blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2
values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539
values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13
values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62
values | src_encoding stringclasses 26
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 128 12.8k | extension stringclasses 11
values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f25155f8c60a99d68ce35fd0bad491e0a26d7f5f | cd3ccc969d6e31dce1a0cdc21de71899ab670a46 | /agp-7.1.0-alpha01/tools/base/repository/src/main/java/com/android/repository/api/SimpleRepositorySource.java | 738a934f84a07e7f79d6b912bbd20cb37de9c829 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | jomof/CppBuildCacheWorkInProgress | 75e76e1bd1d8451e3ee31631e74f22e5bb15dd3c | 9e3475f6d94cb3239f27ed8f8ee81b0abde4ef51 | refs/heads/main | 2023-05-28T19:03:16.798422 | 2021-06-10T20:59:25 | 2021-06-10T20:59:25 | 374,736,765 | 0 | 1 | Apache-2.0 | 2021-06-07T21:06:53 | 2021-06-07T16:44:55 | Java | UTF-8 | Java | false | false | 3,691 | java | /*
* Copyright (C) 2015 The Android Open Source 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.
*/
package com.android.repository.api;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
import java.util.Collection;
/**
* A simple {@link RepositorySource}.
*/
public class SimpleRepositorySource implements RepositorySource {
/**
* The URL for this source.
*/
private final String mUrl;
/**
* The user-friendly name for this source.
*/
private final String mDisplayName;
/**
* Whether this source is enabled.
* TODO: persist this value.
*/
private boolean mEnabled;
/**
* The {@link SchemaModule}s allowed to be used when parsing the xml downloaded from
* this source.
*/
private final Collection<SchemaModule<?>> mAllowedModules;
/**
* Any error that occurred when fetching this source.
*/
private String mError;
/**
* The {@link RepositorySourceProvider} that created this source.
*/
private final RepositorySourceProvider mProvider;
/**
* Constructor
*
* @param url The URL this source will fetch from.
* @param displayName The user-friendly name for this source
* @param enabled Whether this source is enabled.
* @param allowedModules The {@link SchemaModule}s allowed to be used when parsing the xml
* downloaded from this source.
* @param provider The {@link RepositorySourceProvider} that created this source.
*/
public SimpleRepositorySource(@NonNull String url,
@Nullable String displayName,
boolean enabled,
@NonNull Collection<SchemaModule<?>> allowedModules,
@NonNull RepositorySourceProvider provider) {
mProvider = provider;
mUrl = url.trim();
mDisplayName = displayName;
mEnabled = enabled;
mAllowedModules = allowedModules;
}
@Override
@NonNull
public Collection<SchemaModule<?>> getPermittedModules() {
return mAllowedModules;
}
@Override
public boolean isEnabled() {
return mEnabled;
}
@Override
public void setEnabled(boolean enabled) {
if (getProvider().isModifiable()) {
mEnabled = enabled;
}
}
@Override
@Nullable
public String getDisplayName() {
return mDisplayName;
}
@Override
@NonNull
public String getUrl() {
return mUrl;
}
/**
* Returns a debug string representation of this object. Not for user display.
*/
@Override
@NonNull
public String toString() {
return String.format("<RepositorySource URL='%1$s' Name='%2$s'>", mUrl, mDisplayName);
}
@Override
public void setFetchError(@Nullable String error) {
mError = error;
}
@Override
@Nullable
public String getFetchError() {
return mError;
}
@Override
@NonNull
public RepositorySourceProvider getProvider() {
return mProvider;
}
}
| [
"jomof@google.com"
] | jomof@google.com |
20ec8c3cd89decd5ea28c651a958e2d889477ed2 | 288928a84a1d9a661744b0e489560df746271af7 | /app/src/main/java/com/nilhcem/mobilization/ui/settings/SettingsMvp.java | 3f1c15d764cb6a086c14ee23321b46682bf958b5 | [
"Apache-2.0"
] | permissive | benju69/mobilization-2016 | 9373dcb0eaef8b7c621ee2b948de102e249bfd1b | adb0203fb345844fde8040e23f16bfd5587e839e | refs/heads/master | 2021-01-22T04:34:04.970064 | 2016-10-24T20:40:29 | 2016-10-24T20:40:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package com.nilhcem.mobilization.ui.settings;
public interface SettingsMvp {
interface View {
void setNotifySessionsCheckbox(boolean checked);
void setAppVersion(CharSequence version);
}
interface Presenter {
void onCreate();
boolean onNotifySessionsChange(boolean checked);
}
}
| [
"nilhcem@gmail.com"
] | nilhcem@gmail.com |
5b40ff9138128c63b658c31a6eb9d29680964be1 | 8b9906f0ffe956ef5d94ec0bcea34c1150a9e503 | /drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/test/java/org/drools/workbench/screens/scenariosimulation/client/commands/actualcommands/AbstractScenarioSimulationCommandTest.java | 650a3480ab96f5c269670c9a35d32102fbd868cc | [
"Apache-2.0"
] | permissive | kbongjin/drools-wb | e8ece84964e519ef1ed133e979f5b4143b8026ed | 431e8408d676e193828001845296a5f46cbe3917 | refs/heads/master | 2020-04-09T18:17:00.086161 | 2018-12-04T15:56:10 | 2018-12-04T15:56:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,017 | java | /*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
* 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.drools.workbench.screens.scenariosimulation.client.commands.actualcommands;
import java.util.List;
import com.google.gwt.event.shared.EventBus;
import org.drools.workbench.screens.scenariosimulation.client.AbstractScenarioSimulationTest;
import org.drools.workbench.screens.scenariosimulation.client.editor.ScenarioSimulationEditorPresenter;
import org.drools.workbench.screens.scenariosimulation.client.metadata.ScenarioHeaderMetaData;
import org.drools.workbench.screens.scenariosimulation.client.rightpanel.RightPanelPresenter;
import org.drools.workbench.screens.scenariosimulation.model.FactMappingType;
import org.junit.Before;
import org.mockito.Mock;
import org.uberfire.ext.wires.core.grids.client.model.GridColumn;
import static org.mockito.Mockito.when;
public abstract class AbstractScenarioSimulationCommandTest extends AbstractScenarioSimulationTest {
@Mock
protected ScenarioSimulationEditorPresenter scenarioSimulationEditorPresenterMock;
@Mock
protected RightPanelPresenter rightPanelPresenterMock;
@Mock
protected EventBus eventBusMock;
@Mock
protected List<GridColumn.HeaderMetaData> headerMetaDatasMock;
@Mock
protected ScenarioHeaderMetaData informationHeaderMetaDataMock;
@Mock
protected ScenarioHeaderMetaData propertyHeaderMetaDataMock;
protected final String COLUMN_ID = "COLUMN ID";
protected final String COLUMN_GROUP = FactMappingType.EXPECT.name();
protected final String FULL_PACKAGE = "test.scesim";
protected final String VALUE = "VALUE";
protected final String FULL_CLASS_NAME = FULL_PACKAGE + ".testclass";
protected final String VALUE_CLASS_NAME = String.class.getName();
protected final FactMappingType factMappingType = FactMappingType.valueOf(COLUMN_GROUP);
@Before
public void setup() {
super.setup();
when(informationHeaderMetaDataMock.getTitle()).thenReturn(VALUE);
when(informationHeaderMetaDataMock.getColumnGroup()).thenReturn(COLUMN_GROUP);
when(headerMetaDatasMock.get(1)).thenReturn(informationHeaderMetaDataMock);
when(gridColumnMock.getHeaderMetaData()).thenReturn(headerMetaDatasMock);
when(gridColumnMock.getInformationHeaderMetaData()).thenReturn(informationHeaderMetaDataMock);
when(gridColumnMock.getPropertyHeaderMetaData()).thenReturn(propertyHeaderMetaDataMock);
}
} | [
"manstis@users.noreply.github.com"
] | manstis@users.noreply.github.com |
4de9fcd46b8343d98ab7d3f39c8175adefb413c5 | c95b26c2f7dd77f5e30e2d1cd1a45bc1d936c615 | /azureus-core/src/main/java/org/gudy/azureus2/pluginsimpl/local/sharing/ShareResourceDirImpl.java | 735a2f45278985ba8322bb29accdf93de2534aab | [] | no_license | ostigter/testproject3 | b918764f5c7d4c10d3846411bd9270ca5ba2f4f2 | 2d2336ef19631148c83636c3e373f874b000a2bf | refs/heads/master | 2023-07-27T08:35:59.212278 | 2023-02-22T09:10:45 | 2023-02-22T09:10:45 | 41,742,046 | 2 | 1 | null | 2023-07-07T22:07:12 | 2015-09-01T14:02:08 | Java | UTF-8 | Java | false | false | 2,144 | java | /*
* File : ShareResourceDirImpl.java
* Created : 02-Jan-2004
* By : parg
*
* Azureus - a Java Bittorrent client
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details ( see the LICENSE file ).
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.gudy.azureus2.pluginsimpl.local.sharing;
/**
* @author parg
*
*/
import java.io.File;
import java.util.Map;
import org.gudy.azureus2.plugins.sharing.ShareException;
import org.gudy.azureus2.plugins.sharing.ShareResourceDir;
public class ShareResourceDirImpl extends ShareResourceFileOrDirImpl implements ShareResourceDir {
protected static ShareResourceDirImpl getResource(ShareManagerImpl _manager, File _file)
throws ShareException {
ShareResourceImpl res = ShareResourceFileOrDirImpl.getResourceSupport(_manager, _file);
if (res instanceof ShareResourceDirImpl) {
return ((ShareResourceDirImpl) res);
}
return (null);
}
protected ShareResourceDirImpl(ShareManagerImpl _manager, ShareResourceDirContentsImpl _parent, File _file, boolean _personal)
throws ShareException {
super(_manager, _parent, ST_DIR, _file, _personal);
}
protected ShareResourceDirImpl(ShareManagerImpl _manager, File _file, Map _map)
throws ShareException {
super(_manager, ST_DIR, _file, _map);
}
protected byte[] getFingerPrint() throws ShareException {
return (getFingerPrint(getFile()));
}
public File getDir() {
return (getFile());
}
} | [
"oscar.stigter@e0aef87a-ea4e-0410-81cd-4b1fdc67522b"
] | oscar.stigter@e0aef87a-ea4e-0410-81cd-4b1fdc67522b |
086c36957955d93ac9f56b90537f842fb6eee631 | 7569f9a68ea0ad651b39086ee549119de6d8af36 | /cocoon-2.1.9/src/blocks/taglib/java/org/apache/cocoon/taglib/TagSupport.java | 356e9265102e85639b42e45cfcfde7890b9ec658 | [
"Apache-2.0"
] | permissive | tpso-src/cocoon | 844357890f8565c4e7852d2459668ab875c3be39 | f590cca695fd9930fbb98d86ae5f40afe399c6c2 | refs/heads/master | 2021-01-10T02:45:37.533684 | 2015-07-29T18:47:11 | 2015-07-29T18:47:11 | 44,549,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,559 | java | /*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cocoon.taglib;
import java.util.Map;
import java.io.IOException;
import org.apache.avalon.excalibur.pool.Recyclable;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.environment.Context;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.SourceResolver;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
/**
* Abstract implementation for all Tags
*
* @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
* @version CVS $Id: TagSupport.java 158423 2005-03-21 09:15:22Z cziegeler $
*/
public abstract class TagSupport extends AbstractLogEnabled implements Tag, Recyclable {
protected Tag parent;
protected SourceResolver resolver;
protected Map objectModel;
protected Parameters parameters;
private Request request;
/**
* Find the instance of a given class type that is closest to a given
* instance.
* This method uses the getParent method from the Tag
* interface.
* This method is used for coordination among cooperating tags.
*
* @param from The instance from where to start looking.
* @param klass The subclass of Tag or interface to be matched
* @return the nearest ancestor that implements the interface
* or is an instance of the class specified
*/
public static final Tag findAncestorWithClass(Tag from, Class klass) {
boolean isInterface = false;
if (from == null || klass == null || (!Tag.class.isAssignableFrom(klass) && !(isInterface = klass.isInterface()))) {
return null;
}
for (;;) {
Tag tag = from.getParent();
if (tag == null) {
return null;
}
if ((isInterface && klass.isInstance(tag)) || klass.isAssignableFrom(tag.getClass())) {
return tag;
}
from = tag;
}
}
/**
* Process the end tag for this instance.
*
* @return EVAL_PAGE.
* @throws SAXException
*/
public int doEndTag(String namespaceURI, String localName, String qName)
throws SAXException {
return EVAL_PAGE;
}
/**
* Process the start tag for this instance.
* <p>
* The doStartTag method assumes that pageContext and
* parent have been set. It also assumes that any properties exposed as
* attributes have been set too. When this method is invoked, the body
* has not yet been evaluated.
*
* @return EVAL_BODY or SKIP_BODY.
*/
public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
throws SAXException {
return EVAL_BODY;
}
/**
* Searches for the named attribute in request, session (if valid),
* and application scope(s) in order and returns the value associated or
* null.
*
* @return the value associated or null
*/
public final Object findAttribute(String name) {
if (request == null)
request = ObjectModelHelper.getRequest(objectModel);
Object o = request.getAttribute(name);
if (o != null)
return o;
Session session = request.getSession(false);
if (session != null) {
o = session.getAttribute(name);
if (o != null)
return o;
}
Context context = ObjectModelHelper.getContext(objectModel);
return context.getAttribute(name);
}
/**
* Get the parent (closest enclosing tag handler) for this tag handler.
*
* @return the current parent, or null if none.
*/
public final Tag getParent() {
return parent;
}
public void recycle() {
getLogger().debug("recycle");
this.parent = null;
this.resolver = null;
this.objectModel = null;
this.parameters = null;
this.request = null;
}
/**
* Set the parent (closest enclosing tag handler) of this tag handler.
* Invoked by the TagTransformer prior to doStartTag().
* <p>
* This value is *not* reset by doEndTag() and must be explicitly reset
* by a Tag implementation.
*
* @param parent the parent tag, or null.
*/
public final void setParent(Tag parent) {
this.parent = parent;
}
/**
* Set the <code>SourceResolver</code>, objectModel <code>Map</code>
* and sitemap <code>Parameters</code> used to process the request.
*/
public void setup(SourceResolver resolver, Map objectModel, Parameters parameters)
throws SAXException, IOException {
this.resolver = resolver;
this.objectModel = objectModel;
this.parameters = parameters;
}
}
| [
"ms@tpso.com"
] | ms@tpso.com |
60eaca3e528ac3cb9ad7039f6b2e0b39311def0a | fb95e027d518bed1af7b5cac84048e8801df2dd3 | /sm-core-model/src/main/java/com/salesmanager/core/model/catalog/product/attribute/ProductAttribute.java | eee7024dfb10a96b511fcb2208b341d7ecf74840 | [
"Apache-2.0"
] | permissive | attesch/shopizer | 8f85d3a43037524dd36531498e1cdcb85aabfc00 | ad829ec8f5113e8105c38038699d626676a64837 | refs/heads/master | 2023-04-29T00:57:23.341608 | 2022-06-22T01:40:42 | 2022-06-22T01:40:42 | 274,239,070 | 0 | 0 | Apache-2.0 | 2023-04-14T18:09:22 | 2020-06-22T20:48:31 | Java | UTF-8 | Java | false | false | 5,964 | java | package com.salesmanager.core.model.catalog.product.attribute;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.salesmanager.core.model.catalog.product.Product;
import com.salesmanager.core.model.generic.SalesManagerEntity;
@Entity
@Table(name="PRODUCT_ATTRIBUTE",
uniqueConstraints={
@UniqueConstraint(columnNames={
"OPTION_ID",
"OPTION_VALUE_ID",
"PRODUCT_ID"
})
}
)
/**
* Attribute Size - Small and product
* @author carlsamson
*
*/
public class ProductAttribute extends SalesManagerEntity<Long, ProductAttribute> {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "PRODUCT_ATTRIBUTE_ID", unique=true, nullable=false)
@TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "PRODUCT_ATTR_SEQ_NEXT_VAL")
@GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN")
private Long id;
@Column(name="PRODUCT_ATRIBUTE_PRICE")
private BigDecimal productAttributePrice;
@Column(name="PRODUCT_ATTRIBUTE_SORT_ORD")
private Integer productOptionSortOrder;
@Column(name="PRODUCT_ATTRIBUTE_FREE")
private boolean productAttributeIsFree;
@Column(name="PRODUCT_ATTRIBUTE_WEIGHT")
private BigDecimal productAttributeWeight;
@Column(name="PRODUCT_ATTRIBUTE_DEFAULT")
private boolean attributeDefault=false;
@Column(name="PRODUCT_ATTRIBUTE_REQUIRED")
private boolean attributeRequired=false;
/**
* a read only attribute is considered as a core attribute addition
*/
@Column(name="PRODUCT_ATTRIBUTE_FOR_DISP")
private boolean attributeDisplayOnly=false;
@Column(name="PRODUCT_ATTRIBUTE_DISCOUNTED")
private boolean attributeDiscounted=false;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name="OPTION_ID", nullable=false)
private ProductOption productOption;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name="OPTION_VALUE_ID", nullable=false)
private ProductOptionValue productOptionValue;
/**
* This transient object property
* is a utility used only to submit from a free text
*/
@Transient
private String attributePrice = "0";
/**
* This transient object property
* is a utility used only to submit from a free text
*/
@Transient
private String attributeSortOrder = "0";
/**
* This transient object property
* is a utility used only to submit from a free text
*/
@Transient
private String attributeAdditionalWeight = "0";
public String getAttributePrice() {
return attributePrice;
}
public void setAttributePrice(String attributePrice) {
this.attributePrice = attributePrice;
}
@JsonIgnore
@ManyToOne(targetEntity = Product.class)
@JoinColumn(name = "PRODUCT_ID", nullable = false)
private Product product;
public ProductAttribute() {
}
@Override
public Long getId() {
return id;
}
@Override
public void setId(Long id) {
this.id = id;
}
public Integer getProductOptionSortOrder() {
return productOptionSortOrder;
}
public void setProductOptionSortOrder(Integer productOptionSortOrder) {
this.productOptionSortOrder = productOptionSortOrder;
}
public boolean getProductAttributeIsFree() {
return productAttributeIsFree;
}
public void setProductAttributeIsFree(boolean productAttributeIsFree) {
this.productAttributeIsFree = productAttributeIsFree;
}
public BigDecimal getProductAttributeWeight() {
return productAttributeWeight;
}
public void setProductAttributeWeight(BigDecimal productAttributeWeight) {
this.productAttributeWeight = productAttributeWeight;
}
public boolean getAttributeDefault() {
return attributeDefault;
}
public void setAttributeDefault(boolean attributeDefault) {
this.attributeDefault = attributeDefault;
}
public boolean getAttributeRequired() {
return attributeRequired;
}
public void setAttributeRequired(boolean attributeRequired) {
this.attributeRequired = attributeRequired;
}
public boolean getAttributeDisplayOnly() {
return attributeDisplayOnly;
}
public void setAttributeDisplayOnly(boolean attributeDisplayOnly) {
this.attributeDisplayOnly = attributeDisplayOnly;
}
public boolean getAttributeDiscounted() {
return attributeDiscounted;
}
public void setAttributeDiscounted(boolean attributeDiscounted) {
this.attributeDiscounted = attributeDiscounted;
}
public ProductOption getProductOption() {
return productOption;
}
public void setProductOption(ProductOption productOption) {
this.productOption = productOption;
}
public ProductOptionValue getProductOptionValue() {
return productOptionValue;
}
public void setProductOptionValue(ProductOptionValue productOptionValue) {
this.productOptionValue = productOptionValue;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public String getAttributeSortOrder() {
return attributeSortOrder;
}
public void setAttributeSortOrder(String attributeSortOrder) {
this.attributeSortOrder = attributeSortOrder;
}
public String getAttributeAdditionalWeight() {
return attributeAdditionalWeight;
}
public void setAttributeAdditionalWeight(String attributeAdditionalWeight) {
this.attributeAdditionalWeight = attributeAdditionalWeight;
}
public BigDecimal getProductAttributePrice() {
return productAttributePrice;
}
public void setProductAttributePrice(BigDecimal productAttributePrice) {
this.productAttributePrice = productAttributePrice;
}
}
| [
"csamson777@yahoo.com"
] | csamson777@yahoo.com |
4d630a025849dfe6fe996665399440b62ec8175b | c52772715b4e3e72cdbd605846a3f52d24bc8599 | /src/net/sourceforge/plantuml/command/CommandTitle.java | b7aec1b69c8665c2d5389ad8ae405639f6fdbc17 | [
"MIT"
] | permissive | vsujeesh/plantuml-mit | c172b089441a98e943c6acc559a4506d775da5a0 | e7133c02afdda24b556a8ddb7b5cc416cc0365d6 | refs/heads/master | 2022-02-21T22:23:47.415151 | 2019-10-14T17:03:26 | 2019-10-14T17:03:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,054 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Licensed under The MIT License (Massachusetts Institute of Technology License)
*
* See http://opensource.org/licenses/MIT
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Author: Arnaud Roques
*/
package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.TitledDiagram;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandTitle extends SingleLineCommand2<TitledDiagram> {
public CommandTitle() {
super(getRegexConcat());
}
static IRegex getRegexConcat() {
return RegexConcat.build(CommandTitle.class.getName(), //
RegexLeaf.start(), //
new RegexLeaf("title"), //
new RegexLeaf("(?:[%s]*:[%s]*|[%s]+)"), //
new RegexLeaf("TITLE", "(.*[\\p{L}0-9_.].*)"), RegexLeaf.end()); //
}
@Override
protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) {
diagram.setTitle(DisplayPositionned.single(Display.getWithNewlines(arg.get("TITLE", 0)),
HorizontalAlignment.CENTER, VerticalAlignment.TOP));
return CommandExecutionResult.ok();
}
}
| [
"plantuml@gmail.com"
] | plantuml@gmail.com |
a1cab5c5fbfe96e27b42f5dae8a5db39a58ec256 | d1109c7e2c6b5f9d42f49784489da7929aeeffa8 | /SESION POO/src/Datos.java | dafcf071c7ab3455619ae6aa61db811b511cd952 | [] | no_license | JORGE98-max/Sesion-POO | c4d80e060a79e0a1cabde777d3449b63730695aa | 5dd2a5015ffc6c37dc29ad3be94ea66d11026e37 | refs/heads/master | 2022-11-05T16:54:04.222764 | 2020-06-25T20:56:11 | 2020-06-25T20:56:11 | 274,757,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 489 | java |
public class Datos {
public static void main(String[] args) {
persona myperson = new persona();
myperson.saluda();
vehiculo v1 = new vehiculo();
v1.setColor("Rojo");
System.out.println(v1.getColor());
perro arius = new perro();
arius.caminar();
System.out.println(arius.nombre);
arius.setCantidadPatas(4);
System.out.println(arius.getCantidadPatas());
arius.setColorPelo("Cafe");
System.out.println(arius.getColorPelo());
}
}
| [
"you@example.com"
] | you@example.com |
52d563b6639f5f9a146ecb3f068758ef200f1dda | 7ee2de6d6db11a38e8e5f618514a046f14e75c12 | /rxjava207/src/main/java/io/reactivex/internal/operators/observable/ObservableMap.java | 4f1d1f0fe03baed40e36d57569e37f2c01c0014a | [] | no_license | tinghaoMa/AndroidHelper | b015059da1443488eacd0a262b75e865b38ae8c3 | ab94d7b02d680f4283715c3c3ab4d229820eb5e8 | refs/heads/master | 2023-06-26T08:40:09.145400 | 2021-07-25T13:03:18 | 2021-07-25T13:03:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,540 | java | /**
* Copyright (c) 2016-present, RxJava Contributors.
*
* 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 io.reactivex.internal.operators.observable;
import io.reactivex.*;
import io.reactivex.annotations.Nullable;
import io.reactivex.functions.Function;
import io.reactivex.internal.functions.ObjectHelper;
import io.reactivex.internal.observers.BasicFuseableObserver;
public final class ObservableMap<T, U> extends AbstractObservableWithUpstream<T, U> {
final Function<? super T, ? extends U> function;
public ObservableMap(ObservableSource<T> source, Function<? super T, ? extends U> function) {
super(source);
this.function = function;
}
@Override
public void subscribeActual(Observer<? super U> t) {
source.subscribe(new MapObserver<T, U>(t, function));
}
static final class MapObserver<T, U> extends BasicFuseableObserver<T, U> {
final Function<? super T, ? extends U> mapper;
MapObserver(Observer<? super U> actual, Function<? super T, ? extends U> mapper) {
super(actual); //赋值actual
this.mapper = mapper;
}
@Override
public void onNext(T t) {
if (done) {
return;
}
if (sourceMode != NONE) {
actual.onNext(null);
return;
}
U v;
try {
v = ObjectHelper.requireNonNull(mapper.apply(t), "The mapper function returned a null value.");
} catch (Throwable ex) {
fail(ex);
return;
}
actual.onNext(v);
}
@Override
public int requestFusion(int mode) {
return transitiveBoundaryFusion(mode);
}
@Nullable
@Override
public U poll() throws Exception {
T t = qs.poll();
return t != null ? ObjectHelper.<U>requireNonNull(mapper.apply(t), "The mapper function returned a null value.") : null;
}
}
}
| [
"18310579837@163.com"
] | 18310579837@163.com |
bf7c249418a19fda0ac92cddc8a52ff44480945b | df484743755c29ff497a682f251e4bfdba91c8a5 | /build/multi-lib-tests/src/main/java/org/glowroot/testing/Play.java | 49a4270d614c3d775d9490c960a116ef74e94749 | [
"Apache-2.0"
] | permissive | BurnningHotel/glowroot | 7e4be000d1367b63181aced4667b3317391d08c4 | 4889ac3bfdfcf6229bd22d1df44aa1284fd884ee | refs/heads/master | 2021-01-22T20:21:51.099859 | 2017-08-13T00:27:20 | 2017-08-13T00:27:20 | 100,702,599 | 1 | 0 | null | 2017-08-18T10:42:46 | 2017-08-18T10:42:46 | null | UTF-8 | Java | false | false | 7,961 | java | /**
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.glowroot.testing;
import static org.glowroot.testing.JavaVersion.JAVA6;
import static org.glowroot.testing.JavaVersion.JAVA7;
import static org.glowroot.testing.JavaVersion.JAVA8;
public class Play {
private static final String MODULE_PATH = "agent/plugins/play-plugin";
public static void main(String[] args) throws Exception {
play1x();
play2x();
}
private static void play1x() throws Exception {
runPlay1x("1.1", "play-1.x");
runPlay1x("1.1.1", "play-1.x");
runPlay1x("1.1.2", "play-1.x");
runPlay1x("1.2", "play-1.x");
runPlay1x("1.2.1", "play-1.x");
runPlay1x("1.2.1.1", "play-1.x");
runPlay1x("1.2.2", "play-1.x");
runPlay1x("1.2.3", "play-1.x");
runPlay1x("1.2.4", "play-1.x");
runPlay1x("1.2.5", "play-1.x");
runPlay1x("1.2.5.1", "play-1.x");
runPlay1x("1.2.5.2", "play-1.x");
runPlay1x("1.2.5.3", "play-1.x");
runPlay1x("1.2.5.5", "play-1.x");
runPlay1x("1.2.5.6", "play-1.x");
runPlay1x("1.2.6", "play-1.x");
runPlay1x("1.2.6.1", "play-1.x");
runPlay1x("1.2.6.2", "play-1.x");
runPlay1x("1.2.7", "play-1.x");
runPlay1x("1.2.7.2", "play-1.x");
runPlay1x("1.3.0", "play-1.x");
runPlay1x("1.3.1", "play-1.x");
runPlay1x("1.3.2", "play-1.x");
runPlay1x("1.3.3", "play-1.x");
runPlay1x("1.3.4", "play-1.x");
runPlay1x("1.4.0", "play-1.x");
runPlay1x("1.4.1", "play-1.x");
runPlay1x("1.4.2", "play-1.x");
}
private static void play2x() throws Exception {
runPlay2x("2.0", "2.9.3", "3.3.0.Final", "2.2.2");
runPlay2x("2.0.1", "2.9.3", "3.3.0.Final", "2.2.2");
runPlay2x("2.0.2", "2.9.3", "3.3.0.Final", "2.2.2");
runPlay2x("2.0.3", "2.9.3", "3.5.0.Final", "2.2.2");
runPlay2x("2.0.4", "2.9.3", "3.5.0.Final", "2.2.2");
runPlay2x("2.0.5", "2.9.3", "3.5.0.Final", "2.2.2");
runPlay2x("2.0.6", "2.9.3", "3.5.0.Final", "2.2.2");
runPlay2x("2.0.7", "2.9.3", "3.5.0.Final", "2.2.2");
runPlay2x("2.0.8", "2.9.3", "3.5.0.Final", "2.2.2");
runPlay2x("2.1.0", "2.10.3", "3.5.9.Final", "2.2.2");
runPlay2x("2.1.1", "2.10.3", "3.6.3.Final", "2.2.2");
runPlay2x("2.1.2", "2.10.3", "3.6.3.Final", "2.2.2");
runPlay2x("2.1.3", "2.10.3", "3.6.3.Final", "2.2.2");
runPlay2x("2.1.4", "2.10.3", "3.6.3.Final", "2.2.2");
runPlay2x("2.1.5", "2.10.3", "3.6.3.Final", "2.2.2");
runPlay2x("2.2.0", "2.10.3", "3.7.0.Final", "2.2.2");
runPlay2x("2.2.1", "2.10.3", "3.7.0.Final", "2.2.2");
runPlay2x("2.2.2", "2.10.3", "3.7.0.Final", "2.2.2");
runPlay2x("2.2.3", "2.10.3", "3.7.1.Final", "2.2.2");
runPlay2x("2.2.4", "2.10.3", "3.7.1.Final", "2.2.2");
runPlay2x("2.2.5", "2.10.3", "3.7.1.Final", "2.2.2");
runPlay2x("2.2.6", "2.10.3", "3.7.1.Final", "2.2.2");
runPlay2x("2.3.0", "2.11.8", "3.9.1.Final", "2.3.2");
runPlay2x("2.3.1", "2.11.8", "3.9.2.Final", "2.3.2");
runPlay2x("2.3.2", "2.11.8", "3.9.2.Final", "2.3.2");
runPlay2x("2.3.3", "2.11.8", "3.9.2.Final", "2.3.2");
runPlay2x("2.3.4", "2.11.8", "3.9.3.Final", "2.3.2");
runPlay2x("2.3.5", "2.11.8", "3.9.3.Final", "2.3.2");
runPlay2x("2.3.6", "2.11.8", "3.9.3.Final", "2.3.2");
runPlay2x("2.3.7", "2.11.8", "3.9.3.Final", "2.3.2");
runPlay2x("2.3.8", "2.11.8", "3.9.3.Final", "2.3.2");
runPlay2x("2.3.9", "2.11.8", "3.9.8.Final", "2.3.2");
runPlay2x("2.3.10", "2.11.8", "3.9.9.Final", "2.3.2");
runPlay2x("2.4.0", "2.11.8", "3.10.3.Final", "2.5.3");
runPlay2x("2.4.1", "2.11.8", "3.10.3.Final", "2.5.4");
runPlay2x("2.4.2", "2.11.8", "3.10.3.Final", "2.5.4");
runPlay2x("2.4.3", "2.11.8", "3.10.4.Final", "2.5.4");
runPlay2x("2.4.4", "2.11.8", "3.10.4.Final", "2.5.4");
runPlay2x("2.4.5", "2.11.8", "3.10.4.Final", "2.5.4");
runPlay2x("2.4.6", "2.11.8", "3.10.4.Final", "2.5.4");
runPlay2x("2.4.7", "2.11.8", "3.10.4.Final", "2.5.4");
runPlay2x("2.4.8", "2.11.8", "3.10.4.Final", "2.5.4");
runPlay2x("2.5.0", "2.11.8", "4.0.33.Final", "2.7.1");
runPlay2x("2.5.1", "2.11.8", "4.0.34.Final", "2.7.1");
runPlay2x("2.5.2", "2.11.8", "4.0.36.Final", "2.7.1");
runPlay2x("2.5.3", "2.11.8", "4.0.36.Final", "2.7.1");
runPlay2x("2.5.4", "2.11.8", "4.0.36.Final", "2.7.1");
runPlay2x("2.5.5", "2.11.8", "4.0.39.Final", "2.7.6");
runPlay2x("2.5.6", "2.11.8", "4.0.39.Final", "2.7.6");
runPlay2x("2.5.7", "2.11.8", "4.0.41.Final", "2.7.6");
runPlay2x("2.5.8", "2.11.8", "4.0.41.Final", "2.7.6");
runPlay2x("2.5.9", "2.11.8", "4.0.41.Final", "2.7.6");
runPlay2x("2.5.10", "2.11.8", "4.0.41.Final", "2.7.8");
}
private static void runPlay2x(String playVersion, String scalaVersion, String nettyVersion,
String jacksonVersion) throws Exception {
String testAppVersion;
if (playVersion.equals("2.0")) {
testAppVersion = "2.0.x";
} else if (playVersion.equals("2.1.0")) {
// there are some incompatibilities between 2.1.0 and other 2.1.x
testAppVersion = "2.1.0";
} else {
testAppVersion = playVersion.substring(0, playVersion.lastIndexOf('.')) + ".x";
}
String scalaMajorVersion = scalaVersion.substring(0, scalaVersion.lastIndexOf('.'));
String profile;
JavaVersion[] javaVersions;
if (playVersion.startsWith("2.0")) {
profile = "play-2.0.x";
javaVersions = new JavaVersion[] {JAVA6, JAVA7}; // scala 2.9 doesn't support 1.8
} else if (playVersion.startsWith("2.1")) {
profile = "play-2.1.x";
javaVersions = new JavaVersion[] {JAVA6, JAVA7, JAVA8};
} else if (playVersion.startsWith("2.2") || playVersion.startsWith("2.3")) {
profile = "play-2.2.x";
javaVersions = new JavaVersion[] {JAVA6, JAVA7, JAVA8};
} else {
// play version is 2.4+
profile = "play-2.4.x";
javaVersions = new JavaVersion[] {JAVA8};
}
Util.updateLibVersion(MODULE_PATH, "play.version", playVersion);
Util.updateLibVersion(MODULE_PATH, "scala.major.version", scalaMajorVersion);
Util.updateLibVersion(MODULE_PATH, "scala.version", scalaVersion);
Util.updateLibVersion(MODULE_PATH, "netty.version", nettyVersion);
Util.updateLibVersion(MODULE_PATH, "jackson.version", jacksonVersion);
Util.updateLibVersion(MODULE_PATH, "test.app.version", testAppVersion);
Util.updateLibVersion(MODULE_PATH, "test.app.language", "scala");
Util.runTests(MODULE_PATH, new String[] {"play-2.x", profile}, javaVersions);
Util.updateLibVersion(MODULE_PATH, "test.app.language", "java");
Util.runTests(MODULE_PATH, new String[] {"play-2.x", profile}, javaVersions);
}
private static void runPlay1x(String version, String profile) throws Exception {
Util.updateLibVersion(MODULE_PATH, "play.version", version);
Util.runTests(MODULE_PATH, profile, JAVA6, JAVA7, JAVA8);
}
}
| [
"trask.stalnaker@gmail.com"
] | trask.stalnaker@gmail.com |
f7d4fbc656e408c9ca511bbb32b52cd59db68af8 | 3eca6278418d9eef7f5f850b23714a8356ef525f | /tumi/ServicioEJB/ejbModule/pe/com/tumi/servicio/prevision/domain/EstadoLiquidacion.java | 3637413a510175656863704bee96f006b6f95baf | [] | no_license | cdelosrios88/tumiws-bizarq | 2728235b3f3239f12f14b586bb6349e2f9b8cf4f | 7b32fa5765a4384b8d219c5f95327b2e14dd07ac | refs/heads/master | 2021-01-23T22:53:21.052873 | 2014-07-05T05:19:58 | 2014-07-05T05:19:58 | 32,641,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,477 | java | package pe.com.tumi.servicio.prevision.domain;
import java.sql.Timestamp;
import java.util.Date;
import pe.com.tumi.empresa.domain.Subsucursal;
import pe.com.tumi.empresa.domain.Sucursal;
import pe.com.tumi.framework.negocio.domain.TumiDomain;
import pe.com.tumi.persona.core.domain.Persona;
public class EstadoLiquidacion extends TumiDomain{
private EstadoLiquidacionId id;
private Integer intParaEstado;
private Timestamp tsFechaEstado;
private Integer intPersEmpresaEstado;
private Integer intSucuIdSucursal;
private Integer intSudeIdSubsucursal;
private Integer intPersUsuarioEstado;
private String strObservacion;
private Integer intPersEmpresaLibro;
private Integer intContPeriodoLibro;
private Integer intContCodigoLibro;
//filtro
private Date dtFechaEstadoDesde;
private Date dtFechaEstadoHasta;
private Sucursal sucursal;
private Subsucursal subsucursal;
private Persona persona;
public EstadoLiquidacion(){
id = new EstadoLiquidacionId();
}
public EstadoLiquidacionId getId() {
return id;
}
public void setId(EstadoLiquidacionId id) {
this.id = id;
}
public Integer getIntParaEstado() {
return intParaEstado;
}
public void setIntParaEstado(Integer intParaEstado) {
this.intParaEstado = intParaEstado;
}
public Timestamp getTsFechaEstado() {
return tsFechaEstado;
}
public void setTsFechaEstado(Timestamp tsFechaEstado) {
this.tsFechaEstado = tsFechaEstado;
}
public Integer getIntPersEmpresaEstado() {
return intPersEmpresaEstado;
}
public void setIntPersEmpresaEstado(Integer intPersEmpresaEstado) {
this.intPersEmpresaEstado = intPersEmpresaEstado;
}
public Integer getIntSucuIdSucursal() {
return intSucuIdSucursal;
}
public void setIntSucuIdSucursal(Integer intSucuIdSucursal) {
this.intSucuIdSucursal = intSucuIdSucursal;
}
public Integer getIntSudeIdSubsucursal() {
return intSudeIdSubsucursal;
}
public void setIntSudeIdSubsucursal(Integer intSudeIdSubsucursal) {
this.intSudeIdSubsucursal = intSudeIdSubsucursal;
}
public Integer getIntPersUsuarioEstado() {
return intPersUsuarioEstado;
}
public void setIntPersUsuarioEstado(Integer intPersUsuarioEstado) {
this.intPersUsuarioEstado = intPersUsuarioEstado;
}
public String getStrObservacion() {
return strObservacion;
}
public void setStrObservacion(String strObservacion) {
this.strObservacion = strObservacion;
}
public Integer getIntPersEmpresaLibro() {
return intPersEmpresaLibro;
}
public void setIntPersEmpresaLibro(Integer intPersEmpresaLibro) {
this.intPersEmpresaLibro = intPersEmpresaLibro;
}
public Integer getIntContPeriodoLibro() {
return intContPeriodoLibro;
}
public void setIntContPeriodoLibro(Integer intContPeriodoLibro) {
this.intContPeriodoLibro = intContPeriodoLibro;
}
public Integer getIntContCodigoLibro() {
return intContCodigoLibro;
}
public void setIntContCodigoLibro(Integer intContCodigoLibro) {
this.intContCodigoLibro = intContCodigoLibro;
}
public Date getDtFechaEstadoDesde() {
return dtFechaEstadoDesde;
}
public void setDtFechaEstadoDesde(Date dtFechaEstadoDesde) {
this.dtFechaEstadoDesde = dtFechaEstadoDesde;
}
public Date getDtFechaEstadoHasta() {
return dtFechaEstadoHasta;
}
public void setDtFechaEstadoHasta(Date dtFechaEstadoHasta) {
this.dtFechaEstadoHasta = dtFechaEstadoHasta;
}
public Sucursal getSucursal() {
return sucursal;
}
public void setSucursal(Sucursal sucursal) {
this.sucursal = sucursal;
}
public Subsucursal getSubsucursal() {
return subsucursal;
}
public void setSubsucursal(Subsucursal subsucursal) {
this.subsucursal = subsucursal;
}
public Persona getPersona() {
return persona;
}
public void setPersona(Persona persona) {
this.persona = persona;
}
@Override
public String toString() {
return "EstadoLiquidacion [id=" + id + ", intParaEstado=" + intParaEstado
+ ", tsFechaEstado=" + tsFechaEstado
+ ", intPersEmpresaEstado=" + intPersEmpresaEstado
+ ", intSucuIdSucursal=" + intSucuIdSucursal
+ ", intSudeIdSubsucursal=" + intSudeIdSubsucursal
+ ", intPersUsuarioEstado=" + intPersUsuarioEstado
+ ", strObservacion=" + strObservacion
+ ", intPersEmpresaLibro=" + intPersEmpresaLibro
+ ", intContPeriodoLibro=" + intContPeriodoLibro
+ ", intContCodigoLibro=" + intContCodigoLibro + "]";
}
}
| [
"cdelosrios@bizarq.com@b3a863b4-f5f8-5366-a268-df30542ed8c1"
] | cdelosrios@bizarq.com@b3a863b4-f5f8-5366-a268-df30542ed8c1 |
a13b3c5dec2252c83b15dbd67e04a297fd3e9978 | 6732796da80d70456091ec1c3cc1ee9748b97cc5 | /yasjf4j/jackson-databind-over-yasjf4j/src/main/java/com/fasterxml/jackson/databind/deser/impl/JavaUtilCollectionsDeserializers.java | f13472d95755cfa04e24671f371d1c89ce5c51f9 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | nharrand/argo | f88c13a1fb759f44fab6dbc6614de3c0c0554549 | c09fccba668e222a1b349b95d34177b5964e78e1 | refs/heads/main | 2023-08-13T10:39:48.526694 | 2021-10-13T09:40:19 | 2021-10-13T09:40:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,553 | java | package com.fasterxml.jackson.databind.deser.impl;
import java.util.*;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.deser.std.StdDelegatingDeserializer;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.Converter;
/**
* Helper class used to contain logic for deserializing "special" containers
* from {@code java.util.Collections} and {@code java.util.Arrays}. This is needed
* because they do not have usable no-arguments constructor: however, are easy enough
* to deserialize using delegating deserializer.
*
* @since 2.9.4
*/
public abstract class JavaUtilCollectionsDeserializers
{
private final static int TYPE_SINGLETON_SET = 1;
private final static int TYPE_SINGLETON_LIST = 2;
private final static int TYPE_SINGLETON_MAP = 3;
private final static int TYPE_UNMODIFIABLE_SET = 4;
private final static int TYPE_UNMODIFIABLE_LIST = 5;
private final static int TYPE_UNMODIFIABLE_MAP = 6;
public final static int TYPE_AS_LIST = 7;
// 10-Jan-2018, tatu: There are a few "well-known" special containers in JDK too:
private final static Class<?> CLASS_AS_ARRAYS_LIST = Arrays.asList(null, null).getClass();
private final static Class<?> CLASS_SINGLETON_SET;
private final static Class<?> CLASS_SINGLETON_LIST;
private final static Class<?> CLASS_SINGLETON_MAP;
private final static Class<?> CLASS_UNMODIFIABLE_SET;
private final static Class<?> CLASS_UNMODIFIABLE_LIST;
/* 02-Mar-2019, tatu: for [databind#2265], need to consider possible alternate type...
* which we essentially coerce into the other one
*/
private final static Class<?> CLASS_UNMODIFIABLE_LIST_ALIAS;
private final static Class<?> CLASS_UNMODIFIABLE_MAP;
static {
Set<?> set = Collections.singleton(Boolean.TRUE);
CLASS_SINGLETON_SET = set.getClass();
CLASS_UNMODIFIABLE_SET = Collections.unmodifiableSet(set).getClass();
List<?> list = Collections.singletonList(Boolean.TRUE);
CLASS_SINGLETON_LIST = list.getClass();
CLASS_UNMODIFIABLE_LIST = Collections.unmodifiableList(list).getClass();
// for [databind#2265]
CLASS_UNMODIFIABLE_LIST_ALIAS = Collections.unmodifiableList(new LinkedList<Object>()).getClass();
Map<?,?> map = Collections.singletonMap("a", "b");
CLASS_SINGLETON_MAP = map.getClass();
CLASS_UNMODIFIABLE_MAP = Collections.unmodifiableMap(map).getClass();
}
public static JsonDeserializer<?> findForCollection(DeserializationContext ctxt,
JavaType type)
throws JsonMappingException
{
JavaUtilCollectionsConverter conv;
// 10-Jan-2017, tatu: Some types from `java.util.Collections`/`java.util.Arrays` need bit of help...
if (type.hasRawClass(CLASS_AS_ARRAYS_LIST)) {
conv = converter(TYPE_AS_LIST, type, List.class);
} else if (type.hasRawClass(CLASS_SINGLETON_LIST)) {
conv = converter(TYPE_SINGLETON_LIST, type, List.class);
} else if (type.hasRawClass(CLASS_SINGLETON_SET)) {
conv = converter(TYPE_SINGLETON_SET, type, Set.class);
// [databind#2265]: we may have another impl type for unmodifiable Lists, check both
} else if (type.hasRawClass(CLASS_UNMODIFIABLE_LIST) || type.hasRawClass(CLASS_UNMODIFIABLE_LIST_ALIAS)) {
conv = converter(TYPE_UNMODIFIABLE_LIST, type, List.class);
} else if (type.hasRawClass(CLASS_UNMODIFIABLE_SET)) {
conv = converter(TYPE_UNMODIFIABLE_SET, type, Set.class);
} else {
return null;
}
return new StdDelegatingDeserializer<Object>(conv);
}
public static JsonDeserializer<?> findForMap(DeserializationContext ctxt,
JavaType type)
throws JsonMappingException
{
JavaUtilCollectionsConverter conv;
// 10-Jan-2017, tatu: Some types from `java.util.Collections`/`java.util.Arrays` need bit of help...
if (type.hasRawClass(CLASS_SINGLETON_MAP)) {
conv = converter(TYPE_SINGLETON_MAP, type, Map.class);
} else if (type.hasRawClass(CLASS_UNMODIFIABLE_MAP)) {
conv = converter(TYPE_UNMODIFIABLE_MAP, type, Map.class);
} else {
return null;
}
return new StdDelegatingDeserializer<Object>(conv);
}
static JavaUtilCollectionsConverter converter(int kind,
JavaType concreteType, Class<?> rawSuper)
{
return new JavaUtilCollectionsConverter(kind, concreteType.findSuperType(rawSuper));
}
/**
* Implementation used for converting from various generic container
* types ({@link java.util.Set}, {@link java.util.List}, {@link java.util.Map})
* into more specific implementations accessible via {@code java.util.Collections}.
*/
private static class JavaUtilCollectionsConverter implements Converter<Object,Object>
{
private final JavaType _inputType;
private final int _kind;
JavaUtilCollectionsConverter(int kind, JavaType inputType) {
_inputType = inputType;
_kind = kind;
}
@Override
public Object convert(Object value) {
if (value == null) { // is this legal to get?
return null;
}
switch (_kind) {
case TYPE_SINGLETON_SET:
{
Set<?> set = (Set<?>) value;
_checkSingleton(set.size());
return Collections.singleton(set.iterator().next());
}
case TYPE_SINGLETON_LIST:
{
List<?> list = (List<?>) value;
_checkSingleton(list.size());
return Collections.singletonList(list.get(0));
}
case TYPE_SINGLETON_MAP:
{
Map<?,?> map = (Map<?,?>) value;
_checkSingleton(map.size());
Map.Entry<?,?> entry = map.entrySet().iterator().next();
return Collections.singletonMap(entry.getKey(), entry.getValue());
}
case TYPE_UNMODIFIABLE_SET:
return Collections.unmodifiableSet((Set<?>) value);
case TYPE_UNMODIFIABLE_LIST:
return Collections.unmodifiableList((List<?>) value);
case TYPE_UNMODIFIABLE_MAP:
return Collections.unmodifiableMap((Map<?,?>) value);
case TYPE_AS_LIST:
default:
// Here we do not actually care about impl type, just return List as-is:
return value;
}
}
@Override
public JavaType getInputType(TypeFactory typeFactory) {
return _inputType;
}
@Override
public JavaType getOutputType(TypeFactory typeFactory) {
// we don't actually care, so:
return _inputType;
}
private void _checkSingleton(int size) {
if (size != 1) {
// not the best error ever but... has to do
throw new IllegalArgumentException("Can not deserialize Singleton container from "+size+" entries");
}
}
}
}
| [
"nicolas.harrand@gmail.com"
] | nicolas.harrand@gmail.com |
479e20d976ea4015cf1f4d8df48323632e3c1bfb | 9654f4ae1ca6e3bd31565ae814f0a3edd96c3168 | /src/main/java/be/aga/dominionSimulator/cards/MineCard.java | cb04f5b1b9df5754f86a1e11b97eab613843e65e | [] | no_license | danieljbrooks/DominionSim | 3cd17fbd93a1fb0b9fa6782d151b65180ec65209 | 23b5697876bf21e1f8ad607ccc391001c686784a | refs/heads/master | 2021-01-23T14:31:29.977254 | 2017-05-11T12:12:53 | 2017-05-11T12:12:53 | 102,690,613 | 1 | 0 | null | 2017-09-07T04:16:33 | 2017-09-07T04:16:33 | null | UTF-8 | Java | false | false | 2,842 | java | package be.aga.dominionSimulator.cards;
import java.util.Collections;
import be.aga.dominionSimulator.DomCard;
import be.aga.dominionSimulator.DomCost;
import be.aga.dominionSimulator.enums.DomCardName;
import be.aga.dominionSimulator.enums.DomCardType;
import be.aga.dominionSimulator.enums.DomPlayStrategy;
public class MineCard extends DomCard {
private DomCard myCardToTrash;
private DomCardName myDesiredCard;
public MineCard () {
super( DomCardName.Mine);
}
public void play() {
if (owner.getPlayStrategyFor(this)==DomPlayStrategy.mineCopperFirst && !owner.getCardsFromHand(DomCardName.Copper).isEmpty() && owner.getCurrentGame().countInSupply(DomCardName.Silver)>0) {
owner.trash(owner.removeCardFromHand( owner.getCardsFromHand(DomCardName.Copper).get(0)));
owner.gainInHand(DomCardName.Silver);
return;
}
checkForCardToMine();
if (myCardToTrash==null)
//possible if played by Golem for instance
return;
owner.trash(owner.removeCardFromHand( myCardToTrash));
if (myDesiredCard==null)
//possible if card was throne roomed
myDesiredCard=owner.getCurrentGame().getBestCardInSupplyFor(owner, DomCardType.Treasure, myCardToTrash.getCost(owner.getCurrentGame()).add(new DomCost(3,0)));
if (myDesiredCard!=null)
owner.gainInHand(myDesiredCard);
}
@Override
public boolean wantsToBePlayed() {
checkForCardToMine();
return myDesiredCard!=null;
}
private void checkForCardToMine() {
Collections.sort(owner.getCardsInHand(), SORT_FOR_TRASHING);
DomCardName thePossibleDesiredCard=null;
myDesiredCard=null;
myCardToTrash=null;
//we try to get the best treasure which is important in Colony games (Golds into Platinums and not Silvers into Golds)
for (DomCard card : owner.getCardsFromHand(DomCardType.Treasure)){
DomCost theCostOfmyDesiredCard = card.getName().getCost(owner.getCurrentGame()).add(new DomCost(3,0)) ;
thePossibleDesiredCard=owner.getDesiredCard(DomCardType.Treasure, theCostOfmyDesiredCard , false, false, null);
if (thePossibleDesiredCard==null)
continue;
if ((card.getName()!=thePossibleDesiredCard || thePossibleDesiredCard==DomCardName.Ill_Gotten_Gains)) {
if (myCardToTrash==null
|| (thePossibleDesiredCard.getOrderInBuyRules(owner) <= card.getName().getOrderInBuyRules(owner)
&& (thePossibleDesiredCard.getOrderInBuyRules(owner) < myDesiredCard.getOrderInBuyRules(owner)
|| (thePossibleDesiredCard.getOrderInBuyRules(owner) == myDesiredCard.getOrderInBuyRules(owner)
&& myCardToTrash.getTrashPriority()>card.getTrashPriority())))){
myDesiredCard=thePossibleDesiredCard;
myCardToTrash=card;
}
}
}
}
} | [
"jeroen_aga@yahoo.com"
] | jeroen_aga@yahoo.com |
7344101c550f135a1d59b6bfc99781500e1158fc | b0b08bc775a09a6878a01cfe382162c8b00f647f | /ts-assurance-service/src/main/java/assurance/service/AssuranceServiceImpl.java | 72dc386a85c8e8f6af0b2d9936ee690cce9bb1c6 | [] | no_license | hechuan73/train_ticket | 82c1c21c84c818c22f2aeb17fd4a6141ee60dd58 | 57b392013e08dfc6b04a469061187dbd819c8462 | refs/heads/master | 2022-07-31T08:10:46.261517 | 2018-01-03T01:46:32 | 2018-01-03T01:46:32 | 116,078,736 | 13 | 8 | null | 2022-07-27T10:43:46 | 2018-01-03T02:01:05 | Java | UTF-8 | Java | false | false | 6,276 | java | package assurance.service;
import assurance.domain.*;
import assurance.repository.AssuranceRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
@Service
public class AssuranceServiceImpl implements AssuranceService {
@Autowired
private AssuranceRepository assuranceRepository;
// @Override
// public Assurance createAssurance(Assurance assurance) {
// Assurance assuranceTemp = assuranceRepository.findById(assurance.getId());
// if(assuranceTemp != null){
// System.out.println("[Assurance Service][Init Assurance] Already Exists Id:" + assurance.getId());
// } else {
// assuranceRepository.save(assurance);
// }
// return assurance;
// }
@Override
public Assurance findAssuranceById(UUID id) {
return assuranceRepository.findById(id);
}
@Override
public Assurance findAssuranceByOrderId(UUID orderId) {
return assuranceRepository.findByOrderId(orderId);
}
@Override
public AddAssuranceResult create(AddAssuranceInfo aai) {
Assurance a = assuranceRepository.findByOrderId(UUID.fromString(aai.getOrderId()));
AddAssuranceResult aar = new AddAssuranceResult();
AssuranceType at = AssuranceType.getTypeByIndex(aai.getTypeIndex());
if(a != null){
System.out.println("[Assurance-Add&Delete-Service][AddAssurance] Fail.Assurance already exists");
aar.setStatus(false);
aar.setMessage("Assurance Already Exists");
aar.setAssurance(null);
} else if(at == null){
System.out.println("[Assurance-Add&Delete-Service][AddAssurance] Fail.Assurance type doesn't exist");
aar.setStatus(false);
aar.setMessage("Assurance type doesn't exist");
aar.setAssurance(null);
} else{
Assurance assurance = new Assurance(UUID.randomUUID(), UUID.fromString(aai.getOrderId()), at);
assuranceRepository.save(assurance);
System.out.println("[Assurance-Add&Delete-Service][AddAssurance] Success.");
aar.setStatus(true);
aar.setMessage("Success");
aar.setAssurance(assurance);
}
return aar;
}
@Override
public DeleteAssuranceResult deleteById(UUID assuranceId) {
assuranceRepository.deleteById(assuranceId);
Assurance a = assuranceRepository.findById(assuranceId);
DeleteAssuranceResult dar = new DeleteAssuranceResult();
if(a == null){
System.out.println("[Assurance-Add&Delete-Service][DeleteAssurance] Success.");
dar.setStatus(true);
dar.setMessage("Success");
} else {
System.out.println("[Assurance-Add&Delete-Service][DeleteAssurance] Fail.Assurance not clear.");
dar.setStatus(false);
dar.setMessage("Reason Not clear");
}
return dar;
}
@Override
public DeleteAssuranceResult deleteByOrderId(UUID orderId) {
assuranceRepository.removeAssuranceByOrderId(orderId);
Assurance a = assuranceRepository.findByOrderId(orderId);
DeleteAssuranceResult dar = new DeleteAssuranceResult();
if(a == null){
System.out.println("[Assurance-Add&Delete-Service][DeleteAssurance] Success.");
dar.setStatus(true);
dar.setMessage("Success");
} else {
System.out.println("[Assurance-Add&Delete-Service][DeleteAssurance] Fail.Assurance not clear.");
dar.setStatus(false);
dar.setMessage("Reason Not clear");
}
return dar;
}
@Override
public ModifyAssuranceResult modify(ModifyAssuranceInfo info) {
Assurance oldAssurance = findAssuranceById(UUID.fromString(info.getAssuranceId()));
ModifyAssuranceResult mcr = new ModifyAssuranceResult();
if(oldAssurance == null){
System.out.println("[Assurance-Modify-Service][ModifyAssurance] Fail.Assurance not found.");
mcr.setStatus(false);
mcr.setMessage("Contacts not found");
mcr.setAssurance(null);
}else{
AssuranceType at = AssuranceType.getTypeByIndex(info.getTypeIndex());
if(at != null){
oldAssurance.setType(at);
assuranceRepository.save(oldAssurance);
System.out.println("[Assurance-Modify-Service][ModifyAssurance] Success.");
mcr.setStatus(true);
mcr.setMessage("Success");
mcr.setAssurance(oldAssurance);
} else {
System.out.println("[Assurance-Modify-Service][ModifyAssurance] Fail.Assurance Type not exist.");
mcr.setStatus(false);
mcr.setMessage("Assurance Type not exist");
mcr.setAssurance(null);
}
}
return mcr;
}
@Override
public GetAllAssuranceResult getAllAssurances() {
ArrayList<Assurance> as = assuranceRepository.findAll();
GetAllAssuranceResult gar = new GetAllAssuranceResult();
gar.setStatus(true);
gar.setMessage("Success");
ArrayList<PlainAssurance> result = new ArrayList<PlainAssurance>();
for(Assurance a : as){
PlainAssurance pa = new PlainAssurance();
pa.setId(a.getId());
pa.setOrderId(a.getOrderId());
pa.setTypeIndex(a.getType().getIndex());
pa.setTypeName(a.getType().getName());
pa.setTypePrice(a.getType().getPrice());
result.add(pa);
}
gar.setAssurances(result);
return gar;
}
@Override
public List<AssuranceTypeBean> getAllAssuranceTypes() {
List<AssuranceTypeBean> atlist = new ArrayList<AssuranceTypeBean>();
for(AssuranceType at : AssuranceType.values()){
AssuranceTypeBean atb = new AssuranceTypeBean();
atb.setIndex(at.getIndex());
atb.setName(at.getName());
atb.setPrice(at.getPrice());
atlist.add(atb);
}
return atlist;
}
}
| [
"18321716610@163.com"
] | 18321716610@163.com |
30795ac4ab3599acd3f7d535ddb13dfcb5a82f14 | 8d4291048c6915af897325c1ee6e36e43aa78031 | /src/main/java/io/flowing/trip/saga/camunda/adapter/ReserveCarAdapter.java | 90c697497e05eddccb7b1bf1251b8405c2152909 | [
"Apache-2.0"
] | permissive | brunourb/trip-booking-saga-java | 0ed6c14d45a40101c84fc8bd79c5845ca9d5ad1d | 4f9cadb5b64e11ba78984be42a910469b4fbfc31 | refs/heads/master | 2023-08-10T13:29:09.162034 | 2021-04-28T16:00:20 | 2021-04-28T16:00:20 | 399,949,340 | 0 | 0 | Apache-2.0 | 2023-07-21T14:33:44 | 2021-08-25T20:29:16 | null | UTF-8 | Java | false | false | 379 | java | package io.flowing.trip.saga.camunda.adapter;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
public class ReserveCarAdapter implements JavaDelegate {
@Override
public void execute(DelegateExecution ctx) throws Exception {
System.out.println("reserve car for '" + ctx.getVariable("name") + "'");
}
}
| [
"bernd.ruecker@camunda.com"
] | bernd.ruecker@camunda.com |
d0048f7bb46796795aa2c93612561f59298b97fb | ddbb70f9e2caa272c05a8fa54c5358e2aeb507ad | /rimauth/src/main/java/com/rimdev/rimauth/Repo/PagesPriviledgeRepo.java | f2f240e44031149106219d3f36a0eceea79ac1cf | [] | no_license | ahmedhamed105/rimdev | 1e1aad2c4266dd20e402c566836b9db1f75d4643 | c5737a7463f0b80b49896a52f93acbb1e1823509 | refs/heads/master | 2023-02-05T15:18:20.829487 | 2021-04-04T08:10:19 | 2021-04-04T08:10:19 | 228,478,954 | 1 | 0 | null | 2023-01-11T19:57:52 | 2019-12-16T21:27:44 | JavaScript | UTF-8 | Java | false | false | 239 | java | package com.rimdev.rimauth.Repo;
import org.springframework.data.repository.CrudRepository;
import com.rimdev.rimauth.entities.PagesPriviledge;
public interface PagesPriviledgeRepo extends CrudRepository<PagesPriviledge, Integer>{
} | [
"ahmed.elemam@its.ws"
] | ahmed.elemam@its.ws |
27f6deb5425f71593ef8a13517959341f4198cc6 | ff2683777d02413e973ee6af2d71ac1a1cac92d3 | /src/main/java/com/alipay/api/domain/ZhimaCreditPeUserSceneConsultModel.java | 879232b1868149c7df288908007f0d06028e2125 | [
"Apache-2.0"
] | permissive | weizai118/alipay-sdk-java-all | c30407fec93e0b2e780b4870b3a71e9d7c55ed86 | ec977bf06276e8b16c4b41e4c970caeaf21e100b | refs/heads/master | 2020-05-31T21:01:16.495008 | 2019-05-28T13:14:39 | 2019-05-28T13:14:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,030 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 信用受理评估接口(场景维度准入&盖帽额度咨询)
*
* @author auto create
* @since 1.0, 2018-12-21 09:45:54
*/
public class ZhimaCreditPeUserSceneConsultModel extends AlipayObject {
private static final long serialVersionUID = 7616742226416329723L;
/**
* 买家的蚂蚁统一会员ID
*/
@ApiField("buyer_id")
private String buyerId;
/**
* 芝麻信用类目码,由芝麻信用侧分配
*/
@ApiField("category_code")
private String categoryCode;
/**
* 芝麻信用场景,由芝麻信用侧分配,如:天猫信用购,淘宝租赁等
*/
@ApiField("credit_scene")
private String creditScene;
/**
* 业务扩展参数,json格式字符串,如果有需要,请提前联系开发人员沟通确定参数
*/
@ApiField("ext_params")
private String extParams;
/**
* 风险环境参数信息,json格式字符串,目前已知key如下:umid,设备指纹;imei,设备号;lbs,经纬度;ip,设备网络IP地址;wireless_mac,设备无线wifi mac;mac,设备网卡地址
*/
@ApiField("risk_info")
private String riskInfo;
public String getBuyerId() {
return this.buyerId;
}
public void setBuyerId(String buyerId) {
this.buyerId = buyerId;
}
public String getCategoryCode() {
return this.categoryCode;
}
public void setCategoryCode(String categoryCode) {
this.categoryCode = categoryCode;
}
public String getCreditScene() {
return this.creditScene;
}
public void setCreditScene(String creditScene) {
this.creditScene = creditScene;
}
public String getExtParams() {
return this.extParams;
}
public void setExtParams(String extParams) {
this.extParams = extParams;
}
public String getRiskInfo() {
return this.riskInfo;
}
public void setRiskInfo(String riskInfo) {
this.riskInfo = riskInfo;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
4fed7f40f88a27bf77fa43f9928e2dafce19ca7f | 81b95139944f634e942ced7bb2b266f03dbd2183 | /hsweb-web-datasource/src/main/java/org/hsweb/web/datasource/dynamic/DynamicXaDataSourceImpl.java | 00cec097d8f17d52443765256b1e77149fdae7eb | [
"Apache-2.0"
] | permissive | Sheamus2340/hsweb-framework | e7311261518e4651394370c7689b16ba843cdc46 | 0a58760d925555189d52e508e4a1ba5a7a8c3ddf | refs/heads/master | 2020-08-01T01:08:46.080768 | 2016-11-05T07:37:32 | 2016-11-05T07:37:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,627 | java | /*
* Copyright 2015-2016 http://hsweb.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 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.hsweb.web.datasource.dynamic;
import com.atomikos.jdbc.AtomikosDataSourceBean;
import org.hsweb.web.core.datasource.DatabaseType;
import org.hsweb.web.core.datasource.DynamicDataSource;
import org.hsweb.web.service.datasource.DynamicDataSourceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.datasource.AbstractDataSource;
import org.springframework.util.Assert;
import javax.sql.DataSource;
import javax.sql.XAConnection;
import javax.sql.XADataSource;
import java.io.Closeable;
import java.sql.Connection;
import java.sql.SQLException;
public class DynamicXaDataSourceImpl extends AbstractDataSource implements DynamicDataSource, XADataSource, Closeable {
private Logger logger = LoggerFactory.getLogger(DynamicDataSource.class);
private javax.sql.DataSource defaultDataSource = null;
private DatabaseType defaultDatabaseType;
protected DynamicDataSourceService dynamicDataSourceService;
public DynamicXaDataSourceImpl(javax.sql.DataSource defaultDataSource, DatabaseType defaultDatabaseType) {
Assert.notNull(defaultDataSource);
Assert.notNull(defaultDatabaseType);
this.defaultDataSource = defaultDataSource;
this.defaultDatabaseType = defaultDatabaseType;
}
@Override
public Connection getConnection() throws SQLException {
return getActiveDataSource().getConnection();
}
@Override
public Connection getConnection(String username, String password) throws SQLException {
return getActiveDataSource().getConnection(username, password);
}
public DataSource getActiveDataSource() {
String sourceId = DynamicDataSource.getActiveDataSourceId();
logger.info("use datasource:{}", sourceId == null ? "default" : sourceId);
if (sourceId == null || dynamicDataSourceService == null) return defaultDataSource;
DataSource dataSource = dynamicDataSourceService.getDataSource(sourceId);
logger.info("use datasource:{} fail,because its not exists! use default datasource now.", sourceId);
if (dataSource == null) return defaultDataSource;
return dataSource;
}
@Override
public DatabaseType getActiveDataBaseType() {
String sourceId = DynamicDataSource.getActiveDataSourceId();
if (sourceId == null || dynamicDataSourceService == null) return defaultDatabaseType;
String type = dynamicDataSourceService.getDataBaseType(sourceId);
if (type == null) return defaultDatabaseType;
return DatabaseType.valueOf(type);
}
public XADataSource getActiveXADataSource() {
DataSource activeDs = getActiveDataSource();
XADataSource xaDataSource;
if (activeDs instanceof XADataSource)
xaDataSource = ((XADataSource) activeDs);
else if (activeDs instanceof AtomikosDataSourceBean) {
xaDataSource = ((AtomikosDataSourceBean) activeDs).getXaDataSource();
} else {
throw new UnsupportedOperationException(activeDs.getClass() + " is not XADataSource");
}
return xaDataSource;
}
public synchronized void setDynamicDataSourceService(DynamicDataSourceService dynamicDataSourceService) {
if (this.dynamicDataSourceService != null) throw new UnsupportedOperationException();
this.dynamicDataSourceService = dynamicDataSourceService;
}
@Override
public XAConnection getXAConnection() throws SQLException {
return getActiveXADataSource().getXAConnection();
}
@Override
public XAConnection getXAConnection(String user, String password) throws SQLException {
return getActiveXADataSource().getXAConnection(user, password);
}
public void close() {
try {
if (dynamicDataSourceService != null)
dynamicDataSourceService.destroyAll();
} catch (Exception e) {
logger.error("close datasource error", e);
}
}
}
| [
"zh.sqy@qq.com"
] | zh.sqy@qq.com |
8ed08d9916351e746ae2acb40480d35b2f3d10f4 | 223b8eb0c4569299fa40c559ac100dc909614de1 | /src/main/java/be/shad/tsqb/restrictions/WhereRestrictions.java | 518f896c64f426f4fb532151b583d280a0573974 | [] | no_license | YoussefArfaoui/TypeSafeQueryBuilder | 070fb78f8556bf7424779768102fc31bfc12193b | ef1d2e52337b009697a95ca79ed0c01e83d8fb98 | refs/heads/master | 2021-01-17T20:29:53.391405 | 2014-10-21T10:20:30 | 2014-10-21T10:20:30 | 25,512,535 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,439 | java | /*
* Copyright Gert Wijns gert.wijns@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package be.shad.tsqb.restrictions;
import java.util.Date;
import be.shad.tsqb.query.TypeSafeSubQuery;
import be.shad.tsqb.values.HqlQueryValue;
import be.shad.tsqb.values.TypeSafeValue;
public interface WhereRestrictions {
/**
* Adds the restrictions as 'and' to the where restrictions
*/
RestrictionChainable and(RestrictionHolder restriction, RestrictionHolder... restrictions);
/**
* Adds the restrictions as 'and' to the where restrictions
*/
RestrictionChainable or(RestrictionHolder restriction, RestrictionHolder... restrictions);
/**
* In case part of the restrictions were already built, but no reference was kept
* to the last restriction chainable, this method can be used to get the last
* one to be able to continue with 'or' on an already partially built restrictions group.
*/
RestrictionChainable where();
/**
* Adds a custom restriction as and to the existing where clause.
*/
RestrictionChainable where(HqlQueryValue restriction);
/**
* Adds a restriction group as and to the existing where clause.
*/
RestrictionChainable where(RestrictionsGroup group);
/**
* Adds a restriction as and to the existing where clause.
*/
RestrictionChainable where(Restriction restriction);
/**
* The general restrict by enum method. Anything which represents a number
* can be used with this method.
*/
<E extends Enum<E>> OnGoingEnumRestriction<E> whereEnum(TypeSafeValue<E> value);
/**
* Restrict an enum value. This can be a direct value (an actual enum value),
* or a value of a TypeSafeQueryProxy getter.
*/
<E extends Enum<E>> OnGoingEnumRestriction<E> where(E value);
/**
* The general restrict by boolean method. Anything which represents a boolean
* can be used with this method.
*/
OnGoingBooleanRestriction whereBoolean(TypeSafeValue<Boolean> value);
/**
* Restrict a boolean value. This can be a direct value (an actual boolean),
* or a value of a TypeSafeQueryProxy getter.
*/
OnGoingBooleanRestriction where(Boolean value);
/**
* The general restrict by number method. Anything which represents a number
* can be used with this method.
*/
<N extends Number> OnGoingNumberRestriction whereNumber(TypeSafeValue<N> value);
/**
* Restrict a number value. This can be a direct value (an actual number),
* or a value of a TypeSafeQueryProxy getter.
*/
OnGoingNumberRestriction where(Number value);
/**
* The general restrict by date method. Anything which represents a date
* can be used with this method.
*/
OnGoingDateRestriction whereDate(TypeSafeValue<Date> value);
/**
* Restrict a number value. This can be a direct value (an actual date),
* or a value of a TypeSafeQueryProxy getter.
*/
OnGoingDateRestriction where(Date value);
/**
* The general restrict by string method. Anything which represents a string
* can be used with this method.
*/
OnGoingTextRestriction whereString(TypeSafeValue<String> value);
/**
* Restrict a string value. This can be a direct value (an actual string),
* or a value of a TypeSafeQueryProxy getter.
*/
OnGoingTextRestriction where(String value);
/**
* Adds an exists restriction.
*/
RestrictionChainable whereExists(TypeSafeSubQuery<?> subquery);
/**
* Adds a not exists restriction.
*/
RestrictionChainable whereNotExists(TypeSafeSubQuery<?> subquery);
/**
* Restrict an object value. This can be a direct value (an actual enum value),
* or a value of a TypeSafeQueryProxy getter.
*/
<T> OnGoingObjectRestriction<T> where(TypeSafeValue<T> value);
}
| [
"gert.wijns@gmail.com"
] | gert.wijns@gmail.com |
b7dc0aa1e6ffe6e264169fc34e88f07edae8094e | b777e38032eeb6827a38f4b7e8c3f9d0167db60a | /plugin/src/net/groboclown/idea/p4ic/v2/server/cache/CentralCacheManager.java | f874da2c2a8a862d9d88ecbbe8c5741264e232b7 | [
"Apache-2.0"
] | permissive | neocrowell/p4ic4idea | d5e1db879db5293654e9add7a95d1b00f2f18c1e | 36816310e88bfdf43b79da44f5c8df08b586c681 | refs/heads/master | 2021-01-15T09:14:14.826454 | 2015-09-29T18:42:38 | 2015-09-29T18:42:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,647 | java | /*
* 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 net.groboclown.idea.p4ic.v2.server.cache;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.util.messages.MessageBusConnection;
import net.groboclown.idea.p4ic.config.*;
import net.groboclown.idea.p4ic.server.exceptions.P4InvalidConfigException;
import net.groboclown.idea.p4ic.v2.events.BaseConfigUpdatedListener;
import net.groboclown.idea.p4ic.v2.events.Events;
import net.groboclown.idea.p4ic.v2.server.cache.state.AllClientsState;
import net.groboclown.idea.p4ic.v2.server.cache.state.ClientLocalServerState;
import net.groboclown.idea.p4ic.v2.server.cache.sync.ClientCacheManager;
import net.groboclown.idea.p4ic.v2.server.connection.ProjectConfigSource;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class CentralCacheManager {
private static final Logger LOG = Logger.getInstance(CentralCacheManager.class);
private final AllClientsState allClientState;
private final MessageBusConnection messageBus;
private final Map<ClientServerId, ClientCacheManager> clientManagers = new HashMap<ClientServerId, ClientCacheManager>();
private final Lock cacheLock = new ReentrantLock();
private boolean disposed = false;
public CentralCacheManager() {
allClientState = AllClientsState.getInstance();
messageBus = ApplicationManager.getApplication().getMessageBus().connect();
Events.appBaseConfigUpdated(messageBus, new BaseConfigUpdatedListener() {
@Override
public void configUpdated(@NotNull final Project project,
@NotNull final List<ProjectConfigSource> sources) {
}
});
// FIXME use new handlers.
messageBus.subscribe(P4ClientsReloadedListener.TOPIC, new P4ClientsReloadedListener() {
@Override
public void clientsLoaded(@NotNull final Project project, @NotNull final List<Client> clients) {
if (disposed) {
return;
}
cacheLock.lock();
try {
clientManagers.clear();
// Don't create the new ones until we need it
// Also, don't remove existing cache objects.
} finally {
cacheLock.unlock();
}
}
});
// FIXME old stuff
messageBus.subscribe(P4ConfigListener.TOPIC, new P4ConfigListener() {
@Override
public void configChanges(@NotNull final Project project, @NotNull final P4Config original,
@NotNull final P4Config config) {
if (disposed) {
return;
}
ClientServerId originalId = ClientServerId.create(project, original);
ClientServerId newId = ClientServerId.create(project, config);
if (originalId != null && ! originalId.equals(newId)) {
removeCache(originalId);
}
// Don't create the new one until we need it
}
@Override
public void configurationProblem(@NotNull final Project project, @NotNull final P4Config config,
@NotNull final P4InvalidConfigException ex) {
if (disposed) {
return;
}
ClientServerId id = ClientServerId.create(project, config);
removeCache(id);
}
});
}
public void dispose() {
messageBus.disconnect();
disposed = true;
}
public boolean isDisposed() {
return disposed;
}
/**
*
* @param clientServerId client / server name
* @param config server configuration
* @param isServerCaseInsensitiveCallable if the cached version of the client is not loaded,
* this will be called to discover whether the
* Perforce server is case sensitive or not.
* Errors will be reported to the log, and the local OS
* case sensitivity will be used instead.
* @return the cache manager.
*/
@NotNull
public ClientCacheManager getClientCacheManager(@NotNull ClientServerId clientServerId, @NotNull ServerConfig config,
@NotNull Callable<Boolean> isServerCaseInsensitiveCallable) {
if (disposed) {
// Coding error; no bundled message
throw new IllegalStateException("disposed");
}
ClientCacheManager cacheManager;
cacheLock.lock();
try {
cacheManager = clientManagers.get(clientServerId);
if (cacheManager == null) {
final ClientLocalServerState state = allClientState.getStateForClient(clientServerId,
isServerCaseInsensitiveCallable);
cacheManager = new ClientCacheManager(config, state);
clientManagers.put(clientServerId, cacheManager);
}
} finally {
cacheLock.unlock();
}
return cacheManager;
}
private void removeCache(ClientServerId id) {
if (disposed) {
// Coding error; no bundled message
throw new IllegalStateException("disposed");
}
cacheLock.lock();
try {
clientManagers.remove(id);
allClientState.removeClientState(id);
} finally {
cacheLock.unlock();
}
LOG.info("Removed cached state for " + id);
}
}
| [
"matt@groboclown.net"
] | matt@groboclown.net |
8b5cb745fea0774e33159cd3975368b0bf1b0eb2 | 58f4d3de8e264d1e00d70a19caefd452f824a328 | /mc-back/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridColumn.java | 365f20dcdc4c7307350c8922e178724ce111536a | [] | no_license | ndboy2012/wechat | cad20f54aedba081d36cc5ec10664f126e0a4486 | 82367e3bf088c36a5d6373fd056eba5c798b8de5 | refs/heads/master | 2021-04-12T04:37:32.857904 | 2015-07-30T04:27:46 | 2015-07-30T11:40:44 | 37,120,698 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,307 | java | package org.jeecgframework.tag.vo.easyui;
/**
*
* 类描述:列表字段模型
*
* @author: 张代浩
* @date: 日期:2012-12-7 时间:上午10:17:45
* @version 1.0
*/
public class DataGridColumn {
protected String title;// 表格列名
protected String field;// 数据库对应字段
protected Integer width;// 宽度
protected String rowspan;// 跨列
protected String colspan;// 跨行
protected String align;// 对齐方式
protected boolean sortable;// 是否排序
protected boolean checkbox;// 是否显示复选框
protected String formatter;// 格式化函数
protected boolean hidden;// 是否隐藏
protected String treefield;//
protected boolean image;// 是否是图片
protected boolean query;// 是否查询
protected String queryMode = "single";// 字段查询模式:single单字段查询;group范围查询
protected boolean autoLoadData = true; // 列表是否自动加载数据
private boolean frozenColumn = false; // 是否是冰冻列 默认不是
protected String url;// 自定义链接
protected String funname = "openwindow";// 自定义函数名称
protected String arg;
protected String dictionary;
protected String replace;
protected String extend;
protected String style; // 列的颜色值
protected String imageSize;// 自定义图片显示大小
protected String downloadName;// 附件下载
protected boolean autocomplete;// 自动补全
protected String extendParams;// 扩展参数,easyui有的,但是jeecg没有的参数进行扩展
protected String imgBasePath;
protected String formatRow;
public String getDownloadName() {
return downloadName;
}
public void setDownloadName(String downloadName) {
this.downloadName = downloadName;
}
public String getImageSize() {
return imageSize;
}
public void setImageSize(String imageSize) {
this.imageSize = imageSize;
}
public boolean isQuery() {
return query;
}
public String getArg() {
return arg;
}
public void setArg(String arg) {
this.arg = arg;
}
public void setQuery(boolean query) {
this.query = query;
}
public boolean isImage() {
return image;
}
public void setImage(boolean image) {
this.image = image;
}
public String getTreefield() {
return treefield;
}
public void setTreefield(String treefield) {
this.treefield = treefield;
}
public void setTitle(String title) {
this.title = title;
}
public void setField(String field) {
this.field = field;
}
public void setWidth(Integer width) {
this.width = width;
}
public void setRowspan(String rowspan) {
this.rowspan = rowspan;
}
public void setColspan(String colspan) {
this.colspan = colspan;
}
public void setAlign(String align) {
this.align = align;
}
public void setSortable(boolean sortable) {
this.sortable = sortable;
}
public void setCheckbox(boolean checkbox) {
this.checkbox = checkbox;
}
public void setFormatter(String formatter) {
this.formatter = formatter;
}
public boolean isHidden() {
return hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
public String getTitle() {
return title;
}
public String getField() {
return field;
}
public Integer getWidth() {
return width;
}
public String getRowspan() {
return rowspan;
}
public String getColspan() {
return colspan;
}
public String getAlign() {
return align;
}
public boolean isSortable() {
return sortable;
}
public boolean isCheckbox() {
return checkbox;
}
public String getFormatter() {
return formatter;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getFunname() {
return funname;
}
public void setFunname(String funname) {
this.funname = funname;
}
public String getDictionary() {
return dictionary;
}
public void setDictionary(String dictionary) {
this.dictionary = dictionary;
}
public String getQueryMode() {
return queryMode;
}
public void setQueryMode(String queryMode) {
this.queryMode = queryMode;
}
public String getReplace() {
return replace;
}
public void setReplace(String replace) {
this.replace = replace;
}
public boolean isAutoLoadData() {
return autoLoadData;
}
public void setAutoLoadData(boolean autoLoadData) {
this.autoLoadData = autoLoadData;
}
public boolean isFrozenColumn() {
return frozenColumn;
}
public void setFrozenColumn(boolean frozenColumn) {
this.frozenColumn = frozenColumn;
}
public String getExtend() {
return extend;
}
public void setExtend(String extend) {
this.extend = extend;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public boolean isAutocomplete() {
return autocomplete;
}
public void setAutocomplete(boolean autocomplete) {
this.autocomplete = autocomplete;
}
public String getExtendParams() {
return extendParams;
}
public void setExtendParams(String extendParams) {
this.extendParams = extendParams;
}
public String getImgBasePath() {
return imgBasePath;
}
public void setImgBasePath(String imgBasePath) {
this.imgBasePath = imgBasePath;
}
public String getFormatRow() {
return formatRow;
}
public void setFormatRow(String formatRow) {
this.formatRow = formatRow;
}
}
| [
"yelp1022@163.com"
] | yelp1022@163.com |
425fb460ec8ae977140e6df515b16480859b54fd | 97734b7675c7bb24468c9fe4b7917540ce9a65db | /app/src/main/java/com/zhejiang/haoxiadan/third/wheelview/WheelAdapter.java | a18f4393edb8540c0a5f0daca9ee371cea4ca21e | [] | no_license | yangyuqi/android_hxd | 303db8bba4f4419c0792dbcfdd973e1a5165e09a | f02cb1c7c625c5f6eaa656d03a82c7459ff4a9a1 | refs/heads/master | 2020-04-13T03:47:59.651505 | 2018-12-24T03:06:34 | 2018-12-24T03:06:34 | 162,942,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,244 | java | /*
* Copyright 2010 Yuri Kanivets
*
* 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.zhejiang.haoxiadan.third.wheelview;
/**
* Wheel adapter interface
*
* @deprecated Use WheelViewAdapter
*/
public interface WheelAdapter {
/**
* Gets items count
* @return the count of wheel items
*/
public int getItemsCount();
/**
* Gets a wheel item by index.
*
* @param index the item index
* @return the wheel item text or null
*/
public String getItem(int index);
/**
* Gets maximum item length. It is used to determine the wheel width.
* If -1 is returned there will be used the default wheel width.
*
* @return the maximum item length or -1
*/
public int getMaximumLength();
}
| [
"yuqi.yang@ughen.com"
] | yuqi.yang@ughen.com |
125b2d429a5436a4a1bd433446745942c9c987a2 | e89d45f9e6831afc054468cc7a6ec675867cd3d7 | /src/main/java/com/microsoft/graph/requests/extensions/IAppVulnerabilityManagedDeviceCollectionPage.java | efcad51a1bf311c64b8acf5bcd7164281db6e6c1 | [
"MIT"
] | permissive | isabella232/msgraph-beta-sdk-java | 67d3b9251317f04a465042d273fe533ef1ace13e | 7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8 | refs/heads/dev | 2023-03-12T05:44:24.349020 | 2020-11-19T15:51:17 | 2020-11-19T15:51:17 | 318,158,544 | 0 | 0 | MIT | 2021-02-23T20:48:09 | 2020-12-03T10:37:46 | null | UTF-8 | Java | false | false | 1,251 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.extensions;
import com.microsoft.graph.http.IRequestBuilder;
import com.microsoft.graph.core.ClientException;
import com.microsoft.graph.concurrency.ICallback;
import com.microsoft.graph.models.extensions.AppVulnerabilityTask;
import com.microsoft.graph.models.extensions.AppVulnerabilityManagedDevice;
import java.util.Arrays;
import java.util.EnumSet;
import com.google.gson.JsonObject;
import com.microsoft.graph.requests.extensions.IAppVulnerabilityManagedDeviceCollectionRequestBuilder;
import com.microsoft.graph.http.IBaseCollectionPage;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The interface for the App Vulnerability Managed Device Collection Page.
*/
public interface IAppVulnerabilityManagedDeviceCollectionPage extends IBaseCollectionPage<AppVulnerabilityManagedDevice, IAppVulnerabilityManagedDeviceCollectionRequestBuilder> {
}
| [
"GraphTooling@service.microsoft.com"
] | GraphTooling@service.microsoft.com |
18c06f384c4bff7638046728a5fc6a15b3623ae6 | 0c0421c28782fb221e7a829d069c4429afb8ea63 | /CornerRibbonLabel/src/java/example/MainPanel.java | 0ab62172b775ff5424b95f68e0f69a4852a5121d | [
"MIT"
] | permissive | lordofthemind/java-swing-tips | 6472ac184bf6930cc3bc53d143ff18104de27940 | 869772629df0750b285730728309b0d06ebfd480 | refs/heads/master | 2023-03-06T22:16:19.593165 | 2021-02-21T23:37:33 | 2021-02-21T23:37:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,179 | java | // -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@
package example;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.util.stream.Stream;
import javax.swing.*;
public final class MainPanel extends JPanel {
private MainPanel() {
super(new FlowLayout(FlowLayout.CENTER, 50, 50));
Icon informationIcon = UIManager.getIcon("OptionPane.informationIcon");
Icon errorIcon = UIManager.getIcon("OptionPane.errorIcon");
Icon questionIcon = UIManager.getIcon("OptionPane.questionIcon");
Icon warningIcon = UIManager.getIcon("OptionPane.warningIcon");
BadgeLabel error = new BadgeLabel(errorIcon);
BadgeLabel error1 = new BadgeLabel(errorIcon, "beta");
// error1.setText("default");
BadgeLabel question = new BadgeLabel(questionIcon, "RC1");
BadgeLabel warning = new BadgeLabel(warningIcon, "beta");
BadgeLabel information = new BadgeLabel(informationIcon, "alpha");
BadgeLabel information2 = new BadgeLabel(informationIcon, "RC2");
Stream.of(error, error1, question, warning, information, information2).forEach(this::add);
setPreferredSize(new Dimension(320, 240));
}
public static void main(String[] args) {
EventQueue.invokeLater(MainPanel::createAndShowGui);
}
private static void createAndShowGui() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
ex.printStackTrace();
Toolkit.getDefaultToolkit().beep();
}
JFrame frame = new JFrame("@title@");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.getContentPane().add(new MainPanel());
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
class BadgeLabel extends JLabel {
private final Color ribbonColor = new Color(0xAA_FF_64_00, true);
private final String ribbonText;
protected BadgeLabel(Icon image) {
super(image);
this.ribbonText = null;
}
protected BadgeLabel(Icon image, String ribbonText) {
super(image);
this.ribbonText = ribbonText;
}
@Override public void updateUI() {
super.updateUI();
setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
setVerticalAlignment(SwingConstants.CENTER);
setVerticalTextPosition(SwingConstants.BOTTOM);
setHorizontalAlignment(SwingConstants.CENTER);
setHorizontalTextPosition(SwingConstants.CENTER);
}
@Override protected void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D) g.create();
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setPaint(Color.WHITE);
g2.fill(getShape());
super.paintComponent(g);
if (ribbonText != null) {
Dimension d = getSize();
float fontSize = 10f;
int cx = (d.width - (int) fontSize) / 2;
double theta = Math.toRadians(45d);
Font font = g2.getFont().deriveFont(fontSize);
g2.setFont(font);
FontRenderContext frc = new FontRenderContext(null, true, true);
Shape ribbon = new Rectangle2D.Double(cx, -fontSize, d.width, fontSize);
AffineTransform at = AffineTransform.getRotateInstance(theta, cx, 0);
g2.setPaint(ribbonColor);
g2.fill(at.createTransformedShape(ribbon));
TextLayout tl = new TextLayout(ribbonText, font, frc);
g2.setPaint(Color.WHITE);
Rectangle2D r = tl.getOutline(null).getBounds2D();
double dx = cx + (d.width - cx) / Math.sqrt(2d) - r.getWidth() / 2d;
double dy = fontSize / 2d + r.getY();
Shape s = tl.getOutline(AffineTransform.getTranslateInstance(dx, dy));
g2.fill(at.createTransformedShape(s));
}
g2.dispose();
}
@Override public boolean isOpaque() {
return false;
}
protected Shape getShape() {
Dimension d = getSize();
double r = d.width / 2d;
return new RoundRectangle2D.Double(0d, 0d, d.width - 1d, d.height - 1d, r, r);
}
}
| [
"aterai@outlook.com"
] | aterai@outlook.com |
2a61d977574d8bbb4e202c188972d1dd9847372f | f96cb994a5e56a01bba412c79b07a3b0cbd3d390 | /exdos/exdos-frontend/src/main/java/com/gl/extrade/spec/dto/FrontendTradeRequest.java | a7cd34d12bbb5291e26d0f4036cf31c47aef0319 | [] | no_license | gavin2lee/incubator2 | 1f0bf22da822b234418d27050c81b6c0ce445844 | 08f6d4b262119b2f07ef312daea1d7d1717f7abb | refs/heads/master | 2021-08-15T23:37:28.107987 | 2017-11-18T15:45:29 | 2017-11-18T15:45:29 | 106,685,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 182 | java | package com.gl.extrade.spec.dto;
public class FrontendTradeRequest extends TradeRequest {
/**
*
*/
private static final long serialVersionUID = 1L;
}
| [
"gavin2lee@163.com"
] | gavin2lee@163.com |
8418fb807798dc908a3b836f0e7041da520b0381 | f321db1ace514d08219cc9ba5089ebcfff13c87a | /generated-tests/random/tests/s7/7_okhttp/evosuite-tests/okhttp3/internal/tls/DistinguishedNameParser_ESTest_scaffolding.java | 3e05907d83f8cb5c05c933cd6514546e728be134 | [] | no_license | sealuzh/dynamic-performance-replication | 01bd512bde9d591ea9afa326968b35123aec6d78 | f89b4dd1143de282cd590311f0315f59c9c7143a | refs/heads/master | 2021-07-12T06:09:46.990436 | 2020-06-05T09:44:56 | 2020-06-05T09:44:56 | 146,285,168 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,861 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Mar 22 15:25:17 GMT 2019
*/
package okhttp3.internal.tls;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class DistinguishedNameParser_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "okhttp3.internal.tls.DistinguishedNameParser";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("user.dir", "/home/apaniche/performance/Dataset/gordon_scripts/projects/7_okhttp");
java.lang.System.setProperty("java.io.tmpdir", "/tmp");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DistinguishedNameParser_ESTest_scaffolding.class.getClassLoader() ,
"okhttp3.internal.tls.DistinguishedNameParser"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(DistinguishedNameParser_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"okhttp3.internal.tls.DistinguishedNameParser"
);
}
}
| [
"granogiovanni90@gmail.com"
] | granogiovanni90@gmail.com |
f8a1236755d9bfe781bcc45dd91e2204ece11f5f | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/441cf9171e11dac2c245d5e5558cf5be0e1a3bf9/after/GroovyTypeDefinitionItemPresentation.java | c7ff5822c01d0328b5a04a2cb5ad299e3d46a539 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 714 | java | package org.jetbrains.plugins.groovy.structure.itemsPresentations.impl;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
import org.jetbrains.plugins.groovy.structure.GroovyElementPresentation;
import org.jetbrains.plugins.groovy.structure.itemsPresentations.GroovyItemPresentation;
/**
* User: Dmitry.Krasilschikov
* Date: 30.10.2007
*/
public class GroovyTypeDefinitionItemPresentation extends GroovyItemPresentation {
public GroovyTypeDefinitionItemPresentation(GrTypeDefinition myElement) {
super(myElement);
}
public String getPresentableText() {
return GroovyElementPresentation.getTypeDefinitionPresentableText((GrTypeDefinition) myElement);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
3beabdde104c1d3d7fea91bf1dc88281dae00b15 | a8fe6fe19686b08b14ab3b5523584b4518085f00 | /com/advent/oc/domain/model/MarketValueRankedRebalance.java | 7e7f087247dcb084262adc06e42472e18ac316d9 | [] | no_license | daweng/ocdomain | efa0dfbe6c7b9aa88ac8e513f7605f7bdf5e3c6c | d3209b9ce26f3d240e5e25d91da9c40fa774619e | refs/heads/master | 2021-01-17T08:28:39.841281 | 2016-06-07T23:22:40 | 2016-06-07T23:22:40 | 60,638,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,851 | java | package com.advent.oc.domain.model;
import com.advent.oc.domain.core.*;
import com.advent.oc.base.BaseEntity;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.UUID;
import java.util.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
public class MarketValueRankedRebalance extends RebalanceInstructions
{
protected UUID targetId;
protected UUID toleranceId;
protected UUID rankId;
public MarketValueRankedRebalance(){
super();
}
public MarketValueRankedRebalance(UUID id, String extId, Short sourceId , UUID targetId, UUID toleranceId, UUID rankId
, UUID modelReferenceId
) {
this.id = id;
this.extId = extId;
this.sourceId = sourceId;
this.targetId = targetId;
this.toleranceId = toleranceId;
this.rankId = rankId;
this.modelReferenceId = modelReferenceId;
}
public UUID getTargetId() {
return this.targetId;
}
public void setTargetId(UUID targetId) {
this.targetId = targetId;
}
public UUID getToleranceId() {
return this.toleranceId;
}
public void setToleranceId(UUID toleranceId) {
this.toleranceId = toleranceId;
}
public UUID getRankId() {
return this.rankId;
}
public void setRankId(UUID rankId) {
this.rankId = rankId;
}
@Override
public String toString() {
return "MarketValueRankedRebalance{" +
"Id=" + id +
", extId='" + extId + '\'' +
", sourceId=" + sourceId +
", lastModified=" + lastModified +
", targetId='" + targetId + '\'' +
", toleranceId='" + toleranceId + '\'' +
", rankId='" + rankId + '\'' +
super.toString() +
'}';
}
}
| [
"help@genmymodel.com"
] | help@genmymodel.com |
8aeb0c0f17338c16196ae94eb9d95fba984595ca | 0444b9e1ccafb89e2133a90e1cbf5b5ce7691e83 | /src/main/java/kfs/mailingservice/dao/jpa/JpaMailTemplateDao.java | 7638cc6d97700dfb98d5c630ba9b3af74d0ccea2 | [] | no_license | k0fis/KfsMailingService | 318a3f83bebb953b30ebe5fcb93cc0998b548754 | d28cb6977465098e93a6fdd5bd1f034a9aa391ca | refs/heads/master | 2021-01-10T20:49:19.542984 | 2015-10-01T07:26:16 | 2015-10-01T07:26:16 | 42,913,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,324 | java | package kfs.mailingservice.dao.jpa;
import java.util.List;
import javax.persistence.NoResultException;
import kfs.mailingservice.dao.MailTemplateDao;
import kfs.mailingservice.domain.MailTemplate;
import kfs.springutils.BaseDaoJpa;
import org.springframework.stereotype.Repository;
/**
*
* @author pavedrim
*/
@Repository
public class JpaMailTemplateDao extends BaseDaoJpa<MailTemplate, Long> implements MailTemplateDao {
@Override
protected Class<MailTemplate> getDataClass() {
return MailTemplate.class;
}
@Override
protected Long getId(MailTemplate data) {
return data.getId();
}
@Override
public MailTemplate findFull(MailTemplate mt) {
MailTemplate ret = find(mt);
ret.getCcList().size();
return ret;
}
@Override
public MailTemplate findByName(String name) {
try {
return (MailTemplate) em.createQuery("select mt from MailTemplate mt where mt.name = :name")
.setParameter("name", name)
.getSingleResult();
} catch (NoResultException ex) {
return null;
}
}
@Override
public List<MailTemplate> load() {
return em.createQuery("select mt from MailTemplate mt ORDER BY mt.name")
.getResultList();
}
}
| [
"k0fis@me.com"
] | k0fis@me.com |
b7c78a6cc39d293c3f007bc1091460d78b43965d | 96d06bfbeff740f661e7ef409183f348f551a414 | /leopard-lang-parent/leopard-servlet/src/main/java/io/leopard/web/servlet/RegisterHandlerInterceptor.java | fbeaad56ce840d3bb34729c11118bae04fe99181 | [
"Apache-2.0"
] | permissive | cuidd2018/leopard | 135648152202f00b405af1f0039f3dd95ee1689c | bcc6c394d5a7246384c666f94ac3c5e494e777a3 | refs/heads/master | 2021-09-22T11:11:37.093267 | 2018-09-09T05:24:19 | 2018-09-09T05:24:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,443 | java | package io.leopard.web.servlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.BeansException;
import org.springframework.beans.Mergeable;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
//TODO ahai 在site项目必须实现BeanPostProcessor接口才能成功配置拦截器.
public abstract class RegisterHandlerInterceptor implements HandlerInterceptor, BeanFactoryAware, BeanPostProcessor, Mergeable {
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
}
protected boolean isHandlerMapping(BeanDefinition beanDefinition) {
String beanClassName = beanDefinition.getBeanClassName();
if (beanClassName == null) {
// throw new NullPointerException("beanDefinition:" + beanDefinition);
return false;
}
Class<?> clazz;
try {
clazz = Class.forName(beanClassName);
}
catch (NoClassDefFoundError e) {
e.printStackTrace();
return false;
}
catch (ClassNotFoundException e) {
return false;
}
if (RequestMappingHandlerMapping.class.isAssignableFrom(clazz)) {
return true;
}
return false;
}
/**
* 是否注册.
*
* @return
*/
protected boolean isRegister() {
return true;
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
if (!this.isRegister()) {
return;
}
ConfigurableListableBeanFactory factory = ((ConfigurableListableBeanFactory) beanFactory);
for (String beanName : factory.getBeanDefinitionNames()) {
BeanDefinition beanDefinition = factory.getBeanDefinition(beanName);
boolean isHandlerMapping = isHandlerMapping(beanDefinition);
if (isHandlerMapping) {
// System.out.println("setBeanFactory postProcessBeanFactory BeanClassName:" + beanDefinition.getBeanClassName() + " class:" + this.getClass().getName());
MutablePropertyValues propertyValues = beanDefinition.getPropertyValues();
propertyValues.addPropertyValue("interceptors", this);
}
}
}
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@Override
public boolean isMergeEnabled() {
return true;
}
@Override
public Object merge(Object parent) {
if (parent instanceof Object[]) {
Object[] interceptors = (Object[]) parent;
Object[] args = new Object[interceptors.length + 1];
System.arraycopy(interceptors, 0, args, 1, interceptors.length);
args[0] = this;
return args;
}
else {
return new Object[] { this, parent };
}
}
}
| [
"tanhaichao@gmail.com"
] | tanhaichao@gmail.com |
a4c40b2dc3b42b41ca4c74a5e1992efd4a50c7e7 | 9cd45a02087dac52ea4d39a0c17e525c11a8ed97 | /src/java/com/tapjoy/internal/cs.java | 055c6d89303adae6384ea2abede3156832054e3e | [] | no_license | abhijeetvaidya24/INFO-NDVaidya | fffb90b8cb4478399753e3c13c4813e7e67aea19 | 64d69250163e2d8d165e8541aec75b818c2d21c5 | refs/heads/master | 2022-11-29T16:03:21.503079 | 2020-08-12T06:00:59 | 2020-08-12T06:00:59 | 286,928,296 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | /*
* Decompiled with CFR 0.0.
*
* Could not load the following classes:
* java.lang.NullPointerException
* java.lang.Object
*/
package com.tapjoy.internal;
public final class cs {
public static Object a(Object object) {
if (object != null) {
return object;
}
throw new NullPointerException();
}
}
| [
"abhijeetvaidya24@gmail.com"
] | abhijeetvaidya24@gmail.com |
17f577740b86fbe72fe09699f70979c57400317a | 1f2889bb822520b08b2f6752b9c7da0e466d1643 | /src/resource/VO/Stock.java | 9366d1a43fbab4c58d8fc762c0e6e926cd09d37b | [] | no_license | crspeed/javaDesignPattern | 4fb4ca284e8709c954751949720bb4fe7fe19b47 | 5352ccbff262e87dafb9d23f468cd5dd439497a8 | refs/heads/master | 2020-04-01T17:36:38.420953 | 2018-11-20T12:23:35 | 2018-11-20T12:23:35 | 153,439,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package resource.VO;
public class Stock {
private String name = "ABC";
private int quantity = 10;
public void buy(){
System.out.println("Stock [ Name:"+name+", Quantity:"+quantity+"]bought");
}
public void sell(){
System.out.println("Stock [ Name: "+name+", Quantity: " + quantity +" ] sold");
}
}
| [
"you@example.com"
] | you@example.com |
f1165a6c2842160fdbe2bbd2cde3c2849aec8b67 | c04e424a5282b06598fe2d6f689f69b2bcf00786 | /isap-dao/src/main/java/com/gosun/isap/dao/mapper/face/OriganizesMapper.java | 82134ffe73912c3cd0b558462d6bc0a490e5c022 | [] | no_license | soon14/isap-parent | 859d9c0d4adc0e7d60f92a537769b237c1c5095b | 2f6c1ec4e635e08eab57d4df4c92e90e4e09e044 | refs/heads/master | 2021-12-15T03:09:00.641560 | 2017-07-26T02:13:40 | 2017-07-26T02:13:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 913 | java | package com.gosun.isap.dao.mapper.face;
import com.gosun.isap.dao.po.face.Origanizes;
import com.gosun.isap.dao.po.face.OriganizesExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OriganizesMapper {
int countByExample(OriganizesExample example);
int deleteByExample(OriganizesExample example);
int deleteByPrimaryKey(Integer id);
int insert(Origanizes record);
int insertSelective(Origanizes record);
List<Origanizes> selectByExample(OriganizesExample example);
Origanizes selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") Origanizes record, @Param("example") OriganizesExample example);
int updateByExample(@Param("record") Origanizes record, @Param("example") OriganizesExample example);
int updateByPrimaryKeySelective(Origanizes record);
int updateByPrimaryKey(Origanizes record);
} | [
"lzk90s@163.com"
] | lzk90s@163.com |
5d99594f0dc991563b666ce813d0765479dad3f3 | 2e96aafbdea2fb683e3cffd9b906a89402c0227e | /mcr-test/src/main/java/edu/tamu/aser/tests/bufwriter/BufWriter.java | b4c41f27b2a23b807f5ed358940fd761171a3922 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"MIT",
"NCSA",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | phantomDai/CMTJmcr | b439db17411c05e745ac98b07b037c168b02a008 | 56c91914a6aa0500ff89e71381a66ecd2bfa63ed | refs/heads/master | 2023-05-11T16:17:58.057163 | 2023-05-04T12:21:34 | 2023-05-04T12:21:34 | 323,773,780 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,496 | java | package edu.tamu.aser.tests.bufwriter;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2003
* Company:
* @author
* @version 1.0
*/
import edu.tamu.aser.reex.JUnit4MCRRunner;
import edu.tamu.aser.tests.counter.Counter;
import log.RecordTimeInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.*;
import java.util.*;
import static org.junit.Assert.fail;
@RunWith(JUnit4MCRRunner.class)
public class BufWriter extends Thread {
public static void main (String[] args)
{
args = new String[]{"/Users/phantom/javaDir/CMTJmcr/output/output", "little"};
Buffer buf = new Buffer(1000);
File outFile;
Thread[] wr;
int threadNum = 2,res;
Checker checker = new Checker (buf);
Thread tCheck = new Thread(checker);
FileOutputStream outF;
Random rGen = new Random();
double noSyncProbability = 0.1;
//Output file creation
if (args.length > 0)
outFile = new File(args[0]);
else return;
//Optional concurrency parameter
if (args.length > 1)
{
if (args[1].equalsIgnoreCase("little")) threadNum = 2;
if (args[1].equalsIgnoreCase("average")) threadNum = 5;
if (args[1].equalsIgnoreCase("lot")) threadNum = 10;
}
//Thread array creation
wr = new Thread [threadNum];
//Threads creation
for (int i=0;i<threadNum;i++)
{
if (rGen.nextDouble()> noSyncProbability + 1)
wr[i] = new Thread(new SyncWriter(buf,i+1));
else
wr[i] = new Thread(new Writer(buf,i+1));
}
// Checker thread starting
tCheck.start();
//Output stream creation
try{
outF = new FileOutputStream(outFile);
}
catch (FileNotFoundException e) {return;}
DataOutputStream outStream = new DataOutputStream(outF);
//Starting threads ...
for (int i=0;i<threadNum;i++)
{
wr[i].start();
}
try{
wr[0].join();
wr[1].join();
} catch (InterruptedException e) {
e.printStackTrace();
}
////Let them work ...
// try {
// sleep (10);
// }
// catch (InterruptedException e) {}
//
////Stopping threads ...
// for (int i=0;i<threadNum;i++)
// {
// wr[i].stop();
// }
//Stopping checker thread
tCheck.stop();
//Outputting results ...
try
{
res = buf._count - (checker.getWrittenCount()+buf._pos);
outStream.writeChars("<BufWriter,");
outStream.writeChars(res+",");
if (res != 0)
outStream.writeChars("[Wrong/No-Lock]>");
else
outStream.writeChars("[None]>");
outStream.close();
}
catch (IOException e) {}
return;
}
@Test
public void test(){
// RecordTimeInfo.recordInfo("BufWriter", "记录原始测试用例生成和执行的时间:",true);
for (int i = 0; i < 1; i++) {
long start = System.currentTimeMillis();
try {
BufWriter.main(new String[]{"/Users/phantom/javaDir/CMTJmcr/output/output", "little"});
} catch (Exception e) {
System.out.println("here");
fail();
}
long end = System.currentTimeMillis();
String timeInfo = "执行原始测试用例的时间为:" + (end - start);
if (i != 29){
RecordTimeInfo.recordInfo("BufWriter", timeInfo, true);
}else {
RecordTimeInfo.recordInfo("BufWriter", timeInfo, true);
}
}
// BufWriter.main(new String[]{"/Users/phantom/javaDir/CMTJmcr/output/output", "little"});
}
} | [
"daihepeng@sina.cn"
] | daihepeng@sina.cn |
0112a96c4831e5b7ebb396aad91bfcb516439559 | fd7679e033d5cb8242761b7fb5ba1c7cba3d5a46 | /core/src/java/com/robonobo/midas/client/PutStreamRequest.java | adad4f8369b5951bed8279bc0e08fd0b920202be | [] | no_license | macavity23/robonobo | a70e33232c5767b8350dcd80570b0c12d4dd4f13 | 080da6833e9d61dd8c26f7742307ce44ec2e9015 | refs/heads/master | 2020-05-26T06:53:01.208890 | 2011-11-04T11:51:39 | 2011-11-04T11:51:39 | 1,431,931 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,208 | java | package com.robonobo.midas.client;
import java.util.Collection;
import java.util.Stack;
import com.robonobo.core.api.model.Stream;
import com.robonobo.core.metadata.StreamCallback;
import com.robonobo.midas.client.Params.Operation;
public class PutStreamRequest implements Request {
MidasClientConfig cfg;
StreamCallback handler;
Stack<Stream> streams = new Stack<Stream>();
public PutStreamRequest(MidasClientConfig cfg, Collection<Stream> streams, StreamCallback handler) {
this.cfg = cfg;
this.handler = handler;
this.streams.addAll(streams);
}
public PutStreamRequest(MidasClientConfig cfg, Stream s, StreamCallback handler) {
this.cfg = cfg;
this.handler = handler;
this.streams.add(s);
}
@Override
public Params getNextParams() {
Stream s = streams.pop();
return new Params(Operation.Put, s.toMsg(), null, cfg.getStreamUrl(s.getStreamId()), s);
}
@Override
public int remaining() {
return streams.size();
}
@Override
public void success(Object obj) {
if(handler != null)
handler.success(null);
}
@Override
public void error(Params p, Exception e) {
if (handler != null) {
Stream s = (Stream) p.obj;
handler.error(s.getStreamId(), e);
}
}
}
| [
"macavity@well.com"
] | macavity@well.com |
443c53889a892de813830212e2b1893591ca5b5a | d7dab538d6fc5390c5160c28f5c8231834c0a406 | /src/main/java/gov/nist/javax/sip/message/MultipartMimeContent.java | 9caa131a1fbf05a6fc064c7a698dcfc6de00f4dd | [
"Apache-2.0"
] | permissive | fhg-fokus-nubomedia/nubomedia-ims-connector | 037cbcc11c2f053fc3c159b3c53735dcc27fdcaf | a6dac8810f779c75351355cdd03933fedf07a99a | refs/heads/master | 2020-04-06T06:42:11.608858 | 2016-07-29T12:40:34 | 2016-07-29T12:40:34 | 49,443,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 960 | java | package gov.nist.javax.sip.message;
import java.util.Iterator;
import java.util.List;
import javax.sip.header.ContentTypeHeader;
public interface MultipartMimeContent {
public abstract boolean add(Content content);
/**
* Return the Content type header to assign to the outgoing sip meassage.
*
* @return
*/
public abstract ContentTypeHeader getContentTypeHeader();
public abstract String toString();
/**
* Set the content by its type.
*
* @param content
*/
public abstract void addContent( Content content);
/**
* Retrieve the list of Content that is part of this MultitypeMime content.
*
* @return - the content iterator. Returns an empty iterator if no content list present.
*/
public Iterator getContents();
/**
* Get the number of Content parts.
*
* @return - the content parts.
*/
public int getContentCount();
}
| [
"alice.cheambe@fokus.fraunhofer.de"
] | alice.cheambe@fokus.fraunhofer.de |
84aca1a8d5d98fc81eeab9bf7cbe44aff9118771 | 45736204805554b2d13f1805e47eb369a8e16ec3 | /net/minecraft/dispenser/BehaviorDefaultDispenseItem.java | 43973974b126200653ee374a825b28ef68174bed | [] | no_license | KrOySi/ArchWare-Source | 9afc6bfcb1d642d2da97604ddfed8048667e81fd | 46cdf10af07341b26bfa704886299d80296320c2 | refs/heads/main | 2022-07-30T02:54:33.192997 | 2021-08-08T23:36:39 | 2021-08-08T23:36:39 | 394,089,144 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,681 | java | /*
* Decompiled with CFR 0.150.
*/
package net.minecraft.dispenser;
import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.IBehaviorDispenseItem;
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.dispenser.IPosition;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
public class BehaviorDefaultDispenseItem
implements IBehaviorDispenseItem {
@Override
public final ItemStack dispense(IBlockSource source, ItemStack stack) {
ItemStack itemstack = this.dispenseStack(source, stack);
this.playDispenseSound(source);
this.spawnDispenseParticles(source, source.getBlockState().getValue(BlockDispenser.FACING));
return itemstack;
}
protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
EnumFacing enumfacing = source.getBlockState().getValue(BlockDispenser.FACING);
IPosition iposition = BlockDispenser.getDispensePosition(source);
ItemStack itemstack = stack.splitStack(1);
BehaviorDefaultDispenseItem.doDispense(source.getWorld(), itemstack, 6, enumfacing, iposition);
return stack;
}
public static void doDispense(World worldIn, ItemStack stack, int speed, EnumFacing facing, IPosition position) {
double d0 = position.getX();
double d1 = position.getY();
double d2 = position.getZ();
d1 = facing.getAxis() == EnumFacing.Axis.Y ? (d1 -= 0.125) : (d1 -= 0.15625);
EntityItem entityitem = new EntityItem(worldIn, d0, d1, d2, stack);
double d3 = worldIn.rand.nextDouble() * 0.1 + 0.2;
entityitem.motionX = (double)facing.getFrontOffsetX() * d3;
entityitem.motionY = 0.2f;
entityitem.motionZ = (double)facing.getFrontOffsetZ() * d3;
entityitem.motionX += worldIn.rand.nextGaussian() * (double)0.0075f * (double)speed;
entityitem.motionY += worldIn.rand.nextGaussian() * (double)0.0075f * (double)speed;
entityitem.motionZ += worldIn.rand.nextGaussian() * (double)0.0075f * (double)speed;
worldIn.spawnEntityInWorld(entityitem);
}
protected void playDispenseSound(IBlockSource source) {
source.getWorld().playEvent(1000, source.getBlockPos(), 0);
}
protected void spawnDispenseParticles(IBlockSource source, EnumFacing facingIn) {
source.getWorld().playEvent(2000, source.getBlockPos(), this.getWorldEventDataFrom(facingIn));
}
private int getWorldEventDataFrom(EnumFacing facingIn) {
return facingIn.getFrontOffsetX() + 1 + (facingIn.getFrontOffsetZ() + 1) * 3;
}
}
| [
"67242784+KrOySi@users.noreply.github.com"
] | 67242784+KrOySi@users.noreply.github.com |
043335e9ef7c8d0e2eca3382b4bee6fb0668be75 | 6e60b850d6af5653adb786560ab80f273c042b3a | /java/org/apache/catalina/util/LifecycleMBeanBase.java | edba79093f1784955b29d70723bcbd023f9f59e6 | [
"Apache-2.0",
"CDDL-1.0",
"bzip2-1.0.6",
"CPL-1.0",
"Zlib",
"EPL-1.0",
"LicenseRef-scancode-unknown-license-reference",
"LZMA-exception"
] | permissive | WangXinW/apache-tomcat-8.5.45-src | da2f2f91197c62a392dc2e761dbcaa029d9e8c6c | 86b9fc7bb9b3e3e853812a88601a27fb2957707f | refs/heads/master | 2022-02-03T18:08:57.786829 | 2019-09-19T11:00:55 | 2019-09-19T11:00:55 | 209,529,706 | 0 | 0 | Apache-2.0 | 2022-01-21T23:39:45 | 2019-09-19T10:50:40 | Java | UTF-8 | Java | false | false | 7,785 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.catalina.util;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanRegistrationException;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import org.apache.catalina.Globals;
import org.apache.catalina.JmxEnabled;
import org.apache.catalina.LifecycleException;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.modeler.Registry;
import org.apache.tomcat.util.res.StringManager;
public abstract class LifecycleMBeanBase extends LifecycleBase
implements JmxEnabled {
private static final Log log = LogFactory.getLog(LifecycleMBeanBase.class);
private static final StringManager sm =
StringManager.getManager("org.apache.catalina.util");
/* Cache components of the MBean registration. */
private String domain = null;
private ObjectName oname = null;
protected MBeanServer mserver = null;
/**
* Sub-classes wishing to perform additional initialization should override
* this method, ensuring that super.initInternal() is the first call in the
* overriding method.
*/
@Override
protected void initInternal() throws LifecycleException {
// If oname is not null then registration has already happened via
// preRegister().
if (oname == null) {
mserver = Registry.getRegistry(null, null).getMBeanServer();
oname = register(this, getObjectNameKeyProperties());
}
}
/**
* Sub-classes wishing to perform additional clean-up should override this
* method, ensuring that super.destroyInternal() is the last call in the
* overriding method.
*/
@Override
protected void destroyInternal() throws LifecycleException {
unregister(oname);
}
/**
* Specify the domain under which this component should be registered. Used
* with components that cannot (easily) navigate the component hierarchy to
* determine the correct domain to use.
*/
@Override
public final void setDomain(String domain) {
this.domain = domain;
}
/**
* Obtain the domain under which this component will be / has been
* registered.
*/
@Override
public final String getDomain() {
if (domain == null) {
domain = getDomainInternal();
}
if (domain == null) {
domain = Globals.DEFAULT_MBEAN_DOMAIN;
}
return domain;
}
/**
* Method implemented by sub-classes to identify the domain in which MBeans
* should be registered.
*
* @return The name of the domain to use to register MBeans.
*/
protected abstract String getDomainInternal();
/**
* Obtain the name under which this component has been registered with JMX.
*/
@Override
public final ObjectName getObjectName() {
return oname;
}
/**
* Allow sub-classes to specify the key properties component of the
* {@link ObjectName} that will be used to register this component.
*
* @return The string representation of the key properties component of the
* desired {@link ObjectName}
*/
protected abstract String getObjectNameKeyProperties();
/**
* Utility method to enable sub-classes to easily register additional
* components that don't implement {@link JmxEnabled} with an MBean server.
* <br>
* Note: This method should only be used once {@link #initInternal()} has
* been called and before {@link #destroyInternal()} has been called.
*
* @param obj The object the register
* @param objectNameKeyProperties The key properties component of the
* object name to use to register the
* object
*
* @return The name used to register the object
*/
protected final ObjectName register(Object obj,
String objectNameKeyProperties) {
// Construct an object name with the right domain
StringBuilder name = new StringBuilder(getDomain());
name.append(':');
name.append(objectNameKeyProperties);
ObjectName on = null;
try {
on = new ObjectName(name.toString());
Registry.getRegistry(null, null).registerComponent(obj, on, null);
} catch (MalformedObjectNameException e) {
log.warn(sm.getString("lifecycleMBeanBase.registerFail", obj, name),
e);
} catch (Exception e) {
log.warn(sm.getString("lifecycleMBeanBase.registerFail", obj, name),
e);
}
return on;
}
/**
* Utility method to enable sub-classes to easily unregister additional
* components that don't implement {@link JmxEnabled} with an MBean server.
* <br>
* Note: This method should only be used once {@link #initInternal()} has
* been called and before {@link #destroyInternal()} has been called.
*
* @param on The name of the component to unregister
*/
protected final void unregister(ObjectName on) {
// If null ObjectName, just return without complaint
if (on == null) {
return;
}
// If the MBeanServer is null, log a warning & return
if (mserver == null) {
log.warn(sm.getString("lifecycleMBeanBase.unregisterNoServer", on));
return;
}
try {
mserver.unregisterMBean(on);
} catch (MBeanRegistrationException e) {
log.warn(sm.getString("lifecycleMBeanBase.unregisterFail", on), e);
} catch (InstanceNotFoundException e) {
log.warn(sm.getString("lifecycleMBeanBase.unregisterFail", on), e);
}
}
/**
* Not used - NOOP.
*/
@Override
public final void postDeregister() {
// NOOP
}
/**
* Not used - NOOP.
*/
@Override
public final void postRegister(Boolean registrationDone) {
// NOOP
}
/**
* Not used - NOOP.
*/
@Override
public final void preDeregister() throws Exception {
// NOOP
}
/**
* Allows the object to be registered with an alternative
* {@link MBeanServer} and/or {@link ObjectName}.
*/
@Override
public final ObjectName preRegister(MBeanServer server, ObjectName name)
throws Exception {
this.mserver = server;
this.oname = name;
this.domain = name.getDomain().intern();
return oname;
}
}
| [
"2763041366@qq.com"
] | 2763041366@qq.com |
82b21d27fb90768c8ce6132f113806189b29b294 | 82398d6a036bc45edf324c37e2a418ee17ec5760 | /src/main/java/com/atlassian/jira/rest/client/model/ProjectRoleActorsUpdateBean.java | f6d85f15a20c88bda82251f4a1455127a908079f | [] | no_license | amondnet/jira-client | 7ff59c70cead9d517d031836f961ec0e607366cb | 4f9fdf10532fefbcc0d6ae80fd42d357545eee4d | refs/heads/main | 2023-04-03T21:42:24.069554 | 2021-04-15T15:27:20 | 2021-04-15T15:27:20 | 358,300,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,996 | java | /*
* The Jira Cloud platform REST API
* Jira Cloud platform REST API documentation
*
* The version of the OpenAPI document: 1001.0.0-SNAPSHOT
* Contact: ecosystem@atlassian.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.atlassian.jira.rest.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* ProjectRoleActorsUpdateBean
*/
@JsonPropertyOrder({
ProjectRoleActorsUpdateBean.JSON_PROPERTY_ID,
ProjectRoleActorsUpdateBean.JSON_PROPERTY_CATEGORISED_ACTORS
})
@JsonTypeName("ProjectRoleActorsUpdateBean")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-04-16T00:10:50.175246+09:00[Asia/Seoul]")
public class ProjectRoleActorsUpdateBean {
public static final String JSON_PROPERTY_ID = "id";
private Long id;
public static final String JSON_PROPERTY_CATEGORISED_ACTORS = "categorisedActors";
private Map<String, List<String>> categorisedActors = null;
/**
* The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs.
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs.")
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
public ProjectRoleActorsUpdateBean categorisedActors(Map<String, List<String>> categorisedActors) {
this.categorisedActors = categorisedActors;
return this;
}
public ProjectRoleActorsUpdateBean putCategorisedActorsItem(String key, List<String> categorisedActorsItem) {
if (this.categorisedActors == null) {
this.categorisedActors = new HashMap<>();
}
this.categorisedActors.put(key, categorisedActorsItem);
return this;
}
/**
* The actors to add to the project role. Add groups using `atlassian-group-role-actor` and a list of group names. For example, `\"atlassian-group-role-actor\":[\"another\",\"administrators\"]}`. Add users using `atlassian-user-role-actor` and a list of account IDs. For example, `\"atlassian-user-role-actor\":[\"12345678-9abc-def1-2345-6789abcdef12\", \"abcdef12-3456-789a-bcde-f123456789ab\"]`.
* @return categorisedActors
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The actors to add to the project role. Add groups using `atlassian-group-role-actor` and a list of group names. For example, `\"atlassian-group-role-actor\":[\"another\",\"administrators\"]}`. Add users using `atlassian-user-role-actor` and a list of account IDs. For example, `\"atlassian-user-role-actor\":[\"12345678-9abc-def1-2345-6789abcdef12\", \"abcdef12-3456-789a-bcde-f123456789ab\"]`.")
@JsonProperty(JSON_PROPERTY_CATEGORISED_ACTORS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, List<String>> getCategorisedActors() {
return categorisedActors;
}
public void setCategorisedActors(Map<String, List<String>> categorisedActors) {
this.categorisedActors = categorisedActors;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ProjectRoleActorsUpdateBean projectRoleActorsUpdateBean = (ProjectRoleActorsUpdateBean) o;
return Objects.equals(this.id, projectRoleActorsUpdateBean.id) &&
Objects.equals(this.categorisedActors, projectRoleActorsUpdateBean.categorisedActors);
}
@Override
public int hashCode() {
return Objects.hash(id, categorisedActors);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ProjectRoleActorsUpdateBean {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" categorisedActors: ").append(toIndentedString(categorisedActors)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"amond@amond.net"
] | amond@amond.net |
601b94e6c1301407bad9ad47e3fe604d61a1b62b | 6138af219efc3a8f31060e30ebc532ffcbad1768 | /astrogrid/desktop/impl/test/java/org/astrogrid/desktop/modules/auth/AllAuthUnitTests.java | 746e1f98f9a552a65e3b818599ed7e57f88da093 | [] | no_license | Javastro/astrogrid-legacy | dd794b7867a4ac650d1a84bdef05dfcd135b8bb6 | 51bdbec04bacfc3bcc3af6a896e8c7f603059cd5 | refs/heads/main | 2023-06-26T10:23:01.083788 | 2021-07-30T11:17:12 | 2021-07-30T11:17:12 | 391,028,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 683 | java | /**
*
*/
package org.astrogrid.desktop.modules.auth;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* @author Noel.Winstanley@manchester.ac.uk
* @since Mar 22, 20072:55:36 PM
* @TEST extend unit coverage, and work on integraiton tests.
*/
public class AllAuthUnitTests {
public static Test suite() {
TestSuite suite = new TestSuite("Tests for Sessions & Authorisation");
//$JUnit-BEGIN$
suite.addTestSuite(SessionManagerImplUnitTest.class);
suite.addTestSuite(MutablePrincipalUnitTest.class);
suite.addTestSuite(UnauthenticatedPrincipalUnitTest.class);
suite.addTestSuite(CommunityImplUnitTest.class);
//$JUnit-END$
return suite;
}
}
| [
"Noel.Winstanley@astrogrid.org"
] | Noel.Winstanley@astrogrid.org |
0dd36e8fbd2eadbdaf4adab1826c5451cec6ec50 | e38ab03528d0674d9838cc887ec0d6ec6922daab | /Secure_Storage_Service/src/testing/weloveclouds/kvstore/serialization/KVEntryTest.java | 167b45a8e2220999e384110e2cf682b94aa3b5f5 | [] | no_license | benedekh/WeLoveClouds | d8ba2c7024205985c15de5b49fd0e221c4b55cce | 085579c889713b3a63c7ad01dbf30973bce7dabc | refs/heads/master | 2022-07-22T02:46:22.989742 | 2022-07-14T06:25:24 | 2022-07-14T06:25:24 | 71,482,555 | 0 | 1 | null | 2022-07-14T06:25:25 | 2016-10-20T16:29:29 | Java | UTF-8 | Java | false | false | 1,579 | java | package testing.weloveclouds.kvstore.serialization;
import java.net.UnknownHostException;
import org.junit.Test;
import junit.framework.Assert;
import junit.framework.TestCase;
import weloveclouds.commons.kvstore.deserialization.exceptions.DeserializationException;
import weloveclouds.commons.kvstore.deserialization.helper.KVEntryDeserializer;
import weloveclouds.commons.kvstore.models.KVEntry;
import weloveclouds.commons.kvstore.serialization.helper.KVEntrySerializer;
import weloveclouds.commons.serialization.IDeserializer;
import weloveclouds.commons.serialization.ISerializer;
import weloveclouds.commons.serialization.models.AbstractXMLNode;
/**
* Tests for the {@link KVEntry} to verify its serialization and deserialization processes.
*
* @author Benedek
*/
public class KVEntryTest extends TestCase {
private static final IDeserializer<KVEntry, String> kvEntryDeserializer =
new KVEntryDeserializer();
private static final ISerializer<AbstractXMLNode, KVEntry> kvEntrySerializer =
new KVEntrySerializer();
@Test
public void testHashSerializationAndDeserialization()
throws DeserializationException, UnknownHostException {
KVEntry kvEntry = new KVEntry("hello", "world");
String serializedKVEntry = kvEntrySerializer.serialize(kvEntry).toString();
KVEntry deserializedKVEntry = kvEntryDeserializer.deserialize(serializedKVEntry);
Assert.assertEquals(kvEntry.toString(), deserializedKVEntry.toString());
Assert.assertEquals(kvEntry, deserializedKVEntry);
}
}
| [
"benedekh12@gmail.com"
] | benedekh12@gmail.com |
459cdb94c18a4c2485e0b5493d4ec48660cd133d | 0ae9455f8602eaf225972f5912eea09227580dc4 | /SendRedirectExample/src/com/example/ornek/ValidUser.java | 8ba2b08ad410dd21c0942e8cb380ad243c3bad2c | [] | no_license | canmurat/myworkspace | 7fcb269ae881557ad4cd31450e6a8644311a8de2 | 7ddc97a40609b652cf2b7e5304b1c29a4d4b4393 | refs/heads/master | 2016-09-06T00:27:08.858902 | 2014-04-01T19:46:56 | 2014-04-01T19:46:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | package com.example.ornek;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ValidUser extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
/**
*
*/
private static final long serialVersionUID = 1L;
public ValidUser() {
super();
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw = response.getWriter();
pw.println("Welcome to roseindia.net<br>");
pw.println("how are you");
}
} | [
"can.murat@bil.omu.edu.tr"
] | can.murat@bil.omu.edu.tr |
a6f6588e0e85398e89e19fcfbea9bf007cf7bbe9 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_d08c281c5047589378e04d6de0e59e3f3bcf9d8c/CustomEntityWrapper/5_d08c281c5047589378e04d6de0e59e3f3bcf9d8c_CustomEntityWrapper_t.java | e54359df5ad7f2b03630decba30d6b48ba726da4 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 8,141 | java | package kabbage.customentitylibrary;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import net.minecraft.server.v1_5_R1.EntityLiving;
import net.minecraft.server.v1_5_R1.ItemStack;
import net.minecraft.server.v1_5_R1.PathfinderGoal;
import net.minecraft.server.v1_5_R1.PathfinderGoalSelector;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_5_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_5_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_5_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_5_R1.util.UnsafeList;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
public class CustomEntityWrapper
{
static Map<EntityLiving, CustomEntityWrapper> customEntities = new HashMap<EntityLiving, CustomEntityWrapper>();
private EntityLiving entity;
private String name;
private int health;
private int maxHealth;
private EntityType type;
Map<String, Integer> damagers = new LinkedHashMap<String, Integer>();
public boolean immune;
@SuppressWarnings("rawtypes")
public CustomEntityWrapper(final EntityLiving entity, World world, final double x, final double y, final double z, EntityType type)
{
this.entity = entity;
this.type = type;
entity.world = ((CraftWorld) world).getHandle();
this.name = type.toString();
immune = true;
entity.setPosition(x, y-5, z);
//The arduous process of changing the entities speed without disrupting the pathfinders in any other way
try
{
float initialSpeed = 0;
Field speed = EntityLiving.class.getDeclaredField("bI");
speed.setAccessible(true);
initialSpeed = speed.getFloat(entity);
speed.setFloat(entity, type.getSpeed());
UnsafeList goalSelectorList = null;
UnsafeList targetSelectorList = null;
PathfinderGoalSelector goalSelector;
PathfinderGoalSelector targetSelector;
Field gsa = PathfinderGoalSelector.class.getDeclaredField("a");
Field goalSelectorField = EntityLiving.class.getDeclaredField("goalSelector");
Field targetSelectorField = EntityLiving.class.getDeclaredField("targetSelector");
gsa.setAccessible(true);
goalSelectorField.setAccessible(true);
targetSelectorField.setAccessible(true);
goalSelector = (PathfinderGoalSelector) goalSelectorField.get(entity);
targetSelector = (PathfinderGoalSelector) targetSelectorField.get(entity);
goalSelectorList = (UnsafeList) gsa.get(goalSelector);
targetSelectorList = (UnsafeList) gsa.get(targetSelector);
for(Object goalObject : goalSelectorList)
{
Field goalField = goalObject.getClass().getDeclaredField("a");
goalField.setAccessible(true);
PathfinderGoal goal = (PathfinderGoal) goalField.get(goalObject);
for(Field f : goal.getClass().getDeclaredFields())
{
if(f.getType().equals(Float.TYPE))
{
f.setAccessible(true);
float fl = f.getFloat(goal);
if(fl == initialSpeed)
f.setFloat(goal, type.getSpeed());
}
}
}
for(Object goalObject : targetSelectorList)
{
Field goalField = goalObject.getClass().getDeclaredField("a");
goalField.setAccessible(true);
PathfinderGoal goal = (PathfinderGoal) goalField.get(goalObject);
for(Field f : goal.getClass().getDeclaredFields())
{
if(f.getType().equals(Float.TYPE))
{
f.setAccessible(true);
float fl = f.getFloat(goal);
if(fl == initialSpeed)
f.setFloat(goal, type.getSpeed());
}
}
}
} catch (Exception e)
{
e.printStackTrace();
}
org.bukkit.inventory.ItemStack[] items = type.getItems();
if(items != null)
{
for(int i = 0; i <= 4; i++)
{
if(items[i] != null)
{
ItemStack item = CraftItemStack.asNMSCopy(items[i]);
if(item != null)
entity.setEquipment(i, item);
}
}
}
maxHealth = type.getHealth();
health = type.getHealth();
customEntities.put(entity, this);
//Reload visibility
Bukkit.getScheduler().scheduleSyncDelayedTask(CustomEntityLibrary.plugin, new Runnable()
{
@Override
public void run()
{
if(entity.getHealth() > 0)
{
entity.setPosition(x, y, z);
immune = false;
}
}
},1L);
}
public void setHealth(int health)
{
this.health = health;
}
public EntityLiving getEntity()
{
return entity;
}
public int getHealth()
{
return health;
}
public void setMaxHealth(int maxHealth)
{
this.maxHealth = maxHealth;
if(health > maxHealth)
health = maxHealth;
}
public int getMaxHealth()
{
return maxHealth;
}
public void restoreHealth()
{
health = maxHealth;
}
public void modifySpeed(double modifier)
{
Field f;
try
{
f = EntityLiving.class.getDeclaredField("bI");
f.setAccessible(true);
float newSpeed = (float) (f.getFloat(entity) * modifier);
f.setFloat(entity, newSpeed);
} catch (Exception e)
{
e.printStackTrace();
}
}
public EntityType getType()
{
return type;
}
public void addAttack(Player p, int damage)
{
int damagex = 0;
if(damagers.get(p.getName()) != null)
damagex = damagers.get(p.getName());
damagers.put(p.getName(), damage + damagex);
}
public Player getBestAttacker()
{
String p = null;
int damage = 0;
for(Entry<String, Integer> e: damagers.entrySet())
{
if(e.getValue() > damage)
{
p = e.getKey();
damage = e.getValue();
}
}
if(p == null)
return null;
return Bukkit.getPlayer(p);
}
public Player getAssistAttacker()
{
String p = null;
String p2 = null;
int damage = 0;
for(Entry<String, Integer> e: damagers.entrySet())
{
if(e.getValue() > damage)
{
p2 = p;
p = e.getKey();
damage = e.getValue();
}
}
if(p2 == null)
return null;
return Bukkit.getPlayer(p2);
}
public String getName()
{
return name;
}
/**
* Allows for a simpler way of checking if an Entity is an instance of a CustomEntityWrapper
* @param entity the entity being checked
* @return whether or not an Entity is an instanceof a CustomEntityWrapper
*/
public static boolean instanceOf(Entity entity)
{
if(customEntities.containsKey(((CraftEntity) entity).getHandle()))
return true;
return false;
}
/**
* Allows for a simpler way of converting an Entity to a CustomEntity
* @param entity being converted to a CustomEntityWrapper
* @return a CustomEntityWrapper instance of the entity, or null if none exists
*/
public static CustomEntityWrapper getCustomEntity(Entity entity)
{
if(customEntities.containsKey(((CraftEntity) entity).getHandle()))
return customEntities.get(((CraftEntity) entity).getHandle());
return null;
}
public static CustomEntityWrapper spawnCustomEntity(EntityLiving entity, World world, double x, double y, double z, EntityType type)
{
CustomEntityWrapper customEnt = new CustomEntityWrapper(entity, world, x, y, z, type);
CustomEntitySpawnEvent event = new CustomEntitySpawnEvent(customEnt, new Location(world, x, y, z));
Bukkit.getPluginManager().callEvent(event);
if(event.isCancelled())
{
customEnt.getEntity().setHealth(0);
return null;
}
return customEnt;
}
public static CustomEntityWrapper spawnCustomEntity(EntityLiving entity, Location location, EntityType type)
{
return spawnCustomEntity(entity, location.getWorld(), location.getX(), location.getY(), location.getZ(), type);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
f21b8f4f8d3b82d3536778ebff9d0e6a87e990f4 | 4525db535c18d40cbc1870d83b402e1bcf64416c | /14.spring_security/exercise/blog-manager/src/main/java/com/project/config/WebSecurityConfig.java | 47c5682f7777bf8d2a15ee10b1f05605019db4cb | [] | no_license | Lnnaf/C0720G1_NguyenVanLinh-Module4 | e48453833b9f55e5ee401b4e52b337ec1098410a | 901587eca1e53f368c3a96e441b98757d9008705 | refs/heads/main | 2023-01-31T23:19:43.678433 | 2020-12-17T09:22:15 | 2020-12-17T09:22:15 | 314,421,197 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,339 | java | package com.project.config;
import com.project.service.impl.UserDetailsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.authentication.rememberme.InMemoryTokenRepositoryImpl;
import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository;
import javax.sql.DataSource;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsServiceImpl userDetailsService;
@Autowired
private DataSource dataSource;
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder(12);
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.authorizeRequests().antMatchers("/", "/login", "/logout").permitAll();
http.authorizeRequests().antMatchers("/admin","/delete","/update").access("hasRole('ROLE_ADMIN')");
http.authorizeRequests().antMatchers("/posting").access("hasAnyRole('ROLE_ADMIN', 'ROLE_USER')");
http.authorizeRequests().and().exceptionHandling().accessDeniedPage("/403");
http.authorizeRequests().and().formLogin()//
.loginProcessingUrl("/permission-check")
.loginPage("/login")//
.defaultSuccessUrl("/")//đây Khi đăng nhập thành công thì vào trang này. userAccountInfo sẽ được khai báo trong controller để hiển thị trang view tương ứng
.failureUrl("/login?error=true")// Khi đăng nhật sai username và password thì nhập lại
.usernameParameter("username")// tham số này nhận từ form login ở bước 3 có input name='username'
.passwordParameter("password")// tham số này nhận từ form login ở bước 3 có input name='password'
// Cấu hình cho Logout Page. Khi logout mình trả về trang
.and().logout().logoutUrl("/logout").logoutSuccessUrl("/");
http.authorizeRequests().and() //
.rememberMe().tokenRepository(this.persistentTokenRepository()) //
.tokenValiditySeconds(1 * 24 * 60 * 60); // 24h
}
@Bean
public PersistentTokenRepository persistentTokenRepository() {
InMemoryTokenRepositoryImpl memory = new InMemoryTokenRepositoryImpl(); // Ta lưu tạm remember me trong memory (RAM). Nếu cần mình có thể lưu trong database
return memory;
}
}
| [
"vanlinh12b5@gmail.com"
] | vanlinh12b5@gmail.com |
ff72eca2488a3404bb83757e86060263d94befb6 | c4879ef930bba3dadd88dff96906e357927994f1 | /3.JavaMultithreading/src/com/javarush/task/jdk13/task41/task4108/middles/PythonMiddle.java | 0c4fa5ebf738d4abec92de23eb77b4ddfa126080 | [] | no_license | tsebal/JavaRushTasks | 6b4181ca59702c3799734c7bef9574f55ee4863f | 8046fda30184b0a923f50a0aa21b2da2b708cf3a | refs/heads/master | 2023-01-22T16:26:25.076632 | 2023-01-18T13:18:39 | 2023-01-18T13:18:39 | 168,700,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 282 | java | package com.javarush.task.jdk13.task41.task4108.middles;
public class PythonMiddle implements MiddleDeveloper {
public void writeNewModule() {
System.out.println("Пишет новый модуль для системы машинного обучения.");
}
}
| [
"atsebal@gmail.com"
] | atsebal@gmail.com |
5b7fe10d82cc298ef98da20874d7b88449d9344c | 148c70aef9be6b85e15ccf88fc10e4cb25b56979 | /Comprobante/src/ec/gob/sri/comprobantes/util/key/DylibKeyStoreProvider.java | 567099f7f451dd11ec753f6854b789ec06bc83c1 | [] | no_license | navidaro/facturacion-electronica-web-svn-to-git | 8c8bc4fade2c10bdb037bbf481b1697590521917 | 177532421502ad13c902fcaa75e8515055cc4d26 | refs/heads/master | 2023-03-17T15:02:05.517717 | 2015-12-28T14:19:20 | 2015-12-28T14:19:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 903 | java | /* 1: */ package ec.gob.sri.comprobantes.util.key;
/* 2: */
/* 3: */ public class DylibKeyStoreProvider
/* 4: */ extends PKCS11KeyStoreProvider
/* 5: */ {
/* 6: */ private static String CONFIG;
/* 7: */
/* 8: */ public DylibKeyStoreProvider()
/* 9: */ {
/* 10:25 */ StringBuffer config = new StringBuffer();
/* 11:26 */ config.append("name=eToken\n");
/* 12:27 */ config.append("library=/usr/local/lib/libeTPkcs11.dylib\n");
/* 13: */
/* 14:29 */ CONFIG = config.toString();
/* 15: */ }
/* 16: */
/* 17: */ public String getConfig()
/* 18: */ {
/* 19:34 */ return CONFIG;
/* 20: */ }
/* 21: */ }
/* Location: C:\Facturacion Electronica\ComprobantesDesktop.jar
* Qualified Name: ec.gob.sri.comprobantes.util.key.DylibKeyStoreProvider
* JD-Core Version: 0.7.0.1
*/ | [
"you@example.com"
] | you@example.com |
6024b15768563ed58e93627a7a98c20297153c66 | a6a6fb681bc0222e16454bb3ddb79696e6ea1ad5 | /disassembly_2020-07-06/sources/com/accessorydm/db/file/XDBRegistrationInfo.java | ac19459e740ee8fd2eb40691b16ba6d67873c975 | [] | no_license | ThePBone/GalaxyBudsLive-Disassembly | 6f9c1bf03c0fd27689dcc2440f754039ac54b7a1 | ad119a91b20904f8efccc797f3084005811934c8 | refs/heads/master | 2022-11-23T13:20:54.555338 | 2020-07-28T21:33:30 | 2020-07-28T21:33:30 | 282,281,940 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,025 | java | package com.accessorydm.db.file;
import com.samsung.accessory.fotaprovider.AccessoryState;
public class XDBRegistrationInfo {
private int consumerStatus = AccessoryState.NONE.getValue();
private int deviceRegistrationStatus = 0;
private int pushRegistrationStatus = 0;
private int termStatus = 0;
public int getTermStatus() {
return this.termStatus;
}
public void setTermStatus(int i) {
this.termStatus = i;
}
public int getDeviceRegistrationStatus() {
return this.deviceRegistrationStatus;
}
public void setDeviceRegistrationStatus(int i) {
this.deviceRegistrationStatus = i;
}
public int getPushRegistrationStatus() {
return this.pushRegistrationStatus;
}
public void setPushRegistrationStatus(int i) {
this.pushRegistrationStatus = i;
}
public int getConsumerStatus() {
return this.consumerStatus;
}
public void setConsumerStatus(int i) {
this.consumerStatus = i;
}
}
| [
"thebone.main@gmail.com"
] | thebone.main@gmail.com |
6dd2b8142d56dcdb68fc3b9cb66b039e48f927e6 | 2ea0ee8aa12685c27453608f959e5736b4cddd45 | /app/src/main/java/com/pepperonas/enigma/app/SettingsFragment.java | adc9dcbb6f9bed4ede6a7f774ebbf368c8891c9d | [] | no_license | pepperonas/Enigma | e6d8086889d059ae7d58e4fe9044cdcef590262c | 8478b902335837d9c82e6948e0c6990e672a815a | refs/heads/master | 2020-12-25T05:27:42.921385 | 2016-06-04T23:47:17 | 2016-06-04T23:47:17 | 60,435,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 458 | java | package com.pepperonas.enigma.app;
import android.os.Bundle;
import android.support.v4.app.Fragment;
/**
* @author Martin Pfeffer (pepperonas)
*/
public class SettingsFragment extends Fragment {
public static SettingsFragment newInstance(int i) {
SettingsFragment fragment = new SettingsFragment();
Bundle args = new Bundle();
args.putInt("the_id", i);
fragment.setArguments(args);
return fragment;
}
}
| [
"martinpaush@gmail.com"
] | martinpaush@gmail.com |
379468e85cc093e7b2f8832b08cd67e887907177 | f1869552b270439c4d8269fdf00f1eca006ed6fc | /sandbox/mock-repository-maven-plugin/src/main/java/org/codehaus/mojo/mockrepo/utils/MimeRegistry.java | 2fad2238bf9b1fbfe8681467958fec7a1b0ea91a | [] | no_license | slachiewicz/codehaus-mojo | c3c4e39ab95d0f8f9f3a689f8f6d39dd128c3ea3 | 7671f03c7ebd08e35d954fdcf8de925c0c8d44a9 | refs/heads/master | 2023-03-29T05:20:20.396751 | 2011-08-04T17:49:04 | 2011-08-04T18:04:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,073 | java | package org.codehaus.mojo.mockrepo.utils;
/*
* 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.
*/
import java.util.HashMap;
import java.util.Map;
/**
* Contains the MIME types for common file types
*
* @author connollys
* @since Sep 1, 2009 4:15:23 PM
*/
public final class MimeRegistry
{
/**
* mapping of file extensions to repository-types
*/
private static final Map map = new HashMap();
static
{
map.put( ".ai", "application/postscript" );
map.put( ".aif", "audio/x-aiff" );
map.put( ".aifc", "audio/x-aiff" );
map.put( ".aiff", "audio/x-aiff" );
map.put( ".asc", "text/plain" );
map.put( ".au", "audio/basic" );
map.put( ".avi", "video/x-msvideo" );
map.put( ".bin", "application/octet-stream" );
map.put( ".c", "text/plain" );
map.put( ".cc", "text/plain" );
map.put( ".class", "application/octet-stream" );
map.put( ".cpio", "application/x-cpio" );
map.put( ".csh", "application/x-csh" );
map.put( ".css", "text/css" );
map.put( ".dms", "application/octet-stream" );
map.put( ".doc", "application/msword" );
map.put( ".dvi", "application/x-dvi" );
map.put( ".eps", "application/postscript" );
map.put( ".exe", "application/octet-stream" );
map.put( ".f", "text/plain" );
map.put( ".f90", "text/plain" );
map.put( ".gif", "image/gif" );
map.put( ".gtar", "application/x-gtar" );
map.put( ".gz", "application/x-gzip" );
map.put( ".h", "text/plain" );
map.put( ".hh", "text/plain" );
map.put( ".hqx", "application/mac-binhex40" );
map.put( ".htm", "text/html" );
map.put( ".html", "text/html" );
map.put( ".jpe", "image/jpeg" );
map.put( ".jpeg", "image/jpeg" );
map.put( ".jpg", "image/jpeg" );
map.put( ".js", "application/x-javascript" );
map.put( ".latex", "application/x-latex" );
map.put( ".lha", "application/octet-stream" );
map.put( ".lzh", "application/octet-stream" );
map.put( ".m", "text/plain" );
map.put( ".man", "application/x-troff-man" );
map.put( ".me", "application/x-troff-me" );
map.put( ".mid", "audio/midi" );
map.put( ".midi", "audio/midi" );
map.put( ".mif", "application/vnd.mif" );
map.put( ".mov", "video/quicktime" );
map.put( ".mp2", "audio/mpeg" );
map.put( ".mp3", "audio/mpeg" );
map.put( ".mpe", "video/mpeg" );
map.put( ".mpeg", "video/mpeg" );
map.put( ".mpg", "video/mpeg" );
map.put( ".mpga", "audio/mpeg" );
map.put( ".oda", "application/oda" );
map.put( ".pbm", "image/x-portable-bitmap" );
map.put( ".pdf", "application/pdf" );
map.put( ".pgm", "image/x-portable-graymap" );
map.put( ".png", "image/png" );
map.put( ".pnm", "image/x-portable-anymap" );
map.put( ".pot", "application/mspowerpoint" );
map.put( ".ppm", "image/x-portable-pixmap" );
map.put( ".pps", "application/mspowerpoint" );
map.put( ".ppt", "application/mspowerpoint" );
map.put( ".ppz", "application/mspowerpoint" );
map.put( ".ps", "application/postscript" );
map.put( ".qt", "video/quicktime" );
map.put( ".ra", "audio/x-realaudio" );
map.put( ".ram", "audio/x-pn-realaudiio" );
map.put( ".rgb", "image/x-rgb" );
map.put( ".rm", "audio/x-pn-realaudio" );
map.put( ".roff", "application/x-troff" );
map.put( ".rtf", "text/rtf" );
map.put( ".rtx", "text/richtext" );
map.put( ".sgm", "text/sgml" );
map.put( ".sgml", "text/sgml" );
map.put( ".sh", "application/x-sh" );
map.put( ".shar", "application/x-shar" );
map.put( ".silo", "model/mesh" );
map.put( ".sit", "application/x-stuffit" );
map.put( ".smi", "application/smil" );
map.put( ".smil", "application/smil" );
map.put( ".snd", "audio/basic" );
map.put( ".swf", "application/x-shockwave-flash" );
map.put( ".t", "application/x-troff" );
map.put( ".tar", "application/x-tar" );
map.put( ".tcl", "application/x-tcl" );
map.put( ".tex", "application/x-tex" );
map.put( ".texi", "application/x-texinfo" );
map.put( ".texinfo", "application/x-texinfo" );
map.put( ".tif", "image/tiff" );
map.put( ".tiff", "image/tiff" );
map.put( ".tr", "application/x-troff" );
map.put( ".tsv", "text/tab-separated-values" );
map.put( ".txt", "text/plain" );
map.put( ".wav", "audio/x-wav" );
map.put( ".xbm", "image/x-xbitmap" );
map.put( ".xlc", "application/vnd.ms-excel" );
map.put( ".xll", "application/vnd.ms-excel" );
map.put( ".xlm", "application/vnd.ms-excel" );
map.put( ".xls", "application/vnd.ms-excel" );
map.put( ".xlw", "application/vnd.ms-excel" );
map.put( ".xml", "text/xml" );
map.put( ".xpm", "image/x-xpixmap" );
map.put( ".xwd", "image/x-xwindowdump" );
map.put( ".xyz", "chemical/x-pdb" );
map.put( ".zip", "application/zip" );
map.put( ".asc", "text/plain" );
map.put( ".jar", "application/octet-stream" );
map.put( ".ear", "application/octet-stream" );
map.put( ".exe", "application/octet-stream" );
map.put( ".htm", "text/html" );
map.put( ".html", "text/html" );
map.put( ".java", "text/plain" );
map.put( ".md5", "text/plain" );
map.put( ".par", "application/octet-stream" );
map.put( ".pom", "text/xml" );
map.put( ".rar", "application/octet-stream" );
map.put( ".sar", "application/octet-stream" );
map.put( ".sha1", "text/plain" );
map.put( ".tar", "application/x-tar" );
map.put( ".war", "application/octet-stream" );
map.put( ".xml", "text/xml" );
map.put( ".zip", "application/zip" );
}
private MimeRegistry()
{
throw new IllegalAccessError( "Utility class" );
}
public static String lookup( String extension )
{
return map.containsKey( extension ) ? (String) map.get( extension ) : "application/octet-stream";
}
}
| [
"olamy@52ab4f32-60fc-0310-b215-8acea882cd1b"
] | olamy@52ab4f32-60fc-0310-b215-8acea882cd1b |
cf0cc69fc66058d09e2f0555fc495e8d6e540272 | 27af35647ca8a90e9eb26a38f6cee054a9a6e23d | /yun_kuangjia2019/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewutils/AdvertiseLinearLayoutManager.java | 431d7f5e7a55a87bf269039bbe27123a99c808f3 | [] | no_license | geeklx/myappkuangjia20190806 | 6007614bd8e45c53ddc5fcebd47e9f1499236c69 | 8fbfdd0223af16cdc5cfb5434c49b26c41d3958a | refs/heads/master | 2020-06-30T07:37:28.804826 | 2019-08-20T07:09:45 | 2019-08-20T07:09:45 | 200,767,192 | 9 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,815 | java | package com.haier.cellarette.baselibrary.recycleviewutils;
import android.content.Context;
//import android.support.v7.widget.LinearLayoutManager;
//import android.support.v7.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
/**
* ((AdvertiseLinearLayoutManager) recyclerview3.getLayoutManager()).scrollToPositionWithOffset(recy_current, 0);
* mRecyclerView11.setLayoutManager(new AdvertiseLinearLayoutManager(ReadBookActivity.this, OrientationHelper.HORIZONTAL, false));
* https://blog.csdn.net/x466911254/article/details/78525980
* RecycleView滚动并置顶
*/
public class AdvertiseLinearLayoutManager extends LinearLayoutManager {
public AdvertiseLinearLayoutManager(Context context) {
super(context);
}
public AdvertiseLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}
public AdvertiseLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) {
AdvertiseLinearSmoothScroller linearSmoothScroller =
new AdvertiseLinearSmoothScroller(recyclerView.getContext());
linearSmoothScroller.setTargetPosition(position);
startSmoothScroll(linearSmoothScroller);
}
public class AdvertiseLinearSmoothScroller extends LinearSmoothScroller {
public AdvertiseLinearSmoothScroller(Context context) {
super(context);
}
/**
* @param viewStart RecyclerView的top位置
* @param viewEnd RecyclerView的Bottom位置
* @param boxStart item的top位置
* @param boxEnd item的bottom位置
* @param snapPreference 滑动方向的识别
* @return
*/
@Override
public int calculateDtToFit(int viewStart, int viewEnd, int boxStart, int boxEnd, int snapPreference) {
return boxStart - viewStart;//返回的就是我们item置顶需要的偏移量
}
/**
* 此方法返回滚动每1px需要的时间,可以用来控制滚动速度
* 即如果返回2ms,则每滚动1000px,需要2秒钟
*
* @param displayMetrics
* @return
*/
@Override
protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
return super.calculateSpeedPerPixel(displayMetrics);
}
}
}
| [
"liangxiao@smart-haier.com"
] | liangxiao@smart-haier.com |
cc3d61460ef4d0a21ed9a3821ca26a091257ce4b | 2072659ed1de2bb264493e023802d7dd771df268 | /zuihou-tenant-biz/src/main/java/com/github/zuihou/tenant/service/GlobalUserService.java | f3fbb18fda565f8d1c830b3853f936fde615c489 | [
"Apache-2.0"
] | permissive | LimTerran/zuihou-admin-boot | a4c9fae022b5ff4e10e4b3030957129ae0c71b84 | af0de7b158536cc36c5f9b000b759a349660e5d0 | refs/heads/master | 2022-11-06T05:12:55.195896 | 2020-06-28T06:30:05 | 2020-06-28T06:30:05 | 259,492,403 | 0 | 0 | Apache-2.0 | 2020-06-28T06:30:06 | 2020-04-28T00:48:50 | null | UTF-8 | Java | false | false | 800 | java | package com.github.zuihou.tenant.service;
import com.github.zuihou.base.service.SuperService;
import com.github.zuihou.tenant.dto.GlobalUserSaveDTO;
import com.github.zuihou.tenant.dto.GlobalUserUpdateDTO;
import com.github.zuihou.tenant.entity.GlobalUser;
/**
* <p>
* 业务接口
* 全局账号
* </p>
*
* @author zuihou
* @date 2019-10-25
*/
public interface GlobalUserService extends SuperService<GlobalUser> {
/**
* 检测账号是否可用
*
* @param account
* @return
*/
Boolean check(String account);
/**
* 新建用户
*
* @param data
* @return
*/
GlobalUser save(GlobalUserSaveDTO data);
/**
* 修改
*
* @param data
* @return
*/
GlobalUser update(GlobalUserUpdateDTO data);
}
| [
"244387066@qq.com"
] | 244387066@qq.com |
656cbddcd1b6075721658f9ce0ee98fd5ddd3e49 | 1270a533ae7aaba56e5d5be8ba8e870641ac69c3 | /src/main/java/com/survey/sys/base/SurveyMsDAO.java | 0160b62a92157225cfa7846ec694aa6ca89da720 | [] | no_license | QuickSurveySpace/SurveyMs | 7ce6017a16fe628f473af2281cf6528b6e80bd1a | 57fcf264bd1cbb518a95e8ea2512d10f1f77f46b | refs/heads/master | 2020-03-27T15:05:38.786632 | 2018-09-11T03:57:05 | 2018-09-11T03:57:05 | 146,697,831 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package com.survey.sys.base;
import com.youguu.core.dao.SqlDAO;
import org.apache.ibatis.session.SqlSessionFactory;
import javax.annotation.Resource;
public class SurveyMsDAO<T> extends SqlDAO<T> {
public SurveyMsDAO() {
super();
setUseSimpleName(true);
}
@Resource(name = "surveyMsSessionFactory")
@Override
public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
super.setSqlSessionFactory(sqlSessionFactory);
}
}
| [
"shileibrave@163.com"
] | shileibrave@163.com |
c9488a1a8c9fab8a82528145235ed9aac61a991f | 6b9588d36a20f37323724d39cf196feb31dc3103 | /skycloset_malware/src/com/facebook/imagepipeline/d/p.java | 678f836536954d4c45ef544e629213ed80922e6d | [] | no_license | won21kr/Malware_Project_Skycloset | f7728bef47c0b231528fdf002e3da4fea797e466 | 1ad90be1a68a4e9782a81ef1490f107489429c32 | refs/heads/master | 2022-12-07T11:27:48.119778 | 2019-12-16T21:39:19 | 2019-12-16T21:39:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 243 | java | package com.facebook.imagepipeline.d;
import com.facebook.common.d.j;
import com.facebook.common.h.a;
public interface p<K, V> {
int a(j<K> paramj);
a<V> a(K paramK);
a<V> a(K paramK, a<V> parama);
boolean b(j<K> paramj);
}
| [
"root@localhost.localdomain"
] | root@localhost.localdomain |
abe573b028a218c03dda8324d54fc37371bb864b | 839865567c38f9bef925710d73e6094a142b95c8 | /audit/src/audit/controller/access/AsAccessDataOnLineController.java | d6f172d14f04cfb8e5e4a65d0b69076568499c9d | [] | no_license | serenawanggit/learngit | 7e598cfb7e55ffdaef1a5c3ece4e8c4d30ec1a49 | 60cbc6d016d0736aa520df4d2dd72a58d1f4aa9d | refs/heads/master | 2021-09-05T09:34:40.457287 | 2018-01-26T03:33:03 | 2018-01-26T03:33:03 | 118,994,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,061 | java | package audit.controller.access;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject;
import audit.model.assess.AsAccessDataInfo;
import audit.service.access.AsAccessDataInfoServiceI;
@Controller
@RequestMapping("asAccessDataOnLineController")
public class AsAccessDataOnLineController {
@Autowired
private AsAccessDataInfoServiceI asAccessDataInfoServiceI ;
/**
* 显示要下载的评估材料
* @return
*/
@RequestMapping("showData")
@ResponseBody
public String showData(HttpServletRequest request,HttpServletResponse response){
List<AsAccessDataInfo> asAccessDataInfos= asAccessDataInfoServiceI.findDataOnline();
JSONObject o = new JSONObject();
o.put("list",asAccessDataInfos);
try {
response.setCharacterEncoding("utf-8");
response.getWriter().write(o.toString());
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* 下载文件
*/
@RequestMapping("downfile")
public String downfile(HttpServletRequest request,HttpServletResponse response){
String filename= request.getParameter("filename");
String type=request.getParameter("datatype");
File file = new File(System.getProperty("accessFileAdmin")+"\\"+filename+"."+type);
// File userDir = new File(System.getProperty("accessFileUser")+"\\"+filename+"."+type);
try {
String name=file.getName().trim();
name=new String(name.getBytes("utf-8"),"ISO8859-1");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName="+name);
ServletOutputStream out;
FileInputStream inputStream = new FileInputStream(file);
out = response.getOutputStream();
int len = 0;
while (len==0) {
len=inputStream.available();
}
byte[] buffer = new byte[len];
inputStream.read(buffer);
out.write(buffer);
out.flush();
/* int b = 0;
byte[] buffer = new byte[1024];
while (b != -1){
b = inputStream.read(buffer);
//4.写到输出流(out)中
out.write(buffer,0,b);
}
inputStream.close();
out.close();
out.flush(); */
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
| [
"1416640422@qq.com"
] | 1416640422@qq.com |
1862ef2ff099a68ab16420e50724686ec5ebd11a | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdas/applicationModule/src/test/java/applicationModulepackageJava19/Foo685Test.java | feaf05f9d03439f08b9f64fbffae0740b4437b38 | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 482 | java | package applicationModulepackageJava19;
import org.junit.Test;
public class Foo685Test {
@Test
public void testFoo0() {
new Foo685().foo0();
}
@Test
public void testFoo1() {
new Foo685().foo1();
}
@Test
public void testFoo2() {
new Foo685().foo2();
}
@Test
public void testFoo3() {
new Foo685().foo3();
}
@Test
public void testFoo4() {
new Foo685().foo4();
}
@Test
public void testFoo5() {
new Foo685().foo5();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
5fe1dfe2de226df1d8166062ede5f3c761bab1c3 | 509d35c95d2516b63c8068a94598ee7657e4885f | /src/main/java/com/dianping/dobby/ticket/biz/DefaultTicketManager.java | 8afa4d18b77389eccff528dcf8e29914d26b8061 | [] | no_license | fengshao0907/dobby | 4aa0529d7f89858381ed9b94498df0b71e3a97c1 | 80c2d162156e4f69bbb23d46e33d4560bee3f483 | refs/heads/master | 2021-01-18T11:09:06.744924 | 2013-11-27T09:53:49 | 2013-11-27T09:53:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,471 | java | package com.dianping.dobby.ticket.biz;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
import org.unidal.helper.Files;
import com.dianping.dobby.ticket.model.entity.Model;
import com.dianping.dobby.ticket.model.entity.Ticket;
import com.dianping.dobby.ticket.model.transform.DefaultSaxParser;
public class DefaultTicketManager implements TicketManager, Initializable {
private File m_modelFile;
private Model m_model;
@Override
public void initialize() throws InitializationException {
try {
m_modelFile = new File("ticket.xml").getCanonicalFile();
if (m_modelFile.canRead()) {
String xml = Files.forIO().readFrom(m_modelFile, "utf-8");
m_model = DefaultSaxParser.parse(xml);
} else {
m_model = new Model();
}
} catch (Exception e) {
throw new InitializationException("Unable to load ticket.xml!", e);
}
}
@Override
public Ticket getTicket(String id) {
return m_model.findTicket(id);
}
@Override
public void persist() throws IOException {
Files.forIO().writeTo(m_modelFile, m_model.toString());
}
@Override
public void addTicket(Ticket ticket) {
m_model.addTicket(ticket);
}
@Override
public List<Ticket> getTickets() {
return new ArrayList<Ticket>(m_model.getTickets().values());
}
}
| [
"qmwu2000@gmail.com"
] | qmwu2000@gmail.com |
dd28d8d36105d0e3a2119f747b09e08bf4df2933 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/4/4_0297f578e7fb17de91a20a2b322c05dcd54b08be/PermissionTopLevelFolderItem/4_0297f578e7fb17de91a20a2b322c05dcd54b08be_PermissionTopLevelFolderItem_t.java | 582cce98e66e545659066a247c28fba005781e4b | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,862 | java | /*
* (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser General Public License
* (LGPL) version 2.1 which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl.html
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* Contributors:
* Antoine Taillefer <ataillefer@nuxeo.com>
*/
package org.nuxeo.drive.hierarchy.permission.adapter;
import java.security.Principal;
import java.util.ArrayList;
import java.util.List;
import org.nuxeo.drive.adapter.FileSystemItem;
import org.nuxeo.drive.adapter.FolderItem;
import org.nuxeo.drive.adapter.impl.AbstractVirtualFolderItem;
import org.nuxeo.drive.service.VirtualFolderItemFactory;
import org.nuxeo.ecm.core.api.ClientException;
/**
* User workspace and permission based implementation of the top level
* {@link FolderItem}.
* <p>
* Implements the following tree:
*
* <pre>
* Nuxeo Drive
* |-- My Documents (= user workspace if synchronized else user synchronization roots)
* | |-- Folder 1
* | |-- Folder 2
* | |-- ...
* |-- Other Documents (= user's shared synchronized roots with ReadWrite permission)
* | |-- Other folder 1
* | |-- Other folder 2
* | |-- ...
* </pre>
*
* @author Antoine Taillefer
*/
public class PermissionTopLevelFolderItem extends AbstractVirtualFolderItem {
private static final long serialVersionUID = 5179858544427598560L;
protected List<String> childrenFactoryNames;
public PermissionTopLevelFolderItem(String factoryName,
Principal principal, String folderName,
List<String> childrenFactoryNames) throws ClientException {
super(factoryName, principal, null, null, folderName);
this.childrenFactoryNames = childrenFactoryNames;
}
protected PermissionTopLevelFolderItem() {
// Needed for JSON deserialization
}
@Override
public List<FileSystemItem> getChildren() throws ClientException {
List<FileSystemItem> children = new ArrayList<FileSystemItem>();
for (String childFactoryName : childrenFactoryNames) {
VirtualFolderItemFactory factory = getFileSystemItemAdapterService().getVirtualFolderItemFactory(
childFactoryName);
FileSystemItem child = factory.getVirtualFolderItem(principal);
if (child != null) {
children.add(child);
}
}
return children;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
04994ea0bdad0d1dd1256cae5b44d9ee5b7f770d | 4fcb4a80ba41e9d6c7d04fe918407eeb731113b6 | /wscs-web-admin/src/main/java/com/xxx/market/web/admin/ump/validator/PromotionValidator.java | 4f4becb2b31ac541038deabb7e5015e19c8d43ad | [
"Apache-2.0"
] | permissive | pjworkspace/wscs | d088a6ec9da0b42fccfc3a8d9a20b40853e22850 | aff7c5ec0f3cb61179dd6dfc41d4d73c04b921ed | refs/heads/master | 2021-01-25T06:06:47.739373 | 2018-12-03T06:40:40 | 2018-12-03T06:40:40 | 93,526,599 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | package com.xxx.market.web.admin.ump.validator;
import com.xxx.market.web.core.validator.BaseJsonRenderValidator;
import com.jfinal.core.Controller;
public class PromotionValidator extends BaseJsonRenderValidator{
@Override
protected void validate(Controller c) {
validateRequiredString("promotion_name", "error_promotion_name", "请输入折扣活动名称!");
validateRequiredString("start_date", "error_start_date", "生效开始时间不能为空!");
validateRequiredString("end_date", "error_end_date", "生效结束时间不能为空!");
validateRequiredString("promotion_tag", "error_promotion_tag", "请填写活动标签!");
}
}
| [
"692706577@qq.com"
] | 692706577@qq.com |
2fe97b01e33416500854c582beeed1dfdd91a204 | 6a0e82d471b16a89c330eadc7778d040e60508c2 | /src/main/java/org/joda/beans/impl/BasicProperty.java | bce12eaa5933d67682b23eae1b4afeb2d79c3ef4 | [
"Apache-2.0"
] | permissive | luiz158/joda-beans | 11f880ba9242663ff0e673d4bb9584ad31cd9179 | 570b8267bebc7eae898f9c53f9d684420e0e5d0d | refs/heads/master | 2021-04-09T14:00:25.587520 | 2012-12-10T19:08:54 | 2012-12-10T19:08:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,091 | java | /*
* Copyright 2001-2011 Stephen Colebourne
*
* 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.joda.beans.impl;
import org.joda.beans.Bean;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
/**
* A property that binds a {@code Bean} to a {@code MetaProperty}.
* <p>
* This is the standard implementation of a property.
* It defers the strategy of getting and setting the value to the meta-property.
* <p>
* This implementation is also a map entry to aid performance in maps.
*
* @param <P> the type of the property content
* @author Stephen Colebourne
*/
public final class BasicProperty<P> implements Property<P> {
/** The bean that the property is bound to. */
private final Bean bean;
/** The meta-property that the property is bound to. */
private final MetaProperty<P> metaProperty;
/**
* Factory to create a property avoiding duplicate generics.
*
* @param bean the bean that the property is bound to, not null
* @param metaProperty the meta property, not null
*/
public static <P> BasicProperty<P> of(Bean bean, MetaProperty<P> metaProperty) {
return new BasicProperty<P>(bean, metaProperty);
}
/**
* Creates a property binding the bean to the meta-property.
*
* @param bean the bean that the property is bound to, not null
* @param metaProperty the meta property, not null
*/
private BasicProperty(Bean bean, MetaProperty<P> metaProperty) {
if (bean == null) {
throw new NullPointerException("Bean must not be null");
}
if (metaProperty == null) {
throw new NullPointerException("MetaProperty must not be null");
}
this.bean = bean;
this.metaProperty = metaProperty;
}
//-----------------------------------------------------------------------
@SuppressWarnings("unchecked")
@Override
public <B extends Bean> B bean() {
return (B) bean;
}
@Override
public MetaProperty<P> metaProperty() {
return metaProperty;
}
@Override
public String name() {
return metaProperty.name();
}
//-----------------------------------------------------------------------
@Override
public P get() {
return metaProperty.get(bean);
}
@Override
public void set(Object value) {
metaProperty.set(bean, value);
}
@Override
public P put(Object value) {
return metaProperty.put(bean, value);
}
//-----------------------------------------------------------------------
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof Property) {
Property<?> other = (Property<?>) obj;
if (metaProperty.equals(other.metaProperty())) {
Object a = get();
Object b = other.get();
return a == null ? b == null : a.equals(b);
}
}
return false;
}
@Override
public int hashCode() {
P value = get();
return metaProperty.hashCode() ^ (value == null ? 0 : value.hashCode());
}
/**
* Returns a string that summarises the property.
*
* @return a summary string, not null
*/
@Override
public String toString() {
return metaProperty + "=" + get();
}
}
| [
"scolebourne@joda.org"
] | scolebourne@joda.org |
2aefa9d0a9e5efb122855650c9aca477f385a31d | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /ant_cluster/17895/src_0.java | aedf2a8a3620aed4e881f2ed22c5503d48e20562 | [] | no_license | martinezmatias/GenPat-data-C3 | 63cfe27efee2946831139747e6c20cf952f1d6f6 | b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4 | refs/heads/master | 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,213 | java | /*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant;
import java.io.*;
/**
* Writes build event to a PrintStream. Currently, it
* only writes which targets are being executed, and
* any messages that get logged.
*/
public class DefaultLogger implements BuildLogger {
private static int LEFT_COLUMN_SIZE = 12;
protected PrintStream out;
protected PrintStream err;
protected int msgOutputLevel = Project.MSG_ERR;
private long startTime = System.currentTimeMillis();
protected static String lSep = System.getProperty("line.separator");
protected boolean emacsMode = false;
/**
* Set the msgOutputLevel this logger is to respond to.
*
* Only messages with a message level lower than or equal to the given level are
* output to the log.
* <P>
* Constants for the message levels are in Project.java. The order of
* the levels, from least to most verbose, is MSG_ERR, MSG_WARN,
* MSG_INFO, MSG_VERBOSE, MSG_DEBUG.
*
* The default message level for DefaultLogger is Project.MSG_ERR.
*
* @param level the logging level for the logger.
*/
public void setMessageOutputLevel(int level) {
this.msgOutputLevel = level;
}
/**
* Set the output stream to which this logger is to send its output.
*
* @param output the output stream for the logger.
*/
public void setOutputPrintStream(PrintStream output) {
this.out = output;
}
/**
* Set the output stream to which this logger is to send error messages.
*
* @param err the error stream for the logger.
*/
public void setErrorPrintStream(PrintStream err) {
this.err = err;
}
/**
* Set this logger to produce emacs (and other editor) friendly output.
*
* @param emacsMode true if output is to be unadorned so that emacs and other
* editors can parse files names, etc.
*/
public void setEmacsMode(boolean emacsMode) {
this.emacsMode = emacsMode;
}
public void buildStarted(BuildEvent event) {
startTime = System.currentTimeMillis();
}
/**
* Prints whether the build succeeded or failed, and
* any errors the occured during the build.
*/
public void buildFinished(BuildEvent event) {
Throwable error = event.getException();
if (error == null) {
out.println(lSep + "BUILD SUCCESSFUL");
}
else {
err.println(lSep + "BUILD FAILED" + lSep);
if (error instanceof BuildException) {
err.println(error.toString());
Throwable nested = ((BuildException)error).getException();
if (nested != null) {
nested.printStackTrace(err);
}
}
else {
error.printStackTrace(err);
}
}
out.println(lSep + "Total time: " + formatTime(System.currentTimeMillis() - startTime));
}
public void targetStarted(BuildEvent event) {
if (Project.MSG_INFO <= msgOutputLevel) {
out.println(lSep + event.getTarget().getName() + ":");
}
}
public void targetFinished(BuildEvent event) {
}
public void taskStarted(BuildEvent event) {}
public void taskFinished(BuildEvent event) {}
public void messageLogged(BuildEvent event) {
PrintStream logTo = event.getPriority() == Project.MSG_ERR ? err : out;
// Filter out messages based on priority
if (event.getPriority() <= msgOutputLevel) {
// Print out the name of the task if we're in one
if (event.getTask() != null) {
String name = event.getTask().getTaskName();
if (!emacsMode) {
String msg = "[" + name + "] ";
for (int i = 0; i < (LEFT_COLUMN_SIZE - msg.length()); i++) {
logTo.print(" ");
}
logTo.print(msg);
}
}
// Print the message
logTo.println(event.getMessage());
}
}
protected static String formatTime(long millis) {
long seconds = millis / 1000;
long minutes = seconds / 60;
if (minutes > 0) {
return Long.toString(minutes) + " minute"
+ (minutes == 1 ? " " : "s ")
+ Long.toString(seconds%60) + " second"
+ (seconds%60 == 1 ? "" : "s");
}
else {
return Long.toString(seconds) + " second"
+ (seconds%60 == 1 ? "" : "s");
}
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
c05f3aae5164765cff584b19fdb35b858267997f | 982c6b06d72d646c809d5a12866359f720305067 | /subprojects/build-adapter-xcode/src/main/java/dev/nokee/buildadapter/xcode/internal/plugins/specs/AtNestedCollectionEncoder.java | cbfc6b9e157731f0da1ec7ff4246c406de01a8b4 | [
"Apache-2.0"
] | permissive | nokeedev/gradle-native | e46709a904e20183ca09ff64b92d222d3c888df2 | 6e6ee42cefa69d81fd026b2cfcb7e710dd62d569 | refs/heads/master | 2023-05-30T02:27:59.371101 | 2023-05-18T15:36:49 | 2023-05-23T14:43:18 | 243,841,556 | 52 | 9 | Apache-2.0 | 2023-05-23T14:58:33 | 2020-02-28T19:42:28 | Java | UTF-8 | Java | false | false | 2,774 | java | /*
* Copyright 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package dev.nokee.buildadapter.xcode.internal.plugins.specs;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import dev.nokee.xcode.project.ValueEncoder;
import lombok.EqualsAndHashCode;
import lombok.val;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collector;
@EqualsAndHashCode
public final class AtNestedCollectionEncoder<IN> implements ValueEncoder<XCBuildSpec, IN> {
private final Collector<XCBuildPlan, ?, ? extends Collection<XCBuildPlan>> collector;
private final ValueEncoder<List<XCBuildSpec>, IN> delegate;
public AtNestedCollectionEncoder(Collector<XCBuildPlan, ?, ? extends Collection<XCBuildPlan>> collector, ValueEncoder<List<XCBuildSpec>, IN> delegate) {
this.collector = collector;
this.delegate = delegate;
}
@Override
public XCBuildSpec encode(IN value, Context context) {
return new Spec(collector, delegate.encode(value, context));
}
public static <IN> AtNestedCollectionEncoder<IN> atNestedSet(ValueEncoder<List<XCBuildSpec>, IN> encoder) {
return new AtNestedCollectionEncoder<>(ImmutableSet.toImmutableSet(), encoder);
}
public static <IN> AtNestedCollectionEncoder<IN> atNestedList(ValueEncoder<List<XCBuildSpec>, IN> encoder) {
return new AtNestedCollectionEncoder<>(ImmutableList.toImmutableList(), encoder);
}
@EqualsAndHashCode
public static class Spec implements XCBuildSpec {
private final Collector<XCBuildPlan, ?, ? extends Collection<XCBuildPlan>> collector;
private final List<XCBuildSpec> specs;
public Spec(Collector<XCBuildPlan, ?, ? extends Collection<XCBuildPlan>> collector, List<XCBuildSpec> specs) {
this.collector = collector;
this.specs = specs;
}
@Override
public XCBuildPlan resolve(ResolveContext context) {
val result = specs.stream().map(it -> it.resolve(context)).collect(collector);
return new CompositeXCBuildPlan<>(result);
}
@Override
public void visit(Visitor visitor) {
for (int i = 0; i < specs.size(); i++) {
XCBuildSpec it = specs.get(i);
visitor.enterContext(String.valueOf(i));
it.visit(visitor);
visitor.exitContext();
}
}
}
}
| [
"lacasseio@users.noreply.github.com"
] | lacasseio@users.noreply.github.com |
e4eb23d42130e35488cb9038098c8a4c2dcf9638 | 11c9cc61ae0c48ed0b81a1e2b35f97b45421f263 | /library/src/main/java/com/ben/livesdk/player/widget/media/AndroidMediaController.java | b4af8e46d207b5ac1a87019d7445621b7592bd3b | [] | no_license | ben622/live | b9c76764c672c2c9b2959370f8011cd7a5ca2b27 | d6a3700d5fcbd1dc02597d2c690d3c39411cbcc2 | refs/heads/master | 2020-04-15T11:11:16.736138 | 2019-09-11T08:23:34 | 2019-09-11T08:23:34 | 164,618,715 | 10 | 4 | null | null | null | null | UTF-8 | Java | false | false | 2,428 | java | /*
* Copyright (C) 2015 Bilibili
* Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ben.livesdk.player.widget.media;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.util.AttributeSet;
import android.view.View;
import android.widget.MediaController;
import java.util.ArrayList;
public class AndroidMediaController extends MediaController implements IMediaController {
private ActionBar mActionBar;
public AndroidMediaController(Context context, AttributeSet attrs) {
super(context, attrs);
initView(context);
}
public AndroidMediaController(Context context, boolean useFastForward) {
super(context, useFastForward);
initView(context);
}
public AndroidMediaController(Context context) {
super(context);
initView(context);
}
private void initView(Context context) {
}
public void setSupportActionBar(@Nullable ActionBar actionBar) {
mActionBar = actionBar;
if (isShowing()) {
actionBar.show();
} else {
actionBar.hide();
}
}
@Override
public void show() {
super.show();
if (mActionBar != null)
mActionBar.show();
}
@Override
public void hide() {
super.hide();
if (mActionBar != null)
mActionBar.hide();
for (View view : mShowOnceArray)
view.setVisibility(View.GONE);
mShowOnceArray.clear();
}
//----------
// Extends
//----------
private ArrayList<View> mShowOnceArray = new ArrayList<View>();
public void showOnce(@NonNull View view) {
mShowOnceArray.add(view);
view.setVisibility(View.VISIBLE);
show();
}
}
| [
"zhangchuan622@gmail.com"
] | zhangchuan622@gmail.com |
629c4c1da632ebed0a8a9a9d0eb6bc7ebea6f23a | 045f5f676adf418ac3f89ca17fa78baccd53089d | /app/src/main/java/com/checktoupdatedemo/MainActivity.java | c1b271e646e9350117ca246368565b9b90ff9b95 | [] | no_license | DevelopWb/CheckSoftwareToUpdate | ab021766dfd6e532aca5445b5f8fbca0f985bf09 | 931e41d22c44bfcd72da7ec077bba8aa6aa3e604 | refs/heads/master | 2021-05-11T17:27:06.775108 | 2018-01-17T07:06:46 | 2018-01-17T07:06:46 | 117,796,260 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,582 | java | package com.checktoupdatedemo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import com.checktoupdatedemo.utils.CheckUpdateUtil;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
/**
* 检查更新
*/
private TextView mCheckUpdateTv;
private String appVersionDescription = "1.我是功能1 \n 1.我是功能1 \n 2.我是功能2 \n 3.我是功能3 \n 4.我是功能4 \n ";//最新软件版本特征描述
private String downloadApkUrl = "/SoftwareManagement/Uploads/celllocation_NR-release(1).apk";//服务端apk包的路径
private CheckUpdateUtil utils;
public String serverUrl = "http://zc.xun365.net";//服务端地址
private String dialogNotice = "";//对话框的提示语,两种,一种是稍后提示,一种是其他自定义词语
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
utils = new CheckUpdateUtil(this,"2.0",serverUrl,downloadApkUrl,appVersionDescription,"稍后提示");
}
private void initView() {
mCheckUpdateTv = (TextView) findViewById(R.id.check_update_tv);
mCheckUpdateTv.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.check_update_tv:
utils.CheckVersionToWarnUpdate();
break;
}
}
}
| [
"three6one@163.com"
] | three6one@163.com |
e89436570d956dafba857629ed738e034feb5d72 | 47798511441d7b091a394986afd1f72e8f9ff7ab | /src/main/java/com/alipay/api/domain/PidShopInfo.java | 06f2ed403da6ce3ba3501bedbec7d70061775716 | [
"Apache-2.0"
] | permissive | yihukurama/alipay-sdk-java-all | c53d898371032ed5f296b679fd62335511e4a310 | 0bf19c486251505b559863998b41636d53c13d41 | refs/heads/master | 2022-07-01T09:33:14.557065 | 2020-05-07T11:20:51 | 2020-05-07T11:20:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 894 | java | package com.alipay.api.domain;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 招商pid和pid对应的门第列表
*
* @author auto create
* @since 1.0, 2017-06-05 11:25:25
*/
public class PidShopInfo extends AlipayObject {
private static final long serialVersionUID = 4818511231915564191L;
/**
* 商户pid
*/
@ApiField("pid")
private String pid;
/**
* pid下的门店列表
*/
@ApiListField("shop_ids")
@ApiField("string")
private List<String> shopIds;
public String getPid() {
return this.pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public List<String> getShopIds() {
return this.shopIds;
}
public void setShopIds(List<String> shopIds) {
this.shopIds = shopIds;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
55eb25c7456b2715610e541c24e481340e5e5d12 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-418-24-23-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/wikimodel/xhtml/filter/DefaultXMLFilter_ESTest_scaffolding.java | 16923c0ea2eb8df5559f81f8a879c4d1586fce30 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 463 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Apr 06 11:14:59 UTC 2020
*/
package org.xwiki.rendering.wikimodel.xhtml.filter;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class DefaultXMLFilter_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
8bc53fd810a9dba6982c93f5493961cfe608f38e | 2b1821134bb02ec32f71ddbc63980d6e9c169b65 | /algorithms/src/main/java/com/github/mdssjc/algorithms/chapter2/exercises24/Ex1.java | ad55f2020a5e6b1614df54110c5125b38ab90922 | [] | no_license | mdssjc/study | a52f8fd6eb1f97db0ad523131f45d5caf914f01b | 2ca51a968e254a01900bffdec76f1ead2acc8912 | refs/heads/master | 2023-04-04T18:24:06.091047 | 2023-03-17T00:55:50 | 2023-03-17T00:55:50 | 39,316,435 | 3 | 1 | null | 2023-03-04T00:50:33 | 2015-07-18T23:53:39 | Java | UTF-8 | Java | false | false | 851 | java | package com.github.mdssjc.algorithms.chapter2.exercises24;
import com.github.mdssjc.algorithms.datastructure.priority_queue.PriorityQueue;
import com.github.mdssjc.algorithms.datastructure.priority_queue.concrete.MaxPQ;
import com.github.mdssjc.algorithms.utils.Executor;
import com.github.mdssjc.algorithms.utils.TestDrive;
import edu.princeton.cs.algs4.StdOut;
/**
* Exercise 1.
*
* @author Marcelo dos Santos
*
*/
@TestDrive("P R I O * R * * I * T * Y * * * Q U E * * * U * E")
public class Ex1 {
public static void main(final String[] args) {
Executor.execute(Ex1.class, args);
final PriorityQueue<String> pq = new MaxPQ<>();
final String[] xs = args[0].split(" ");
for (final String x : xs) {
if ("*".equals(x)) {
StdOut.print(pq.delete() + " ");
} else {
pq.insert(x);
}
}
}
}
| [
"mdssjc@gmail.com"
] | mdssjc@gmail.com |
9916dc929ae87cd0e1c39a0ca10db78747297421 | bbe9db564e53765e28ef91934dc3e4de4e1b9f01 | /tlatools/test/tlc2/tool/suite/Test17.java | f1e76c53446ee97b9cb9862d53c8101cb336caf9 | [
"MIT"
] | permissive | softagram/tlaplus | b0bb5f8be64445977442386a699c575aa54de238 | f12b10e796f775c10b764b3c0afdde0bcc328620 | refs/heads/master | 2020-04-08T16:26:47.631771 | 2018-11-27T00:21:18 | 2018-11-27T00:21:18 | 159,518,788 | 0 | 0 | MIT | 2018-11-28T14:58:40 | 2018-11-28T14:57:15 | Java | UTF-8 | Java | false | false | 1,535 | java | /*******************************************************************************
* Copyright (c) 2016 Microsoft Research. All rights reserved.
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Contributors:
* Markus Alexander Kuppe - initial API and implementation
******************************************************************************/
package tlc2.tool.suite;
public class Test17 extends SuiteTestCase {
public Test17() {
super("7", "2", "0", "1");
}
}
| [
"tlaplus.net@lemmster.de"
] | tlaplus.net@lemmster.de |
533c5f40cd55469ae1edae6af8a3628c356a2631 | 995c1b7c61bbf6e28d69bc36d4721be9c1a3b7c4 | /xxpay-core/src/main/java/org/xxpay/core/common/util/MD5Util.java | 76f102f6075e765ef017cf076ed878d6f71593e9 | [] | no_license | launchfirst2020/xxpay4new | 94bdb9cf3c974ac51214a13dfec279b8c34029d1 | 54247cd9cf64aacfffe84455a7ac1bf61420ffc2 | refs/heads/master | 2023-04-09T21:10:13.344707 | 2021-01-22T09:10:28 | 2021-01-22T09:10:28 | 331,880,197 | 5 | 9 | null | null | null | null | UTF-8 | Java | false | false | 1,241 | java | package org.xxpay.core.common.util;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
/**
* Created with IntelliJ IDEA.
* User: zhanglei
* Date: 18/3/1 下午6:05
* Description: MD5加密工具类
*/
public class MD5Util {
public static String string2MD5(String inStr) {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
e.printStackTrace();
return "";
}
byte[] byteArray = null;
try {
byteArray = inStr.getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
byte[] md5Bytes = md5.digest(byteArray);
StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = md5Bytes[i] & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
public static void main(String[] args) {
/**
* loginid+ pwd
*/
System.out.println(string2MD5("asdddddddd"));
}
}
| [
"launchfirst_baggio@163.com"
] | launchfirst_baggio@163.com |
399a8d0f3686addbf3ce247a5f328408822133cc | 57ccfe41d0d365158bab7bb739023bbc66f84a61 | /basex-core/src/main/java/org/basex/query/expr/constr/CTxt.java | 995247f00ef84085141d1b4b21865620a433211c | [
"BSD-3-Clause"
] | permissive | rabbit2190/basex | 207670a948a82f69607e5f6707c11b01e5ef1223 | 75f4c6ef78c849dd03c56f0f478bcd9b0b36fd4a | refs/heads/master | 2020-12-29T23:45:34.648291 | 2020-02-05T18:25:06 | 2020-02-05T18:25:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,360 | java | package org.basex.query.expr.constr;
import static org.basex.query.QueryText.*;
import org.basex.query.*;
import org.basex.query.expr.*;
import org.basex.query.iter.*;
import org.basex.query.value.item.*;
import org.basex.query.value.node.*;
import org.basex.query.value.seq.*;
import org.basex.query.value.type.*;
import org.basex.query.var.*;
import org.basex.util.*;
import org.basex.util.hash.*;
/**
* Text fragment.
*
* @author BaseX Team 2005-19, BSD License
* @author Christian Gruen
*/
public final class CTxt extends CNode {
/** Item evaluation flag. */
private boolean simple;
/**
* Constructor.
* @param sc static context
* @param info input info
* @param text text
*/
public CTxt(final StaticContext sc, final InputInfo info, final Expr text) {
super(sc, info, SeqType.TXT_ZO, text);
}
@Override
public Expr optimize(final CompileContext cc) throws QueryException {
simplifyAll(AtomType.ATM, cc);
final Expr expr = exprs[0];
final SeqType st = expr.seqType();
if(st.zero()) return cc.replaceWith(this, expr);
final boolean atom = !st.mayBeArray();
if(st.oneOrMore() && atom) exprType.assign(Occ.ONE);
simple = st.zeroOrOne() && atom;
return this;
}
@Override
public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
// if possible, retrieve single item
final Expr expr = exprs[0];
if(simple) {
final Item item = expr.item(qc, info);
return new FTxt(item == Empty.VALUE ? Token.EMPTY : item.string(info));
}
final TokenBuilder tb = new TokenBuilder();
boolean more = false;
final Iter iter = expr.atomIter(qc, info);
for(Item item; (item = qc.next(iter)) != null;) {
if(more) tb.add(' ');
tb.add(item.string(info));
more = true;
}
return more ? new FTxt(tb.finish()) : Empty.VALUE;
}
@Override
public Expr copy(final CompileContext cc, final IntObjMap<Var> vm) {
final CTxt ctxt = copyType(new CTxt(sc, info, exprs[0].copy(cc, vm)));
ctxt.simple = simple;
return ctxt;
}
@Override
public boolean equals(final Object obj) {
return this == obj || obj instanceof CTxt && super.equals(obj);
}
@Override
public String description() {
return info(TEXT);
}
@Override
public String toString() {
return toString(TEXT);
}
}
| [
"christian.gruen@gmail.com"
] | christian.gruen@gmail.com |
ce2c2dc0360b44f127e63d6f0d24095d0651b2e3 | 3883554587c8f3f75a7bebd746e1269b8e1e5ef1 | /kubernetes-model-generator/kubernetes-model-core/src/generated/java/io/fabric8/kubernetes/api/model/ContainerStateTerminated.java | f2f93814a9dd35ec4ed5f2fd4de24c7422359c08 | [
"Apache-2.0"
] | permissive | KamalSinghKhanna/kubernetes-client | 58f663fdc0ca4b6006ae1448ac89b04b6093e46d | 08261fba6c9306eb063534ec2320e9166f85c71c | refs/heads/master | 2023-08-17T04:33:28.646984 | 2021-09-23T17:17:24 | 2021-09-23T17:17:24 | 409,863,910 | 1 | 0 | Apache-2.0 | 2021-09-24T06:55:57 | 2021-09-24T06:55:57 | null | UTF-8 | Java | false | false | 4,380 | java |
package io.fabric8.kubernetes.api.model;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.sundr.builder.annotations.Buildable;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"apiVersion",
"kind",
"metadata",
"containerID",
"exitCode",
"finishedAt",
"message",
"reason",
"signal",
"startedAt"
})
@ToString
@EqualsAndHashCode
@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = true, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder")
public class ContainerStateTerminated implements KubernetesResource
{
@JsonProperty("containerID")
private java.lang.String containerID;
@JsonProperty("exitCode")
private Integer exitCode;
@JsonProperty("finishedAt")
private String finishedAt;
@JsonProperty("message")
private java.lang.String message;
@JsonProperty("reason")
private java.lang.String reason;
@JsonProperty("signal")
private Integer signal;
@JsonProperty("startedAt")
private String startedAt;
@JsonIgnore
private Map<java.lang.String, Object> additionalProperties = new HashMap<java.lang.String, Object>();
/**
* No args constructor for use in serialization
*
*/
public ContainerStateTerminated() {
}
/**
*
* @param reason
* @param exitCode
* @param startedAt
* @param containerID
* @param message
* @param signal
* @param finishedAt
*/
public ContainerStateTerminated(java.lang.String containerID, Integer exitCode, String finishedAt, java.lang.String message, java.lang.String reason, Integer signal, String startedAt) {
super();
this.containerID = containerID;
this.exitCode = exitCode;
this.finishedAt = finishedAt;
this.message = message;
this.reason = reason;
this.signal = signal;
this.startedAt = startedAt;
}
@JsonProperty("containerID")
public java.lang.String getContainerID() {
return containerID;
}
@JsonProperty("containerID")
public void setContainerID(java.lang.String containerID) {
this.containerID = containerID;
}
@JsonProperty("exitCode")
public Integer getExitCode() {
return exitCode;
}
@JsonProperty("exitCode")
public void setExitCode(Integer exitCode) {
this.exitCode = exitCode;
}
@JsonProperty("finishedAt")
public String getFinishedAt() {
return finishedAt;
}
@JsonProperty("finishedAt")
public void setFinishedAt(String finishedAt) {
this.finishedAt = finishedAt;
}
@JsonProperty("message")
public java.lang.String getMessage() {
return message;
}
@JsonProperty("message")
public void setMessage(java.lang.String message) {
this.message = message;
}
@JsonProperty("reason")
public java.lang.String getReason() {
return reason;
}
@JsonProperty("reason")
public void setReason(java.lang.String reason) {
this.reason = reason;
}
@JsonProperty("signal")
public Integer getSignal() {
return signal;
}
@JsonProperty("signal")
public void setSignal(Integer signal) {
this.signal = signal;
}
@JsonProperty("startedAt")
public String getStartedAt() {
return startedAt;
}
@JsonProperty("startedAt")
public void setStartedAt(String startedAt) {
this.startedAt = startedAt;
}
@JsonAnyGetter
public Map<java.lang.String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(java.lang.String name, Object value) {
this.additionalProperties.put(name, value);
}
}
| [
"marc@marcnuri.com"
] | marc@marcnuri.com |
b2151cc21fe103b096cdeae67ef2970daaf2f2b7 | f222dbc0c70f2372179c01ca9e6f7310ab624d63 | /store/src/java/com/zimbra/cs/util/yauth/AuthTest.java | 77097660680410697d2a423363c2af3edf894566 | [] | no_license | Prashantsurana/zm-mailbox | 916480997851f55d4b2de1bc8034c2187ed34dda | 2fb9a0de108df9c2cd530fe3cb2da678328b819d | refs/heads/develop | 2021-01-23T01:07:59.215154 | 2017-05-26T09:18:30 | 2017-05-26T10:36:04 | 85,877,552 | 1 | 0 | null | 2017-03-22T21:23:04 | 2017-03-22T21:23:04 | null | UTF-8 | Java | false | false | 2,106 | java | /*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2008, 2009, 2010, 2013, 2014, 2016 Synacor, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation,
* version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK *****
*/
package com.zimbra.cs.util.yauth;
import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
public class AuthTest extends TestCase {
private static final String APPID = "D2hTUBHAkY0IEL5MA7ibTS_1K86E8RErSSaTGn4-";
private static final String USER = "dacztest";
private static final String PASS = "test1234";
private static String token;
static {
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.DEBUG);
}
private static String getToken() throws Exception {
if (token == null) {
token = RawAuth.getToken(APPID, USER, PASS);
}
return token;
}
public void testToken() throws Exception {
token = getToken();
assertNotNull(token);
}
public void testAuthenticate() throws Exception {
RawAuth auth = RawAuth.authenticate(APPID, getToken());
assertNotNull(auth.getWSSID());
assertNotNull(auth.getCookie());
}
public void testInvalidPassword() throws Exception {
Exception error = null;
try {
RawAuth.getToken(APPID, USER, "invalid");
} catch (AuthenticationException e) {
error = e;
}
assertNotNull(error);
}
}
| [
"shriram.vishwanathan@synacor.com"
] | shriram.vishwanathan@synacor.com |
fb31c408dbe7c3bad0bbfab8058b49321bd3f70d | a7eeb054cf22cdfb4cc40131263e68840fe847b7 | /otter/src/main/java/net/tokensmith/otter/router/Engine.java | 848b0dcf1aaa3b4bffa3bed367e52a9b837d4510 | [
"MIT"
] | permissive | tokensmith/otter | 915b5139bd98cb6604bd9c80d3946b0295fdd676 | 362559b8a1ef71673a0a708b0e032e645e929152 | refs/heads/main | 2023-03-25T08:28:43.479738 | 2020-08-01T14:19:48 | 2020-08-01T14:19:48 | 55,358,823 | 1 | 0 | MIT | 2021-03-20T14:32:59 | 2016-04-03T17:21:43 | Java | UTF-8 | Java | false | false | 5,475 | java | package net.tokensmith.otter.router;
import net.tokensmith.otter.controller.entity.StatusCode;
import net.tokensmith.otter.dispatch.RouteRunner;
import net.tokensmith.otter.router.entity.Location;
import net.tokensmith.otter.router.entity.MatchedLocation;
import net.tokensmith.otter.router.entity.io.Answer;
import net.tokensmith.otter.router.entity.io.Ask;
import net.tokensmith.otter.router.exception.HaltException;
import java.util.ArrayList;
import java.util.Optional;
public class Engine {
private Dispatcher dispatcher;
private Dispatcher notFoundDispatcher;
public Engine(Dispatcher dispatcher, Dispatcher notFoundDispatcher) {
this.dispatcher = dispatcher;
this.notFoundDispatcher = notFoundDispatcher;
}
public Answer route(Ask ask, Answer answer) throws HaltException {
Answer resourceAnswer = new Answer();
Optional<MatchedLocation> matchedLocation = dispatcher.find(
ask.getMethod(), ask.getPathWithParams()
);
if (matchedLocation.isPresent()) {
ask.setMatcher(Optional.of(matchedLocation.get().getMatcher()));
ask.setPossibleContentTypes(matchedLocation.get().getLocation().getContentTypes());
ask.setPossibleAccepts(matchedLocation.get().getLocation().getAccepts());
} else {
ask.setMatcher(Optional.empty());
ask.setPossibleContentTypes(new ArrayList<>());
ask.setPossibleAccepts(new ArrayList<>());
}
try {
StatusCode matches = to(matchedLocation, ask);
switch (matches){
case OK:
resourceAnswer = found(matchedLocation.get(), ask, answer);
break;
case NOT_FOUND:
resourceAnswer = notFound(ask, answer);
break;
case UNSUPPORTED_MEDIA_TYPE:
resourceAnswer = unSupportedMediaType(matchedLocation.get(), ask, answer);
break;
case NOT_ACCEPTABLE:
resourceAnswer = notAcceptable(matchedLocation.get(), ask, answer);
break;
}
} catch (HaltException e) {
throw e;
}
return resourceAnswer;
}
protected StatusCode to(Optional<MatchedLocation> matchedLocation, Ask ask) {
StatusCode to = StatusCode.OK;
if (matchedLocation.isEmpty()) {
to = StatusCode.NOT_FOUND;
} else {
Location location = matchedLocation.get().getLocation();
if (location.getContentTypes().size() > 0 && !location.getContentTypes().contains(ask.getContentType())) {
to = StatusCode.UNSUPPORTED_MEDIA_TYPE;
} else if (location.getAccepts().size() > 0 && !location.getAccepts().contains(ask.getAccept())) {
to = StatusCode.NOT_ACCEPTABLE;
}
}
return to;
}
protected Answer found(MatchedLocation foundLocation, Ask ask, Answer answer) throws HaltException {
ask.setMatcher(Optional.of(foundLocation.getMatcher()));
ask.setPossibleContentTypes(foundLocation.getLocation().getContentTypes());
return foundLocation.getLocation().getRouteRunner().run(ask, answer);
}
/**
* Finds the location from the notFoundDispatcher, executes its route, then returns the answer.
* This does not validate that the ask's content type matches the not found's content-type
*
* @param ask Ask to pass to the route runner
* @param answer Answer to pass to the route runner
* @return An Answer from the route runner
* @throws HaltException Could be thrown from the route runner.
*/
protected Answer notFound(Ask ask, Answer answer) throws HaltException {
Optional<MatchedLocation> matchedLocation = notFoundDispatcher.find(ask.getMethod(), ask.getPathWithParams());
MatchedLocation foundLocation = matchedLocation.get();
ask.setMatcher(Optional.of(foundLocation.getMatcher()));
ask.setPossibleContentTypes(foundLocation.getLocation().getContentTypes());
ask.setPossibleAccepts(foundLocation.getLocation().getAccepts());
return matchedLocation.get().getLocation().getRouteRunner().run(ask, answer);
}
protected Answer unSupportedMediaType(MatchedLocation foundLocation, Ask ask, Answer answer) throws HaltException{
ask.setMatcher(Optional.empty());
ask.setPossibleContentTypes(foundLocation.getLocation().getContentTypes());
ask.setPossibleAccepts(foundLocation.getLocation().getAccepts());
RouteRunner mediaTypeRunner = foundLocation.getLocation().getErrorRouteRunners().get(StatusCode.UNSUPPORTED_MEDIA_TYPE);
return mediaTypeRunner.run(ask, answer);
}
protected Answer notAcceptable(MatchedLocation foundLocation, Ask ask, Answer answer) throws HaltException{
ask.setMatcher(Optional.empty());
ask.setPossibleContentTypes(foundLocation.getLocation().getContentTypes());
ask.setPossibleAccepts(foundLocation.getLocation().getAccepts());
RouteRunner notAcceptable = foundLocation.getLocation().getErrorRouteRunners().get(StatusCode.NOT_ACCEPTABLE);
return notAcceptable.run(ask, answer);
}
public Dispatcher getDispatcher() {
return dispatcher;
}
public Dispatcher getNotFoundDispatcher() {
return notFoundDispatcher;
}
}
| [
"tom.s.mackenzie@gmail.com"
] | tom.s.mackenzie@gmail.com |
14ba4c635ec51a1048a478941a26a6f92710ba0a | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module2123_public/src/java/module2123_public/a/Foo2.java | 79e3151105d6b5da800e6d0527eb69611653cc4f | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,530 | java | package module2123_public.a;
import java.awt.datatransfer.*;
import java.beans.beancontext.*;
import java.io.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see java.awt.datatransfer.DataFlavor
* @see java.beans.beancontext.BeanContext
* @see java.io.File
*/
@SuppressWarnings("all")
public abstract class Foo2<E> extends module2123_public.a.Foo0<E> implements module2123_public.a.IFoo2<E> {
java.rmi.Remote f0 = null;
java.nio.file.FileStore f1 = null;
java.sql.Array f2 = null;
public E element;
public static Foo2 instance;
public static Foo2 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return module2123_public.a.Foo0.create(input);
}
public String getName() {
return module2123_public.a.Foo0.getInstance().getName();
}
public void setName(String string) {
module2123_public.a.Foo0.getInstance().setName(getName());
return;
}
public E get() {
return (E)module2123_public.a.Foo0.getInstance().get();
}
public void set(Object element) {
this.element = (E)element;
module2123_public.a.Foo0.getInstance().set(this.element);
}
public E call() throws Exception {
return (E)module2123_public.a.Foo0.getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
583c7c6920c7c384c2f917edd603c65ab43e5118 | 414eef02f9f795aef545b45d4991f974fb98787b | /Architectural-pattern/cqrs/account-service/cqrs-es/cqrs.core/src/main/java/com/techbank/cqrs/core/messages/Message.java | e02de7695ace5dd3063a5b110d74ca31e52afca6 | [] | no_license | DucManhPhan/Design-Pattern | 16c2252b5e9946a7f4f1bc565da23779bfc67a58 | 59143088e1321e9fe5d3f93b85d472452d5c16a6 | refs/heads/master | 2023-07-19T20:57:07.370273 | 2022-12-11T14:50:36 | 2022-12-11T14:50:36 | 142,884,065 | 1 | 1 | null | 2023-07-07T21:53:02 | 2018-07-30T14:06:02 | Java | UTF-8 | Java | false | false | 287 | java | package com.techbank.cqrs.core.messages;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public abstract class Message {
private String id;
}
| [
"ducmanhphan93@gmail.com"
] | ducmanhphan93@gmail.com |
5674e758d11bebb4e448199db3460cb4cfa9fed0 | b214f96566446763ce5679dd2121ea3d277a9406 | /modules/base/util/util-lang/src/main/java/consulo/util/lang/BitUtil.java | f425df103d6ee9be39123f83f3114d4fec43bc6b | [
"Apache-2.0",
"LicenseRef-scancode-jgraph"
] | permissive | consulo/consulo | aa340d719d05ac6cbadd3f7d1226cdb678e6c84f | d784f1ef5824b944c1ee3a24a8714edfc5e2b400 | refs/heads/master | 2023-09-06T06:55:04.987216 | 2023-09-01T06:42:16 | 2023-09-01T06:42:16 | 10,116,915 | 680 | 54 | Apache-2.0 | 2023-06-05T18:28:51 | 2013-05-17T05:48:18 | Java | UTF-8 | Java | false | false | 2,224 | java | /*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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 consulo.util.lang;
public class BitUtil {
public static boolean isSet(byte value, byte mask) {
assertOneBitMask(mask);
return (value & mask) == mask;
}
public static boolean isSet(int value, int mask) {
assertOneBitMask(mask);
return (value & mask) == mask;
}
public static boolean isSet(long flags, long mask) {
assertOneBitMask(mask);
return (flags & mask) == mask;
}
public static byte set(byte value, byte mask, boolean setBit) {
assertOneBitMask(mask);
return (byte)(setBit ? value | mask : value & ~mask);
}
public static int set(int value, int mask, boolean setBit) {
assertOneBitMask(mask);
return setBit ? value | mask : value & ~mask;
}
public static long set(long value, long mask, boolean setBit) {
assertOneBitMask(mask);
return setBit ? value | mask : value & ~mask;
}
public static byte clear(byte value, byte mask) {
return set(value, mask, false);
}
public static int clear(int value, int mask) {
return set(value, mask, false);
}
public static long clear(long value, long mask) {
return set(value, mask, false);
}
private static void assertOneBitMask(byte mask) {
assertOneBitMask(mask & 0xFFL);
}
public static void assertOneBitMask(int mask) {
assertOneBitMask(mask & 0xFFFFFFFFL);
}
private static void assertOneBitMask(long mask) {
assert (mask & mask - 1) == 0 : "Mask must have only one bit set, but got: " + Long.toBinaryString(mask);
}
@Deprecated
public static boolean notSet(final int value, final int mask) {
return (value & mask) != mask;
}
} | [
"vistall.valeriy@gmail.com"
] | vistall.valeriy@gmail.com |
ab41d2852f4981749e42aff48f19c2f2df06ba0a | 1374d8de0a481c4e14360a239f9fcd797c246fa6 | /com/giousa/wx/service/impl/EducInfoServiceImpl.java | f4ce349989cfdf866497a20514e5ffec50d757ee | [] | no_license | Giousa/GoTestProject | 04293f5fa5c27c01f7c4f47bb402fec2451248e3 | df41c9d128e55f0be068f280cfc1e83910abd9a8 | refs/heads/main | 2023-07-01T12:27:48.860912 | 2021-07-28T05:49:39 | 2021-07-28T05:49:39 | 327,627,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 683 | java | package com.giousa.wx.service.impl;
/**
* Description:
* Author:
* Date:
*/
@Service
public class EducInfoServiceImpl implements EducInfoService {
@Autowired
private EducInfoMapper educInfoMapper;
@Override
public ResultVO addEducInfo(EducInfo educInfo) {
return null;
}
@Override
public ResultVO updateEducInfo(EducInfo educInfo) {
return null;
}
@Override
public ResultVO findEducInfoById(String id) {
return null;
}
@Override
public ResultVO deleteEducInfoById(String id) {
return null;
}
@Override
public ResultVO findEducInfoListByPage(int page,int size) {
return null;
}
}
| [
"65489469@qq.com"
] | 65489469@qq.com |
a08711b39df4237672621cd8f933112f494ae2b0 | 258de8e8d556901959831bbdc3878af2d8933997 | /luffy/luffy-core/src/main/java/com/voxlearning/luffy/controller/tobbit/TobbitMathBoostController.java | afb89d4806f052a1d30de2bc69943dfb1a7ed214 | [] | no_license | Explorer1092/vox | d40168b44ccd523748647742ec376fdc2b22160f | 701160b0417e5a3f1b942269b0e7e2fd768f4b8e | refs/heads/master | 2020-05-14T20:13:02.531549 | 2019-04-17T06:54:06 | 2019-04-17T06:54:06 | 181,923,482 | 0 | 4 | null | 2019-04-17T15:53:25 | 2019-04-17T15:53:25 | null | UTF-8 | Java | false | false | 3,956 | java | package com.voxlearning.luffy.controller.tobbit;
import com.voxlearning.alps.core.util.StringUtils;
import com.voxlearning.alps.lang.util.MapMessage;
import com.voxlearning.luffy.controller.MiniProgramController;
import com.voxlearning.utopia.service.ai.api.TobbitMathBoostService;
import com.voxlearning.utopia.service.ai.client.TobbitMathServiceClient;
import com.voxlearning.utopia.service.wechat.api.constants.MiniProgramType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.inject.Inject;
/**
* <a href="http://wiki.17zuoye.net/pages/viewpage.action?pageId=45251113">wiki</a>
*/
@Slf4j
@Controller
@RequestMapping(value = "/mp/tobbit/boost")
public class TobbitMathBoostController extends MiniProgramController {
@Inject
private TobbitMathServiceClient tobbitMathServiceClient;
@Override
protected MiniProgramType type() {
return MiniProgramType.TOBBIT;
}
@Override
public boolean onBeforeControllerMethod() {
return true;
}
@RequestMapping(value = "/status.vpage")
@ResponseBody
public MapMessage status() {
String bid = getRequestString("bid");
String openId = getOpenId();
if (StringUtils.isBlank(openId)) {
return MapMessage.errorMessage("没权限访问");
}
return wrapper((mm) -> {
mm.putAll(boostServ().status(openId, uid(),bid));
});
}
@RequestMapping(value = "/append.vpage", method = RequestMethod.POST)
@ResponseBody
public MapMessage append() {
String openId = getOpenId();
if (StringUtils.isBlank(openId)) {
return MapMessage.errorMessage("没权限访问");
}
String bid = getRequestString("bid");
String name = getRequestString("name");
String avatar = getRequestString("avatar");
if (StringUtils.isAnyBlank(bid, avatar)) {
return MapMessage.errorMessage("参数错误");
}
return wrapper((mm) -> {
mm.putAll(boostServ().appendBoost(bid, openId, name, avatar));
});
}
@RequestMapping(value = "/new.vpage", method = RequestMethod.POST)
@ResponseBody
public MapMessage newBoost() {
String openId = getOpenId();
if (StringUtils.isBlank(openId)) {
return MapMessage.errorMessage("没权限访问");
}
String bookId = getRequestString("bookId");
String name = getRequestString("name");
String tel = getRequestString("tel");
String city = getRequestString("city");
String addr = getRequestString("addr");
if (StringUtils.isAnyBlank(bookId, name, tel, city, addr)) {
return MapMessage.errorMessage("参数错误");
}
return wrapper((mm) -> {
mm.putAll(boostServ().newBoost(openId, uid(), bookId, name, tel, city, addr));
});
}
@RequestMapping(value = "/books.vpage")
@ResponseBody
public MapMessage books() {
String openId = getOpenId();
if (StringUtils.isBlank(openId)) {
return MapMessage.errorMessage("没权限访问");
}
return wrapper((mm) -> {
mm.putAll(boostServ().oralBookList());
});
}
@RequestMapping(value = "/scrolling.vpage")
@ResponseBody
public MapMessage scrolling() {
String openId = getOpenId();
if (StringUtils.isBlank(openId)) {
return MapMessage.errorMessage("没权限访问");
}
return wrapper((mm) -> {
mm.putAll(boostServ().scrollingList());
});
}
private TobbitMathBoostService boostServ() {
return tobbitMathServiceClient.getTobbitMathBoostService();
}
}
| [
"wangahai@300.cn"
] | wangahai@300.cn |
d8f8d0dd7adee0fccd13d09094da4b7fc41e2ed6 | 15b260ccada93e20bb696ae19b14ec62e78ed023 | /v2/src/main/java/com/alipay/api/request/AlipayDataBillBizfundagentQueryRequest.java | 97a1771f105e4d2ccfd308739b9b1246aa8e9e0d | [
"Apache-2.0"
] | permissive | alipay/alipay-sdk-java-all | df461d00ead2be06d834c37ab1befa110736b5ab | 8cd1750da98ce62dbc931ed437f6101684fbb66a | refs/heads/master | 2023-08-27T03:59:06.566567 | 2023-08-22T14:54:57 | 2023-08-22T14:54:57 | 132,569,986 | 470 | 207 | Apache-2.0 | 2022-12-25T07:37:40 | 2018-05-08T07:19:22 | Java | UTF-8 | Java | false | false | 3,029 | java | package com.alipay.api.request;
import com.alipay.api.domain.AlipayDataBillBizfundagentQueryModel;
import java.util.Map;
import com.alipay.api.AlipayRequest;
import com.alipay.api.internal.util.AlipayHashMap;
import com.alipay.api.response.AlipayDataBillBizfundagentQueryResponse;
import com.alipay.api.AlipayObject;
/**
* ALIPAY API: alipay.data.bill.bizfundagent.query request
*
* @author auto create
* @since 1.0, 2023-05-29 23:11:16
*/
public class AlipayDataBillBizfundagentQueryRequest implements AlipayRequest<AlipayDataBillBizfundagentQueryResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* ISV代理商户资金业务账单查询
*/
private String bizContent;
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null;
public String getNotifyUrl() {
return this.notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getReturnUrl() {
return this.returnUrl;
}
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
public String getApiVersion() {
return this.apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
public String getTerminalType(){
return this.terminalType;
}
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public String getTerminalInfo(){
return this.terminalInfo;
}
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
public String getProdCode() {
return this.prodCode;
}
public String getApiMethodName() {
return "alipay.data.bill.bizfundagent.query";
}
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("biz_content", this.bizContent);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
public Class<AlipayDataBillBizfundagentQueryResponse> getResponseClass() {
return AlipayDataBillBizfundagentQueryResponse.class;
}
public boolean isNeedEncrypt() {
return this.needEncrypt;
}
public void setNeedEncrypt(boolean needEncrypt) {
this.needEncrypt=needEncrypt;
}
public AlipayObject getBizModel() {
return this.bizModel;
}
public void setBizModel(AlipayObject bizModel) {
this.bizModel=bizModel;
}
}
| [
"auto-publish"
] | auto-publish |
40f2240c72da25d7534b34928fbb6a49a0d1670b | 3b91ed788572b6d5ac4db1bee814a74560603578 | /com/tencent/mm/ui/chatting/viewitems/r.java | e2ecd44062a71f1ff7701006f4923a0412be6ce2 | [] | no_license | linsir6/WeChat_java | a1deee3035b555fb35a423f367eb5e3e58a17cb0 | 32e52b88c012051100315af6751111bfb6697a29 | refs/heads/master | 2020-05-31T05:40:17.161282 | 2018-08-28T02:07:02 | 2018-08-28T02:07:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,543 | java | package com.tencent.mm.ui.chatting.viewitems;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.tencent.mm.R;
import com.tencent.mm.bp.a;
import com.tencent.mm.sdk.platformtools.x;
public final class r extends RelativeLayout {
private LayoutInflater eMa;
private int ucc;
public r(LayoutInflater layoutInflater, int i) {
super(layoutInflater.getContext());
this.eMa = layoutInflater;
this.ucc = i;
View inflate = this.eMa.inflate(R.i.chatting_history_msg_tip_layout, null);
LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -2);
inflate.setId(R.h.chatting_histroy_msg_tip);
layoutParams.setMargins(0, getResources().getDimensionPixelSize(R.f.NormalPadding), 0, getResources().getDimensionPixelSize(R.f.NormalPadding));
inflate.setVisibility(8);
addView(inflate, layoutParams);
inflate = new TextView(getContext(), null, R.m.ChattingUISplit);
inflate.setId(R.h.chatting_time_tv);
int dimensionPixelSize = inflate.getResources().getDimensionPixelSize(R.f.SmallestTextSize);
if (a.ad(getContext(), R.f.SmallestTextSize) != dimensionPixelSize) {
x.e("MicroMsg.ChattingItemContainer", "warn!!! cacheSize:%s sysSize:%s", new Object[]{Integer.valueOf(a.ad(getContext(), R.f.SmallestTextSize)), Integer.valueOf(dimensionPixelSize)});
}
inflate.setTextSize(0, (float) dimensionPixelSize);
layoutParams = new RelativeLayout.LayoutParams(-2, -2);
layoutParams.addRule(3, R.h.chatting_histroy_msg_tip);
layoutParams.addRule(14);
layoutParams.setMargins(0, getResources().getDimensionPixelSize(R.f.NormalPadding), 0, getResources().getDimensionPixelSize(R.f.NormalPadding));
addView(inflate, layoutParams);
CheckBox checkBox = (CheckBox) LayoutInflater.from(getContext()).inflate(R.i.mm_big_checkbox, this, false);
checkBox.setId(R.h.chatting_checkbox);
dimensionPixelSize = a.fromDPToPix(getContext(), 32);
LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(dimensionPixelSize, dimensionPixelSize);
layoutParams2.setMargins(0, getResources().getDimensionPixelSize(R.f.BasicPaddingSize), getResources().getDimensionPixelSize(R.f.SmallPadding), 0);
layoutParams2.addRule(3, R.h.chatting_time_tv);
layoutParams2.addRule(11);
layoutParams2.width = dimensionPixelSize;
layoutParams2.height = dimensionPixelSize;
addView(checkBox, layoutParams2);
View inflate2 = this.eMa.inflate(this.ucc, null);
int id = inflate2.getId();
if (-1 == id) {
x.v("MicroMsg.ChattingItemContainer", "content view has no id, use defaul id");
id = R.h.chatting_content_area;
inflate2.setId(R.h.chatting_content_area);
}
layoutParams2 = new RelativeLayout.LayoutParams(-1, -2);
layoutParams2.addRule(3, R.h.chatting_time_tv);
layoutParams2.addRule(0, R.h.chatting_checkbox);
addView(inflate2, layoutParams2);
inflate2 = new View(getContext());
inflate2.setId(R.h.chatting_maskview);
inflate2.setVisibility(8);
layoutParams2 = new RelativeLayout.LayoutParams(-1, -1);
layoutParams2.addRule(6, id);
layoutParams2.addRule(8, id);
addView(inflate2, layoutParams2);
}
}
| [
"707194831@qq.com"
] | 707194831@qq.com |
b9f6ec655d23ef1b0c87afc6a810b378e1405db2 | 3efecbdce5edf4aea349ba92a06066ec87f5bc41 | /test/org/ddogleg/fitting/modelset/GenericModelMatcherTests.java | 1ebc2a7c04ad160694b0b44d02ff96068c9b97aa | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | lessthanoptimal/ddogleg | c15065f15d7256d2a43c364ab67714e202e69b7e | 58c50b359e7cb44753d852ea38132d7f84228d77 | refs/heads/SNAPSHOT | 2023-09-03T17:32:38.366931 | 2023-04-22T14:48:30 | 2023-04-22T14:49:22 | 6,781,936 | 51 | 15 | null | 2023-02-15T01:47:47 | 2012-11-20T17:23:48 | Java | UTF-8 | Java | false | false | 7,845 | java | /*
* Copyright (c) 2012-2020, Peter Abeles. All Rights Reserved.
*
* This file is part of DDogleg (http://ddogleg.org).
*
* 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.ddogleg.fitting.modelset;
import org.ddogleg.fitting.modelset.distance.DistanceFromMeanModel;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* A series of tests are provided that test to see the provided model set algorithm has the expected
* behavior. This includes removing outliers and estimating the model parameters. The test
* cases tend to be fairly easy so that they will work on all model set algorithms.
*
* @author Peter Abeles
*/
public abstract class GenericModelMatcherTests {
protected Random rand = new Random(0x353456);
// how many of the points is it expected to match
protected double minMatchFrac = 1.0;
// how close does the parameter set need to be
protected double parameterTol = 1e-8;
// should it check the inlier set for accuracy
protected boolean checkInlierSet = true;
// mean of the true inlier set
// this value is the best estimate that can possibly be done
private double inlierMean;
// If the model matcher is deterministic and doesn't use any random numbers
protected boolean deterministic = false;
protected void configure( double minMatchFrac, double parameterTol, boolean checkInlierSet ) {
this.minMatchFrac = minMatchFrac;
this.parameterTol = parameterTol;
this.checkInlierSet = checkInlierSet;
}
/**
* Sees if it can correctly select a model set and determine the best fit parameters for
* a simple test case.
*/
@Test
public void performSimpleModelFit() {
double mean = 2.5;
double tol = 0.2;
// generate the points with a smaller tolerance to account for fitting error
// later on.
ModelMatcher<double[], Double> alg = createModel(4, tol*0.95);
List<Double> samples = createSampleSet(100, mean, tol, 0.1);
assertTrue(alg.process(samples));
List<Double> matchSet = alg.getMatchSet();
if (checkInlierSet)
assertTrue(matchSet.size()/90.0 >= minMatchFrac);
assertEquals(inlierMean, alg.getModelParameters()[0], parameterTol);
}
/**
* Multiple data sets are processed in an attempt to see if it is properly reinitializing
* itself and returns the correct solutions.
*/
@Test
public void runMultipleTimes() {
double mean = 2.5;
double tol = 0.2;
// generate the points with a smaller tolerance to account for fitting error
// later on.
ModelMatcher<double[], Double> alg = createModel(4, tol);
for (int i = 0; i < 10; i++) {
// try different sample sizes in each trial. a bug was found once where
// a small value of N than previous caused a problem
int N = 200 - i*10;
List<Double> samples = createSampleSet(N, mean, tol*0.90, 0.1);
assertTrue(alg.process(samples));
List<Double> matchSet = alg.getMatchSet();
double foundMean = alg.getModelParameters()[0];
if (checkInlierSet)
assertTrue(matchSet.size()/(N*0.9) >= minMatchFrac);
assertEquals(inlierMean, foundMean, parameterTol);
}
}
/**
* Creates a set of sample points that are part of the model and some outliers
*
* @param numPoints Number of sample points it will generate
* @param mean Mean of the distribution
* @param modelDist How close to the model do the points need to be.
* @param fracOutlier Fraction of the points which will be outliers.
* @return Set of sample points
*/
protected List<Double> createSampleSet( int numPoints, double mean, double modelDist, double fracOutlier ) {
List<Double> ret = new ArrayList<>();
double numOutlier = (int)(numPoints*fracOutlier);
inlierMean = 0;
for (int i = 0; i < numPoints - numOutlier; i++) {
double d = mean + (rand.nextDouble() - 0.5)*2.0*modelDist;
inlierMean += d;
ret.add(d);
}
inlierMean /= ret.size();
while (ret.size() < numPoints) {
double d = (rand.nextDouble() - 0.5)*200*modelDist;
// add a point if its sufficiently far away from the model
if (Math.abs(d) > modelDist*10) {
ret.add(d);
}
}
// randomize the order
Collections.shuffle(ret, rand);
return ret;
}
/**
* Make sure the function getInputIndex() returns the original index
*/
@Test
public void checkMatchSetToInputIndex() {
double mean = 2.5;
double tol = 0.2;
// generate the points with a smaller tolerance to account for fitting error
// later on.
ModelMatcher<double[], Double> alg = createModel(4, tol*0.95);
List<Double> samples = createSampleSet(100, mean, tol, 0.1);
assertTrue(alg.process(samples));
List<Double> matchSet = alg.getMatchSet();
// sanity check to make sure there is a large enough match set
assertTrue(matchSet.size() > 20);
int orderNotTheSame = 0;
for (int i = 0; i < matchSet.size(); i++) {
int expected = samples.indexOf(matchSet.get(i));
int found = alg.getInputIndex(i);
if (found != i)
orderNotTheSame++;
assertEquals(expected, found);
}
// sanity check to make sure the order has been changed
assertTrue(orderNotTheSame != matchSet.size());
}
/**
* Make sure that if reset is called it produces identical results
*/
@Test
public void reset() {
double mean = 2.5;
// generate the points with a smaller tolerance to account for fitting error
// later on.
ModelMatcher<double[], Double> alg = createModel(1, 0.6);
// Create a uniform sample with multiple just as good solutions so it's unlikely that two random
// draws will get the exact same solution
List<Double> samples = new ArrayList<>();
for (int i = 0; i < 500; i++) {
samples.add(mean - (0.5 - i/500.0)*2.0);
}
assertTrue(alg.process(samples));
List<Double> matchesA = new ArrayList<>(alg.getMatchSet());
assertTrue(alg.process(samples));
List<Double> matchesB = new ArrayList<>(alg.getMatchSet());
// See if this produces different results
boolean matched = matchesA.size() == matchesB.size();
if (matched) {
for (int i = 0; i < matchesA.size(); i++) {
if (!matchesA.get(i).equals(matchesB.get(i))) {
matched = false;
break;
}
}
}
assertEquals(deterministic, matched);
if (deterministic)
return;
// It should now produce identical results to the first run
alg.reset();
assertTrue(alg.process(samples));
List<Double> matchesC = new ArrayList<>(alg.getMatchSet());
assertEquals(matchesA.size(), matchesC.size());
for (int i = 0; i < matchesA.size(); i++) {
assertEquals(matchesA.get(i), matchesC.get(i));
}
}
protected ModelMatcher<double[], Double> createModel( int minPoints, double fitThreshold ) {
DoubleArrayManager manager = new DoubleArrayManager(1);
DistanceFromMeanModel dist = new DistanceFromMeanModel();
MeanModelFitter fitter = new MeanModelFitter();
return createModelMatcher(manager, dist, fitter, fitter, minPoints, fitThreshold);
}
public abstract ModelMatcher<double[], Double> createModelMatcher(
ModelManager<double[]> manager,
DistanceFromModel<double[], Double> distance,
ModelGenerator<double[], Double> generator,
ModelFitter<double[], Double> fitter,
int minPoints, double fitThreshold );
}
| [
"peter.abeles@gmail.com"
] | peter.abeles@gmail.com |
871f29a16dd7f737007ab440d250bff2c655d90d | 03af1d66f21eff029d238d56ffa40df4edc5c530 | /valkyrie/src/test/java/us/ihmc/valkyrie/ValkyrieBranchJobBalancerTest.java | 35fd34a68acb40b6c977e611c5586b7ef62a4739 | [
"Apache-2.0"
] | permissive | stevewen/ihmc-open-robotics-software | 2d702a256f80775b091b3c947f61542350080485 | a8e89934e75cc7026bc3e082397d989a26c7549e | refs/heads/master | 2020-04-09T17:22:49.997637 | 2018-12-05T00:02:04 | 2018-12-05T00:02:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package us.ihmc.valkyrie;
import org.junit.Test;
import us.ihmc.continuousIntegration.ContinuousIntegrationAnnotations.ContinuousIntegrationTest;
public class ValkyrieBranchJobBalancerTest
{
@ContinuousIntegrationTest(estimatedDuration = 180.0)
@Test(timeout = 30000)
public void testExtraTimeToSyncJobs()
{
}
}
| [
"dcalvert@ihmc.us"
] | dcalvert@ihmc.us |
d28aaf9ec712bfdb9f4920561df2ae2ed94a7008 | 75d5f2955b7cc38dbed300a9c77ef1cdc77df0fe | /ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationsSpectraS3ResponseParser.java | a5c1c780bdd41d71950826c0371131c9a40c01de | [
"Apache-2.0"
] | permissive | shabtaisharon/ds3_java_sdk | 00b4cc960daf2007c567be04dd07843c814a475f | f97d10d0e644f20a7a40c5e51101bab3e4bd6c8f | refs/heads/master | 2021-01-18T00:44:19.369801 | 2018-09-18T18:17:23 | 2018-09-18T18:17:23 | 43,845,561 | 0 | 0 | null | 2015-10-07T21:25:06 | 2015-10-07T21:25:06 | null | UTF-8 | Java | false | false | 2,836 | java | /*
* ******************************************************************************
* Copyright 2014-2017 Spectra Logic Corporation. 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://www.apache.org/licenses/LICENSE-2.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.
* ****************************************************************************
*/
// This code is auto-generated, do not modify
package com.spectralogic.ds3client.commands.parsers;
import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser;
import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils;
import com.spectralogic.ds3client.commands.spectrads3.notifications.GetSystemFailureNotificationRegistrationsSpectraS3Response;
import com.spectralogic.ds3client.models.SystemFailureNotificationRegistrationList;
import com.spectralogic.ds3client.networking.WebResponse;
import com.spectralogic.ds3client.serializer.XmlOutput;
import java.io.IOException;
import java.io.InputStream;
public class GetSystemFailureNotificationRegistrationsSpectraS3ResponseParser extends AbstractResponseParser<GetSystemFailureNotificationRegistrationsSpectraS3Response> {
private final int[] expectedStatusCodes = new int[]{200};
@Override
public GetSystemFailureNotificationRegistrationsSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException {
final int statusCode = response.getStatusCode();
final Integer pagingTruncated = parseIntHeader("page-truncated");
final Integer pagingTotalResultCount = parseIntHeader("total-result-count");
if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) {
switch (statusCode) {
case 200:
try (final InputStream inputStream = response.getResponseStream()) {
final SystemFailureNotificationRegistrationList result = XmlOutput.fromXml(inputStream, SystemFailureNotificationRegistrationList.class);
return new GetSystemFailureNotificationRegistrationsSpectraS3Response(result, pagingTotalResultCount, pagingTruncated, this.getChecksum(), this.getChecksumType());
}
default:
assert false: "validateStatusCode should have made it impossible to reach this line";
}
}
throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes);
}
} | [
"rachelt@spectralogic.com"
] | rachelt@spectralogic.com |
fb19b4eddcf4aa43ccee140dd7aae7ed0db824e8 | cb2ff548d3c11d90e96b8485112fa52062b7ca43 | /src/main/java/com/gmail/thelimeglass/Expressions/ExprLlamaColorType.java | f07545d0a87fff9cea555e16f8eb37bcd1e8db7c | [
"Apache-2.0"
] | permissive | Tominous/Skellett | 31e51ba11ae20fb444adbec221d774c5df9147b2 | aadd0e259cfd120540b9d5251c5cd02a049c69db | refs/heads/master | 2020-12-22T11:26:51.745998 | 2020-01-28T15:22:08 | 2020-01-28T15:22:08 | 236,766,485 | 1 | 0 | Apache-2.0 | 2020-01-28T15:19:26 | 2020-01-28T15:19:25 | null | UTF-8 | Java | false | false | 2,234 | java | package com.gmail.thelimeglass.Expressions;
import javax.annotation.Nullable;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Llama;
import org.bukkit.event.Event;
import com.gmail.thelimeglass.Utils.Annotations.Config;
import com.gmail.thelimeglass.Utils.Annotations.PropertyType;
import com.gmail.thelimeglass.Utils.Annotations.RegisterEnum;
import com.gmail.thelimeglass.Utils.Annotations.Syntax;
import com.gmail.thelimeglass.Utils.Annotations.Version;
import ch.njol.skript.classes.Changer;
import ch.njol.skript.classes.Changer.ChangeMode;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;
import ch.njol.util.coll.CollectionUtils;
@Syntax({"Llama colo[u]r of %entity%", "Llama %entity%'s colo[u]r", "%entity%['s] Llama colo[u]r"})
@Config("LlamaColour")
@PropertyType(ExpressionType.COMBINED)
@Version("1.11")
@RegisterEnum("llamacolor")
public class ExprLlamaColorType extends SimpleExpression<Llama.Color>{
private Expression<Entity> llama;
@Override
public Class<? extends Llama.Color> getReturnType() {
return Llama.Color.class;
}
@Override
public boolean isSingle() {
return true;
}
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] e, int matchedPattern, Kleenean isDelayed, ParseResult parser) {
llama = (Expression<Entity>) e[0];
return true;
}
@Override
public String toString(@Nullable Event e, boolean arg1) {
return "Llama colo[u]r of %entity%";
}
@Override
@Nullable
protected Llama.Color[] get(Event e) {
if (llama.getSingle(e) instanceof Llama) {
return new Llama.Color[]{((Llama) llama.getSingle(e)).getColor()};
}
return null;
}
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
if (mode == ChangeMode.SET) {
if (!(llama.getSingle(e) instanceof Llama)) {
return;
}
((Llama) llama.getSingle(e)).setColor((Llama.Color)delta[0]);
}
}
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
if (mode == ChangeMode.SET) {
return CollectionUtils.array(Llama.Color.class);
}
return null;
}
} | [
"seantgrover@gmail.com"
] | seantgrover@gmail.com |
16467b9ed5b134b4e27231b8454bc0dbf50da374 | d5e5129850e4332a8d4ccdcecef81c84220538d9 | /Courses/TestingXP_WMD/src/com/wmd/sandbox/test/Problem.java | d6e04f7c5c0dec409d535e767ecc6edd0461711b | [] | no_license | ClickerMonkey/ship | e52da76735d6bf388668517c033e58846c6fe017 | 044430be32d4ec385e01deb17de919eda0389d5e | refs/heads/master | 2020-03-18T00:43:52.330132 | 2018-05-22T13:45:14 | 2018-05-22T13:45:14 | 134,109,816 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 567 | java | package com.wmd.sandbox.test;
import com.wmd.sandbox.Tuple;
public class Problem extends Tuple
{
public static final int ID = 0;
public static final int NAME = 1;
public static final int SET_ID = 2;
public static final int STATEMENT = 3;
public Problem() {
super(Tables.Problems);
}
public Problem(long id) {
super(Tables.Problems);
set(ID, id);
}
public Problem(String name, long set_id, String statement) {
super(Tables.Problems);
set(NAME, name);
set(SET_ID, set_id);
set(STATEMENT, statement);
}
}
| [
"pdiffenderfer@gmail.com"
] | pdiffenderfer@gmail.com |
85adc6f9ac8c22a37d1a70be9e8df70da32395e0 | 878bece606bb57e4bf1d3bc57e70bc2bd46dab63 | /server-api/src/main/java/org/jboss/lhotse/server/api/lifecycle/Notification.java | 9c28f5867b66c9249be0c38f23a9bd40c9abb859 | [] | no_license | matejonnet/lhotse | a1830194638bb599294b8bb0fa4342244a2b8220 | 6e2b0a98d7c897345674c99518677fe4060f4fd9 | refs/heads/master | 2021-01-20T23:24:27.016026 | 2011-04-15T14:03:35 | 2011-04-15T14:03:35 | 1,590,828 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,324 | java | /*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.lhotse.server.api.lifecycle;
/**
* Notification value.
*
* @param <T> exact value type
* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
*/
public interface Notification<T>
{
/**
* Get value.
*
* @return the value
*/
T value();
}
| [
"ales.justin@gmail.com"
] | ales.justin@gmail.com |
269660052f5317df2f512660a2ba24713342ad93 | a70c357f151cf2b7942bc00f942a4d25ea9037ad | /src/main/java/org/practice/designpatterns/behavioural/interpreter/TerminalExpression.java | c0eb1ec0a6b493e471fab238d13204cf625a9a55 | [] | no_license | SujanKumarMitra/design-patterns | 9836dc826e72a3e947e91b348d5471904d09d7e4 | f1bf99eb2e57e1cac9f8fe97eeb4f7f976d44acf | refs/heads/master | 2022-12-26T14:48:41.230241 | 2020-10-11T17:14:32 | 2020-10-11T17:14:32 | 298,303,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package org.practice.designpatterns.behavioural.interpreter;
/**
* @author Sujan Kumar Mitra
* @since 2020-10-03
*/
public class TerminalExpression implements Expression {
String data;
public TerminalExpression(String data) {
this.data = data;
}
@Override
public boolean interpret(String context) {
return context.contains(data);
}
}
| [
"mitrakumarsujan@gmail.com"
] | mitrakumarsujan@gmail.com |
a07b8e7bb04ee99b2c94bccb5585b290bc4bc1e2 | 96f8d42c474f8dd42ecc6811b6e555363f168d3e | /baike/sources/android/support/design/internal/e.java | bae8f8c92cf685287b050841fdae9a5d42e13baf | [] | no_license | aheadlcx/analyzeApk | 050b261595cecc85790558a02d79739a789ae3a3 | 25cecc394dde4ed7d4971baf0e9504dcb7fabaca | refs/heads/master | 2020-03-10T10:24:49.773318 | 2018-04-13T09:44:45 | 2018-04-13T09:44:45 | 129,332,351 | 6 | 2 | null | null | null | null | UTF-8 | Java | false | false | 602 | java | package android.support.design.internal;
import android.os.Parcel;
import android.os.Parcelable.ClassLoaderCreator;
final class e implements ClassLoaderCreator<ParcelableSparseArray> {
e() {
}
public ParcelableSparseArray createFromParcel(Parcel parcel, ClassLoader classLoader) {
return new ParcelableSparseArray(parcel, classLoader);
}
public ParcelableSparseArray createFromParcel(Parcel parcel) {
return new ParcelableSparseArray(parcel, null);
}
public ParcelableSparseArray[] newArray(int i) {
return new ParcelableSparseArray[i];
}
}
| [
"aheadlcxzhang@gmail.com"
] | aheadlcxzhang@gmail.com |
13d0c69391ec615143d8858c4a84016ce1920d7e | 11c3292712a3cc0a87475c92755c1d81616d691d | /src/main/java/xdean/css/editor/context/setting/OtherSettings.java | 1ef54b99499d32e4d784a5090e7b8788607f3a53 | [
"Apache-2.0"
] | permissive | XDean/CSS-Editor-FX | 7afe1c0c11e5730dfedba36c356bb3fa2e14b066 | 9fb891b71fdfa46b675a4d1d31eb694795d2c586 | refs/heads/master | 2022-12-08T19:27:05.590675 | 2022-11-25T09:17:27 | 2022-11-25T09:17:27 | 77,589,648 | 17 | 10 | Apache-2.0 | 2021-03-18T03:16:59 | 2016-12-29T06:42:07 | Java | UTF-8 | Java | false | false | 1,630 | java | package xdean.css.editor.context.setting;
import static xdean.css.editor.context.setting.SettingKeys.LANGUAGE;
import static xdean.css.editor.context.setting.SettingKeys.RECENT_LOC;
import static xdean.css.editor.context.setting.SettingKeys.SKIN;
import java.util.Locale;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import xdean.css.editor.context.setting.DefaultValue.DefaultSkin;
import xdean.css.editor.context.setting.SettingKeys.Find;
import xdean.css.editor.context.setting.model.option.BooleanOption;
import xdean.css.editor.context.setting.model.option.Option;
import xdean.css.editor.context.setting.model.option.SimpleOption;
import xdean.css.editor.context.setting.model.option.StringOption;
import xdean.jfxex.util.StringConverters;
@Configuration
public class OtherSettings {
@Bean(LANGUAGE)
public Option<Locale> locale() {
return new SimpleOption<>(LANGUAGE, DefaultValue.DEFAULT_LOCALE, StringConverters.create(Locale::forLanguageTag));
}
@Bean(SKIN)
public StringOption skin() {
return new StringOption(SKIN, DefaultSkin.CLASSIC.getName());
}
@Bean(RECENT_LOC)
public StringOption recent() {
return new StringOption(RECENT_LOC, "");
}
@Bean(Find.WRAP_SEARCH)
public BooleanOption wrapSearch() {
return new BooleanOption(Find.WRAP_SEARCH, true);
}
@Bean(Find.REGEX)
public BooleanOption regexSearch() {
return new BooleanOption(Find.REGEX, false);
}
@Bean(Find.CASE_SENSITIVE)
public BooleanOption caseSensitive() {
return new BooleanOption(Find.CASE_SENSITIVE, false);
}
}
| [
"373216024@qq.com"
] | 373216024@qq.com |
d16f9141e7fd15158363ff4d8b037dde00e293c3 | eb9f655206c43c12b497c667ba56a0d358b6bc3a | /java/java-tests/testData/inspection/dataFlow/fixture/InstanceQualifiedStaticMember.java | 4d970e5bfc47887f9a7c8b03bbcec515e0ea944c | [
"Apache-2.0"
] | permissive | JetBrains/intellij-community | 2ed226e200ecc17c037dcddd4a006de56cd43941 | 05dbd4575d01a213f3f4d69aa4968473f2536142 | refs/heads/master | 2023-09-03T17:06:37.560889 | 2023-09-03T11:51:00 | 2023-09-03T12:12:27 | 2,489,216 | 16,288 | 6,635 | Apache-2.0 | 2023-09-12T07:41:58 | 2011-09-30T13:33:05 | null | UTF-8 | Java | false | false | 178 | java | class Null {
public static void greet() {
System.out.println("Hello World");
}
public static void main(String[] args) {
Null null1 = null;
null1.greet();
}
} | [
"intellij-monorepo-bot-no-reply@jetbrains.com"
] | intellij-monorepo-bot-no-reply@jetbrains.com |
2b41cef30ed8865eb93487d892a30b468dc96faa | 3b150be1b781b17495e43c73daab94a940ba1fef | /MainClient/src/main/java/com/fdl/wedgit/LoadingBg.java | df172c3387856c71016372c7166651ec9acecb51 | [] | no_license | DreamFly01/SuanNiHen | e43346a86eb156e36b3eb643e176e735811c4024 | c10832fb402a011a93923d074d5755b64ccf1d93 | refs/heads/master | 2022-01-06T21:52:02.597929 | 2019-08-02T03:06:49 | 2019-08-02T03:06:49 | 195,406,683 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,048 | java | package com.fdl.wedgit;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.sg.cj.snh.R;
/**
* <p>desc:<p>
* <p>author:DreamFly<p>
* <p>creatTime:2018/11/19<p>
* <p>changeTime:2018/11/19<p>
* <p>version:1<p>
*/
public class LoadingBg extends LinearLayout implements View.OnClickListener {
public LoadingBg(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initialView(context);
}
private ImageView iv_loading;
private LinearLayout ll_erro_bg;
private LinearLayout ll_loading_bg;
private Button btn_cs;
private LinearLayout ll_view_bg;
@Override
public void onClick(View view) {
iv_loading.setVisibility(View.VISIBLE);
ll_loading_bg.setVisibility(View.VISIBLE);
ll_erro_bg.setVisibility(View.GONE);
if (null != ycErro) {
ycErro.onTryAgainClick();
}
}
private ErroLisener ycErro;
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
public interface ErroLisener {
void onTryAgainClick();
}
private void initialView(Context context) {
View.inflate(context, R.layout.custom_progress, this);
setVisibility(View.VISIBLE);
ll_loading_bg = (LinearLayout) findViewById(R.id.ll_loading_bg);
ll_view_bg = (LinearLayout) findViewById(R.id.ll_02);
ll_view_bg.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//阻止事件向下传递
}
});
iv_loading = (ImageView) findViewById(R.id.spinnerImageView);
ll_erro_bg = (LinearLayout) findViewById(R.id.ll_01);
btn_cs = (Button) findViewById(R.id.btn_try_again);
spinner = (AnimationDrawable) iv_loading.getBackground();
assert spinner != null;
// 默认一加载该布局就开始执行 加载动画
spinner.start();
// Glide.with(context).load(R.drawable.carloding).asGif().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(iv_loading);
}
private AnimationDrawable spinner;
public void showErroBg(ErroLisener ycerro) {
this.ycErro = ycerro;
setVisibility(View.VISIBLE);
iv_loading.setVisibility(View.GONE);
ll_erro_bg.setVisibility(View.VISIBLE);
btn_cs.setOnClickListener(this);
ll_loading_bg.setVisibility(View.GONE);
}
public void showLoadingBg() {
setVisibility(View.VISIBLE);
iv_loading.setVisibility(View.VISIBLE);
ll_erro_bg.setVisibility(View.GONE);
ll_loading_bg.setVisibility(View.VISIBLE);
}
public void dissmiss() {
setVisibility(View.GONE);
}
}
| [
"y290206959@163.com"
] | y290206959@163.com |
3c3c471aa18325921785e2086af0f525826abe04 | 40074451d5efb09bb7e90afad2b4d91e3bd884c7 | /eagle-core/src/test/java/in/hocg/eagle/modules/oms/helper/OrderHelperTest.java | 82c70e328330dc83f809f5b2faa7d6db263b7e9d | [] | no_license | zgwdg/eagle | 744fc699662818a85a87a1d64a4b218d4c7e7ebd | f7d4037973b6ef046bf842117f79239fb1a81fca | refs/heads/master | 2023-03-27T20:59:58.824963 | 2021-04-01T04:27:32 | 2021-04-01T04:27:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | package in.hocg.eagle.modules.oms.helper;
/**
* Created by hocgin on 2020/3/18.
* email: hocgin@gmail.com
*
* @author hocgin
*/
class OrderHelperTest {
}
| [
"hocgin@gmail.com"
] | hocgin@gmail.com |
548f8accd5c1d78d3f35c49bd07cfd13022fbc34 | ed64cc0df1311c75e13da0f37009c1675675f756 | /My Frame Animation/src/kr/co/wikibook/my_frame_animation/MyFrameAnimationActivity.java | 1f6ff128bb57d7d679f62d3c228252b2fd0d6df2 | [] | no_license | wikibook/androidgingerbread | 192fd57cfc426089357e24af408fd2fe52d0e4b7 | 1aca0ed5125c69f7a1bcbc4ccc6b9058b312c23f | refs/heads/master | 2021-01-01T16:51:19.421342 | 2013-10-22T13:25:41 | 2013-10-22T13:25:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package kr.co.wikibook.my_frame_animation;
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;
public class MyFrameAnimationActivity extends Activity {
AnimationDrawable animation;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView iv = (ImageView) findViewById(R.id.imageview);
iv.setBackgroundResource(R.drawable.my_frame_animation);
animation = (AnimationDrawable) iv.getBackground();
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
animation.start();
}
} | [
"dylee@wikibook.co.kr"
] | dylee@wikibook.co.kr |
35284f970924683991ce43493219fe8826b1e60a | 1e9c9f2a9639db7cdb032aae69cb4d99aef1d3a5 | /codeChef/src/medium/unsolved/AngryChefCrispyChips.java | 389aa15a457dcc7fb6800b929c9ea8acfa981466 | [
"MIT"
] | permissive | sagarnikam123/learnNPractice | f0da3f8acf653e56c591353ab342765a6831698c | 1b3b0cb2cff2f478006626a4c37a99102acbb628 | refs/heads/master | 2023-02-04T11:21:18.211654 | 2023-01-24T14:47:52 | 2023-01-24T14:47:52 | 61,184,927 | 2 | 1 | MIT | 2022-03-06T11:07:18 | 2016-06-15T06:57:19 | Python | UTF-8 | Java | false | false | 2,502 | java | /**
Angry Chef - Crispy Chips
Did you know that potato was the first food that was ever grown in space ? Today is a big day for chef Crum,
as he was called to make potato dishes for the people of the Valley of Food. He got angry knowing someone said that
his potatoes were thick and so he started making them too thin and crisp ! (and thus invented potato chips :) ).
There are N persons sitting in a row ( numbered 0 to N-1 ) and you are given an array V, where V[i] is
the village number, where the ith person is from.
In each of the R rounds, Po serves potato chips to a group of people sitting continuously (a sub-array).
Shifu is worried that, if in a round, more than K people from a village are served potato chips,
others may protest and that leads to disruption of outer peace. To estimate the damage of a round,
he wants to know how many distinct villages are there such that more than K people from each of them are served
in that round.
Input
First line contains two integers N K ( N is the number of persons, 1 <= N <= 100,000 and K is the limit in
each round 0 <= K <= N ). Next line contains N numbers, the array V (as described above. 0 <= V[i] <= 100,000,000 ).
Third line contains R (number of rounds, 1 <= R <= 100,000 ). R rounds follow, each in a new line,
having integers i j (0 <= i <= j < N ). Po serves all the persons [ i, i+1, ... , j ] in that round.
Output
For each of the R rounds, print the answer in a new line.
***********************************************************************************************************************
Example
Input:
8 2
3 1 2 2 1 1 2 1
3
0 5
2 4
1 7
Output:
1
0
2
Explanation:
V[0..5] = { 3, 1, 2, 2, 1, 1 } : Only Village 1 occurs more than K ( = 2) times.
V[2..4] = { 2, 2, 1} : None of the villages occur more than 2 times.
V[1..7] = { 1, 2, 2, 1, 1, 2, 1 } : Villages 1 and 2 occur more than 2 times.
Warning : Large input / output. You may have to use efficient input / output methods if you are using languages with
heavy input / output overload. Eg: Prefer using scanf/printf to cin/cout for C/C++
Note : There are multiple test sets, and the judge shows the sum of the time taken over all test sets of your submission,
if Accepted. Time limit on each test set is 2 sec
**********************************************************************************************************************/
package medium.unsolved;
public class AngryChefCrispyChips {
public static void main(String[] args) {
}
}
| [
"sagarnikam123@gmail.com"
] | sagarnikam123@gmail.com |
38971b0e7d772df9d43ee72e29601b0103bfb98e | 0b3cacb3d5cf62de446bffc77273f0aa4d556e05 | /gym/src/main/java/com/zhiyou100/gym/service/RechargeService.java | 9412e5d9836bd97664923493f70f35af3984e7e3 | [] | no_license | luqian-git/xiangmu | e1a2bef3ad5633750203d09b790c07abc43014c2 | eb0f5fd7c09c82889ad8e0b24394f7fd261685f5 | refs/heads/master | 2023-08-03T09:45:22.536887 | 2020-04-10T09:25:50 | 2020-04-10T09:25:50 | 251,285,907 | 0 | 0 | null | 2023-07-23T10:20:06 | 2020-03-30T11:34:58 | Java | UTF-8 | Java | false | false | 781 | java | package com.zhiyou100.gym.service;
import com.zhiyou100.gym.pojo.Recharge;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
//事务
@Transactional
public interface RechargeService {
//充值记录
public List<Recharge> findRTC();
//根据 会员号 查询记录
public List<Recharge> findrechUserMember(Integer rechUserMember);
//
public Recharge findById(Integer rechId);
public void deleteById(Integer rechId);
public String add(Recharge recharge);
public Integer findCount();
public Integer findrechUserMemberCount(Integer rechUserMember);
public List<Recharge> findRTCByPage(Integer page);
public List<Recharge> findrechUserMemberByPage(Integer page,Integer rechUserMember);
}
| [
"123"
] | 123 |
a88b09d7b6aa5d6fed6e1e7859bd7ad021cf4207 | 4aa90348abcb2119011728dc067afd501f275374 | /app/src/main/java/com/tencent/mm/plugin/favorite/e.java | 9124eaefa5f2c6ceab59a83c4c0d2518f654f2b9 | [] | no_license | jambestwick/HackWechat | 0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6 | 6a34899c8bfd50d19e5a5ec36a58218598172a6b | refs/heads/master | 2022-01-27T12:48:43.446804 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | null | UTF-8 | Java | false | false | 3,368 | java | package com.tencent.mm.plugin.favorite;
import com.tencent.mm.g.a.fs;
import com.tencent.mm.plugin.fav.a.f;
import com.tencent.mm.plugin.favorite.b.h;
import com.tencent.mm.sdk.b.b;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.sdk.platformtools.z;
public final class e extends c<fs> {
private z<Long, f> mpa;
private h mpb;
public e() {
this.mpa = new z(10);
this.xen = fs.class.getName().hashCode();
}
public final /* synthetic */ boolean a(b bVar) {
f fVar;
fs fsVar = (fs) bVar;
if (fsVar.fvc.fqk == 0) {
fVar = null;
} else if (fsVar.fvc.fvj) {
fVar = h.getFavItemInfoStorage().db(fsVar.fvc.fqk);
if (fVar != null) {
this.mpa.put(Long.valueOf(fsVar.fvc.fqk), fVar);
}
} else {
f fVar2 = (f) this.mpa.get(Long.valueOf(fsVar.fvc.fqk));
String str = "MicroMsg.FavImageServiceListener";
String str2 = "get item from cache itemInfo is null? %B";
Object[] objArr = new Object[1];
objArr[0] = Boolean.valueOf(fVar2 == null);
x.d(str, str2, objArr);
if (fVar2 == null) {
fVar = h.getFavItemInfoStorage().db(fsVar.fvc.fqk);
if (fVar != null) {
this.mpa.put(Long.valueOf(fsVar.fvc.fqk), fVar);
}
} else {
fVar = fVar2;
}
}
x.d("MicroMsg.FavImageServiceListener", "image serivce callback type %d, localId %d", new Object[]{Integer.valueOf(fsVar.fvc.opType), Long.valueOf(fsVar.fvc.fqk)});
if (fVar != null || fsVar.fvc.opType == 3 || fsVar.fvc.opType == 4) {
switch (fsVar.fvc.opType) {
case 0:
fsVar.fvd.fvk = h.a(fsVar.fvc.fve, fVar);
break;
case 1:
if (this.mpb != null) {
this.mpb.b(fsVar.fvc.fvf, fsVar.fvc.fve, fVar, fsVar.fvc.fvg, fsVar.fvc.width, fsVar.fvc.height);
break;
}
x.w("MicroMsg.FavImageServiceListener", "imageServer is null");
break;
case 2:
x.d("MicroMsg.FavImageServiceListener", "get img from Cache %s", new Object[]{Boolean.valueOf(fsVar.fvc.fvh)});
if (!fsVar.fvc.fvh) {
fsVar.fvd.fvk = h.b(fsVar.fvc.fve, fVar, fsVar.fvc.maxWidth);
break;
}
fsVar.fvd.fvk = h.j(fsVar.fvc.fve);
break;
case 3:
x.d("MicroMsg.FavImageServiceListener", "create image server");
if (this.mpb != null) {
this.mpb.destory();
}
this.mpb = new h(fsVar.fvc.context, 16);
break;
case 4:
x.d("MicroMsg.FavImageServiceListener", "destroy image server");
if (this.mpb != null) {
this.mpb.destory();
this.mpb = null;
break;
}
break;
}
}
return false;
}
}
| [
"malin.myemail@163.com"
] | malin.myemail@163.com |
0e0ece3747861073b1579c2ce03ca60518d26cd7 | db364bac633e39b3164d97407d49177d3627e148 | /src/test/java/org/nfl/testmf/security/oauth2/AudienceValidatorTest.java | 1a589235afa496de9e8ed74161816af26571b0de | [] | no_license | LutherFirst/mfMainGateway | 5be1d1bd7ba8bb31e0fd3e80033dafb0d28416c5 | b6aa7a97fba6dada334c7914d6ce55aecf5f2601 | refs/heads/main | 2023-04-10T16:37:53.809358 | 2021-04-23T17:39:37 | 2021-04-23T17:39:37 | 360,961,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,294 | java | package org.nfl.testmf.security.oauth2;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.springframework.security.oauth2.jwt.Jwt;
/**
* Test class for the {@link AudienceValidator} utility class.
*/
class AudienceValidatorTest {
private final AudienceValidator validator = new AudienceValidator(Arrays.asList("api://default"));
@Test
@SuppressWarnings("unchecked")
void testInvalidAudience() {
Map<String, Object> claims = new HashMap<>();
claims.put("aud", "bar");
Jwt badJwt = mock(Jwt.class);
when(badJwt.getAudience()).thenReturn(new ArrayList(claims.values()));
assertThat(validator.validate(badJwt).hasErrors()).isTrue();
}
@Test
@SuppressWarnings("unchecked")
void testValidAudience() {
Map<String, Object> claims = new HashMap<>();
claims.put("aud", "api://default");
Jwt jwt = mock(Jwt.class);
when(jwt.getAudience()).thenReturn(new ArrayList(claims.values()));
assertThat(validator.validate(jwt).hasErrors()).isFalse();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
f6a08ba9296869f417544e57f8b5a15a6b6375f3 | f6ae8bca70c35727233abe01c828520a69f888cc | /ai/mdp/SearchProblem.java | 998a9747a35513df3dedc122636bb6b2ab337e9c | [] | no_license | iron2414/norbik | 2188ffceef2fa11ba2a882123af351316e2bc6b4 | 80383aa3de32425c56fa1583d58898d165c2e988 | refs/heads/master | 2021-05-07T15:43:05.542557 | 2017-11-23T21:09:10 | 2017-11-23T21:09:10 | 108,512,278 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 441 | java | package org.arrostia.mdp;
import java.util.Collection;
import java.util.Map;
public interface SearchProblem<A, C extends Comparable<? super C>, S> {
Collection<A> actions(S state);
C abs(C cost);
C add(C cost0, C cost1);
C gamma();
C multiply(C cost0, C cost1);
C one();
Map<S, C> probabilities(S state, A action);
C reward(S state, A action, S successorState);
Collection<S> states();
C subtract(C cost0, C cost1);
C zero();
}
| [
"a@b.c"
] | a@b.c |
8eca7533ccb6905798a6f08b4e17a9472047467b | b00c54389a95d81a22e361fa9f8bdf5a2edc93e3 | /packages/apps/UnifiedEmail/src/org/apache/commons/io/filefilter/WildcardFileFilter.java | e9eddbb8a109c884f9052004d9c47bcbfb8fb766 | [] | no_license | mirek190/x86-android-5.0 | 9d1756fa7ff2f423887aa22694bd737eb634ef23 | eb1029956682072bb7404192a80214189f0dc73b | refs/heads/master | 2020-05-27T01:09:51.830208 | 2015-10-07T22:47:36 | 2015-10-07T22:47:36 | 41,942,802 | 15 | 20 | null | 2020-03-09T00:21:03 | 2015-09-05T00:11:19 | null | UTF-8 | Java | false | false | 7,339 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.io.filefilter;
import java.io.File;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOCase;
/**
* Filters files using the supplied wildcards.
* <p>
* This filter selects files and directories based on one or more wildcards.
* Testing is case-sensitive by default, but this can be configured.
* <p>
* The wildcard matcher uses the characters '?' and '*' to represent a
* single or multiple wildcard characters.
* This is the same as often found on Dos/Unix command lines.
* The extension check is case-sensitive by .
* See {@link FilenameUtils#wildcardMatchOnSystem} for more information.
* <p>
* For example:
* <pre>
* File dir = new File(".");
* FileFilter fileFilter = new WildcardFileFilter("*test*.java~*~");
* File[] files = dir.listFiles(fileFilter);
* for (int i = 0; i < files.length; i++) {
* System.out.println(files[i]);
* }
* </pre>
*
* @author Jason Anderson
* @version $Revision: 155419 $ $Date: 2007-12-22 02:03:16 +0000 (Sat, 22 Dec 2007) $
* @since Commons IO 1.3
*/
public class WildcardFileFilter extends AbstractFileFilter implements Serializable {
/** The wildcards that will be used to match filenames. */
private final String[] wildcards;
/** Whether the comparison is case sensitive. */
private final IOCase caseSensitivity;
/**
* Construct a new case-sensitive wildcard filter for a single wildcard.
*
* @param wildcard the wildcard to match
* @throws IllegalArgumentException if the pattern is null
*/
public WildcardFileFilter(String wildcard) {
this(wildcard, null);
}
/**
* Construct a new wildcard filter for a single wildcard specifying case-sensitivity.
*
* @param wildcard the wildcard to match, not null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the pattern is null
*/
public WildcardFileFilter(String wildcard, IOCase caseSensitivity) {
if (wildcard == null) {
throw new IllegalArgumentException("The wildcard must not be null");
}
this.wildcards = new String[] { wildcard };
this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
}
/**
* Construct a new case-sensitive wildcard filter for an array of wildcards.
* <p>
* The array is not cloned, so could be changed after constructing the
* instance. This would be inadvisable however.
*
* @param wildcards the array of wildcards to match
* @throws IllegalArgumentException if the pattern array is null
*/
public WildcardFileFilter(String[] wildcards) {
this(wildcards, null);
}
/**
* Construct a new wildcard filter for an array of wildcards specifying case-sensitivity.
* <p>
* The array is not cloned, so could be changed after constructing the
* instance. This would be inadvisable however.
*
* @param wildcards the array of wildcards to match, not null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the pattern array is null
*/
public WildcardFileFilter(String[] wildcards, IOCase caseSensitivity) {
if (wildcards == null) {
throw new IllegalArgumentException("The wildcard array must not be null");
}
this.wildcards = wildcards;
this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
}
/**
* Construct a new case-sensitive wildcard filter for a list of wildcards.
*
* @param wildcards the list of wildcards to match, not null
* @throws IllegalArgumentException if the pattern list is null
* @throws ClassCastException if the list does not contain Strings
*/
public WildcardFileFilter(List<String> wildcards) {
this(wildcards, null);
}
/**
* Construct a new wildcard filter for a list of wildcards specifying case-sensitivity.
*
* @param wildcards the list of wildcards to match, not null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the pattern list is null
* @throws ClassCastException if the list does not contain Strings
*/
public WildcardFileFilter(List<String> wildcards, IOCase caseSensitivity) {
if (wildcards == null) {
throw new IllegalArgumentException("The wildcard list must not be null");
}
this.wildcards = wildcards.toArray(new String[wildcards.size()]);
this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
}
//-----------------------------------------------------------------------
/**
* Checks to see if the filename matches one of the wildcards.
*
* @param dir the file directory
* @param name the filename
* @return true if the filename matches one of the wildcards
*/
@Override
public boolean accept(File dir, String name) {
for (int i = 0; i < wildcards.length; i++) {
if (FilenameUtils.wildcardMatch(name, wildcards[i], caseSensitivity)) {
return true;
}
}
return false;
}
/**
* Checks to see if the filename matches one of the wildcards.
*
* @param file the file to check
* @return true if the filename matches one of the wildcards
*/
@Override
public boolean accept(File file) {
String name = file.getName();
for (int i = 0; i < wildcards.length; i++) {
if (FilenameUtils.wildcardMatch(name, wildcards[i], caseSensitivity)) {
return true;
}
}
return false;
}
/**
* Provide a String representaion of this file filter.
*
* @return a String representaion
*/
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(super.toString());
buffer.append("(");
if (wildcards != null) {
for (int i = 0; i < wildcards.length; i++) {
if (i > 0) {
buffer.append(",");
}
buffer.append(wildcards[i]);
}
}
buffer.append(")");
return buffer.toString();
}
}
| [
"mirek190@gmail.com"
] | mirek190@gmail.com |
898b35061c63308a3b3cb9667e9441a04d4b9831 | 59928e3edfd4ac14905ef0a1aea86f103269a050 | /src/main/java/org/jcommon/com/jrouter/socketio/SocketIoConnectorStandalone.java | 60256bce38623eb1b94365546b334e2e4906e23b | [] | no_license | leoleegit/jcommon-jrouter | 65c70f5f3a2dbe460c3c231a05d88504d1873d25 | aa12cada3921de1bb6c01b12523fb00c5eeed330 | refs/heads/master | 2021-01-22T10:09:28.992934 | 2016-09-27T07:57:05 | 2016-09-27T07:57:05 | 26,008,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,473 | java | // ========================================================================
// Copyright 2012 leolee<workspaceleo@gmail.com>
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========================================================================
package org.jcommon.com.jrouter.socketio;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.jcommon.com.jrouter.AbstractRouterConnector;
import org.jcommon.com.jrouter.RouterConnection;
import org.jcommon.com.jrouter.utils.DisConnectReason;
public class SocketIoConnectorStandalone extends AbstractRouterConnector{
private static final Logger LOG = Logger.getLogger(SocketIoConnectorStandalone.class.getName());
public static final String version = "v1.0_20140822";
public static final String project = "SocketIo Connector Standalone";
private static SocketIoConnectorStandalone instance;
public static SocketIoConnectorStandalone instance(){return instance;}
public RouterConnection addConnection(HttpServletRequest request){
return super.addConnection(new SocketIoConnection(this, request));
}
public void startup(String host, int port){
try
{
_localAddr = InetAddress.getByName(host);
}
catch (Exception e)
{
LOG.warn(e);
}
_connections = new HashMap<String, RouterConnection>();
instance = this;
}
public void shutdown(){
LOG.info(String.format("Stoped {project:%s, version:%s}", project, version));
@SuppressWarnings("unchecked")
Map<String, RouterConnection> _copy = (HashMap<String, RouterConnection>) ((HashMap<String, RouterConnection>) _connections).clone();
for(RouterConnection conn : _copy.values())conn.doClose(DisConnectReason.SHUTDOWN, "shutdown");
_connections.clear();
_copy.clear();
onConnectorChange(null);
}
}
| [
"workspaceleo@gmail.com"
] | workspaceleo@gmail.com |
8efca1b2db65f17eb9047fbea542a4a404d87080 | 9aca950475568296704a1282759bc080d45129f1 | /src/net/minecraft/BlockCocoa.java | 96663ea58cb6d98a46a52859e8e1c8bf335bd861 | [] | no_license | jiangzhonghui/MinecraftServerDec | 1ef67dc5a4f34abffeaf6a6253ef8a2fb6449957 | ca2f62642a5629ebc3fa7ce356142e767be85e10 | refs/heads/master | 2021-01-22T16:13:27.101670 | 2014-11-09T10:15:49 | 2014-11-09T10:15:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,248 | java | package net.minecraft;
import java.util.Random;
public class BlockCocoa extends avb implements atz {
public static final bew a = bew.a("age", 0, 2);
public BlockCocoa() {
super(Material.PLANT);
this.setBlockState(this.L.b().a(N, BlockFace.NORTH).a(a, Integer.valueOf(0)));
this.a(true);
}
public void b(World var1, Position var2, IBlockState var3, Random var4) {
if (!this.e(var1, var2, var3)) {
this.f(var1, var2, var3);
} else if (var1.random.nextInt(5) == 0) {
int var5 = ((Integer) var3.b(a)).intValue();
if (var5 < 2) {
var1.setBlockAt(var2, var3.a(a, Integer.valueOf(var5 + 1)), 2);
}
}
}
public boolean e(World var1, Position var2, IBlockState var3) {
var2 = var2.getRelative((BlockFace) var3.b(N));
IBlockState var4 = var1.getBlockState(var2);
return var4.getBlock() == Blocks.LOG && var4.b(BlockWood.a) == EnumWoodType.d;
}
public boolean d() {
return false;
}
public boolean c() {
return false;
}
public AxisAlignedBB a(World var1, Position var2, IBlockState var3) {
this.updateShape(var1, var2);
return super.a(var1, var2, var3);
}
public void updateShape(IBlockAccess var1, Position var2) {
IBlockState var3 = var1.getBlockState(var2);
BlockFace var4 = (BlockFace) var3.b(N);
int var5 = ((Integer) var3.b(a)).intValue();
int var6 = 4 + var5 * 2;
int var7 = 5 + var5 * 2;
float var8 = (float) var6 / 2.0F;
switch (aum.a[var4.ordinal()]) {
case 1:
this.a((8.0F - var8) / 16.0F, (12.0F - (float) var7) / 16.0F, (15.0F - (float) var6) / 16.0F, (8.0F + var8) / 16.0F, 0.75F, 0.9375F);
break;
case 2:
this.a((8.0F - var8) / 16.0F, (12.0F - (float) var7) / 16.0F, 0.0625F, (8.0F + var8) / 16.0F, 0.75F, (1.0F + (float) var6) / 16.0F);
break;
case 3:
this.a(0.0625F, (12.0F - (float) var7) / 16.0F, (8.0F - var8) / 16.0F, (1.0F + (float) var6) / 16.0F, 0.75F, (8.0F + var8) / 16.0F);
break;
case 4:
this.a((15.0F - (float) var6) / 16.0F, (12.0F - (float) var7) / 16.0F, (8.0F - var8) / 16.0F, 0.9375F, 0.75F, (8.0F + var8) / 16.0F);
}
}
public void postPlace(World var1, Position var2, IBlockState var3, EntityLiving var4, ItemStack var5) {
BlockFace var6 = BlockFace.fromDirection((double) var4.yaw);
var1.setBlockAt(var2, var3.a(N, var6), 2);
}
public IBlockState a(World var1, Position var2, BlockFace var3, float var4, float var5, float var6, int var7, EntityLiving var8) {
if (!var3.getAxis().isHorizontal()) {
var3 = BlockFace.NORTH;
}
return this.getBlockState().a(N, var3.getOpposite()).a(a, Integer.valueOf(0));
}
public void doPhysics(World var1, Position var2, IBlockState var3, Block var4) {
if (!this.e(var1, var2, var3)) {
this.f(var1, var2, var3);
}
}
private void f(World var1, Position var2, IBlockState var3) {
var1.setBlockAt(var2, Blocks.AIR.getBlockState(), 3);
this.dropNaturally(var1, var2, var3, 0);
}
public void dropNaturally(World var1, Position var2, IBlockState var3, float var4, int var5) {
int var6 = ((Integer) var3.b(a)).intValue();
byte var7 = 1;
if (var6 >= 2) {
var7 = 3;
}
for (int var8 = 0; var8 < var7; ++var8) {
dropItem(var1, var2, new ItemStack(Items.DYE, 1, EnumDyeColor.m.b()));
}
}
public int getDropData(World var1, Position var2) {
return EnumDyeColor.m.b();
}
public boolean a(World var1, Position var2, IBlockState var3, boolean var4) {
return ((Integer) var3.b(a)).intValue() < 2;
}
public boolean a(World var1, Random var2, Position var3, IBlockState var4) {
return true;
}
public void b(World var1, Random var2, Position var3, IBlockState var4) {
var1.setBlockAt(var3, var4.a(a, Integer.valueOf(((Integer) var4.b(a)).intValue() + 1)), 2);
}
public IBlockState setData(int var1) {
return this.getBlockState().a(N, BlockFace.fromDirection(var1)).a(a, Integer.valueOf((var1 & 15) >> 2));
}
public int getData(IBlockState var1) {
byte var2 = 0;
int var3 = var2 | ((BlockFace) var1.b(N)).toDirection();
var3 |= ((Integer) var1.b(a)).intValue() << 2;
return var3;
}
protected bed e() {
return new bed(this, new bex[] { N, a });
}
}
| [
"Shev4ik.den@gmail.com"
] | Shev4ik.den@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.