code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
// Copyright 2018 Google 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.google.location.suplclient.asn1.supl2.lpp;
// Copyright 2008 Google Inc. All Rights Reserved.
/*
* This class is AUTOMATICALLY GENERATED. Do NOT EDIT.
*/
//
//
import com.google.location.suplclient.asn1.base.Asn1Sequence;
import com.google.location.suplclient.asn1.base.Asn1Tag;
import com.google.location.suplclient.asn1.base.BitStream;
import com.google.location.suplclient.asn1.base.BitStreamReader;
import com.google.location.suplclient.asn1.base.SequenceComponent;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import javax.annotation.Nullable;
/**
*
*/
public class GNSS_RealTimeIntegrityReq extends Asn1Sequence {
//
private static final Asn1Tag TAG_GNSS_RealTimeIntegrityReq
= Asn1Tag.fromClassAndNumber(-1, -1);
public GNSS_RealTimeIntegrityReq() {
super();
}
@Override
@Nullable
protected Asn1Tag getTag() {
return TAG_GNSS_RealTimeIntegrityReq;
}
@Override
protected boolean isTagImplicit() {
return true;
}
public static Collection<Asn1Tag> getPossibleFirstTags() {
if (TAG_GNSS_RealTimeIntegrityReq != null) {
return ImmutableList.of(TAG_GNSS_RealTimeIntegrityReq);
} else {
return Asn1Sequence.getPossibleFirstTags();
}
}
/**
* Creates a new GNSS_RealTimeIntegrityReq from encoded stream.
*/
public static GNSS_RealTimeIntegrityReq fromPerUnaligned(byte[] encodedBytes) {
GNSS_RealTimeIntegrityReq result = new GNSS_RealTimeIntegrityReq();
result.decodePerUnaligned(new BitStreamReader(encodedBytes));
return result;
}
/**
* Creates a new GNSS_RealTimeIntegrityReq from encoded stream.
*/
public static GNSS_RealTimeIntegrityReq fromPerAligned(byte[] encodedBytes) {
GNSS_RealTimeIntegrityReq result = new GNSS_RealTimeIntegrityReq();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
}
@Override protected boolean isExtensible() {
return true;
}
@Override public boolean containsExtensionValues() {
for (SequenceComponent extensionComponent : getExtensionComponents()) {
if (extensionComponent.isExplicitlySet()) return true;
}
return false;
}
@Override public Iterable<? extends SequenceComponent> getComponents() {
ImmutableList.Builder<SequenceComponent> builder = ImmutableList.builder();
return builder.build();
}
@Override public Iterable<? extends SequenceComponent>
getExtensionComponents() {
ImmutableList.Builder<SequenceComponent> builder = ImmutableList.builder();
return builder.build();
}
@Override public Iterable<BitStream> encodePerUnaligned() {
return super.encodePerUnaligned();
}
@Override public Iterable<BitStream> encodePerAligned() {
return super.encodePerAligned();
}
@Override public void decodePerUnaligned(BitStreamReader reader) {
super.decodePerUnaligned(reader);
}
@Override public void decodePerAligned(BitStreamReader reader) {
super.decodePerAligned(reader);
}
@Override public String toString() {
return toIndentedString("");
}
public String toIndentedString(String indent) {
StringBuilder builder = new StringBuilder();
builder.append("GNSS_RealTimeIntegrityReq = {\n");
final String internalIndent = indent + " ";
for (SequenceComponent component : getComponents()) {
if (component.isExplicitlySet()) {
builder.append(internalIndent)
.append(component.toIndentedString(internalIndent));
}
}
if (isExtensible()) {
builder.append(internalIndent).append("...\n");
for (SequenceComponent component : getExtensionComponents()) {
if (component.isExplicitlySet()) {
builder.append(internalIndent)
.append(component.toIndentedString(internalIndent));
}
}
}
builder.append(indent).append("};\n");
return builder.toString();
}
}
| google/supl-client | src/main/java/com/google/location/suplclient/asn1/supl2/lpp/GNSS_RealTimeIntegrityReq.java | Java | apache-2.0 | 4,587 |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package modelo.formularios;
import controlador.dbConnection;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JOptionPane;
/**
*
* @author Eisner López Acevedo <eisner.lopez at gmail.com>
*/
public class Interfaz_Factura {
private final dbConnection myLink = new dbConnection();
private final Connection conexion = dbConnection.getConnection();
private String querySQL = "";
ResultSet rs = null;
PreparedStatement pst = null;
public boolean mostrarFactura(String Buscar) {
String[] registro = new String[8];
querySQL
= "SELECT `factura_cabina`.`factura_id`, "
+ "`factura_cabina`.`cant_dia`, "
+ "`factura_cabina`.`fecha`, "
+ "`factura_cabina`.`impuesto_cabina`, "
+ "`factura_cabina`.`precio_total_cabina`, "
+ "`factura_cabina`.`cabina_cabina_id`, "
+ "`factura_cabina`.`colaborador_empleado_id`, "
+ "`factura_cabina`.`numero_factura`"
+ "FROM `pct3`.`factura_cabina`"
+ "WHERE "
+ "`factura_cabina`.`numero_factura` = '" + Buscar + "'"
+ "order by `factura_cabina`.`numero_factura`;";
try {
Statement st = conexion.createStatement();
rs = st.executeQuery(querySQL);
while (rs.next()) {
registro[0] = rs.getString(1);
registro[1] = rs.getString(2);
registro[2] = rs.getString(3);
registro[3] = rs.getString(4);
registro[4] = rs.getString(5);
registro[5] = rs.getString(6);
registro[6] = rs.getString(7);
registro[7] = rs.getString(8);
}
} catch (SQLException sqle) {
JOptionPane.showConfirmDialog(null, sqle);
}
return false;
}
}
| eisnerh/PCT_315 | TropiCabinas/src/modelo/formularios/Interfaz_Factura.java | Java | apache-2.0 | 2,200 |
// ***************************************************************************
// * Copyright 2014 Joseph Molnar
// *
// * 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.talvish.tales.samples.userclient;
import java.time.LocalDate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.talvish.tales.businessobjects.ObjectId;
import com.talvish.tales.client.http.ResourceClient;
import com.talvish.tales.client.http.ResourceConfiguration;
import com.talvish.tales.client.http.ResourceMethod;
import com.talvish.tales.client.http.ResourceResult;
import com.talvish.tales.communication.HttpVerb;
import com.talvish.tales.parts.ArgumentParser;
import com.talvish.tales.system.configuration.ConfigurationManager;
import com.talvish.tales.system.configuration.MapSource;
import com.talvish.tales.system.configuration.PropertyFileSource;
/**
* The client for talking to the UserService.
* @author jmolnar
*
*/
public class UserClient extends ResourceClient {
private static final Logger logger = LoggerFactory.getLogger( UserClient.class );
/**
* This main is really just to demonstrate calling and would not exist in an actual client.
*/
public static void main( String[ ] theArgs ) throws Exception {
// get the configuration system up and running
ConfigurationManager configurationManager = new ConfigurationManager( );
// we prepare two sources for configurations
// first the command line source
configurationManager.addSource( new MapSource( "command-line", ArgumentParser.parse( theArgs ) ) );
// second the file source, if the command-line indicates a file is to be used
String filename = configurationManager.getStringValue( "settings.file", null ); // we will store config in a file ideally
if( !Strings.isNullOrEmpty( filename ) ) {
configurationManager.addSource( new PropertyFileSource( filename ) );
}
UserClient client = new UserClient( configurationManager.getValues( "user_service", ResourceConfiguration.class ), "sample_user_client/1.0" );
// client.setHeaderOverride( "Authorization", "random" ); //<= for testing, perhaps want to override this value, assuming server allows overrides
// next we see what mode we are in, setup or not setup
String operation = configurationManager.getStringValue( "operation", "update_user" );
ResourceResult<User> result;
switch( operation ) {
case "update_user":
result = client.getUser( new ObjectId( 1, 1, 100 ) );
if( result.getResult() != null ) {
logger.debug( "Found user: '{}'/'{}'", result.getResult().getId(), result.getResult().getFirstName( ) );
result.getResult().setFirstName( "Bilbo" );
result.getResult().getAliases( ).add( "billy" );
result.getResult().getSettings().put( "favourite_category", "games" );
result = client.updateUser( result.getResult() );
logger.debug( "Updated user: '{}'", result.getResult().getFirstName( ) );
} else {
logger.debug( "Did not find user." );
}
break;
case "create_user":
//for( int i = 0; i < 1; i += 1 ) {
User user = new User( );
user.setFirstName( "Jimmy" );
user.setMiddleName( "Scott" );
user.setLastName( "McWhalter" );
user.setBirthdate( LocalDate.of( 1992, 1, 31 ) );
user.getAliases().add( "alias1" );
result = client.createUser( user );
if( result.getResult() != null ) {
logger.debug( "Created user: '{}'/'{}'", result.getResult().getId(), result.getResult().getFirstName( ) );
} else {
logger.debug( "Did not create user." );
}
//}
break;
default:
break;
}
// TODO: this doesn't exit at the end of the main here, need to understand why
// (which is why I added the System.exit(0)
// TODO: one time when this ran it throw some form of SSL EOF related error that
// I need to track down (this happened on the server too)
System.console().writer().print( "Please <Enter> to quit ..." );
System.console().writer().flush();
System.console().readLine();
System.exit( 0 );
}
private String authToken = "Sample key=\"42349840984\"";
/**
* The constructor used to create the client.
* @param theConfiguration the configuration needed to talk to the service
* @param theUserAgent the user agent to use while talking to the service
*/
public UserClient( ResourceConfiguration theConfiguration, String theUserAgent ) {
super( theConfiguration, "/user", "20140124", theUserAgent );
// we now define the methods that we are going to expose for calling
this.methods = new ResourceMethod[ 3 ];
this.methods[ 0 ] = this.defineMethod( "get_user", User.class, HttpVerb.GET, "users/{id}" )
.definePathParameter("id", ObjectId.class )
.defineHeaderParameter( "Authorization", String.class );
this.methods[ 1 ] = this.defineMethod( "update_user", User.class, HttpVerb.POST, "users/{id}/update" )
.definePathParameter( "id", ObjectId.class )
.defineBodyParameter( "user", User.class )
.defineHeaderParameter( "Authorization", String.class );
this.methods[ 2 ] = this.defineMethod( "create_user", User.class, HttpVerb.POST, "users/create" )
.defineBodyParameter( "user", User.class )
.defineHeaderParameter( "Authorization", String.class );
}
/**
* Requests a particular user.
* @param theUserId the id of the user being requested
* @return the requested user, if found, null otherwise
* @throws InterruptedException thrown if the calling thread is interrupted
*/
public ResourceResult<User> getUser( ObjectId theUserId ) throws InterruptedException {
Preconditions.checkNotNull( theUserId, "need a user id to retrieve a user" );
return this.createRequest( this.methods[ 0 ], theUserId )
.setHeaderParameter( "Authorization", this.authToken )
.call();
}
/**
* A call to save the values of a user on the server.
* @param theUser the user to save
* @return the server returned version of the saved user
* @throws InterruptedException thrown if the calling thread is interrupted
*/
public ResourceResult<User> updateUser( User theUser ) throws InterruptedException {
Preconditions.checkNotNull( theUser, "need a user to be able to update" );
return this.createRequest( this.methods[ 1 ], theUser.getId() )
.setBodyParameter( "user", theUser )
.setHeaderParameter( "Authorization", this.authToken )
.call();
}
/**
* A call to create a new user
* @param theFirstName the first name of the user
* @param theLastName the last name of the user
* @return the freshly created user
* @throws InterruptedException thrown if the calling thread is interrupted
*/
public ResourceResult<User> createUser( User theUser) throws InterruptedException {
Preconditions.checkNotNull( theUser, "need a user" );
Preconditions.checkArgument( theUser.getId( ) == null, "user's id must be null" );
Preconditions.checkArgument( !Strings.isNullOrEmpty( theUser.getFirstName() ), "to create a user you need a first name" );
return this.createRequest( this.methods[ 2 ] )
.setBodyParameter( "user", theUser )
.setHeaderParameter( "Authorization", this.authToken )
.call();
}
} | Talvish/Tales-Samples | user_client/src/main/java/com/talvish/tales/samples/userclient/UserClient.java | Java | apache-2.0 | 7,943 |
# Makefile for Tutorials
#
SHELL := /bin/bash
# You can set these variables from the command line.
TUTORIAL_OUTPUT_DIR = build
ALLENNLP_WEBSITE_DIR = ../allennlp-website
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " build to clean and build all the tutorials"
@echo " clean to wipe out the build directory"
@echo " getting-started to build the getting-started tutorials"
@echo " notebooks to build the jupyter notebook tutorials"
.PHONY: clean
clean:
@echo "Cleaning out the build directory"
@rm -rf $(TUTORIAL_OUTPUT_DIR)
.PHONY: getting-started
getting-started:
@echo "Building the getting-started tutorials"
@mkdir -p $(TUTORIAL_OUTPUT_DIR)
@cp -r getting_started/*.md $(TUTORIAL_OUTPUT_DIR)/
.PHONY: notebooks
notebooks:
@echo "Building the jupyter notebooks tutorials"
@mkdir -p $(TUTORIAL_OUTPUT_DIR)
@for file in notebooks/*.ipynb; do jupyter nbconvert --to markdown "$$file" --output-dir $(TUTORIAL_OUTPUT_DIR); done
.PHONY: hyphenate
hyphenate:
@echo "Hyphenating"
@for f in build/*.md; do if [[ $$f == *"_"* ]]; then mv "$$f" "$${f//_/-}"; fi; done
.PHONY: copy
copy:
@echo "Copying from $(TUTORIAL_OUTPUT_DIR) to $(ALLENNLP_WEBSITE_DIR)"
@cp -r $(TUTORIAL_OUTPUT_DIR) $(ALLENNLP_WEBSITE_DIR)/tutorials
.PHONY: build
build:
@make clean
@make getting-started
@make notebooks
@make hyphenate
@echo "Build finished. The md pages are in $(TUTORIAL_OUTPUT_DIR)."
| nafitzgerald/allennlp | tutorials/Makefile | Makefile | apache-2.0 | 1,478 |
#! /bin/bash
# Runs the linters against dendrite
# The linters can take a lot of resources and are slow, so they can be
# configured using two environment variables:
#
# - `DENDRITE_LINT_CONCURRENCY` - number of concurrent linters to run,
# gometalinter defaults this to 8
# - `DENDRITE_LINT_DISABLE_GC` - if set then the the go gc will be disabled
# when running the linters, speeding them up but using much more memory.
set -eux
cd `dirname $0`/..
export GOPATH="$(pwd):$(pwd)/vendor"
# prefer the versions of gometalinter and the linters that we install
# to anythign that ends up on the PATH.
export PATH="$(pwd)/bin:$PATH"
args=""
if [ ${1:-""} = "fast" ]
then args="--config=linter-fast.json"
else args="--config=linter.json"
fi
if [ -n "${DENDRITE_LINT_CONCURRENCY:-}" ]
then args="$args --concurrency=$DENDRITE_LINT_CONCURRENCY"
fi
if [ -z "${DENDRITE_LINT_DISABLE_GC:-}" ]
then args="$args --enable-gc"
fi
echo "Installing lint search engine..."
gb build github.com/alecthomas/gometalinter/
gometalinter --config=linter.json ./... --install
echo "Looking for lint..."
gometalinter ./... $args
echo "Double checking spelling..."
misspell -error src *.md
| gperdomor/dendrite | scripts/find-lint.sh | Shell | apache-2.0 | 1,179 |
package com.ihtsdo.snomed.model.xml;
import java.sql.Date;
import javax.xml.bind.annotation.XmlRootElement;
import com.google.common.base.Objects;
import com.google.common.primitives.Longs;
import com.ihtsdo.snomed.dto.refset.RefsetDto;
import com.ihtsdo.snomed.model.refset.Refset;
@XmlRootElement(name="refset")
public class RefsetDtoShort {
private long id;
private XmlRefsetConcept concept;
private String publicId;
private String title;
private String description;
private Date created;
private Date lastModified;
private int memberSize;
private String snomedExtension;
private String snomedReleaseDate;
private boolean pendingChanges;
public RefsetDtoShort(Refset r){
setId(r.getId());
setConcept(new XmlRefsetConcept(r.getRefsetConcept()));
setPublicId(r.getPublicId());
setTitle(r.getTitle());
setDescription(r.getDescription());
setCreated(r.getCreationTime());
setLastModified(r.getModificationTime());
setPendingChanges(r.isPendingChanges());
setMemberSize(r.getMemberSize());
setSnomedExtension(r.getOntologyVersion().getFlavour().getPublicId());
setSnomedReleaseDate(RefsetDto.dateFormat.format(r.getOntologyVersion().getTaggedOn()));
}
public RefsetDtoShort(){}
@Override
public String toString() {
return Objects.toStringHelper(this)
.add("id", getId())
.add("concept", getConcept())
.add("publicId", getPublicId())
.add("title", getTitle())
.add("description", getDescription())
.add("created", getCreated())
.add("lastModified", getLastModified())
.add("pendingChanges", isPendingChanges())
.add("memberSize", getMemberSize())
.add("snomedExtension", getSnomedExtension())
.add("snomedReleaseDate", getSnomedReleaseDate())
.toString();
}
@Override
public int hashCode(){
return Longs.hashCode(getId());
}
@Override
public boolean equals(Object o){
if (o instanceof RefsetDtoShort){
RefsetDtoShort r = (RefsetDtoShort) o;
if (r.getId() == this.getId()){
return true;
}
}
return false;
}
public boolean isPendingChanges() {
return pendingChanges;
}
public void setPendingChanges(boolean pendingChanges) {
this.pendingChanges = pendingChanges;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public XmlRefsetConcept getConcept() {
return concept;
}
public void setConcept(XmlRefsetConcept concept) {
this.concept = concept;
}
public String getPublicId() {
return publicId;
}
public void setPublicId(String publicId) {
this.publicId = publicId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getLastModified() {
return lastModified;
}
public void setLastModified(Date lastModified) {
this.lastModified = lastModified;
}
public int getMemberSize() {
return memberSize;
}
public void setMemberSize(int memberSize) {
this.memberSize = memberSize;
}
public String getSnomedExtension() {
return snomedExtension;
}
public void setSnomedExtension(String snomedExtension) {
this.snomedExtension = snomedExtension;
}
public String getSnomedReleaseDate() {
return snomedReleaseDate;
}
public void setSnomedReleaseDate(String snomedReleaseDate) {
this.snomedReleaseDate = snomedReleaseDate;
}
public static RefsetDtoShort parse(Refset r){
return getBuilder(new XmlRefsetConcept(r.getRefsetConcept()),
r.getPublicId(),
r.getTitle(),
r.getDescription(),
r.getCreationTime(),
r.getModificationTime(),
r.isPendingChanges(),
r.getMemberSize(),
r.getOntologyVersion().getFlavour().getPublicId(),
r.getOntologyVersion().getTaggedOn()).build();
}
public static Builder getBuilder(XmlRefsetConcept concept, String publicId, String title,
String description, Date created, Date lastModified, boolean pendingChanges, int memberSize,
String snomedExtension, Date snomedReleaseDate) {
return new Builder(concept, publicId, title, description, created, lastModified, pendingChanges,
memberSize, snomedExtension, snomedReleaseDate);
}
public static class Builder {
private RefsetDtoShort built;
Builder(XmlRefsetConcept concept, String publicId, String title, String description,
Date created, Date lastModified, boolean pendingChanges, int memberSize,
String snomedExtension, Date snomedReleaseDate){
built = new RefsetDtoShort();
built.concept = concept;
built.publicId = publicId;
built.title = title;
built.description = description;
built.created = created;
built.lastModified = lastModified;
built.pendingChanges = pendingChanges;
built.memberSize = memberSize;
built.setSnomedExtension(snomedExtension);
built.setSnomedReleaseDate(RefsetDto.dateFormat.format(snomedReleaseDate));
}
public RefsetDtoShort build() {
return built;
}
}
}
| IHTSDO/snomed-publish | model/src/main/java/com/ihtsdo/snomed/model/xml/RefsetDtoShort.java | Java | apache-2.0 | 6,129 |
/*
* %CopyrightBegin%
*
* Copyright Ericsson AB 1998-2016. 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.
*
* %CopyrightEnd%
*/
#ifndef _DB_UTIL_H
#define _DB_UTIL_H
#include "global.h"
#include "erl_message.h"
/*#define HARDDEBUG 1*/
#ifdef DEBUG
/*
** DMC_DEBUG does NOT need DEBUG, but DEBUG needs DMC_DEBUG
*/
#define DMC_DEBUG 1
#endif
/*
* These values can be returned from the functions performing the
* BIF operation for different types of tables. When the
* actual operations have been performed, the BIF function
* checks for negative returns and issues BIF_ERRORS based
* upon these values.
*/
#define DB_ERROR_NONE 0 /* No error */
#define DB_ERROR_BADITEM -1 /* The item was malformed ie no
tuple or to small*/
#define DB_ERROR_BADTABLE -2 /* The Table is inconsisitent */
#define DB_ERROR_SYSRES -3 /* Out of system resources */
#define DB_ERROR_BADKEY -4 /* Returned if a key that should
exist does not. */
#define DB_ERROR_BADPARAM -5 /* Returned if a specified slot does
not exist (hash table only) or
the state parameter in db_match_object
is broken.*/
#define DB_ERROR_UNSPEC -10 /* Unspecified error */
/*#define DEBUG_CLONE*/
/*
* A datatype for a database entry stored out of a process heap
*/
typedef struct db_term {
struct erl_off_heap_header* first_oh; /* Off heap data for term. */
Uint size; /* Heap size of term in "words" */
#ifdef DEBUG_CLONE
Eterm* debug_clone; /* An uncompressed copy */
#endif
Eterm tpl[1]; /* Term data. Top tuple always first */
/* Compression: is_immed and key element are uncompressed.
Compressed elements are stored in external format after each other
last in dbterm. The top tuple elements contains byte offsets, to
the start of the data, tagged as headers.
The allocated size of the dbterm in bytes is stored at tpl[arity+1].
*/
} DbTerm;
union db_table;
typedef union db_table DbTable;
#define DB_MUST_RESIZE 1
#define DB_NEW_OBJECT 2
/* Info about a database entry while it's being updated
* (by update_counter or update_element)
*/
typedef struct {
DbTable* tb;
DbTerm* dbterm;
void** bp; /* {Hash|Tree}DbTerm** */
Uint new_size;
int flags;
void* lck;
} DbUpdateHandle;
typedef struct db_table_method
{
int (*db_create)(Process *p, DbTable* tb);
int (*db_first)(Process* p,
DbTable* tb, /* [in out] */
Eterm* ret /* [out] */);
int (*db_next)(Process* p,
DbTable* tb, /* [in out] */
Eterm key, /* [in] */
Eterm* ret /* [out] */);
int (*db_last)(Process* p,
DbTable* tb, /* [in out] */
Eterm* ret /* [out] */);
int (*db_prev)(Process* p,
DbTable* tb, /* [in out] */
Eterm key,
Eterm* ret);
int (*db_put)(DbTable* tb, /* [in out] */
Eterm obj,
int key_clash_fail); /* DB_ERROR_BADKEY if key exists */
int (*db_get)(Process* p,
DbTable* tb, /* [in out] */
Eterm key,
Eterm* ret);
int (*db_get_element)(Process* p,
DbTable* tb, /* [in out] */
Eterm key,
int index,
Eterm* ret);
int (*db_member)(DbTable* tb, /* [in out] */
Eterm key,
Eterm* ret);
int (*db_erase)(DbTable* tb, /* [in out] */
Eterm key,
Eterm* ret);
int (*db_erase_object)(DbTable* tb, /* [in out] */
Eterm obj,
Eterm* ret);
int (*db_slot)(Process* p,
DbTable* tb, /* [in out] */
Eterm slot,
Eterm* ret);
int (*db_select_chunk)(Process* p,
DbTable* tb, /* [in out] */
Eterm pattern,
Sint chunk_size,
int reverse,
Eterm* ret);
int (*db_select)(Process* p,
DbTable* tb, /* [in out] */
Eterm pattern,
int reverse,
Eterm* ret);
int (*db_select_delete)(Process* p,
DbTable* tb, /* [in out] */
Eterm pattern,
Eterm* ret);
int (*db_select_continue)(Process* p,
DbTable* tb, /* [in out] */
Eterm continuation,
Eterm* ret);
int (*db_select_delete_continue)(Process* p,
DbTable* tb, /* [in out] */
Eterm continuation,
Eterm* ret);
int (*db_select_count)(Process* p,
DbTable* tb, /* [in out] */
Eterm pattern,
Eterm* ret);
int (*db_select_count_continue)(Process* p,
DbTable* tb, /* [in out] */
Eterm continuation,
Eterm* ret);
int (*db_take)(Process *, DbTable *, Eterm, Eterm *);
int (*db_delete_all_objects)(Process* p,
DbTable* db /* [in out] */ );
int (*db_free_table)(DbTable* db /* [in out] */ );
int (*db_free_table_continue)(DbTable* db); /* [in out] */
void (*db_print)(int to,
void* to_arg,
int show,
DbTable* tb /* [in out] */ );
void (*db_foreach_offheap)(DbTable* db, /* [in out] */
void (*func)(ErlOffHeap *, void *),
void *arg);
void (*db_check_table)(DbTable* tb);
/* Lookup a dbterm for updating. Return false if not found. */
int (*db_lookup_dbterm)(Process *, DbTable *, Eterm key, Eterm obj,
DbUpdateHandle* handle);
/* Must be called for each db_lookup_dbterm that returned true, even if
** dbterm was not updated. If the handle was of a new object and cret is
** not DB_ERROR_NONE, the object is removed from the table. */
void (*db_finalize_dbterm)(int cret, DbUpdateHandle* handle);
} DbTableMethod;
typedef struct db_fixation {
Eterm pid;
Uint counter;
struct db_fixation *next;
} DbFixation;
/*
* This structure contains data for all different types of database
* tables. Note that these fields must match the same fields
* in the table-type specific structures.
* The reason it is placed here and not in db.h is that some table
* operations may be the same on different types of tables.
*/
typedef struct db_table_common {
erts_refc_t ref; /* fixation counter */
#ifdef ERTS_SMP
erts_smp_rwmtx_t rwlock; /* rw lock on table */
erts_smp_mtx_t fixlock; /* Protects fixations,megasec,sec,microsec */
int is_thread_safe; /* No fine locking inside table needed */
Uint32 type; /* table type, *read only* after creation */
#endif
Eterm owner; /* Pid of the creator */
Eterm heir; /* Pid of the heir */
UWord heir_data; /* To send in ETS-TRANSFER (is_immed or (DbTerm*) */
Uint64 heir_started_interval; /* To further identify the heir */
Eterm the_name; /* an atom */
Eterm id; /* atom | integer */
DbTableMethod* meth; /* table methods */
erts_smp_atomic_t nitems; /* Total number of items in table */
erts_smp_atomic_t memory_size;/* Total memory size. NOTE: in bytes! */
struct { /* Last fixation time */
ErtsMonotonicTime monotonic;
ErtsMonotonicTime offset;
} time;
DbFixation* fixations; /* List of processes who have done safe_fixtable,
"local" fixations not included. */
/* All 32-bit fields */
Uint32 status; /* bit masks defined below */
int slot; /* slot index in meta_main_tab */
int keypos; /* defaults to 1 */
int compress;
} DbTableCommon;
/* These are status bit patterns */
#define DB_NORMAL (1 << 0)
#define DB_PRIVATE (1 << 1)
#define DB_PROTECTED (1 << 2)
#define DB_PUBLIC (1 << 3)
#define DB_BAG (1 << 4)
#define DB_SET (1 << 5)
/*#define DB_LHASH (1 << 6)*/
#define DB_FINE_LOCKED (1 << 7) /* fine grained locking enabled */
#define DB_DUPLICATE_BAG (1 << 8)
#define DB_ORDERED_SET (1 << 9)
#define DB_DELETE (1 << 10) /* table is being deleted */
#define DB_FREQ_READ (1 << 11)
#define ERTS_ETS_TABLE_TYPES (DB_BAG|DB_SET|DB_DUPLICATE_BAG|DB_ORDERED_SET|DB_FINE_LOCKED|DB_FREQ_READ)
#define IS_HASH_TABLE(Status) (!!((Status) & \
(DB_BAG | DB_SET | DB_DUPLICATE_BAG)))
#define IS_TREE_TABLE(Status) (!!((Status) & \
DB_ORDERED_SET))
#define NFIXED(T) (erts_refc_read(&(T)->common.ref,0))
#define IS_FIXED(T) (NFIXED(T) != 0)
/*
* tplp is an untagged pointer to a tuple we know is large enough
* and dth is a pointer to a DbTableHash.
*/
#define GETKEY(dth, tplp) (*((tplp) + ((DbTableCommon*)(dth))->keypos))
ERTS_GLB_INLINE Eterm db_copy_key(Process* p, DbTable* tb, DbTerm* obj);
Eterm db_copy_from_comp(DbTableCommon* tb, DbTerm* bp, Eterm** hpp,
ErlOffHeap* off_heap);
int db_eq_comp(DbTableCommon* tb, Eterm a, DbTerm* b);
DbTerm* db_alloc_tmp_uncompressed(DbTableCommon* tb, DbTerm* org);
ERTS_GLB_INLINE Eterm db_copy_object_from_ets(DbTableCommon* tb, DbTerm* bp,
Eterm** hpp, ErlOffHeap* off_heap);
ERTS_GLB_INLINE int db_eq(DbTableCommon* tb, Eterm a, DbTerm* b);
Wterm db_do_read_element(DbUpdateHandle* handle, Sint position);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
ERTS_GLB_INLINE Eterm db_copy_key(Process* p, DbTable* tb, DbTerm* obj)
{
Eterm key = GETKEY(tb, obj->tpl);
if IS_CONST(key) return key;
else {
Uint size = size_object(key);
Eterm* hp = HAlloc(p, size);
Eterm res = copy_struct(key, size, &hp, &MSO(p));
ASSERT(EQ(res,key));
return res;
}
}
ERTS_GLB_INLINE Eterm db_copy_object_from_ets(DbTableCommon* tb, DbTerm* bp,
Eterm** hpp, ErlOffHeap* off_heap)
{
if (tb->compress) {
return db_copy_from_comp(tb, bp, hpp, off_heap);
}
else {
return copy_shallow(bp->tpl, bp->size, hpp, off_heap);
}
}
ERTS_GLB_INLINE int db_eq(DbTableCommon* tb, Eterm a, DbTerm* b)
{
if (!tb->compress) {
return EQ(a, make_tuple(b->tpl));
}
else {
return db_eq_comp(tb, a, b);
}
}
#endif /* ERTS_GLB_INLINE_INCL_FUNC_DEF */
#define DB_READ (DB_PROTECTED|DB_PUBLIC)
#define DB_WRITE DB_PUBLIC
#define DB_INFO (DB_PROTECTED|DB_PUBLIC|DB_PRIVATE)
#define ONLY_WRITER(P,T) (((T)->common.status & (DB_PRIVATE|DB_PROTECTED)) \
&& (T)->common.owner == (P)->common.id)
#define ONLY_READER(P,T) (((T)->common.status & DB_PRIVATE) && \
(T)->common.owner == (P)->common.id)
/* Function prototypes */
BIF_RETTYPE db_get_trace_control_word(Process* p);
BIF_RETTYPE db_set_trace_control_word(Process* p, Eterm tcw);
BIF_RETTYPE db_get_trace_control_word_0(BIF_ALIST_0);
BIF_RETTYPE db_set_trace_control_word_1(BIF_ALIST_1);
void db_initialize_util(void);
Eterm db_getkey(int keypos, Eterm obj);
void db_cleanup_offheap_comp(DbTerm* p);
void db_free_term(DbTable *tb, void* basep, Uint offset);
void* db_store_term(DbTableCommon *tb, DbTerm* old, Uint offset, Eterm obj);
void* db_store_term_comp(DbTableCommon *tb, DbTerm* old, Uint offset, Eterm obj);
Eterm db_copy_element_from_ets(DbTableCommon* tb, Process* p, DbTerm* obj,
Uint pos, Eterm** hpp, Uint extra);
int db_has_map(Eterm obj);
int db_has_variable(Eterm obj);
int db_is_variable(Eterm obj);
void db_do_update_element(DbUpdateHandle* handle,
Sint position,
Eterm newval);
void db_finalize_resize(DbUpdateHandle* handle, Uint offset);
Eterm db_add_counter(Eterm** hpp, Wterm counter, Eterm incr);
Eterm db_match_set_lint(Process *p, Eterm matchexpr, Uint flags);
Binary *db_match_set_compile(Process *p, Eterm matchexpr,
Uint flags);
void erts_db_match_prog_destructor(Binary *);
typedef struct match_prog {
ErlHeapFragment *term_save; /* Only if needed, a list of message
buffers for off heap copies
(i.e. binaries)*/
int single_variable; /* ets:match needs to know this. */
int num_bindings; /* Size of heap */
/* The following two are only filled in when match specs
are used for tracing */
struct erl_heap_fragment *saved_program_buf;
Eterm saved_program;
Uint heap_size; /* size of: heap + eheap + stack */
Uint stack_offset;
#ifdef DMC_DEBUG
UWord* prog_end; /* End of program */
#endif
UWord text[1]; /* Beginning of program */
} MatchProg;
/*
* The heap-eheap-stack block of a MatchProg is nowadays allocated
* when the match program is run.
* - heap: variable bindings
* - eheap: erlang heap storage
* - eheap: a "large enough" stack
*/
#define DMC_ERR_STR_LEN 100
typedef enum { dmcWarning, dmcError} DMCErrorSeverity;
typedef struct dmc_error {
char error_string[DMC_ERR_STR_LEN + 1]; /* printf format string
with %d for the variable
number (if applicable) */
int variable; /* -1 if no variable is referenced
in error string */
struct dmc_error *next;
DMCErrorSeverity severity; /* Error or warning */
} DMCError;
typedef struct dmc_err_info {
unsigned int *var_trans; /* Translations of variable names,
initiated to NULL
and free'd with sys_free if != NULL
after compilation */
int num_trans;
int error_added; /* indicates if the error list contains
any fatal errors (dmcError severity) */
DMCError *first; /* List of errors */
} DMCErrInfo;
/*
** Compilation flags
**
** The dialect is in the 3 least significant bits and are to be interspaced by
** by at least 2 (decimal), thats why ((Uint) 2) isn't used. This is to be
** able to add DBIF_GUARD or DBIF BODY to it to use in the match_spec bif
** table. The rest of the word is used like ordinary flags, one bit for each
** flag. Note that DCOMP_TABLE and DCOMP_TRACE are mutually exclusive.
*/
#define DCOMP_TABLE ((Uint) 1) /* Ets and dets. The body returns a value,
* and the parameter to the execution is a tuple. */
#define DCOMP_TRACE ((Uint) 4) /* Trace. More functions are allowed, and the
* parameter to the execution will be an array. */
#define DCOMP_DIALECT_MASK ((Uint) 0x7) /* To mask out the bits marking
dialect */
#define DCOMP_FAKE_DESTRUCTIVE ((Uint) 8) /* When this is active, no setting of
trace control words or seq_trace tokens will be done. */
/* Allow lock seizing operations on the tracee and 3rd party processes */
#define DCOMP_ALLOW_TRACE_OPS ((Uint) 0x10)
/* This is call trace */
#define DCOMP_CALL_TRACE ((Uint) 0x20)
Binary *db_match_compile(Eterm *matchexpr, Eterm *guards,
Eterm *body, int num_matches,
Uint flags,
DMCErrInfo *err_info);
/* Returns newly allocated MatchProg binary with refc == 0*/
Eterm db_match_dbterm(DbTableCommon* tb, Process* c_p, Binary* bprog,
int all, DbTerm* obj, Eterm** hpp, Uint extra);
Eterm db_prog_match(Process *p, Process *self,
Binary *prog, Eterm term,
Eterm *termp, int arity,
enum erts_pam_run_flags in_flags,
Uint32 *return_flags /* Zeroed on enter */);
/* returns DB_ERROR_NONE if matches, 1 if not matches and some db error on
error. */
DMCErrInfo *db_new_dmc_err_info(void);
/* Returns allocated error info, where errors are collected for lint. */
Eterm db_format_dmc_err_info(Process *p, DMCErrInfo *ei);
/* Formats an error info structure into a list of tuples. */
void db_free_dmc_err_info(DMCErrInfo *ei);
/* Completely free's an error info structure, including all recorded
errors */
Eterm db_make_mp_binary(Process *p, Binary *mp, Eterm **hpp);
/* Convert a match program to a erlang "magic" binary to be returned to userspace,
increments the reference counter. */
int erts_db_is_compiled_ms(Eterm term);
/*
** Convenience when compiling into Binary structures
*/
#define IsMatchProgBinary(BP) \
(((BP)->flags & BIN_FLAG_MAGIC) \
&& ERTS_MAGIC_BIN_DESTRUCTOR((BP)) == erts_db_match_prog_destructor)
#define Binary2MatchProg(BP) \
(ASSERT(IsMatchProgBinary((BP))), \
((MatchProg *) ERTS_MAGIC_BIN_DATA((BP))))
/*
** Debugging
*/
#ifdef HARDDEBUG
void db_check_tables(void); /* in db.c */
#define CHECK_TABLES() db_check_tables()
#else
#define CHECK_TABLES()
#endif
#endif /* _DB_UTIL_H */
| lemenkov/otp | erts/emulator/beam/erl_db_util.h | C | apache-2.0 | 16,474 |
package com.fuyoul.sanwenseller.bean.pickerview;
import java.util.List;
public class ProvinceModel implements IPickerViewData {
private String name;
private List<CityModel> cityList;
@Override
public String getPickerViewText() {
return name;
}
public ProvinceModel() {
super();
}
public ProvinceModel(String name, List<CityModel> cityList) {
super();
this.name = name;
this.cityList = cityList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<CityModel> getCityList() {
return cityList;
}
public void setCityList(List<CityModel> cityList) {
this.cityList = cityList;
}
@Override
public String toString() {
return "ProvinceModel [name=" + name + ", cityList=" + cityList + "]";
}
}
| newbieandroid/AppBase | app/src/main/java/com/fuyoul/sanwenseller/bean/pickerview/ProvinceModel.java | Java | apache-2.0 | 915 |
var nodes = new vis.DataSet([
/* {id: a, label: b, ...}, */
{id: '192', label: 'VALUE\n13.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 13.0<br>Type: CONSTANT_VALUE<br>Id: 192<br>Formula Expression: Formula String: VALUE; Formula Values: 13.0; Formula Ptg: 13.0; Ptgs: VALUE Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '193', label: 'VALUE\n9.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 9.0<br>Type: CONSTANT_VALUE<br>Id: 193<br>Formula Expression: Formula String: VALUE; Formula Values: 9.0; Formula Ptg: 9.0; Ptgs: VALUE Index in Ptgs: 1 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '194', label: 'VALUE\n5.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 5.0<br>Type: CONSTANT_VALUE<br>Id: 194<br>Formula Expression: Formula String: VALUE; Formula Values: 5.0; Formula Ptg: 5.0; Ptgs: VALUE Index in Ptgs: 2 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '195', label: 'VALUE\n7.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 7.0<br>Type: CONSTANT_VALUE<br>Id: 195<br>Formula Expression: Formula String: VALUE; Formula Values: 7.0; Formula Ptg: 7.0; Ptgs: VALUE Index in Ptgs: 3 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '196', label: 'VALUE\n12.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 12.0<br>Type: CONSTANT_VALUE<br>Id: 196<br>Formula Expression: Formula String: VALUE; Formula Values: 12.0; Formula Ptg: 12.0; Ptgs: VALUE Index in Ptgs: 4 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '197', label: 'VALUE\n5.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 5.0<br>Type: CONSTANT_VALUE<br>Id: 197<br>Formula Expression: Formula String: VALUE; Formula Values: 5.0; Formula Ptg: 5.0; Ptgs: VALUE Index in Ptgs: 5 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '198', label: 'VALUE\n46.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 46.0<br>Type: CONSTANT_VALUE<br>Id: 198<br>Formula Expression: Formula String: VALUE; Formula Values: 46.0; Formula Ptg: 46.0; Ptgs: VALUE Index in Ptgs: 6 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '199', label: 'VALUE\n85.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 85.0<br>Type: CONSTANT_VALUE<br>Id: 199<br>Formula Expression: Formula String: VALUE; Formula Values: 85.0; Formula Ptg: 85.0; Ptgs: VALUE Index in Ptgs: 7 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '200', label: 'VALUE\n15.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 15.0<br>Type: CONSTANT_VALUE<br>Id: 200<br>Formula Expression: Formula String: VALUE; Formula Values: 15.0; Formula Ptg: 15.0; Ptgs: VALUE Index in Ptgs: 8 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '201', label: 'VALUE\n159.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 159.0<br>Type: CONSTANT_VALUE<br>Id: 201<br>Formula Expression: Formula String: VALUE; Formula Values: 159.0; Formula Ptg: 159.0; Ptgs: VALUE Index in Ptgs: 9 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '202', label: 'VALUE\n452.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 452.0<br>Type: CONSTANT_VALUE<br>Id: 202<br>Formula Expression: Formula String: VALUE; Formula Values: 452.0; Formula Ptg: 452.0; Ptgs: VALUE Index in Ptgs: 10 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '203', label: 'VALUE\n452.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 452.0<br>Type: CONSTANT_VALUE<br>Id: 203<br>Formula Expression: Formula String: VALUE; Formula Values: 452.0; Formula Ptg: 452.0; Ptgs: VALUE Index in Ptgs: 11 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '204', label: 'VALUE\n365.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 365.0<br>Type: CONSTANT_VALUE<br>Id: 204<br>Formula Expression: Formula String: VALUE; Formula Values: 365.0; Formula Ptg: 365.0; Ptgs: VALUE Index in Ptgs: 12 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '205', label: 'VALUE\n36.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 36.0<br>Type: CONSTANT_VALUE<br>Id: 205<br>Formula Expression: Formula String: VALUE; Formula Values: 36.0; Formula Ptg: 36.0; Ptgs: VALUE Index in Ptgs: 13 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '206', label: 'VALUE\n362.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 362.0<br>Type: CONSTANT_VALUE<br>Id: 206<br>Formula Expression: Formula String: VALUE; Formula Values: 362.0; Formula Ptg: 362.0; Ptgs: VALUE Index in Ptgs: 14 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '207', label: 'VALUE\n23.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 23.0<br>Type: CONSTANT_VALUE<br>Id: 207<br>Formula Expression: Formula String: VALUE; Formula Values: 23.0; Formula Ptg: 23.0; Ptgs: VALUE Index in Ptgs: 15 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '208', label: 'VALUE\n236.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 236.0<br>Type: CONSTANT_VALUE<br>Id: 208<br>Formula Expression: Formula String: VALUE; Formula Values: 236.0; Formula Ptg: 236.0; Ptgs: VALUE Index in Ptgs: 16 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '209', label: 'VALUE\n562.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 562.0<br>Type: CONSTANT_VALUE<br>Id: 209<br>Formula Expression: Formula String: VALUE; Formula Values: 562.0; Formula Ptg: 562.0; Ptgs: VALUE Index in Ptgs: 17 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '210', label: 'VALUE\n45.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 45.0<br>Type: CONSTANT_VALUE<br>Id: 210<br>Formula Expression: Formula String: VALUE; Formula Values: 45.0; Formula Ptg: 45.0; Ptgs: VALUE Index in Ptgs: 18 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '211', label: 'VALUE\n125.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 125.0<br>Type: CONSTANT_VALUE<br>Id: 211<br>Formula Expression: Formula String: VALUE; Formula Values: 125.0; Formula Ptg: 125.0; Ptgs: VALUE Index in Ptgs: 19 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '212', label: 'VALUE\n23.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: null<br>Value: 23.0<br>Type: CONSTANT_VALUE<br>Id: 212<br>Formula Expression: Formula String: VALUE; Formula Values: 23.0; Formula Ptg: 23.0; Ptgs: VALUE Index in Ptgs: 20 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '213', label: 'CHOOSE\n36.0', color: '#f0ad4e', title: 'Name: CHOOSE<br>Alias: null<br>Value: 36.0<br>Type: FUNCTION<br>Id: 213<br>Formula Expression: Formula String: CHOOSE(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); Formula Values: CHOOSE(23.0, 125.0, 45.0, 562.0, 236.0, 23.0, 362.0, 36.0, 365.0, 452.0, 452.0, 159.0, 15.0, 85.0, 46.0, 5.0, 12.0, 7.0, 5.0, 9.0, 13.0); Formula Ptg: ; Ptgs: Index in Ptgs: 21 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'},
{id: '191', label: 'B2\n36.0', color: '#31b0d5', title: 'Name: B2<br>Alias: null<br>Value: 36.0<br>Type: CELL_WITH_FORMULA<br>Id: 191<br>Formula Expression: Formula String: CHOOSE(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE); Formula Values: CHOOSE(23.0, 125.0, 45.0, 562.0, 236.0, 23.0, 362.0, 36.0, 365.0, 452.0, 452.0, 159.0, 15.0, 85.0, 46.0, 5.0, 12.0, 7.0, 5.0, 9.0, 13.0); Formula Ptg: ; Ptgs: Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@301eda63'}
]);
var edges = new vis.DataSet([
/* {from: id_a, to: id_b}, */
{from: '212', to: '213'},
{from: '211', to: '213'},
{from: '210', to: '213'},
{from: '209', to: '213'},
{from: '208', to: '213'},
{from: '207', to: '213'},
{from: '206', to: '213'},
{from: '205', to: '213'},
{from: '204', to: '213'},
{from: '203', to: '213'},
{from: '213', to: '191'},
{from: '202', to: '213'},
{from: '201', to: '213'},
{from: '200', to: '213'},
{from: '199', to: '213'},
{from: '198', to: '213'},
{from: '197', to: '213'},
{from: '196', to: '213'},
{from: '195', to: '213'},
{from: '194', to: '213'},
{from: '193', to: '213'},
{from: '192', to: '213'}
]); | DataArt/CalculationEngine | calculation-engine/engine-tests/engine-it-graph/src/test/resources/standard_data_js_files/data_CHOOSE_Fx_cells_B2.js | JavaScript | apache-2.0 | 9,297 |
<!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_03) on Mon Nov 19 21:41:27 CET 2007 -->
<TITLE>
Uses of Class org.springframework.core.type.filter.AnnotationTypeFilter (Spring Framework API 2.5)
</TITLE>
<META NAME="date" CONTENT="2007-11-19">
<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="Uses of Class org.springframework.core.type.filter.AnnotationTypeFilter (Spring Framework API 2.5)";
}
}
</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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/springframework/core/type/filter/AnnotationTypeFilter.html" title="class in org.springframework.core.type.filter"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<a href="http://www.springframework.org/" target="_top">The Spring Framework</a></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/springframework/core/type/filter/\class-useAnnotationTypeFilter.html" target="_top"><B>FRAMES</B></A>
<A HREF="AnnotationTypeFilter.html" target="_top"><B>NO FRAMES</B></A>
<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>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.springframework.core.type.filter.AnnotationTypeFilter</B></H2>
</CENTER>
No usage of org.springframework.core.type.filter.AnnotationTypeFilter
<P>
<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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/springframework/core/type/filter/AnnotationTypeFilter.html" title="class in org.springframework.core.type.filter"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<a href="http://www.springframework.org/" target="_top">The Spring Framework</a></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/springframework/core/type/filter/\class-useAnnotationTypeFilter.html" target="_top"><B>FRAMES</B></A>
<A HREF="AnnotationTypeFilter.html" target="_top"><B>NO FRAMES</B></A>
<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>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright © 2002-2007 <a href=http://www.springframework.org/ target=_top>The Spring Framework</a>.</i>
</BODY>
</HTML>
| mattxia/spring-2.5-analysis | docs/api/org/springframework/core/type/filter/class-use/AnnotationTypeFilter.html | HTML | apache-2.0 | 6,470 |
/*
* Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.hawkular.metrics.api.jaxrs.handler;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.MediaType.APPLICATION_XHTML_XML;
import static javax.ws.rs.core.MediaType.TEXT_HTML;
import com.wordnik.swagger.annotations.ApiOperation;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* @author mwringe
*/
@Path("/")
public class BaseHandler {
public static final String PATH = "/";
@GET
@Produces(APPLICATION_JSON)
@ApiOperation(value = "Returns some basic information about the Hawkular Metrics service.",
response = String.class, responseContainer = "Map")
public Response baseJSON(@Context ServletContext context) {
String version = context.getInitParameter("hawkular.metrics.version");
if (version == null) {
version = "undefined";
}
HawkularMetricsBase hawkularMetrics = new HawkularMetricsBase();
hawkularMetrics.version = version;
return Response.ok(hawkularMetrics).build();
}
@GET
@Produces({APPLICATION_XHTML_XML, TEXT_HTML})
public void baseHTML(@Context ServletContext context) throws Exception {
HttpServletRequest request = ResteasyProviderFactory.getContextData(HttpServletRequest.class);
HttpServletResponse response = ResteasyProviderFactory.getContextData(HttpServletResponse.class);
request.getRequestDispatcher("/static/index.html").forward(request,response);
}
private class HawkularMetricsBase {
String name = "Hawkular-Metrics";
String version;
public String getName() {
return name;
}
public void setVersion(String version) {
this.version = version;
}
public String getVersion() {
return version;
}
}
} | 140293816/Hawkular-fork | api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/handler/BaseHandler.java | Java | apache-2.0 | 2,802 |
/*
* 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.
*/
/**
* @author Dennis Ushakov
*/
package javax.accessibility;
import com.gaecompat.javax.swing.text.AttributeSet;
import com.google.code.appengine.awt.Point;
import com.google.code.appengine.awt.Rectangle;
public interface AccessibleText {
static final int CHARACTER = 1;
static final int WORD = 2;
static final int SENTENCE = 3;
int getIndexAtPoint(Point p);
Rectangle getCharacterBounds(int i);
int getCharCount();
int getCaretPosition();
String getAtIndex(int part, int index);
String getAfterIndex(int part, int index);
String getBeforeIndex(int part, int index);
AttributeSet getCharacterAttribute(int i);
int getSelectionStart();
int getSelectionEnd();
String getSelectedText();
}
| mike10004/appengine-imaging | gaecompat-awt-imaging/src/common/javax/accessibility/AccessibleText.java | Java | apache-2.0 | 1,610 |
/**
* Copyright 2015-2016 Maven Source Dependencies
* Plugin contributors as indicated by the @author tags.
*
* 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.l2x6.srcdeps.core.shell;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import org.l2x6.srcdeps.core.util.SrcdepsCoreUtils;
/**
* A definition of a shell command that can be executed by {@link Shell#execute(ShellCommand)}.
*
* @author <a href="https://github.com/ppalaga">Peter Palaga</a>
*/
public class ShellCommand {
private final List<String> arguments;
private final Map<String, String> environment;
private final String executable;
private final IoRedirects ioRedirects;
private final long timeoutMs;
private final Path workingDirectory;
public ShellCommand(String executable, List<String> arguments, Path workingDirectory,
Map<String, String> environment, IoRedirects ioRedirects, long timeoutMs) {
super();
SrcdepsCoreUtils.assertArgNotNull(executable, "executable");
SrcdepsCoreUtils.assertArgNotNull(arguments, "arguments");
SrcdepsCoreUtils.assertArgNotNull(workingDirectory, "workingDirectory");
SrcdepsCoreUtils.assertArgNotNull(environment, "environment");
SrcdepsCoreUtils.assertArgNotNull(ioRedirects, "ioRedirects");
this.executable = executable;
this.arguments = arguments;
this.workingDirectory = workingDirectory;
this.environment = environment;
this.ioRedirects = ioRedirects;
this.timeoutMs = timeoutMs;
}
/**
* @return an array containing the executable and its arguments that can be passed e.g. to
* {@link ProcessBuilder#command(String...)}
*/
public String[] asCmdArray() {
String[] result = new String[arguments.size() + 1];
int i = 0;
result[i++] = executable;
for (String arg : arguments) {
result[i++] = arg;
}
return result;
}
/**
* @return the {@link List} arguments for the executable. Cannot be {@code null}.
*/
public List<String> getArguments() {
return arguments;
}
/**
* @return a {@link Map} of environment variables that should be used when executing this {@link ShellCommand}.
* Cannot be {@code null}. Note that these are just overlay variables - when a new {@link Process} is
* spawned, the environment is copied from the present process and only the variables the provided by the
* present method are overwritten.
*/
public Map<String, String> getEnvironment() {
return environment;
}
/**
* @return the executable file that should be called
*/
public String getExecutable() {
return executable;
}
/**
* @return the {@link IoRedirects} to use when the {@link Shell} spawns a new {@link Process}
*/
public IoRedirects getIoRedirects() {
return ioRedirects;
}
/**
* @return timeout in milliseconds
*/
public long getTimeoutMs() {
return timeoutMs;
}
/**
* @return the directory in which this {@link ShellCommand} should be executed
*/
public Path getWorkingDirectory() {
return workingDirectory;
}
}
| jpkrohling/srcdeps-maven-plugin | srcdeps-core/src/main/java/org/l2x6/srcdeps/core/shell/ShellCommand.java | Java | apache-2.0 | 3,821 |
/*
* Powered By agile
* Web Site: http://www.agile.com
* Since 2008 - 2016
*/
package persistent.prestige.modules.edu.service;
import java.util.Map;
/**
* Organization service类
* @author 雅居乐 2016-9-10 22:28:24
* @version 1.0
*/
public interface OrganizationService{
/**
* 保存信息
* @param datas
* @return
*/
Integer saveOrganization(Map datas);
}
| dingwpmz/Mycat-Demo | src/main/java/persistent/prestige/modules/edu/service/OrganizationService.java | Java | apache-2.0 | 381 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Carrot Cake</title>
<meta name="description" content="ZutatenFür den Kuchen:200 g brauner Zucker180 g Pflanzenöl (200 ml)3 EL fetter Joghurt3 Eier1 TL Vanille-Extrakt oder das Mark einer Schote250g Mehl1 TL Back...">
<link rel="stylesheet" href="/css/main.css">
<link rel="canonical" href="http://clonker.github.io/recipe/secret/2015/09/26/carrot-cake.html">
<link rel="alternate" type="application/rss+xml" title="d'oh" href="http://clonker.github.io/feed.xml" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<header class="site-header">
<div class="wrapper">
<a class="site-title" href="/">d'oh</a>
<nav class="site-nav">
<a href="#" class="menu-icon">
<svg viewBox="0 0 18 15">
<path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
<path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
<path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
</svg>
</a>
<div class="trigger">
<a class="page-link" href="/about/">About</a>
<a class="page-link" href="/slides/">todo</a>
<a class="page-link" href="/test/test.html">Text!</a>
<a class="page-link" href="/phd/todo.html">todo</a>
</div>
</nav>
</div>
</header>
<div class="page-content">
<div class="wrapper">
<div class="hidden" id="hidden"></div>
<script type="text/javascript">
$(document).ready(function() {
var hidden = jQuery('#hidden');
var post = jQuery('#post');
post.contents().appendTo(hidden);
var pwd = prompt("Please enter the password", "");
if(pwd != null && pwd == 'doh') {
hidden.contents().appendTo(post);
} else {
var sloths = [
"https://upload.wikimedia.org/wikipedia/commons/2/25/Sloth1a.jpg",
"http://free4uwallpapers.eu/wp-content/uploads/Funny/funny-sloth-animals-hd-wallpaper.jpg"
];
var item = sloths[Math.floor(Math.random()*sloths.length)];
post.append(jQuery('<h1>Sorry, wrong password.</h1><img src="'+item+'"/>'));
}
})
</script>
<div class="post" id="post">
<header class="post-header">
<h1 class="post-title">Carrot Cake</h1>
<p class="post-meta">Sep 26, 2015</p>
</header>
<article class="post-content">
<h2>Zutaten</h2>
<h3>Für den Kuchen:</h3>
<ul>
<li>200 g brauner Zucker</li>
<li>180 g Pflanzenöl (200 ml)</li>
<li>3 EL fetter Joghurt</li>
<li>3 Eier</li>
<li>1 TL Vanille-Extrakt oder das Mark einer Schote</li>
<li>250g Mehl</li>
<li>1 TL Backpulver (besser: Natron)</li>
<li>2 TL Zimt</li>
<li>1/4 TL Muskatnuss</li>
<li>1/2 TL Salz</li>
<li>260 g geriebene Karotten</li>
<li>150 g Walnüsse</li>
</ul>
<h3>Für das Frosting:</h3>
<ul>
<li>300 g Frischkäse</li>
<li>120 g zimmerwarme Butter</li>
<li>200 g Puderzucker</li>
<li>das Mark einer Vanilleschote</li>
<li>1/2 TL Salz</li>
</ul>
<h2>Zubereitung:</h2>
<p>Braunen Zucker, Salz, Öl, Eier, Vanille, Zimt, Muskat und Joghurt in einer Schüssel verquirlen, bis eine homogene Masse entstanden ist. Mehl und Backpulver langsam unterheben und weiterrühren, bis sich die Zutaten verbunden haben. Karotten schällen und fein raspeln. Ebenfalls unter den Teig heben. Zum Schluss die Walnüsse grob hacken und auch zum Teig geben.</p>
<p>Eine Springform mit Butter ausreiben und leicht mit Zucker bestreuen. Den Teig hineinfüllen und den Kuchen bei 180°C Umluft in einem vorgeheizten Backofen für 37 min backen.</p>
<p>In der Zwischenzeit Frischkäse und Butter cremig aufschlagen und anschließend den Puderzucker unterrühren, bis eine glatte Creme entstanden ist. Mit Vanillemark und etwas Salz abschmecken. Den Kuchen nach 37 Minuten aus dem Ofen nehmen und auskühlen lassen. Das Frosting in die Mitte geben und mit einem Löffel oder einem Spatel vorsichtig kreisförmig </p>
</article>
</div>
</div>
</div>
</body>
</html>
| clonker/clonker.github.io | recipe/secret/2015/09/26/carrot-cake.html | HTML | apache-2.0 | 4,741 |
/**
--| ADAPTIVE RUNTIME PLATFORM |----------------------------------------------------------------------------------------
(C) Copyright 2013-2015 Carlos Lozano Diez t/a Adaptive.me <http://adaptive.me>.
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 appli-
-cable 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.
Original author:
* Carlos Lozano Diez
<http://github.com/carloslozano>
<http://twitter.com/adaptivecoder>
<mailto:[email protected]>
Contributors:
* Ferran Vila Conesa
<http://github.com/fnva>
<http://twitter.com/ferran_vila>
<mailto:[email protected]>
* See source code files for contributors.
Release:
* @version v2.2.15
-------------------------------------------| aut inveniam viam aut faciam |--------------------------------------------
*/
using System;
namespace Adaptive.Arp.Api
{
/**
Enumeration IAdaptiveRPGroup
*/
public enum IAdaptiveRPGroup {
Application,
Commerce,
Communication,
Data,
Media,
Notification,
PIM,
Reader,
Security,
Sensor,
Social,
System,
UI,
Util,
Kernel,
Unknown
}
}
| AdaptiveMe/adaptive-arp-api-lib-dotnet | adaptive-arp-api/Sources/Adaptive.Arp.Api/IAdaptiveRPGroup.cs | C# | apache-2.0 | 1,735 |
package buchungstool.model.importer;
import org.junit.Test;
import static java.time.LocalDateTime.now;
import static org.assertj.core.api.Assertions.assertThat;
public class KonfigurationEventTest {
@Test
public void test() {
KonfigurationEvent konfigurationEvent = new KonfigurationEvent(now(), now(), "@Konfiguration",
"Max:16\nMin: 4");
assertThat(konfigurationEvent.getMax()).isEqualTo(16);
assertThat(konfigurationEvent.getMin()).isEqualTo(4);
}
} | AlexBischof/buchungstool | src/test/java/buchungstool/model/importer/KonfigurationEventTest.java | Java | apache-2.0 | 562 |
/*
*
* * Copyright (c) 2011-2015 EPFL DATA Laboratory
* * Copyright (c) 2014-2015 The Squall Collaboration (see NOTICE)
* *
* * 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 ch.epfl.data.squall.components.dbtoaster;
import backtype.storm.Config;
import backtype.storm.topology.TopologyBuilder;
import ch.epfl.data.squall.components.Component;
import ch.epfl.data.squall.components.JoinerComponent;
import ch.epfl.data.squall.components.AbstractJoinerComponent;
import ch.epfl.data.squall.operators.AggregateStream;
import ch.epfl.data.squall.predicates.Predicate;
import ch.epfl.data.squall.storm_components.StormComponent;
import ch.epfl.data.squall.storm_components.dbtoaster.StormDBToasterJoin;
import ch.epfl.data.squall.storm_components.synchronization.TopologyKiller;
import ch.epfl.data.squall.types.Type;
import ch.epfl.data.squall.utilities.MyUtilities;
import org.apache.log4j.Logger;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class DBToasterJoinComponent extends AbstractJoinerComponent<DBToasterJoinComponent> {
protected DBToasterJoinComponent getThis() {
return this;
}
private static final long serialVersionUID = 1L;
private static Logger LOG = Logger.getLogger(DBToasterJoinComponent.class);
private Map<String, Type[]> _parentNameColTypes;
private Set<String> _parentsWithMultiplicity;
private Map<String, AggregateStream> _parentsWithAggregator;
private String _equivalentSQL;
protected DBToasterJoinComponent(List<Component> relations, Map<String, Type[]> relationTypes,
Set<String> relationsWithMultiplicity, Map<String, AggregateStream> relationsWithAggregator,
String sql, String name) {
super(relations, name);
_parentsWithMultiplicity = relationsWithMultiplicity;
_parentsWithAggregator = relationsWithAggregator;
_parentNameColTypes = relationTypes;
_equivalentSQL = sql;
}
@Override
public void makeBolts(TopologyBuilder builder, TopologyKiller killer,
List<String> allCompNames, Config conf, int hierarchyPosition) {
// by default print out for the last component
// for other conditions, can be set via setPrintOut
if (hierarchyPosition == StormComponent.FINAL_COMPONENT
&& !getPrintOutSet())
setPrintOut(true);
MyUtilities.checkBatchOutput(getBatchOutputMillis(),
getChainOperator().getAggregation(), conf);
setStormEmitter(new StormDBToasterJoin(getParents(), this,
allCompNames,
_parentNameColTypes,
_parentsWithMultiplicity,
_parentsWithAggregator,
hierarchyPosition,
builder, killer, conf));
}
@Override
public DBToasterJoinComponent setJoinPredicate(Predicate predicate) {
throw new UnsupportedOperationException();
}
public String getSQLQuery() {
return _equivalentSQL;
}
}
| akathorn/squall | squall-core/src/main/java/ch/epfl/data/squall/components/dbtoaster/DBToasterJoinComponent.java | Java | apache-2.0 | 3,862 |
[
{
"title": "Ventes véhicules",
"url": "",
"imageUrl": "http://lim.local.inetpsa.com/application/images/service/car2.jpg",
"language": "fr-FR",
"order": "1",
"workplace": "All",
"department": "All",
"categoryPro": "All",
"status": "published",
"children": [
{
"title": "http://portail.inetpsa.com/sites/gpmobile/PublishingImages/car2.jpg",
"url": "http://portail.inetpsa.com/sites/gpmobile/PublishingImages/car2.jpg",
"imageUrl": "http://lim.local.inetpsa.com/application/images/service/car2.jpg",
"language": "fr-FR",
"order": 0,
"workplace": "All",
"department": "All",
"categoryPro": "All",
"status": "published"
},
{
"title": "Ventes véhicules Peugeot",
"url": "https://docinfogroupe.psa-peugeot-citroen.com/ead/dom/1000788899.fd",
"imageUrl": "http://lim.local.inetpsa.com/application/images/service/car2.jpg",
"language": "fr-FR",
"order": 1,
"workplace": "All",
"department": "All",
"categoryPro": "All",
"status": "edited"
},
{
"title": "Ventes véhicules DS",
"url": "https://docinfogroupe.psa-peugeot-citroen.com/ead/dom/1000779116.fd",
"imageUrl": "http://lim.local.inetpsa.com/application/images/service/car2.jpg",
"language": "fr-FR",
"order": 2,
"workplace": "All",
"department": "All",
"categoryPro": "All",
"status": "published"
}
]
},
{
"title": "Webmail",
"url": "https://webmail.mpsa.com/",
"imageUrl": "http://lim.local.inetpsa.com/application/images/service/webmail.jpg",
"language": "en-US",
"order": "0",
"workplace": "All",
"department": "All",
"categoryPro": "All",
"status": "published",
"children": []
},
{
"title": "Net'RH congés",
"url": "https://fr-rh.mpsa.com/rib00/ribdnins.nsf/fc583fb6947d633ac12569450031fbd2/755dcfb785421c6cc1256c7f003107c2?OpenDocument",
"imageUrl": "http://lim.local.inetpsa.com/application/images/service/holiday.jpg",
"language": "fr-FR",
"order": "3",
"workplace": "All",
"department": "All",
"categoryPro": "All",
"status": "unpublished",
"children": []
}
] | florentbruel/livein | services.js | JavaScript | apache-2.0 | 2,378 |
/*
* Copyright 2009-2013 Aarhus University
*
* 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 dk.brics.tajs.analysis;
import dk.brics.tajs.flowgraph.BasicBlock;
import dk.brics.tajs.lattice.CallEdge;
import dk.brics.tajs.solver.CallGraph;
import dk.brics.tajs.solver.IWorkListStrategy;
/**
* Work list strategy.
*/
public class WorkListStrategy implements IWorkListStrategy<Context> {
private CallGraph<State,Context,CallEdge<State>> call_graph;
/**
* Constructs a new WorkListStrategy object.
*/
public WorkListStrategy() {}
/**
* Sets the call graph.
*/
public void setCallGraph(CallGraph<State,Context,CallEdge<State>> call_graph) {
this.call_graph = call_graph;
}
@Override
public int compare(IEntry<Context> e1, IEntry<Context> e2) {
BasicBlock n1 = e1.getBlock();
BasicBlock n2 = e2.getBlock();
int serial1 = e1.getSerial();
int serial2 = e2.getSerial();
if (serial1 == serial2)
return 0;
final int E1_FIRST = -1;
final int E2_FIRST = 1;
if (n1.getFunction().equals(n2.getFunction()) && e1.getContext().equals(e2.getContext())) {
// same function and same context: use block order
if (n1.getOrder() < n2.getOrder())
return E1_FIRST;
else if (n2.getOrder() < n1.getOrder())
return E2_FIRST;
}
int function_context_order1 = call_graph.getBlockContextOrder(e1.getContext().getEntryBlockAndContext());
int function_context_order2 = call_graph.getBlockContextOrder(e2.getContext().getEntryBlockAndContext());
// different function/context: order by occurrence number
if (function_context_order1 < function_context_order2)
return E2_FIRST;
else if (function_context_order2 < function_context_order1)
return E1_FIRST;
// strategy: breadth first
return serial1 - serial2;
}
}
| cursem/ScriptCompressor | ScriptCompressor1.0/src/dk/brics/tajs/analysis/WorkListStrategy.java | Java | apache-2.0 | 2,303 |
mod project;
mod build;
pub use self::project::{Project, Folder};
| defuz/sublimate | src/core/workspace/mod.rs | Rust | apache-2.0 | 67 |
#include "firestore/src/swig/equality_compare.h"
namespace {
template <typename T>
bool EqualityCompareHelper(const T* lhs, const T* rhs) {
return lhs == rhs || (lhs != nullptr && rhs != nullptr && *lhs == *rhs);
}
} // namespace
namespace firebase {
namespace firestore {
namespace csharp {
bool QueryEquals(const Query* lhs, const Query* rhs) {
return EqualityCompareHelper(lhs, rhs);
}
bool QuerySnapshotEquals(const QuerySnapshot* lhs, const QuerySnapshot* rhs) {
return EqualityCompareHelper(lhs, rhs);
}
bool DocumentSnapshotEquals(const DocumentSnapshot* lhs,
const DocumentSnapshot* rhs) {
return EqualityCompareHelper(lhs, rhs);
}
bool DocumentChangeEquals(const DocumentChange* lhs,
const DocumentChange* rhs) {
return EqualityCompareHelper(lhs, rhs);
}
} // namespace csharp
} // namespace firestore
} // namespace firebase
| firebase/firebase-unity-sdk | firestore/src/swig/equality_compare.cc | C++ | apache-2.0 | 912 |
package at.ac.tuwien.dsg.pm.resources;
import at.ac.tuwien.dsg.pm.PeerManager;
import at.ac.tuwien.dsg.pm.model.Collective;
import at.ac.tuwien.dsg.smartcom.model.CollectiveInfo;
import at.ac.tuwien.dsg.smartcom.model.Identifier;
import javax.inject.Inject;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;
/**
* @author Philipp Zeppezauer ([email protected])
* @version 1.0
*/
@Path("collectiveInfo")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class CollectiveInfoResource {
@Inject
private PeerManager manager;
@GET
@Path("/{id}")
public CollectiveInfo getCollectiveInfo(@PathParam("id") String id) {
Collective collective = manager.getCollective(id);
if (collective == null) {
throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build());
}
CollectiveInfo info = new CollectiveInfo();
info.setId(Identifier.collective(id));
info.setDeliveryPolicy(collective.getDeliveryPolicy());
List<Identifier> peers = new ArrayList<>(collective.getPeers().size());
for (String s : collective.getPeers()) {
peers.add(Identifier.peer(s));
}
info.setPeers(peers);
return info;
}
}
| PhilZeppe/CaaS | pm/src/main/java/at/ac/tuwien/dsg/pm/resources/CollectiveInfoResource.java | Java | apache-2.0 | 1,385 |
package tutor.utils
import org.scalatest.{FunSpec, Matchers}
class FileUtilSpec extends FunSpec with Matchers {
describe("FileUtil"){
it("can extract file extension name"){
val path = "src/test/build.sbt"
FileUtil.extractExtFileName(path) shouldBe "sbt"
}
it("if file has no extension name, should give EmptyFileType constant"){
val path = "src/test/build"
FileUtil.extractExtFileName(path) shouldBe FileUtil.EmptyFileType
}
it("can extract local file path"){
val path = "src/test/build.sbt"
FileUtil.extractLocalPath(path) shouldBe "build.sbt"
}
}
}
| notyy/CodeAnalyzerTutorial | src/test/scala/tutor/utils/FileUtilSpec.scala | Scala | apache-2.0 | 617 |
sap.ui.define(["sap/ui/integration/Designtime"], function (
Designtime
) {
"use strict";
return function () {
return new Designtime({
"form": {
"items": {
"validationGroup": {
"type": "group",
"label": "Validation"
},
"OrderID": {
"manifestpath": "/sap.card/configuration/parameters/OrderID/value",
"label": "Order Id",
"type": "integer",
"required": true
},
"stringphone": {
"manifestpath": "/sap.card/configuration/parameters/string/value",
"label": "String with Pattern validation",
"type": "string",
"translatable": false,
"required": true,
"placeholder": "555-4555",
"validation": {
"type": "error",
"maxLength": 20,
"minLength": 1,
"pattern": "^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$",
"message": "The string does not match a telefone number"
}
},
"stringphonenomessage": {
"manifestpath": "/sap.card/configuration/parameters/string/value",
"label": "String with default validation message",
"type": "string",
"translatable": false,
"required": true,
"placeholder": "555-4555",
"validation": {
"type": "warning",
"maxLength": 20,
"minLength": 1,
"pattern": "^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$"
}
},
"stringmaxmin": {
"manifestpath": "/sap.card/configuration/parameters/string/value",
"label": "String with Length Constrained",
"type": "string",
"translatable": false,
"required": true,
"placeholder": "MinMaxlength",
"validation": {
"type": "warning",
"maxLength": 20,
"minLength": 3
},
"hint": "Please refer to the <a href='https://www.sap.com'>documentation</a> lets see how this will behave if the text is wrapping to the next line and has <a href='https://www.sap.com'>two links</a>. good?"
},
"integerrequired": {
"manifestpath": "/sap.card/configuration/parameters/integerrequired/value",
"label": "Integer with Required",
"type": "integer",
"translatable": false,
"required": true
},
"integervalidation": {
"manifestpath": "/sap.card/configuration/parameters/integer/value",
"label": "Integer with Min Max value",
"type": "integer",
"visualization": {
"type": "Slider",
"settings": {
"value": "{currentSettings>value}",
"min": 0,
"max": 16,
"width": "100%",
"showAdvancedTooltip": true,
"showHandleTooltip": false,
"inputsAsTooltips": true,
"enabled": "{currentSettings>editable}"
}
},
"validations": [
{
"type": "warning",
"minimum": 5,
"message": "The minimum is 5."
},
{
"type": "error",
"exclusiveMaximum": 16,
"message": "The maximum is 15."
},
{
"type": "error",
"multipleOf": 5,
"message": "Has to be multiple of 5"
}
]
},
"numberrequired": {
"manifestpath": "/sap.card/configuration/parameters/number/value",
"label": "Number with validation",
"type": "number",
"translatable": false,
"required": true,
"validation": {
"type": "error",
"minimum": 0,
"maximum": 100,
"exclusiveMaximum": true,
"message": "The value should be equal or greater than 0 and be less than 100."
}
}
}
},
"preview": {
"modes": "AbstractLive"
}
});
};
});
| SAP/openui5 | src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/samples/designtimeValidation/dt/configuration.js | JavaScript | apache-2.0 | 3,586 |
#include "list.h"
void __list_add__(list_node_t *prev, list_node_t *next, list_node_t *node)
{
next->prev = node;
node->next = next;
node->prev = prev;
prev->next = node;
}
void __list_del__(list_node_t *prev, list_node_t *next)
{
next->prev = prev;
prev->next = next;
}
void __list_erase__(list_t *list, list_node_t *node)
{
list_iter_t next, prev;
if (list_is_singular(*list)) {
list->head = list->tail = NULL;
} else {
next = node->next;
prev = node->prev;
__list_del__(node->prev, node->next);
list->head = list->head == node ? next : list->head;
list->tail = list->tail == node ? prev : list->tail;
}
node->prev = NULL;
node->next = NULL;
}
void __list_replace__(list_node_t *o, list_node_t *n)
{
n->next = o->next;
n->next->prev = n;
n->prev = o->prev;
n->prev->next = n;
}
void __list_push_back__(list_t *list, list_node_t *node)
{
if (list->head) {
__list_add__(list->head->prev, list->head, node);
list->tail = node;
} else {
list->head = list->tail = node->next = node->prev = node;
}
}
void __list_push_front__(list_t *list, list_node_t *node)
{
if (list->head) {
__list_add__(list->head->prev, list->head, node);
list->head = node;
} else {
list->head = list->tail = node->next = node->prev = node;
}
}
| veficos/occ | src/list.c | C | apache-2.0 | 1,500 |
package com.earlysleep.model;
import org.litepal.crud.DataSupport;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zml on 2016/6/23.
* 介绍:
*/
public class AllData extends DataSupport {
private String music;
private int musictime;
private boolean musicchosse;
List<TimeSeting> list=new ArrayList<>();
}
| 642638112/-1.0 | EarlySleep/app/src/main/java/com/earlysleep/model/AllData.java | Java | apache-2.0 | 353 |
package org.spoofax.jsglr2.integrationtest.features;
import java.util.Arrays;
import java.util.stream.Stream;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.TestFactory;
import org.spoofax.jsglr2.integrationtest.BaseTestWithSdf3ParseTables;
import org.spoofax.jsglr2.integrationtest.OriginDescriptor;
import org.spoofax.terms.ParseError;
public class OriginsTest extends BaseTestWithSdf3ParseTables {
public OriginsTest() {
super("tokenization.sdf3");
}
@TestFactory public Stream<DynamicTest> operator() throws ParseError {
return testOrigins("x+x", Arrays.asList(
//@formatter:off
new OriginDescriptor("AddOperator", 0, 2),
new OriginDescriptor("Id", 0, 0),
new OriginDescriptor("Id", 2, 2)
//@formatter:on
));
}
}
| metaborg/jsglr | org.spoofax.jsglr2.integrationtest/src/test/java/org/spoofax/jsglr2/integrationtest/features/OriginsTest.java | Java | apache-2.0 | 839 |
# frozen_string_literal: true
# Copyright 2020 Google 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
#
# https://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.
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
require "google/cloud/access_approval/v1/access_approval"
require "google/cloud/access_approval/v1/version"
module Google
module Cloud
module AccessApproval
##
# To load this package, including all its services, and instantiate a client:
#
# @example
#
# require "google/cloud/access_approval/v1"
# client = ::Google::Cloud::AccessApproval::V1::AccessApproval::Client.new
#
module V1
end
end
end
end
helper_path = ::File.join __dir__, "v1", "_helpers.rb"
require "google/cloud/access_approval/v1/_helpers" if ::File.file? helper_path
| googleapis/google-cloud-ruby | google-cloud-access_approval-v1/lib/google/cloud/access_approval/v1.rb | Ruby | apache-2.0 | 1,279 |
/*
* Copyright (c) 2005-2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.andes.server.handler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.andes.AMQException;
import org.wso2.andes.amqp.AMQPUtils;
import org.wso2.andes.exchange.ExchangeDefaults;
import org.wso2.andes.framing.AMQShortString;
import org.wso2.andes.framing.BasicPublishBody;
import org.wso2.andes.framing.abstraction.MessagePublishInfo;
import org.wso2.andes.protocol.AMQConstant;
import org.wso2.andes.server.AMQChannel;
import org.wso2.andes.server.exchange.Exchange;
import org.wso2.andes.server.protocol.AMQProtocolSession;
import org.wso2.andes.server.state.AMQStateManager;
import org.wso2.andes.server.state.StateAwareMethodListener;
import org.wso2.andes.server.virtualhost.VirtualHost;
public class BasicPublishMethodHandler implements StateAwareMethodListener<BasicPublishBody>
{
private static final Log _logger = LogFactory.getLog(BasicPublishMethodHandler.class);
private static final BasicPublishMethodHandler _instance = new BasicPublishMethodHandler();
public static BasicPublishMethodHandler getInstance()
{
return _instance;
}
private BasicPublishMethodHandler()
{
}
public void methodReceived(AMQStateManager stateManager, BasicPublishBody body, int channelId) throws AMQException
{
AMQProtocolSession session = stateManager.getProtocolSession();
if (_logger.isDebugEnabled())
{
_logger.debug("Publish received on channel " + channelId);
}
AMQShortString exchangeName = body.getExchange();
// TODO: check the delivery tag field details - is it unique across the broker or per subscriber?
if (exchangeName == null)
{
exchangeName = ExchangeDefaults.DEFAULT_EXCHANGE_NAME;
}
VirtualHost vHost = session.getVirtualHost();
Exchange exch = vHost.getExchangeRegistry().getExchange(exchangeName);
// if the exchange does not exist we raise a channel exception
if (exch == null)
{
throw body.getChannelException(AMQConstant.NOT_FOUND, "Unknown exchange name");
}
else
{
// The partially populated BasicDeliver frame plus the received route body
// is stored in the channel. Once the final body frame has been received
// it is routed to the exchange.
AMQChannel channel = session.getChannel(channelId);
if (channel == null)
{
throw body.getChannelNotFoundException(channelId);
}
MessagePublishInfo info = session.getMethodRegistry().getProtocolVersionMethodConverter().convertToInfo(body);
if (ExchangeDefaults.TOPIC_EXCHANGE_NAME.equals(exchangeName)
&& AMQPUtils.isWildCardDestination(info.getRoutingKey().toString())) {
throw body.getChannelException(AMQConstant.INVALID_ROUTING_KEY, "Publishing messages to a wildcard "
+ "destination is not allowed");
}
info.setExchange(exchangeName);
channel.setPublishFrame(info, exch);
}
}
}
| wso2/andes | modules/andes-core/broker/src/main/java/org/wso2/andes/server/handler/BasicPublishMethodHandler.java | Java | apache-2.0 | 3,860 |
using System;
using System.Net.Http.Formatting;
using System.Web;
using System.Web.Hosting;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using NLog;
using NLog.Config;
using NLog.Targets;
using RceDoorzoeker.Configuration;
using RceDoorzoeker.Services.Mappers;
namespace RceDoorzoeker
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : HttpApplication
{
private static readonly Logger s_logger = LogManager.GetCurrentClassLogger();
public static bool ReleaseBuild
{
get
{
#if DEBUG
return false;
#else
return true;
#endif
}
}
protected void Application_Start()
{
InitializeConfiguration();
InitLogging();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
AreaRegistration.RegisterAllAreas();
BundleTable.EnableOptimizations = ReleaseBuild;
BundleConfig.RegisterBundles(BundleTable.Bundles);
RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
WebApiConfig.Register(GlobalConfiguration.Configuration);
RouteConfig.RegisterRoutes(RouteTable.Routes);
DoorzoekerModelMapper.ConfigureMapper();
var config = GlobalConfiguration.Configuration;
config.Formatters.Clear();
var jsonMediaTypeFormatter = new JsonMediaTypeFormatter
{
SerializerSettings =
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
NullValueHandling = NullValueHandling.Ignore
}
};
config.Formatters.Add(jsonMediaTypeFormatter);
s_logger.Info("Application started.");
}
private void InitLogging()
{
var cfg = new LoggingConfiguration();
var fileTarget = new FileTarget()
{
FileName = string.Format("${{basedir}}/App_Data/NLog-{0}.log", Instance.Current.Name),
Layout = "${longdate} ${level} ${logger} ${message} ${exception:format=tostring}",
ArchiveAboveSize = 2000000,
ArchiveNumbering = ArchiveNumberingMode.Sequence,
ArchiveEvery = FileArchivePeriod.Month,
MaxArchiveFiles = 10,
ConcurrentWrites = false,
KeepFileOpen = true,
EnableFileDelete = true,
ArchiveFileName = string.Format("${{basedir}}/App_Data/NLog-{0}_archive_{{###}}.log", Instance.Current.Name)
};
var traceTarget = new TraceTarget()
{
Layout = "${level} ${logger} ${message} ${exception:format=tostring}"
};
cfg.AddTarget("instancefile", fileTarget);
cfg.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, fileTarget));
cfg.AddTarget("trace", traceTarget);
cfg.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, traceTarget));
LogManager.Configuration = cfg;
}
private static void InitializeConfiguration()
{
var instanceConfig = InstanceRegistry.Current.GetBySiteName(HostingEnvironment.SiteName);
if (instanceConfig == null)
throw new ApplicationException("Can't find instance configuration for site " + HostingEnvironment.SiteName);
Instance.Current = instanceConfig;
DoorzoekerConfig.Current = DoorzoekerConfig.Load(instanceConfig.Config);
}
protected void Application_End()
{
s_logger.Info("Application ended");
}
}
} | Joppe-A/rce-doorzoeker | RceDoorzoeker/Global.asax.cs | C# | apache-2.0 | 3,311 |
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.policy.mgt.core.task;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.ntask.common.TaskException;
import org.wso2.carbon.ntask.core.TaskInfo;
import org.wso2.carbon.ntask.core.TaskManager;
import org.wso2.carbon.ntask.core.service.TaskService;
import org.wso2.carbon.policy.mgt.common.PolicyMonitoringTaskException;
import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder;
import org.wso2.carbon.policy.mgt.core.util.PolicyManagementConstants;
import org.wso2.carbon.policy.mgt.core.util.PolicyManagerUtil;
import org.wso2.carbon.ntask.core.TaskInfo.TriggerInfo;
import java.util.HashMap;
import java.util.Map;
public class TaskScheduleServiceImpl implements TaskScheduleService {
private static Log log = LogFactory.getLog(TaskScheduleServiceImpl.class);
@Override
public void startTask(int monitoringFrequency) throws PolicyMonitoringTaskException {
if (monitoringFrequency <= 0) {
throw new PolicyMonitoringTaskException("Time interval cannot be 0 or less than 0.");
}
try {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
TaskService taskService = PolicyManagementDataHolder.getInstance().getTaskService();
taskService.registerTaskType(PolicyManagementConstants.TASK_TYPE);
if (log.isDebugEnabled()) {
log.debug("Monitoring task is started for the tenant id " + tenantId);
}
TaskManager taskManager = taskService.getTaskManager(PolicyManagementConstants.TASK_TYPE);
TriggerInfo triggerInfo = new TriggerInfo();
triggerInfo.setIntervalMillis(monitoringFrequency);
triggerInfo.setRepeatCount(-1);
Map<String, String> properties = new HashMap<>();
properties.put(PolicyManagementConstants.TENANT_ID, String.valueOf(tenantId));
String taskName = PolicyManagementConstants.TASK_NAME + "_" + String.valueOf(tenantId);
TaskInfo taskInfo = new TaskInfo(taskName, PolicyManagementConstants.TASK_CLAZZ, properties, triggerInfo);
taskManager.registerTask(taskInfo);
taskManager.rescheduleTask(taskInfo.getName());
} catch (TaskException e) {
String msg = "Error occurred while creating the task for tenant " + PrivilegedCarbonContext.
getThreadLocalCarbonContext().getTenantId();
log.error(msg, e);
throw new PolicyMonitoringTaskException(msg, e);
}
}
@Override
public void stopTask() throws PolicyMonitoringTaskException {
try {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String taskName = PolicyManagementConstants.TASK_NAME + "_" + String.valueOf(tenantId);
TaskService taskService = PolicyManagementDataHolder.getInstance().getTaskService();
TaskManager taskManager = taskService.getTaskManager(PolicyManagementConstants.TASK_TYPE);
taskManager.deleteTask(taskName);
} catch (TaskException e) {
String msg = "Error occurred while deleting the task for tenant " + PrivilegedCarbonContext.
getThreadLocalCarbonContext().getTenantId();
log.error(msg, e);
throw new PolicyMonitoringTaskException(msg, e);
}
}
@Override
public void updateTask(int monitoringFrequency) throws PolicyMonitoringTaskException {
try {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
String taskName = PolicyManagementConstants.TASK_NAME + "_" + String.valueOf(tenantId);
TaskService taskService = PolicyManagementDataHolder.getInstance().getTaskService();
TaskManager taskManager = taskService.getTaskManager(PolicyManagementConstants.TASK_TYPE);
taskManager.deleteTask(taskName);
TriggerInfo triggerInfo = new TriggerInfo();
triggerInfo.setIntervalMillis(monitoringFrequency);
triggerInfo.setRepeatCount(-1);
Map<String, String> properties = new HashMap<>();
properties.put("tenantId", String.valueOf(tenantId));
TaskInfo taskInfo = new TaskInfo(taskName, PolicyManagementConstants.TASK_CLAZZ, properties, triggerInfo);
taskManager.registerTask(taskInfo);
taskManager.rescheduleTask(taskInfo.getName());
} catch (TaskException e) {
String msg = "Error occurred while updating the task for tenant " + PrivilegedCarbonContext.
getThreadLocalCarbonContext().getTenantId();
log.error(msg, e);
throw new PolicyMonitoringTaskException(msg, e);
}
}
}
| charithag/carbon-device-mgt-framework | components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/TaskScheduleServiceImpl.java | Java | apache-2.0 | 5,611 |
# AUTOGENERATED FILE
FROM balenalib/generic-armv7ahf-ubuntu:focal-build
ENV NODE_VERSION 12.21.0
ENV YARN_VERSION 1.22.4
RUN for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
done \
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-armv7l.tar.gz" \
&& echo "6edc31a210e47eb72b0a2a150f7fe604539c1b2a45e8c81d378ac9315053a54f node-v$NODE_VERSION-linux-armv7l.tar.gz" | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-armv7l.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-armv7l.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/[email protected]" \
&& echo "Running test-stack@node" \
&& chmod +x [email protected] \
&& bash [email protected] \
&& rm -rf [email protected]
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 v7 \nOS: Ubuntu focal \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v12.21.0, 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 | nghiant2710/base-images | balena-base-images/node/generic-armv7ahf/ubuntu/focal/12.21.0/build/Dockerfile | Dockerfile | apache-2.0 | 2,767 |
/*
* Copyright 2013 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.
*/
package com.google.api.client.googleapis.testing.json;
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.json.Json;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.testing.http.HttpTesting;
import com.google.api.client.testing.http.MockHttpTransport;
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
import com.google.api.client.util.Beta;
import java.io.IOException;
/**
* {@link Beta} <br>
* Factory class that builds {@link GoogleJsonResponseException} instances for testing.
*
* @since 1.18
*/
@Beta
public final class GoogleJsonResponseExceptionFactoryTesting {
/**
* Convenience factory method that builds a {@link GoogleJsonResponseException} from its
* arguments. The method builds a dummy {@link HttpRequest} and {@link HttpResponse}, sets the
* response's status to a user-specified HTTP error code, suppresses exceptions, and executes the
* request. This forces the underlying framework to create, but not throw, a {@link
* GoogleJsonResponseException}, which the method retrieves and returns to the invoker.
*
* @param jsonFactory the JSON factory that will create all JSON required by the underlying
* framework
* @param httpCode the desired HTTP error code. Note: do nut specify any codes that indicate
* successful completion, e.g. 2XX.
* @param reasonPhrase the HTTP reason code that explains the error. For example, if {@code
* httpCode} is {@code 404}, the reason phrase should be {@code NOT FOUND}.
* @return the generated {@link GoogleJsonResponseException}, as specified.
* @throws IOException if request transport fails.
*/
public static GoogleJsonResponseException newMock(
JsonFactory jsonFactory, int httpCode, String reasonPhrase) throws IOException {
MockLowLevelHttpResponse otherServiceUnavaiableLowLevelResponse =
new MockLowLevelHttpResponse()
.setStatusCode(httpCode)
.setReasonPhrase(reasonPhrase)
.setContentType(Json.MEDIA_TYPE)
.setContent(
"{ \"error\": { \"errors\": [ { \"reason\": \""
+ reasonPhrase
+ "\" } ], "
+ "\"code\": "
+ httpCode
+ " } }");
MockHttpTransport otherTransport =
new MockHttpTransport.Builder()
.setLowLevelHttpResponse(otherServiceUnavaiableLowLevelResponse)
.build();
HttpRequest otherRequest =
otherTransport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL);
otherRequest.setThrowExceptionOnExecuteError(false);
HttpResponse otherServiceUnavailableResponse = otherRequest.execute();
return GoogleJsonResponseException.from(jsonFactory, otherServiceUnavailableResponse);
}
}
| googleapis/google-api-java-client | google-api-client/src/main/java/com/google/api/client/googleapis/testing/json/GoogleJsonResponseExceptionFactoryTesting.java | Java | apache-2.0 | 3,555 |
<!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_26) on Sun Dec 30 01:26:12 PST 2012 -->
<TITLE>
Uses of Class org.apache.hadoop.fs.s3.S3FileSystem (Hadoop 1.0.4-SNAPSHOT API)
</TITLE>
<META NAME="date" CONTENT="2012-12-30">
<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="Uses of Class org.apache.hadoop.fs.s3.S3FileSystem (Hadoop 1.0.4-SNAPSHOT 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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/hadoop/fs/s3/S3FileSystem.html" title="class in org.apache.hadoop.fs.s3"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/hadoop/fs/s3//class-useS3FileSystem.html" target="_top"><B>FRAMES</B></A>
<A HREF="S3FileSystem.html" target="_top"><B>NO FRAMES</B></A>
<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>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.hadoop.fs.s3.S3FileSystem</B></H2>
</CENTER>
No usage of org.apache.hadoop.fs.s3.S3FileSystem
<P>
<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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/hadoop/fs/s3/S3FileSystem.html" title="class in org.apache.hadoop.fs.s3"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/hadoop/fs/s3//class-useS3FileSystem.html" target="_top"><B>FRAMES</B></A>
<A HREF="S3FileSystem.html" target="_top"><B>NO FRAMES</B></A>
<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>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2009 The Apache Software Foundation
</BODY>
</HTML>
| davidl1/hortonworks-extension | build/docs/api/org/apache/hadoop/fs/s3/class-use/S3FileSystem.html | HTML | apache-2.0 | 6,043 |
/* Generic definitions */
#define Custom
#define PACKAGE it.unimi.dsi.fastutil.shorts
#define VALUE_PACKAGE it.unimi.dsi.fastutil.floats
/* Assertions (useful to generate conditional code) */
#unassert keyclass
#assert keyclass(Short)
#unassert keys
#assert keys(primitive)
#unassert valueclass
#assert valueclass(Float)
#unassert values
#assert values(primitive)
/* Current type and class (and size, if applicable) */
#define KEY_TYPE short
#define VALUE_TYPE float
#define KEY_CLASS Short
#define VALUE_CLASS Float
#if #keyclass(Object) || #keyclass(Reference)
#define KEY_GENERIC_CLASS K
#define KEY_GENERIC_TYPE K
#define KEY_GENERIC <K>
#define KEY_GENERIC_WILDCARD <?>
#define KEY_EXTENDS_GENERIC <? extends K>
#define KEY_SUPER_GENERIC <? super K>
#define KEY_GENERIC_CAST (K)
#define KEY_GENERIC_ARRAY_CAST (K[])
#define KEY_GENERIC_BIG_ARRAY_CAST (K[][])
#else
#define KEY_GENERIC_CLASS KEY_CLASS
#define KEY_GENERIC_TYPE KEY_TYPE
#define KEY_GENERIC
#define KEY_GENERIC_WILDCARD
#define KEY_EXTENDS_GENERIC
#define KEY_SUPER_GENERIC
#define KEY_GENERIC_CAST
#define KEY_GENERIC_ARRAY_CAST
#define KEY_GENERIC_BIG_ARRAY_CAST
#endif
#if #valueclass(Object) || #valueclass(Reference)
#define VALUE_GENERIC_CLASS V
#define VALUE_GENERIC_TYPE V
#define VALUE_GENERIC <V>
#define VALUE_EXTENDS_GENERIC <? extends V>
#define VALUE_GENERIC_CAST (V)
#define VALUE_GENERIC_ARRAY_CAST (V[])
#else
#define VALUE_GENERIC_CLASS VALUE_CLASS
#define VALUE_GENERIC_TYPE VALUE_TYPE
#define VALUE_GENERIC
#define VALUE_EXTENDS_GENERIC
#define VALUE_GENERIC_CAST
#define VALUE_GENERIC_ARRAY_CAST
#endif
#if #keyclass(Object) || #keyclass(Reference)
#if #valueclass(Object) || #valueclass(Reference)
#define KEY_VALUE_GENERIC <K,V>
#define KEY_VALUE_EXTENDS_GENERIC <? extends K, ? extends V>
#else
#define KEY_VALUE_GENERIC <K>
#define KEY_VALUE_EXTENDS_GENERIC <? extends K>
#endif
#else
#if #valueclass(Object) || #valueclass(Reference)
#define KEY_VALUE_GENERIC <V>
#define KEY_VALUE_EXTENDS_GENERIC <? extends V>
#else
#define KEY_VALUE_GENERIC
#define KEY_VALUE_EXTENDS_GENERIC
#endif
#endif
/* Value methods */
#define KEY_VALUE shortValue
#define VALUE_VALUE floatValue
/* Interfaces (keys) */
#define COLLECTION ShortCollection
#define SET ShortSet
#define HASH ShortHash
#define SORTED_SET ShortSortedSet
#define STD_SORTED_SET ShortSortedSet
#define FUNCTION Short2FloatFunction
#define MAP Short2FloatMap
#define SORTED_MAP Short2FloatSortedMap
#if #keyclass(Object) || #keyclass(Reference)
#define STD_SORTED_MAP SortedMap
#define STRATEGY Strategy
#else
#define STD_SORTED_MAP Short2FloatSortedMap
#define STRATEGY PACKAGE.ShortHash.Strategy
#endif
#define LIST ShortList
#define BIG_LIST ShortBigList
#define STACK ShortStack
#define PRIORITY_QUEUE ShortPriorityQueue
#define INDIRECT_PRIORITY_QUEUE ShortIndirectPriorityQueue
#define INDIRECT_DOUBLE_PRIORITY_QUEUE ShortIndirectDoublePriorityQueue
#define KEY_ITERATOR ShortIterator
#define KEY_ITERABLE ShortIterable
#define KEY_BIDI_ITERATOR ShortBidirectionalIterator
#define KEY_LIST_ITERATOR ShortListIterator
#define KEY_BIG_LIST_ITERATOR ShortBigListIterator
#define STD_KEY_ITERATOR ShortIterator
#define KEY_COMPARATOR ShortComparator
/* Interfaces (values) */
#define VALUE_COLLECTION FloatCollection
#define VALUE_ARRAY_SET FloatArraySet
#define VALUE_ITERATOR FloatIterator
#define VALUE_LIST_ITERATOR FloatListIterator
/* Abstract implementations (keys) */
#define ABSTRACT_COLLECTION AbstractShortCollection
#define ABSTRACT_SET AbstractShortSet
#define ABSTRACT_SORTED_SET AbstractShortSortedSet
#define ABSTRACT_FUNCTION AbstractShort2FloatFunction
#define ABSTRACT_MAP AbstractShort2FloatMap
#define ABSTRACT_FUNCTION AbstractShort2FloatFunction
#define ABSTRACT_SORTED_MAP AbstractShort2FloatSortedMap
#define ABSTRACT_LIST AbstractShortList
#define ABSTRACT_BIG_LIST AbstractShortBigList
#define SUBLIST ShortSubList
#define ABSTRACT_PRIORITY_QUEUE AbstractShortPriorityQueue
#define ABSTRACT_STACK AbstractShortStack
#define KEY_ABSTRACT_ITERATOR AbstractShortIterator
#define KEY_ABSTRACT_BIDI_ITERATOR AbstractShortBidirectionalIterator
#define KEY_ABSTRACT_LIST_ITERATOR AbstractShortListIterator
#define KEY_ABSTRACT_BIG_LIST_ITERATOR AbstractShortBigListIterator
#if #keyclass(Object)
#define KEY_ABSTRACT_COMPARATOR Comparator
#else
#define KEY_ABSTRACT_COMPARATOR AbstractShortComparator
#endif
/* Abstract implementations (values) */
#define VALUE_ABSTRACT_COLLECTION AbstractFloatCollection
#define VALUE_ABSTRACT_ITERATOR AbstractFloatIterator
#define VALUE_ABSTRACT_BIDI_ITERATOR AbstractFloatBidirectionalIterator
/* Static containers (keys) */
#define COLLECTIONS ShortCollections
#define SETS ShortSets
#define SORTED_SETS ShortSortedSets
#define LISTS ShortLists
#define BIG_LISTS ShortBigLists
#define MAPS Short2FloatMaps
#define FUNCTIONS Short2FloatFunctions
#define SORTED_MAPS Short2FloatSortedMaps
#define PRIORITY_QUEUES ShortPriorityQueues
#define HEAPS ShortHeaps
#define SEMI_INDIRECT_HEAPS ShortSemiIndirectHeaps
#define INDIRECT_HEAPS ShortIndirectHeaps
#define ARRAYS ShortArrays
#define BIG_ARRAYS ShortBigArrays
#define ITERATORS ShortIterators
#define BIG_LIST_ITERATORS ShortBigListIterators
#define COMPARATORS ShortComparators
/* Static containers (values) */
#define VALUE_COLLECTIONS FloatCollections
#define VALUE_SETS FloatSets
#define VALUE_ARRAYS FloatArrays
/* Implementations */
#define OPEN_HASH_SET ShortOpenCustomHashSet
#define OPEN_HASH_BIG_SET ShortOpenCustomHashBigSet
#define OPEN_DOUBLE_HASH_SET ShortOpenCustomDoubleHashSet
#define OPEN_HASH_MAP Short2FloatOpenCustomHashMap
#define STRIPED_OPEN_HASH_MAP StripedShort2FloatOpenCustomHashMap
#define OPEN_DOUBLE_HASH_MAP Short2FloatOpenCustomDoubleHashMap
#define ARRAY_SET ShortArraySet
#define ARRAY_MAP Short2FloatArrayMap
#define LINKED_OPEN_HASH_SET ShortLinkedOpenHashSet
#define AVL_TREE_SET ShortAVLTreeSet
#define RB_TREE_SET ShortRBTreeSet
#define AVL_TREE_MAP Short2FloatAVLTreeMap
#define RB_TREE_MAP Short2FloatRBTreeMap
#define ARRAY_LIST ShortArrayList
#define BIG_ARRAY_BIG_LIST ShortBigArrayBigList
#define ARRAY_FRONT_CODED_LIST ShortArrayFrontCodedList
#define HEAP_PRIORITY_QUEUE ShortHeapPriorityQueue
#define HEAP_SEMI_INDIRECT_PRIORITY_QUEUE ShortHeapSemiIndirectPriorityQueue
#define HEAP_INDIRECT_PRIORITY_QUEUE ShortHeapIndirectPriorityQueue
#define HEAP_SESQUI_INDIRECT_DOUBLE_PRIORITY_QUEUE ShortHeapSesquiIndirectDoublePriorityQueue
#define HEAP_INDIRECT_DOUBLE_PRIORITY_QUEUE ShortHeapIndirectDoublePriorityQueue
#define ARRAY_FIFO_QUEUE ShortArrayFIFOQueue
#define ARRAY_PRIORITY_QUEUE ShortArrayPriorityQueue
#define ARRAY_INDIRECT_PRIORITY_QUEUE ShortArrayIndirectPriorityQueue
#define ARRAY_INDIRECT_DOUBLE_PRIORITY_QUEUE ShortArrayIndirectDoublePriorityQueue
/* Synchronized wrappers */
#define SYNCHRONIZED_COLLECTION SynchronizedShortCollection
#define SYNCHRONIZED_SET SynchronizedShortSet
#define SYNCHRONIZED_SORTED_SET SynchronizedShortSortedSet
#define SYNCHRONIZED_FUNCTION SynchronizedShort2FloatFunction
#define SYNCHRONIZED_MAP SynchronizedShort2FloatMap
#define SYNCHRONIZED_LIST SynchronizedShortList
/* Unmodifiable wrappers */
#define UNMODIFIABLE_COLLECTION UnmodifiableShortCollection
#define UNMODIFIABLE_SET UnmodifiableShortSet
#define UNMODIFIABLE_SORTED_SET UnmodifiableShortSortedSet
#define UNMODIFIABLE_FUNCTION UnmodifiableShort2FloatFunction
#define UNMODIFIABLE_MAP UnmodifiableShort2FloatMap
#define UNMODIFIABLE_LIST UnmodifiableShortList
#define UNMODIFIABLE_KEY_ITERATOR UnmodifiableShortIterator
#define UNMODIFIABLE_KEY_BIDI_ITERATOR UnmodifiableShortBidirectionalIterator
#define UNMODIFIABLE_KEY_LIST_ITERATOR UnmodifiableShortListIterator
/* Other wrappers */
#define KEY_READER_WRAPPER ShortReaderWrapper
#define KEY_DATA_INPUT_WRAPPER ShortDataInputWrapper
/* Methods (keys) */
#define NEXT_KEY nextShort
#define PREV_KEY previousShort
#define FIRST_KEY firstShortKey
#define LAST_KEY lastShortKey
#define GET_KEY getShort
#define REMOVE_KEY removeShort
#define READ_KEY readShort
#define WRITE_KEY writeShort
#define DEQUEUE dequeueShort
#define DEQUEUE_LAST dequeueLastShort
#define SUBLIST_METHOD shortSubList
#define SINGLETON_METHOD shortSingleton
#define FIRST firstShort
#define LAST lastShort
#define TOP topShort
#define PEEK peekShort
#define POP popShort
#define KEY_ITERATOR_METHOD shortIterator
#define KEY_LIST_ITERATOR_METHOD shortListIterator
#define KEY_EMPTY_ITERATOR_METHOD emptyShortIterator
#define AS_KEY_ITERATOR asShortIterator
#define TO_KEY_ARRAY toShortArray
#define ENTRY_GET_KEY getShortKey
#define REMOVE_FIRST_KEY removeFirstShort
#define REMOVE_LAST_KEY removeLastShort
#define PARSE_KEY parseShort
#define LOAD_KEYS loadShorts
#define LOAD_KEYS_BIG loadShortsBig
#define STORE_KEYS storeShorts
/* Methods (values) */
#define NEXT_VALUE nextFloat
#define PREV_VALUE previousFloat
#define READ_VALUE readFloat
#define WRITE_VALUE writeFloat
#define VALUE_ITERATOR_METHOD floatIterator
#define ENTRY_GET_VALUE getFloatValue
#define REMOVE_FIRST_VALUE removeFirstFloat
#define REMOVE_LAST_VALUE removeLastFloat
/* Methods (keys/values) */
#define ENTRYSET short2FloatEntrySet
/* Methods that have special names depending on keys (but the special names depend on values) */
#if #keyclass(Object) || #keyclass(Reference)
#define GET_VALUE getFloat
#define REMOVE_VALUE removeFloat
#else
#define GET_VALUE get
#define REMOVE_VALUE remove
#endif
/* Equality */
#ifdef Custom
#define KEY_EQUALS(x,y) ( strategy.equals( (x), KEY_GENERIC_CAST (y) ) )
#else
#if #keyclass(Object)
#define KEY_EQUALS(x,y) ( (x) == null ? (y) == null : (x).equals(y) )
#define KEY_EQUALS_NOT_NULL(x,y) ( (x).equals(y) )
#else
#define KEY_EQUALS(x,y) ( (x) == (y) )
#define KEY_EQUALS_NOT_NULL(x,y) ( (x) == (y) )
#endif
#endif
#if #valueclass(Object)
#define VALUE_EQUALS(x,y) ( (x) == null ? (y) == null : (x).equals(y) )
#else
#define VALUE_EQUALS(x,y) ( (x) == (y) )
#endif
/* Object/Reference-only definitions (keys) */
#if #keyclass(Object) || #keyclass(Reference)
#define REMOVE remove
#define KEY_OBJ2TYPE(x) (x)
#define KEY_CLASS2TYPE(x) (x)
#define KEY2OBJ(x) (x)
#if #keyclass(Object)
#ifdef Custom
#define KEY2JAVAHASH(x) ( strategy.hashCode( KEY_GENERIC_CAST (x)) )
#define KEY2INTHASH(x) ( it.unimi.dsi.fastutil.HashCommon.murmurHash3( strategy.hashCode( KEY_GENERIC_CAST (x)) ) )
#define KEY2LONGHASH(x) ( it.unimi.dsi.fastutil.HashCommon.murmurHash3( (long)strategy.hashCode( KEY_GENERIC_CAST (x)) ) )
#else
#define KEY2JAVAHASH(x) ( (x) == null ? 0 : (x).hashCode() )
#define KEY2INTHASH(x) ( (x) == null ? 0x87fcd5c : it.unimi.dsi.fastutil.HashCommon.murmurHash3( (x).hashCode() ) )
#define KEY2LONGHASH(x) ( (x) == null ? 0x810879608e4259ccL : it.unimi.dsi.fastutil.HashCommon.murmurHash3( (long)(x).hashCode() ) )
#endif
#else
#define KEY2JAVAHASH(x) ( (x) == null ? 0 : System.identityHashCode(x) )
#define KEY2INTHASH(x) ( (x) == null ? 0x87fcd5c : it.unimi.dsi.fastutil.HashCommon.murmurHash3( System.identityHashCode(x) ) )
#define KEY2LONGHASH(x) ( (x) == null ? 0x810879608e4259ccL : it.unimi.dsi.fastutil.HashCommon.murmurHash3( (long)System.identityHashCode(x) ) )
#endif
#define KEY_CMP(x,y) ( ((Comparable<KEY_GENERIC_CLASS>)(x)).compareTo(y) )
#define KEY_CMP_EQ(x,y) ( ((Comparable<KEY_GENERIC_CLASS>)(x)).compareTo(y) == 0 )
#define KEY_LESS(x,y) ( ((Comparable<KEY_GENERIC_CLASS>)(x)).compareTo(y) < 0 )
#define KEY_LESSEQ(x,y) ( ((Comparable<KEY_GENERIC_CLASS>)(x)).compareTo(y) <= 0 )
#define KEY_NULL (null)
#else
/* Primitive-type-only definitions (keys) */
#define REMOVE rem
#define KEY_CLASS2TYPE(x) ((x).KEY_VALUE())
#define KEY_OBJ2TYPE(x) (KEY_CLASS2TYPE((KEY_CLASS)(x)))
#define KEY2OBJ(x) (KEY_CLASS.valueOf(x))
#if #keyclass(Boolean)
#define KEY_CMP_EQ(x,y) ( (x) == (y) )
#define KEY_NULL (false)
#define KEY_CMP(x,y) ( !(x) && (y) ? -1 : ( (x) == (y) ? 0 : 1 ) )
#define KEY_LESS(x,y) ( !(x) && (y) )
#define KEY_LESSEQ(x,y) ( !(x) || (y) )
#else
#define KEY_NULL ((KEY_TYPE)0)
#if #keyclass(Float) || #keyclass(Double)
#define KEY_CMP_EQ(x,y) ( KEY_CLASS.compare((x),(y)) == 0 )
#define KEY_CMP(x,y) ( KEY_CLASS.compare((x),(y)) )
#define KEY_LESS(x,y) ( KEY_CLASS.compare((x),(y)) < 0 )
#define KEY_LESSEQ(x,y) ( KEY_CLASS.compare((x),(y)) <= 0 )
#else
#define KEY_CMP_EQ(x,y) ( (x) == (y) )
#define KEY_CMP(x,y) ( (x) < (y) ? -1 : ( (x) == (y) ? 0 : 1 ) )
#define KEY_LESS(x,y) ( (x) < (y) )
#define KEY_LESSEQ(x,y) ( (x) <= (y) )
#endif
#if #keyclass(Float)
#define KEY2LEXINT(x) fixFloat(x)
#elif #keyclass(Double)
#define KEY2LEXINT(x) fixDouble(x)
#else
#define KEY2LEXINT(x) (x)
#endif
#endif
#ifdef Custom
#define KEY2JAVAHASH(x) ( strategy.hashCode(x) )
#define KEY2INTHASH(x) ( it.unimi.dsi.fastutil.HashCommon.murmurHash3( strategy.hashCode(x) ) )
#define KEY2LONGHASH(x) ( it.unimi.dsi.fastutil.HashCommon.murmurHash3( (long)strategy.hashCode(x) ) )
#else
#if #keyclass(Float)
#define KEY2JAVAHASH(x) it.unimi.dsi.fastutil.HashCommon.float2int(x)
#define KEY2INTHASH(x) it.unimi.dsi.fastutil.HashCommon.murmurHash3( it.unimi.dsi.fastutil.HashCommon.float2int(x) )
#define KEY2LONGHASH(x) it.unimi.dsi.fastutil.HashCommon.murmurHash3( (long)it.unimi.dsi.fastutil.HashCommon.float2int(x) )
#elif #keyclass(Double)
#define KEY2JAVAHASH(x) it.unimi.dsi.fastutil.HashCommon.double2int(x)
#define KEY2INTHASH(x) (int)it.unimi.dsi.fastutil.HashCommon.murmurHash3(Double.doubleToRawLongBits(x))
#define KEY2LONGHASH(x) it.unimi.dsi.fastutil.HashCommon.murmurHash3(Double.doubleToRawLongBits(x))
#elif #keyclass(Long)
#define KEY2JAVAHASH(x) it.unimi.dsi.fastutil.HashCommon.long2int(x)
#define KEY2INTHASH(x) (int)it.unimi.dsi.fastutil.HashCommon.murmurHash3(x)
#define KEY2LONGHASH(x) it.unimi.dsi.fastutil.HashCommon.murmurHash3(x)
#elif #keyclass(Boolean)
#define KEY2JAVAHASH(x) ((x) ? 1231 : 1237)
#define KEY2INTHASH(x) ((x) ? 0xfab5368 : 0xcba05e7b)
#define KEY2LONGHASH(x) ((x) ? 0x74a19fc8b6428188L : 0xbaeca2031a4fd9ecL)
#else
#define KEY2JAVAHASH(x) (x)
#define KEY2INTHASH(x) ( it.unimi.dsi.fastutil.HashCommon.murmurHash3( (x) ) )
#define KEY2LONGHASH(x) ( it.unimi.dsi.fastutil.HashCommon.murmurHash3( (long)(x) ) )
#endif
#endif
#endif
/* Object/Reference-only definitions (values) */
#if #valueclass(Object) || #valueclass(Reference)
#define VALUE_OBJ2TYPE(x) (x)
#define VALUE_CLASS2TYPE(x) (x)
#define VALUE2OBJ(x) (x)
#if #valueclass(Object)
#define VALUE2JAVAHASH(x) ( (x) == null ? 0 : (x).hashCode() )
#else
#define VALUE2JAVAHASH(x) ( (x) == null ? 0 : System.identityHashCode(x) )
#endif
#define VALUE_NULL (null)
#define OBJECT_DEFAULT_RETURN_VALUE (this.defRetValue)
#else
/* Primitive-type-only definitions (values) */
#define VALUE_CLASS2TYPE(x) ((x).VALUE_VALUE())
#define VALUE_OBJ2TYPE(x) (VALUE_CLASS2TYPE((VALUE_CLASS)(x)))
#define VALUE2OBJ(x) (VALUE_CLASS.valueOf(x))
#if #valueclass(Float) || #valueclass(Double) || #valueclass(Long)
#define VALUE_NULL (0)
#define VALUE2JAVAHASH(x) it.unimi.dsi.fastutil.HashCommon.float2int(x)
#elif #valueclass(Boolean)
#define VALUE_NULL (false)
#define VALUE2JAVAHASH(x) (x ? 1231 : 1237)
#else
#if #valueclass(Integer)
#define VALUE_NULL (0)
#else
#define VALUE_NULL ((VALUE_TYPE)0)
#endif
#define VALUE2JAVAHASH(x) (x)
#endif
#define OBJECT_DEFAULT_RETURN_VALUE (null)
#endif
#include "drv/OpenCustomHashMap.drv"
| karussell/fastutil | src/it/unimi/dsi/fastutil/shorts/Short2FloatOpenCustomHashMap.c | C | apache-2.0 | 15,409 |
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Class: Selenium::Rake::ServerTask
— Documentation by YARD 0.8.3
</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '../../';
framesUrl = "../../frames.html#!" + escape(window.location.href);
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
</head>
<body>
<div id="header">
<div id="menu">
<a href="../../_index.html">Index (S)</a> »
<span class='title'><span class='object_link'><a href="../../Selenium.html" title="Selenium (module)">Selenium</a></span></span> » <span class='title'><span class='object_link'><a href="../Rake.html" title="Selenium::Rake (module)">Rake</a></span></span>
»
<span class="title">ServerTask</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../class_list.html">
Class List
</a>
<a class="full_list_link" id="method_list_link"
href="../../method_list.html">
Method List
</a>
<a class="full_list_link" id="file_list_link"
href="../../file_list.html">
File List
</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Class: Selenium::Rake::ServerTask
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Selenium::Rake::ServerTask</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2">Includes:</dt>
<dd class="r2">Rake::DSL</dd>
<dt class="r1 last">Defined in:</dt>
<dd class="r1 last">rb/lib/selenium/rake/server_task.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Defines rake tasks for starting, stopping and restarting the Selenium
server.</p>
<p>Usage:</p>
<pre class="code ruby"><code><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>selenium/rake/server_task</span><span class='tstring_end'>'</span></span>
<span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Rake</span><span class='op'>::</span><span class='const'>ServerTask</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_t'>t</span><span class='op'>|</span>
<span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_jar'>jar</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/path/to/selenium-server-standalone.jar</span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span> <span class='op'>=</span> <span class='int'>4444</span>
<span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='qwords_beg'>%w[</span><span class='tstring_content'>-some</span><span class='words_sep'> </span><span class='tstring_content'>options</span><span class='words_sep'>]</span>
<span class='kw'>end</span></code></pre>
<p>Alternatively, you can have the task download a specific version of the
server:</p>
<pre class="code ruby"><code><span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Rake</span><span class='op'>::</span><span class='const'>ServerTask</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:server</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_t'>t</span><span class='op'>|</span>
<span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>2.6.0</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span></code></pre>
<p>or the latest version</p>
<pre class="code ruby"><code><span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Rake</span><span class='op'>::</span><span class='const'>ServerTask</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:server</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_t'>t</span><span class='op'>|</span>
<span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='symbol'>:latest</span>
<span class='kw'>end</span></code></pre>
<p>Tasks defined:</p>
<pre class="code ruby"><code>rake selenium:server:start
rake selenium:server:stop
rake selenium:server:restart</code></pre>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#background-instance_method" title="#background (instance method)">- (Object) <strong>background</strong> </a>
(also: #background?)
</span>
<span class="summary_desc"><div class='inline'>
<p>Whether we should detach from the server process.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#jar-instance_method" title="#jar (instance method)">- (Object) <strong>jar</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Path to the selenium server jar.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#log-instance_method" title="#log (instance method)">- (Object) <strong>log</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Configure logging.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#opts-instance_method" title="#opts (instance method)">- (Object) <strong>opts</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add additional options passed to the server jar.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#port-instance_method" title="#port (instance method)">- (Object) <strong>port</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Port to use for the server.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#timeout-instance_method" title="#timeout (instance method)">- (Object) <strong>timeout</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Timeout in seconds for the server to start/stop.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#version-instance_method" title="#version (instance method)">- (Object) <strong>version</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Specify the version of the server jar to download.</p>
</div></span>
</li>
</ul>
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">- (ServerTask) <strong>initialize</strong>(prefix = "selenium:server") {|_self| ... }</a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of ServerTask.</p>
</div></span>
</li>
</ul>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
- (<tt><span class='object_link'><a href="" title="Selenium::Rake::ServerTask (class)">ServerTask</a></span></tt>) <strong>initialize</strong>(prefix = "selenium:server") {|_self| ... }
</h3><div class="docstring">
<div class="discussion">
<p>A new instance of ServerTask</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Yields:</p>
<ul class="yield">
<li>
<span class='type'>(<tt>_self</tt>)</span>
</li>
</ul>
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
<li>
<span class='name'>_self</span>
<span class='type'>(<tt><span class='object_link'><a href="" title="Selenium::Rake::ServerTask (class)">Selenium::Rake::ServerTask</a></span></tt>)</span>
—
<div class='inline'>
<p>the object that the method was called on</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 99</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_prefix'>prefix</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>selenium:server</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='ivar'>@jar</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='ivar'>@prefix</span> <span class='op'>=</span> <span class='id identifier rubyid_prefix'>prefix</span>
<span class='ivar'>@port</span> <span class='op'>=</span> <span class='int'>4444</span>
<span class='ivar'>@timeout</span> <span class='op'>=</span> <span class='int'>30</span>
<span class='ivar'>@background</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='ivar'>@log</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='ivar'>@opts</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='ivar'>@version</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='kw'>yield</span> <span class='kw'>self</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
<span class='kw'>if</span> <span class='ivar'>@version</span>
<span class='ivar'>@jar</span> <span class='op'>=</span> <span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_download'>download</span><span class='lparen'>(</span><span class='ivar'>@version</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>unless</span> <span class='ivar'>@jar</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>MissingJarFileError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>must provide path to the selenium server jar</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='ivar'>@server</span> <span class='op'>=</span> <span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@jar</span><span class='comma'>,</span> <span class='symbol'>:port</span> <span class='op'>=></span> <span class='ivar'>@port</span><span class='comma'>,</span>
<span class='symbol'>:timeout</span> <span class='op'>=></span> <span class='ivar'>@timeout</span><span class='comma'>,</span>
<span class='symbol'>:background</span> <span class='op'>=></span> <span class='ivar'>@background</span><span class='comma'>,</span>
<span class='symbol'>:log</span> <span class='op'>=></span> <span class='ivar'>@log</span> <span class='rparen'>)</span>
<span class='ivar'>@server</span> <span class='op'><<</span> <span class='ivar'>@opts</span>
<span class='id identifier rubyid_define_start_task'>define_start_task</span>
<span class='id identifier rubyid_define_stop_task'>define_stop_task</span>
<span class='id identifier rubyid_define_restart_task'>define_restart_task</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id="background=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="background-instance_method">
- (<tt>Object</tt>) <strong>background</strong>
<span class="aliases">Also known as:
<span class="names"><span id='background?-instance_method'>background?</span></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Whether we should detach from the server process. Default: true</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
72
73
74</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 72</span>
<span class='kw'>def</span> <span class='id identifier rubyid_background'>background</span>
<span class='ivar'>@background</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="jar=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="jar-instance_method">
- (<tt>Object</tt>) <strong>jar</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Path to the selenium server jar</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
50
51
52</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 50</span>
<span class='kw'>def</span> <span class='id identifier rubyid_jar'>jar</span>
<span class='ivar'>@jar</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="log=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="log-instance_method">
- (<tt>Object</tt>) <strong>log</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Configure logging. Pass a log file path or a boolean. Default: true</p>
<p>true - log to stdout/stderr false - no logging String - log to the
specified file</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
84
85
86</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 84</span>
<span class='kw'>def</span> <span class='id identifier rubyid_log'>log</span>
<span class='ivar'>@log</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="opts=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="opts-instance_method">
- (<tt>Object</tt>) <strong>opts</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Add additional options passed to the server jar.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
90
91
92</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 90</span>
<span class='kw'>def</span> <span class='id identifier rubyid_opts'>opts</span>
<span class='ivar'>@opts</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="port=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="port-instance_method">
- (<tt>Object</tt>) <strong>port</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Port to use for the server. Default: 4444</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
58
59
60</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 58</span>
<span class='kw'>def</span> <span class='id identifier rubyid_port'>port</span>
<span class='ivar'>@port</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="timeout=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="timeout-instance_method">
- (<tt>Object</tt>) <strong>timeout</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Timeout in seconds for the server to start/stop. Default: 30</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
65
66
67</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 65</span>
<span class='kw'>def</span> <span class='id identifier rubyid_timeout'>timeout</span>
<span class='ivar'>@timeout</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="version=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="version-instance_method">
- (<tt>Object</tt>) <strong>version</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Specify the version of the server jar to download</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
96
97
98</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 96</span>
<span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
<span class='ivar'>@version</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Jan 21 19:22:44 2013 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.3 (ruby-1.9.3).
</div>
</body>
</html> | qamate/iOS-selenium-server | docs/api/rb/Selenium/Rake/ServerTask.html | HTML | apache-2.0 | 20,743 |
package pl.mobilization.conference2015.sponsor;
import android.content.Context;
import android.content.Intent;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.ArrayList;
import java.util.List;
import de.greenrobot.event.EventBus;
import lombok.extern.slf4j.Slf4j;
import pl.mobilization.conference2015.sponsor.events.OnSponsorClickEvent;
import pl.mobilization.conference2015.sponsor.events.SponsorUpdatedEvent;
import pl.mobilization.conference2015.sponsor.repository.SponsorRepoModel;
import pl.mobilization.conference2015.sponsor.repository.SponsorRepository;
import pl.mobilization.conference2015.sponsor.rest.SponsorRestService;
import pl.mobilization.conference2015.sponsor.rest.SponsorListRestModel;
import pl.mobilization.conference2015.sponsor.view.SponsorsView;
import pl.mobilization.conference2015.sponsor.view.SponsorsListViewModel;
import rx.Observable;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
/**
* Created by msaramak on 19.08.15.
*/
@Slf4j
public class SponsorRestModelPresenterTest {
@Mock
SponsorRestService sponsorRestService;
@Mock
EventBus eventBus;
@Mock
SponsorsView view;
@Mock
SponsorRepository sponsorRepository;
@Mock
Context context;
private SponsorPresenter testedSp;
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
//GIVEN a sponsor presenter..
testedSp = new SponsorPresenter(sponsorRepository, eventBus);
List<SponsorRepoModel> l = new ArrayList<>();
when(sponsorRepository.getSponsors()).thenReturn(Observable.<List<SponsorRepoModel>>just(l));
}
@After
public void tearDown() throws Exception {
}
@SuppressWarnings("ResourceType")
@Test
public void testOnBindView() throws Exception {
//GIVEN a sponsor presenter
verify(eventBus).register(testedSp);
//WHEN bind view
testedSp.onBindView(context, view);
//THEN check if background service is setup
verify(context).bindService(any(Intent.class), any(), eq(Context.BIND_AUTO_CREATE));
}
@Test
public void shouldDisplayDialogWhenOnSponsorClickEventCalled() throws Exception {
//GIVEN a tested sponsor presenter with binded view
testedSp.onBindView(context, view);
//WHEN event come
OnSponsorClickEvent event = new OnSponsorClickEvent(null);
testedSp.onEvent(event);
//THEN
verify(view).showSponsorDialog(event);
}
@Test
public void testOnUpdateSponsorList() throws Exception {
//GIVEN a tested sponsor presenter with binded view
testedSp.onBindView(context, view);
//WHEN sponsors list is updated
SponsorUpdatedEvent event = new SponsorUpdatedEvent();
testedSp.onEvent(event);
//THEN
verify(view).updateSponsors(any(SponsorsListViewModel.class));
}
} | Mobilization/mobandroid5 | app/src/test/java/pl/mobilization/conference2015/sponsor/SponsorRestModelPresenterTest.java | Java | apache-2.0 | 3,058 |
package org.liveontologies.protege.justification.proof.preferences;
/*-
* #%L
* Protege Proof Justification
* $Id:$
* $HeadURL:$
* %%
* Copyright (C) 2016 - 2017 Live Ontologies Project
* %%
* 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.
* #L%
*/
import org.eclipse.core.runtime.IExtension;
import org.protege.editor.core.editorkit.EditorKit;
import org.protege.editor.core.plugin.AbstractPluginLoader;
public class ProofPreferencesPanelPluginLoader extends AbstractPluginLoader<ProofPreferencesPanelPlugin> {
private final EditorKit kit;
private static final String ID = "JustificationProofPreferences";
private static final String KEY = "org.liveontologies.protege.justification.proof";
public ProofPreferencesPanelPluginLoader(EditorKit kit) {
super(KEY, ID);
this.kit = kit;
}
@Override
protected ProofPreferencesPanelPlugin createInstance(IExtension extension) {
return new ProofPreferencesPanelPlugin(kit, extension);
}
}
| liveontologies/protege-proof-justification | src/main/java/org/liveontologies/protege/justification/proof/preferences/ProofPreferencesPanelPluginLoader.java | Java | apache-2.0 | 1,491 |
# encoding: utf-8
u'''MCL — Publication Folder'''
from ._base import IIngestableFolder, Ingestor, IngestableFolderView
from .interfaces import IPublication
from five import grok
class IPublicationFolder(IIngestableFolder):
u'''Folder containing publications.'''
class PublicationIngestor(Ingestor):
u'''RDF ingestor for publication.'''
grok.context(IPublicationFolder)
def getContainedObjectInterface(self):
return IPublication
class View(IngestableFolderView):
u'''View for an publication folder'''
grok.context(IPublicationFolder)
| MCLConsortium/mcl-site | src/jpl.mcl.site.knowledge/src/jpl/mcl/site/knowledge/publicationfolder.py | Python | apache-2.0 | 575 |
export interface SimpleAPIConfig {
}
export interface SimpleAPI {
count: number;
add(n?: number): void;
sub(n?: number): void;
}
| jsnoble/teraslice | packages/teraslice-test-harness/test/fixtures/asset/simple-api/interfaces.ts | TypeScript | apache-2.0 | 143 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.exterior_equipment import ExteriorFuelEquipment
log = logging.getLogger(__name__)
class TestExteriorFuelEquipment(unittest.TestCase):
def setUp(self):
self.fd, self.path = tempfile.mkstemp()
def tearDown(self):
os.remove(self.path)
def test_create_exteriorfuelequipment(self):
pyidf.validation_level = ValidationLevel.error
obj = ExteriorFuelEquipment()
# alpha
var_name = "Name"
obj.name = var_name
# alpha
var_fuel_use_type = "Electricity"
obj.fuel_use_type = var_fuel_use_type
# object-list
var_schedule_name = "object-list|Schedule Name"
obj.schedule_name = var_schedule_name
# real
var_design_level = 0.0
obj.design_level = var_design_level
# alpha
var_enduse_subcategory = "End-Use Subcategory"
obj.enduse_subcategory = var_enduse_subcategory
idf = IDF()
idf.add(obj)
idf.save(self.path, check=False)
with open(self.path, mode='r') as f:
for line in f:
log.debug(line.strip())
idf2 = IDF(self.path)
self.assertEqual(idf2.exteriorfuelequipments[0].name, var_name)
self.assertEqual(idf2.exteriorfuelequipments[0].fuel_use_type, var_fuel_use_type)
self.assertEqual(idf2.exteriorfuelequipments[0].schedule_name, var_schedule_name)
self.assertAlmostEqual(idf2.exteriorfuelequipments[0].design_level, var_design_level)
self.assertEqual(idf2.exteriorfuelequipments[0].enduse_subcategory, var_enduse_subcategory) | rbuffat/pyidf | tests/test_exteriorfuelequipment.py | Python | apache-2.0 | 1,733 |
<ul>
<li ng-repeat="item in $ctrl.items">
{{item.quantity}} of {{item.name}}
</li>
</ul> | liminjun/coursera-front-end | lecture37/src/shopinglist/templates/shoppinglist.template.html | HTML | apache-2.0 | 104 |
/*
* Copyright 2014-2019 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.workdocs.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.workdocs.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.protocol.*;
import com.amazonaws.protocol.Protocol;
import com.amazonaws.annotation.SdkInternalApi;
/**
* DeleteFolderRequest Marshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class DeleteFolderRequestProtocolMarshaller implements Marshaller<Request<DeleteFolderRequest>, DeleteFolderRequest> {
private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON).requestUri("/api/v1/folders/{FolderId}")
.httpMethodName(HttpMethodName.DELETE).hasExplicitPayloadMember(false).hasPayloadMembers(false).serviceName("AmazonWorkDocs").build();
private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory;
public DeleteFolderRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) {
this.protocolFactory = protocolFactory;
}
public Request<DeleteFolderRequest> marshall(DeleteFolderRequest deleteFolderRequest) {
if (deleteFolderRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<DeleteFolderRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
deleteFolderRequest);
protocolMarshaller.startMarshalling();
DeleteFolderRequestMarshaller.getInstance().marshall(deleteFolderRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| jentfoo/aws-sdk-java | aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/transform/DeleteFolderRequestProtocolMarshaller.java | Java | apache-2.0 | 2,620 |
# Leucopaxillus spinulosus (Kühner & Romagn.) Konrad & Maubl., 1949 SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Encyclop. Mycol. 14: 409 (1949)
#### Original name
Tricholoma spinulosum Kühner & Romagn., 1947
### Remarks
null | mdoering/backbone | life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Tricholomataceae/Porpoloma/Porpoloma spinulosum/ Syn. Leucopaxillus spinulosus/README.md | Markdown | apache-2.0 | 291 |
# Didissandra C.B. Clarke GENUS
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Gesneriaceae/Didissandra/README.md | Markdown | apache-2.0 | 179 |
# Spongiuspinus Martin, 1971 GENUS
#### Status
ACCEPTED
#### According to
Interim Register of Marine and Nonmarine Genera
#### Published in
Boln R. Soc. esp. Hist. Nat. (Geol. ) 69: 224.
#### Original name
null
### Remarks
null | mdoering/backbone | life/Protozoa/Sarcomastigophora/Spongiuspinus/README.md | Markdown | apache-2.0 | 232 |
# Macaranga lancifolia Pax SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Euphorbiaceae/Macaranga/Macaranga barteri/ Syn. Macaranga lancifolia/README.md | Markdown | apache-2.0 | 181 |
# Atriplex arabicum Ehrenb. ex Boiss. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Chenopodiaceae/Atriplex/Atriplex arabicum/README.md | Markdown | apache-2.0 | 185 |
# Metasphaeria urostigymatis Speg. SPECIES
#### Status
SYNONYM
#### According to
Index Fungorum
#### Published in
null
#### Original name
Metasphaeria urostigymatis Speg.
### Remarks
null | mdoering/backbone | life/Fungi/Ascomycota/Dothideomycetes/Dothideales/Dothioraceae/Metasphaeria/Metasphaeria urostigmatis/ Syn. Metasphaeria urostigymatis/README.md | Markdown | apache-2.0 | 192 |
# Sericographis haplostachya Nees SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Acanthaceae/Sericographis/Sericographis haplostachya/README.md | Markdown | apache-2.0 | 181 |
# Rhyssostelma Decne. GENUS
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Asclepiadaceae/Rhyssostelma/README.md | Markdown | apache-2.0 | 167 |
# Usnea comosa f. isidiella Räsänen FORM
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
Ann. bot. Soc. Zool. -Bot. fenn. Vanamo 2(1): 9 (1932)
#### Original name
Usnea comosa f. isidiella Räsänen
### Remarks
null | mdoering/backbone | life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Parmeliaceae/Usnea/Usnea comosa/Usnea comosa isidiella/README.md | Markdown | apache-2.0 | 246 |
# Rhodymenia preissiana Sonder SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Rhodophyta/Florideophyceae/Gracilariales/Gracilariaceae/Hydropuntia/Hydropuntia preissiana/ Syn. Rhodymenia preissiana/README.md | Markdown | apache-2.0 | 185 |
# Sphacelotheca furcata var. furcata Maire VARIETY
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Sphacelotheca furcata var. furcata Maire
### Remarks
null | mdoering/backbone | life/Fungi/Basidiomycota/Microbotryomycetes/Microbotryales/Microbotryaceae/Sphacelotheca/Sphacelotheca furcata/Sphacelotheca furcata furcata/README.md | Markdown | apache-2.0 | 209 |
# Rubus semiapiculatus var. malaconeurus (Sudre) Sudre VARIETY
#### Status
DOUBTFUL
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Rubus/Rubus semiapiculatus/Rubus semiapiculatus malaconeurus/README.md | Markdown | apache-2.0 | 210 |
<?php
/*
* 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.
*
*/
/**
* Locale test case.
*/
class LocaleTest extends PHPUnit_Framework_TestCase {
/**
* @var Locale
*/
private $Locale;
/**
* Prepares the environment before running a test.
*/
protected function setUp()
{
parent::setUp();
$this->Locale = new Locale('EN', 'US');
}
/**
* Cleans up the environment after running a test.
*/
protected function tearDown()
{
$this->Locale = null;
parent::tearDown();
}
/**
* Constructs the test case.
*/
public function __construct()
{
}
/**
* Tests Locale->__construct()
*/
public function test__construct()
{
$this->Locale->__construct('EN', 'US');
}
/**
* Tests Locale->equals()
*/
public function testEquals()
{
$locale = new Locale('EN', 'US');
$this->assertTrue($this->Locale->equals($locale));
}
/**
* Tests Locale->getCountry()
*/
public function testGetCountry()
{
$this->assertEquals('US', $this->Locale->getCountry());
}
/**
* Tests Locale->getLanguage()
*/
public function testGetLanguage()
{
$this->assertEquals('EN', $this->Locale->getLanguage());
}
}
| nevali/shindig | php/test/common/LocaleTest.php | PHP | apache-2.0 | 1,900 |
module Dapp
module Config
class Config < Directive::Base
def dev_mode
@_dev_mode = true
end
def _dev_mode
!!@_dev_mode
end
def after_parsing!
do_all!('_after_parsing!')
end
def validate!
do_all!('_validate!')
end
end
end
end
| kobel169/dapp | lib/dapp/config/config.rb | Ruby | apache-2.0 | 320 |
using System;
using System.IO;
namespace Glass.Mapper.Sc
{
public class RenderingResult: IDisposable
{
private readonly TextWriter _writer;
private readonly string _firstPart;
private readonly string _lastPart;
public RenderingResult(TextWriter writer, string firstPart, string lastPart)
{
_writer = writer;
_firstPart = firstPart;
_lastPart = lastPart;
_writer.Write(_firstPart);
}
public void Dispose()
{
_writer.Write(_lastPart);
}
}
}
| mikeedwards83/Glass.Mapper | Source/Glass.Mapper.Sc/RenderingResult.cs | C# | apache-2.0 | 614 |
# Eupteron acuminatum (Wight) Miq. SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Araliaceae/Polyscias/Polyscias acuminata/ Syn. Eupteron acuminatum/README.md | Markdown | apache-2.0 | 189 |
/**
* Created by Jacky.Gao on 2017-02-09.
*/
import {alert} from '../MsgBox.js';
export default class EditPropertyConditionDialog{
constructor(conditions){
this.conditions=conditions;
this.dialog=$(`<div class="modal fade" role="dialog" aria-hidden="true" style="z-index: 11001">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
${window.i18n.dialog.editPropCondition.title}
</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer"></div>
</div>
</div>
</div>`);
const body=this.dialog.find('.modal-body'),footer=this.dialog.find(".modal-footer");
this.init(body,footer);
}
init(body,footer){
const _this=this;
this.joinGroup=$(`<div class="form-group"><label>${window.i18n.dialog.editPropCondition.relation}</label></div>`);
this.joinSelect=$(`<select class="form-control" style="display: inline-block;width:430px;">
<option value="and">${window.i18n.dialog.editPropCondition.and}</option>
<option value="or">${window.i18n.dialog.editPropCondition.or}</option>
</select>`);
this.joinGroup.append(this.joinSelect);
body.append(this.joinGroup);
const leftGroup=$(`<div class="form-group"><label>${window.i18n.dialog.editPropCondition.leftValue}</label></div>`);
this.leftTypeSelect=$(`<select class="form-control" style="display: inline-block;width: inherit">
<option value="current">${window.i18n.dialog.editPropCondition.currentValue}</option>
<option value="property">${window.i18n.dialog.editPropCondition.property}</option>
<option value="expression">${window.i18n.dialog.editPropCondition.expression}</option>
</select>`);
leftGroup.append(this.leftTypeSelect);
this.propertyGroup=$(`<span style="margin-left: 10px"><label>${window.i18n.dialog.editPropCondition.propName}</label></span>`);
this.propertySelect=$(`<select class="form-control" style="display: inline-block;width:320px;"></select>`);
this.propertyGroup.append(this.propertySelect);
leftGroup.append(this.propertyGroup);
body.append(leftGroup);
this.exprGroup=$(`<span style="margin-left: 10px"><label>${window.i18n.dialog.editPropCondition.expr}</label></span>`);
this.exprEditor=$(`<input type="text" style="display: inline-block;width:320px;" class="form-control">`);
this.exprGroup.append(this.exprEditor);
leftGroup.append(this.exprGroup);
this.exprEditor.change(function(){
const val=$(this).val();
const url=window._server+'/designer/conditionScriptValidation';
$.ajax({
url,
type:'POST',
data:{content:val},
success:function(errors){
if(errors.length>0){
alert(`${val} ${window.i18n.dialog.editPropCondition.syntaxError}`);
}
}
});
});
this.leftTypeSelect.change(function(){
const val=$(this).val();
if(val==='current'){
_this.exprGroup.hide();
_this.propertyGroup.hide();
}else if(val==='property'){
_this.exprGroup.hide();
_this.propertyGroup.show();
}else{
_this.propertyGroup.hide();
_this.exprGroup.show();
}
});
const operatorGroup=$(`<div class="form-group"><label>${window.i18n.dialog.editPropCondition.operator}</label></div>`);
this.operatorSelect=$(`<select class="form-control" style="display: inline-block;width:490px;">
<option value=">">${window.i18n.dialog.editPropCondition.greater}</option>
<option value=">=">${window.i18n.dialog.editPropCondition.greaterEquals}</option>
<option value="<">${window.i18n.dialog.editPropCondition.less}</option>
<option value="<=">${window.i18n.dialog.editPropCondition.lessEquals}</option>
<option value="==">${window.i18n.dialog.editPropCondition.equals}</option>
<option value="!=">${window.i18n.dialog.editPropCondition.notEquals}</option>
<option value="in">${window.i18n.dialog.editPropCondition.in}</option>
<option value="like">${window.i18n.dialog.editPropCondition.like}</option>
</select>`);
operatorGroup.append(this.operatorSelect);
body.append(operatorGroup);
const valueGroup=$(`<div class="form-group"><label>${window.i18n.dialog.editPropCondition.valueExpr}</label></div>`);
this.valueEditor=$(`<input type="text" class="form-control" style="display: inline-block;width:477px;">`);
valueGroup.append(this.valueEditor);
body.append(valueGroup);
this.valueEditor.change(function(){
const val=$(this).val();
const url=window._server+'/designer/conditionScriptValidation';
$.ajax({
url,
type:'POST',
data:{content:val},
success:function(errors){
if(errors.length>0){
alert(`${val} ${window.i18n.dialog.editPropCondition.syntaxError}`);
}
}
});
});
const button=$(`<button class="btn btn-default">${window.i18n.dialog.editPropCondition.ok}</button>`);
button.click(function(){
let property=_this.propertySelect.val(),op=_this.operatorSelect.val(),value=_this.valueEditor.val(),join=_this.joinSelect.val(),type=_this.leftTypeSelect.val(),expr=_this.exprEditor.val();
if (type === 'property') {
if (property === '') {
alert(`${window.i18n.dialog.editPropCondition.selectProp}`);
return;
}
} else if(type==='expression') {
if(expr===''){
alert(`${window.i18n.dialog.editPropCondition.leftValueExpr}`);
return;
}
property=expr;
}else{
property = null;
}
if(type==='current'){
type="property";
}
if (op === '') {
alert(`${window.i18n.dialog.editPropCondition.selectOperator}`);
return;
}
if (value === '') {
alert(`${window.i18n.dialog.editPropCondition.inputExpr}`);
return;
}
if (_this.condition) {
if (_this.condition.join) {
_this.callback.call(_this,type, property, op, value, join);
} else {
_this.callback.call(_this,type, property, op, value);
}
} else if (_this.conditions.length > 0) {
_this.callback.call(_this,type, property, op, value, join);
} else {
_this.callback.call(_this,type, property, op, value);
}
_this.dialog.modal('hide');
});
footer.append(button);
}
show(callback,fields,condition){
this.callback=callback;
this.condition=condition;
this.type='current';
if(condition){
this.type=condition.type;
if(condition.join){
this.joinGroup.show();
}else{
this.joinGroup.hide();
}
}else{
if(this.conditions.length>0){
this.joinGroup.show();
}else{
this.joinGroup.hide();
}
}
this.propertySelect.empty();
for(let field of fields){
this.propertySelect.append(`<option>${field.name}</option>`);
}
if(condition){
if(this.type==='expression'){
this.leftTypeSelect.val("expression");
this.exprEditor.val(condition.left);
this.propertyGroup.hide();
this.exprGroup.show();
}else{
if(condition.left && condition.left!==''){
this.propertySelect.val(condition.left);
this.leftTypeSelect.val("property");
this.propertyGroup.show();
}else{
this.leftTypeSelect.val("current");
this.propertyGroup.hide();
}
this.exprGroup.hide();
}
this.operatorSelect.val(condition.operation || condition.op);
this.valueEditor.val(condition.right);
this.joinSelect.val(condition.join);
}else{
this.leftTypeSelect.val("current");
this.propertyGroup.hide();
this.exprGroup.hide();
}
this.dialog.modal('show');
}
} | youseries/ureport | ureport2-js/src/dialog/EditPropertyConditionDialog.js | JavaScript | apache-2.0 | 9,326 |
from collections import defaultdict
import codecs
def count(corpus, output_file):
debug = False
dic = defaultdict(int)
other = set()
fout = codecs.open(output_file, 'w', 'utf8')
for line in open(corpus, 'r'):
words = line.split()
for word in words:
if len(word) % 3 == 0:
for i in xrange(len(word) / 3):
dic[word[i:i+3]] += 1
else:
other.add(word)
fout.write('%i %i\n' % (len(dic), len(other)))
record_list = [(y, x) for x, y in dic.items()]
record_list.sort()
record_list.reverse()
i = 0
for x, y in record_list:
#print y.decode('utf8'), x
try:
yy = y.decode('GBK')
except:
print y
yy = 'N/A'
fout.write('%s %i\n' % (yy, x))
i += 1
if i > 10 and debug:
break
other_list = list(other)
other_list.sort()
for item in other_list:
#print item.decode('utf8')
item2 = item.decode('utf8')
fout.write(item2)
fout.write('\n')
i += 1
if i > 20 and debug:
break
fout.close()
if __name__ =='__main__':
count('data/train.zh_parsed', 'output/count.zh')
count('data/train.ja_parsed', 'output/count.ja')
| jileiwang/CJ-Glo | tools/character_count.py | Python | apache-2.0 | 1,312 |
<!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_102) on Wed Nov 02 19:53:02 IST 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>org.apache.solr.update.processor Class Hierarchy (Solr 6.3.0 API)</title>
<meta name="date" content="2016-11-02">
<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="org.apache.solr.update.processor Class Hierarchy (Solr 6.3.0 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><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</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><a href="../../../../../org/apache/solr/update/package-tree.html">Prev</a></li>
<li><a href="../../../../../org/apache/solr/util/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/solr/update/processor/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.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">
<h1 class="title">Hierarchy For Package org.apache.solr.update.processor</h1>
<span class="packageHierarchyLabel">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="../../../../../overview-tree.html">All Packages</a></li>
</ul>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/AtomicUpdateDocumentMerger.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">AtomicUpdateDocumentMerger</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributedUpdateProcessor.RequestReplicationTracker.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">DistributedUpdateProcessor.RequestReplicationTracker</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.SelectorParams.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">FieldMutatingUpdateProcessorFactory.SelectorParams</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/Signature.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">Signature</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/Lookup3Signature.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">Lookup3Signature</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/MD5Signature.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">MD5Signature</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/TextProfileSignature.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">TextProfileSignature</span></a></li>
</ul>
</li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/TemplateUpdateProcessorFactory.Resolved.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">TemplateUpdateProcessorFactory.Resolved</span></a></li>
<li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Throwable</span></a> (implements java.io.<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>)
<ul>
<li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Exception</span></a>
<ul>
<li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">RuntimeException</span></a>
<ul>
<li type="circle">org.apache.solr.common.<a href="../../../../../../solr-solrj/org/apache/solr/common/SolrException.html?is-external=true" title="class or interface in org.apache.solr.common"><span class="typeNameLink">SolrException</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributedUpdateProcessor.DistributedUpdatesAsyncException.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">DistributedUpdateProcessor.DistributedUpdatesAsyncException</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UpdateRequestProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">UpdateRequestProcessor</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributedUpdateProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">DistributedUpdateProcessor</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/CdcrUpdateProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">CdcrUpdateProcessor</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FieldMutatingUpdateProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">FieldMutatingUpdateProcessor</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">AllValuesOrNoneFieldMutatingUpdateProcessor</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">FieldValueMutatingUpdateProcessor</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/RegexpBoostProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">RegexpBoostProcessor</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/TolerantUpdateProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">TolerantUpdateProcessor</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/URLClassifyProcessor.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">URLClassifyProcessor</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UpdateRequestProcessorChain.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">UpdateRequestProcessorChain</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/PluginInfoInitialized.html" title="interface in org.apache.solr.util.plugin">PluginInfoInitialized</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UpdateRequestProcessorChain.ProcessorInfo.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">UpdateRequestProcessorChain.ProcessorInfo</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UpdateRequestProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">UpdateRequestProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/NamedListInitializedPlugin.html" title="interface in org.apache.solr.util.plugin">NamedListInitializedPlugin</a>)
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/AbstractDefaultValueUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">AbstractDefaultValueUpdateProcessorFactory</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DefaultValueUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">DefaultValueUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/TimestampUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">TimestampUpdateProcessorFactory</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">AddSchemaFieldsUpdateProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/SolrCoreAware.html" title="interface in org.apache.solr.util.plugin">SolrCoreAware</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/CdcrUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">CdcrUpdateProcessorFactory</span></a> (implements org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributingUpdateProcessorFactory.html" title="interface in org.apache.solr.update.processor">DistributingUpdateProcessorFactory</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ClassificationUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">CloneFieldUpdateProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/SolrCoreAware.html" title="interface in org.apache.solr.util.plugin">SolrCoreAware</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributedUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">DistributedUpdateProcessorFactory</span></a> (implements org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributingUpdateProcessorFactory.html" title="interface in org.apache.solr.update.processor">DistributingUpdateProcessorFactory</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DocBasedVersionConstraintsProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">DocBasedVersionConstraintsProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/SolrCoreAware.html" title="interface in org.apache.solr.util.plugin">SolrCoreAware</a>, org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UpdateRequestProcessorFactory.RunAlways.html" title="interface in org.apache.solr.update.processor">UpdateRequestProcessorFactory.RunAlways</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">DocExpirationUpdateProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/SolrCoreAware.html" title="interface in org.apache.solr.util.plugin">SolrCoreAware</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">FieldMutatingUpdateProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/SolrCoreAware.html" title="interface in org.apache.solr.util.plugin">SolrCoreAware</a>)
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ConcatFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ConcatFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/CountFieldValuesUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">CountFieldValuesUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FieldLengthUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">FieldLengthUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FieldValueSubsetUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">FieldValueSubsetUpdateProcessorFactory</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FirstFieldValueUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">FirstFieldValueUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/LastFieldValueUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">LastFieldValueUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">MaxFieldValueUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">MinFieldValueUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">UniqFieldsUpdateProcessorFactory</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/HTMLStripFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">HTMLStripFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/IgnoreFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">IgnoreFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ParseBooleanFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ParseBooleanFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ParseDateFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ParseDateFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ParseNumericFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ParseNumericFieldUpdateProcessorFactory</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ParseDoubleFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ParseFloatFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ParseIntFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">ParseLongFieldUpdateProcessorFactory</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/PreAnalyzedUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">PreAnalyzedUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/RegexReplaceProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">RegexReplaceProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/RemoveBlankFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">RemoveBlankFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/TrimFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">TrimFieldUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/TruncateFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">TruncateFieldUpdateProcessorFactory</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FieldNameMutatingUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">FieldNameMutatingUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">IgnoreCommitOptimizeUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/LogUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">LogUpdateProcessorFactory</span></a> (implements org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UpdateRequestProcessorFactory.RunAlways.html" title="interface in org.apache.solr.update.processor">UpdateRequestProcessorFactory.RunAlways</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/NoOpDistributingUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">NoOpDistributingUpdateProcessorFactory</span></a> (implements org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributingUpdateProcessorFactory.html" title="interface in org.apache.solr.update.processor">DistributingUpdateProcessorFactory</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/RegexpBoostProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">RegexpBoostProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/RunUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">RunUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/SignatureUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">SignatureUpdateProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/SolrCoreAware.html" title="interface in org.apache.solr.util.plugin">SolrCoreAware</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/SimpleUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">SimpleUpdateProcessorFactory</span></a>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/TemplateUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">TemplateUpdateProcessorFactory</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">StatelessScriptUpdateProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/SolrCoreAware.html" title="interface in org.apache.solr.util.plugin">SolrCoreAware</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/TolerantUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">TolerantUpdateProcessorFactory</span></a> (implements org.apache.solr.util.plugin.<a href="../../../../../org/apache/solr/util/plugin/SolrCoreAware.html" title="interface in org.apache.solr.util.plugin">SolrCoreAware</a>, org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UpdateRequestProcessorFactory.RunAlways.html" title="interface in org.apache.solr.update.processor">UpdateRequestProcessorFactory.RunAlways</a>)</li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/URLClassifyProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">URLClassifyProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UUIDUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor"><span class="typeNameLink">UUIDUpdateProcessorFactory</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributingUpdateProcessorFactory.html" title="interface in org.apache.solr.update.processor"><span class="typeNameLink">DistributingUpdateProcessorFactory</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/FieldMutatingUpdateProcessor.FieldNameSelector.html" title="interface in org.apache.solr.update.processor"><span class="typeNameLink">FieldMutatingUpdateProcessor.FieldNameSelector</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/ScriptEngineCustomizer.html" title="interface in org.apache.solr.update.processor"><span class="typeNameLink">ScriptEngineCustomizer</span></a></li>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/UpdateRequestProcessorFactory.RunAlways.html" title="interface in org.apache.solr.update.processor"><span class="typeNameLink">UpdateRequestProcessorFactory.RunAlways</span></a></li>
</ul>
<h2 title="Enum Hierarchy">Enum Hierarchy</h2>
<ul>
<li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a>
<ul>
<li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Enum</span></a><E> (implements java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>, java.io.<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>)
<ul>
<li type="circle">org.apache.solr.update.processor.<a href="../../../../../org/apache/solr/update/processor/DistributedUpdateProcessor.DistribPhase.html" title="enum in org.apache.solr.update.processor"><span class="typeNameLink">DistributedUpdateProcessor.DistribPhase</span></a></li>
</ul>
</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="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><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</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><a href="../../../../../org/apache/solr/update/package-tree.html">Prev</a></li>
<li><a href="../../../../../org/apache/solr/util/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/solr/update/processor/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.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 © 2000-2016 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>
| johannesbraun/clm_autocomplete | docs/solr-core/org/apache/solr/update/processor/package-tree.html | HTML | apache-2.0 | 30,792 |
/*
* Copyright 2017 ThoughtWorks, 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.thoughtworks.go.config.materials.git;
import com.googlecode.junit.ext.JunitExtRunner;
import com.thoughtworks.go.domain.materials.Modification;
import com.thoughtworks.go.domain.materials.RevisionContext;
import com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext;
import com.thoughtworks.go.domain.materials.git.GitCommand;
import com.thoughtworks.go.domain.materials.git.GitTestRepo;
import com.thoughtworks.go.domain.materials.mercurial.StringRevision;
import com.thoughtworks.go.helper.TestRepo;
import com.thoughtworks.go.util.SystemEnvironment;
import com.thoughtworks.go.util.TestFileUtil;
import org.hamcrest.Matchers;
import org.hamcrest.core.Is;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.thoughtworks.go.domain.materials.git.GitTestRepo.*;
import static com.thoughtworks.go.util.command.ProcessOutputStreamConsumer.inMemoryConsumer;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(JunitExtRunner.class)
public class GitMaterialShallowCloneTest {
private GitTestRepo repo;
private File workingDir;
@Before
public void setup() throws Exception {
repo = new GitTestRepo();
workingDir = TestFileUtil.createUniqueTempFolder("working");
}
@After
public void teardown() throws Exception {
TestRepo.internalTearDown();
}
@Test
public void defaultShallowFlagIsOff() throws Exception {
assertThat(new GitMaterial(repo.projectRepositoryUrl()).isShallowClone(), is(false));
assertThat(new GitMaterial(repo.projectRepositoryUrl(), null).isShallowClone(), is(false));
assertThat(new GitMaterial(repo.projectRepositoryUrl(), true).isShallowClone(), is(true));
assertThat(new GitMaterial(new GitMaterialConfig(repo.projectRepositoryUrl())).isShallowClone(), is(false));
assertThat(new GitMaterial(new GitMaterialConfig(repo.projectRepositoryUrl(), GitMaterialConfig.DEFAULT_BRANCH, true)).isShallowClone(), is(true));
assertThat(new GitMaterial(new GitMaterialConfig(repo.projectRepositoryUrl(), GitMaterialConfig.DEFAULT_BRANCH, false)).isShallowClone(), is(false));
TestRepo.internalTearDown();
}
@Test
public void shouldGetLatestModificationWithShallowClone() throws IOException {
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
List<Modification> mods = material.latestModification(workingDir, context());
assertThat(mods.size(), is(1));
assertThat(mods.get(0).getComment(), Matchers.is("Added 'run-till-file-exists' ant target"));
assertThat(localRepoFor(material).isShallow(), is(true));
assertThat(localRepoFor(material).containsRevisionInBranch(REVISION_0), is(false));
assertThat(localRepoFor(material).currentRevision(), is(REVISION_4.getRevision()));
}
@Test
public void shouldGetModificationSinceANotInitiallyClonedRevision() {
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
List<Modification> modifications = material.modificationsSince(workingDir, REVISION_0, context());
assertThat(modifications.size(), is(4));
assertThat(modifications.get(0).getRevision(), is(REVISION_4.getRevision()));
assertThat(modifications.get(0).getComment(), is("Added 'run-till-file-exists' ant target"));
assertThat(modifications.get(1).getRevision(), is(REVISION_3.getRevision()));
assertThat(modifications.get(1).getComment(), is("adding build.xml"));
assertThat(modifications.get(2).getRevision(), is(REVISION_2.getRevision()));
assertThat(modifications.get(2).getComment(), is("Created second.txt from first.txt"));
assertThat(modifications.get(3).getRevision(), is(REVISION_1.getRevision()));
assertThat(modifications.get(3).getComment(), is("Added second line"));
}
@Test
public void shouldBeAbleToUpdateToRevisionNotFetched() {
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
material.updateTo(inMemoryConsumer(), workingDir, new RevisionContext(REVISION_3, REVISION_2, 2), context());
assertThat(localRepoFor(material).currentRevision(), is(REVISION_3.getRevision()));
assertThat(localRepoFor(material).containsRevisionInBranch(REVISION_2), is(true));
assertThat(localRepoFor(material).containsRevisionInBranch(REVISION_3), is(true));
}
@Test
public void configShouldIncludesShallowFlag() {
GitMaterialConfig shallowConfig = (GitMaterialConfig) new GitMaterial(repo.projectRepositoryUrl(), true).config();
assertThat(shallowConfig.isShallowClone(), is(true));
GitMaterialConfig normalConfig = (GitMaterialConfig) new GitMaterial(repo.projectRepositoryUrl(), null).config();
assertThat(normalConfig.isShallowClone(), is(false));
}
@Test
public void xmlAttributesShouldIncludesShallowFlag() {
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
assertThat(material.getAttributesForXml().get("shallowClone"), Is.<Object>is(true));
}
@Test
public void attributesShouldIncludeShallowFlag() {
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
Map gitConfig = (Map) (material.getAttributes(false).get("git-configuration"));
assertThat(gitConfig.get("shallow-clone"), Is.<Object>is(true));
}
@Test
public void shouldConvertExistingRepoToFullRepoWhenShallowCloneIsOff() {
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
material.latestModification(workingDir, context());
assertThat(localRepoFor(material).isShallow(), is(true));
material = new GitMaterial(repo.projectRepositoryUrl(), false);
material.latestModification(workingDir, context());
assertThat(localRepoFor(material).isShallow(), is(false));
}
@Test
public void withShallowCloneShouldGenerateANewMaterialWithOverriddenShallowConfig() {
GitMaterial original = new GitMaterial(repo.projectRepositoryUrl(), false);
assertThat(original.withShallowClone(true).isShallowClone(), is(true));
assertThat(original.withShallowClone(false).isShallowClone(), is(false));
assertThat(original.isShallowClone(), is(false));
}
@Test
public void updateToANewRevisionShouldNotResultInUnshallowing() throws IOException {
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
material.updateTo(inMemoryConsumer(), workingDir, new RevisionContext(REVISION_4, REVISION_4, 1), context());
assertThat(localRepoFor(material).isShallow(), is(true));
List<Modification> modifications = repo.addFileAndPush("newfile", "add new file");
StringRevision newRevision = new StringRevision(modifications.get(0).getRevision());
material.updateTo(inMemoryConsumer(), workingDir, new RevisionContext(newRevision, newRevision, 1), context());
assertThat(new File(workingDir, "newfile").exists(), is(true));
assertThat(localRepoFor(material).isShallow(), is(true));
}
@Test
public void shouldUnshallowServerSideRepoCompletelyOnRetrievingModificationsSincePreviousRevision() {
SystemEnvironment mockSystemEnvironment = mock(SystemEnvironment.class);
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
when(mockSystemEnvironment.get(SystemEnvironment.GO_SERVER_SHALLOW_CLONE)).thenReturn(false);
material.modificationsSince(workingDir, REVISION_4, new TestSubprocessExecutionContext(mockSystemEnvironment, true));
assertThat(localRepoFor(material).isShallow(), is(false));
}
@Test
public void shouldNotUnshallowOnServerSideIfShallowClonePropertyIsOnAndRepoIsAlreadyShallow() {
SystemEnvironment mockSystemEnvironment = mock(SystemEnvironment.class);
GitMaterial material = new GitMaterial(repo.projectRepositoryUrl(), true);
when(mockSystemEnvironment.get(SystemEnvironment.GO_SERVER_SHALLOW_CLONE)).thenReturn(true);
material.modificationsSince(workingDir, REVISION_4, new TestSubprocessExecutionContext(mockSystemEnvironment, false));
assertThat(localRepoFor(material).isShallow(), is(true));
}
private TestSubprocessExecutionContext context() {
return new TestSubprocessExecutionContext();
}
private GitCommand localRepoFor(GitMaterial material) {
return new GitCommand(material.getFingerprint(), workingDir, GitMaterialConfig.DEFAULT_BRANCH, false, new HashMap<>());
}
}
| soundcloud/gocd | domain/test/com/thoughtworks/go/config/materials/git/GitMaterialShallowCloneTest.java | Java | apache-2.0 | 9,537 |
package wei_chih.service.handler.wei_chih;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.Socket;
import java.security.KeyPair;
import java.security.PublicKey;
import java.security.SignatureException;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import java.util.logging.Logger;
import message.Operation;
import message.OperationType;
import service.Key;
import service.KeyManager;
import service.handler.ConnectionHandler;
import wei_chih.service.Config;
import wei_chih.service.SocketServer;
import wei_chih.utility.MerkleTree;
import wei_chih.utility.Utils;
import wei_chih.message.wei_chih.Request;
import wei_chih.message.wei_chih.Acknowledgement;
/**
*
* @author Chienweichih
*/
public class WeiChihHandler extends ConnectionHandler {
private static final ReentrantLock LOCK;
private static final MerkleTree[] merkleTree;
private static final String[] digestBeforeUpdate;
private static final Operation[] lastOP;
private static final Integer[] sequenceNumbers;
static {
merkleTree = new MerkleTree[Config.SERVICE_NUM];
digestBeforeUpdate = new String[Config.SERVICE_NUM];
lastOP = new Operation[Config.SERVICE_NUM];
sequenceNumbers = new Integer[Config.SERVICE_NUM];
for (int i = 0; i < Config.SERVICE_NUM; ++i) {
merkleTree[i] = new MerkleTree(new File(SocketServer.dataDirPath));
digestBeforeUpdate[i] = "";
lastOP[i] = new Operation(OperationType.DOWNLOAD, "", merkleTree[i].getRootHash());
sequenceNumbers[i] = 0;
}
LOCK = new ReentrantLock();
}
public WeiChihHandler(Socket socket, KeyPair keyPair) {
super(socket, keyPair);
}
@Override
protected void handle(DataOutputStream out, DataInputStream in) {
PublicKey clientPubKey = KeyManager.getInstance().getPublicKey(Key.CLIENT);
int portIndex = 0;
if (Math.abs(socket.getPort() - Config.SERVICE_PORT[0]) < 10) {
portIndex = socket.getPort() - Config.SERVICE_PORT[0];
} else if (Math.abs(socket.getLocalPort() - Config.SERVICE_PORT[0]) < 10) {
portIndex = socket.getLocalPort() - Config.SERVICE_PORT[0];
}
try {
Request req = Request.parse(Utils.receive(in));
LOCK.lock();
if (!req.validate(clientPubKey)) {
throw new SignatureException("REQ validation failure");
}
Operation op = req.getOperation();
switch (op.getType()) {
case UPLOAD:
digestBeforeUpdate[portIndex] = merkleTree[portIndex].getDigest(op.getPath());
merkleTree[portIndex].update(op.getPath(), op.getMessage());
case DOWNLOAD:
// both upload and download, so no break
if (0 != op.getClientID().compareTo(String.valueOf(sequenceNumbers[portIndex]))) {
throw new java.security.InvalidParameterException();
}
sequenceNumbers[portIndex]++;
default:
}
File file = new File(SocketServer.dataDirPath + op.getPath());
String rootHash = merkleTree[portIndex].getRootHash();
String fileHash = null;
if (file.exists()) {
fileHash = Utils.digest(file, Config.DIGEST_ALGORITHM);
}
Acknowledgement ack = new Acknowledgement(rootHash, fileHash, req);
ack.sign(keyPair);
Utils.send(out, ack.toString());
switch (op.getType()) {
case DOWNLOAD:
lastOP[portIndex] = op;
if (portIndex + Config.SERVICE_PORT[0] == Config.SERVICE_PORT[0]) {
Utils.send(out, file);
}
break;
case UPLOAD:
lastOP[portIndex] = op;
if (portIndex + Config.SERVICE_PORT[0] == Config.SERVICE_PORT[0]) {
file = new File(Config.DOWNLOADS_DIR_PATH + op.getPath());
Utils.receive(in, file);
String digest = Utils.digest(file, Config.DIGEST_ALGORITHM);
if (0 != op.getMessage().compareTo(digest)) {
throw new java.io.IOException();
}
}
break;
case AUDIT:
file = new File(Config.ATTESTATION_DIR_PATH + "/service-provider/voting");
switch (lastOP[portIndex].getType()) {
case DOWNLOAD:
Utils.write(file, rootHash);
break;
case UPLOAD:
MerkleTree prevMerkleTree = new MerkleTree(merkleTree[portIndex]);
prevMerkleTree.update(lastOP[portIndex].getPath(), digestBeforeUpdate[portIndex]);
Utils.Serialize(file, prevMerkleTree);
break;
default:
throw new java.lang.Error();
}
Utils.send(out, file);
break;
default:
}
socket.close();
} catch (IOException | SignatureException ex) {
Logger.getLogger(WeiChihHandler.class.getName()).log(Level.SEVERE, null, ex);
} finally {
if (LOCK != null) {
LOCK.unlock();
}
}
}
}
| CloudComLab/Voting-CAP | src/wei_chih/service/handler/wei_chih/WeiChihHandler.java | Java | apache-2.0 | 5,740 |
//// [/lib/initial-buildOutput.txt]
/lib/tsc --b /src/core --verbose
12:01:00 AM - Projects in this build:
* src/core/tsconfig.json
12:01:00 AM - Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist
12:01:00 AM - Building project '/src/core/tsconfig.json'...
exitCode:: ExitStatus.Success
//// [/src/core/anotherModule.js]
"use strict";
exports.__esModule = true;
exports.World = "hello";
//// [/src/core/index.js]
"use strict";
exports.__esModule = true;
exports.someString = "HELLO WORLD";
function leftPad(s, n) { return s + n; }
exports.leftPad = leftPad;
function multiply(a, b) { return a * b; }
exports.multiply = multiply;
//// [/src/core/tsconfig.json]
{
"compilerOptions": {
"incremental": true,
"module": "commonjs"
}
}
//// [/src/core/tsconfig.tsbuildinfo]
{
"program": {
"fileInfos": {
"../../lib/lib.d.ts": {
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
},
"./anothermodule.ts": {
"version": "-2676574883-export const World = \"hello\";\r\n",
"signature": "-8396256275-export declare const World = \"hello\";\r\n"
},
"./index.ts": {
"version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",
"signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"
},
"./some_decl.d.ts": {
"version": "-9253692965-declare const dts: any;\r\n",
"signature": "-9253692965-declare const dts: any;\r\n"
}
},
"options": {
"incremental": true,
"module": 1,
"configFilePath": "./tsconfig.json"
},
"referencedMap": {},
"exportedModulesMap": {},
"semanticDiagnosticsPerFile": [
"../../lib/lib.d.ts",
"./anothermodule.ts",
"./index.ts",
"./some_decl.d.ts"
]
},
"version": "FakeTSVersion"
}
| minestarks/TypeScript | tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js | JavaScript | apache-2.0 | 3,067 |
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2012-2019 Couchbase, 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.
*/
#include "histogram.h"
#include <string>
using namespace cbc;
using std::string;
void Histogram::install(lcb_INSTANCE *inst, FILE *out)
{
lcb_STATUS rc;
output = out;
lcb_enable_timings(inst);
rc = lcb_cntl(inst, LCB_CNTL_GET, LCB_CNTL_KVTIMINGS, &hg);
lcb_assert(rc == LCB_SUCCESS);
lcb_assert(hg != NULL);
(void)rc;
}
void Histogram::installStandalone(FILE *out)
{
if (hg != NULL) {
return;
}
hg = lcb_histogram_create();
output = out;
}
void Histogram::write()
{
if (hg == NULL) {
return;
}
lcb_histogram_print(hg, output);
}
void Histogram::record(lcb_U64 duration)
{
if (hg == NULL) {
return;
}
lcb_histogram_record(hg, duration);
}
| avsej/libcouchbase | tools/common/histogram.cc | C++ | apache-2.0 | 1,439 |
# frozen_string_literal: true
require_relative "ruby/version"
module XTF
module Ruby
class Error < StandardError; end
# placeholder
end
end
| jamieorc/xtf-ruby | lib/xtf/ruby.rb | Ruby | apache-2.0 | 154 |
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2020, OpenNebula Project, OpenNebula Systems */
/* */
/* 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. */
/* -------------------------------------------------------------------------- */
define(function(require){
return 'acls-tab';
});
| baby-gnu/one | src/sunstone/public/app/tabs/acls-tab/tabId.js | JavaScript | apache-2.0 | 1,267 |
/* Copyright 2016-2017 Vector Creations Ltd
*
* 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 gomatrixserverlib
import (
"encoding/binary"
"fmt"
"sort"
"unicode/utf8"
"github.com/tidwall/gjson"
)
// CanonicalJSON re-encodes the JSON in a canonical encoding. The encoding is
// the shortest possible encoding using integer values with sorted object keys.
// https://matrix.org/docs/spec/server_server/unstable.html#canonical-json
func CanonicalJSON(input []byte) ([]byte, error) {
if !gjson.Valid(string(input)) {
return nil, fmt.Errorf("invalid json")
}
return CanonicalJSONAssumeValid(input), nil
}
// CanonicalJSONAssumeValid is the same as CanonicalJSON, but assumes the
// input is valid JSON
func CanonicalJSONAssumeValid(input []byte) []byte {
input = CompactJSON(input, make([]byte, 0, len(input)))
return SortJSON(input, make([]byte, 0, len(input)))
}
// SortJSON reencodes the JSON with the object keys sorted by lexicographically
// by codepoint. The input must be valid JSON.
func SortJSON(input, output []byte) []byte {
result := gjson.ParseBytes(input)
RawJSON := RawJSONFromResult(result, input)
return sortJSONValue(result, RawJSON, output)
}
// sortJSONValue takes a gjson.Result and sorts it. inputJSON must be the
// raw JSON bytes that gjson.Result points to.
func sortJSONValue(input gjson.Result, inputJSON, output []byte) []byte {
if input.IsArray() {
return sortJSONArray(input, inputJSON, output)
}
if input.IsObject() {
return sortJSONObject(input, inputJSON, output)
}
// If its neither an object nor an array then there is no sub structure
// to sort, so just append the raw bytes.
return append(output, inputJSON...)
}
// sortJSONArray takes a gjson.Result and sorts it, assuming its an array.
// inputJSON must be the raw JSON bytes that gjson.Result points to.
func sortJSONArray(input gjson.Result, inputJSON, output []byte) []byte {
sep := byte('[')
// Iterate over each value in the array and sort it.
input.ForEach(func(_, value gjson.Result) bool {
output = append(output, sep)
sep = ','
RawJSON := RawJSONFromResult(value, inputJSON)
output = sortJSONValue(value, RawJSON, output)
return true // keep iterating
})
if sep == '[' {
// If sep is still '[' then the array was empty and we never wrote the
// initial '[', so we write it now along with the closing ']'.
output = append(output, '[', ']')
} else {
// Otherwise we end the array by writing a single ']'
output = append(output, ']')
}
return output
}
// sortJSONObject takes a gjson.Result and sorts it, assuming its an object.
// inputJSON must be the raw JSON bytes that gjson.Result points to.
func sortJSONObject(input gjson.Result, inputJSON, output []byte) []byte {
type entry struct {
key string // The parsed key string
rawKey []byte // The raw, unparsed key JSON string
value gjson.Result
}
var entries []entry
// Iterate over each key/value pair and add it to a slice
// that we can sort
input.ForEach(func(key, value gjson.Result) bool {
entries = append(entries, entry{
key: key.String(),
rawKey: RawJSONFromResult(key, inputJSON),
value: value,
})
return true // keep iterating
})
// Sort the slice based on the *parsed* key
sort.Slice(entries, func(a, b int) bool {
return entries[a].key < entries[b].key
})
sep := byte('{')
for _, entry := range entries {
output = append(output, sep)
sep = ','
// Append the raw unparsed JSON key, *not* the parsed key
output = append(output, entry.rawKey...)
output = append(output, ':')
RawJSON := RawJSONFromResult(entry.value, inputJSON)
output = sortJSONValue(entry.value, RawJSON, output)
}
if sep == '{' {
// If sep is still '{' then the object was empty and we never wrote the
// initial '{', so we write it now along with the closing '}'.
output = append(output, '{', '}')
} else {
// Otherwise we end the object by writing a single '}'
output = append(output, '}')
}
return output
}
// CompactJSON makes the encoded JSON as small as possible by removing
// whitespace and unneeded unicode escapes
func CompactJSON(input, output []byte) []byte {
var i int
for i < len(input) {
c := input[i]
i++
// The valid whitespace characters are all less than or equal to SPACE 0x20.
// The valid non-white characters are all greater than SPACE 0x20.
// So we can check for whitespace by comparing against SPACE 0x20.
if c <= ' ' {
// Skip over whitespace.
continue
}
// Add the non-whitespace character to the output.
output = append(output, c)
if c == '"' {
// We are inside a string.
for i < len(input) {
c = input[i]
i++
// Check if this is an escape sequence.
if c == '\\' {
escape := input[i]
i++
if escape == 'u' {
// If this is a unicode escape then we need to handle it specially
output, i = compactUnicodeEscape(input, output, i)
} else if escape == '/' {
// JSON does not require escaping '/', but allows encoders to escape it as a special case.
// Since the escape isn't required we remove it.
output = append(output, escape)
} else {
// All other permitted escapes are single charater escapes that are already in their shortest form.
output = append(output, '\\', escape)
}
} else {
output = append(output, c)
}
if c == '"' {
break
}
}
}
}
return output
}
// compactUnicodeEscape unpacks a 4 byte unicode escape starting at index.
// If the escape is a surrogate pair then decode the 6 byte \uXXXX escape
// that follows. Returns the output slice and a new input index.
func compactUnicodeEscape(input, output []byte, index int) ([]byte, int) {
const (
ESCAPES = "uuuuuuuubtnufruuuuuuuuuuuuuuuuuu"
HEX = "0123456789ABCDEF"
)
// If there aren't enough bytes to decode the hex escape then return.
if len(input)-index < 4 {
return output, len(input)
}
// Decode the 4 hex digits.
c := readHexDigits(input[index:])
index += 4
if c < ' ' {
// If the character is less than SPACE 0x20 then it will need escaping.
escape := ESCAPES[c]
output = append(output, '\\', escape)
if escape == 'u' {
output = append(output, '0', '0', byte('0'+(c>>4)), HEX[c&0xF])
}
} else if c == '\\' || c == '"' {
// Otherwise the character only needs escaping if it is a QUOTE '"' or BACKSLASH '\\'.
output = append(output, '\\', byte(c))
} else if c < 0xD800 || c >= 0xE000 {
// If the character isn't a surrogate pair then encoded it directly as UTF-8.
var buffer [4]byte
n := utf8.EncodeRune(buffer[:], rune(c))
output = append(output, buffer[:n]...)
} else {
// Otherwise the escaped character was the first part of a UTF-16 style surrogate pair.
// The next 6 bytes MUST be a '\uXXXX'.
// If there aren't enough bytes to decode the hex escape then return.
if len(input)-index < 6 {
return output, len(input)
}
// Decode the 4 hex digits from the '\uXXXX'.
surrogate := readHexDigits(input[index+2:])
index += 6
// Reconstruct the UCS4 codepoint from the surrogates.
codepoint := 0x10000 + (((c & 0x3FF) << 10) | (surrogate & 0x3FF))
// Encode the charater as UTF-8.
var buffer [4]byte
n := utf8.EncodeRune(buffer[:], rune(codepoint))
output = append(output, buffer[:n]...)
}
return output, index
}
// Read 4 hex digits from the input slice.
// Taken from https://github.com/NegativeMjark/indolentjson-rust/blob/8b959791fe2656a88f189c5d60d153be05fe3deb/src/readhex.rs#L21
func readHexDigits(input []byte) uint32 {
hex := binary.BigEndian.Uint32(input)
// subtract '0'
hex -= 0x30303030
// strip the higher bits, maps 'a' => 'A'
hex &= 0x1F1F1F1F
mask := hex & 0x10101010
// subtract 'A' - 10 - '9' - 9 = 7 from the letters.
hex -= mask >> 1
hex += mask >> 4
// collect the nibbles
hex |= hex >> 4
hex &= 0xFF00FF
hex |= hex >> 8
return hex & 0xFFFF
}
// RawJSONFromResult extracts the raw JSON bytes pointed to by result.
// input must be the json bytes that were used to generate result
func RawJSONFromResult(result gjson.Result, input []byte) (RawJSON []byte) {
// This is lifted from gjson README. Basically, result.Raw is a copy of
// the bytes we want, but its more efficient to take a slice.
// If Index is 0 then for some reason we can't extract it from the original
// JSON bytes.
if result.Index > 0 {
RawJSON = input[result.Index : result.Index+len(result.Raw)]
} else {
RawJSON = []byte(result.Raw)
}
return
}
| gperdomor/dendrite | vendor/src/github.com/matrix-org/gomatrixserverlib/json.go | GO | apache-2.0 | 8,987 |
# Geranium pyrenaicum var. patulivillosum Hausskn. & Bornm. ex Bornm. VARIETY
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Geraniales/Geraniaceae/Geranium/Geranium pyrenaicum/ Syn. Geranium pyrenaicum patulivillosum/README.md | Markdown | apache-2.0 | 224 |
# Tragacantha canoatra Kuntze SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Tragacantha/Tragacantha canoatra/README.md | Markdown | apache-2.0 | 177 |
-- MySQL dump 10.13 Distrib 5.5.37, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: AirAlliance
-- ------------------------------------------------------
-- Server version 5.5.37-0ubuntu0.12.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `flight`
--
DROP TABLE IF EXISTS `flight`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `flight` (
`id` int(11) NOT NULL,
`name` varchar(10) NOT NULL,
`source_sector_id` int(11) NOT NULL,
`dest_sector_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk_flight_sector_source` (`source_sector_id`),
KEY `fk_flight_sector_dest` (`dest_sector_id`),
CONSTRAINT `fk_flight_sector_dest` FOREIGN KEY (`dest_sector_id`) REFERENCES `sector` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_flight_sector_source` FOREIGN KEY (`source_sector_id`) REFERENCES `sector` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `flight`
--
LOCK TABLES `flight` WRITE;
/*!40000 ALTER TABLE `flight` DISABLE KEYS */;
INSERT INTO `flight` VALUES (1,'AA056',1,3),(2,'AA032',5,6),(3,'AA087',20,4),(4,'AA003',19,17),(5,'AA004',10,13),(6,'AA045',2,5),(7,'AA033',8,11),(8,'AA089',12,9),(9,'AA099',7,16),(10,'AA098',15,14);
/*!40000 ALTER TABLE `flight` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `guest`
--
DROP TABLE IF EXISTS `guest`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `guest` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`firstname` varchar(20) NOT NULL,
`lastname` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `guest`
--
LOCK TABLES `guest` WRITE;
/*!40000 ALTER TABLE `guest` DISABLE KEYS */;
INSERT INTO `guest` VALUES (1,'Frank','Jennings'),(2,'Florence','Justina'),(3,'Randy','Pauch'),(4,'Dorris','Lessing'),(5,'Orhan','Pamuk'),(6,'Harold','Pinter'),(7,'Toni','Morrison'),(8,'Dario','Fo'),(9,'Ivan','Bunin'),(10,'Henri','Bergson');
/*!40000 ALTER TABLE `guest` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `itinerary`
--
DROP TABLE IF EXISTS `itinerary`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `itinerary` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guest_id` int(11) NOT NULL,
`flight_id` int(11) NOT NULL,
`schedule_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk_itinerary_guest` (`guest_id`),
KEY `fk_itinerary_flight` (`flight_id`),
KEY `fk_itinerary_schedule` (`schedule_id`),
CONSTRAINT `fk_itinerary_schedule` FOREIGN KEY (`schedule_id`) REFERENCES `schedule` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_itinerary_flight` FOREIGN KEY (`flight_id`) REFERENCES `flight` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_itinerary_guest` FOREIGN KEY (`guest_id`) REFERENCES `guest` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `itinerary`
--
LOCK TABLES `itinerary` WRITE;
/*!40000 ALTER TABLE `itinerary` DISABLE KEYS */;
INSERT INTO `itinerary` VALUES (1,4,6,5),(2,1,10,9),(3,6,1,1),(4,9,8,7),(5,3,3,3),(6,2,4,8),(7,7,7,4),(8,5,9,6),(9,10,5,2),(10,8,2,10);
/*!40000 ALTER TABLE `itinerary` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `schedule`
--
DROP TABLE IF EXISTS `schedule`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `schedule` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guest_id` int(11) NOT NULL,
`flight_id` int(11) NOT NULL,
`schedule_date` date NOT NULL,
PRIMARY KEY (`id`),
KEY `fk_schedule_guest` (`guest_id`),
KEY `fk_schedule_flight` (`flight_id`),
CONSTRAINT `fk_schedule_flight` FOREIGN KEY (`flight_id`) REFERENCES `flight` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_schedule_guest` FOREIGN KEY (`guest_id`) REFERENCES `guest` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `schedule`
--
LOCK TABLES `schedule` WRITE;
/*!40000 ALTER TABLE `schedule` DISABLE KEYS */;
INSERT INTO `schedule` VALUES (1,4,4,'2008-11-01'),(2,6,1,'2008-11-04'),(3,2,10,'2008-10-04'),(4,3,9,'2008-10-21'),(5,5,8,'2008-10-20'),(6,1,7,'2008-10-03'),(7,8,6,'2008-10-04'),(8,9,3,'2008-10-07'),(9,7,2,'2008-10-15'),(10,10,5,'2008-10-17');
/*!40000 ALTER TABLE `schedule` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sector`
--
DROP TABLE IF EXISTS `sector`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sector` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sector` varchar(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `sector` (`sector`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sector`
--
LOCK TABLES `sector` WRITE;
/*!40000 ALTER TABLE `sector` DISABLE KEYS */;
INSERT INTO `sector` VALUES (15,'ANG'),(1,'BLR'),(3,'BOM'),(9,'CAL'),(20,'CAL'),(10,'CHI'),(19,'DEL'),(4,'FRA'),(17,'JAV'),(14,'LON'),(11,'MAL'),(2,'MAS'),(5,'PEK'),(7,'SCA'),(8,'SFO'),(6,'SIN'),(12,'SPB'),(13,'SYD'),(16,'TOK'),(18,'VIS');
/*!40000 ALTER TABLE `sector` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2014-05-15 1:13:28
| ecabrerar/AirAlliance | sql/aadb_dump.sql | SQL | apache-2.0 | 6,824 |
package ru.stqa.pft.addressbook.tests;
import org.hamcrest.CoreMatchers;
import org.hamcrest.MatcherAssert;
import org.testng.annotations.Test;
import ru.stqa.pft.addressbook.model.ContactData;
import ru.stqa.pft.addressbook.tests.TestBase;
import java.util.Arrays;
import java.util.stream.Collectors;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Created by mocius on 2017-04-16.
*/
public class ContactPhone extends TestBase {
@Test
public void testContactPhones(){
app.goTo().homePage();
ContactData contact = app.contactHelper().all().iterator().next();
ContactData contactInfoFromEditForm = app.contactHelper().infoFromEditForm(contact);
assertThat(contact.getAllPhones(), equalTo(mergePhones(contactInfoFromEditForm)));
}
private <T> String mergePhones(ContactData contact) {
return Arrays.asList(contact.getHomePhone(), contact.getMobilePhone(),contact.getWorkPhone()).stream().
filter((s) -> ! s.equals("")).map(ContactPhone::cleaned)
.collect(Collectors.joining("\n"));
}
public static String cleaned(String phone){
return phone.replaceAll("\\s", "").replaceAll("[-()]", "");
}
}
| mociek124/java_pft | addressbook-web-tests/src/test/java/ru/stqa/pft/addressbook/tests/ContactPhone.java | Java | apache-2.0 | 1,225 |
package com.oauth.services.security;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.keygen.BytesKeyGenerator;
import org.springframework.security.crypto.keygen.KeyGenerators;
import org.springframework.security.crypto.password.StandardPasswordEncoder;
/**
* Created by yichen.wei on 6/24/17.
*/
public class Test {
public static void main(String args[]) {
BytesKeyGenerator saltGenerator = KeyGenerators.secureRandom();
// StandardPasswordEncoder encode = new StandardPasswordEncoder("SHA-256", "");
// StandardPasswordEncoder encode = new StandardPasswordEncoder("");
StandardPasswordEncoder encode = new StandardPasswordEncoder();
System.out.println("abcfwef...");
//a8ba715d5a076c99b95995d357651df5c296bf308abaa154a54d2418885ec622e9fe8624f2e06524
//be1e54adbd1c5c5d58a714fad7d529c73198c8c51e1f9d43edc79dac4784b5e93460605fe7082b0d
//910a6df88a99d5d81f3376628f3fd6a91a2152a366f2d450ef9220ff32f0c74952f754da62cd5a13
System.out.println(encode.encode("abcdef"));
// System.out.println(encode.encode("mypass"));
String salt = saltGenerator.generateKey().toString();
System.out.println(salt);
System.out.println(saltGenerator.getKeyLength());
BCryptPasswordEncoder bc = new BCryptPasswordEncoder();
System.out.println(bc.encode("admin"));
}
}
| kinddevil/course-service | oauth/src/main/java/com/oauth/services/security/Test.java | Java | apache-2.0 | 1,438 |
<?php
/**
* Created by PhpStorm.
* User: Bartosz Bartniczak <[email protected]>
*/
namespace BartoszBartniczak\EventSourcing\Shop\User\Event;
use BartoszBartniczak\EventSourcing\Event\Id;
class UserAccountHasBeenActivated extends Event
{
/**
* @var string
*/
protected $activationToken;
/**
* @inheritDoc
*/
public function __construct(Id $eventId, \DateTime $dateTime, string $userEmail, string $activationToken)
{
parent::__construct($eventId, $dateTime, $userEmail);
$this->activationToken = $activationToken;
}
/**
* @return string
*/
public function getActivationToken(): string
{
return $this->activationToken;
}
} | BartoszBartniczak/EventSourcing-Example | src/User/Event/UserAccountHasBeenActivated.php | PHP | apache-2.0 | 735 |
# Phoma maculata (Cooke & Harkn.) Sacc. SPECIES
#### Status
SYNONYM
#### According to
Index Fungorum
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Fungi/Ascomycota/Coleophoma/Coleophoma maculiformis/ Syn. Phoma maculata/README.md | Markdown | apache-2.0 | 169 |
package net.distilledcode.httpclient.impl.metatype.reflection;
import org.apache.http.client.config.RequestConfig;
import org.junit.Test;
import java.util.Map;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;
public class InvokersTest {
private static class TestBean {
private boolean featureEnabled = true;
// getters
public String getFooBar() { return null; }
public void getFooBarVoid() {}
// setters
public void setBarFoo(String fooBar) {}
public void setBarFooNoArgs() {}
// boolean switch (only called for enabling, disabled by default
public void enableFeature() {
featureEnabled = true;
}
// boolean switch (only called for disabling, enabled by default
void disableFeature() {
featureEnabled = false;
}
}
@Test
public void invokeMethods() throws Exception {
// builder.setMaxRedirects(5)
Invokers.Invoker<Void> setMaxRedirects = new Invokers.Invoker<>(RequestConfig.Builder.class.getDeclaredMethod("setMaxRedirects", int.class));
RequestConfig.Builder builder = RequestConfig.custom();
setMaxRedirects.invoke(builder, 17);
// requestConfig.getMaxRedirects()
Invokers.Invoker<Integer> getMaxRedirects = new Invokers.Invoker<>(RequestConfig.class.getDeclaredMethod("getMaxRedirects"));
RequestConfig requestConfig = builder.build();
assertThat(getMaxRedirects.invoke(requestConfig), is(17));
}
@Test
public void beanGetters() throws Exception {
Map<String, Invokers.Invoker<?>> testBeanGetters = Invokers.beanGetters(TestBean.class);
assertThat(testBeanGetters.keySet(), allOf(
hasItem("foo.bar"),
not(hasItem("foo.bar.void"))
));
}
@Test
public void beanSetters() throws Exception {
Map<String, Invokers.Invoker<?>> testBeanGetters = Invokers.beanSetters(TestBean.class);
assertThat(testBeanGetters.keySet(), allOf(
hasItem("bar.foo"),
not(hasItem("bar.foo.no.args"))
));
}
@Test
public void conditionalSetter() throws Exception {
Invokers.Invoker<?> featureDisabler = Invokers.conditionalNoArgsSetter(TestBean.class.getDeclaredMethod("disableFeature"), false);
TestBean testBean = new TestBean();
assertThat(testBean.featureEnabled, is(true));
featureDisabler.invoke(testBean, false);
assertThat(testBean.featureEnabled, is(false));
}
@Test
public void conditionalSetterIgnored() throws Exception {
Invokers.Invoker<?> featureDisabler = Invokers.conditionalNoArgsSetter(TestBean.class.getDeclaredMethod("disableFeature"), true);
TestBean testBean = new TestBean();
assertThat(testBean.featureEnabled, is(true));
featureDisabler.invoke(testBean, false);
assertThat(testBean.featureEnabled, is(true));
}
}
| code-distillery/httpclient-configuration-support | src/test/java/net/distilledcode/httpclient/impl/metatype/reflection/InvokersTest.java | Java | apache-2.0 | 3,178 |
--TEST--
swoole_coroutine_server: (length protocol) 1
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
require __DIR__ . '/../include/bootstrap.php';
use SwooleTest\LengthServer;
class TestServer_5 extends LengthServer
{
protected $show_lost_package = true;
function onWorkerStart()
{
global $pm;
$pm->wakeup();
}
function onClose()
{
parent::onClose();
$this->serv->shutdown();
}
}
TestServer_5::$random_bytes = true;
TestServer_5::$pkg_num = IS_IN_TRAVIS ? 1000 : 10000;
$pm = new ProcessManager;
$pm->parentFunc = function ($pid) use ($pm)
{
$client = new swoole_client(SWOOLE_SOCK_TCP);
if (!$client->connect('127.0.0.1', $pm->getFreePort()))
{
exit("connect failed\n");
}
$bytes = 0;
$pkg_bytes = 0;
for ($i = 0; $i < TestServer_5::$pkg_num; $i++)
{
// if ($i % 1000 == 0)
// {
// echo "#{$i} send package. sid={$sid}, length=" . ($len + 10) . ", total bytes={$pkg_bytes}\n";
// }
if (!$client->send(TestServer_5::getPacket()))
{
echo "send [$i] failed.\n";
break;
}
$bytes += 2;
}
$recv = $client->recv();
echo $recv;
//echo "send ".TestServer::PKG_NUM." packet sucess, send $bytes bytes\n";
$client->close();
};
$pm->childFunc = function () use ($pm) {
go(function () use ($pm) {
$serv = new TestServer_5($pm->getFreePort(), false);
$serv->start();
});
swoole_event::wait();
};
$pm->childFirst();
$pm->run();
?>
--EXPECTF--
end
Total count=%d, bytes=%d
| LinkedDestiny/swoole-src | tests/swoole_server_coro/length_1.phpt | PHP | apache-2.0 | 1,637 |
# Physalis lathyroides f. parvifolia Chodat & Hassl. FORM
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Solanales/Solanaceae/Physalis/Physalis lathyroides/Physalis lathyroides parvifolia/README.md | Markdown | apache-2.0 | 197 |
# Antennaria luzuloides ssp. aberrans (E.E. Nelson) Bayer & Stebbins SUBSPECIES
#### Status
ACCEPTED
#### According to
Integrated Taxonomic Information System
#### Published in
Canad. J. Bot. 71:1597. 1993
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Antennaria/Antennaria luzuloides/Antennaria luzuloides aberrans/README.md | Markdown | apache-2.0 | 251 |
/*
* Copyright 2013 Square 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 flowless;
import android.os.Parcelable;
import android.support.annotation.NonNull;
/**
* Used by History to convert your key objects to and from instances of
* {@link android.os.Parcelable}.
*/
public interface KeyParceler {
@NonNull
Parcelable toParcelable(@NonNull Object key);
@NonNull
Object toKey(@NonNull Parcelable parcelable);
}
| Zhuinden/flowless | flowless-library/src/main/java/flowless/KeyParceler.java | Java | apache-2.0 | 964 |
select ST_Length(ST_Linestring(1,1, 1,2, 2,2, 2,1)),
ST_Length(ST_Linestring(1,1, 1,4, 4,4, 4,1)),
ST_Length(ST_Linestring(1,1, 1,7, 7,7, 7,1)) from onerow;
select ST_Area(ST_Polygon(1,1, 1,2, 2,2, 2,1)),
ST_Area(ST_Polygon(1,1, 1,4, 4,4, 4,1)) from onerow;
select ST_Contains(ST_Polygon(1, 1, 1, 4, 4, 4, 4, 1), ST_Point(2, 3)),
ST_Contains(ST_Polygon(1, 1, 1, 4, 4, 4, 4, 1), ST_Point(8, 8)) from onerow;
select ST_CoordDim(ST_Point(0., 3.)),
ST_CoordDim(ST_PointZ(0., 3., 1)) from onerow;
select ST_Crosses(st_linestring(2,0, 2,3), ST_Polygon(1,1, 1,4, 4,4, 4,1)),
ST_Crosses(st_linestring(8,7, 7,8), ST_Polygon(1,1, 1,4, 4,4, 4,1)) from onerow;
select ST_Dimension(ST_Point(0,0)),
ST_Dimension(ST_LineString(1.5,2.5, 3.0,2.2)) from onerow;
select ST_Disjoint(st_point(1,1), ST_Point(1,1)),
ST_Disjoint(st_point(2,0), ST_Point(1,1)) from onerow;
select ST_EnvIntersects(st_point(1,1), ST_Point(1,1)),
ST_EnvIntersects(st_point(2,0), ST_Point(1,1)) from onerow;
select ST_Equals(st_point(1,1), ST_Point(1,1)),
ST_Equals(st_point(2,0), ST_Point(1,1)) from onerow;
select ST_Intersects(st_point(1,1), ST_Point(1,1)),
ST_Intersects(st_point(2,0), ST_Point(1,1)) from onerow;
select ST_Is3D(ST_Point(0., 3.)),
ST_Is3D(ST_PointZ(0., 3., 1)) from onerow;
select ST_Overlaps(st_polygon(2,0, 2,3, 3,0), ST_Polygon(1,1, 1,4, 4,4, 4,1)),
ST_Overlaps(st_polygon(2,0, 2,1, 3,1), ST_Polygon(1,1, 1,4, 4,4, 4,1)) from onerow;
select ST_Touches(ST_Point(1, 3), ST_Polygon(1, 1, 1, 4, 4, 4, 4, 1)),
ST_Touches(ST_Point(8, 8), ST_Polygon(1, 1, 1, 4, 4, 4, 4, 1)) from onerow;
select ST_Within(ST_Point(2, 3), ST_Polygon(1, 1, 1, 4, 4, 4, 4, 1)),
ST_Within(ST_Point(8, 8), ST_Polygon(1, 1, 1, 4, 4, 4, 4, 1)) from onerow;
| SpaceCurve/spatial-framework-for-hadoop | hive/test/st-geom-multi-call.sql | SQL | apache-2.0 | 1,707 |
/*
* Copyright 2012 Michael Bischoff
*
* 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 de.jpaw.util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.Externalizable;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.OutputStream;
import java.nio.charset.Charset;
/**
* Functionality which corresponds to String, but for byte arrays.
* Essential feature is that the class is immutable, so you can use it in messaging without making deep copies.
* Mimicking {@link java.lang.String}, the class contains offset and length fields to allow sharing of the buffer.
* <p>
* This should really exist in Java SE already.
*
* @author Michael Bischoff
*
*/
public final class ByteArray implements Externalizable, Cloneable {
private static final long serialVersionUID = 2782729564297256974L;
public static final Charset CHARSET_UTF8 = Charset.forName("UTF-8"); // default character set is available on all platforms
private static final int MAGIC_LENGTH_INDICATING_32_BIT_SIZE = 247; // if a single byte length of this value is written in the
// serialized form, it indicates a full four byte length must be read instead. Not used 0 or 255 due to their frequent use.
private final byte[] buffer;
private final int offset;
private final int length;
private ByteArray extraFieldJustRequiredForDeserialization = null; // transient temporary field
private static final byte[] ZERO_JAVA_BYTE_ARRAY = new byte[0];
public static final ByteArray ZERO_BYTE_ARRAY = new ByteArray(ZERO_JAVA_BYTE_ARRAY);
/** No-arg constructor required for Serializable interface. */
@Deprecated
public ByteArray() {
this(ZERO_JAVA_BYTE_ARRAY);
}
/** Constructs a ByteArray from a source byte[], which is defensively copied. */
public ByteArray(final byte[] source) {
if (source == null || source.length == 0) {
buffer = ZERO_JAVA_BYTE_ARRAY;
offset = 0;
length = 0;
} else {
buffer = source.clone(); // benchmarks have shown that clone() is equally fast as System.arraycopy for all lengths > 0
offset = 0;
length = buffer.length;
}
}
// construct a ByteArray from a trusted source byte[]
// this method is always called with unsafeTrustedReuseOfJavaByteArray = true, the parameter is only required in order to distinguish the constructor
// from the copying one
private ByteArray(final byte[] source, final boolean unsafeTrustedReuseOfJavaByteArray) {
if (source == null || source.length == 0) {
buffer = ZERO_JAVA_BYTE_ARRAY;
offset = 0;
length = 0;
} else {
buffer = unsafeTrustedReuseOfJavaByteArray ? source : source.clone();
offset = 0;
length = buffer.length;
}
}
/** Constructs a ByteArray from a ByteArrayOutputStream, which has just been contructed by some previous process.
* @throws IOException */
public static ByteArray fromByteArrayOutputStream(final ByteArrayOutputStream baos) throws IOException {
baos.flush();
return new ByteArray(baos.toByteArray(), true);
}
/** Writes the contents of this ByteArray to an OutputStream. */
public void toOutputStream(final OutputStream os) throws IOException {
os.write(buffer, offset, length);
}
/** Constructs a ByteArray from the provided DataInput, with a predefined length. */
public static ByteArray fromDataInput(final DataInput in, final int len) throws IOException {
if (len <= 0)
return ZERO_BYTE_ARRAY;
final byte[] tmp = new byte[len];
in.readFully(tmp);
return new ByteArray(tmp, true);
}
/** read bytes from an input stream, up to maxBytes (or all which exist, if maxBytes = 0). */
public static ByteArray fromInputStream(final InputStream is, final int maxBytes) throws IOException {
final ByteBuilder tmp = maxBytes > 0 ? new ByteBuilder(maxBytes, CHARSET_UTF8) : new ByteBuilder();
tmp.readFromInputStream(is, maxBytes);
if (tmp.length() == 0)
return ZERO_BYTE_ARRAY;
return new ByteArray(tmp.getCurrentBuffer(), 0, tmp.length());
}
/** Constructs a ByteArray from the provided ByteBuilder. */
public static ByteArray fromByteBuilder(final ByteBuilder in) {
if (in == null || in.length() == 0)
return ZERO_BYTE_ARRAY;
return new ByteArray(in.getCurrentBuffer(), 0, in.length());
}
/** Constructs a ByteArray from the provided String, using the UTF8 character set. */
public static ByteArray fromString(final String in) {
return fromString(in, CHARSET_UTF8);
}
/** Constructs a ByteArray from the provided String, using the specified character set. */
public static ByteArray fromString(final String in, final Charset cs) {
if (in == null || in.length() == 0)
return ZERO_BYTE_ARRAY;
return new ByteArray(in.getBytes(cs), true); // we know these bytes are never changed, so no extra copy required
}
/** returns the byte array as a string. Unlike toString(), which uses the JVM default character set, this method always uses UTF-8. */
public String asString() {
return asString(CHARSET_UTF8);
}
/** returns the byte array as a string, using a specified character set. */
public String asString(final Charset cs) {
return new String(buffer, offset, length, cs);
}
/** construct a ByteArray from a source byte[], with offset and length. source may not be null. */
public ByteArray(final byte[] source, final int offset, final int length) {
if (source == null || offset < 0 || length < 0 || offset + length > source.length)
throw new IllegalArgumentException();
buffer = new byte[length];
System.arraycopy(source, offset, buffer, 0, length);
this.offset = 0;
this.length = length;
}
/** Construct a ByteArray from another one. Could also just assign it due to immutability.
* The only benefit of this constructor is that it converts a null parameter into the non-null empty ByteArray. */
public ByteArray(final ByteArray source) {
if (source == null) {
buffer = ZERO_JAVA_BYTE_ARRAY;
offset = 0;
length = 0;
} else {
buffer = source.buffer; // no array copy required due to immutability
offset = source.offset;
length = source.length;
}
}
/** Construct a ByteArray from a source byte[], with offset and length. source may not be null.
* Similar to the subArray member method. */
public ByteArray(final ByteArray source, final int offset, final int length) {
if (source == null || offset < 0 || length < 0 || offset + length > source.length)
throw new IllegalArgumentException();
this.buffer = source.buffer; // no array copy required due to immutability
this.offset = source.offset + offset;
this.length = length;
}
/** Returns a ByteArray which contains a subsequence of the bytes of this one. The underlying buffer is shared.
* Functionality wise this corresponds to String.substring (before Java 6) or ByteBuffer.slice. */
public ByteArray subArray(final int xoffset, final int xlength) {
// create a new ByteArray sharing the same buffer
return new ByteArray(this, xoffset, xlength);
}
/** Returns a ByteArray which contains a subsequence of the bytes of this one. The underlying buffer is not shared.
* Use this variant if the original ByteArray holds a much larger byte[] and can be GCed afterwards. */
public ByteArray subArrayUnshared(final int xoffset, final int xlength) {
if (xoffset < 0 || xlength < 0 || xoffset + xlength > this.length)
throw new IllegalArgumentException();
final byte[] newBuffer = new byte[xlength];
System.arraycopy(buffer, xoffset, newBuffer, 0, xlength);
// create a new ByteArray using the new buffer
return new ByteArray(newBuffer, true);
}
@Override
public ByteArray clone() {
return new ByteArray(this);
}
public int length() {
return this.length;
}
// public int getOffset() {
// return this.offset;
// }
//
// /** Returns the internal buffer of this object. It may only be used for read-only access.
// * Java is missing a "const" specifier for arrays as it is available in C and C++.
// *
// * Java-purists will complain against exposing this internal state of an immutable object, but as long as
// * access is possible via reflection anyway, just with performance penalty, it would be outright stupid
// * to force people to use reflection, or even defensive copies. Instead I hope the name of the method
// * documents the intended use.
// */
// public byte /* const */[] unsafe$getConstBufferOfConstBytes() {
// return this.buffer;
// }
public int indexOf(final byte x) {
int i = 0;
while (i < length) {
if (buffer[offset + i] == x)
return i;
++i;
}
return -1;
}
public int indexOf(final byte x, final int fromIndex) {
int i = fromIndex >= 0 ? fromIndex : 0;
while (i < length) {
if (buffer[offset + i] == x)
return i;
++i;
}
return -1;
}
public int lastIndexOf(final byte x) {
int i = length;
while (i > 0) {
if (buffer[offset + --i] == x)
return i;
}
return -1;
}
public int lastIndexOf(final byte x, final int fromIndex) {
int i = fromIndex >= length ? length - 1 : fromIndex;
while (i >= 0) {
if (buffer[offset + i] == x)
return i;
--i;
}
return -1;
}
public byte byteAt(final int pos) {
if (pos < 0 || pos >= length)
throw new IllegalArgumentException();
return buffer[offset + pos];
}
/** Provides the contents of this ByteArray to some InputStream. */
public ByteArrayInputStream asByteArrayInputStream() {
return new ByteArrayInputStream(buffer, offset, length());
}
// return a defensive copy of the contents
public byte[] getBytes() {
final byte[] result = new byte[length];
System.arraycopy(buffer, offset, result, 0, length);
return result;
}
// return a defensive copy of part of the contents. Shorthand for subArray(offset, length).getBytes(),
// which would create a temporary object
public byte[] getBytes(final int xoffset, final int xlength) {
if (xoffset < 0 || xlength < 0 || xoffset + xlength > this.length)
throw new IllegalArgumentException();
final byte[] result = new byte[xlength];
System.arraycopy(buffer, xoffset + this.offset, result, 0, xlength);
return result;
}
private boolean contentEqualsSub(final byte[] dst, final int dstOffset, final int dstLength) {
if (length != dstLength)
return false;
for (int i = 0; i < dstLength; ++i) {
if (buffer[offset + i] != dst[dstOffset + i])
return false;
}
return true;
}
// following: all arguments must be not null
public boolean contentEquals(final ByteArray that) {
return contentEqualsSub(that.buffer, that.offset, that.length);
}
public boolean contentEquals(final byte[] that) {
return contentEqualsSub(that, 0, that.length);
}
public boolean contentEquals(final byte[] that, final int thatOffset, final int thatLength) {
if (thatOffset < 0 || thatLength < 0 || thatOffset + thatLength > that.length)
throw new IllegalArgumentException();
return contentEqualsSub(that, thatOffset, thatLength);
}
// returns if the two instances share the same backing buffer (for debugging)
public boolean shareBuffer(final ByteArray that) {
return buffer == that.buffer;
}
@Override
public int hashCode() {
int hash = 997;
for (int i = 0; i < length; ++i) {
hash = 29 * hash + buffer[offset + i];
}
return hash;
}
// two ByteArrays are considered equal if they have the same visible contents
@Override
public boolean equals(final Object that) {
if (this == that)
return true;
if (that == null || getClass() != that.getClass())
return false;
final ByteArray xthat = (ByteArray)that;
// same as contentEqualsSub(..) now
if (this.length != xthat.length)
return false;
for (int i = 0; i < length; ++i) {
if (buffer[offset + i] != xthat.buffer[xthat.offset + i])
return false;
}
return true;
}
// support function to allow dumping contents to DataOutput without the need to expose our internal buffer
public void writeToDataOutput(final DataOutput out) throws IOException {
out.write(buffer, offset, length);
}
public String hexdump(final int startAt, final int maxlength) {
if (length <= startAt)
return ""; // no data to dump
return ByteUtil.dump(buffer, offset + startAt, (maxlength > 0 && maxlength < length) ? maxlength : length);
}
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
//writeBytes(out, buffer, offset, length);
if (length < 256 && length != MAGIC_LENGTH_INDICATING_32_BIT_SIZE) {
out.writeByte(length);
} else {
out.writeByte(MAGIC_LENGTH_INDICATING_32_BIT_SIZE);
out.writeInt(length);
}
out.write(buffer, offset, length);
}
// support function to allow ordinary byte[] to be written in same fashion
public static void writeBytes(final ObjectOutput out, final byte[] buffer, final int offset, final int length) throws IOException {
if (length < 256 && length != MAGIC_LENGTH_INDICATING_32_BIT_SIZE) {
out.writeByte(length);
} else {
out.writeByte(MAGIC_LENGTH_INDICATING_32_BIT_SIZE);
out.writeInt(length);
}
out.write(buffer, offset, length);
}
public static byte[] readBytes(final ObjectInput in) throws IOException {
int newlength = in.readByte();
if (newlength < 0)
newlength += 256; // want full unsigned range
if (newlength == MAGIC_LENGTH_INDICATING_32_BIT_SIZE) // magic to indicate four byte length
newlength = in.readInt();
// System.out.println("ByteArray.readExternal() with length " + newlength);
if (newlength == 0)
return ZERO_JAVA_BYTE_ARRAY;
final byte[] localBuffer = new byte[newlength];
int done = 0;
while (done < newlength) {
final int nRead = in.read(localBuffer, done, newlength - done); // may return less bytes than requested!
if (nRead <= 0)
throw new IOException("deserialization of ByteArray returned " + nRead + " while expecting " + (newlength - done));
done += nRead;
}
return localBuffer;
}
// factory method to read from objectInput via above helper function
public static ByteArray read(final ObjectInput in) throws IOException {
return new ByteArray(readBytes(in), true);
}
// a direct implementation of this method would conflict with the immutability / "final" attributes of the field
// Weird Java language design again. If readExternal() is kind of a constructor, why are assignments to final fields not allowed here?
// alternatives around are to add artificial fields and use readResolve / proxies or to discard the "final" attributes,
// or using reflection to set the values (!?). Bleh!
// We're using kind of Bloch's "proxy" pattern (Essential Java, #78), namely a single-sided variant with just a single additonal member field,
// which lets us preserve the immutability
// see also http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6379948 for discussion around this
@Override
public void readExternal(final ObjectInput in) throws IOException {
extraFieldJustRequiredForDeserialization = new ByteArray(readBytes(in), true);
}
public Object readResolve() {
// System.out.println("ByteArray.readResolve()");
if (extraFieldJustRequiredForDeserialization == null)
throw new RuntimeException("readResolve() called on instance not obtained via readExternal()");
return extraFieldJustRequiredForDeserialization;
}
// factory method to construct a byte array from a prevalidated base64 byte sequence. returns null if length is suspicious
public static ByteArray fromBase64(final byte[] data, final int offset, final int length) {
if (length == 0)
return ZERO_BYTE_ARRAY;
final byte[] tmp = Base64.decode(data, offset, length);
if (tmp == null)
return null;
return new ByteArray(tmp, true);
}
public void appendBase64(final ByteBuilder b) {
Base64.encodeToByte(b, buffer, offset, length);
}
public void appendToRaw(final ByteBuilder b) {
b.write(buffer, offset, length);
}
/** Returns the contents of this ByteArray as a base64 encoded string.
* @since 1.2.12 */
public String asBase64() {
final ByteBuilder tmp = new ByteBuilder(0, null);
Base64.encodeToByte(tmp, buffer, offset, length);
return tmp.toString();
}
// returns the String representation of the visible bytes portion
@Override
public String toString() {
return new String(buffer, offset, length);
}
}
| jpaw/jpaw | jpaw-util/src/main/java/de/jpaw/util/ByteArray.java | Java | apache-2.0 | 18,751 |
/*
* Copyright (C) 2014 Jörg Prante
*
* 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.xbib.elasticsearch.plugin.jdbc.feeder;
import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.ESLoggerFactory;
import org.elasticsearch.common.metrics.MeterMetric;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.loader.JsonSettingsLoader;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.river.RiverName;
import org.xbib.elasticsearch.plugin.jdbc.RiverRunnable;
import org.xbib.elasticsearch.plugin.jdbc.classloader.uri.URIClassLoader;
import org.xbib.elasticsearch.plugin.jdbc.client.Ingest;
import org.xbib.elasticsearch.plugin.jdbc.client.IngestFactory;
import org.xbib.elasticsearch.plugin.jdbc.client.transport.BulkTransportClient;
import org.xbib.elasticsearch.plugin.jdbc.cron.CronExpression;
import org.xbib.elasticsearch.plugin.jdbc.cron.CronThreadPoolExecutor;
import org.xbib.elasticsearch.plugin.jdbc.state.RiverStatesMetaData;
import org.xbib.elasticsearch.plugin.jdbc.util.RiverServiceLoader;
import org.xbib.elasticsearch.river.jdbc.RiverFlow;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.Reader;
import java.io.Writer;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import static org.elasticsearch.common.collect.Lists.newLinkedList;
import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
/**
* Standalone feeder for JDBC
*/
public class JDBCFeeder {
private final static ESLogger logger = ESLoggerFactory.getLogger("JDBCFeeder");
/**
* Register metadata factory in Elasticsearch for being able to decode
* ClusterStateResponse with RiverStatesMetadata
*/
static {
MetaData.registerFactory(RiverStatesMetaData.TYPE, RiverStatesMetaData.FACTORY);
}
protected Reader reader;
protected Writer writer;
protected PrintStream printStream;
protected IngestFactory ingestFactory;
/**
* This ingest is the client for the river flow state operations
*/
private Ingest ingest;
private RiverFlow riverFlow;
private List<Map<String, Object>> definitions;
private ThreadPoolExecutor threadPoolExecutor;
private volatile Thread feederThread;
private volatile boolean closed;
/**
* Constructor for running this from command line
*/
public JDBCFeeder() {
Runtime.getRuntime().addShutdownHook(shutdownHook());
}
public void exec() throws Exception {
readFrom(new InputStreamReader(System.in, "UTF-8"))
.writeTo(new OutputStreamWriter(System.out, "UTF-8"))
.errorsTo(System.err)
.start();
}
@SuppressWarnings("unchecked")
public JDBCFeeder readFrom(Reader reader) {
this.reader = reader;
try {
Map<String, Object> map = XContentFactory.xContent(XContentType.JSON).createParser(reader).mapOrderedAndClose();
Settings settings = settingsBuilder()
.put(new JsonSettingsLoader().load(jsonBuilder().map(map).string()))
.build();
this.definitions = newLinkedList();
Object pipeline = map.get("jdbc");
if (pipeline instanceof Map) {
definitions.add((Map<String, Object>) pipeline);
}
if (pipeline instanceof List) {
definitions.addAll((List<Map<String, Object>>) pipeline);
}
// before running, create the river flow
createRiverFlow(map, settings);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return this;
}
protected RiverFlow createRiverFlow(Map<String, Object> spec, Settings settings) throws IOException {
String strategy = XContentMapValues.nodeStringValue(spec.get("strategy"), "simple");
this.riverFlow = RiverServiceLoader.newRiverFlow(strategy);
logger.debug("strategy {}: river flow class {}, spec = {} settings = {}",
strategy, riverFlow.getClass().getName(), spec, settings.getAsMap());
this.ingestFactory = createIngestFactory(settings);
// out private ingest, needed for having a client in the river flow
this.ingest = ingestFactory.create();
riverFlow.setRiverName(new RiverName("jdbc", "feeder"))
.setSettings(settings)
.setClient(ingest.client())
.setIngestFactory(ingestFactory)
.setMetric(new MeterMetric(Executors.newScheduledThreadPool(1), TimeUnit.SECONDS))
.setQueue(new ConcurrentLinkedDeque<Map<String, Object>>());
return riverFlow;
}
public JDBCFeeder writeTo(Writer writer) {
this.writer = writer;
return this;
}
public JDBCFeeder errorsTo(PrintStream printStream) {
this.printStream = printStream;
return this;
}
public JDBCFeeder start() throws Exception {
this.closed = false;
if (ingest.getConnectedNodes().isEmpty()) {
throw new IOException("no nodes connected, can't continue");
}
this.feederThread = new Thread(new RiverRunnable(riverFlow, definitions));
List<Future<?>> futures = schedule(feederThread);
// wait for all threads to finish
for (Future<?> future : futures) {
future.get();
}
ingest.shutdown();
return this;
}
private List<Future<?>> schedule(Thread thread) {
Settings settings = riverFlow.getSettings();
String[] schedule = settings.getAsArray("schedule");
List<Future<?>> futures = newLinkedList();
Long seconds = settings.getAsTime("interval", TimeValue.timeValueSeconds(0)).seconds();
if (schedule != null && schedule.length > 0) {
CronThreadPoolExecutor cronThreadPoolExecutor =
new CronThreadPoolExecutor(settings.getAsInt("threadpoolsize", 1));
for (String cron : schedule) {
futures.add(cronThreadPoolExecutor.schedule(thread, new CronExpression(cron)));
}
this.threadPoolExecutor = cronThreadPoolExecutor;
logger.debug("scheduled feeder instance with cron expressions {}", Arrays.asList(schedule));
} else if (seconds > 0L) {
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor =
new ScheduledThreadPoolExecutor(settings.getAsInt("threadpoolsize", 4));
futures.add(scheduledThreadPoolExecutor.scheduleAtFixedRate(thread, 0L, seconds, TimeUnit.SECONDS));
logger.debug("scheduled feeder instance at fixed rate of {} seconds", seconds);
this.threadPoolExecutor = scheduledThreadPoolExecutor;
} else {
this.threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>());
futures.add(threadPoolExecutor.submit(thread));
logger.debug("started feeder instance");
}
return futures;
}
/**
* Shut down feeder instance by Ctrl-C
*
* @return shutdown thread
*/
public Thread shutdownHook() {
return new Thread() {
public void run() {
try {
shutdown();
} catch (Exception e) {
e.printStackTrace(printStream);
}
}
};
}
public synchronized void shutdown() throws Exception {
if (closed) {
return;
}
closed = true;
if (threadPoolExecutor != null) {
threadPoolExecutor.shutdownNow();
threadPoolExecutor = null;
}
if (feederThread != null) {
feederThread.interrupt();
}
if (!ingest.isShutdown()) {
ingest.shutdown();
}
reader.close();
writer.close();
printStream.close();
}
private IngestFactory createIngestFactory(final Settings settings) {
return new IngestFactory() {
@Override
public Ingest create() {
Integer maxbulkactions = settings.getAsInt("max_bulk_actions", 10000);
Integer maxconcurrentbulkrequests = settings.getAsInt("max_concurrent_bulk_requests",
Runtime.getRuntime().availableProcessors() * 2);
ByteSizeValue maxvolume = settings.getAsBytesSize("max_bulk_volume", ByteSizeValue.parseBytesSizeValue("10m"));
TimeValue maxrequestwait = settings.getAsTime("max_request_wait", TimeValue.timeValueSeconds(60));
TimeValue flushinterval = settings.getAsTime("flush_interval", TimeValue.timeValueSeconds(5));
File home = new File(settings.get("home", "."));
BulkTransportClient ingest = new BulkTransportClient();
Settings clientSettings = ImmutableSettings.settingsBuilder()
.put("cluster.name", settings.get("elasticsearch.cluster", "elasticsearch"))
.put("host", settings.get("elasticsearch.host", "localhost"))
.put("port", settings.getAsInt("elasticsearch.port", 9300))
.put("sniff", settings.getAsBoolean("elasticsearch.sniff", false))
.put("name", "feeder") // prevents lookup of names.txt, we don't have it, and marks this node as "feeder". See also module load skipping in JDBCRiverPlugin
.put("client.transport.ignore_cluster_name", true) // ignore cluster name setting
.put("client.transport.ping_timeout", settings.getAsTime("elasticsearch.timeout", TimeValue.timeValueSeconds(10))) // ping timeout
.put("client.transport.nodes_sampler_interval", settings.getAsTime("elasticsearch.timeout", TimeValue.timeValueSeconds(5))) // for sniff sampling
.put("path.plugins", ".dontexist") // pointing to a non-exiting folder means, this disables loading site plugins
// adding our custom class loader is tricky, actions may not be registered to ActionService
.classLoader(getClassLoader(getClass().getClassLoader(), home))
.build();
ingest.maxActionsPerBulkRequest(maxbulkactions)
.maxConcurrentBulkRequests(maxconcurrentbulkrequests)
.maxVolumePerBulkRequest(maxvolume)
.maxRequestWait(maxrequestwait)
.flushIngestInterval(flushinterval)
.newClient(clientSettings);
return ingest;
}
};
}
/**
* We have to add Elasticsearch to our classpath, but exclude all jvm plugins
* for starting our TransportClient.
*
* @param home ES_HOME
* @return a custom class loader with our dependencies
*/
private ClassLoader getClassLoader(ClassLoader parent, File home) {
URIClassLoader classLoader = new URIClassLoader(parent);
File[] libs = new File(home + "/lib").listFiles();
if (libs != null) {
for (File file : libs) {
if (file.getName().toLowerCase().endsWith(".jar")) {
classLoader.addURI(file.toURI());
}
}
}
return classLoader;
}
}
| songwie/elasticsearch-river-jdbc | src/main/java/org/xbib/elasticsearch/plugin/jdbc/feeder/JDBCFeeder.java | Java | apache-2.0 | 12,908 |
/*
* Copyright @ 2015 Atlassian Pty Ltd
*
* 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.jitsi.service.neomedia.stats;
import org.jitsi.service.neomedia.*;
import java.util.*;
/**
* An extended interface for accessing the statistics of a {@link MediaStream}.
*
* The reason to extend the {@link MediaStreamStats} interface rather than
* adding methods into it is to allow the implementation to reside in a separate
* class. This is desirable in order to:
* 1. Help to keep the old interface for backward compatibility.
* 2. Provide a "clean" place where future code can be added, thus avoiding
* further cluttering of the already overly complicated
* {@link org.jitsi.impl.neomedia.MediaStreamStatsImpl}.
*
* @author Boris Grozev
*/
public interface MediaStreamStats2
extends MediaStreamStats
{
/**
* @return the instance which keeps aggregate statistics for the associated
* {@link MediaStream} in the receive direction.
*/
ReceiveTrackStats getReceiveStats();
/**
* @return the instance which keeps aggregate statistics for the associated
* {@link MediaStream} in the send direction.
*/
SendTrackStats getSendStats();
/**
* @return the instance which keeps statistics for a particular SSRC in the
* receive direction.
*/
ReceiveTrackStats getReceiveStats(long ssrc);
/**
* @return the instance which keeps statistics for a particular SSRC in the
* send direction.
*/
SendTrackStats getSendStats(long ssrc);
/**
* @return all per-SSRC statistics for the send direction.
*/
Collection<? extends SendTrackStats> getAllSendStats();
/**
* @return all per-SSRC statistics for the receive direction.
*/
Collection<? extends ReceiveTrackStats> getAllReceiveStats();
/**
* Clears send ssrc stats.
* @param ssrc the ssrc to clear.
*/
void clearSendSsrc(long ssrc);
}
| jitsi/libjitsi | src/main/java/org/jitsi/service/neomedia/stats/MediaStreamStats2.java | Java | apache-2.0 | 2,461 |
/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets 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 io.druid.data.input.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import io.druid.TestObjectMapper;
import org.junit.Assert;
import org.junit.Test;
import javax.validation.constraints.Null;
import java.io.IOException;
import java.util.Arrays;
public class DelimitedParseSpecTest
{
private final ObjectMapper jsonMapper = new TestObjectMapper();
@Test
public void testSerde() throws IOException
{
DelimitedParseSpec spec = new DelimitedParseSpec(
new TimestampSpec("abc", "iso", null,null),
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(Arrays.asList("abc")), null, null),
"\u0001",
"\u0002",
Arrays.asList("abc")
);
final DelimitedParseSpec serde = jsonMapper.readValue(
jsonMapper.writeValueAsString(spec),
DelimitedParseSpec.class
);
Assert.assertEquals("abc", serde.getTimestampSpec().getTimestampColumn());
Assert.assertEquals("iso", serde.getTimestampSpec().getTimestampFormat());
Assert.assertEquals(Arrays.asList("abc"), serde.getColumns());
Assert.assertEquals("\u0001", serde.getDelimiter());
Assert.assertEquals("\u0002", serde.getListDelimiter());
Assert.assertEquals(Arrays.asList("abc"), serde.getDimensionsSpec().getDimensionNames());
}
@Test(expected = IllegalArgumentException.class)
public void testColumnMissing() throws Exception
{
final ParseSpec spec = new DelimitedParseSpec(
new TimestampSpec(
"timestamp",
"auto",
null,
null
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a", "b")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
),
",",
" ",
Arrays.asList("a")
);
}
@Test(expected = IllegalArgumentException.class)
public void testComma() throws Exception
{
final ParseSpec spec = new DelimitedParseSpec(
new TimestampSpec(
"timestamp",
"auto",
null,
null
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a,", "b")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
),
",",
null,
Arrays.asList("a")
);
}
@Test(expected = NullPointerException.class)
public void testDefaultColumnList(){
final DelimitedParseSpec spec = new DelimitedParseSpec(
new TimestampSpec(
"timestamp",
"auto",
null,
null
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a", "b")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
),
",",
null,
// pass null columns not allowed
null
);
}
}
| Saligia-eva/mobvista_druid | api/src/test/java/io/druid/data/input/impl/DelimitedParseSpecTest.java | Java | apache-2.0 | 3,790 |
# Dovyalis engleri Gilg SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Salicaceae/Dovyalis/Dovyalis engleri/README.md | Markdown | apache-2.0 | 171 |
/*
* Copyright 2010-2016 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.elasticloadbalancing.model;
import java.io.Serializable;
/**
*
*/
public class RegisterInstancesWithLoadBalancerResult implements Serializable, Cloneable {
/**
* The updated list of instances for the load balancer.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag<Instance> instances;
/**
* The updated list of instances for the load balancer.
*
* @return The updated list of instances for the load balancer.
*/
public java.util.List<Instance> getInstances() {
if (instances == null) {
instances = new com.amazonaws.internal.ListWithAutoConstructFlag<Instance>();
instances.setAutoConstruct(true);
}
return instances;
}
/**
* The updated list of instances for the load balancer.
*
* @param instances The updated list of instances for the load balancer.
*/
public void setInstances(java.util.Collection<Instance> instances) {
if (instances == null) {
this.instances = null;
return;
}
com.amazonaws.internal.ListWithAutoConstructFlag<Instance> instancesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Instance>(instances.size());
instancesCopy.addAll(instances);
this.instances = instancesCopy;
}
/**
* The updated list of instances for the load balancer.
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if
* any). Use {@link #setInstances(java.util.Collection)} or {@link
* #withInstances(java.util.Collection)} if you want to override the
* existing values.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param instances The updated list of instances for the load balancer.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RegisterInstancesWithLoadBalancerResult withInstances(Instance... instances) {
if (getInstances() == null) setInstances(new java.util.ArrayList<Instance>(instances.length));
for (Instance value : instances) {
getInstances().add(value);
}
return this;
}
/**
* The updated list of instances for the load balancer.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param instances The updated list of instances for the load balancer.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RegisterInstancesWithLoadBalancerResult withInstances(java.util.Collection<Instance> instances) {
if (instances == null) {
this.instances = null;
} else {
com.amazonaws.internal.ListWithAutoConstructFlag<Instance> instancesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Instance>(instances.size());
instancesCopy.addAll(instances);
this.instances = instancesCopy;
}
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getInstances() != null) sb.append("Instances: " + getInstances() );
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInstances() == null) ? 0 : getInstances().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof RegisterInstancesWithLoadBalancerResult == false) return false;
RegisterInstancesWithLoadBalancerResult other = (RegisterInstancesWithLoadBalancerResult)obj;
if (other.getInstances() == null ^ this.getInstances() == null) return false;
if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == false) return false;
return true;
}
@Override
public RegisterInstancesWithLoadBalancerResult clone() {
try {
return (RegisterInstancesWithLoadBalancerResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!",
e);
}
}
}
| trasa/aws-sdk-java | aws-java-sdk-elasticloadbalancing/src/main/java/com/amazonaws/services/elasticloadbalancing/model/RegisterInstancesWithLoadBalancerResult.java | Java | apache-2.0 | 5,518 |
package com.example.godtemper.db;
import java.util.ArrayList;
import java.util.List;
import com.example.godtemper.model.City;
import com.example.godtemper.model.County;
import com.example.godtemper.model.Province;
import android.R.integer;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
public class GodTemperDB {
/**
* Êý¾Ý¿âÃû
*/
public static final String DB_NAME = "GodTemper";
/**
* Êý¾Ý¿â°æ±¾
*/
public static final int VERSION = 1;
private static GodTemperDB godTemperDB;
private SQLiteDatabase db;
private GodTemperDB(Context context){
GodTemperOpenHelper dbHelper = new GodTemperOpenHelper(context, DB_NAME, null, VERSION);
db = dbHelper.getWritableDatabase();
}
/**
* »ñÈ¡godTemperDBµÄʵÀý
* @param context
* @return
*/
public synchronized static GodTemperDB getInstance(Context context){
if(godTemperDB == null){
godTemperDB = new GodTemperDB(context);
}
return godTemperDB;
}
/**
* ½«ProvinceʵÀý´æ´¢µ½Êý¾Ý¿â
* @param province
*/
public void saveProvince(Province province){
if(province != null){
ContentValues values = new ContentValues();
values.put("province_name", province.getProvinceName());
values.put("province_code", province.getProvinceCode());
db.insert("Province", null, values);
}
}
/**
* ´ÓÊý¾Ý¿â¶Áȡȫ¹úËùÓÐÊ¡·ÝµÄÐÅÏ¢
* @return
*/
public List<Province>loadProvinces(){
List<Province>list = new ArrayList<Province>();
Cursor cursor = db.query("Province", null, null, null, null, null, null);
if(cursor.moveToFirst()){
do{
Province province = new Province();
province.setId(cursor.getInt(cursor.getColumnIndex("id")));
province.setProvinceName(cursor.getString(cursor.getColumnIndex("province_name")));
province.setProvinceCode(cursor.getString(cursor.getColumnIndex("province_code")));
list.add(province);
}while(cursor.moveToNext());
}
return list;
}
/**
* ½«CityʵÀý´æ´¢µ½Êý¾Ý¿â
* @param city
*/
public void saveCity(City city) {
if(city!=null){
ContentValues values = new ContentValues();
values.put("city_name", city.getCityName());
values.put("city_code", city.getCityCode());
values.put("province_id", city.getProvinceId());
db.insert("City", null, values);
}
}
/**
* ´ÓÊý¾Ý¿â¶ÁȡijʡÏÂËùÓеijÇÊÐÐÅÏ¢
* @param provinceId
* @return
*/
public List<City> loadCities(int provinceId) {
List<City>list = new ArrayList<City>();
Cursor cursor = db.query("City", null, "province_id = ?",
new String[]{String.valueOf(provinceId)}, null,null,null);
if(cursor.moveToFirst()){
do{
City city = new City();
city.setId(cursor.getInt(cursor.getColumnIndex("id")));
city.setCityName(cursor.getString(cursor.getColumnIndex("city_name")));
city.setCityCode(cursor.getString(cursor.getColumnIndex("city_code")));
city.setProvinceId(provinceId);
list.add(city);
}while(cursor.moveToNext());
}
return list;
}
/**
* ½«CountyʵÀý´æ´¢µ½Êý¾Ý¿â
*/
public void saveCounty(County county){
if(county != null){
ContentValues values = new ContentValues();
values.put("county_name", county.getCountyName());
values.put("county_code", county.getCountyCode());
values.put("city_id", county.getCityId());
db.insert("County", null, values);
}
}
/**
* ´ÓÊý¾Ý¿â¶Áȡij³ÇÊÐÏÂËùÓÐÏØµÄÐÅÏ¢
*/
public List<County>loadCounties (int cityId){
List<County>list = new ArrayList<County>();
Cursor cursor = db.query("County", null, "city_id = ?",
new String[]{String.valueOf(cityId)}, null, null, null);
if(cursor.moveToFirst()){
do{
County county = new County();
county.setId(cursor.getInt(cursor.getColumnIndex("id")));
county.setCountyName(cursor.getString(cursor.getColumnIndex("county_name")));
county.setCountyCode(cursor.getString(cursor.getColumnIndex("county_code")));
county.setCityId(cityId);
list.add(county);
}while(cursor.moveToNext());
}
return list;
}
}
| GodisGod/godtemper | src/com/example/godtemper/db/GodTemperDB.java | Java | apache-2.0 | 4,037 |
<?php
return array(
//'配置项'=>'配置值'
/* 调试设定 */
'SHOW_PAGE_TRACE' =>false, // 显示页面Trace信息
// 'SHOW_RUN_TIME'=>true, // 运行时间显示
// 'SHOW_ADV_TIME'=>true, // 显示详细的运行时间
// 'SHOW_DB_TIMES'=>true, // 显示数据库查询和写入次数
// 'SHOW_CACHE_TIMES'=>true, // 显示缓存操作次数
// 'SHOW_USE_MEM'=>true, // 显示内存开销
// 'SHOW_LOAD_FILE' =>true, // 显示加载文件数
// 'SHOW_FUN_TIMES'=>true , // 显示函数调用次数
/* 数据库设置 */
'DB_TYPE' => 'mysql', // 数据库类型
'DB_HOST' => '127.0.0.1', // 服务器地址
'DB_NAME' => 'ts', // 数据库名
'DB_USER' => 'root', // 用户名
'DB_PWD' => '123456', // 密码
'DB_PORT' => '3306', // 端口
'DB_PREFIX' => 'treesys_', // 数据库表前缀
'DB_FIELDTYPE_CHECK' => false, // 是否进行字段类型检查
'DB_FIELDS_CACHE' => true, // 启用字段缓存
'DB_CHARSET' => 'utf8', // 数据库编码默认采用utf8
'DB_DEPLOY_TYPE' => 0, // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'DB_RW_SEPARATE' => false, // 数据库读写是否分离 主从式有效
'DB_MASTER_NUM' => 1, // 读写分离后 主服务器数量
'DB_SQL_BUILD_CACHE' => true, // 数据库查询的SQL创建缓存
'DB_SQL_BUILD_QUEUE' => 'file', // SQL缓存队列的缓存方式 支持 file xcache和apc
'DB_SQL_BUILD_LENGTH' => 20, // SQL缓存的队列长度
'VAR_PAGE' =>'p', //分页参数
);
?>
| fuermolv/treesys | Application/Common/Conf/db.php | PHP | apache-2.0 | 1,794 |
'use strict';
module.exports = function(config) {
config.set({
files: [
'tests/main.js',
{pattern: 'app/js/**/*.js', included: false},
{pattern: 'app/bower_components/**/*.js', included: false},
{pattern: 'tests/specs/**/*.js', included: false},
{pattern: 'tests/fixtures/**/*.js', included: false}
],
basePath: '../',
frameworks: ['jasmine', 'requirejs'],
reporters: ['progress'],
runnerPort: 9000,
singleRun: true,
browsers: ['PhantomJS', 'Chrome'],
logLevel: 'ERROR'
});
};
| spolnik/javascript-workspace | grunt/TodoApp/tests/karma.conf.js | JavaScript | apache-2.0 | 619 |
# Ericameria viscidiflora var. stenophylla (A.Gray) L.C.Anderson VARIETY
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Chrysothamnus/Chrysothamnus viscidiflorus/ Syn. Ericameria viscidiflora stenophylla/README.md | Markdown | apache-2.0 | 219 |
/*
* Copyright 2012 Delving B.V.
*
* 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 models.cms
import com.mongodb.casbah.Imports.{ MongoCollection, MongoDB }
import com.mongodb.casbah.query.Imports._
import org.bson.types.ObjectId
import com.novus.salat.dao.SalatDAO
import models.HubMongoContext._
import com.mongodb.casbah.commons.MongoDBObject
import models.{ OrganizationConfiguration, MultiModel }
import play.api.i18n.Lang
/**
*
* @author Manuel Bernhardt <[email protected]>
*/
case class CMSPage(
_id: ObjectId = new ObjectId(),
key: String, // the key of this page (unique across all version sets of pages)
userName: String, // who created the page
lang: String, // 2-letters ISO code of the page language
title: String, // title of the page in this language
content: String, // actual page content (text)
isSnippet: Boolean = false, // is this a snippet in the welcome page or not
published: Boolean = false // is this page published, i.e. visible?
)
case class MenuEntry(
_id: ObjectId = new ObjectId(),
menuKey: String, // key of the menu this entry belongs to
parentMenuKey: Option[String] = None, // parent menu key. if none is provided this entry is not part of a sub-menu
position: Int, // position of this menu entry inside of the menu
title: Map[String, String], // title of this menu entry, per language
targetPageKey: Option[String] = None, // key of the page this menu entry links to, if any
targetMenuKey: Option[String] = None, // key of the target menu this entry links to, if any
targetUrl: Option[String] = None, // URL this menu entry links to, if any
published: Boolean = false // is this entry published, i.e. visible ?
)
case class ListEntry(page: CMSPage, menuEntry: MenuEntry)
/** Represents a menu, which is not persisted at the time being **/
case class Menu(
key: String,
parentMenuKey: Option[String],
title: Map[String, String])
object CMSPage extends MultiModel[CMSPage, CMSPageDAO] {
def connectionName: String = "CMSPages"
def initIndexes(collection: MongoCollection) {
addIndexes(collection, Seq(MongoDBObject("_id" -> 1, "language" -> 1)))
}
def initDAO(collection: MongoCollection, connection: MongoDB)(implicit configuration: OrganizationConfiguration): CMSPageDAO = new CMSPageDAO(collection)
}
class CMSPageDAO(collection: MongoCollection)(implicit configuration: OrganizationConfiguration) extends SalatDAO[CMSPage, ObjectId](collection) {
def entryList(lang: Lang, menuKey: Option[String]): List[ListEntry] = {
val allEntries = MenuEntry.dao.findAll().toList
val relevantEntries = if (menuKey.isEmpty) allEntries.filterNot(_.menuKey == "news") else allEntries.filter(_.menuKey == menuKey.get)
val entries = relevantEntries.flatMap(
menuEntry =>
find(MongoDBObject(
"lang" -> lang.language,
"key" -> menuEntry.targetPageKey
)).toList.map(
page =>
ListEntry(page, menuEntry)
)
)
entries.groupBy(_.page.key).map(m => m._2.sortBy(_.page._id).reverse.head).toList
}
def findByKey(key: String): List[CMSPage] = find(MongoDBObject("key" -> key)).$orderby(MongoDBObject("_id" -> -1)).toList
def findByKeyAndLanguage(key: String, lang: String): List[CMSPage] = find(queryByKeyAndLanguage(key, lang)).$orderby(MongoDBObject("_id" -> -1)).toList
def create(key: String, lang: String, userName: String, title: String, content: String, published: Boolean): CMSPage = {
val page = CMSPage(key = key, userName = userName, title = title, content = content, isSnippet = false, lang = lang, published = published)
val inserted = insert(page)
page.copy(_id = inserted.get)
}
def delete(key: String, lang: String) {
remove(MongoDBObject("key" -> key, "lang" -> lang))
}
val MAX_VERSIONS = 20
def removeOldVersions(key: String, lang: String) {
val versions = findByKeyAndLanguage(key, lang)
if (versions.length > MAX_VERSIONS) {
val id = versions(MAX_VERSIONS - 1)._id
find(("_id" $lt id) ++ queryByKeyAndLanguage(key, lang)).foreach(remove)
}
}
private def queryByKeyAndLanguage(key: String, lang: String) = MongoDBObject("key" -> key, "lang" -> lang)
}
object MenuEntry extends MultiModel[MenuEntry, MenuEntryDAO] {
def connectionName: String = "CMSMenuEntries"
def initIndexes(collection: MongoCollection) {
addIndexes(collection, Seq(MongoDBObject("menuKey" -> 1)))
addIndexes(collection, Seq(MongoDBObject("menuKey" -> 1, "parentKey" -> 1)))
}
def initDAO(collection: MongoCollection, connection: MongoDB)(implicit configuration: OrganizationConfiguration): MenuEntryDAO = new MenuEntryDAO(collection)
}
class MenuEntryDAO(collection: MongoCollection) extends SalatDAO[MenuEntry, ObjectId](collection) {
def findOneByKey(menuKey: String) = findOne(MongoDBObject("menuKey" -> menuKey))
def findOneByMenuKeyAndTargetMenuKey(menuKey: String, targetMenuKey: String) = findOne(MongoDBObject("menuKey" -> menuKey, "targetMenuKey" -> targetMenuKey))
def findOneByTargetPageKey(targetPageKey: String) = findOne(MongoDBObject("targetPageKey" -> targetPageKey))
def findOneByMenuAndPage(orgId: String, menuKey: String, pageKey: String) = findOne(MongoDBObject("orgId" -> orgId, "menuKey" -> menuKey, "targetPageKey" -> pageKey))
def findEntries(orgId: String, menuKey: String, parentKey: String) = {
find(MongoDBObject("orgId" -> orgId, "menuKey" -> menuKey, "parentKey" -> parentKey)).$orderby(MongoDBObject("position" -> 1))
}
def findEntries(menuKey: String) = find(MongoDBObject("menuKey" -> menuKey)).$orderby(MongoDBObject("position" -> 1))
def findAll() = find(MongoDBObject())
/**
* Adds a page to a menu (root menu). If the menu entry already exists, updates the position and title.
*/
def savePage(menuKey: String, targetPageKey: String, position: Int, title: String, lang: String, published: Boolean) {
findOneByTargetPageKey(targetPageKey) match {
case Some(existing) =>
val updatedEntry = existing.copy(position = position, menuKey = menuKey, title = existing.title + (lang -> title), published = published)
save(updatedEntry)
// update position of siblings by shifting them to the right
update(MongoDBObject("menuKey" -> menuKey, "published" -> published) ++ ("position" $gte (position)) ++ ("targetPageKey" $ne (targetPageKey)), $inc("position" -> 1))
case None =>
val newEntry = MenuEntry(menuKey = menuKey, parentMenuKey = None, position = position, targetPageKey = Some(targetPageKey), title = Map(lang -> title), published = published)
insert(newEntry)
}
}
def removePage(targetPageKey: String, lang: String) {
findOne(MongoDBObject("targetPageKey" -> targetPageKey)) match {
case Some(entry) =>
val updated = entry.copy(title = (entry.title.filterNot(_._1 == lang)))
if (updated.title.isEmpty) {
removeById(updated._id)
} else {
save(updated)
}
case None => // nothing
}
}
} | delving/culture-hub | modules/cms/app/models/cms/CMSPage.scala | Scala | apache-2.0 | 7,589 |
// Copyright 2016 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.
#include "exegesis/x86/cleanup_instruction_set_fix_operands.h"
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/container/node_hash_map.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "exegesis/base/cleanup_instruction_set.h"
#include "exegesis/proto/instructions.pb.h"
#include "exegesis/util/instruction_syntax.h"
#include "exegesis/x86/cleanup_instruction_set_utils.h"
#include "glog/logging.h"
#include "src/google/protobuf/repeated_field.h"
#include "util/gtl/map_util.h"
namespace exegesis {
namespace x86 {
namespace {
using ::google::protobuf::RepeatedPtrField;
// Mapping from memory operands to their sizes as used in the Intel assembly
// syntax.
const std::pair<const char*, const char*> kOperandToPointerSize[] = {
{"m8", "BYTE"}, {"m16", "WORD"}, {"m32", "DWORD"}, {"m64", "QWORD"}};
// List of RSI-indexed source arrays.
const char* kRSIIndexes[] = {"BYTE PTR [RSI]", "WORD PTR [RSI]",
"DWORD PTR [RSI]", "QWORD PTR [RSI]"};
// List of RDI-indexed destination arrays.
const char* kRDIIndexes[] = {"BYTE PTR [RDI]", "WORD PTR [RDI]",
"DWORD PTR [RDI]", "QWORD PTR [RDI]"};
} // namespace
absl::Status FixOperandsOfCmpsAndMovs(InstructionSetProto* instruction_set) {
CHECK(instruction_set != nullptr);
const absl::flat_hash_set<std::string> kMnemonics = {"CMPS", "MOVS"};
const absl::flat_hash_set<std::string> kSourceOperands(
std::begin(kRSIIndexes), std::begin(kRSIIndexes));
const absl::flat_hash_set<std::string> kDestinationOperands(
std::begin(kRDIIndexes), std::begin(kRDIIndexes));
const absl::flat_hash_map<std::string, std::string> operand_to_pointer_size(
std::begin(kOperandToPointerSize), std::end(kOperandToPointerSize));
absl::Status status = absl::OkStatus();
for (InstructionProto& instruction :
*instruction_set->mutable_instructions()) {
InstructionFormat* const vendor_syntax =
GetOrAddUniqueVendorSyntaxOrDie(&instruction);
if (!kMnemonics.contains(vendor_syntax->mnemonic())) {
continue;
}
if (vendor_syntax->operands_size() != 2) {
status = absl::InvalidArgumentError(
"Unexpected number of operands of a CMPS/MOVS instruction.");
LOG(ERROR) << status;
continue;
}
std::string pointer_size;
if (!gtl::FindCopy(operand_to_pointer_size,
vendor_syntax->operands(0).name(), &pointer_size) &&
!kSourceOperands.contains(vendor_syntax->operands(0).name()) &&
!kDestinationOperands.contains(vendor_syntax->operands(0).name())) {
status = absl::InvalidArgumentError(
absl::StrCat("Unexpected operand of a CMPS/MOVS instruction: ",
vendor_syntax->operands(0).name()));
LOG(ERROR) << status;
continue;
}
CHECK_EQ(vendor_syntax->operands_size(), 2);
// The correct syntax for MOVS is MOVSB BYTE PTR [RDI],BYTE PTR [RSI]
// (destination is the right operand, as expected in the Intel syntax),
// while for CMPS LLVM only supports CMPSB BYTE PTR [RSI],BYTE PTR [RDI].
// The following handles this.
constexpr const char* const kIndexings[] = {"[RDI]", "[RSI]"};
const int dest = vendor_syntax->mnemonic() == "MOVS" ? 0 : 1;
const int src = 1 - dest;
vendor_syntax->mutable_operands(0)->set_name(
absl::StrCat(pointer_size, " PTR ", kIndexings[dest]));
vendor_syntax->mutable_operands(0)->set_usage(
dest == 0 ? InstructionOperand::USAGE_WRITE
: InstructionOperand::USAGE_READ);
vendor_syntax->mutable_operands(1)->set_name(
absl::StrCat(pointer_size, " PTR ", kIndexings[src]));
vendor_syntax->mutable_operands(1)->set_usage(
InstructionOperand::USAGE_READ);
}
return status;
}
REGISTER_INSTRUCTION_SET_TRANSFORM(FixOperandsOfCmpsAndMovs, 2000);
absl::Status FixOperandsOfInsAndOuts(InstructionSetProto* instruction_set) {
constexpr char kIns[] = "INS";
constexpr char kOuts[] = "OUTS";
const absl::flat_hash_map<std::string, std::string> operand_to_pointer_size(
std::begin(kOperandToPointerSize), std::end(kOperandToPointerSize));
absl::Status status = absl::OkStatus();
for (InstructionProto& instruction :
*instruction_set->mutable_instructions()) {
InstructionFormat* const vendor_syntax =
GetOrAddUniqueVendorSyntaxOrDie(&instruction);
const bool is_ins = vendor_syntax->mnemonic() == kIns;
const bool is_outs = vendor_syntax->mnemonic() == kOuts;
if (!is_ins && !is_outs) {
continue;
}
if (vendor_syntax->operands_size() != 2) {
status = absl::InvalidArgumentError(
"Unexpected number of operands of an INS/OUTS instruction.");
LOG(ERROR) << status;
continue;
}
std::string pointer_size;
if (!gtl::FindCopy(operand_to_pointer_size,
vendor_syntax->operands(0).name(), &pointer_size) &&
!gtl::FindCopy(operand_to_pointer_size,
vendor_syntax->operands(1).name(), &pointer_size)) {
status = absl::InvalidArgumentError(
absl::StrCat("Unexpected operands of an INS/OUTS instruction: ",
vendor_syntax->operands(0).name(), ", ",
vendor_syntax->operands(1).name()));
LOG(ERROR) << status;
continue;
}
CHECK_EQ(vendor_syntax->operands_size(), 2);
if (is_ins) {
vendor_syntax->mutable_operands(0)->set_name(
absl::StrCat(pointer_size, " PTR [RDI]"));
vendor_syntax->mutable_operands(0)->set_usage(
InstructionOperand::USAGE_WRITE);
vendor_syntax->mutable_operands(1)->set_name("DX");
vendor_syntax->mutable_operands(1)->set_usage(
InstructionOperand::USAGE_READ);
} else {
CHECK(is_outs);
vendor_syntax->mutable_operands(0)->set_name("DX");
vendor_syntax->mutable_operands(0)->set_usage(
InstructionOperand::USAGE_READ);
vendor_syntax->mutable_operands(1)->set_name(
absl::StrCat(pointer_size, " PTR [RSI]"));
vendor_syntax->mutable_operands(1)->set_usage(
InstructionOperand::USAGE_READ);
}
}
return status;
}
REGISTER_INSTRUCTION_SET_TRANSFORM(FixOperandsOfInsAndOuts, 2000);
absl::Status FixOperandsOfLddqu(InstructionSetProto* instruction_set) {
constexpr char kMemOperand[] = "mem";
constexpr char kM128Operand[] = "m128";
constexpr char kLddquEncoding[] = "F2 0F F0 /r";
for (InstructionProto& instruction :
*instruction_set->mutable_instructions()) {
if (instruction.raw_encoding_specification() != kLddquEncoding) continue;
InstructionFormat* const vendor_syntax =
GetOrAddUniqueVendorSyntaxOrDie(&instruction);
for (InstructionOperand& operand : *vendor_syntax->mutable_operands()) {
if (operand.name() == kMemOperand) {
operand.set_name(kM128Operand);
}
}
}
return absl::OkStatus();
}
REGISTER_INSTRUCTION_SET_TRANSFORM(FixOperandsOfLddqu, 2000);
absl::Status FixOperandsOfLodsScasAndStos(
InstructionSetProto* instruction_set) {
// Note that we're matching only the versions with operands. These versions
// use the mnemonics without the size suffix. By matching exactly these names,
// we can easily avoid the operand-less versions.
constexpr char kLods[] = "LODS";
constexpr char kScas[] = "SCAS";
constexpr char kStos[] = "STOS";
const absl::flat_hash_map<std::string, std::string> operand_to_pointer_size(
std::begin(kOperandToPointerSize), std::end(kOperandToPointerSize));
const absl::flat_hash_map<std::string, std::string> kOperandToRegister = {
{"m8", "AL"}, {"m16", "AX"}, {"m32", "EAX"}, {"m64", "RAX"}};
absl::Status status = absl::OkStatus();
for (InstructionProto& instruction :
*instruction_set->mutable_instructions()) {
InstructionFormat* const vendor_syntax =
GetOrAddUniqueVendorSyntaxOrDie(&instruction);
const bool is_lods = vendor_syntax->mnemonic() == kLods;
const bool is_stos = vendor_syntax->mnemonic() == kStos;
const bool is_scas = vendor_syntax->mnemonic() == kScas;
if (!is_lods && !is_stos && !is_scas) {
continue;
}
if (vendor_syntax->operands_size() != 1) {
status = absl::InvalidArgumentError(
"Unexpected number of operands of a LODS/STOS instruction.");
LOG(ERROR) << status;
continue;
}
std::string register_operand;
std::string pointer_size;
if (!gtl::FindCopy(kOperandToRegister, vendor_syntax->operands(0).name(),
®ister_operand) ||
!gtl::FindCopy(operand_to_pointer_size,
vendor_syntax->operands(0).name(), &pointer_size)) {
status = absl::InvalidArgumentError(
absl::StrCat("Unexpected operand of a LODS/STOS instruction: ",
vendor_syntax->operands(0).name()));
LOG(ERROR) << status;
continue;
}
vendor_syntax->clear_operands();
if (is_stos) {
auto* const operand = vendor_syntax->add_operands();
operand->set_name(absl::StrCat(pointer_size, " PTR [RDI]"));
operand->set_encoding(InstructionOperand::IMPLICIT_ENCODING);
operand->set_usage(InstructionOperand::USAGE_READ);
}
auto* const operand = vendor_syntax->add_operands();
operand->set_encoding(InstructionOperand::IMPLICIT_ENCODING);
operand->set_name(register_operand);
operand->set_usage(InstructionOperand::USAGE_READ);
if (is_lods) {
auto* const operand = vendor_syntax->add_operands();
operand->set_encoding(InstructionOperand::IMPLICIT_ENCODING);
operand->set_name(absl::StrCat(pointer_size, " PTR [RSI]"));
operand->set_usage(InstructionOperand::USAGE_READ);
}
if (is_scas) {
auto* const operand = vendor_syntax->add_operands();
operand->set_encoding(InstructionOperand::IMPLICIT_ENCODING);
operand->set_name(absl::StrCat(pointer_size, " PTR [RDI]"));
operand->set_usage(InstructionOperand::USAGE_READ);
}
}
return status;
}
REGISTER_INSTRUCTION_SET_TRANSFORM(FixOperandsOfLodsScasAndStos, 2000);
absl::Status FixOperandsOfSgdtAndSidt(InstructionSetProto* instruction_set) {
CHECK(instruction_set != nullptr);
const absl::flat_hash_set<std::string> kEncodings = {"0F 01 /0", "0F 01 /1"};
constexpr char kMemoryOperandName[] = "m";
constexpr char kUpdatedMemoryOperandName[] = "m16&64";
for (InstructionProto& instruction :
*instruction_set->mutable_instructions()) {
if (kEncodings.contains(instruction.raw_encoding_specification())) {
InstructionFormat* const vendor_syntax =
GetOrAddUniqueVendorSyntaxOrDie(&instruction);
for (InstructionOperand& operand : *vendor_syntax->mutable_operands()) {
if (operand.name() == kMemoryOperandName) {
operand.set_name(kUpdatedMemoryOperandName);
}
}
}
}
return absl::OkStatus();
}
REGISTER_INSTRUCTION_SET_TRANSFORM(FixOperandsOfSgdtAndSidt, 2000);
absl::Status FixOperandsOfVMovq(InstructionSetProto* instruction_set) {
CHECK(instruction_set != nullptr);
constexpr char kVMovQEncoding[] = "VEX.128.F3.0F.WIG 7E /r";
constexpr char kRegisterOrMemoryOperand[] = "xmm2/m64";
::google::protobuf::RepeatedPtrField<InstructionProto>* const instructions =
instruction_set->mutable_instructions();
for (InstructionProto& instruction : *instructions) {
if (instruction.raw_encoding_specification() != kVMovQEncoding) continue;
InstructionFormat* const vendor_syntax =
GetOrAddUniqueVendorSyntaxOrDie(&instruction);
if (vendor_syntax->operands_size() != 2) {
return absl::InvalidArgumentError(
absl::StrCat("Unexpected number of operands of a VMOVQ instruction: ",
instruction.DebugString()));
}
vendor_syntax->mutable_operands(1)->set_name(kRegisterOrMemoryOperand);
}
return absl::OkStatus();
}
REGISTER_INSTRUCTION_SET_TRANSFORM(FixOperandsOfVMovq, 2000);
absl::Status FixRegOperands(InstructionSetProto* instruction_set) {
CHECK(instruction_set != nullptr);
constexpr char kR8Operand[] = "r8";
constexpr char kR16Operand[] = "r16";
constexpr char kR32Operand[] = "r32";
constexpr char kR64Operand[] = "r64";
constexpr char kRegOperand[] = "reg";
// The mnemonics for which we add new entries.
const absl::flat_hash_set<std::string> kExpandToAllSizes = {"LAR"};
// The mnemonics for which we just replace reg with r8/r16/r32.
const absl::flat_hash_set<std::string> kRenameToReg8 = {"VPBROADCASTB"};
const absl::flat_hash_set<std::string> kRenameToReg16 = {"VPBROADCASTW"};
const absl::flat_hash_set<std::string> kRenameToReg32 = {
"EXTRACTPS", "MOVMSKPD", "MOVMSKPS", "PEXTRB", "PEXTRW", "PMOVMSKB",
"VMOVMSKPD", "VMOVMSKPS", "VPEXTRB", "VPEXTRW", "VPMOVMSKB"};
// We can't safely add new entries to 'instructions' while we iterate over it.
// Instead, we collect the instructions in a separate vector and add it to the
// proto at the end.
std::vector<InstructionProto> new_instruction_protos;
::google::protobuf::RepeatedPtrField<InstructionProto>* const instructions =
instruction_set->mutable_instructions();
absl::Status status = absl::OkStatus();
for (InstructionProto& instruction : *instructions) {
InstructionFormat* const vendor_syntax =
GetOrAddUniqueVendorSyntaxOrDie(&instruction);
const std::string& mnemonic = vendor_syntax->mnemonic();
for (auto& operand : *vendor_syntax->mutable_operands()) {
if (operand.name() == kRegOperand) {
if (kExpandToAllSizes.contains(mnemonic)) {
// This is a bit hacky. To avoid complicated matching of registers, we
// just override the existing entry in the instruction set proto, add
// the modified proto to new_instruction_protos except for the last
// modification which we keep in the instruction set proto.
//
// This is safe as long as there is only one reg operand per entry
// (which is true in the current version of the data).
operand.set_name(kR32Operand);
new_instruction_protos.push_back(instruction);
operand.set_name(kR64Operand);
instruction.set_raw_encoding_specification(
"REX.W + " + instruction.raw_encoding_specification());
} else if (kRenameToReg8.contains(mnemonic)) {
operand.set_name(kR8Operand);
} else if (kRenameToReg16.contains(mnemonic)) {
operand.set_name(kR16Operand);
} else if (kRenameToReg32.contains(mnemonic)) {
operand.set_name(kR32Operand);
} else {
status = absl::InvalidArgumentError(
absl::StrCat("Unexpected instruction mnemonic: ", mnemonic));
LOG(ERROR) << status;
continue;
}
}
}
}
std::copy(new_instruction_protos.begin(), new_instruction_protos.end(),
::google::protobuf::RepeatedPtrFieldBackInserter(instructions));
return status;
}
REGISTER_INSTRUCTION_SET_TRANSFORM(FixRegOperands, 2000);
absl::Status RenameOperands(InstructionSetProto* instruction_set) {
CHECK(instruction_set != nullptr);
const absl::flat_hash_map<std::string, std::string> kOperandRenaming = {
// Synonyms (different names used for the same type in different parts of
// the manual).
{"m80dec", "m80bcd"},
{"r8/m8", "r/m8"},
{"r16/m16", "r/m16"},
{"r32/m32", "r/m32"},
{"r64/m64", "r/m64"},
{"ST", "ST(0)"},
// Variants that depend on the mode of the CPU. The 32- and 64-bit modes
// always use the larger of the two values.
{"m14/28byte", "m28byte"},
{"m94/108byte", "m108byte"}};
for (InstructionProto& instruction :
*instruction_set->mutable_instructions()) {
InstructionFormat* const vendor_syntax =
GetOrAddUniqueVendorSyntaxOrDie(&instruction);
for (auto& operand : *vendor_syntax->mutable_operands()) {
const std::string* renaming =
gtl::FindOrNull(kOperandRenaming, operand.name());
if (renaming != nullptr) {
operand.set_name(*renaming);
}
}
}
return absl::OkStatus();
}
REGISTER_INSTRUCTION_SET_TRANSFORM(RenameOperands, 2000);
absl::Status RemoveImplicitST0Operand(InstructionSetProto* instruction_set) {
CHECK(instruction_set != nullptr);
static constexpr char kImplicitST0Operand[] = "ST(0)";
const absl::flat_hash_set<std::string> kUpdatedInstructionEncodings = {
"D8 C0+i", "D8 C8+i", "D8 E0+i", "D8 E8+i", "D8 F0+i", "D8 F8+i",
"DB E8+i", "DB F0+i", "DE C0+i", "DE C8+i", "DE E0+i", "DE E8+i",
"DE F0+i", "DE F8+i", "DF E8+i", "DF F0+i",
};
for (InstructionProto& instruction :
*instruction_set->mutable_instructions()) {
if (!kUpdatedInstructionEncodings.contains(
instruction.raw_encoding_specification())) {
continue;
}
RepeatedPtrField<InstructionOperand>* const operands =
GetOrAddUniqueVendorSyntaxOrDie(&instruction)->mutable_operands();
operands->erase(std::remove_if(operands->begin(), operands->end(),
[](const InstructionOperand& operand) {
return operand.name() ==
kImplicitST0Operand;
}),
operands->end());
}
return absl::OkStatus();
}
REGISTER_INSTRUCTION_SET_TRANSFORM(RemoveImplicitST0Operand, 2000);
absl::Status RemoveImplicitOperands(InstructionSetProto* instruction_set) {
CHECK(instruction_set != nullptr);
const absl::flat_hash_set<absl::string_view> kImplicitXmmOperands = {
"<EAX>", "<XMM0>", "<XMM0-2>", "<XMM0-6>", "<XMM0-7>", "<XMM4-6>"};
for (InstructionProto& instruction :
*instruction_set->mutable_instructions()) {
RepeatedPtrField<InstructionOperand>* const operands =
GetOrAddUniqueVendorSyntaxOrDie(&instruction)->mutable_operands();
operands->erase(
std::remove_if(
operands->begin(), operands->end(),
[&kImplicitXmmOperands](const InstructionOperand& operand) {
return kImplicitXmmOperands.contains(operand.name());
}),
operands->end());
}
return absl::OkStatus();
}
REGISTER_INSTRUCTION_SET_TRANSFORM(RemoveImplicitOperands, 2000);
} // namespace x86
} // namespace exegesis
| google/EXEgesis | exegesis/x86/cleanup_instruction_set_fix_operands.cc | C++ | apache-2.0 | 19,133 |
require 'spec_helper'
describe Rtime::Executor do
let :executor do
Rtime::Executor.new
end
describe 'execute' do
it 'needs arguments to execute' do
expect { executor.execute }.to raise_error ArgumentError
end
it 'times the executed process' do
expect(executor.timer).to receive(:time).and_call_original
executor.execute 'true'
end
it 'returns a filled Rtime::Result' do
result = executor.execute('true', name: 'the name')
expect(result).to be_a Rtime::Result
expect(result.start).to be_a Time
expect(result.pid).to respond_to :to_int
expect(result.duration).to be_a Float
expect(result.exitstatus).to eq 0
expect(result.name).to eq 'the name'
end
end
describe 'measure' do
it 'needs a name argument to execute' do
expect { executor.measure do end }.to raise_error ArgumentError
end
it 'needs a block to call' do
expect { executor.measure('foo') }.to raise_error ArgumentError
end
it 'measures times of a block' do
executed = false
result = executor.measure('the name') do
executed = true
end
expect(executed).to eq true
expect(result).to be_a Rtime::Result
expect(result.start).to be_a Time
expect(result.pid).to eq $$
expect(result.duration).to be_a Float
expect(result.exitstatus).to eq 0
expect(result.name).to eq 'the name'
end
end
end
| flori/rtime | spec/executor_spec.rb | Ruby | apache-2.0 | 1,451 |
package org.axway.grapes.server.webapp.resources;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.GenericType;
import com.sun.jersey.api.client.WebResource;
import com.yammer.dropwizard.auth.basic.BasicAuthProvider;
import com.yammer.dropwizard.testing.ResourceTest;
import org.axway.grapes.commons.api.ServerAPI;
import org.axway.grapes.server.GrapesTestUtils;
import org.axway.grapes.server.config.GrapesServerConfig;
import org.axway.grapes.server.core.options.FiltersHolder;
import org.axway.grapes.server.db.RepositoryHandler;
import org.axway.grapes.server.db.datamodel.DbCredential;
import org.axway.grapes.server.db.datamodel.DbSearch;
import org.axway.grapes.server.webapp.auth.GrapesAuthenticator;
import org.eclipse.jetty.http.HttpStatus;
import org.junit.Test;
import javax.ws.rs.core.MediaType;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class WebSearchResourceTest extends ResourceTest {
private RepositoryHandler repositoryHandler;
@Override
protected void setUpResources() throws Exception {
repositoryHandler = GrapesTestUtils.getRepoHandlerMock();
final GrapesServerConfig config = mock(GrapesServerConfig.class);
final WebSearchResource resource = new WebSearchResource(repositoryHandler, config);
addProvider(new BasicAuthProvider<DbCredential>(new GrapesAuthenticator(repositoryHandler), "test auth"));
addResource(resource);
}
@Test
public void getSearchResult() throws Exception {
List<String> moduleIds = new ArrayList<>();
moduleIds.add("testSearch_id_1");
moduleIds.add("testSearch_id_2");
List<String> artifactIds = new ArrayList<>();
artifactIds.add("testSearch_artifact_id_1");
artifactIds.add("testSearch_artifact_id_2");
DbSearch search = new DbSearch();
search.setModules(moduleIds);
search.setArtifacts(artifactIds);
when(repositoryHandler.getSearchResult(eq("testSearch"), (FiltersHolder) anyObject())).thenReturn(search);
final WebResource resource = client().resource("/" + ServerAPI.SEARCH_RESOURCE + "/testSearch");
final ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
assertNotNull(response);
assertEquals(HttpStatus.OK_200, response.getStatus());
final String results = response.getEntity(new GenericType<String>() {
});
assertEquals("{\"modules\":[\"testSearch_id_1\",\"testSearch_id_2\"],\"artifacts\":[\"testSearch_artifact_id_1\",\"testSearch_artifact_id_2\"]}", results);
}
@Test
public void getNullSearchResult() {
DbSearch search = new DbSearch();
when(repositoryHandler.getSearchResult(eq("testSearch"), (FiltersHolder) anyObject())).thenReturn(search);
final WebResource resource = client().resource("/" + ServerAPI.SEARCH_RESOURCE + "/testSearch");
final ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
assertNotNull(response);
assertEquals(HttpStatus.OK_200, response.getStatus());
final String results = response.getEntity(new GenericType<String>() {
});
assertEquals("{\"modules\":null,\"artifacts\":null}", results);
}
@Test
public void getModulesSearchResult() {
DbSearch search = new DbSearch();
List<String> moduleIds = new ArrayList<>();
moduleIds.add("testSearch_id_1");
moduleIds.add("testSearch_id_2");
search.setModules(moduleIds);
when(repositoryHandler.getSearchResult(eq("testSearch"), (FiltersHolder) anyObject())).thenReturn(search);
final WebResource resource = client().resource("/" + ServerAPI.SEARCH_RESOURCE + "/testSearch");
final ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
assertNotNull(response);
assertEquals(HttpStatus.OK_200, response.getStatus());
final String results = response.getEntity(new GenericType<String>() {
});
assertEquals("{\"modules\":[\"testSearch_id_1\",\"testSearch_id_2\"],\"artifacts\":null}", results);
}
@Test
public void getArtifactsSearchResult() {
DbSearch search = new DbSearch();
List<String> artifactIds = new ArrayList<>();
artifactIds.add("testSearch_artifact_id_1");
artifactIds.add("testSearch_artifact_id_2");
search.setArtifacts(artifactIds);
when(repositoryHandler.getSearchResult(eq("testSearch"), (FiltersHolder) anyObject())).thenReturn(search);
final WebResource resource = client().resource("/" + ServerAPI.SEARCH_RESOURCE + "/testSearch");
final ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
assertNotNull(response);
assertEquals(HttpStatus.OK_200, response.getStatus());
final String results = response.getEntity(new GenericType<String>() {
});
assertEquals("{\"modules\":null,\"artifacts\":[\"testSearch_artifact_id_1\",\"testSearch_artifact_id_2\"]}", results);
}
} | Axway/Grapes | server/src/test/java/org/axway/grapes/server/webapp/resources/WebSearchResourceTest.java | Java | apache-2.0 | 5,448 |
// Copyright 2012 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.
//
// Author: [email protected] (Tomasz Kaftal)
//
// This file contains the benchmark manager class which is responsible for
// carrying out the benchmarking process from cursor reception to DOT graph
// drawing.
#ifndef SUPERSONIC_BENCHMARK_MANAGER_BENCHMARK_MANAGER_H_
#define SUPERSONIC_BENCHMARK_MANAGER_BENCHMARK_MANAGER_H_
#include <memory>
#include "supersonic/benchmark/infrastructure/benchmark_listener.h"
#include "supersonic/benchmark/infrastructure/cursor_statistics.h"
#include "supersonic/benchmark/infrastructure/node.h"
#include "supersonic/benchmark/infrastructure/tree_builder.h"
#include "supersonic/benchmark/dot/dot_drawer.h"
#include "supersonic/utils/macros.h"
namespace supersonic {
class Cursor;
// Enum, whose values describe the possible graph generation destinations.
enum Destination {
DOT_FILE,
DOT_STRING
};
// Structure containing options for graph visualisation, currently
// the destination enum and possibly a file name.
struct GraphVisualisationOptions {
explicit GraphVisualisationOptions(Destination destination)
: destination(destination) {}
GraphVisualisationOptions(Destination destination, const string& file_name)
: destination(destination),
file_name(file_name) {}
Destination destination;
string file_name;
};
// BenchmarkDataWrapper contains the instances of objects necessary to run
// a benchmark on a cursor.
class BenchmarkDataWrapper {
public:
// Takes ownership of cursor, tree builder and node.
BenchmarkDataWrapper(
unique_ptr<Cursor> cursor,
unique_ptr<BenchmarkTreeBuilder> builder,
unique_ptr<BenchmarkTreeNode> node)
: cursor_(std::move(cursor)),
tree_builder_(std::move(builder)),
node_(std::move(node)) {}
// Caller takes ownership of the result.
unique_ptr<Cursor> move_cursor() { return std::move(cursor_); }
// No ownership transfer.
BenchmarkTreeNode* node() { return node_.get(); }
private:
unique_ptr<Cursor> cursor_;
unique_ptr<BenchmarkTreeBuilder> tree_builder_;
unique_ptr<BenchmarkTreeNode> node_;
};
// Transforms the cursor tree, whose root is passed as the argument, by
// attaching spy cursors in between benchmarked nodes. The result is
// a BenchmarkDataWrapper object, which stores the transformed cursor. In
// this use case the caller then takes over the cursor and proceeds
// to carrying out computations on it. The data wrapper must not be destroyed
// before the benchmarking has been completed, that is before the graph has
// been created using the CreateGraph() function, and before the lifetime of
// the cursor ends.
//
// Caller takes ownership of the result data wrapper. The transformed cursor
// resident in the wrapper will take ownership of the argument cursor. The
// caller will have to drain the transformed cursor before proceeding to
// graph creation.
unique_ptr<BenchmarkDataWrapper> SetUpBenchmarkForCursor(unique_ptr<Cursor> cursor);
// CreateGraph() is used to finalise the benchmarking process by drawing
// a performance graph. It accepts the name of the benchmark, a pointer to
// the benchmark node accessible from BenchmarkDataWrapper and created when
// a call to SetUpBenchmarkForCursor() is made, and an options structure.
// Depending on the options the type of the performed visualisation will vary,
// while options' destination field will determine the semantics of the result
// string:
//
// DOT_FILE - an empty string,
// DOT_STRING - the generated DOT code,
// GRAPHVIZ_RPC - url to the generated DOT graph.
//
// The caller is responsible for draining the benchmarked cursor manually before
// calling CreateGraph().
//
// Does not take ownership of the node.
string CreateGraph(
const string& benchmark_name,
BenchmarkTreeNode* node,
GraphVisualisationOptions options);
// PerformBenchmark() is an all-in-one function which runs a benchmark on
// the given cursor. The benchmark will be labelled with benchmark_name and
// visualised using options. The function will drain the cursor by calling
// its Next() function with the specified block size until the data have been
// depleted. The returned value will depend on the options argument analogously
// to CreateGraph().
//
// Takes ownership of the cursor and destroys it when the benchmark graph
// is ready.
string PerformBenchmark(
const string& benchmark_name,
unique_ptr<Cursor> cursor,
rowcount_t max_block_size,
GraphVisualisationOptions options);
} // namespace supersonic
#endif // SUPERSONIC_BENCHMARK_MANAGER_BENCHMARK_MANAGER_H_
| adfin/supersonic | supersonic/benchmark/manager/benchmark_manager.h | C | apache-2.0 | 5,175 |
@echo off
echo ¿ªÊ¼Ìá½»´úÂëµ½±¾µØ²Ö¿â
echo µ±Ç°Ä¿Â¼ÊÇ£º%cd%
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mvn clean package install
echo;
echo Åú´¦ÀíÖ´ÐÐÍê±Ï£¡
echo;
pause; | danlley/myteay-common-tools | install.bat | Batchfile | apache-2.0 | 196 |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/cri-o/cri-o/internal/lib/sandbox (interfaces: NamespaceIface)
// Package sandboxmock is a generated GoMock package.
package sandboxmock
import (
sandbox "github.com/cri-o/cri-o/internal/lib/sandbox"
gomock "github.com/golang/mock/gomock"
reflect "reflect"
)
// MockNamespaceIface is a mock of NamespaceIface interface
type MockNamespaceIface struct {
ctrl *gomock.Controller
recorder *MockNamespaceIfaceMockRecorder
}
// MockNamespaceIfaceMockRecorder is the mock recorder for MockNamespaceIface
type MockNamespaceIfaceMockRecorder struct {
mock *MockNamespaceIface
}
// NewMockNamespaceIface creates a new mock instance
func NewMockNamespaceIface(ctrl *gomock.Controller) *MockNamespaceIface {
mock := &MockNamespaceIface{ctrl: ctrl}
mock.recorder = &MockNamespaceIfaceMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockNamespaceIface) EXPECT() *MockNamespaceIfaceMockRecorder {
return m.recorder
}
// Close mocks base method
func (m *MockNamespaceIface) Close() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error)
return ret0
}
// Close indicates an expected call of Close
func (mr *MockNamespaceIfaceMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockNamespaceIface)(nil).Close))
}
// Get mocks base method
func (m *MockNamespaceIface) Get() *sandbox.Namespace {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Get")
ret0, _ := ret[0].(*sandbox.Namespace)
return ret0
}
// Get indicates an expected call of Get
func (mr *MockNamespaceIfaceMockRecorder) Get() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockNamespaceIface)(nil).Get))
}
// Initialize mocks base method
func (m *MockNamespaceIface) Initialize() sandbox.NamespaceIface {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Initialize")
ret0, _ := ret[0].(sandbox.NamespaceIface)
return ret0
}
// Initialize indicates an expected call of Initialize
func (mr *MockNamespaceIfaceMockRecorder) Initialize() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockNamespaceIface)(nil).Initialize))
}
// Initialized mocks base method
func (m *MockNamespaceIface) Initialized() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Initialized")
ret0, _ := ret[0].(bool)
return ret0
}
// Initialized indicates an expected call of Initialized
func (mr *MockNamespaceIfaceMockRecorder) Initialized() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialized", reflect.TypeOf((*MockNamespaceIface)(nil).Initialized))
}
// Path mocks base method
func (m *MockNamespaceIface) Path() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Path")
ret0, _ := ret[0].(string)
return ret0
}
// Path indicates an expected call of Path
func (mr *MockNamespaceIfaceMockRecorder) Path() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Path", reflect.TypeOf((*MockNamespaceIface)(nil).Path))
}
// Remove mocks base method
func (m *MockNamespaceIface) Remove() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Remove")
ret0, _ := ret[0].(error)
return ret0
}
// Remove indicates an expected call of Remove
func (mr *MockNamespaceIfaceMockRecorder) Remove() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Remove", reflect.TypeOf((*MockNamespaceIface)(nil).Remove))
}
// Type mocks base method
func (m *MockNamespaceIface) Type() sandbox.NSType {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Type")
ret0, _ := ret[0].(sandbox.NSType)
return ret0
}
// Type indicates an expected call of Type
func (mr *MockNamespaceIfaceMockRecorder) Type() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Type", reflect.TypeOf((*MockNamespaceIface)(nil).Type))
}
| mikebrow/cri-o | test/mocks/sandbox/sandbox.go | GO | apache-2.0 | 4,124 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.