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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8fc7952d2b00550d8a58a9e4462730542ba43823
|
0e8571d80b42b33b7240c35fb11b410cc77e5d4e
|
/src/main/java/com/example/demo/model/StudentDetails.java
|
7ce71f3f662159deaf742d44cef80a776fbfb3f3
|
[] |
no_license
|
quguanwen/aopdemo
|
0398436fbcf5734dfd1a98fddfb09307a189b9f8
|
7cd0d9c3b3dadb96f29df2341a1da5b5f832e005
|
refs/heads/master
| 2021-01-05T12:11:39.684140
| 2020-02-20T12:15:53
| 2020-02-20T12:15:53
| 241,020,199
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 316
|
java
|
package com.example.demo.model;
import com.example.demo.entity.Score;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class StudentDetails implements Serializable {
private Integer sId;
private String sName;
private Integer sAge;
private String sSex;
}
|
[
"admin@example.com"
] |
admin@example.com
|
f4b3374f00770b55c35b5f77aff15571aea57718
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/10/10_cff37debdc7c669020621641668bd139c6661c7b/AbstractProject/10_cff37debdc7c669020621641668bd139c6661c7b_AbstractProject_s.java
|
dad018a6ca952a4a848b3abe159e1d7adb36ccc1
|
[] |
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
| 7,901
|
java
|
package net.bodz.redist.installer;
import java.io.File;
import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.swt.graphics.ImageData;
import net.bodz.bas.c.java.util.TextMap;
import net.bodz.bas.c.java.util.TreeTextMap;
import net.bodz.bas.c.object.IdentityObjectSet;
import net.bodz.bas.meta.build.IVersion;
import net.bodz.bas.t.tree.legacy.ITreeCallback;
import net.bodz.mda.xjdoc.model.artifact.ArtifactDoc;
import net.bodz.mda.xjdoc.model.javadoc.Author;
import net.bodz.redist.installer.Schemes.Custom;
import net.bodz.redist.installer.Schemes.Default;
import net.bodz.redist.installer.Schemes.Maximum;
import net.bodz.redist.installer.Schemes.Minimum;
import net.bodz.redist.installer.builtins.RequiredSection;
import net.bodz.redist.installer.lic.License;
import net.bodz.swt.c.resources.SWTResources;
/**
* Project Root
*/
public class AbstractProject
extends RequiredSection
implements IProject {
private ImageData logo;
private IVersion version;
private String updateTime;
private Author company;
public AbstractProject(Class<?> artifactClass, IComponent... children) {
super("root", children);
LogoImage alogo = artifactClass.getAnnotation(LogoImage.class);
if (alogo != null) {
String respath = alogo.value();
logo = SWTResources.getImageDataRes(artifactClass, respath);
}
ArtifactDoc artifactDoc = getXjdoc();
URL iconURL = artifactDoc.getIcon();
if (iconURL != null) {
ImageData icon = SWTResources.getImageData(iconURL);
setImage(icon);
}
version = artifactDoc.getVersion();
company = artifactDoc.getAuthor();
updateTime = artifactDoc.getReleaseDateString();
this.variables = new TreeTextMap<Variable>();
}
@Override
public ImageData getLogo() {
return logo;
}
public void setLogo(ImageData logo) {
this.logo = logo;
}
@Override
public IVersion getVersion() {
return version;
}
@Override
public Author getCompany() {
return company;
}
@Override
public String getLicense() {
return License.GPLv2;
}
@Override
public String getUpdateTime() {
return updateTime;
}
@Override
public Scheme[] getSchemes() {
Scheme[] commons = {
//
new Default(), //
new Minimum(), //
new Maximum(), //
new Custom(), //
};
return commons;
}
private TextMap<Variable> variables;
private Map<IComponent, Set<IComponent>> bydeps;
@Override
public TextMap<Variable> getVariables() {
return variables;
}
@Override
public Variable get(String variableName) {
return variables.get(variableName);
}
@Override
public BaseDirVariable getBaseDir(String variableName) {
return (BaseDirVariable) variables.get(variableName);
}
public void define(String name, Variable variable) {
variables.put(name, variable);
}
public void define(String name, String value) {
Variable var = new Variable(null, value);
variables.put(name, var);
}
public void define(String name, File value) {
Variable var = new Variable(null, value);
variables.put(name, var);
}
@Override
public void refreshDependants() {
bydeps = new HashMap<IComponent, Set<IComponent>>();
reverseDependants(this);
}
void reverseDependants(IComponent parent) {
Collection<IComponent> children = parent.getDependancy();
for (IComponent child : children) {
Set<IComponent> parentList = bydeps.get(child);
if (parentList == null) {
parentList = new HashSet<IComponent>(1);
bydeps.put(child, parentList);
}
parentList.add(parent);
reverseDependants(child);
}
}
@Override
public void findDependents(IComponent parent, ITreeCallback<IComponent> callback) {
IdentityObjectSet uniq = new IdentityObjectSet();
findDependents(parent, callback, 0, uniq);
}
boolean findDependents(IComponent parent, ITreeCallback<IComponent> callback, int level, IdentityObjectSet uniq) {
if (parent == null)
throw new NullPointerException("null component in level " + level);
if (uniq.contains(parent))
throw new IllegalStateException(tr._("Loop detected: ") + parent);
uniq.add(parent);
Collection<IComponent> children = parent.getDependancy();
if (children == null)
return true;
L: for (IComponent child : children) {
switch (callback.each(child, level)) {
case ITreeCallback.OK:
break;
case ITreeCallback.BREAK:
break L;
case ITreeCallback.CANCEL:
return false;
}
if (!findDependents(child, callback, level + 1, uniq))
return false; // canceled
}
return true;
}
@Override
public void findDependentsBy(IComponent child, ITreeCallback<IComponent> callback) {
if (bydeps == null)
refreshDependants();
IdentityObjectSet uniq = new IdentityObjectSet();
findDependentsBy(child, callback, 0, uniq);
}
boolean findDependentsBy(IComponent child, ITreeCallback<IComponent> callback, int level, IdentityObjectSet uniq) {
if (child == null)
throw new NullPointerException("null component in rev-level " + level);
if (uniq.contains(child))
throw new IllegalStateException(tr._("Loop detected: ") + child);
uniq.add(child);
Set<IComponent> parents = bydeps.get(child);
if (parents == null)
return true;
L: for (IComponent parent : parents) {
switch (callback.each(parent, level)) {
case ITreeCallback.OK:
break;
case ITreeCallback.BREAK:
break L;
case ITreeCallback.CANCEL:
return false;
}
if (!findDependentsBy(parent, callback, level + 1, uniq))
return false; // canceled
}
return true;
}
@Override
public void analyseDependency(ITreeCallback<IComponent> missingCallback) {
IdentityObjectSet uniq = new IdentityObjectSet();
analyseDependency(this, missingCallback, 0, uniq);
}
boolean analyseDependency(IComponent child, ITreeCallback<IComponent> missingCallback, int level,
IdentityObjectSet uniq) {
if (uniq.contains(child))
throw new IllegalStateException(tr._("Loop detected: ") + child);
uniq.add(child);
Collection<IComponent> dependancy = child.getDependancy();
if (dependancy == null)
return true;
L: for (IComponent parent : dependancy) {
if (!parent.isSelected())
switch (missingCallback.each(parent, level)) {
case ITreeCallback.OK:
break;
case ITreeCallback.BREAK:
break L;
case ITreeCallback.CANCEL:
return false;
}
if (!analyseDependency(parent, missingCallback, level + 1, uniq))
return false; // canceled
}
return true;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
f2752072be68e80ed29ce93774c5dc4a5968e48e
|
4679024fe07717f224a4aa95d378d8cb9bac2d8d
|
/cms/src/main/java/de/innovationgate/wgpublisher/design/OverlayData.java
|
7a1201a0dee226d82a5e9a11ff0a4926da760e0a
|
[] |
no_license
|
oweise/WestGate
|
cb2d42495c60c4fd971578f935f179ed1b435cfd
|
f665b226fed2259e7aaa418a8874b732ba6552b4
|
refs/heads/master
| 2020-03-21T10:48:51.255135
| 2018-07-13T16:08:47
| 2018-07-13T16:08:47
| 138,472,376
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,723
|
java
|
/*******************************************************************************
* Copyright 2009, 2010 Innovation Gate GmbH. All Rights Reserved.
*
* This file is part of the OpenWGA databaseServer platform.
*
* OpenWGA 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 3 of the License, or
* (at your option) any later version.
*
* In addition, a special exception is granted by the copyright holders
* of OpenWGA called "OpenWGA plugin exception". You should have received
* a copy of this exception along with OpenWGA in file COPYING.
* If not, see <http://www.openwga.com/gpl-plugin-exception>.
*
* OpenWGA 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 OpenWGA in file COPYING.
* If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package de.innovationgate.wgpublisher.design;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.vfs2.FileObject;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.ElementMap;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.core.Persister;
import de.innovationgate.wga.config.ConfigValidationException;
import de.innovationgate.wga.config.NotNull;
import de.innovationgate.wga.config.WGAConfiguration;
import de.innovationgate.wga.model.ValidationError;
@Root(strict=false)
public class OverlayData {
private static Persister _serializer = new Persister();
public static OverlayData load(FileObject overlayDataFile) throws Exception {
InputStream in = new BufferedInputStream(overlayDataFile.getContent().getInputStream());
OverlayData overlayData = OverlayData.read(in);
in.close();
return overlayData;
}
public static OverlayData read(InputStream in) throws Exception {
return _serializer.read(OverlayData.class, in);
}
public void write(OutputStream out) throws Exception {
_serializer.write(this, out);
}
@Root(strict=false)
public static class ResourceData {
@Attribute(name="md5Hash")
private String _md5Hash;
public String getMd5Hash() {
return _md5Hash;
}
public void setMd5Hash(String md5Hash) {
this._md5Hash = md5Hash;
}
}
private transient boolean _updated = false;
@Attribute(name="basepluginName", required=true)
private String _basepluginName;
@Attribute(name="basepluginVersion", required=true)
private String _basepluginVersion;
@Attribute(name="initialBasepluginVersion", required=false)
private String _initialBasepluginVersion;
@ElementMap(entry="resource", key="path", inline=true, required=false)
@NotNull
private Map<String,ResourceData> _overlayResources = new HashMap<String, ResourceData>();
public String getBasepluginName() {
return _basepluginName;
}
public void setBasepluginName(String designPlugin) {
_basepluginName = designPlugin;
_updated = true;
}
public Map<String, ResourceData> getOverlayResources() {
return Collections.unmodifiableMap(_overlayResources);
}
public void setOverlayResource(String path, ResourceData resourceData) {
_overlayResources.put(path, resourceData);
_updated = true;
}
public void removeOverlayResource(String path) {
_overlayResources.remove(path);
_updated = true;
}
public String getBasepluginVersion() {
return _basepluginVersion;
}
public void setBasepluginVersion(String basepluginVersion) {
_basepluginVersion = basepluginVersion;
_updated = true;
}
public boolean isUpdated() {
return _updated;
}
public void setUpdated(boolean updated) {
_updated = updated;
}
public String getInitialBasepluginVersion() {
return _initialBasepluginVersion;
}
public void setInitialBasepluginVersion(String initialBasepluginVersion) {
_initialBasepluginVersion = initialBasepluginVersion;
}
}
|
[
"oliver.weise@consol.de"
] |
oliver.weise@consol.de
|
33f0ed5b0350226bd35e29d653fae869a7c0faeb
|
c89333d091f152c8c36623065cf6974997530876
|
/sa.elm.ob.hcm/src/sa/elm/ob/hcm/event/OrgClassEvent.java
|
4f698abedabd5a9b524e208ea61794739bb63cff
|
[] |
no_license
|
Orkhan42/openbravotest
|
24cb0f35986732c41a21963d7aa7a0910e7b4afd
|
82c7bfb60dda7a30be276a2b07e5ca2b4a92c585
|
refs/heads/master
| 2023-03-01T00:35:37.463178
| 2021-02-04T12:55:45
| 2021-02-04T12:55:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,055
|
java
|
package sa.elm.ob.hcm.event;
import java.util.Date;
import javax.enterprise.event.Observes;
import org.apache.log4j.Logger;
import org.openbravo.base.exception.OBException;
import org.openbravo.base.model.Entity;
import org.openbravo.base.model.ModelProvider;
import org.openbravo.base.model.Property;
import org.openbravo.client.kernel.event.EntityNewEvent;
import org.openbravo.client.kernel.event.EntityPersistenceEventObserver;
import org.openbravo.client.kernel.event.EntityUpdateEvent;
import org.openbravo.dal.core.OBContext;
import org.openbravo.dal.service.OBDal;
import org.openbravo.dal.service.OBQuery;
import org.openbravo.erpCommon.utility.OBMessageUtils;
import sa.elm.ob.hcm.EHCMOrgClassfication;
public class OrgClassEvent extends EntityPersistenceEventObserver {
private static Entity[] entities = {
ModelProvider.getInstance().getEntity(EHCMOrgClassfication.ENTITY_NAME) };
@Override
protected Entity[] getObservedEntities() {
return entities;
}
private Logger log = Logger.getLogger(this.getClass());
public void onUpdate(@Observes EntityUpdateEvent event) {
if (!isValidEvent(event)) {
return;
}
try {
OBContext.setAdminMode();
EHCMOrgClassfication classtype = (EHCMOrgClassfication) event.getTargetInstance();
final Property typename = entities[0].getProperty(EHCMOrgClassfication.PROPERTY_ORGCLASSNAME);
final Property typecode = entities[0].getProperty(EHCMOrgClassfication.PROPERTY_SEARCHKEY);
final Property Startdate = entities[0].getProperty(EHCMOrgClassfication.PROPERTY_STARTDATE);
final Property Enddate = entities[0].getProperty(EHCMOrgClassfication.PROPERTY_ENDDATE);
OBQuery<EHCMOrgClassfication> type = OBDal.getInstance()
.createQuery(EHCMOrgClassfication.class, "value='" + classtype.getSearchKey()
+ "' or orgclassname = '" + classtype.getOrgclassname() + "' ");
/*
* if (!event.getPreviousState(typename).equals(event.getCurrentState(typename)) ||
* !event.getPreviousState(typecode).equals(event.getCurrentState(typecode))) { if
* (type.list().size() > 0) { throw new
* OBException(OBMessageUtils.messageBD("Ehcm_ClassType"));
*
* } }
*/
Date startDate = classtype.getStartDate();
Date endDate = classtype.getEndDate();
if (startDate != null && endDate != null) {
if (endDate.compareTo(startDate) == -1) {
throw new OBException(OBMessageUtils.messageBD("Ehcm_Enddate"));
}
}
} catch (OBException e) {
log.error(" Exception while creating orgtype in Organization: ", e);
throw new OBException(e.getMessage());
} catch (Exception e) {
throw new OBException(OBMessageUtils.messageBD("HB_INTERNAL_ERROR"));
} finally {
OBContext.restorePreviousMode();
}
}
public void onSave(@Observes EntityNewEvent event) {
if (!isValidEvent(event)) {
return;
}
try {
OBContext.setAdminMode();
EHCMOrgClassfication classtype = (EHCMOrgClassfication) event.getTargetInstance();
OBQuery<EHCMOrgClassfication> type = OBDal.getInstance()
.createQuery(EHCMOrgClassfication.class, "value='" + classtype.getSearchKey()
+ "' or orgclassname = '" + classtype.getOrgclassname() + "' ");
if (type.list().size() > 0) {
throw new OBException(OBMessageUtils.messageBD("Ehcm_ClassType"));
}
Date startDate = classtype.getStartDate();
Date endDate = classtype.getEndDate();
if (startDate != null && endDate != null) {
if (endDate.compareTo(startDate) == -1) {
throw new OBException(OBMessageUtils.messageBD("Ehcm_Enddate"));
}
}
} catch (OBException e) {
log.error(" Exception while creating classtype in Organization: ", e);
throw new OBException(e.getMessage());
} catch (Exception e) {
throw new OBException(OBMessageUtils.messageBD("HB_INTERNAL_ERROR"));
} finally {
OBContext.restorePreviousMode();
}
}
}
|
[
"laiquddin.syed83@gmail.com"
] |
laiquddin.syed83@gmail.com
|
de2ca17140cf04f70e070fb6db992defc18067a5
|
6016c5d98f6a27c5edab08c88d21ac3727d379af
|
/BiglyBT/src/main/java/com/biglybt/android/client/adapter/MetaSearchEnginesAdapter.java
|
b085d00984b6cc3973aa9665aecf157e19984e24
|
[] |
no_license
|
morristech/BiglyBT-Android
|
d21b784ac5ddd5e79f73ac6b797ba74188868f34
|
db4e54f0ef914b0e4aed373162111657cee7f565
|
refs/heads/master
| 2021-05-07T17:50:28.625139
| 2017-10-28T23:38:03
| 2017-10-28T23:38:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,420
|
java
|
/*
* Copyright (c) Azureus Software, Inc, All Rights Reserved.
*
* 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.
* 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 com.biglybt.android.client.adapter;
import java.io.Serializable;
import org.jetbrains.annotations.NonNls;
import com.biglybt.android.FlexibleRecyclerAdapter;
import com.biglybt.android.FlexibleRecyclerSelectionListener;
import com.biglybt.android.FlexibleRecyclerViewHolder;
import com.biglybt.android.client.BiglyBTApp;
import com.biglybt.android.client.R;
import com.biglybt.util.DisplayFormatters;
import com.squareup.picasso.Picasso;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
/**
* Created by TuxPaper on 4/22/16.
*/
public class MetaSearchEnginesAdapter
extends
FlexibleRecyclerAdapter<MetaSearchEnginesAdapter.MetaSearchEnginesHolder, MetaSearchEnginesAdapter.MetaSearchEnginesInfo>
{
public static class MetaSearchEnginesHolder
extends FlexibleRecyclerViewHolder
{
final TextView tvName;
final TextView tvCount;
final ProgressBar pb;
final ImageView iv;
final ImageView ivChecked;
public MetaSearchEnginesHolder(RecyclerSelectorInternal selector,
View rowView) {
super(selector, rowView);
tvName = rowView.findViewById(R.id.ms_engine_name);
tvCount = rowView.findViewById(R.id.ms_engine_count);
pb = rowView.findViewById(R.id.ms_engine_pb);
iv = rowView.findViewById(R.id.ms_engine_icon);
ivChecked = rowView.findViewById(R.id.ms_engine_checked);
}
}
public static class MetaSearchEnginesInfo
implements Comparable<MetaSearchEnginesInfo>, Serializable
{
@NonNls
public final String uid;
@NonNls
public String name;
public boolean completed;
public int count;
public String iconURL;
protected MetaSearchEnginesInfo(String uid) {
this.uid = uid;
}
public MetaSearchEnginesInfo(String uid, String name,
@Nullable String iconURL, boolean completed) {
this.name = name;
this.iconURL = iconURL;
this.completed = completed;
this.uid = uid;
}
@Override
public int compareTo(@NonNull MetaSearchEnginesInfo another) {
return uid.compareTo(another.uid);
}
}
private final Context context;
public MetaSearchEnginesAdapter(Context context,
FlexibleRecyclerSelectionListener<MetaSearchEnginesAdapter, MetaSearchEnginesInfo> rs) {
super(rs);
this.context = context;
Picasso.with(context).setLoggingEnabled(true);
setHasStableIds(true);
}
@Override
public long getItemId(int position) {
MetaSearchEnginesInfo item = getItem(position);
return item.uid.hashCode();
}
@Override
public void onBindFlexibleViewHolder(MetaSearchEnginesHolder holder,
int position) {
MetaSearchEnginesInfo item = getItem(position);
holder.tvName.setText(item.name);
if (holder.tvCount != null) {
holder.tvCount.setText(item.count == 0 ? "" : item.count == -1 ? "Error"
: DisplayFormatters.formatNumber(item.count));
}
if (holder.pb != null) {
holder.pb.setVisibility(item.completed ? View.GONE : View.VISIBLE);
}
if (holder.ivChecked != null) {
holder.ivChecked.setVisibility(
isItemChecked(position) ? View.VISIBLE : View.GONE);
}
if (holder.iv != null) {
String url = "http://search.vuze.com/xsearch/imageproxy.php?url="
+ item.iconURL;
Picasso picassoInstance = BiglyBTApp.getPicassoInstance();
picassoInstance.load(url).into(holder.iv);
}
}
@Override
public MetaSearchEnginesHolder onCreateFlexibleViewHolder(ViewGroup parent,
int viewType) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.row_ms_engine_sidelist, parent,
false);
return new MetaSearchEnginesHolder(this, rowView);
}
public void refreshItem(String uid, boolean completed, int numAdded) {
MetaSearchEnginesInfo info = new MetaSearchEnginesInfo(uid);
if (info.completed == completed && numAdded == 0) {
return;
}
final int position = getPositionForItem(info);
if (position < 0) {
return;
}
info = getItem(position);
if (info == null) {
return;
}
boolean changed = false;
if (info.completed != completed) {
info.completed = completed;
changed = true;
}
int oldCount = info.count;
if (numAdded < 0) {
info.count = -1;
} else {
info.count += numAdded;
}
changed |= (info.count != oldCount);
if (changed) {
getRecyclerView().post(new Runnable() {
@Override
public void run() {
notifyItemChanged(position);
}
});
}
}
}
|
[
"725353+TuxPaper@users.noreply.github.com"
] |
725353+TuxPaper@users.noreply.github.com
|
27ee2329be982d10a09ed67e00ddcbd3b6781181
|
612d055cd25bc9cdbf76bd70f7b8609d8584a4e2
|
/demo-service/src/main/java/com/yz/demo/validate/CouponValidate.java
|
e0a59faeaaf82a17844313204a7e8ab74f92f60c
|
[] |
no_license
|
leopard5/yz-project-structure
|
6705303bb5d898c7a377ad0df272ecce25571a50
|
3d18fb5dddd1ff8497d98be9e79ff31c24a7854b
|
refs/heads/master
| 2021-08-18T04:18:19.381118
| 2017-11-06T03:46:36
| 2017-11-06T03:46:36
| 96,396,447
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,962
|
java
|
package com.yz.demo.validate;
import com.yz.demo.model.Coupon;
import com.yz.demo.resp.DemoResult;
import com.yz.demo.resp.MmcResultCode;
import java.util.Date;
import static com.yz.demo.biz.util.ValidationUtil.*;
public class CouponValidate {
public static boolean validateForCreate(Coupon coupon, DemoResult<?> message, boolean isUpdateFlag) {
if (isNull(message, Coupon.OWNER_TYPE, coupon.getOwnerType())) {
return false;
}
if (isNull(message, Coupon.OWNER_ID, coupon.getOwnerId())) {
return false;
}
if (isEmptyOrMoreThan(message, Coupon.OWNER_NAME, coupon.getOwnerName(), 64)) {
return false;
}
if (isNull(message, Coupon.ACTIVITY_ID, coupon.getActivityId())) {
return false;
}
if (isEmptyOrMoreThan(message, Coupon.COUPON_NAME, coupon.getCouponName(), 64)) {
return false;
}
if (isNull(message, Coupon.COUPON_USE_TYPE, coupon.getCouponUseType())) {
return false;
}
if (isNull(message, Coupon.COUPON_PACKAGE_ID, coupon.getCouponPackageId())) {
return false;
}
if (isNull(message, Coupon.PER_PERSON_LIMIT, coupon.getPerPersonLimit())) {
return false;
}
if (coupon.getPerOrderLimit().intValue() < 1) {
message.setErrorCode(MmcResultCode.CAN_NOT_BE_OPERATE, "每笔订单优惠券使用数量", "小于1");
return false;
}
if (isNull(message, Coupon.START_TIME, coupon.getStartTime())) {
return false;
}
if (isNull(message, Coupon.END_TIME, coupon.getEndTime())) {
return false;
}
if (isNull(message, Coupon.IS_SHARED_SUBPROMOTION, coupon.getIsSharedSubpromotion())) {
return false;
}
if (isNull(message, Coupon.IS_SHARED_COUPON, coupon.getIsSharedCoupon())) {
return false;
}
if (isMoreThan(message, Coupon.REDIRECT_URL, coupon.getRedirectUrl(), 512)) {
return false;
}
if (isNull(message, Coupon.IS_MUST_APPLY, coupon.getIsMustApply())) {
return false;
}
if (isNull(message, Coupon.AFFORD_COST_TYPE, coupon.getAffordCostType())) {
return false;
}
if (isNull(message, Coupon.AFFORD_COST_VALUE, coupon.getAffordCostValue())) {
return false;
}
if (isNull(message, Coupon.COUPON_DISPATCH_TYPE, coupon.getCouponDispatchType())) {
return false;
}
if (isMoreThan(message, Coupon.GIFT_NAME, coupon.getGiftName(), 64)) {
return false;
}
if (isMoreThan(message, Coupon.PROMOTION_SCOPE_AMOUNT, coupon.getPromotionScopeAmount(), 1024)) {
return false;
}
if (!isUpdateFlag) {
if (isEmptyOrMoreThan(message, Coupon.CREATE_USER, coupon.getCreateUser(), 64)) {
return false;
}
if (isMoreThan(message, Coupon.CREATE_USER_NAME, coupon.getCreateUserName(), 64)) {
return false;
}
} else {
if (isEmptyOrMoreThan(message, Coupon.UPDATE_USER, coupon.getUpdateUser(), 64)) {
return false;
}
if (isMoreThan(message, Coupon.UPDATE_USER_NAME, coupon.getUpdateUserName(), 64)) {
return false;
}
}
return true;
}
private static boolean couponTimeCheck(DemoResult<?> message, Coupon coupon, Date issueStartTime, Date issueEndTime, String target) {
// 优惠券发券开始时间为空 报错
if (issueStartTime == null) {
message.setErrorCode(MmcResultCode.FIELD_NOT_ALLOWED_EMPTY, target + "发券开始时间");
return false;
}
// 优惠券发券结束时间为空 报错
if (issueEndTime == null) {
message.setErrorCode(MmcResultCode.FIELD_NOT_ALLOWED_EMPTY, target + "发券结束时间");
return false;
}
// 优惠券发券开始时间大于等于发券结束时间 报错
if (issueStartTime.getTime() >= issueEndTime.getTime()) {
message.setErrorCode(MmcResultCode.TIME_VALUE_MUST_LESS_THAN, target + "发券开始时间", "发券结束时间");
return false;
}
// 优惠券预热开始时间大于等于发券开始时间 报错
if (coupon.getPendingTime() != null
&& coupon.getPendingTime().getTime() >= issueStartTime.getTime()) {
message.setErrorCode(MmcResultCode.TIME_VALUE_MUST_LESS_THAN, "预热时间", target + "发券开始时间");
return false;
}
// 优惠券发券截止日期大于生效截止时间 报错
String msg = "发券";
if (coupon.getCouponPackageId() > 0) {
msg = "券包发行";
}
if (issueEndTime.getTime() > coupon.getEndTime().getTime()) {
message.setErrorCode(MmcResultCode.TIME_VALUE_MUST_LESS_THAN, target + msg + "结束时间", "优惠券失效时间");
return false;
}
// 优惠券发券开始日期大于生效开始时间 报错
if (issueStartTime.getTime() > coupon.getStartTime().getTime()) {
message.setErrorCode(MmcResultCode.TIME_VALUE_MUST_LESS_THAN, target + msg + "开始时间", "优惠券生效时间");
return false;
}
return true;
}
public static boolean validateForUpdate(Coupon coupon, DemoResult<?> message) {
if (isNull(message, Coupon.ID, coupon.getId())) {
return false;
}
if (coupon.getId().intValue() <= 0) {
message.setErrorCode(MmcResultCode.COMMON_PARAM_INVALID, Coupon.ID);
}
if (!(validateForCreate(coupon, message, true))) {
return false;
}
return true;
}
}
|
[
"qiyazhong@163.com"
] |
qiyazhong@163.com
|
333927b6817edaa6d304c77d091c4839f2b4db65
|
65d97757cb55ada67058cab92b5115e3af0b63cd
|
/src/no/systema/transportdisp/model/jsonjackson/workflow/frankatur/JsonTransportDispFrankaturRecord.java
|
ed170fa9143281c14098006d799fc732f0219ce9
|
[] |
no_license
|
SystemaAS/espedsgtranspdisp
|
318dd970e23f19567f971353ce443e7191b6b80c
|
d88371f8a49cf6ea9c1675bbda416f4244afdc00
|
refs/heads/master
| 2022-08-01T16:38:00.000649
| 2022-07-01T08:47:16
| 2022-07-01T08:47:16
| 188,211,015
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 761
|
java
|
/**
*
*/
package no.systema.transportdisp.model.jsonjackson.workflow.frankatur;
/**
* @author oscardelatorre
* @date Aug 07, 2015
*
*/
public class JsonTransportDispFrankaturRecord {
private String franka = null;
public void setFranka(String value){ this.franka = value;}
public String getFranka(){ return this.franka; }
private String beskr = null;
public void setBeskr(String value){ this.beskr = value;}
public String getBeskr(){ return this.beskr; }
private String beskrEn = null;
public void setBeskrEn(String value){ this.beskrEn = value;}
public String getBeskrEn(){ return this.beskrEn; }
private String ccpp = null;
public void setCcpp(String value){ this.ccpp = value;}
public String getCcpp(){ return this.ccpp; }
}
|
[
"oscar@systema.no"
] |
oscar@systema.no
|
4f9bf37732a498355dc8e9e9bdc638c8aee0dcb3
|
f3e426666bb86f2181e459b0ff738266630dcb12
|
/Eclipse/com.mobilesorcery.sdk.extensionsupport/src/com/mobilesorcery/sdk/extensionsupport/ui/ExtensionSupportBuildStepEditor.java
|
674b0f3da6bab1f4f2db35c0313a67ef29d57dc9
|
[] |
no_license
|
mmaheu/CLTEST
|
83bab5d60aea25f09d72a0b619c1bb7eb4fbb09b
|
3e3b14303f894fc9d57236e0df5642f4959962ad
|
refs/heads/master
| 2016-09-06T21:28:47.753739
| 2013-12-03T21:39:02
| 2013-12-03T21:39:02
| 14,906,574
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,039
|
java
|
package com.mobilesorcery.sdk.extensionsupport.ui;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import com.mobilesorcery.sdk.extensionsupport.ExtensionSupportBuildStep;
import com.mobilesorcery.sdk.extensionsupport.ExtensionSupportBuildStep.Factory;
import com.mobilesorcery.sdk.ui.BuildStepEditor;
public class ExtensionSupportBuildStepEditor extends BuildStepEditor {
private Button doAutoInstall;
private Button doGenerateStubs;
@Override
public void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Edit Extension Build Step");
}
@Override
public Control createDialogArea(Composite parent) {
Composite main = (Composite) super.createDialogArea(parent);
main.setLayoutData(new GridData(GridData.FILL));
main.setLayout(new GridLayout(2, false));
if (getFactory().getPhase().equals(ExtensionSupportBuildStep.PACK_PHASE)) {
doAutoInstall = new Button(main, SWT.CHECK);
doAutoInstall.setText("&Automatically install extension");
doAutoInstall.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false, 2, 1));
doAutoInstall.setSelection(getFactory().shouldUpdateInstallation());
} else {
doGenerateStubs = new Button(main, SWT.CHECK);
doGenerateStubs.setText("&Always Generate Stubs");
doGenerateStubs.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false, 2, 1));
doGenerateStubs.setSelection(getFactory().shouldGenerateStubs());
}
return main;
}
@Override
public void okPressed() {
if (doAutoInstall != null) {
getFactory().shouldUpdateInstallation(doAutoInstall.getSelection());
}
if (doGenerateStubs != null) {
getFactory().shouldGenerateStubs(doGenerateStubs.getSelection());
}
super.okPressed();
}
private ExtensionSupportBuildStep.Factory getFactory() {
return (Factory) factory;
}
}
|
[
"mmaheu@gmail.com"
] |
mmaheu@gmail.com
|
75db2b9f6a281a65be2b5fe8eb3e85cb414c251c
|
e7e65e20e724db82fecd12aceaa73436ec0ae9f8
|
/app/src/main/java/com/example/zengwei/zengweiossapp/Base/BasePresenter.java
|
0ddd739881ed33b5355ff1e99a9dffa1765eb598
|
[] |
no_license
|
zengwei123/ZengWeiOssApp
|
d6591a9ecf9308199ceb8a9ac3ff492a22475d6d
|
df166c265abae1e97025e3367c0369de81aa3a29
|
refs/heads/master
| 2020-04-06T16:40:34.113357
| 2018-11-15T00:34:35
| 2018-11-15T00:34:35
| 157,629,462
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 289
|
java
|
package com.example.zengwei.zengweiossapp.Base;
/**
* Created by zengwei on 2018/11/12.
*/
public class BasePresenter<V> {
public V mvpView;
public void attachView(V mvpView){
this.mvpView=mvpView;
}
public void detachView(){
this.mvpView=null;
}
}
|
[
"13085486819@163.com"
] |
13085486819@163.com
|
8f686abc19980336b227392bfaf7bab53f00367c
|
738d892969583dd2948799c521f1a9fd2e06b55a
|
/src/com/xuhu/LeetCode/mid/midBefore200/mid0105/Main.java
|
e4707e253022db1605147af2aa84a57822d84924
|
[] |
no_license
|
reallyhwc/LeetCode
|
a4b7875e7f5ed438f86dcd62a3bf0a7be4487631
|
1d41507da86dd3000fafe1ea7c03965bc4e5cb67
|
refs/heads/master
| 2021-06-23T17:00:59.103785
| 2021-04-13T01:33:21
| 2021-04-13T01:33:21
| 213,626,838
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 477
|
java
|
package com.xuhu.LeetCode.mid.midBefore200.mid0105;
import com.xuhu.LeetCode.a.util.TreeOperation;
public class Main {
public static void main(String[] args){
Solution solution = new Solution();
TreeOperation.show(solution.buildTree(new int[]{3,9,20,15,7},new int[]{9,3,15,20,7}));
// TreeOperation.show(solution.buildTree(new int[]{20,15,7},new int[]{15,20,7}));
// TreeOperation.show(solution.buildTree(new int[]{1},new int[]{1}));
}
}
|
[
"reallyhwc@foxmail.com"
] |
reallyhwc@foxmail.com
|
0169a151cbcf9729176e35a33e425e09c06bae94
|
9efc44ff83e19b268e271ed9f667ae823c0ad82e
|
/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/IterativeOptimizer.java
|
61d13972dd8d6b6a7d696da891d2e4344afff12d
|
[
"Apache-2.0"
] |
permissive
|
yinjingcheng/presto
|
0cc7491468b54d02ab3776774ccd877010a14d0d
|
12e883e0eee3084395a817c98663040ea1878ce7
|
refs/heads/master
| 2021-07-08T06:43:52.971331
| 2017-01-20T23:59:38
| 2017-01-21T00:55:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,865
|
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 com.facebook.presto.sql.planner.iterative;
import com.facebook.presto.Session;
import com.facebook.presto.SystemSessionProperties;
import com.facebook.presto.spi.type.Type;
import com.facebook.presto.sql.planner.PlanNodeIdAllocator;
import com.facebook.presto.sql.planner.StatsRecorder;
import com.facebook.presto.sql.planner.Symbol;
import com.facebook.presto.sql.planner.SymbolAllocator;
import com.facebook.presto.sql.planner.optimizations.PlanOptimizer;
import com.facebook.presto.sql.planner.plan.PlanNode;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import static com.google.common.base.Preconditions.checkState;
public class IterativeOptimizer
implements PlanOptimizer
{
private final List<PlanOptimizer> legacyRules;
private final Set<Rule> rules;
private final StatsRecorder stats;
public IterativeOptimizer(StatsRecorder stats, List<PlanOptimizer> legacyRules, Set<Rule> newRules)
{
this.legacyRules = ImmutableList.copyOf(legacyRules);
this.rules = ImmutableSet.copyOf(newRules);
this.stats = stats;
stats.registerAll(rules);
}
public IterativeOptimizer(StatsRecorder stats, Set<Rule> rules)
{
this.legacyRules = ImmutableList.of();
this.rules = ImmutableSet.copyOf(rules);
this.stats = stats;
stats.registerAll(rules);
}
@Override
public PlanNode optimize(PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator)
{
if (!SystemSessionProperties.isNewOptimizerEnabled(session)) {
for (PlanOptimizer optimizer : legacyRules) {
plan = optimizer.optimize(plan, session, symbolAllocator.getTypes(), symbolAllocator, idAllocator);
}
return plan;
}
Memo memo = new Memo(idAllocator, plan);
Lookup lookup = node -> {
if (node instanceof GroupReference) {
return memo.getNode(((GroupReference) node).getGroupId());
}
return node;
};
exploreGroup(memo.getRootGroup(), new Context(memo, lookup, idAllocator, symbolAllocator));
return memo.extract();
}
private boolean exploreGroup(int group, Context context)
{
// tracks whether this group or any children groups change as
// this method executes
boolean progress = exploreNode(group, context);
while (exploreChildren(group, context)) {
progress = true;
// if children changed, try current group again
// in case we can match additional rules
if (!exploreNode(group, context)) {
// no additional matches, so bail out
break;
}
}
return progress;
}
private boolean exploreNode(int group, Context context)
{
PlanNode node = context.getMemo().getNode(group);
boolean done = false;
boolean progress = false;
while (!done) {
done = true;
for (Rule rule : rules) {
long start = System.nanoTime();
Optional<PlanNode> transformed = rule.apply(node, context.getLookup(), context.getIdAllocator(), context.getSymbolAllocator());
long duration = System.nanoTime() - start;
stats.record(rule, duration, transformed.isPresent());
if (transformed.isPresent()) {
node = context.getMemo().replace(group, transformed.get(), rule.getClass().getName());
done = false;
progress = true;
}
}
}
return progress;
}
private boolean exploreChildren(int group, Context context)
{
boolean progress = false;
PlanNode expression = context.getMemo().getNode(group);
for (PlanNode child : expression.getSources()) {
checkState(child instanceof GroupReference, "Expected child to be a group reference. Found: " + child.getClass().getName());
if (exploreGroup(((GroupReference) child).getGroupId(), context)) {
progress = true;
}
}
return progress;
}
private static class Context
{
private final Memo memo;
private final Lookup lookup;
private final PlanNodeIdAllocator idAllocator;
private final SymbolAllocator symbolAllocator;
public Context(Memo memo, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator)
{
this.memo = memo;
this.lookup = lookup;
this.idAllocator = idAllocator;
this.symbolAllocator = symbolAllocator;
}
public Memo getMemo()
{
return memo;
}
public Lookup getLookup()
{
return lookup;
}
public PlanNodeIdAllocator getIdAllocator()
{
return idAllocator;
}
public SymbolAllocator getSymbolAllocator()
{
return symbolAllocator;
}
}
}
|
[
"mtraverso@gmail.com"
] |
mtraverso@gmail.com
|
b4cdeeac3f73bf633f6525ec1fe0cd7d70b34b50
|
8ed70ef0db75d42bfd9dc836b6b0274e96c8e581
|
/src/main/java/com/vaani/dsa/ds/core/list/sll/generic/ListADT.java
|
cb7f5b9a4d30cc9dbed4da3f3348031ec7d01d4d
|
[] |
no_license
|
kinshuk4/algorithms-java
|
8592ed4ab4aa7a8a26279f58f0843d3e0c1142bc
|
45c4f7539f046ba93f6671bf6af014a4c60dbb16
|
refs/heads/master
| 2023-04-14T10:57:17.690911
| 2023-02-19T09:59:51
| 2023-04-12T09:59:51
| 170,701,206
| 1
| 1
| null | 2022-10-05T19:20:50
| 2019-02-14T14:08:22
|
Java
|
UTF-8
|
Java
| false
| false
| 407
|
java
|
package com.vaani.dsa.ds.core.list.sll.generic;
import java.util.Iterator;
public interface ListADT<T, V> {
void setDescription(String izena);
String getDescription ();
T removeFirst();
T removeLast();
boolean remove(T elem);
T first();
T last();
boolean contains(T elem);
V find(T elem);
boolean isEmpty();
int size();
Iterator<T> iterator();
}
|
[
"kinshuk.ram@gmail.com"
] |
kinshuk.ram@gmail.com
|
19dff533ae6ff96095215544e9268759bdac3e2c
|
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
|
/schemaOrgGson/src/org/kyojo/schemaorg/m3n5/gson/core/container/ActionStatusDeserializer.java
|
7e44ae367ed302bbea45f78e4e290a50a91a2dcf
|
[
"Apache-2.0"
] |
permissive
|
nagaikenshin/schemaOrg
|
3dec1626781913930da5585884e3484e0b525aea
|
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
|
refs/heads/master
| 2021-06-25T04:52:49.995840
| 2019-05-12T06:22:37
| 2019-05-12T06:22:37
| 134,319,974
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,055
|
java
|
package org.kyojo.schemaorg.m3n5.gson.core.container;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import org.kyojo.gson.JsonDeserializationContext;
import org.kyojo.gson.JsonDeserializer;
import org.kyojo.gson.JsonElement;
import org.kyojo.gson.JsonParseException;
import org.kyojo.schemaorg.m3n5.core.impl.ACTION_STATUS;
import org.kyojo.schemaorg.m3n5.core.Container.ActionStatus;
import org.kyojo.schemaorg.m3n5.gson.DeserializerTemplate;
public class ActionStatusDeserializer implements JsonDeserializer<ActionStatus> {
public static Map<String, Field> fldMap = new HashMap<>();
@Override
public ActionStatus deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context)
throws JsonParseException {
if(jsonElement.isJsonPrimitive()) {
return new ACTION_STATUS(jsonElement.getAsString());
}
return DeserializerTemplate.deserializeSub(jsonElement, type, context,
new ACTION_STATUS(), ActionStatus.class, ACTION_STATUS.class, fldMap);
}
}
|
[
"nagai@nagaikenshin.com"
] |
nagai@nagaikenshin.com
|
3cfae8b335facdef5118798660a130f86dafa70f
|
7fd22f26527187100c72bc70bd8b2ad69e6480d7
|
/dist/src/main/java/com/smartwebber/rest/BookingRequest.java
|
c78f1e452d0231a3cd58a4ad9877623b928e9155
|
[] |
no_license
|
Longmei/SmartWebber
|
0decc1a99753debd8a14036f27089933407e937f
|
b172dcadd0499f11546a45685080421af001d7cb
|
refs/heads/master
| 2020-04-16T01:26:54.582133
| 2012-07-07T06:50:15
| 2012-07-07T06:50:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,417
|
java
|
package com.smartwebber.rest;
import java.util.ArrayList;
import java.util.List;
import com.smartwebber.model.Performance;
/**
* <p>
* A {@link BookingRequest} is populated with unmarshalled JSON data, and handed to
* {@link BookingService#createBooking(BookingRequest)}.
* </p>
*
* @author Marius Bogoevici
* @author Pete Muir
*
*/
public class BookingRequest {
private List<TicketRequest> ticketRequests = new ArrayList<TicketRequest>();
private long performance;
private String email;
public BookingRequest() {
// Empty constructor for JAXB
}
public BookingRequest(Performance performance, String email) {
this.performance = performance.getId();
this.email = email;
}
public List<TicketRequest> getTicketRequests() {
return ticketRequests;
}
public void setTicketRequests(List<TicketRequest> ticketRequests) {
this.ticketRequests = ticketRequests;
}
public BookingRequest addTicketRequest(TicketRequest ticketRequest) {
ticketRequests.add(ticketRequest);
return this;
}
public long getPerformance() {
return performance;
}
public void setPerformance(long performance) {
this.performance = performance;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
|
[
"songzhiqi_1214@yahoo.com.cn"
] |
songzhiqi_1214@yahoo.com.cn
|
a7c419f3f302566b83d72ca2f45ca2612e28d58e
|
5c7c20f520c7731ea85ef19a0827516a85bd2f15
|
/junit-servers-core/src/test/java/com/github/mjeanroy/junit/servers/commons/lang/CollectionsTest.java
|
c66f4f1e162f534d9d2c7bd2c1a6078b7f23def5
|
[
"MIT"
] |
permissive
|
CDyWeb/junit-servers
|
8ab82add770c89a1712dbf1d6eb60fd81b8a76b0
|
90c1a278f8e3a5bc42b7ee797bfb94d04a06b7da
|
refs/heads/master
| 2023-06-06T10:11:26.122139
| 2021-06-18T07:01:49
| 2021-06-23T22:24:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,692
|
java
|
/**
* The MIT License (MIT)
*
* Copyright (c) 2014-2019 <mickael.jeanroy@gmail.com>
*
* 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.
*/
package com.github.mjeanroy.junit.servers.commons.lang;
import org.junit.jupiter.api.Test;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
class CollectionsTest {
@Test
void it_should_return_check_if_collection_is_null_or_empty() {
assertThat(Collections.isEmpty(null)).isTrue();
assertThat(Collections.isEmpty(emptyList())).isTrue();
assertThat(Collections.isEmpty(singletonList("foo"))).isFalse();
}
}
|
[
"mickael.jeanroy@gmail.com"
] |
mickael.jeanroy@gmail.com
|
7ee560307a69ddbb0c60eba1ef973b4ccb6c39c3
|
31f9169a77add63ce912d21b3870e145d9b0f9a9
|
/Close program properly/src/Mian.java
|
e3d08ad4749f66e99dc4a7a5941ef8dcca60cec2
|
[
"MIT"
] |
permissive
|
Ashleshk/Udemy-JavaFX-Complete-Course
|
45affcd5928697154481c16cda29fa89ecfe02f9
|
14ca21cc05d052fd22199511d71eb21883ca02bb
|
refs/heads/master
| 2022-09-10T04:32:02.857840
| 2020-05-14T07:23:02
| 2020-05-14T07:23:02
| 260,414,650
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,412
|
java
|
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Mian extends Application {
Stage window;
Button button;
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
window=primaryStage;
window.setTitle("title here");
window.setOnCloseRequest(e->{
//setOnCloseRequest cclose applcaiton after running part of code
// and don't care whether user said it false or true
e.consume(); //consume tell window that we got this --closing handleed manually
closeProgram();
});
button = new Button("Click me");
// //Alert Box in action
// button.setOnAction(e->AlertBox.display("Title of the Window","This alert box is awesome"));
button.setOnAction(e-> {
closeProgram();
});
StackPane layout = new StackPane();
layout.getChildren().add(button);
Scene scene = new Scene(layout,600,300);
window.setScene(scene);
window.show();
}
private void closeProgram() {
Boolean answer =ConfirmBox.display("Title","Sure you wanna leave");
if(answer)
{
window.close();
}
}
}
|
[
"ashleshuk@gmail.com"
] |
ashleshuk@gmail.com
|
c6819d11acea0a852227a5bf930260e138223cb5
|
cee232c96f9ed255db9545b78729fcf0c7d62365
|
/src/main/java/io/devfactory/next/config/MyConfiguration.java
|
4cbd836a4ebf231e4a65d4e99503c7f5e9a924f7
|
[
"MIT"
] |
permissive
|
mvmaniac/basic-servlet
|
afef266ff692dd1377e1185c8cb0813a87a57272
|
f048b04b880a75eb9f276a478157feec9a86ccfd
|
refs/heads/master
| 2023-06-24T12:19:02.536626
| 2022-10-19T14:13:06
| 2022-10-19T14:13:06
| 133,379,140
| 0
| 1
|
MIT
| 2023-06-14T22:29:34
| 2018-05-14T15:02:49
|
Java
|
UTF-8
|
Java
| false
| false
| 1,080
|
java
|
package io.devfactory.next.config;
import io.devfactory.core.annotation.Bean;
import io.devfactory.core.annotation.ComponentScan;
import io.devfactory.core.annotation.Configuration;
import io.devfactory.core.jdbc.JdbcTemplate;
import org.apache.commons.dbcp2.BasicDataSource;
import javax.sql.DataSource;
@Configuration
@ComponentScan({ "io.devfactory.next", "io.devfactory.core" })
public class MyConfiguration {
private static final String DB_DRIVER = "com.mysql.jdbc.Driver";
private static final String DB_URL = "jdbc:mysql://localhost:3306/basic_servlet?useSSL=false";
private static final String DB_USERNAME = "basic";
private static final String DB_PW = "basic";
@Bean
public DataSource dataSource() {
BasicDataSource ds = new BasicDataSource();
ds.setDriverClassName(DB_DRIVER);
ds.setUrl(DB_URL);
ds.setUsername(DB_USERNAME);
ds.setPassword(DB_PW);
return ds;
}
@Bean
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
}
|
[
"mvmaniaz@gmail.com"
] |
mvmaniaz@gmail.com
|
8588f155d1eb7166f7a2f96c38fa6750ac04e725
|
e04c4d401e264b4c9b9dec1cb1a619a1eb571d67
|
/SpringAOP-Notice/src/main/java/priv/lint/PostpositionNotice/main.java
|
826f2430e238ac9c18ae93b50888847b267b82d4
|
[] |
no_license
|
lintsGitHub/Spring-LearningPractice
|
629d988e87f85618f2b959563ec10c5cd8a15f18
|
aba09a42730360353b22bad38ff2d73aafddd3b7
|
refs/heads/master
| 2020-04-07T16:05:18.598348
| 2018-12-28T11:33:00
| 2018-12-28T11:33:00
| 158,514,520
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 391
|
java
|
package priv.lint.PostpositionNotice;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class main {
public static void main(String[] args) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("postpositionApplicationContext.xml");
Per bean = (Per) context.getBean("proxyBean");
bean.sayHello();
}
}
|
[
"2145604059@qq.com"
] |
2145604059@qq.com
|
5822fb7d5c1e9f64fe7f612463d676b3a35ac853
|
98503f4fef67ed9d01ce54ecac0267bf48adfa75
|
/Practices/src/DemoConnectionSystem/NamedData.java
|
d1da82fdaccf3ebdfce0854d88a9871d0a52416f
|
[] |
no_license
|
kiribeam/practices
|
9a35bf01e93bf152a8371c9094c5606642242e0b
|
e60de9cb6c7d23d919403aabe3e415c04764f7cf
|
refs/heads/master
| 2020-06-26T11:19:13.125241
| 2019-07-30T09:28:40
| 2019-07-30T09:28:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 408
|
java
|
import java.util.*;
import java.io.*;
public abstract class NamedData implements Serializable, Cloneable{
public static final long serialVersionUID =1l;
public String name;
public String getName(){
return name;
}
@Override
public String toString(){
return name;
}
@Override
protected NamedData clone() throws CloneNotSupportedException{
return (NamedData) super.clone();
}
}
|
[
"kiribeam@outlook.com"
] |
kiribeam@outlook.com
|
d2d26618d3c38f661fd222546a19787ff26481e9
|
fff20660dc7d5f6fa2279d456fada80e0ba1be68
|
/f8xn/account/src/main/java/com/utils/UtilController.java
|
d575152c2c922d36c1ad7013950d3c459d9a8638
|
[] |
no_license
|
jiance520/springcloud
|
790f8a18474925479ada1ab69be4891afa05e625
|
665e848e3b8818e58e8749d527eb9891029134ad
|
refs/heads/master
| 2022-12-14T22:09:52.068086
| 2021-11-09T14:48:23
| 2021-11-09T14:48:23
| 162,028,808
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,099
|
java
|
package com.utils;
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 org.springframework.web.context.ServletContextAware;
import javax.imageio.ImageIO;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
@Controller
public class UtilController implements ServletContextAware {
private static String primarynameKey = "pidnamedjj";
private ServletContext application;
@Override
public void setServletContext(ServletContext servletContext) {
this.application = servletContext;
}
//登陆验证码
@ResponseBody
@RequestMapping(value = "CheckCodeAction",produces = "application/json;chart=UTF-8")
public String checkCodeAction( String value, HttpSession session){
Object vobj = session.getAttribute("rand");
if(value.equalsIgnoreCase((String)vobj)){
System.out.println("验证码正确");
return "true";
}
else{
System.out.println("验证码错误");
return "false";
}
}
@ResponseBody
@RequestMapping("ImageAction")
public void imageAction(String value, HttpServletRequest request, HttpServletResponse response, HttpSession session) throws ServletException, IOException {
String StrFont=this.randstr();
//对session赋值
HttpSession ses=request.getSession();
ses.setAttribute("rand",StrFont);
System.out.println("-----rand:"+StrFont);
String fontName="宋体";
int fontSize=30;
int width=105;
int height=40;
Font font=new Font(fontName,Font.BOLD,fontSize);
BufferedImage StrImage=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
Graphics2D g2d=(Graphics2D)StrImage.getGraphics();
//设置背景色
g2d.setBackground(getRandColor(100,200));
//填充背景
g2d.clearRect(0,0,width,height);
//设置字体色
g2d.setFont(font);
g2d.setColor(Color.BLACK);
/*
写入随机字符串
StrFont - 要呈现的 String
x - 呈现 String 位置的 x 坐标
y - 呈现 String 位置的 y 坐标
*/
g2d.drawString(StrFont,1,30);
//释放此图形的上下文以及它使用的所有系统资源
g2d.dispose();
response.setHeader("pragma", "no-cache");
response.setHeader("cache-control", "no-cache");
response.setDateHeader("expires", 0);
response.setContentType("image/jpeg");
ServletOutputStream os = response.getOutputStream();
//写入输出流
ImageIO.write(StrImage,"jpg",os);
//刷新输出流
os.flush();
//关闭输出流
os.close();
}
//取得随机字符串
protected String randstr(){
String str="";
String charstr="23456789ABDEFIJLQRTYabdefghijqrty";
char[] arrchar=charstr.toCharArray();
int length=arrchar.length;
length=length-1;
Random rd=new Random();
char ct;
int it;
for(int i=0;i<6;i++)
{
it=rd.nextInt(length);
ct=arrchar[it];
str=str+String.valueOf(ct);
}
return "123456";//str
}
//获得随机颜色
protected Color getRandColor(int fc, int bc){
Random random = new Random();
if(fc>255) fc=255;
if(bc>255) bc=255;
int r=fc+random.nextInt(bc-fc);
int g=fc+random.nextInt(bc-fc);
int b=fc+random.nextInt(bc-fc);
return new Color(r,g,b);
}
}
|
[
"jiance520@163.com"
] |
jiance520@163.com
|
5d0d9b9b977ba77ec376cc406484db292f64d983
|
4cf5eef1c83e535ad54dac4958e6149ff33ea7e9
|
/app/src/main/java/com/upyun/shortvideo/album/AlbumUtils.java
|
1ea4ab50e6c3ae07a97183acf64a51b76e3d9ffa
|
[] |
no_license
|
lutao2599/Android-short-video
|
b133cf2fdf65fc0b6db6251c5652775aadc12362
|
ea6cdaa775ec5ae46283ca1e043a14f40e6d4bb0
|
refs/heads/master
| 2022-03-19T01:11:01.271998
| 2019-11-21T09:37:34
| 2019-11-21T09:37:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 780
|
java
|
package com.upyun.shortvideo.album;
import android.content.Context;
import android.content.Intent;
import org.lasque.tusdk.core.TuSdkContext;
/**
* 相册工具类
*/
public class AlbumUtils
{
/**
* 打开相册选取视频
*/
public static void openVideoAlbum(String intentClassName,int selectMax)
{
Context context = TuSdkContext.context();
if (context == null) return;
Intent intent = new Intent(context,MovieAlbumActivity.class);
intent.putExtra("cutClassName",intentClassName);
intent.putExtra("selectMax", selectMax);
// 修复个别机型上使用ApplicationContext启动Activity崩溃问题
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
}
|
[
"mingming.ye@upai.com"
] |
mingming.ye@upai.com
|
45c282198d33d6ec3d39dff1807b12088b267b85
|
5301c6de1fab31d8724967ad6778a865765e0f4a
|
/presentation/src/main/java/com/github/anrimian/simpletestapppfour/ui/FilmsPresenter.java
|
595f4ece3fa6c5eb9a5a793db2a87370768b7f8c
|
[] |
no_license
|
Anrimian/SimpleTestAppFour
|
77d6c19dad703f318c2f87e6cd65aae93ffe55f6
|
d2a782316873b4e895b21fe5f0c841b7df96b00f
|
refs/heads/master
| 2021-08-17T06:28:33.659204
| 2017-11-20T22:45:40
| 2017-11-20T22:45:40
| 111,338,826
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,715
|
java
|
package com.github.anrimian.simpletestapppfour.ui;
import android.text.TextUtils;
import com.arellomobile.mvp.InjectViewState;
import com.arellomobile.mvp.MvpPresenter;
import com.github.anrimian.domain.business.FilmsInteractor;
import com.github.anrimian.domain.models.Film;
import com.github.anrimian.simpletestapppfour.utils.error.ErrorCommand;
import com.github.anrimian.simpletestapppfour.utils.error.parser.ErrorParser;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.disposables.Disposable;
/**
* Created on 20.11.2017.
*/
@InjectViewState
public class FilmsPresenter extends MvpPresenter<FilmsView> {
private static final int SEARCH_DELAY = 750;
private FilmsInteractor filmsInteractor;
private Scheduler uiScheduler;
private ErrorParser errorParser;
private final List<Film> films = new ArrayList<>();
private String searchQuery;
private Disposable startSearchDisposable;
private Disposable loadingDisposable;
public FilmsPresenter(FilmsInteractor filmsInteractor,
Scheduler uiScheduler,
ErrorParser errorParser) {
this.filmsInteractor = filmsInteractor;
this.uiScheduler = uiScheduler;
this.errorParser = errorParser;
}
@Override
protected void onFirstViewAttach() {
super.onFirstViewAttach();
getViewState().bindFilmList(films);
startLoading();
}
@Override
public void attachView(FilmsView view) {
super.attachView(view);
view.bindSearchText(searchQuery);
}
void onTryAgainButtonClicked() {
startLoading();
}
void onStartSearchButtonClicked(String searchQuery) {
startSearch(searchQuery);
}
void onSearchTextChanged(String searchQuery) {
if (startSearchDisposable != null) {
startSearchDisposable.dispose();
}
startSearchDisposable = Observable.timer(SEARCH_DELAY, TimeUnit.MILLISECONDS)
.observeOn(uiScheduler)
.subscribe(o -> startSearch(searchQuery));
}
private void startLoading() {
getViewState().showProgress();
loadingDisposable = filmsInteractor.getFilms(searchQuery)
.observeOn(uiScheduler)
.subscribe(this::onLoadingCompete, this::onLoadingError);
}
private void onLoadingError(Throwable throwable) {
ErrorCommand errorCommand = errorParser.parseError(throwable);
getViewState().showStateError(errorCommand);
}
private void onLoadingCompete(List<Film> results) {
films.clear();
films.addAll(results);
if (films.isEmpty()) {
getViewState().showEmptyState();
} else {
getViewState().showComplete();
}
getViewState().notifyItemsInserted(results.size());
}
private void startSearch(String searchQuery) {
if (TextUtils.isEmpty(searchQuery) && TextUtils.isEmpty(this.searchQuery)) {
return;
}
this.searchQuery = searchQuery;
if (loadingDisposable != null) {
loadingDisposable.dispose();
loadingDisposable = null;
}
if (startSearchDisposable != null) {
startSearchDisposable.dispose();
startSearchDisposable = null;
}
int oldSize = films.size();
films.clear();
getViewState().notifyItemsRemoved(oldSize);
startLoading();
}
}
|
[
"anrimian@gmail.com"
] |
anrimian@gmail.com
|
f429303250be2be1b35810b8f163ab750d38312c
|
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
|
/project_1_2/src/e/d/b/Calc_1_2_4310.java
|
02acc2aa45228cd98e51589a3896b1667b073745
|
[] |
no_license
|
chalstrick/bigRepo1
|
ac7fd5785d475b3c38f1328e370ba9a85a751cff
|
dad1852eef66fcec200df10083959c674fdcc55d
|
refs/heads/master
| 2016-08-11T17:59:16.079541
| 2015-12-18T14:26:49
| 2015-12-18T14:26:49
| 48,244,030
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 131
|
java
|
package e.d.b;
public class Calc_1_2_4310 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
|
[
"christian.halstrick@sap.com"
] |
christian.halstrick@sap.com
|
05bcc8c02531f9dcf8a1aaeea66c7f84ee14dceb
|
a464211147d0fd47d2be533a5f0ced0da88f75f9
|
/EvoSuiteTests/evosuite_2/evosuite-tests/org/mozilla/javascript/NativeJavaTopPackage_ESTest.java
|
c5605d344a38e2372c25ec01bbbf7e95c0336b4e
|
[
"MIT"
] |
permissive
|
LASER-UMASS/Swami
|
63016a6eccf89e4e74ca0ab775e2ef2817b83330
|
5bdba2b06ccfad9d469f8122c2d39c45ef5b125f
|
refs/heads/master
| 2022-05-19T12:22:10.166574
| 2022-05-12T13:59:18
| 2022-05-12T13:59:18
| 170,765,693
| 11
| 5
|
NOASSERTION
| 2022-05-12T13:59:19
| 2019-02-14T22:16:01
|
HTML
|
UTF-8
|
Java
| false
| false
| 3,394
|
java
|
/*
* This file was automatically generated by EvoSuite
* Wed Aug 01 06:05:37 GMT 2018
*/
package org.mozilla.javascript;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.IdFunctionObject;
import org.mozilla.javascript.NativeJavaClass;
import org.mozilla.javascript.NativeJavaTopPackage;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class NativeJavaTopPackage_ESTest extends NativeJavaTopPackage_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
// Undeclared exception!
try {
Context.getContext();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No Context associated with current Thread
//
verifyException("org.mozilla.javascript.Context", e);
}
}
@Test(timeout = 4000)
public void test1() throws Throwable {
ClassLoader classLoader0 = ClassLoader.getSystemClassLoader();
NativeJavaTopPackage nativeJavaTopPackage0 = new NativeJavaTopPackage(classLoader0);
IdFunctionObject idFunctionObject0 = new IdFunctionObject(nativeJavaTopPackage0, "JavaTopPackage", 1, 2);
Context context0 = Context.getCurrentContext();
// Undeclared exception!
try {
nativeJavaTopPackage0.execIdCall(idFunctionObject0, context0, idFunctionObject0, idFunctionObject0, context0.emptyArgs);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Expected argument to getClass() to be a Java object.
//
verifyException("org.mozilla.javascript.Context", e);
}
}
@Test(timeout = 4000)
public void test2() throws Throwable {
ClassLoader classLoader0 = ClassLoader.getSystemClassLoader();
NativeJavaTopPackage nativeJavaTopPackage0 = new NativeJavaTopPackage(classLoader0);
// Undeclared exception!
try {
Context.getContext();
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// No Context associated with current Thread
//
verifyException("org.mozilla.javascript.Context", e);
}
}
@Test(timeout = 4000)
public void test3() throws Throwable {
ClassLoader classLoader0 = ClassLoader.getSystemClassLoader();
NativeJavaTopPackage nativeJavaTopPackage0 = new NativeJavaTopPackage(classLoader0);
NativeJavaClass nativeJavaClass0 = new NativeJavaClass();
Object[] objectArray0 = new Object[5];
objectArray0[0] = (Object) nativeJavaClass0;
// Undeclared exception!
try {
nativeJavaTopPackage0.construct((Context) null, nativeJavaClass0, objectArray0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// Constructor for \"Packages\" expects argument of type java.lang.Classloader
//
verifyException("org.mozilla.javascript.Context", e);
}
}
}
|
[
"mmotwani@cs.umass.edu"
] |
mmotwani@cs.umass.edu
|
ee585f595116b55fc0a55203c4c5a26a65a637d4
|
b4d4093daf6d5f2a09396cd830693df2f0a79d07
|
/yshop-api/src/main/java/co/yixiang/modules/monitor/rest/LimitController.java
|
e753ff3f8e972a6c1378a2ca8f09988179567036
|
[
"Apache-2.0"
] |
permissive
|
aiceorange/yshopmall
|
2035efb93929c503ea3cd4686fccff91a2aeaeb3
|
805b441cc9b91428154ff6813fce64b5aaaab244
|
refs/heads/master
| 2020-12-10T08:42:40.407047
| 2020-01-13T05:37:22
| 2020-01-13T05:37:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 847
|
java
|
package co.yixiang.modules.monitor.rest;
import co.yixiang.annotation.Limit;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.atomic.AtomicInteger;
/**
*
* 接口限流测试类
*/
@RestController
@RequestMapping("api")
public class LimitController {
private static final AtomicInteger ATOMIC_INTEGER = new AtomicInteger();
/**
* 测试限流注解,下面配置说明该接口 60秒内最多只能访问 10次,保存到redis的键名为 limit_test,
*/
@Limit(key = "test", period = 60, count = 10, name = "testLimit", prefix = "limit")
@GetMapping("/limit")
public int testLimit() {
return ATOMIC_INTEGER.incrementAndGet();
}
}
|
[
"guchengwuyue@163.com"
] |
guchengwuyue@163.com
|
92ad998dfba993a6cdae9c58eb1fb51aaabe5244
|
d4b17a1dde0309ea8a1b2f6d6ae640e44a811052
|
/lang_interface/java/com/intel/daal/algorithms/neural_networks/layers/stochastic_pooling2d/StochasticPooling2dMethod.java
|
7c757482a0c701d7bf2c87326bdafcec845808da
|
[
"Apache-2.0",
"Intel"
] |
permissive
|
h2oai/daal
|
c50f2b14dc4a9ffc0b7f7bcb40b599cadac6d333
|
d49815df3040f3872a1fdb9dc99ee86148e4494e
|
refs/heads/daal_2018_beta_update1
| 2023-05-25T17:48:44.312245
| 2017-09-29T13:30:10
| 2017-09-29T13:30:10
| 96,125,165
| 2
| 3
| null | 2017-09-29T13:30:11
| 2017-07-03T15:26:26
|
C++
|
UTF-8
|
Java
| false
| false
| 1,887
|
java
|
/* file: StochasticPooling2dMethod.java */
/*******************************************************************************
* Copyright 2014-2017 Intel Corporation
*
* 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.
*******************************************************************************/
/**
* @ingroup stochastic_pooling2d
* @{
*/
package com.intel.daal.algorithms.neural_networks.layers.stochastic_pooling2d;
/**
* <a name="DAAL-CLASS-ALGORITHMS__NEURAL_NETWORKS__LAYERS__STOCHASTIC_POOLING2D__STOCHASTICPOOLING2DMETHOD"></a>
* @brief Available methods for the two-dimensional stochastic pooling layer
*/
public final class StochasticPooling2dMethod {
/** @private */
static {
System.loadLibrary("JavaAPI");
}
private int _value;
/**
* Constructs the method object using the provided value
* @param value Value corresponding to the method object
*/
public StochasticPooling2dMethod(int value) {
_value = value;
}
/**
* Returns the value corresponding to the method object
* @return Value corresponding to the method object
*/
public int getValue() {
return _value;
}
private static final int DefaultMethodValue = 0;
public static final StochasticPooling2dMethod defaultDense = new StochasticPooling2dMethod(DefaultMethodValue); /*!< Default method */
}
/** @} */
|
[
"vasily.rubtsov@intel.com"
] |
vasily.rubtsov@intel.com
|
cb954cbb4c8301d30e8a442cd83bdf9bb6f4f4e0
|
2bc2eadc9b0f70d6d1286ef474902466988a880f
|
/tags/mule-1.3.1/mule/tests/integration/src/test/java/org/mule/test/integration/providers/file/FileAppendEndpointTestCase.java
|
a43df0051d91ead8eaa3a6ef5ad461263ef5a240
|
[] |
no_license
|
OrgSmells/codehaus-mule-git
|
085434a4b7781a5def2b9b4e37396081eaeba394
|
f8584627c7acb13efdf3276396015439ea6a0721
|
refs/heads/master
| 2022-12-24T07:33:30.190368
| 2020-02-27T19:10:29
| 2020-02-27T19:10:29
| 243,593,543
| 0
| 0
| null | 2022-12-15T23:30:00
| 2020-02-27T18:56:48
| null |
UTF-8
|
Java
| false
| false
| 741
|
java
|
/*
* $Id$
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
*
* The software in this package is published under the terms of the MuleSource MPL
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.test.integration.providers.file;
/**
* @author <a href="mailto:stephen.fenech@symphonysoft.com">Stephen Fenech</a>
*/
public class FileAppendEndpointTestCase extends FileAppendConnectorTestCase
{
protected String getConfigResources()
{
return "org/mule/test/integration/providers/file/mule-fileappend-connector-config.xml";
}
}
|
[
"lajos@bf997673-6b11-0410-b953-e057580c5b09"
] |
lajos@bf997673-6b11-0410-b953-e057580c5b09
|
7e7fca789291deddc5005220ad162ed20ad831d4
|
6ebe48d7fca9467ef02df22cb3a3ddb681f02be5
|
/Open Source Java Projects- Experimental Subjects/18_jsecurity/src/main/java/org/jsecurity/io/Serializer.java
|
5d8fe502ef183d9d69b9b17c1a86919af76cb217
|
[
"Apache-2.0"
] |
permissive
|
mubparekh/MS-Computer-Science-Masters-Project
|
889d3798357a51e8bb72501b74026365e5d8e34f
|
d3d5cd77270e2a3ed4af829430940da18a8d5595
|
refs/heads/master
| 2021-01-22T21:12:38.934221
| 2017-03-20T13:13:28
| 2017-03-20T13:13:28
| 85,402,502
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,539
|
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.jsecurity.io;
/**
* A <code>Serializer</code> converts objects to raw binary data and vice versa, enabling persistent storage
* of objects to files, HTTP cookies, or other mechanism.
* <p/>
* A <code>Serializer</code> should only do conversion, never change the data, such as encoding/decoding or
* encryption. These orthoganal concerns are handled elsewhere by JSecurity, for example, via
* {@link org.jsecurity.codec.CodecSupport CodecSupport} and {@link org.jsecurity.crypto.Cipher Cipher}s.
* @author Les Hazlewood
* @since 0.9
*/
public interface Serializer {
/**
* Converts the specified Object into a byte[] array. This byte[] array must be able to be reconstructed
* back into the original Object form via the {@link #deserialize(byte[]) deserialize} method.
* @param o the Object to convert into a byte[] array.
* @return a byte[] array representing the Object's state that can be restored later.
* @throws SerializationException if an error occurrs converting the Object into a byte[] array.
*/
byte[] serialize(Object o) throws SerializationException;
/**
* Converts the specified raw byte[] array back into an original Object form. This byte[] array is expected to
* be the output of a previous {@link #serialize(Object) serialize} method call.
*
* @param serialized the raw data resulting from a previous {@link #serialize(Object) serialize} call.
* @return the Object that was previously serialized into the raw byte[] array.
* @throws SerializationException if an error occurrs converting the raw byte[] array back into an Object.
*/
Object deserialize(byte[] serialized) throws SerializationException;
}
|
[
"mparekh@uccs.edu"
] |
mparekh@uccs.edu
|
17135295a4ab2cc79814192407de6f4d0d11ea4a
|
4cf769a538b7eda2d32cbfa855ac01ca490db151
|
/Design-Pattern/tic-tac-toe-version-3/src/com/techlabs/game/controller/IGameController.java
|
5e244e1596b40bb21ed0f2cb8472b0c0d8e4cafc
|
[] |
no_license
|
lin-sel/swabhaw
|
d492fb9a47e3baee073ed90277963050eb14ed91
|
a7311b246e6e910078558cca8da1e168e4f8c767
|
refs/heads/master
| 2023-01-13T06:25:45.127899
| 2020-03-09T06:07:09
| 2020-03-09T06:07:09
| 218,722,259
| 1
| 0
| null | 2023-01-07T18:59:57
| 2019-10-31T08:48:47
|
Go
|
UTF-8
|
Java
| false
| false
| 153
|
java
|
package com.techlabs.game.controller;
import com.teclabs.marktype.GameStatus;
public interface IGameController {
GameStatus getInput(int position);
}
|
[
"ccnsy86@gmail.com"
] |
ccnsy86@gmail.com
|
4aef535b573d6b7d5187227c7c3b0b8b932cc92c
|
e3eb00125a35950cb103aca085b1e3fec71fb0e0
|
/azure-mgmt-devices/src/main/java/com/microsoft/azure/management/devices/OperationsMonitoringProperties.java
|
affe1a22719324ed9212a99b4e19239f8b30f083
|
[
"MIT"
] |
permissive
|
AutorestCI/azure-libraries-for-java
|
cefc78a0c47da086a34f5c3b9b742d91872c5cb0
|
e9b6d3f111856cb8509a5cfffcdb3366eb9f36c5
|
refs/heads/master
| 2021-04-15T09:52:41.051392
| 2018-03-23T18:18:31
| 2018-03-23T18:18:31
| 126,526,915
| 2
| 0
|
MIT
| 2018-10-10T16:48:13
| 2018-03-23T18:51:17
|
Java
|
UTF-8
|
Java
| false
| false
| 1,428
|
java
|
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
package com.microsoft.azure.management.devices;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* The operations monitoring properties for the IoT hub. The possible keys to
* the dictionary are Connections, DeviceTelemetry, C2DCommands,
* DeviceIdentityOperations, FileUploadOperations, Routes, D2CTwinOperations,
* C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods.
*/
public class OperationsMonitoringProperties {
/**
* The events property.
*/
@JsonProperty(value = "events")
private Map<String, OperationMonitoringLevel> events;
/**
* Get the events value.
*
* @return the events value
*/
public Map<String, OperationMonitoringLevel> events() {
return this.events;
}
/**
* Set the events value.
*
* @param events the events value to set
* @return the OperationsMonitoringProperties object itself.
*/
public OperationsMonitoringProperties withEvents(Map<String, OperationMonitoringLevel> events) {
this.events = events;
return this;
}
}
|
[
"jianghaolu@users.noreply.github.com"
] |
jianghaolu@users.noreply.github.com
|
67ce148e7edf1f9d0e5f71bb6a2a9cdec5e295f5
|
6d109557600329b936efe538957dfd0a707eeafb
|
/examples/v201208/suggestedadunitservice/GetSuggestedAdUnitsByStatementExample.java
|
cc8ee00dfd970742e80bfb3033ad728001c12c39
|
[
"Apache-2.0"
] |
permissive
|
google-code-export/google-api-dfp-java
|
51b0142c19a34cd822a90e0350eb15ec4347790a
|
b852c716ef6e5d300363ed61e15cbd6242fbac85
|
refs/heads/master
| 2020-05-20T03:52:00.420915
| 2013-12-19T23:08:40
| 2013-12-19T23:08:40
| 32,133,590
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,843
|
java
|
// Copyright 2012 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package v201208.suggestedadunitservice;
import com.google.api.ads.dfp.lib.DfpService;
import com.google.api.ads.dfp.lib.DfpServiceLogger;
import com.google.api.ads.dfp.lib.DfpUser;
import com.google.api.ads.dfp.lib.utils.v201208.StatementBuilder;
import com.google.api.ads.dfp.v201208.Statement;
import com.google.api.ads.dfp.v201208.SuggestedAdUnit;
import com.google.api.ads.dfp.v201208.SuggestedAdUnitPage;
import com.google.api.ads.dfp.v201208.SuggestedAdUnitServiceInterface;
/**
* This example gets suggested ad units that have more than 50 requests. The
* statement retrieves up to the maximum page size limit of 500. This feature is
* only available to DFP premium solution networks.
*
* Tags: SuggestedAdUnitService.getSuggestedAdUnitsByStatement
*
* @author api.arogal@gmail.com (Adam Rogal)
*/
public class GetSuggestedAdUnitsByStatementExample {
public static void main(String[] args) {
try {
// Log SOAP XML request and response.
DfpServiceLogger.log();
// Get DfpUser from "~/dfp.properties".
DfpUser user = new DfpUser();
// Get the SuggestedAdUnitService.
SuggestedAdUnitServiceInterface suggestedAdUnitService =
user.getService(DfpService.V201208.SUGGESTED_AD_UNIT_SERVICE);
// Create a statement to only select suggested ad units that have more
// than 50 requests.
Statement filterStatement =
new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500")
.putValue("numRequests", 50).toStatement();
// Get suggested ad units by statement.
SuggestedAdUnitPage page =
suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement);
if (page.getResults() != null) {
int i = page.getStartIndex();
for (SuggestedAdUnit suggestedAdUnit : page.getResults()) {
System.out.println(i + ") Suggested ad unit with ID \"" + suggestedAdUnit.getId()
+ "\" and number of requests \"" + suggestedAdUnit.getNumRequests()
+ "\" was found.");
i++;
}
}
System.out.println("Number of results found: " + page.getTotalResultSetSize());
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
[
"api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098"
] |
api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098
|
cecf828981a00b5d2bcbbe2109cedb6cfb9b84b6
|
5ebb1d3d4b7e54d016a43d522a3a09a6318555e3
|
/Euler/Java/src/main/java/euler/Problem231.java
|
f94196b9bab3b63b3d6642cc92c27bec59f57fca
|
[] |
no_license
|
redhill42/MMA
|
3af2c4ba5a972f1697b054057b1bfca7fc540f5c
|
1cf0354d43ade6669678a171f8bab01695c075b0
|
refs/heads/master
| 2021-04-26T22:57:04.401893
| 2018-09-01T02:27:03
| 2018-09-01T02:27:03
| 123,901,653
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,797
|
java
|
package euler;
import java.util.Arrays;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.Future;
import euler.algo.SegmentedSieve;
import static euler.algo.Library.factorialExponent;
public final class Problem231 {
private Problem231() {}
private static class SolveTask implements Callable<Long> {
private final long n, k;
private final SegmentedSieve.Segment segment;
SolveTask(long n, long k, SegmentedSieve.Segment segment) {
this.n = n;
this.k = k;
this.segment = segment;
}
@Override
public Long call() throws Exception {
long p, a, r = 0;
while ((p = segment.next()) > 0) {
a = factorialExponent(n, p);
a -= factorialExponent(k, p);
a -= factorialExponent(n - k, p);
r += p * a;
}
return r;
}
}
public static long solve(long n, long k)
throws ExecutionException, InterruptedException
{
SegmentedSieve sieve = new SegmentedSieve(n);
SegmentedSieve.Segment[] blocks = sieve.partition();
ForkJoinPool pool = new ForkJoinPool();
SolveTask[] tasks = new SolveTask[blocks.length];
Arrays.setAll(tasks, i -> new SolveTask(n, k, blocks[i]));
long result = 0;
for (Future<Long> res : pool.invokeAll(Arrays.asList(tasks))) {
result += res.get();
}
pool.shutdown();
return result;
}
public static void main(String[] args)
throws ExecutionException, InterruptedException
{
System.out.println(solve(20_000_000, 15_000_000));
}
}
|
[
"daniel.yuan@me.com"
] |
daniel.yuan@me.com
|
92679b64a44414242a7c0cdef27f0e07a59335ef
|
e3d3a23b2a70a31f40f9347818d97a7370b6c276
|
/kotlin/collections/ArraysKt___ArraysKt$asSequence$$inlined$Sequence$5.java
|
96bae31c092c82305f1ac5a2ddf1b59f23980493
|
[] |
no_license
|
HakerTag/lllllll
|
79d1f1c1be35f2e1ec47247f5b1b04c098595380
|
356b639247fa60123e40584179bdb75278868c7c
|
refs/heads/main
| 2023-08-16T11:00:17.819659
| 2021-08-10T14:58:16
| 2021-08-10T14:58:16
| 394,693,473
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,076
|
java
|
package kotlin.collections;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.jvm.internal.ArrayIteratorsKt;
import kotlin.sequences.Sequence;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010(\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\u000f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003H\u0002¨\u0006\u0004¸\u0006\u0000"}, d2 = {"kotlin/sequences/SequencesKt__SequencesKt$Sequence$1", "Lkotlin/sequences/Sequence;", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 1, 15})
/* compiled from: Sequences.kt */
public final class ArraysKt___ArraysKt$asSequence$$inlined$Sequence$5 implements Sequence<Long> {
final /* synthetic */ long[] $this_asSequence$inlined;
public ArraysKt___ArraysKt$asSequence$$inlined$Sequence$5(long[] jArr) {
this.$this_asSequence$inlined = jArr;
}
@Override // kotlin.sequences.Sequence
public Iterator<Long> iterator() {
return ArrayIteratorsKt.iterator(this.$this_asSequence$inlined);
}
}
|
[
"48122411+HakerTag@users.noreply.github.com"
] |
48122411+HakerTag@users.noreply.github.com
|
7beb56bc735a03684fc9edcbb23965d1d7e3351e
|
d33574802593c6bb49d44c69fc51391f7dc054af
|
/ShipLinx/src/main/java/com/meritconinc/shiplinx/carrier/purolator/ws/pickup/proxy/ArrayOfstring.java
|
72aa4f37819738aaa3f74b34ad8522c78675e49a
|
[] |
no_license
|
mouadaarab/solushipalertmanagement
|
96734a0ff238452531be7f4d12abac84b88de214
|
eb4cf67a7fbf54760edd99dc51efa12d74fa058e
|
refs/heads/master
| 2021-12-06T06:09:15.559467
| 2015-10-06T09:00:54
| 2015-10-06T09:00:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,003
|
java
|
package com.meritconinc.shiplinx.carrier.purolator.ws.pickup.proxy;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ArrayOfstring complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ArrayOfstring">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="string" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfstring", namespace = "http://schemas.microsoft.com/2003/10/Serialization/Arrays", propOrder = {
"string"
})
public class ArrayOfstring {
@XmlElement(nillable = true)
protected List<String> string;
/**
* Gets the value of the string property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the string property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getString().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getString() {
if (string == null) {
string = new ArrayList<String>();
}
return this.string;
}
}
|
[
"harikrishnan.r@mitosistech.com"
] |
harikrishnan.r@mitosistech.com
|
92698240fdc4a6046cfe0c721d3e275736251a1e
|
90207ac52870dfa498a2d280a4adb3ea349825d5
|
/src/com/facebook/buck/cli/UninstallCommand.java
|
dffe3321a75adde192a8fc5fb2af5023fc4c41d0
|
[
"Apache-2.0"
] |
permissive
|
KhalidElSayed/buck
|
cd31a5736cb04eb2395ee52e36dc88aebbd2db55
|
d1019cdd20ec6a4cd0f1351632cd662a57a26418
|
refs/heads/master
| 2021-01-18T06:00:02.516097
| 2013-08-22T17:44:35
| 2013-08-23T17:06:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,887
|
java
|
/*
* Copyright 2012-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.cli;
import com.facebook.buck.json.BuildFileParseException;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.parser.BuildTargetParser;
import com.facebook.buck.parser.NoSuchBuildTargetException;
import com.facebook.buck.parser.ParseContext;
import com.facebook.buck.parser.Parser;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.DependencyGraph;
import com.facebook.buck.rules.InstallableBuildRule;
import com.facebook.buck.step.ExecutionContext;
import com.facebook.buck.util.Verbosity;
import com.google.common.collect.ImmutableList;
import java.io.IOException;
public class UninstallCommand extends UninstallSupportCommandRunner<UninstallCommandOptions> {
public UninstallCommand(CommandRunnerParams params) {
super(params);
}
@Override
UninstallCommandOptions createOptions(BuckConfig buckConfig) {
return new UninstallCommandOptions(buckConfig);
}
@Override
int runCommandWithOptionsInternal(UninstallCommandOptions options) throws IOException {
// Set the logger level based on the verbosity option.
Verbosity verbosity = console.getVerbosity();
Logging.setLoggingLevelForVerbosity(verbosity);
// Make sure that only one build target is specified.
if (options.getArguments().size() != 1) {
getStdErr().println("Must specify exactly one android_binary() rule.");
return 1;
}
// Get a parser.
Parser parser = getParser();
// Parse all of the build targets specified by the user.
BuildTargetParser buildTargetParser = parser.getBuildTargetParser();
String buildTargetName = options.getArgumentsFormattedAsBuildTargets().get(0);
DependencyGraph dependencyGraph;
BuildTarget buildTarget;
try {
buildTarget = buildTargetParser.parse(buildTargetName, ParseContext.fullyQualified());
dependencyGraph = parser.parseBuildFilesForTargets(ImmutableList.of(buildTarget),
options.getDefaultIncludes(),
getBuckEventBus());
} catch (NoSuchBuildTargetException | BuildFileParseException e) {
console.printBuildFailureWithoutStacktrace(e);
return 1;
}
// Find the android_binary() rule from the parse.
BuildRule buildRule = dependencyGraph.findBuildRuleByTarget(buildTarget);
if (!(buildRule instanceof InstallableBuildRule)) {
console.printBuildFailure(String.format(
"Specified rule %s must be of type android_binary() or apk_genrule() but was %s().\n",
buildRule.getFullyQualifiedName(),
buildRule.getType().getName()));
return 1;
}
InstallableBuildRule installableBuildRule = (InstallableBuildRule)buildRule;
// We need this in case adb isn't already running.
ExecutionContext context = createExecutionContext(options, dependencyGraph);
// Find application package name from manifest and uninstall from matching devices.
String appId = tryToExtractPackageNameFromManifest(installableBuildRule);
return uninstallApk(appId,
options.adbOptions(),
options.targetDeviceOptions(),
options.uninstallOptions(),
context) ? 0 : 1;
}
@Override
String getUsageIntro() {
return "Specify an android_binary() rule whose APK should be uninstalled";
}
}
|
[
"mbolin@fb.com"
] |
mbolin@fb.com
|
d6dc56fad5f79e186f9c8ea482f93ee3a85043f8
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-ws/results/LANG-44b-1-18-Single_Objective_GGA-WeightedSum/org/apache/commons/lang/NumberUtils_ESTest_scaffolding.java
|
5de9988902f72f0421d8ac1bd90ae9ff9a4264a4
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 439
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Mar 31 10:10:53 UTC 2020
*/
package org.apache.commons.lang;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class NumberUtils_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
9f61653b8643103cf26d16913e63b4f1db6f1cae
|
8b4dad04d6df47503082ccf0c6977e8f4dd36e96
|
/src/main/java/com/chinalbs/entity/EnterpriseToConductor.java
|
f45f5b184c4fbb703d6f33f018973e07da4fb658
|
[] |
no_license
|
wangyiran125/portal_ec
|
debe084e3cb4ec093ef7f2ed75a40e1ae70b9401
|
5dd1acdb583c52d7a18eb69d320fdf02d4567532
|
refs/heads/master
| 2021-03-12T19:24:53.431109
| 2015-05-20T07:15:00
| 2015-05-20T07:15:00
| 35,932,151
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,362
|
java
|
package com.chinalbs.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@Entity
@Table(name = "rd_enterprise_to_conductor")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "rd_enterprise_to_conductor_sequence")
public class EnterpriseToConductor implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator = "sequenceGenerator")
private long id;
@Column(name = "enterprise_id")
private long enterpriseId;
@Column(name = "conductor_id")
private long conductorId;
@Column(name = "create_time")
private Date createTime;
public long getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(long enterpriseId) {
this.enterpriseId = enterpriseId;
}
public long getConductorId() {
return conductorId;
}
public void setConductorId(long conductorId) {
this.conductorId = conductorId;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
|
[
"wangyiran125@icloud.com"
] |
wangyiran125@icloud.com
|
79b96d4611b48bfe23ece0afac8b1afc4a31247f
|
65f34373765dd41bc889e0a5cfa0fbb919b82ef6
|
/ch11upload1/src/main/java/controller/ProductController.java
|
db4caa7742cd08c1bb86e107a904d510e63216ea
|
[] |
no_license
|
Hao-HOU/SpringMVCpauldeck
|
a41fed150a9ac3c4d3398839ddde7050e7f8908b
|
ad49a40b46d18f2a06ba4414654211342ddbe879
|
refs/heads/master
| 2021-01-20T08:16:39.200382
| 2017-05-19T07:04:52
| 2017-05-19T07:04:52
| 90,126,375
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,929
|
java
|
package controller;
import domain.Product;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Hao HOU on 2017/5/12.
*/
@Controller
public class ProductController {
private static final Log logger = LogFactory.getLog(ProductController.class);
@RequestMapping(value = "/input-product")
public String inputProduct(Model model) {
model.addAttribute("product", new Product());
return "ProductForm";
}
@RequestMapping(value = "/save-product")
public String saveProduct(HttpServletRequest servletRequest, @ModelAttribute Product product,
BindingResult bindingResult, Model model) {
List<MultipartFile> files = product.getImages();
List<String> fileNames = new ArrayList<>();
if (null != files && files.size() > 0) {
for (MultipartFile multipartFile : files) {
String fileName = multipartFile.getOriginalFilename();
fileNames.add(fileName);
File imageFile = new File(servletRequest.getServletContext().getRealPath("/image"), fileName);
try {
multipartFile.transferTo(imageFile);
} catch (IOException e) {
e.printStackTrace();
}
}
}
//save product
model.addAttribute("product", product);
return "ProductDetails";
}
}
|
[
"houhao118@163.com"
] |
houhao118@163.com
|
6d21f60690c543d39250b54f53d961bf537cba31
|
675574d5cb3cb989323cc9078fafd1a9a81ac602
|
/External_TrafficBroadcast/src/cn/ffcs/external/trafficbroadcast/entity/TrafficInfo.java
|
719e851be0267aaf5a13f99a562d3ab00c38fdcf
|
[
"Apache-2.0"
] |
permissive
|
un097/wuxianchangchun
|
24f702ce1d8e7f763ae9762fb63606f78a33565b
|
cc7ffcdf171eb9463ef396e389127d69cbd18c93
|
refs/heads/master
| 2020-07-31T07:35:13.486938
| 2016-11-13T09:25:36
| 2016-11-13T09:25:36
| 73,606,051
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 738
|
java
|
package cn.ffcs.external.trafficbroadcast.entity;
/**
* 路况详情类
*
* @author daizhq
*
* @date 2014.12.01
*
* */
public class TrafficInfo {
private String location;
private String distance;
private String detail;
private String time;
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getDistance() {
return distance;
}
public void setDistance(String distance) {
this.distance = distance;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}
|
[
"un097@qq.com"
] |
un097@qq.com
|
bae7d616c0e4dfcdb0168161dabfe5e4901d2f1c
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_43266906e2541dc34bf4a985c5acf9060c58566c/Config/2_43266906e2541dc34bf4a985c5acf9060c58566c_Config_s.java
|
935796c023b0b5b6fe6051c5c5ceaec4e36d6887
|
[] |
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
| 5,028
|
java
|
package x10.osgi;
import java.io.IOException;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedServiceFactory;
import x10.CM11ASerialController;
import x10.CM17ASerialController;
import x10.Controller;
import x10.net.SocketController;
public class Config implements ManagedServiceFactory {
// String (pid) -> ControllerWrap
Map<String, ControllerWrap> controllers = new HashMap<String, ControllerWrap>();
@SuppressWarnings("rawtypes")
public void updated(String pid, Dictionary props)
throws ConfigurationException {
System.out.println("updated " + pid + ", " + props);
try {
synchronized (controllers) {
ControllerWrap wrap = (ControllerWrap) controllers.get(pid);
if (wrap != null) {
wrap.stop();
controllers.remove(pid);
}
String port = (String) props.get("port");
String module = (String) props.get("module");
module = module.toLowerCase();
wrap = new ControllerWrap(pid, port, module);
controllers.put(pid, wrap);
wrap.register();
}
} catch (ConfigurationException e) {
e.printStackTrace();
throw e;
}
}
public void deleted(String pid) {
Activator.logger.info("delete pid=" + pid);
synchronized (controllers) {
ControllerWrap wrap = (ControllerWrap) controllers.get(pid);
if (wrap != null) {
wrap.stop();
controllers.remove(pid);
}
}
}
public void stop() {
synchronized (controllers) {
for (ControllerWrap wrap : controllers.values()) {
if (wrap != null)
wrap.stop();
}
controllers.clear();
}
}
public String getName() {
return "Creates instances of x10.Controller";
}
}
class ControllerWrap {
String pid;
String port;
String module;
Controller controller;
ServiceRegistration<?> reg;
ControllerWrap(String pid, String port, String module)
throws ConfigurationException {
if (port == null || "".equals(port)) {
throw new ConfigurationException("port", "port must be specified");
}
if (module == null || "".equals(module)) {
throw new ConfigurationException("module",
"module must be specified");
}
this.pid = pid;
this.port = port;
this.module = module;
try {
if ("cm11a".equals(module)) {
controller = new CM11ASerialController(port);
} else if ("firecracker".equals(module) || "cm17a".equals(module)) {
controller = new CM17ASerialController(port);
} else if ("socket".equals(module)) {
String[] parts = module.split(":");
if (parts.length == 2) {
String host = parts[0];
int netPort = Integer.parseInt(parts[1]);
controller = new SocketController(host, netPort);
} else {
throw new ConfigurationException("module",
"Invalid port specification for SocketControler. Should be like localhost:9000");
}
} else {
throw new ConfigurationException("module",
"Unsupported module (valid modules are cm11a, cm17a and firecracker");
}
} catch (IOException e) {
throw new ConfigurationException("port", "IO failure on port="
+ port + ", " + e);
}
Activator.logger.info("created " + this);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
void register() {
if (reg != null) {
return;
}
Hashtable props = new Hashtable();
props.put("port", port);
props.put("module", module);
reg = Activator.bc.registerService(
new String[] { Controller.class.getName(),
controller.getClass().getName() }, controller, props);
Activator.logger.info("registered " + this);
}
void unregister() {
if (reg != null) {
reg.unregister();
reg = null;
Activator.logger.info("unregistered " + this);
}
}
void stop() {
unregister();
if (controller instanceof CM11ASerialController) {
CM11ASerialController c = (CM11ASerialController) controller;
try {
c.shutdown(10 * 1000);
} catch (Exception e) {
Activator.logger.error("Clean shutdown of CM11A failed", e);
try {
c.shutdownNow();
} catch (Exception e2) {
Activator.logger.error("Forced shutdown of CM11A failed",
e2);
}
}
} else if (controller instanceof CM17ASerialController) {
CM17ASerialController c = (CM17ASerialController) controller;
try {
c.shutdown(10 * 1000);
} catch (Exception e) {
Activator.logger.error("Clean shutdown of CM17A failed", e);
try {
c.shutdownNow();
} catch (Exception e2) {
Activator.logger.error("Forced shutdown of CM17A failed",
e2);
}
}
}
controller = null;
Activator.logger.info("stopped " + this);
}
public String toString() {
return "ControllerWrap[" + "pid=" + pid + ", port=" + port
+ ", module=" + module + ", controller=" + controller + "]";
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
b87ba3e08725ad41ccd8134930928baf57eb5cd5
|
4338a45f6d39f7e09fe53d6c485aef11133f2aab
|
/DBConnection/src/test/ProductData1.java
|
27e0dc7a585c36072be1247d1b66d1fa619f1636
|
[] |
no_license
|
PraveenJavaWorld/JDBC
|
50a05924d000eebc489211c37faf028ea6b848c2
|
4af7d435e211b431e463710d5f66a4a5cf22ec16
|
refs/heads/master
| 2022-11-26T18:57:52.730682
| 2020-08-01T08:57:02
| 2020-08-01T08:57:02
| 284,223,990
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 303
|
java
|
package test;
public class ProductData1 {
public String Name;
public double Price;
public int Qty;
public ProductData1(String Name,double Price,int Qty)
{
this.Name=Name;
this.Price=Price;
this.Qty=Qty;
}
public String toString(){
return Name+"\t"+Price+"\t"+Qty;
}
}
|
[
"praveen97javaworld@gmail.com"
] |
praveen97javaworld@gmail.com
|
acd9b5b02c5b3594d93ac26553c55ece803d6f1c
|
ea583eb41905259d1d979a23c6ede50b4eaa4a2b
|
/src/main/java/bieebox/resource/importer/domain/SpecialDeals.java
|
ed34924663a2cefebcf9c22e894afd23b2f6b1dc
|
[] |
no_license
|
thetlwinoo/resource-importer
|
cbc459f5da8330afb103b6d1787ac1e59f65deb0
|
95641ee0f976c17e4c49d24493b5905199806c11
|
refs/heads/master
| 2020-05-02T11:44:20.587886
| 2019-03-27T07:10:53
| 2019-03-27T07:10:53
| 177,937,899
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,629
|
java
|
package bieebox.resource.importer.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Objects;
/**
* A SpecialDeals.
*/
@Entity
@Table(name = "special_deals")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class SpecialDeals implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Column(name = "deal_description", nullable = false)
private String dealDescription;
@NotNull
@Column(name = "start_date", nullable = false)
private LocalDate startDate;
@NotNull
@Column(name = "end_date", nullable = false)
private LocalDate endDate;
@Column(name = "discount_amount", precision = 10, scale = 2)
private BigDecimal discountAmount;
@Column(name = "discount_percentage")
private Float discountPercentage;
@Column(name = "unit_price", precision = 10, scale = 2)
private BigDecimal unitPrice;
@ManyToOne
@JsonIgnoreProperties("specialDeals")
private BuyingGroups buyingGroup;
@ManyToOne
@JsonIgnoreProperties("specialDeals")
private CustomerCategories customerCategory;
@ManyToOne
@JsonIgnoreProperties("specialDeals")
private Customers customer;
@ManyToOne
@JsonIgnoreProperties("specialDeals")
private StockGroups stockGroup;
@ManyToOne
@JsonIgnoreProperties("specialDeals")
private StockItems stockItem;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDealDescription() {
return dealDescription;
}
public SpecialDeals dealDescription(String dealDescription) {
this.dealDescription = dealDescription;
return this;
}
public void setDealDescription(String dealDescription) {
this.dealDescription = dealDescription;
}
public LocalDate getStartDate() {
return startDate;
}
public SpecialDeals startDate(LocalDate startDate) {
this.startDate = startDate;
return this;
}
public void setStartDate(LocalDate startDate) {
this.startDate = startDate;
}
public LocalDate getEndDate() {
return endDate;
}
public SpecialDeals endDate(LocalDate endDate) {
this.endDate = endDate;
return this;
}
public void setEndDate(LocalDate endDate) {
this.endDate = endDate;
}
public BigDecimal getDiscountAmount() {
return discountAmount;
}
public SpecialDeals discountAmount(BigDecimal discountAmount) {
this.discountAmount = discountAmount;
return this;
}
public void setDiscountAmount(BigDecimal discountAmount) {
this.discountAmount = discountAmount;
}
public Float getDiscountPercentage() {
return discountPercentage;
}
public SpecialDeals discountPercentage(Float discountPercentage) {
this.discountPercentage = discountPercentage;
return this;
}
public void setDiscountPercentage(Float discountPercentage) {
this.discountPercentage = discountPercentage;
}
public BigDecimal getUnitPrice() {
return unitPrice;
}
public SpecialDeals unitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
return this;
}
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
public BuyingGroups getBuyingGroup() {
return buyingGroup;
}
public SpecialDeals buyingGroup(BuyingGroups buyingGroups) {
this.buyingGroup = buyingGroups;
return this;
}
public void setBuyingGroup(BuyingGroups buyingGroups) {
this.buyingGroup = buyingGroups;
}
public CustomerCategories getCustomerCategory() {
return customerCategory;
}
public SpecialDeals customerCategory(CustomerCategories customerCategories) {
this.customerCategory = customerCategories;
return this;
}
public void setCustomerCategory(CustomerCategories customerCategories) {
this.customerCategory = customerCategories;
}
public Customers getCustomer() {
return customer;
}
public SpecialDeals customer(Customers customers) {
this.customer = customers;
return this;
}
public void setCustomer(Customers customers) {
this.customer = customers;
}
public StockGroups getStockGroup() {
return stockGroup;
}
public SpecialDeals stockGroup(StockGroups stockGroups) {
this.stockGroup = stockGroups;
return this;
}
public void setStockGroup(StockGroups stockGroups) {
this.stockGroup = stockGroups;
}
public StockItems getStockItem() {
return stockItem;
}
public SpecialDeals stockItem(StockItems stockItems) {
this.stockItem = stockItems;
return this;
}
public void setStockItem(StockItems stockItems) {
this.stockItem = stockItems;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialDeals specialDeals = (SpecialDeals) o;
if (specialDeals.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), specialDeals.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "SpecialDeals{" +
"id=" + getId() +
", dealDescription='" + getDealDescription() + "'" +
", startDate='" + getStartDate() + "'" +
", endDate='" + getEndDate() + "'" +
", discountAmount=" + getDiscountAmount() +
", discountPercentage=" + getDiscountPercentage() +
", unitPrice=" + getUnitPrice() +
"}";
}
}
|
[
"thetlwinoo85@yahoo.com"
] |
thetlwinoo85@yahoo.com
|
6a7d0fadb86c830e59fb873f96b747f7417bb388
|
3947da54355e7a8c0517fa37420a3bafcde51efc
|
/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/BaseAWSEC2AsyncClientTest.java
|
d661123576429bc37045280dd028ca3bd897a038
|
[
"Apache-2.0"
] |
permissive
|
mikem2005/jclouds
|
20ef81863c08319306908def3bd02a446dce91c9
|
dafa2dc00ca5bebe7a0623225b384b7a68e19ced
|
refs/heads/master
| 2021-01-15T22:24:32.613785
| 2011-02-19T18:47:11
| 2011-02-19T18:47:11
| 1,382,852
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,898
|
java
|
package org.jclouds.aws.ec2.services;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import java.net.URI;
import java.util.Map;
import java.util.Properties;
import org.jclouds.aws.domain.Region;
import org.jclouds.aws.ec2.config.AWSEC2RestClientModule;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.date.DateService;
import org.jclouds.ec2.domain.AvailabilityZone;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.RequiresHttp;
import org.jclouds.rest.ConfiguresRestClient;
import org.jclouds.rest.RestClientTest;
import org.jclouds.rest.RestContextFactory;
import org.jclouds.rest.RestContextSpec;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Module;
/**
* @author Adrian Cole
*/
@Test(groups = "unit")
public abstract class BaseAWSEC2AsyncClientTest<T> extends RestClientTest<T> {
@RequiresHttp
@ConfiguresRestClient
protected static class StubAWSEC2RestClientModule extends AWSEC2RestClientModule {
@Override
protected String provideTimeStamp(DateService dateService, int expiration) {
return "2009-11-08T15:54:08.897Z";
}
protected void bindRegionsToProvider() {
bindRegionsToProvider(Regions.class);
}
static class Regions implements javax.inject.Provider<Map<String, URI>> {
@Override
public Map<String, URI> get() {
return ImmutableMap.<String, URI> of(Region.EU_WEST_1, URI.create("https://ec2.eu-west-1.amazonaws.com"),
Region.US_EAST_1, URI.create("https://ec2.us-east-1.amazonaws.com"), Region.US_WEST_1,
URI.create("https://ec2.us-west-1.amazonaws.com"));
}
}
protected void bindZonesToProvider() {
bindZonesToProvider(Zones.class);
}
static class Zones implements javax.inject.Provider<Map<String, String>> {
@Override
public Map<String, String> get() {
return ImmutableMap.<String, String> of(AvailabilityZone.US_EAST_1A, Region.US_EAST_1);
}
}
}
protected FormSigner filter;
@Override
protected void checkFilters(HttpRequest request) {
assertEquals(request.getFilters().size(), 1);
assertEquals(request.getFilters().get(0).getClass(), FormSigner.class);
}
@Override
@BeforeTest
protected void setupFactory() throws IOException {
super.setupFactory();
this.filter = injector.getInstance(FormSigner.class);
}
@Override
protected Module createModule() {
return new StubAWSEC2RestClientModule();
}
protected String provider = "aws-ec2";
@Override
public RestContextSpec<?, ?> createContextSpec() {
return new RestContextFactory().createContextSpec(provider, "identity", "credential", new Properties());
}
}
|
[
"adrian@jclouds.org"
] |
adrian@jclouds.org
|
325b9c3828826ffacc9b89b6bf0738856550a54a
|
6d109557600329b936efe538957dfd0a707eeafb
|
/src/com/google/api/ads/dfp/v201311/ReconciliationError.java
|
6a086570487f2d2476217ba4ccc64652c7290122
|
[
"Apache-2.0"
] |
permissive
|
google-code-export/google-api-dfp-java
|
51b0142c19a34cd822a90e0350eb15ec4347790a
|
b852c716ef6e5d300363ed61e15cbd6242fbac85
|
refs/heads/master
| 2020-05-20T03:52:00.420915
| 2013-12-19T23:08:40
| 2013-12-19T23:08:40
| 32,133,590
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,359
|
java
|
/**
* ReconciliationError.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.google.api.ads.dfp.v201311;
/**
* Lists all errors associated with reconciliation.
*/
public class ReconciliationError extends com.google.api.ads.dfp.v201311.ApiError implements java.io.Serializable {
/* The error reason represented by an enum. */
private com.google.api.ads.dfp.v201311.ReconciliationErrorReason reason;
public ReconciliationError() {
}
public ReconciliationError(
java.lang.String fieldPath,
java.lang.String trigger,
java.lang.String errorString,
java.lang.String apiErrorType,
com.google.api.ads.dfp.v201311.ReconciliationErrorReason reason) {
super(
fieldPath,
trigger,
errorString,
apiErrorType);
this.reason = reason;
}
/**
* Gets the reason value for this ReconciliationError.
*
* @return reason * The error reason represented by an enum.
*/
public com.google.api.ads.dfp.v201311.ReconciliationErrorReason getReason() {
return reason;
}
/**
* Sets the reason value for this ReconciliationError.
*
* @param reason * The error reason represented by an enum.
*/
public void setReason(com.google.api.ads.dfp.v201311.ReconciliationErrorReason reason) {
this.reason = reason;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof ReconciliationError)) return false;
ReconciliationError other = (ReconciliationError) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.reason==null && other.getReason()==null) ||
(this.reason!=null &&
this.reason.equals(other.getReason())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getReason() != null) {
_hashCode += getReason().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(ReconciliationError.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201311", "ReconciliationError"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("reason");
elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201311", "reason"));
elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201311", "ReconciliationError.Reason"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
[
"api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098"
] |
api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098
|
406184b18cb901802c7177542b70bf3fb2ffaec3
|
d5f09c7b0e954cd20dd613af600afd91b039c48a
|
/sources/net/lingala/zip4j/model/ZipParameters.java
|
5d31ece9ff38a299e95850ef612370b4a39ad9ed
|
[] |
no_license
|
t0HiiBwn/CoolapkRelease
|
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
|
a6a2b03e32cde0e5163016e0078391271a8d33ab
|
refs/heads/main
| 2022-07-29T23:28:35.867734
| 2021-03-26T11:41:18
| 2021-03-26T11:41:18
| 345,290,891
| 5
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,267
|
java
|
package net.lingala.zip4j.model;
import net.lingala.zip4j.model.enums.AesKeyStrength;
import net.lingala.zip4j.model.enums.AesVersion;
import net.lingala.zip4j.model.enums.CompressionLevel;
import net.lingala.zip4j.model.enums.CompressionMethod;
import net.lingala.zip4j.model.enums.EncryptionMethod;
public class ZipParameters {
private AesKeyStrength aesKeyStrength = AesKeyStrength.KEY_STRENGTH_256;
private AesVersion aesVersion = AesVersion.TWO;
private CompressionLevel compressionLevel = CompressionLevel.NORMAL;
private CompressionMethod compressionMethod = CompressionMethod.DEFLATE;
private String defaultFolderPath;
private boolean encryptFiles = false;
private EncryptionMethod encryptionMethod = EncryptionMethod.NONE;
private long entryCRC;
private long entrySize = -1;
private ExcludeFileFilter excludeFileFilter;
private String fileComment;
private String fileNameInZip;
private boolean includeRootFolder = true;
private long lastModifiedFileTime = System.currentTimeMillis();
private boolean overrideExistingFilesInZip = true;
private boolean readHiddenFiles = true;
private boolean readHiddenFolders = true;
private String rootFolderNameInZip;
private SymbolicLinkAction symbolicLinkAction = SymbolicLinkAction.INCLUDE_LINKED_FILE_ONLY;
private boolean unixMode;
private boolean writeExtendedLocalFileHeader = true;
public enum SymbolicLinkAction {
INCLUDE_LINK_ONLY,
INCLUDE_LINKED_FILE_ONLY,
INCLUDE_LINK_AND_LINKED_FILE
}
public ZipParameters() {
}
public ZipParameters(ZipParameters zipParameters) {
this.compressionMethod = zipParameters.getCompressionMethod();
this.compressionLevel = zipParameters.getCompressionLevel();
this.encryptFiles = zipParameters.isEncryptFiles();
this.encryptionMethod = zipParameters.getEncryptionMethod();
this.readHiddenFiles = zipParameters.isReadHiddenFiles();
this.readHiddenFolders = zipParameters.isReadHiddenFolders();
this.aesKeyStrength = zipParameters.getAesKeyStrength();
this.aesVersion = zipParameters.getAesVersion();
this.includeRootFolder = zipParameters.isIncludeRootFolder();
this.entryCRC = zipParameters.getEntryCRC();
this.defaultFolderPath = zipParameters.getDefaultFolderPath();
this.fileNameInZip = zipParameters.getFileNameInZip();
this.lastModifiedFileTime = zipParameters.getLastModifiedFileTime();
this.entrySize = zipParameters.getEntrySize();
this.writeExtendedLocalFileHeader = zipParameters.isWriteExtendedLocalFileHeader();
this.overrideExistingFilesInZip = zipParameters.isOverrideExistingFilesInZip();
this.rootFolderNameInZip = zipParameters.getRootFolderNameInZip();
this.fileComment = zipParameters.getFileComment();
this.symbolicLinkAction = zipParameters.getSymbolicLinkAction();
this.excludeFileFilter = zipParameters.getExcludeFileFilter();
this.unixMode = zipParameters.isUnixMode();
}
public CompressionMethod getCompressionMethod() {
return this.compressionMethod;
}
public void setCompressionMethod(CompressionMethod compressionMethod2) {
this.compressionMethod = compressionMethod2;
}
public boolean isEncryptFiles() {
return this.encryptFiles;
}
public void setEncryptFiles(boolean z) {
this.encryptFiles = z;
}
public EncryptionMethod getEncryptionMethod() {
return this.encryptionMethod;
}
public void setEncryptionMethod(EncryptionMethod encryptionMethod2) {
this.encryptionMethod = encryptionMethod2;
}
public CompressionLevel getCompressionLevel() {
return this.compressionLevel;
}
public void setCompressionLevel(CompressionLevel compressionLevel2) {
this.compressionLevel = compressionLevel2;
}
public boolean isReadHiddenFiles() {
return this.readHiddenFiles;
}
public void setReadHiddenFiles(boolean z) {
this.readHiddenFiles = z;
}
public boolean isReadHiddenFolders() {
return this.readHiddenFolders;
}
public void setReadHiddenFolders(boolean z) {
this.readHiddenFolders = z;
}
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
public AesKeyStrength getAesKeyStrength() {
return this.aesKeyStrength;
}
public void setAesKeyStrength(AesKeyStrength aesKeyStrength2) {
this.aesKeyStrength = aesKeyStrength2;
}
public AesVersion getAesVersion() {
return this.aesVersion;
}
public void setAesVersion(AesVersion aesVersion2) {
this.aesVersion = aesVersion2;
}
public boolean isIncludeRootFolder() {
return this.includeRootFolder;
}
public void setIncludeRootFolder(boolean z) {
this.includeRootFolder = z;
}
public long getEntryCRC() {
return this.entryCRC;
}
public void setEntryCRC(long j) {
this.entryCRC = j;
}
public String getDefaultFolderPath() {
return this.defaultFolderPath;
}
public void setDefaultFolderPath(String str) {
this.defaultFolderPath = str;
}
public String getFileNameInZip() {
return this.fileNameInZip;
}
public void setFileNameInZip(String str) {
this.fileNameInZip = str;
}
public long getLastModifiedFileTime() {
return this.lastModifiedFileTime;
}
public void setLastModifiedFileTime(long j) {
if (j > 0) {
this.lastModifiedFileTime = j;
}
}
public long getEntrySize() {
return this.entrySize;
}
public void setEntrySize(long j) {
this.entrySize = j;
}
public boolean isWriteExtendedLocalFileHeader() {
return this.writeExtendedLocalFileHeader;
}
public void setWriteExtendedLocalFileHeader(boolean z) {
this.writeExtendedLocalFileHeader = z;
}
public boolean isOverrideExistingFilesInZip() {
return this.overrideExistingFilesInZip;
}
public void setOverrideExistingFilesInZip(boolean z) {
this.overrideExistingFilesInZip = z;
}
public String getRootFolderNameInZip() {
return this.rootFolderNameInZip;
}
public void setRootFolderNameInZip(String str) {
this.rootFolderNameInZip = str;
}
public String getFileComment() {
return this.fileComment;
}
public void setFileComment(String str) {
this.fileComment = str;
}
public SymbolicLinkAction getSymbolicLinkAction() {
return this.symbolicLinkAction;
}
public void setSymbolicLinkAction(SymbolicLinkAction symbolicLinkAction2) {
this.symbolicLinkAction = symbolicLinkAction2;
}
public ExcludeFileFilter getExcludeFileFilter() {
return this.excludeFileFilter;
}
public void setExcludeFileFilter(ExcludeFileFilter excludeFileFilter2) {
this.excludeFileFilter = excludeFileFilter2;
}
public boolean isUnixMode() {
return this.unixMode;
}
public void setUnixMode(boolean z) {
this.unixMode = z;
}
}
|
[
"test@gmail.com"
] |
test@gmail.com
|
ea8a91409e7cc2551154ca975efe77a4876fb342
|
7b8fb3c97951cd4be702c820333d9bda505db060
|
/大数据/笔记/网站流量分析项目/网站流量分析项目02/源码/Flux/src/cn/tedu/flux/FluxTopology.java
|
6aca0294ba776030ed561fdc588de70e0fc98a7a
|
[] |
no_license
|
pinggaimuir/Document
|
12d886d580efd95c0dc482a259fdc80bfc30585d
|
da91004811326d48b6cec6bbff3c8ea17042d15c
|
refs/heads/master
| 2021-01-01T16:42:04.122148
| 2018-05-11T08:41:54
| 2018-05-11T08:41:54
| 97,893,348
| 0
| 2
| null | null | null | null |
GB18030
|
Java
| false
| false
| 2,465
|
java
|
package cn.tedu.flux;
import java.util.UUID;
import backtype.storm.Config;
import backtype.storm.LocalCluster;
import backtype.storm.generated.StormTopology;
import backtype.storm.spout.SchemeAsMultiScheme;
import backtype.storm.topology.TopologyBuilder;
import backtype.storm.utils.Utils;
import storm.kafka.BrokerHosts;
import storm.kafka.KafkaSpout;
import storm.kafka.SpoutConfig;
import storm.kafka.StringScheme;
import storm.kafka.ZkHosts;
public class FluxTopology {
public static void main(String[] args) {
//SPOUT的id 要求唯一
String KAFKA_SPOUT_ID = "flux_spout";
//要连接的kafka的topic
String CONSUME_TOPIC = "flux_topic";
//要连接的zookeeper的地址
String ZK_HOSTS = "192.168.242.101:2181";
//设定连接服务器的参数
BrokerHosts hosts = new ZkHosts(ZK_HOSTS);
SpoutConfig spoutConfig = new SpoutConfig(hosts, CONSUME_TOPIC, "/" + CONSUME_TOPIC, UUID.randomUUID().toString());
spoutConfig.scheme = new SchemeAsMultiScheme(new StringScheme());
KafkaSpout kafkaSpout = new KafkaSpout(spoutConfig);
//从kafka读取数据发射
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout(KAFKA_SPOUT_ID, kafkaSpout);
//清理数据
builder.setBolt("ClearBolt", new ClearBolt()).shuffleGrouping(KAFKA_SPOUT_ID);
//计算pv
builder.setBolt("PvBolt", new PVBolt()).shuffleGrouping("ClearBolt");
//计算uv
builder.setBolt("UvBolt", new UvBolt()).shuffleGrouping("PvBolt");
//计算vv
builder.setBolt("VvBolt", new VvBolt()).shuffleGrouping("UvBolt");
//计算newip
builder.setBolt("NewIpBolt", new NewIpBolt()).shuffleGrouping("VvBolt");
//计算newcust
builder.setBolt("NewCustBolt", new NewCustBolt()).shuffleGrouping("NewIpBolt");
//将结果数据落地到数据库中
builder.setBolt("ToMysqlBolt", new ToMysqlBolt()).shuffleGrouping("NewCustBolt");
builder.setBolt("PrintBolt", new PrintBolt()).shuffleGrouping("NewCustBolt");
//将数据持久化到hbase中间存储中,方便后续使用
builder.setBolt("ToHBaseBolt", new ToHbaseBolt()).shuffleGrouping("NewCustBolt");
StormTopology topology = builder.createTopology();
//--提交Topology给集群运行
Config conf = new Config();
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("MyTopology", conf, topology);
//--运行10秒钟后杀死Topology关闭集群
Utils.sleep(1000 * 1000);
cluster.killTopology("MyTopology");
cluster.shutdown();
}
}
|
[
"pinggaimuir@sina.com"
] |
pinggaimuir@sina.com
|
b4f8cd84ba67750b37ddbf6ab65013c2a3fd6165
|
9b75d8540ff2e55f9ff66918cc5676ae19c3bbe3
|
/cab.snapp.passenger.play_184.apk-decompiled/sources/com/adjust/sdk/LogLevel.java
|
b6abef7e898a142baa53b361689407514ab61e38
|
[] |
no_license
|
BaseMax/PopularAndroidSource
|
a395ccac5c0a7334d90c2594db8273aca39550ed
|
bcae15340907797a91d39f89b9d7266e0292a184
|
refs/heads/master
| 2020-08-05T08:19:34.146858
| 2019-10-06T20:06:31
| 2019-10-06T20:06:31
| 212,433,298
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 346
|
java
|
package com.adjust.sdk;
public enum LogLevel {
VERBOSE(2),
DEBUG(3),
INFO(4),
WARN(5),
ERROR(6),
ASSERT(7),
SUPRESS(8);
final int androidLogLevel;
private LogLevel(int i) {
this.androidLogLevel = i;
}
public final int getAndroidLogLevel() {
return this.androidLogLevel;
}
}
|
[
"MaxBaseCode@gmail.com"
] |
MaxBaseCode@gmail.com
|
407f7d9c627148d81c08eea2ea9b4aafbae4ac69
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/31/31_8eac639eaa2f9c28360f84357a5d2b64439551c1/RhogenLaunchDelegate/31_8eac639eaa2f9c28360f84357a5d2b64439551c1_RhogenLaunchDelegate_t.java
|
9e973870a228ca67e4a543e3801a54dc9c5a429f
|
[] |
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
| 5,144
|
java
|
package rhogenwizard.launcher;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
import rhogenwizard.AsyncStreamReader;
import rhogenwizard.ConsoleHelper;
import rhogenwizard.LogFileHelper;
import rhogenwizard.OSHelper;
import rhogenwizard.RhodesAdapter;
import rhogenwizard.RhodesAdapter.EPlatformType;
import rhogenwizard.builder.RhogenBuilder;
import rhogenwizard.buildfile.AppYmlFile;
public class RhogenLaunchDelegate extends LaunchConfigurationDelegate implements IDebugEventSetListener
{
public static final String projectNameCfgAttribute = "project_name";
public static final String platforrmCfgAttribute = "platform";
public static final String platforrmDeviceCfgAttribute = "device";
public static final String prjectLogFileName = "log_filename";
private static RhodesAdapter rhodesAdapter = new RhodesAdapter();
private static LogFileHelper rhodesLogHelper = new LogFileHelper();
private String m_projectName = null;
private String m_platformName = null;
private String m_appLogName = null;
private boolean m_onDevice = false;
private AtomicBoolean m_buildFinished = new AtomicBoolean();
private void setProcessFinished(boolean b)
{
m_buildFinished.set(b);
}
private boolean getProcessFinished()
{
return m_buildFinished.get();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
*/
@SuppressWarnings("deprecation")
public synchronized void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, final IProgressMonitor monitor) throws CoreException
{
try
{
setProcessFinished(false);
rhodesLogHelper.stopLog();
m_projectName = configuration.getAttribute(projectNameCfgAttribute, "");
m_platformName = configuration.getAttribute(platforrmCfgAttribute, "");
m_appLogName = configuration.getAttribute(prjectLogFileName, "");
if (configuration.getAttribute(platforrmDeviceCfgAttribute, "").equals("yes"))
{
m_onDevice = true;
}
if (m_projectName == null || m_projectName.length() == 0 || m_platformName == null || m_platformName.length() == 0)
{
throw new IllegalArgumentException("Error - Platform and project name should be assigned");
}
final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(m_projectName);
Thread cancelingThread = new Thread(new Runnable()
{
@Override
public void run()
{
try
{
EPlatformType type = RhodesAdapter.convertPlatformFromDesc(m_platformName);
if (rhodesAdapter.buildApp(project.getLocation().toOSString(), type, m_onDevice) == 0)
{
ConsoleHelper.showAppConsole();
startLogOutput(project, type);
}
else
{
ConsoleHelper.consolePrint("Error in build application");
}
setProcessFinished(true);
}
catch (Exception e)
{
e.printStackTrace();
}
}
});
cancelingThread.start();
while(true)
{
try
{
if (monitor.isCanceled())
{
OSHelper.killProcess("ruby", "ruby.exe");
return;
}
if (getProcessFinished())
{
return;
}
Thread.sleep(100);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
catch(IllegalArgumentException e)
{
ConsoleHelper.consolePrint(e.getMessage());
}
catch (Exception e)
{
e.printStackTrace();
}
monitor.done();
}
@Override
protected IProject[] getBuildOrder(ILaunchConfiguration configuration, String mode) throws CoreException
{
if (m_projectName != null)
{
m_projectName = m_projectName.trim();
if (m_projectName.length() > 0)
{
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(m_projectName);
project.setSessionProperty(RhogenBuilder.getPlatformQualifier(), m_platformName);
IProject[] findProjects = { project };
return findProjects;
}
}
return null;
}
@Override
public void handleDebugEvents(DebugEvent[] events)
{
}
private void startLogOutput(IProject project, EPlatformType type) throws Exception
{
rhodesLogHelper.configurePlatform(type);
rhodesLogHelper.startLog(project);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
083c6aae1f0d4ac03541b66704500aae51e4bef6
|
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
|
/opensearch-20171225/src/main/java/com/aliyun/opensearch20171225/models/TagResourcesRequest.java
|
ce4465e41d62dfe7f81ecac2bc8b2cac8d62cfff
|
[
"Apache-2.0"
] |
permissive
|
aliyun/alibabacloud-java-sdk
|
83a6036a33c7278bca6f1bafccb0180940d58b0b
|
008923f156adf2e4f4785a0419f60640273854ec
|
refs/heads/master
| 2023-09-01T04:10:33.640756
| 2023-09-01T02:40:45
| 2023-09-01T02:40:45
| 288,968,318
| 40
| 45
| null | 2023-06-13T02:47:13
| 2020-08-20T09:51:08
|
Java
|
UTF-8
|
Java
| false
| false
| 2,465
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.opensearch20171225.models;
import com.aliyun.tea.*;
public class TagResourcesRequest extends TeaModel {
/**
* <p>The resource IDs. You can specify a maximum number of 50 resource IDs.</p>
*/
@NameInMap("resourceId")
public java.util.List<String> resourceId;
/**
* <p>The resource type.</p>
*/
@NameInMap("resourceType")
public String resourceType;
/**
* <p>The tags. You can specify a maximum number of 20 tags.</p>
*/
@NameInMap("tag")
public java.util.List<TagResourcesRequestTag> tag;
public static TagResourcesRequest build(java.util.Map<String, ?> map) throws Exception {
TagResourcesRequest self = new TagResourcesRequest();
return TeaModel.build(map, self);
}
public TagResourcesRequest setResourceId(java.util.List<String> resourceId) {
this.resourceId = resourceId;
return this;
}
public java.util.List<String> getResourceId() {
return this.resourceId;
}
public TagResourcesRequest setResourceType(String resourceType) {
this.resourceType = resourceType;
return this;
}
public String getResourceType() {
return this.resourceType;
}
public TagResourcesRequest setTag(java.util.List<TagResourcesRequestTag> tag) {
this.tag = tag;
return this;
}
public java.util.List<TagResourcesRequestTag> getTag() {
return this.tag;
}
public static class TagResourcesRequestTag extends TeaModel {
/**
* <p>The key of the tag.</p>
*/
@NameInMap("key")
public String key;
/**
* <p>The value of the tag.</p>
*/
@NameInMap("value")
public String value;
public static TagResourcesRequestTag build(java.util.Map<String, ?> map) throws Exception {
TagResourcesRequestTag self = new TagResourcesRequestTag();
return TeaModel.build(map, self);
}
public TagResourcesRequestTag setKey(String key) {
this.key = key;
return this;
}
public String getKey() {
return this.key;
}
public TagResourcesRequestTag setValue(String value) {
this.value = value;
return this;
}
public String getValue() {
return this.value;
}
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
c19a8b3bfb8542610779d4e662878446c024c26b
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/checkstyle_cluster/792/src_0.java
|
ff28d6410fb5f85554de3f4e3408a6a6df843695
|
[] |
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
| 3,079
|
java
|
package com.puppycrawl.tools.checkstyle;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import junit.framework.TestCase;
import org.apache.regexp.RE;
public class ConfigSerializationTest
extends TestCase
{
public ConfigSerializationTest(String name)
{
super(name);
}
/**
* Copy mConfig using in-memory serialization
* @param aConfig the original
* @return a copy of aConfig obtained by in-memory serialization
*/
private Configuration copyBySerialization(Configuration aConfig)
throws IOException, ClassNotFoundException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(aConfig);
oos.flush();
oos.close();
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bais);
Configuration configCopy = (Configuration) ois.readObject();
ois.close();
return configCopy;
}
/**
* Test that the RE deserialization mechanism works for one example.
*/
public void testRegexpDesrialization()
throws Exception
{
Configuration configOrig = new Configuration();
configOrig.setPatternProperty(Defn.TYPE_PATTERN_PROP, "xyz");
Configuration configCopy = copyBySerialization(configOrig);
assertNotNull(configCopy);
// test that the general deserialization mechanism for RE fields works
RE typeRegexp = configCopy.getTypeRegexp();
assertTrue(typeRegexp.match("xyz"));
assertTrue(!typeRegexp.match("DefaultCompatibleTypeFormat"));
}
/**
* Tests that all RE fields are restored during deserialization.
* This test is designed to prevent addition of transient RE
* fields to Configuration without modification of
* Configuration.readObject().
*/
public void testAllRegexpsNotNull()
throws Exception
{
Configuration configOrig = new Configuration();
Configuration configCopy = copyBySerialization(configOrig);
assertNotNull(configCopy);
// ensure that none of the getSomeRE() methods (even the ones
// we don't know yet) of the configCopy returns null
Method[] configMethods = Configuration.class.getMethods();
for (int i = 0; i < configMethods.length; i++)
{
Method method = configMethods[i];
String methodName = method.getName();
if (methodName.startsWith("get") &&
method.getReturnType().equals(RE.class) &&
method.getParameterTypes().length == 0)
{
Object[] noArgs = {};
Object obj = method.invoke(configCopy, noArgs);
assertNotNull(methodName + "() returned null", obj);
}
}
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
64a0ba3e44ca4c73abcfa543709f42f825f47e04
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/12/12_932f637a3222e6e4928e3fc3967844c61fa62acd/Main/12_932f637a3222e6e4928e3fc3967844c61fa62acd_Main_t.java
|
19271ecd8edda1fb0a25c04799eca14492317324
|
[] |
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
| 5,733
|
java
|
package antichess;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//Allows the user to select a colour and stores it as either 'b' or 'w'.
char playerColour = selectColour();
//Intialises a new board and stores a reference to it in currentBoard.
Board currentBoard = new Board();
Move nextMove = null;
//TO DO
//Connect to a server using the colour to determine which port to use.
//The connection will need to be stored somewhere.
//Send and receive might need separate connections.
//I'll look into this. MCS
//Draws the initial board.
currentBoard.drawBoard();
//Take special action if the player is white.
//Basically just get a valid move, then make it and send to the server.
if (playerColour == 'w') {
nextMove = getMove(currentBoard, playerColour);
currentBoard.makeMove(nextMove);
currentBoard.drawBoard();
sendMove(nextMove);
}
while (true) {
//Receives the next move from the server.
//if (receiveMove(nextMove) == false) {
// break;
//}
//Make the move received from the server.
//currentBoard.makeMove(nextMove);
//Draw the new board.
//currentBoard.drawBoard();
//TEMP
//Changes the players colour to allow for crude two player
if (playerColour == 'b') {
playerColour = 'w';
} else {
playerColour = 'b';
}
//Get the next move from the player.
nextMove = getMove(currentBoard, playerColour);
//Make the move specified by the player.
currentBoard.makeMove(nextMove);
//Draw the new board.
currentBoard.drawBoard();
//Send the move to the server.
sendMove(nextMove);
}
}
public static char selectColour() {
/* Loops infinitely until either 'b' or 'w' is entered and then
* returns whichever letter was entered
*/
while (true) {
System.out.println("Select your colour, 'b' for black or 'w' for white");
Scanner in = new Scanner(System.in);
String selectedColour = in.nextLine();
if (selectedColour.equals("b")) {
return 'b';
} else if (selectedColour.equals("w")) {
return 'w';
}
}
}
public static Move getMove(Board currentBoard, char playerColour) {
// Crude code that prints whose go it is
System.out.print(playerColour + ": ");
//Check if a capture is required in the next move.
boolean captureRequired = currentBoard.isCapturePossible(playerColour);
while (true) {
Move nextMove = getInput();
if (currentBoard.isMoveValid(playerColour, nextMove)) {
if (captureRequired) {
if (currentBoard.isMoveCapture(nextMove)) {
return nextMove;
}
else {
System.out.println("You are able capture therefore you must.");
}
}
else {
return nextMove;
}
}
else
{
System.out.println("This move is not valid.");
}
}
}
public static Move getInput() {
Scanner in = new Scanner(System.in);
System.out.println("Please enter your next move");
String move = in.nextLine();
//TO DO.
//This should take the string called "move", separate the characters
//and convert to the appropriate integers, then return a new Move class
//with the correct values.
//e.g a4b5 should convert to Move(0, 3, 1, 4)
char move1 = move.charAt(0);
char move2 = move.charAt(1);
char move3 = move.charAt(2);
char move4 = move.charAt(3);
int intInput1 = (int)move1-97;
int intInput2 = (int)move2-49;
int intInput3 = (int)move3-97;
int intInput4 = (int)move4-49;
return new Move(intInput1, intInput2, intInput3, intInput4);
}
public static void sendMove(Move move) {
//Sends the move to the server.
String toServer;
toServer = Integer.toString(move.oldX);
toServer += Integer.toString(move.oldY);
toServer += Integer.toString(move.newX);
toServer += Integer.toString(move.newY);
//TO DO
//Now send the string toServer to the server. The server will probably
//have to be passed to the function.
}
public static boolean receiveMove(Move move) {
//Wait for response from server then return true if there is a move and
//false if there isn't. The move object should be used to store the
//received move. The server will probably have to be passed to the
//function.
String fromServer = "1020";
//TO DO
//Oviously this is just an example. We need to implement actually
//receiving from the server.
if (fromServer.equals("Win")) {
System.out.println("You have won!");
return false;
} else if (fromServer.equals("Loss")) {
System.out.println("You have lost!");
return false;
} else if (fromServer.equals("Stale")) {
System.out.println("Stalemate");
return false;
} else {
//TO DO
//This needs to separate out the bits of the string and
//convert to integers.
move = new Move(0, 1, 0, 2);
return true;
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
1d30aa24f14aa4bfb6ec61bb687c01907a1e6725
|
5741045375dcbbafcf7288d65a11c44de2e56484
|
/reddit-decompilada/com/bumptech/glide/load/resource/drawable/ResourceDrawableDecoder.java
|
83bc3c130d61a890016ad361f027549ca0bd5586
|
[] |
no_license
|
miarevalo10/ReporteReddit
|
18dd19bcec46c42ff933bb330ba65280615c281c
|
a0db5538e85e9a081bf268cb1590f0eeb113ed77
|
refs/heads/master
| 2020-03-16T17:42:34.840154
| 2018-05-11T10:16:04
| 2018-05-11T10:16:04
| 132,843,706
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,457
|
java
|
package com.bumptech.glide.load.resource.drawable;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import com.bumptech.glide.load.Options;
import com.bumptech.glide.load.ResourceDecoder;
import com.bumptech.glide.load.engine.Resource;
import java.io.IOException;
public class ResourceDrawableDecoder implements ResourceDecoder<Uri, Drawable> {
private final Context f12618a;
public final /* bridge */ /* synthetic */ Resource mo979a(Object obj, int i, int i2, Options options) throws IOException {
return m11653a((Uri) obj);
}
public final /* synthetic */ boolean mo980a(Object obj, Options options) throws IOException {
return ((Uri) obj).getScheme().equals("android.resource");
}
public ResourceDrawableDecoder(Context context) {
this.f12618a = context.getApplicationContext();
}
public final Resource<Drawable> m11653a(Uri uri) {
int b = m11652b(uri);
String authority = uri.getAuthority();
return NonOwnedDrawableResource.m17024a(DrawableDecoderCompat.m3065a(authority.equals(this.f12618a.getPackageName()) ? this.f12618a : m11651a(uri, authority), b));
}
private Context m11651a(Uri uri, String str) {
try {
return this.f12618a.createPackageContext(str, 0);
} catch (String str2) {
StringBuilder stringBuilder = new StringBuilder("Failed to obtain context or unrecognized Uri format for: ");
stringBuilder.append(uri);
throw new IllegalArgumentException(stringBuilder.toString(), str2);
}
}
private int m11652b(android.net.Uri r6) {
/* JADX: method processing error */
/*
Error: java.lang.NullPointerException
at jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)
at jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)
at jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)
at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)
at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)
at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)
at jadx.core.ProcessClass.process(ProcessClass.java:37)
at jadx.core.ProcessClass.processDependencies(ProcessClass.java:59)
at jadx.core.ProcessClass.process(ProcessClass.java:42)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:306)
at jadx.api.JavaClass.decompile(JavaClass.java:62)
at jadx.api.JadxDecompiler$1.run(JadxDecompiler.java:199)
*/
/*
r5 = this;
r0 = r6.getPathSegments();
r1 = r0.size();
r2 = 1;
r3 = 0;
r4 = 2;
if (r1 != r4) goto L_0x002c;
L_0x000d:
r1 = r6.getAuthority();
r3 = r0.get(r3);
r3 = (java.lang.String) r3;
r0 = r0.get(r2);
r0 = (java.lang.String) r0;
r2 = r5.f12618a;
r2 = r2.getResources();
r0 = r2.getIdentifier(r0, r3, r1);
r0 = java.lang.Integer.valueOf(r0);
goto L_0x003e;
L_0x002c:
r1 = r0.size();
if (r1 != r2) goto L_0x003d;
L_0x0032:
r0 = r0.get(r3); Catch:{ NumberFormatException -> 0x003d }
r0 = (java.lang.String) r0; Catch:{ NumberFormatException -> 0x003d }
r0 = java.lang.Integer.valueOf(r0); Catch:{ NumberFormatException -> 0x003d }
goto L_0x003e;
L_0x003d:
r0 = 0;
L_0x003e:
if (r0 != 0) goto L_0x0054;
L_0x0040:
r0 = new java.lang.IllegalArgumentException;
r1 = new java.lang.StringBuilder;
r2 = "Unrecognized Uri format: ";
r1.<init>(r2);
r1.append(r6);
r6 = r1.toString();
r0.<init>(r6);
throw r0;
L_0x0054:
r1 = r0.intValue();
if (r1 != 0) goto L_0x006e;
L_0x005a:
r0 = new java.lang.IllegalArgumentException;
r1 = new java.lang.StringBuilder;
r2 = "Failed to obtain resource id for: ";
r1.<init>(r2);
r1.append(r6);
r6 = r1.toString();
r0.<init>(r6);
throw r0;
L_0x006e:
r6 = r0.intValue();
return r6;
*/
throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.load.resource.drawable.ResourceDrawableDecoder.b(android.net.Uri):int");
}
}
|
[
"mi.arevalo10@uniandes.edu.co"
] |
mi.arevalo10@uniandes.edu.co
|
b763813ac00295aad558d6a5d80e37fc2925743a
|
1742b6719b988e5519373002305e31d28b8bd691
|
/sdk/java/src/main/java/com/pulumi/aws/codebuild/inputs/ProjectLogsConfigArgs.java
|
97f901681d23840a9579ee5edf1897dd5468f203
|
[
"BSD-3-Clause",
"Apache-2.0",
"MPL-2.0"
] |
permissive
|
pulumi/pulumi-aws
|
4f7fdb4a816c5ea357cff2c2e3b613c006e49f1a
|
42b0a0abdf6c14da248da22f8c4530af06e67b98
|
refs/heads/master
| 2023-08-03T23:08:34.520280
| 2023-08-01T18:09:58
| 2023-08-01T18:09:58
| 97,484,940
| 384
| 171
|
Apache-2.0
| 2023-09-14T14:48:40
| 2017-07-17T14:20:33
|
Java
|
UTF-8
|
Java
| false
| false
| 3,411
|
java
|
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.codebuild.inputs;
import com.pulumi.aws.codebuild.inputs.ProjectLogsConfigCloudwatchLogsArgs;
import com.pulumi.aws.codebuild.inputs.ProjectLogsConfigS3LogsArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
public final class ProjectLogsConfigArgs extends com.pulumi.resources.ResourceArgs {
public static final ProjectLogsConfigArgs Empty = new ProjectLogsConfigArgs();
/**
* Configuration block. Detailed below.
*
*/
@Import(name="cloudwatchLogs")
private @Nullable Output<ProjectLogsConfigCloudwatchLogsArgs> cloudwatchLogs;
/**
* @return Configuration block. Detailed below.
*
*/
public Optional<Output<ProjectLogsConfigCloudwatchLogsArgs>> cloudwatchLogs() {
return Optional.ofNullable(this.cloudwatchLogs);
}
/**
* Configuration block. Detailed below.
*
*/
@Import(name="s3Logs")
private @Nullable Output<ProjectLogsConfigS3LogsArgs> s3Logs;
/**
* @return Configuration block. Detailed below.
*
*/
public Optional<Output<ProjectLogsConfigS3LogsArgs>> s3Logs() {
return Optional.ofNullable(this.s3Logs);
}
private ProjectLogsConfigArgs() {}
private ProjectLogsConfigArgs(ProjectLogsConfigArgs $) {
this.cloudwatchLogs = $.cloudwatchLogs;
this.s3Logs = $.s3Logs;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(ProjectLogsConfigArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private ProjectLogsConfigArgs $;
public Builder() {
$ = new ProjectLogsConfigArgs();
}
public Builder(ProjectLogsConfigArgs defaults) {
$ = new ProjectLogsConfigArgs(Objects.requireNonNull(defaults));
}
/**
* @param cloudwatchLogs Configuration block. Detailed below.
*
* @return builder
*
*/
public Builder cloudwatchLogs(@Nullable Output<ProjectLogsConfigCloudwatchLogsArgs> cloudwatchLogs) {
$.cloudwatchLogs = cloudwatchLogs;
return this;
}
/**
* @param cloudwatchLogs Configuration block. Detailed below.
*
* @return builder
*
*/
public Builder cloudwatchLogs(ProjectLogsConfigCloudwatchLogsArgs cloudwatchLogs) {
return cloudwatchLogs(Output.of(cloudwatchLogs));
}
/**
* @param s3Logs Configuration block. Detailed below.
*
* @return builder
*
*/
public Builder s3Logs(@Nullable Output<ProjectLogsConfigS3LogsArgs> s3Logs) {
$.s3Logs = s3Logs;
return this;
}
/**
* @param s3Logs Configuration block. Detailed below.
*
* @return builder
*
*/
public Builder s3Logs(ProjectLogsConfigS3LogsArgs s3Logs) {
return s3Logs(Output.of(s3Logs));
}
public ProjectLogsConfigArgs build() {
return $;
}
}
}
|
[
"public@paulstack.co.uk"
] |
public@paulstack.co.uk
|
b0beccd4d3a0578a66f5d5dc96481442d281b9f3
|
a454eb47350c0846c87546aacdd8a8db539d7ec7
|
/ccs-param-ui/src/main/java/com/sunline/ccs/param/ui/client/merchantGroup/MerchantGroupInter.java
|
f290cbf5a7fea1eb4c52b4a42b10d4cf2140537e
|
[] |
no_license
|
soldiers1989/guomei-code
|
a4cf353501419a620c0ff2b9d1f7009168a9ae5c
|
ebb85e52012c58708d3b19ee967944afae10ad87
|
refs/heads/master
| 2020-03-27T19:34:29.293383
| 2016-06-18T06:52:16
| 2016-06-18T06:53:43
| 146,998,057
| 0
| 1
| null | 2018-09-01T12:52:12
| 2018-09-01T12:52:12
| null |
UTF-8
|
Java
| false
| false
| 1,244
|
java
|
package com.sunline.ccs.param.ui.client.merchantGroup;
import java.util.List;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.sunline.ccs.param.def.MerchantGroup;
import com.sunline.kylin.web.ark.client.rpc.FetchRequest;
import com.sunline.kylin.web.ark.client.rpc.FetchResponse;
import com.sunline.ppy.dictionary.exception.ProcessException;
/*
import com.sunline.ppy.dictionary.exception.ProcessException;
import com.sunline.ccs.param.def.MerchantGroup;
import com.sunline.ark.gwt.shared.datasource.FetchRequest;
import com.sunline.ark.gwt.shared.datasource.FetchResponse;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
*/
@RemoteServiceRelativePath("rpc/merchantGroupServer")
public interface MerchantGroupInter extends RemoteService{
FetchResponse fetchMerchantGroupList(FetchRequest request);
MerchantGroup getMerchantGroup(String merGroupId);
void addMerchantGroup(MerchantGroup merchantGroup) throws ProcessException;
void updateMerchantGroup(MerchantGroup merchantGroup) throws ProcessException;
void deleteMerchantGroup(List<String> keys) throws ProcessException;
}
|
[
"yuemk@sunline"
] |
yuemk@sunline
|
f77a3092512edef7f1b12653fab71c05444db74f
|
ee8d5134c392291f8791e04c1b1dcc6a6d0a2ebe
|
/sub-java-project-server/v029_9/src/main/java/sub/lms/dao/AbstractObjectFileDao.java
|
d445fe1bb107265b74de2398de3101d6e3beafaa
|
[] |
no_license
|
shinji-sub/sub-java-project
|
f52fb225072a53d28b763de603652bd25897caa0
|
cf802a5690a5f612297d3cb64e2c71b8460e21e0
|
refs/heads/master
| 2020-11-25T17:18:44.241682
| 2020-03-29T09:13:12
| 2020-03-29T09:13:12
| 228,770,593
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,555
|
java
|
package sub.lms.dao;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.List;
public abstract class AbstractObjectFileDao<T> {
protected String filename;
protected List<T> list;
public AbstractObjectFileDao(String filename) {
this.filename = filename;
list = new ArrayList<>();
loadData();
}
@SuppressWarnings("unchecked")
protected void loadData() {
File file = new File(filename);
try (ObjectInputStream in =
new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)))) {
list = (List<T>) in.readObject();
System.out.printf("총 %d 개의 게시물 데이터를 로딩했습니다.\n", list.size());
} catch (Exception e) {
System.out.println("파일 읽기 중 오류 발생! - " + e.getMessage());
}
}
protected void saveData() {
File file = new File(filename);
try (ObjectOutputStream out =
new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) {
out.reset();
out.writeObject(list);
System.out.printf("총 %d 개의 게시물 데이터를 저장했습니다.\n", list.size());
} catch (IOException e) {
System.out.println("파일 쓰기 중 오류 발생! - " + e.getMessage());
}
}
protected abstract <K> int indexOf(K key);
}
|
[
"wltjq2006@naver.com"
] |
wltjq2006@naver.com
|
5b5e0c57c1eb8fc64c65879bec062185f2a3645a
|
8a0e05e8eeea76a3639e988ddeb7dab8dc07deb2
|
/src/test/java/com/github/fabriciolfj/consignado/ConsignadoApplicationTests.java
|
0632210d9ffcfb12f2d5276e1d8571a8775200ce
|
[] |
no_license
|
fabriciolfj/averbacao-service
|
6e60cff2b27e1ab48a6acbdd6fbd90e5b8795a2a
|
3b2ad0aedae5f5679623eb101c2cd198a48a475b
|
refs/heads/main
| 2023-07-29T00:56:51.225952
| 2021-09-24T00:03:26
| 2021-09-24T00:03:26
| 409,020,723
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 229
|
java
|
package com.github.fabriciolfj.consignado;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ConsignadoApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"fabricio.jacob@outlook.com"
] |
fabricio.jacob@outlook.com
|
384be5262dd45c356c3639f35ca1482f34b7bddd
|
53354a86ae1ab307f1f98b825d8ad1895fde550e
|
/cascading-hadoop/src/main/shared/cascading/flow/hadoop/stream/HadoopGroupGate.java
|
11968391749df03707ba7a85e86d197ebb61693f
|
[
"Apache-2.0"
] |
permissive
|
rubanm/cascading
|
28d42da7dd2b520a29d4d663f82faef239837644
|
d18f0aa121707ca9619c3865e7384e7c85ba3f11
|
refs/heads/wip-3.0
| 2020-12-25T22:31:31.475656
| 2015-04-03T00:23:54
| 2015-04-03T00:23:54
| 33,499,286
| 0
| 0
| null | 2015-04-06T18:53:45
| 2015-04-06T18:53:45
| null |
UTF-8
|
Java
| false
| false
| 4,620
|
java
|
/*
* Copyright (c) 2007-2015 Concurrent, Inc. All Rights Reserved.
*
* Project and contact information: http://www.cascading.org/
*
* This file is part of the Cascading 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 cascading.flow.hadoop.stream;
import java.util.Iterator;
import cascading.CascadingException;
import cascading.flow.FlowProcess;
import cascading.flow.SliceCounters;
import cascading.flow.hadoop.HadoopGroupByClosure;
import cascading.flow.stream.duct.Duct;
import cascading.flow.stream.duct.DuctException;
import cascading.flow.stream.element.GroupingSpliceGate;
import cascading.flow.stream.graph.IORole;
import cascading.flow.stream.graph.StreamGraph;
import cascading.pipe.Splice;
import cascading.pipe.joiner.BufferJoin;
import cascading.tap.hadoop.util.MeasuredOutputCollector;
import cascading.tuple.Tuple;
import cascading.tuple.TupleEntry;
import cascading.tuple.io.TuplePair;
import org.apache.hadoop.mapred.OutputCollector;
/**
*
*/
public abstract class HadoopGroupGate extends GroupingSpliceGate
{
protected HadoopGroupByClosure closure;
protected OutputCollector collector;
public HadoopGroupGate( FlowProcess flowProcess, Splice splice, IORole role )
{
super( flowProcess, splice, role );
}
@Override
public void bind( StreamGraph streamGraph )
{
if( role != IORole.sink )
next = getNextFor( streamGraph );
if( role == IORole.sink )
setOrdinalMap( streamGraph );
}
@Override
public void prepare()
{
if( role != IORole.source )
collector = new MeasuredOutputCollector( flowProcess, SliceCounters.Write_Duration, createOutputCollector() );
if( role != IORole.sink )
closure = createClosure();
if( grouping != null && splice.getJoinDeclaredFields() != null && splice.getJoinDeclaredFields().isNone() )
grouping.joinerClosure = closure;
}
protected abstract OutputCollector createOutputCollector();
@Override
public void start( Duct previous )
{
if( next != null )
super.start( previous );
}
public void receive( Duct previous, TupleEntry incomingEntry ) // todo: receive should receive the edge or ordinal so no lookup
{
Integer pos = ordinalMap.get( previous ); // todo: when posMap size == 1, pos is always zero -- optimize #get() out
Tuple groupTuple = keyBuilder[ pos ].makeResult( incomingEntry.getTuple(), null );
Tuple sortTuple = sortFields == null ? null : sortBuilder[ pos ].makeResult( incomingEntry.getTuple(), null );
Tuple valuesTuple = valuesBuilder[ pos ].makeResult( incomingEntry.getTuple(), null );
Tuple groupKey = sortTuple == null ? groupTuple : new TuplePair( groupTuple, sortTuple );
try
{
wrapGroupingAndCollect( previous, valuesTuple, groupKey );
flowProcess.increment( SliceCounters.Tuples_Written, 1 );
}
catch( OutOfMemoryError error )
{
handleReThrowableException( "out of memory, try increasing task memory allocation", error );
}
catch( CascadingException exception )
{
handleException( exception, incomingEntry );
}
catch( Throwable throwable )
{
handleException( new DuctException( "internal error: " + incomingEntry.getTuple().print(), throwable ), incomingEntry );
}
}
@Override
public void complete( Duct previous )
{
if( next != null )
super.complete( previous );
}
public void accept( Tuple key, Iterator<Tuple>... values )
{
key = unwrapGrouping( key );
closure.reset( key, values );
// Buffer is using JoinerClosure directly
if( !( splice.getJoiner() instanceof BufferJoin ) )
tupleEntryIterator.reset( splice.getJoiner().getIterator( closure ) );
else
tupleEntryIterator.reset( values );
keyEntry.setTuple( closure.getGroupTuple( key ) );
next.receive( this, grouping );
}
protected abstract HadoopGroupByClosure createClosure();
protected abstract void wrapGroupingAndCollect( Duct previous, Tuple valuesTuple, Tuple groupKey ) throws java.io.IOException;
protected abstract Tuple unwrapGrouping( Tuple key );
}
|
[
"chris@wensel.net"
] |
chris@wensel.net
|
b406f55f65dd796b9ef54fc2efe095e8091df295
|
6071a0b5a4b4d6d9f1040858460df6201fc606ac
|
/src/main/java/model/CajeroDTO.java
|
eda31654e8c6479af78b6ff50110ffc8621af362
|
[] |
no_license
|
L2AsHdz/WebBanco
|
26f27de33edde4ae96f151346f0a33711849bcbb
|
b3fdb9cddf8d1a60e82365b5360c1d8ba4fd2a46
|
refs/heads/master
| 2023-01-11T22:23:11.882888
| 2020-11-17T17:56:41
| 2020-11-17T17:56:41
| 310,769,257
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 648
|
java
|
package model;
/**
* @date 16/11/2020
* @time 15:40:22
* @author asael
*/
public class CajeroDTO extends Empleado {
private int totalTransacciones;
public CajeroDTO(int totalTransacciones, Turno turno, String codigo, String nombre, String direccion, String noIdentificacion, String sexo) {
super(turno, codigo, nombre, direccion, noIdentificacion, sexo);
this.totalTransacciones = totalTransacciones;
}
public int getTotalTransacciones() {
return totalTransacciones;
}
public void setTotalTransacciones(int totalTransacciones) {
this.totalTransacciones = totalTransacciones;
}
}
|
[
"leonidas0197@gmail.com"
] |
leonidas0197@gmail.com
|
7a358e9714f12638efe369e7dfa704b3ab6461c7
|
792658a26ffce10e45b46dbf0c5915afcdaf4998
|
/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/tableeditor/source/colouring/CommentRule.java
|
339e9c671685ea6d78a6d6bb83a56ef9f0ed4329
|
[
"Apache-2.0"
] |
permissive
|
mytliulei/RED
|
b2000c4aa84d47a670f199c7fd47233eb76ecea7
|
ca6523223fdb58ebccd3f7424059b53a7778a44b
|
refs/heads/master
| 2021-05-02T02:22:09.715839
| 2018-02-06T10:00:24
| 2018-02-06T12:37:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,348
|
java
|
package org.robotframework.ide.eclipse.main.plugin.tableeditor.source.colouring;
import java.util.List;
import java.util.Optional;
import org.eclipse.jface.text.rules.IToken;
import org.rf.ide.core.testdata.text.read.IRobotLineElement;
import org.rf.ide.core.testdata.text.read.IRobotTokenType;
import org.rf.ide.core.testdata.text.read.recognizer.RobotToken;
import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType;
public class CommentRule implements ISyntaxColouringRule {
private final IToken textToken;
public CommentRule(final IToken textToken) {
this.textToken = textToken;
}
@Override
public boolean isApplicable(final IRobotLineElement token) {
return token instanceof RobotToken;
}
@Override
public Optional<PositionedTextToken> evaluate(final IRobotLineElement token, final int offsetInToken,
final List<IRobotLineElement> analyzedTokens) {
final List<IRobotTokenType> tokenTypes = token.getTypes();
if (tokenTypes.contains(RobotTokenType.START_HASH_COMMENT)
|| tokenTypes.contains(RobotTokenType.COMMENT_CONTINUE)) {
return Optional.of(new PositionedTextToken(textToken, token.getStartOffset(), token.getText().length()));
}
return Optional.empty();
}
}
|
[
"CI-nokia@users.noreply.github.com"
] |
CI-nokia@users.noreply.github.com
|
5656c5baf0c7c51949aeefb511cdd62e46972a57
|
7805cac43c94200567d328a37d5b1ea01bd4289a
|
/src/main/java/com/xym/myJava/nio/WriteSomeBytes.java
|
0d4d35788190cbe9e9d83cb622f15a9b6e304ce0
|
[] |
no_license
|
xym-loveit/myJavaBaseProject
|
58c6606e4102b5c2395d5ddcf3db9de7575c53e8
|
dd2dd52cdd59539b37e40d4f22590b451feed2f3
|
refs/heads/master
| 2022-12-21T05:55:07.838905
| 2019-08-26T09:39:39
| 2019-08-26T09:39:39
| 141,161,163
| 0
| 0
| null | 2022-12-10T03:18:13
| 2018-07-16T15:55:19
|
Java
|
UTF-8
|
Java
| false
| false
| 653
|
java
|
package com.xym.myJava.nio;// $Id$
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
public class WriteSomeBytes
{
static private final byte message[] = { 83, 111, 109, 101, 32,
98, 121, 116, 101, 115, 46 };
static public void main( String args[] ) throws Exception {
FileOutputStream fout = new FileOutputStream( "writesomebytes.txt" );
FileChannel fc = fout.getChannel();
ByteBuffer buffer = ByteBuffer.allocate( 1024 );
for (int i=0; i<message.length; ++i) {
buffer.put( message[i] );
}
buffer.flip();
fc.write( buffer );
fout.close();
}
}
|
[
"xym_loveit@126.com"
] |
xym_loveit@126.com
|
41214f08fe5698df7dbe9b1ddb541600d27dfa06
|
c4a14d70951d7ec5aac7fe7ebb2db891cfe6c0b1
|
/modulos/apps/LOCALGIS-APPS-EIEL/src/main/java/com/geopista/app/eiel/models/PuntosVertidoCompletoEIELTableModel.java
|
4be5885fcfcf0243579a0b50d6abba12530f1cb7
|
[] |
no_license
|
pepeysusmapas/allocalgis
|
925756321b695066775acd012f9487cb0725fcde
|
c14346d877753ca17339f583d469dbac444ffa98
|
refs/heads/master
| 2020-09-14T20:15:26.459883
| 2016-09-27T10:08:32
| 2016-09-27T10:08:32
| null | 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 6,675
|
java
|
/**
* PuntosVertidoCompletoEIELTableModel.java
* © MINETUR, Government of Spain
* This program is part of LocalGIS
* 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.
* You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.geopista.app.eiel.models;
import java.util.ArrayList;
import javax.swing.table.DefaultTableModel;
import com.geopista.app.eiel.beans.PuntosVertidoEIEL;
import com.geopista.app.eiel.utils.LocalGISEIELUtils;
import com.geopista.app.utilidades.estructuras.Estructuras;
import com.vividsolutions.jump.I18N;
/**
* Clase que implementa el modelo de datos de la tabla del panel BienesJPanel
*/
public class PuntosVertidoCompletoEIELTableModel extends DefaultTableModel {
private static String[] columnNames = {
I18N.get("LocalGISEIEL","localgiseiel.tabla.generico.columna.estado"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.clave"),
// I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.codprov"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.codmunic"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.orden"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.tipo_pv"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.zona_pv"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.distancia_nucleo"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.fecha_ini_vertido"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.observ"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.fecha_revision"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.estado_revision"),
I18N.get("LocalGISEIEL","localgiseiel.tabla.pv.columna.bloqueado")};
public PuntosVertidoCompletoEIELTableModel() {
}
private ArrayList lstElementos = new ArrayList();
/**
* @return número de columnas de la tabla
*/
public int getColumnCount() {
if (columnNames!=null){
return columnNames.length;
}
else
return 0;
}
/**
* @return número de filas de la tabla
*/
public int getRowCount() {
if (lstElementos != null)
return lstElementos.size();
else
return 0;
}
/**
* Devuelve el nombre de la columna solicitada
* @param col Índice de la columna
* @return nombre de la columna
*/
public String getColumnName(int col) {
return columnNames[col];
}
/**
* Devuelve el objeto que contiene la celda en la posición indicada
* @param row Índice de la fila
* @param col Índice de la columna
*
* @return Objeto contenido en la posición seleccionada
*/
public Object getValueAt(int row, int col) {
if (lstElementos.get(row)==null)
return null;
switch (col)
{
case 0:
return ((PuntosVertidoEIEL)lstElementos.get(row)).getEstadoValidacion();
case 1:
return ((PuntosVertidoEIEL)lstElementos.get(row)).getClave();
case 2:
return ((PuntosVertidoEIEL)lstElementos.get(row)).getCodINEProvincia() + ((PuntosVertidoEIEL)lstElementos.get(row)).getCodINEMunicipio();
case 3:
return ((PuntosVertidoEIEL)lstElementos.get(row)).getOrden();
case 4:
Estructuras.cargarEstructura("eiel_Tipo Vertido");
return LocalGISEIELUtils.getNameFromEstructura(((PuntosVertidoEIEL)lstElementos.get(row)).getTipo());
case 5:
Estructuras.cargarEstructura("eiel_Zona del punto de vertido");
return LocalGISEIELUtils.getNameFromEstructura(((PuntosVertidoEIEL)lstElementos.get(row)).getZona());
case 6:
return ((PuntosVertidoEIEL) lstElementos.get(row)).getDistanciaNucleo() != null ? ((PuntosVertidoEIEL) lstElementos
.get(row)).getDistanciaNucleo().toString()
: "";
case 7:
return ((PuntosVertidoEIEL)lstElementos.get(row)).getFechaInicio() != null ? ((PuntosVertidoEIEL) lstElementos
.get(row)).getFechaInicio().toString()
: "";
case 8:
return ((PuntosVertidoEIEL)lstElementos.get(row)).getObservaciones();
case 9:
return ((PuntosVertidoEIEL)lstElementos.get(row)).getFechaRevision() != null ? ((PuntosVertidoEIEL) lstElementos
.get(row)).getFechaRevision().toString()
: "";
case 10:
Estructuras.cargarEstructura("eiel_Estado de revisión");
return LocalGISEIELUtils.getNameFromEstructura(((PuntosVertidoEIEL) lstElementos.get(row)).getEstadoRevision().toString());
default:
return null;
}
}
/**
* Devuelve la Depuradora1EIEL completa de la fila seleccionada
* @param row Índice de la fila cuyo objeto FincaCatastro se solicita
* @return FincaCatastro completa
*/
public PuntosVertidoEIEL getValueAt(int row) {
return (PuntosVertidoEIEL)lstElementos.get(row);
}
/**
* JTable uses this method to determine the default renderer/
* editor for each cell.
*/
public Class getColumnClass(int c) {
if (getValueAt(0, c)!=null)
return getValueAt(0, c).getClass();
else
return String.class;
}
public boolean isCellEditable(int row, int col) {
return false;
}
/**
* Establece los datos mostrados en el modelo
* @param datos Datos a mostrar en el modelo
*/
public void setData (ArrayList datos)
{
this.lstElementos = datos;
}
/**
* Recupera los datos del modelo
* @return Datos del modelo
*/
public ArrayList getData (){
return lstElementos;
}
}
|
[
"jorge.martin@cenatic.es"
] |
jorge.martin@cenatic.es
|
7d3aa0e4d2114c8b496e37c2bb7301c56c507a6b
|
d8273e5b8e0ebe0a17c5fae31a99a4df56eccd34
|
/src/main/java/net/qbar/common/grid/CableGrid.java
|
0a665e8b2a1885b36db3ee160d86c9c77f4a7a52
|
[
"Apache-2.0"
] |
permissive
|
Phenix246/Qbar
|
121f689c1e2eb1531226d19c70db6947c3d22afe
|
0169b3083e8e94abdbc265e30850d30433b1737c
|
refs/heads/master
| 2021-01-11T19:30:21.377365
| 2017-02-09T19:13:37
| 2017-02-09T19:13:37
| 79,382,625
| 0
| 0
| null | 2017-01-18T20:46:02
| 2017-01-18T20:46:02
| null |
UTF-8
|
Java
| false
| false
| 2,972
|
java
|
package net.qbar.common.grid;
import java.util.Collection;
import java.util.HashSet;
import javax.annotation.Nonnull;
public abstract class CableGrid
{
private final int identifier;
private final HashSet<ITileCable> cables;
public CableGrid(final int identifier)
{
this.identifier = identifier;
this.cables = new HashSet<>();
}
void tick()
{
}
abstract CableGrid copy(final int identifier);
boolean canMerge(final CableGrid grid)
{
if (grid.getIdentifier() != this.getIdentifier())
return true;
return false;
}
/**
* Called on the destination grid after the merging has occurred.
*
* @param the
* source grid
*/
void onMerge(final CableGrid grid)
{
}
/**
* Called after a grid splitting has occurred, each new fragment will
* receive this event.
*
* @param the
* grid source grid before splitting.
*/
void onSplit(final CableGrid grid)
{
}
public void addCable(@Nonnull final ITileCable cable)
{
this.cables.add(cable);
}
public void addCables(final Collection<ITileCable> cables)
{
cables.forEach(this::addCable);
}
public boolean removeCable(final ITileCable cable)
{
if (this.cables.remove(cable))
{
if (this.cables.isEmpty())
GridManager.getInstance().removeGrid(this.identifier);
return true;
}
return false;
}
public void removeCables(final Collection<ITileCable> cables)
{
cables.forEach(this::removeCable);
}
public boolean hasCable(final ITileCable cable)
{
return this.cables.contains(cable);
}
public int getIdentifier()
{
return this.identifier;
}
public HashSet<ITileCable> getCables()
{
return this.cables;
}
@Override
public String toString()
{
return "CableGrid [identifier=" + this.identifier + ", cables=" + this.cables + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + (this.cables == null ? 0 : this.cables.hashCode());
result = prime * result + this.identifier;
return result;
}
@Override
public boolean equals(final Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (this.getClass() != obj.getClass())
return false;
final CableGrid other = (CableGrid) obj;
if (this.cables == null)
{
if (other.cables != null)
return false;
}
else if (!this.cables.equals(other.cables))
return false;
if (this.identifier != other.identifier)
return false;
return true;
}
}
|
[
"ourtencoop@gmail.com"
] |
ourtencoop@gmail.com
|
0311c04c2f52e25fed9746e424b1a6599eda64ce
|
7130ab126cb86cc2b96ec4ead9a77948b482b6c1
|
/Tabletop/src/lib/weapons/Claw_4.java
|
36af838f0c0934a92ca2ac3323a35104d8ea5268
|
[] |
no_license
|
pester666/OldJavaStuff
|
2ac68fcaf6dc71bfc30ce4e31d71e0bc769fdce2
|
1f25152aefebe5bd88319594bb5392bcc9ee0798
|
refs/heads/master
| 2021-01-20T07:04:42.126369
| 2013-01-22T14:06:29
| 2013-01-22T14:06:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 155
|
java
|
package lib.weapons;
import lib.Weapon;
public class Claw_4 extends Weapon {
public Claw_4() {
super(WC.CLAW_4, 4, 1, 1, 1, false);
}
}
|
[
"pester@666.hell"
] |
pester@666.hell
|
9dfb2d0bee3ec0c0bf462bee110478a777ae086a
|
607fec6bb3faa4585a502a56db877cb5c12e965a
|
/lystore/src/main/java/com/store/zerone/zeronestore/adapter/order/ListOrderAdapter.java
|
c3e1f6031e6a6ae9b7b79ad46de4e518d9eea1ff
|
[] |
no_license
|
lxwguoba/zeroneStore
|
360aca9ed9c309faa82483bb1e99c22b039eeda4
|
7b523d6314b549886c97756217b3279aff6d0734
|
refs/heads/master
| 2020-03-11T22:24:38.621809
| 2018-07-27T16:15:09
| 2018-07-27T16:15:09
| 130,291,421
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,929
|
java
|
package com.store.zerone.zeronestore.adapter.order;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.store.zerone.zeronestore.R;
import java.util.List;
/**
* Created by on 2017/12/29 0029 15 44.
* Author LiuXingWen
*/
public class ListOrderAdapter extends BaseAdapter {
private Context context;
private List<String> list;
private LayoutInflater inflate;
public ListOrderAdapter(Context context, List<String> list) {
this.context = context;
this.list = list;
this.inflate = LayoutInflater.from(context);
}
@Override
public int getCount() {
if (list != null) {
return list.size();
}
return 0;
}
@Override
public Object getItem(int position) {
if (list != null) {
return list.get(position);
}
return null;
}
@Override
public long getItemId(int position) {
if (list != null) {
return position;
}
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = inflate.inflate(R.layout.order_list_fragment, null);
holder.ordercat_name = (TextView) convertView.findViewById(R.id.ordercat_name);
convertView.setTag(holder);
} else {
//直接通过holder获取下面三个子控件,不必使用findviewbyid,加快了 UI 的响应速度
holder = (ViewHolder) convertView.getTag();
}
holder.ordercat_name.setText(list.get(position));
return convertView;
}
static class ViewHolder {
TextView ordercat_name;
}
}
|
[
"liuxingwen_0511@163.com"
] |
liuxingwen_0511@163.com
|
364c57e12a94586e8ea102fa18ecfbc9d848971c
|
7033d33d0ce820499b58da1d1f86f47e311fd0e1
|
/com/mysql/cj/protocol/a/TracingPacketReader.java
|
4f2beb1119d68b29720a72883a5e64d93d588113
|
[
"MIT"
] |
permissive
|
gabrielvicenteYT/melon-client-src
|
1d3f1f65c5a3bf1b6bc3e1cb32a05bf1dd56ee62
|
e0bf34546ada3afa32443dab838b8ce12ce6aaf8
|
refs/heads/master
| 2023-04-04T05:47:35.053136
| 2021-04-19T18:34:36
| 2021-04-19T18:34:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,677
|
java
|
package com.mysql.cj.protocol.a;
import com.mysql.cj.log.*;
import com.mysql.cj.*;
import com.mysql.cj.util.*;
import java.io.*;
import java.util.*;
import com.mysql.cj.protocol.*;
public class TracingPacketReader implements MessageReader<NativePacketHeader, NativePacketPayload>
{
private static final int MAX_PACKET_DUMP_LENGTH = 1024;
private MessageReader<NativePacketHeader, NativePacketPayload> packetReader;
private Log log;
public TracingPacketReader(final MessageReader<NativePacketHeader, NativePacketPayload> packetReader, final Log log) {
this.packetReader = packetReader;
this.log = log;
}
@Override
public NativePacketHeader readHeader() throws IOException {
final NativePacketHeader hdr = this.packetReader.readHeader();
final StringBuilder traceMessageBuf = new StringBuilder();
traceMessageBuf.append(Messages.getString("PacketReader.3"));
traceMessageBuf.append(hdr.getMessageSize());
traceMessageBuf.append(Messages.getString("PacketReader.4"));
traceMessageBuf.append(StringUtils.dumpAsHex(hdr.getBuffer().array(), 4));
this.log.logTrace(traceMessageBuf.toString());
return hdr;
}
@Override
public NativePacketPayload readMessage(final Optional<NativePacketPayload> reuse, final NativePacketHeader header) throws IOException {
final int packetLength = header.getMessageSize();
final NativePacketPayload buf = this.packetReader.readMessage(reuse, header);
final StringBuilder traceMessageBuf = new StringBuilder();
traceMessageBuf.append(Messages.getString(reuse.isPresent() ? "PacketReader.5" : "PacketReader.6"));
traceMessageBuf.append(StringUtils.dumpAsHex(buf.getByteBuffer(), (packetLength < 1024) ? packetLength : 1024));
if (packetLength > 1024) {
traceMessageBuf.append(Messages.getString("PacketReader.7"));
traceMessageBuf.append(1024);
traceMessageBuf.append(Messages.getString("PacketReader.8"));
}
this.log.logTrace(traceMessageBuf.toString());
return buf;
}
@Override
public byte getMessageSequence() {
return this.packetReader.getMessageSequence();
}
@Override
public void resetMessageSequence() {
this.packetReader.resetMessageSequence();
}
@Override
public MessageReader<NativePacketHeader, NativePacketPayload> undecorateAll() {
return this.packetReader.undecorateAll();
}
@Override
public MessageReader<NativePacketHeader, NativePacketPayload> undecorate() {
return this.packetReader;
}
}
|
[
"haroldthesenpai@gmail.com"
] |
haroldthesenpai@gmail.com
|
1ec0b3ef9b01dfe2f35838450d48d34fc4493f63
|
aca1daa97558659d12ea5a602ec839d1b27b06d3
|
/src/main/java/club/crazypenguin/service/sys/impl/SyresourcetypeServiceImpl.java
|
0c8a2b283600f339041d348bd31813dafe0eff5c
|
[
"Apache-2.0"
] |
permissive
|
jamiebolton/star
|
03343549ae83701191d8bf680d4aaf4021ea3ec2
|
701800974318bf50a977b846e7896657477bc1cc
|
refs/heads/master
| 2021-01-16T21:36:48.787135
| 2016-05-30T06:05:05
| 2016-05-30T06:05:05
| 59,984,129
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,060
|
java
|
package club.crazypenguin.service.sys.impl;
import java.util.List;
import club.crazypenguin.model.Syresourcetype;
import club.crazypenguin.service.impl.BaseServiceImpl;
import club.crazypenguin.service.sys.SyresourcetypeServiceI;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
/**
* 资源类型实现类
*
* @author jamie
*/
@Service
public class SyresourcetypeServiceImpl extends BaseServiceImpl<Syresourcetype> implements SyresourcetypeServiceI {
/**
* 为列表添加了缓存,查询一次过后,只要不重启服务,缓存一直存在,不需要再查询数据库了,节省了一些资源
* <p/>
* 在ehcache.xml里面需要有对应的value
* <p/>
* <cache name="SyresourcetypeServiceCache"
* <p/>
* key是自己设定的一个ID,用来标识缓存
*/
@Override
@Cacheable(value = "SyresourcetypeServiceCache", key = "'SyresourcetypeList'")
public List<Syresourcetype> findResourcetype() {
return find();
}
}
|
[
"crazypenguin@aliyun.com"
] |
crazypenguin@aliyun.com
|
80f0f91daddbb7b65c4e66889e1a7c69d733fd1b
|
031b1c5b0c404f23ccd61a08845695bd4c3827f2
|
/project/TestMapper/src/main/java/com/cul/culsite/dao/MCustPurseExtDTOMapper.java
|
a2224d73f31e5aa24df66b8c730940c50faae52c
|
[] |
no_license
|
AndyFlower/zixin
|
c8d957fd8b1e6ca0e1ae63389bc8151ab93dbb55
|
647705e5f14fae96f82d334ba1eb8a534735bfd9
|
refs/heads/master
| 2022-12-23T21:10:44.872371
| 2021-02-10T07:15:21
| 2021-02-10T07:15:21
| 232,578,547
| 1
| 0
| null | 2022-12-16T15:41:14
| 2020-01-08T14:13:25
|
Java
|
UTF-8
|
Java
| false
| false
| 3,040
|
java
|
package com.cul.culsite.dao;
import com.cul.culsite.dto.MCustPurseExtDTO;
import com.cul.culsite.dto.MCustPurseExtDTOCriteria;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MCustPurseExtDTOMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int countByExample(MCustPurseExtDTOCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int deleteByExample(MCustPurseExtDTOCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int deleteByPrimaryKey(String purseId);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int insert(MCustPurseExtDTO record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int insertSelective(MCustPurseExtDTO record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
List<MCustPurseExtDTO> selectByExample(MCustPurseExtDTOCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
MCustPurseExtDTO selectByPrimaryKey(String purseId);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") MCustPurseExtDTO record, @Param("example") MCustPurseExtDTOCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int updateByExample(@Param("record") MCustPurseExtDTO record, @Param("example") MCustPurseExtDTOCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(MCustPurseExtDTO record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table CULSITE.M_CUST_PURSE_EXT
*
* @mbggenerated
*/
int updateByPrimaryKey(MCustPurseExtDTO record);
}
|
[
"1308445442@qq.com"
] |
1308445442@qq.com
|
4d9319c2816ac07466e7c6d0af1a4c582281ecab
|
b4bd19457dae6ecb124e446455f11f0a67677c88
|
/src/main/java/org/logesco/dao/SanctionTravailRepository.java
|
33535c2dd5f9a0fb25ae0631f0a53a8192cb6547
|
[] |
no_license
|
ckiad/logesco1.0
|
a0a79201c01a42801b000de26f0908596c60bbb8
|
86c5e73284099d1ff92cea4d162891ad1d8d927d
|
refs/heads/master
| 2022-07-14T03:57:45.032254
| 2019-07-03T03:18:08
| 2019-07-03T03:18:08
| 163,557,512
| 0
| 0
| null | 2022-06-29T17:08:19
| 2018-12-30T03:06:11
|
Roff
|
UTF-8
|
Java
| false
| false
| 742
|
java
|
/**
*
*/
package org.logesco.dao;
import java.util.List;
import org.logesco.entities.SanctionTravail;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @author cedrickiadjeu
*
*/
public interface SanctionTravailRepository extends JpaRepository<SanctionTravail, Long> {
public Page<SanctionTravail> findAllByOrderByCodeSancTravAscIntituleSancTravAsc(Pageable pageable);
public List<SanctionTravail> findAllByOrderByCodeSancTravAscIntituleSancTravAsc();
public SanctionTravail findByCodeSancTrav(String codeSancTrav);
public SanctionTravail findByCodeSancTravEn(String codeSancTravEn);
}
|
[
"ckiadjeu@gmail.com"
] |
ckiadjeu@gmail.com
|
3725c1d3b4e138020562522016622950668b8d85
|
1912c145dfdc1f67e8f39dbee6e67060808acdfb
|
/starter/src/main/resources/archetype-resources/src/main/java/web/UserController.java
|
28caaba91cf4ee6324326cb5a75aab19564cde71
|
[] |
no_license
|
hitangjun/com.springboot.archetypes
|
ae7e067ae70db2a3e4e57fa71c08e99754d6532e
|
3d438ce4d10b0dcf3c2ccd463d43145f698d7328
|
refs/heads/master
| 2020-06-11T10:05:24.298845
| 2016-12-06T08:00:44
| 2016-12-06T08:00:44
| 75,697,927
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,273
|
java
|
package ${package}.web;
import ${package}.domain.User;
import ${package}.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
@RestController //默认代替@Controller + @ResponseBody
@RequestMapping(value = "/users") // 通过这里配置使下面的映射都在/users下
public class UserController {
@Autowired
private UserService userService;
// 创建线程安全的Map
static Map<Long, User> users = Collections.synchronizedMap(new HashMap<Long, User>());
@RequestMapping(value = "/", method = RequestMethod.GET)
public List<User> getUserList() {
// 处理"/users/"的GET请求,用来获取用户列表
// 还可以通过@RequestParam从页面中传递参数来进行查询条件或者翻页信息的传递
List<User> r = new ArrayList<User>(users.values());
r.add(userService.findUserInfo());
return r;
}
@RequestMapping(value = "/", method = RequestMethod.POST)
public String postUser(@ModelAttribute User user) {
// 处理"/users/"的POST请求,用来创建User
// 除了@ModelAttribute绑定参数之外,还可以通过@RequestParam从页面中传递参数
users.put(user.getId(), user);
return "success";
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public User getUser(@PathVariable Long id) {
// 处理"/users/{id}"的GET请求,用来获取url中id值的User信息
// url中的id可通过@PathVariable绑定到函数的参数中
return users.get(id);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public String putUser(@PathVariable Long id, @ModelAttribute User user) {
// 处理"/users/{id}"的PUT请求,用来更新User信息
User u = users.get(id);
u.setName(user.getName());
u.setAge(user.getAge());
users.put(id, u);
return "success";
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public String deleteUser(@PathVariable Long id) {
// 处理"/users/{id}"的DELETE请求,用来删除User
users.remove(id);
return "success";
}
}
|
[
"hitangjun@qq.com"
] |
hitangjun@qq.com
|
f6a945166833ba576410358176e824d5514d47d2
|
2dd5d04281a16f822db4fbdc6e2dbc1c9f46fa73
|
/src/test/java/com/codahale/usl4j/benchmarks/Benchmarks.java
|
0493caad6d39013372d6b903f52b452961a58290
|
[
"Apache-2.0"
] |
permissive
|
kapiya/usl4j
|
3d9ecf444b68d56eeff69181ee2790103bd25472
|
fd790e7d9f5fab4613ed4b900838ed4874467898
|
refs/heads/master
| 2020-03-12T19:38:22.003917
| 2018-04-11T02:34:26
| 2018-04-11T02:34:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,909
|
java
|
/*
* Copyright © 2017 Coda Hale (coda.hale@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.codahale.usl4j.benchmarks;
import com.codahale.usl4j.Measurement;
import com.codahale.usl4j.Model;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.Main;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.runner.RunnerException;
@State(Scope.Benchmark)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@BenchmarkMode(Mode.AverageTime)
public class Benchmarks {
private List<Measurement> input = new ArrayList<>();
@Param({"10", "100", "1000", "10000"})
private int size = 10;
public static void main(String[] args) throws IOException, RunnerException {
Main.main(args);
}
@Setup
public void setup() {
this.input = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
input.add(Measurement.ofConcurrency().andThroughput(i, Math.random() * i));
}
}
@Benchmark
public Model build() {
return Model.build(input);
}
}
|
[
"coda.hale@gmail.com"
] |
coda.hale@gmail.com
|
4d5fd5525136bc5fc25cb5ffa2185c44040e17a6
|
68a19507f18acff18aa4fa67d6611f5b8ac8913c
|
/plfx/plfx-mp/plfx-mp-pojo/src/main/java/plfx/mp/pojo/dto/scenicspot/TCScenicSpotsDTO.java
|
c10a76a9ceb661cde7143ccf2e6645a408aa80a9
|
[] |
no_license
|
ksksks2222/pl-workspace
|
cf0d0be2dfeaa62c0d4d5437f85401f60be0eadd
|
6146e3e3c2384c91cac459d25b27ffeb4f970dcd
|
refs/heads/master
| 2021-09-13T08:59:17.177105
| 2018-04-27T09:46:42
| 2018-04-27T09:46:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,541
|
java
|
package plfx.mp.pojo.dto.scenicspot;
import java.util.List;
import plfx.mp.pojo.dto.BaseMpDTO;
import plfx.mp.pojo.dto.supplierpolicy.TCPolicyNoticeDTO;
/**
* 同程景区信息
*
* @author Administrator
*/
public class TCScenicSpotsDTO extends BaseMpDTO {
private static final long serialVersionUID = 1L;
/**
* 点评数
*/
private Integer commentCount;
/**
* 问答数
*/
private Integer questionCount;
/**
* 博客数量
*/
private Integer blogCount;
/**
* 浏览次数
*/
private Integer viewCount;
/**
* 是否可预订
*/
private Boolean bookFlag;
/**
* 最低价
*/
private Double amountAdvice;
/**
* 是否需要证件号
*/
private Boolean ifUseCard;
/**
* 政策须知
*/
private TCPolicyNoticeDTO tcPolicyNotice;
/**
* 支付类型
*/
private String payMode;
/**
* 主题列表
*/
private List<TCScenicSpotsThemeDTO> themes;
public Integer getCommentCount() {
return commentCount;
}
public void setCommentCount(Integer commentCount) {
this.commentCount = commentCount;
}
public Integer getQuestionCount() {
return questionCount;
}
public void setQuestionCount(Integer questionCount) {
this.questionCount = questionCount;
}
public Integer getBlogCount() {
return blogCount;
}
public void setBlogCount(Integer blogCount) {
this.blogCount = blogCount;
}
public Integer getViewCount() {
return viewCount;
}
public void setViewCount(Integer viewCount) {
this.viewCount = viewCount;
}
public Boolean getBookFlag() {
return bookFlag;
}
public void setBookFlag(Boolean bookFlag) {
this.bookFlag = bookFlag;
}
public Double getAmountAdvice() {
return amountAdvice;
}
public void setAmountAdvice(Double amountAdvice) {
this.amountAdvice = amountAdvice;
}
public Boolean getIfUseCard() {
return ifUseCard;
}
public void setIfUseCard(Boolean ifUseCard) {
this.ifUseCard = ifUseCard;
}
public String getPayMode() {
return payMode;
}
public void setPayMode(String payMode) {
this.payMode = payMode;
}
public TCPolicyNoticeDTO getTcPolicyNotice() {
return tcPolicyNotice;
}
public void setTcPolicyNotice(TCPolicyNoticeDTO tcPolicyNotice) {
this.tcPolicyNotice = tcPolicyNotice;
}
public List<TCScenicSpotsThemeDTO> getThemes() {
return themes;
}
public void setThemes(List<TCScenicSpotsThemeDTO> themes) {
this.themes = themes;
}
}
|
[
"cangsong6908@gmail.com"
] |
cangsong6908@gmail.com
|
b4ea038f8416e0352b0b36d339823a490664d9d2
|
a5bc47c428a6ad4126f66cb8e8156ff349bfb279
|
/zigbee-api/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ.java
|
5b0d6fe45c5047ef5d699c9ad23f65659caec9f9
|
[
"Apache-2.0"
] |
permissive
|
Arvis-Home/zigbee4java
|
d55cad49dda19133bcffede425f7ca0eeda14b68
|
b8122b86017632caf966030e854e326223487303
|
refs/heads/master
| 2021-01-18T02:32:26.177775
| 2015-07-10T11:26:10
| 2015-07-10T11:26:10
| 34,194,093
| 1
| 0
| null | 2015-04-19T04:57:34
| 2015-04-19T04:57:34
| null |
UTF-8
|
Java
| false
| false
| 4,901
|
java
|
/*
Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/
Instituto Tecnologico de Aplicaciones de Comunicacion
Avanzadas - Grupo Tecnologias para la Salud y el
Bienestar (TSB)
See the NOTICE file distributed with this work for additional
information regarding copyright ownership
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.bubblecloud.zigbee.network.packet.zdo;
import org.bubblecloud.zigbee.network.packet.ZToolAddress16;
import org.bubblecloud.zigbee.network.packet.ZToolCMD;
import org.bubblecloud.zigbee.network.packet.ZToolPacket;
import org.bubblecloud.zigbee.util.DoubleByte;
/**
* @author <a href="mailto:alfiva@aaa.upv.es">Alvaro Fides Valero</a>
* @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $)
*/
public class ZDO_MATCH_DESC_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ {
/// <name>TI.ZPI1.ZDO_MATCH_DESC_REQ.DstAddr</name>
/// <summary>destination address</summary>
public ZToolAddress16 DstAddr;
/// <name>TI.ZPI1.ZDO_MATCH_DESC_REQ.InClusterList</name>
/// <summary>Array of input cluster IDs - NumInClusters long</summary>
public DoubleByte[] InClusterList;
/// <name>TI.ZPI1.ZDO_MATCH_DESC_REQ.NumInClusters</name>
/// <summary>Number of ClusterIds in the InClusterList</summary>
public int NumInClusters;
/// <name>TI.ZPI1.ZDO_MATCH_DESC_REQ.NumOutClusters</name>
/// <summary>Number of ClusterIds in the</summary>
public int NumOutClusters;
/// <name>TI.ZPI1.ZDO_MATCH_DESC_REQ.NWKAddrOfInterest</name>
/// <summary>NWK address for the request</summary>
public ZToolAddress16 NWKAddrOfInterest;
/// <name>TI.ZPI1.ZDO_MATCH_DESC_REQ.OutClusterList</name>
/// <summary>Array of output cluster IDs - NumOutClusters long</summary>
public DoubleByte[] OutClusterList;
/// <name>TI.ZPI1.ZDO_MATCH_DESC_REQ.ProfileID</name>
/// <summary>Profile PROFILE_ID_HOME_AUTOMATION to match</summary>
public DoubleByte ProfileID;
/// <name>TI.ZPI1.ZDO_MATCH_DESC_REQ</name>
/// <summary>Constructor</summary>
public ZDO_MATCH_DESC_REQ() {
this.InClusterList = new DoubleByte[0x10];
this.OutClusterList = new DoubleByte[0x10];
}
public ZDO_MATCH_DESC_REQ(ZToolAddress16 num1, ZToolAddress16 num2, DoubleByte num3, int num4, DoubleByte[] numArray1, int num5, DoubleByte[] numArray2, int security_suite1) {
this.DstAddr = num1;
this.NWKAddrOfInterest = num2;
this.ProfileID = num3;
this.NumInClusters = num4;
this.InClusterList = new DoubleByte[numArray1.length];
this.InClusterList = numArray1;
/*if (numArray1.Length > 0x10)
{
throw new Exception("Error creating object.");
}
this.InClusterList = new ushort[0x10];
Array.Copy(numArray1, this.InClusterList, numArray1.Length);*/
this.NumOutClusters = num5;
this.OutClusterList = new DoubleByte[numArray1.length];
this.OutClusterList = numArray1;
/*if (numArray2.Length > 0x10)
{
throw new Exception("Error creating object.");
}
this.OutClusterList = new ushort[0x10];
Array.Copy(numArray2, this.OutClusterList, numArray2.Length);*/
int[] framedata = new int[8 + this.InClusterList.length * 2 + this.OutClusterList.length * 2];
framedata[0] = this.DstAddr.getLsb();
framedata[1] = this.DstAddr.getMsb();
framedata[2] = this.NWKAddrOfInterest.getLsb();
framedata[3] = this.NWKAddrOfInterest.getMsb();
framedata[4] = this.ProfileID.getLsb();
framedata[5] = this.ProfileID.getMsb();
framedata[6] = this.NumInClusters;
for (int i = 0; i < this.InClusterList.length; i++) {
framedata[(i * 2) + 7] = this.InClusterList[i].getLsb();
framedata[(i * 2) + 8] = this.InClusterList[i].getMsb();
}
framedata[((this.InClusterList.length) * 2) + 7] = this.NumOutClusters;
for (int i = 0; i < this.OutClusterList.length; i++) {
framedata[(i * 2) + ((this.InClusterList.length) * 2) + 8] = this.OutClusterList[i].getLsb();
framedata[(i * 2) + ((this.InClusterList.length) * 2) + 9] = this.OutClusterList[i].getMsb();
}
super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MATCH_DESC_REQ), framedata);
}
}
|
[
"tommi.s.e.laukkanen@gmail.com"
] |
tommi.s.e.laukkanen@gmail.com
|
bb86d18047f0bebbf69494dfc0282dffea93909b
|
bdc26f7dc70696267935dc328579f37773472eae
|
/instrument-modules/user-modules/module-catalina/src/main/java/com/pamirs/attach/plugin/catalina/CatalinaPlugin.java
|
60ac500871304ca86d73e9db9ccf6cbd8b1c881e
|
[
"Apache-2.0"
] |
permissive
|
luoyaogui/LinkAgent
|
ea75e494bdd7ba782dbac6520185c6ce0afa2fb3
|
7f289801309e27cefa3328ab4a67f526e18cf5cc
|
refs/heads/main
| 2023-08-25T21:55:24.736735
| 2021-11-03T08:30:11
| 2021-11-03T08:30:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,284
|
java
|
/**
* Copyright 2021 Shulie Technology, Co.Ltd
* Email: shulie@shulie.io
* 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,
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.pamirs.attach.plugin.catalina;
import com.pamirs.attach.plugin.catalina.interceptor.RequestStartAsyncInterceptor;
import com.pamirs.attach.plugin.catalina.interceptor.SpringMvcInterceptor;
import com.pamirs.attach.plugin.catalina.interceptor.StandardHostValveInvokeInterceptor;
import com.shulie.instrument.simulator.api.ExtensionModule;
import com.shulie.instrument.simulator.api.ModuleInfo;
import com.shulie.instrument.simulator.api.ModuleLifecycleAdapter;
import com.shulie.instrument.simulator.api.instrument.EnhanceCallback;
import com.shulie.instrument.simulator.api.instrument.InstrumentClass;
import com.shulie.instrument.simulator.api.instrument.InstrumentMethod;
import com.shulie.instrument.simulator.api.listener.Listeners;
import org.kohsuke.MetaInfServices;
@MetaInfServices(ExtensionModule.class)
@ModuleInfo(id = "catalina", version = "1.0.0", author = " xiaobin@shulie.io",description = "catalina 服务器,支持 tomcat 和 jboss")
public class CatalinaPlugin extends ModuleLifecycleAdapter implements ExtensionModule {
@Override
public boolean onActive() throws Throwable {
enhanceTemplate.enhance(this, "org.apache.catalina.core.StandardHostValve", new EnhanceCallback() {
@Override
public void doEnhance(InstrumentClass target) {
InstrumentMethod method = target.getDeclaredMethod("invoke", "org.apache.catalina.connector.Request", "org.apache.catalina.connector.Response");
method.addInterceptor(Listeners.of(StandardHostValveInvokeInterceptor.class));
}
});
enhanceTemplate.enhance(this, "org.apache.catalina.connector.Request", new EnhanceCallback() {
@Override
public void doEnhance(InstrumentClass target) {
InstrumentMethod method = target.getDeclaredMethod("startAsync", "javax.servlet.ServletRequest", "javax.servlet.ServletResponse");
method.addInterceptor(Listeners.of(RequestStartAsyncInterceptor.class));
}
});
//org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.MappingRegistry.getMappingsByUrl
enhanceTemplate.enhance(this, "org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry",
new EnhanceCallback() {
@Override
public void doEnhance(InstrumentClass target) {
InstrumentMethod getMethod = target.getDeclaredMethod("getMappingsByUrl",
"java.lang.String");
getMethod.addInterceptor(Listeners.of(SpringMvcInterceptor.class));
}
});
return true;
}
}
|
[
"jirenhe@shulie.io"
] |
jirenhe@shulie.io
|
d68c6ffea6ce679a12513b322da93981ee015006
|
9a6ea6087367965359d644665b8d244982d1b8b6
|
/src/main/java/X/AnonymousClass2UQ.java
|
351fc8936ba2aa2210f377228272afc2c969dc90
|
[] |
no_license
|
technocode/com.wa_2.21.2
|
a3dd842758ff54f207f1640531374d3da132b1d2
|
3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9
|
refs/heads/master
| 2023-02-12T11:20:28.666116
| 2021-01-14T10:22:21
| 2021-01-14T10:22:21
| 329,578,591
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,661
|
java
|
package X;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.SystemClock;
import android.view.View;
import com.whatsapp.mediaview.MediaViewActivity;
/* renamed from: X.2UQ reason: invalid class name */
public class AnonymousClass2UQ {
public int A00 = 1;
public int A01 = 5;
public View A02 = null;
public AnonymousClass02N A03 = null;
public C007303n A04 = null;
public boolean A05 = false;
public boolean A06 = false;
public boolean A07 = false;
public final Context A08;
public AnonymousClass2UQ(Context context) {
this.A08 = context;
}
public Intent A00() {
Context context = this.A08;
Intent intent = new Intent(context, MediaViewActivity.class);
intent.putExtra("start_t", SystemClock.uptimeMillis());
intent.putExtra("video_play_origin", this.A01);
intent.putExtra("nogallery", this.A07);
intent.putExtra("gallery", this.A05);
intent.putExtra("menu_style", this.A00);
intent.putExtra("menu_set_wallpaper", this.A06);
C007303n r0 = this.A04;
if (r0 != null) {
C006803i.A05(intent, r0);
}
AnonymousClass02N r02 = this.A03;
if (r02 != null) {
intent.putExtra("jid", r02.getRawString());
}
View view = this.A02;
if (view != null) {
Context A0O = C002001d.A0O(context);
if (A0O instanceof ActivityC004802g) {
intent.putExtra("animation_bundle", AnonymousClass2UT.A00((Activity) A0O, view));
}
}
return intent;
}
}
|
[
"madeinborneo@gmail.com"
] |
madeinborneo@gmail.com
|
ff876b3c155819f0c709c3d7535a5716f3f92c9d
|
1c785b15245b122d974c300e5004de60056ef55d
|
/projects/wfe/wfe-office/src/main/java/ru/runa/wfe/office/excel/CellConstraints.java
|
236dd7e8a927a47fa3bdce96ebd9df7139f686d7
|
[] |
no_license
|
kuimovvg/RunaWFE-4.x
|
13e58f873d0fb751751a10294473d18b394a4b17
|
9b7d34f1e402d963213efda9dab9c305b090db0d
|
refs/heads/trunk
| 2020-12-25T20:30:53.442175
| 2015-07-29T16:03:24
| 2015-07-29T16:03:24
| 39,517,577
| 0
| 0
| null | 2015-07-22T16:36:09
| 2015-07-22T16:36:08
| null |
UTF-8
|
Java
| false
| false
| 530
|
java
|
package ru.runa.wfe.office.excel;
import org.dom4j.Element;
public class CellConstraints extends OnSheetConstraints {
private int rowIndex;
private int columnIndex;
@Override
public void configure(Element element) {
super.configure(element);
rowIndex = getIndex(element, "row");
columnIndex = getIndex(element, "column");
}
public int getRowIndex() {
return rowIndex;
}
public int getColumnIndex() {
return columnIndex;
}
}
|
[
"gritsenko_s@999c22fd-c5eb-e245-b5be-d41808c6d2cd"
] |
gritsenko_s@999c22fd-c5eb-e245-b5be-d41808c6d2cd
|
caa75597b24e11f0c24c98ed772257740c79cf2d
|
5d8d1de79028188d90ac5db1aa92f98eb174abbe
|
/hw04-1191226486/src/main/java/hr/fer/zemris/java/hw04/collections/Demo1.java
|
289d505579549d4cf96d8cbda19aa1f17c1bf585
|
[] |
no_license
|
tinam8/Introduction-to-Java-Programming-Language
|
108baa33fd599accc2be04c407eb11c077b2dc97
|
73d459b784558e573cf86c210c40b8353f0daa48
|
refs/heads/master
| 2021-09-09T11:37:00.089620
| 2018-03-15T18:39:36
| 2018-03-15T18:39:36
| 125,410,917
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 895
|
java
|
package hr.fer.zemris.java.hw04.collections;
import hr.fer.zemris.java.hw04.collections.SimpleHashtable;
public class Demo1 {
public static void main(String[] args) {
// create collection:
SimpleHashtable<String, Integer> examMarks = new SimpleHashtable<>(2);
// fill data:
examMarks.put("Ivana", 2);
examMarks.put("Ante", 2);
examMarks.put("Jasna", 2);
examMarks.put("Kristina", 5);
examMarks.put("Ivana", 5); // overwrites old grade for Ivana
for (SimpleHashtable.TableEntry<String, Integer> pair : examMarks) {
System.out.printf("%s => %d%n", pair.getKey(), pair.getValue());
}
for (SimpleHashtable.TableEntry<String, Integer> pair1 : examMarks) {
for (SimpleHashtable.TableEntry<String, Integer> pair2 : examMarks) {
System.out.printf("(%s => %d) - (%s => %d)%n", pair1.getKey(), pair1.getValue(), pair2.getKey(),
pair2.getValue());
}
}
}
}
|
[
"you@example.com"
] |
you@example.com
|
445e8d1a9ea3e51aadb8c9bd86b1c9ad53ef8c6c
|
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
|
/program_data/JavaProgramData/19/3157.java
|
ff95600eb526fde0fa0b03e4296f6167462473fe
|
[
"MIT"
] |
permissive
|
qiuchili/ggnn_graph_classification
|
c2090fefe11f8bf650e734442eb96996a54dc112
|
291ff02404555511b94a4f477c6974ebd62dcf44
|
refs/heads/master
| 2021-10-18T14:54:26.154367
| 2018-10-21T23:34:14
| 2018-10-21T23:34:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,868
|
java
|
import java.util.*;
package <missing>;
public class GlobalMembers
{
public static int Main()
{
int i;
int j;
int k;
int l;
int l1;
int l2;
String s = new String(new char[200]);
String a = new String(new char[101]);
String b = new String(new char[101]);
s = new Scanner(System.in).nextLine();
a = new Scanner(System.in).nextLine();
b = new Scanner(System.in).nextLine();
l = s.length();
l1 = a.length();
l2 = b.length();
for (i = l;i >= 0;i--)
{
s = tangible.StringFunctions.changeCharacter(s, i + 1, s.charAt(i));
}
s = tangible.StringFunctions.changeCharacter(s, 0, ' ');
l += 1;
for (i = 0;i <= l + 1;i++)
{
if (s.charAt(i) == ' ')
{
for (j = i + 1;j <= i + l1;j++)
{
if (s.charAt(j) != a.charAt(j - i - 1))
{
break;
}
else
{
if (j == i + l1 && (s.charAt(i + l1 + 1) == ' ' || s.charAt(i + l1 + 1) == '\0'))
{
if (l2 >= l1)
{
l += l2 - l1;
for (k = l - l2 + l1;k >= i + l1 + 1;k--)
{
s = tangible.StringFunctions.changeCharacter(s, k + l2 - l1, s.charAt(k));
}
for (k = i;k <= i + l2 - 1;k++)
{
s = tangible.StringFunctions.changeCharacter(s, k + 1, b.charAt(k - i));
}
}
if (l2 < l1)
{
for (k = i + l1 + 1;k <= l + 2;k++)
{
s = tangible.StringFunctions.changeCharacter(s, k + l2 - l1, s.charAt(k));
}
for (k = i;k <= i + l2 - 1;k++)
{
s = tangible.StringFunctions.changeCharacter(s, k + 1, b.charAt(k - i));
}
}
}
}
}
}
}
for (i = 1;i <= l;i++)
{
s = tangible.StringFunctions.changeCharacter(s, i - 1, s.charAt(i));
}
System.out.print(s);
System.out.print("\n");
return 0;
}
}
|
[
"y.yu@open.ac.uk"
] |
y.yu@open.ac.uk
|
9accabda2ca69cd0aecfb7619600c4d94646e77b
|
14044cdf588178b733c3fb88094841aec30252bc
|
/app/src/main/java/th/ac/dusit/dbizcom/smartshrimp/net/LoginResponse.java
|
32f8f3d88a7801f91551a0ce1cf06180487c964c
|
[] |
no_license
|
3bugs/SmartShrimp
|
139ca35c320a9868e96976368018be98f1ce37d2
|
a147819c38203d3816b300d23dc456224cc8a3de
|
refs/heads/master
| 2020-05-19T05:37:36.807539
| 2020-01-22T10:25:57
| 2020-01-22T10:25:57
| 184,852,853
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 323
|
java
|
package th.ac.dusit.dbizcom.smartshrimp.net;
import com.google.gson.annotations.SerializedName;
import th.ac.dusit.dbizcom.smartshrimp.model.User;
public class LoginResponse extends BaseResponse {
@SerializedName("login_success")
public boolean loginSuccess;
@SerializedName("user")
public User user;
}
|
[
"promlert@gmail.com"
] |
promlert@gmail.com
|
f8fca40571c61df683ae4becfd7a897d8efa2dd3
|
524c3487d7c6edf4cab0ed345237afb71d030d53
|
/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/JsonConfig.java
|
f6373704bfffd4601e430d50107177ea4ca756ca
|
[
"Apache-2.0"
] |
permissive
|
highmed/highmed-dsf
|
2d5666c23ac38e6b3e0355032a10f77f21ca7e14
|
2448ee9719277ae7e720b38ae600f0056c773361
|
refs/heads/main
| 2023-07-09T20:23:42.392160
| 2023-06-21T18:21:33
| 2023-06-21T18:21:33
| 190,670,816
| 35
| 27
|
Apache-2.0
| 2023-09-14T19:36:35
| 2019-06-07T01:06:36
|
Java
|
UTF-8
|
Java
| false
| false
| 782
|
java
|
package org.highmed.dsf.fhir.spring.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonGenerator.Feature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
@Configuration
public class JsonConfig
{
@Bean
public ObjectMapper objectMapper()
{
JsonMapper jsonMapper = JsonMapper.builder().disable(MapperFeature.DEFAULT_VIEW_INCLUSION)
.serializationInclusion(Include.NON_NULL).serializationInclusion(Include.NON_EMPTY)
.disable(Feature.AUTO_CLOSE_TARGET).build();
return jsonMapper;
}
}
|
[
"hauke.hund@hs-heilbronn.de"
] |
hauke.hund@hs-heilbronn.de
|
d7a62ac54b245869035ab20b627aa0591b5b054d
|
0abf9794b01d8278261bcc6b3dade9b41efd17fe
|
/src/main/java/org/demo/web/provider/DemoActionProvider.java
|
8749cc620de4b08e83c686a89d544ad6358b38d1
|
[] |
no_license
|
nanoj-org/nanoj-web-demo
|
d1bcca623b9920b397b3c9b59d1634f36dcbf391
|
087d89cef44feb62fd92a9937381105746330d7a
|
refs/heads/master
| 2021-01-21T13:40:40.036223
| 2016-05-25T10:18:08
| 2016-05-25T10:18:08
| 52,378,885
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 848
|
java
|
package org.demo.web.provider;
import java.util.HashMap;
import java.util.Map;
import org.demo.web.actions.AddAction;
import org.demo.web.actions.BooleanAction;
import org.demo.web.actions.CalcAction;
import org.demo.web.actions.WelcomeAction;
import org.nanoj.web.tinymvc.Action;
import org.nanoj.web.tinymvc.provider.SpecificActionProvider;
public class DemoActionProvider extends SpecificActionProvider {
private final static Map<String, Class<? extends Action>> map = new HashMap<String, Class<? extends Action >>();
//--- Define actions here
static {
map.put("", WelcomeAction.class ) ;
map.put("index", WelcomeAction.class ) ;
map.put("add", AddAction.class ) ;
map.put("calc", CalcAction.class ) ;
map.put("boolean", BooleanAction.class ) ;
}
public DemoActionProvider() {
super(map);
}
}
|
[
"laguerin@LFR002634.corp.capgemini.com"
] |
laguerin@LFR002634.corp.capgemini.com
|
0d739dd9dd0bc8aca628a13f5de8c4e46cf22d79
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_90c36009fa954770753a759da3197ddad91deded/BPPlugin/2_90c36009fa954770753a759da3197ddad91deded_BPPlugin_s.java
|
b2020b333508b741598bb27569e01f4ea476909f
|
[] |
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
| 7,696
|
java
|
/*
* The MIT License
*
* Copyright (C) 2010-2011 by Anthony Robinson
*
* 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.
*/
package jenkins.plugins.publish_over;
import hudson.FilePath;
import hudson.Launcher;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.Hudson;
import hudson.model.Result;
import hudson.model.TaskListener;
import hudson.tasks.BuildStepMonitor;
import hudson.tasks.Notifier;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.TreeMap;
@SuppressWarnings({ "PMD.LooseCoupling", "PMD.TooManyMethods" }) // serializable ... Map ...
public abstract class BPPlugin<PUBLISHER extends BapPublisher, CLIENT extends BPClient, COMMON_CONFIG>
extends Notifier implements BPHostConfigurationAccess<CLIENT, COMMON_CONFIG> {
public static final String PROMOTION_JOB_TYPE = "hudson.plugins.promoted_builds.PromotionProcess";
public static final String PROMOTION_CLASS_NAME = "hudson.plugins.promoted_builds.Promotion";
private final String consolePrefix;
private BPInstanceConfig delegate;
public BPPlugin(final String consolePrefix, final ArrayList<PUBLISHER> publishers, final boolean continueOnError,
final boolean failOnError, final boolean alwaysPublishFromMaster, final String masterNodeName) {
this.delegate = new BPInstanceConfig<PUBLISHER>(publishers, continueOnError, failOnError, alwaysPublishFromMaster, masterNodeName);
delegate.setHostConfigurationAccess(this);
this.consolePrefix = consolePrefix;
}
public BPInstanceConfig getInstanceConfig() { return delegate; }
public BPInstanceConfig getDelegate() { return delegate; }
public void setDelegate(final BPInstanceConfig delegate) {
this.delegate = delegate;
delegate.setHostConfigurationAccess(this);
}
public BuildStepMonitor getRequiredMonitorService() {
return BuildStepMonitor.BUILD;
}
private TreeMap<String, String> getEnvironmentVariables(final AbstractBuild<?, ?> build, final TaskListener listener) {
try {
final TreeMap<String, String> env = build.getEnvironment(listener);
env.putAll(build.getBuildVariables());
return env;
} catch (Exception e) {
throw new RuntimeException(Messages.exception_failedToGetEnvVars(), e);
}
}
@Override
public boolean perform(final AbstractBuild<?, ?> build, final Launcher launcher, final BuildListener listener)
throws InterruptedException, IOException {
final PrintStream console = listener.getLogger();
if (!isBuildGoodEnoughToRun(build, console)) return true;
final BPBuildEnv currentBuildEnv = new BPBuildEnv(getEnvironmentVariables(build, listener), build.getWorkspace(),
build.getTimestamp());
BPBuildEnv targetBuildEnv = null;
if (PROMOTION_CLASS_NAME.equals(build.getClass().getCanonicalName())) {
AbstractBuild<?, ?> promoted;
try {
final Method getTarget = build.getClass().getMethod("getTarget", (Class<?>[]) null);
promoted = (AbstractBuild) getTarget.invoke(build, (Object[]) null);
} catch (Exception e) {
throw new RuntimeException(Messages.exception_failedToGetPromotedBuild(), e);
}
targetBuildEnv = new BPBuildEnv(getEnvironmentVariables(promoted, listener),
new FilePath(promoted.getArtifactsDir()), promoted.getTimestamp());
}
final BPBuildInfo buildInfo = new BPBuildInfo(listener, consolePrefix, Hudson.getInstance().getRootPath(),
currentBuildEnv, targetBuildEnv);
fixup(build, buildInfo);
final Result result = delegate.perform(buildInfo);
if (build.getResult() == null)
build.setResult(result);
else
build.setResult(result.combine(build.getResult()));
return result.isBetterOrEqualTo(Result.UNSTABLE);
}
@SuppressWarnings("EmptyMethodInAbstractClassShouldBeAbstract") // don't need to provide impl, so not abstract!
protected void fixup(final AbstractBuild<?, ?> build, final BPBuildInfo buildInfo) {
// provide a hook for the plugin impl to get at other internals - ie Hudson.getInstance is null when remote from a publisher!!!!!
// as is Exceutor.currentExecutor, Computer.currentComputer - it's a wilderness out there!
}
protected boolean isBuildGoodEnoughToRun(final AbstractBuild<?, ?> build, final PrintStream console) {
if ((build.getResult() != null) && !build.getResult().isBetterOrEqualTo(Result.UNSTABLE)) {
console.println(Messages.console_notPerforming(build.getResult()));
return false;
}
return true;
}
protected HashCodeBuilder createHashCodeBuilder() {
return addToHashCode(new HashCodeBuilder());
}
protected HashCodeBuilder addToHashCode(final HashCodeBuilder builder) {
return builder.append(delegate).append(consolePrefix);
}
protected EqualsBuilder createEqualsBuilder(final BPPlugin that) {
return addToEquals(new EqualsBuilder(), that);
}
protected EqualsBuilder addToEquals(final EqualsBuilder builder, final BPPlugin that) {
return builder.append(delegate, that.delegate)
.append(consolePrefix, that.consolePrefix);
}
protected ToStringBuilder addToToString(final ToStringBuilder builder) {
return builder.append("consolePrefix", consolePrefix)
.append("delegate", delegate);
}
public boolean equals(final Object that) {
if (this == that) return true;
if (that == null || getClass() != that.getClass()) return false;
return createEqualsBuilder((BPPlugin) that).isEquals();
}
public int hashCode() {
return createHashCodeBuilder().toHashCode();
}
public String toString() {
return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
6d21ec93afa31a6c565fbcf50f673a1cc78ddbcf
|
b889ee42c7c2a457c5971b21293e0fbd329eea72
|
/com/badlogic/gdx/graphics/profiling/GLProfiler.java
|
5bf3f8ff1dd9c7271ae4027e37797a60ee0119cd
|
[] |
no_license
|
cfosco/Evolution-simulator
|
aa88d823e546d960247f63e841750b181c5a3622
|
737b8c54da729df78c3db3137432a32d9af5186e
|
refs/heads/master
| 2021-01-12T08:03:22.722480
| 2017-10-01T20:07:23
| 2017-10-01T20:07:23
| 77,113,048
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,428
|
java
|
/*
* Decompiled with CFR 0_122.
*/
package com.badlogic.gdx.graphics.profiling;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GL30;
import com.badlogic.gdx.graphics.profiling.GL20Profiler;
import com.badlogic.gdx.graphics.profiling.GL30Profiler;
import com.badlogic.gdx.math.FloatCounter;
public abstract class GLProfiler {
public static int calls;
public static int textureBindings;
public static int drawCalls;
public static int shaderSwitches;
public static FloatCounter vertexCount;
public static void enable() {
Gdx.gl30 = Gdx.gl30 == null ? null : new GL30Profiler(Gdx.gl30);
Gdx.gl = Gdx.gl20 = Gdx.gl30 != null ? Gdx.gl30 : new GL20Profiler(Gdx.gl20);
}
public static void disable() {
if (Gdx.gl30 != null && Gdx.gl30 instanceof GL30Profiler) {
Gdx.gl30 = ((GL30Profiler)Gdx.gl30).gl30;
}
if (Gdx.gl20 != null && Gdx.gl20 instanceof GL20Profiler) {
Gdx.gl20 = ((GL20Profiler)Gdx.gl).gl20;
}
if (Gdx.gl != null && Gdx.gl instanceof GL20Profiler) {
Gdx.gl = ((GL20Profiler)Gdx.gl).gl20;
}
}
public static void reset() {
calls = 0;
textureBindings = 0;
drawCalls = 0;
shaderSwitches = 0;
vertexCount.reset();
}
static {
vertexCount = new FloatCounter(0);
}
}
|
[
"camilofosco@gmail.com"
] |
camilofosco@gmail.com
|
ed150169904d82df1675be3e9dfd0485ddd1585e
|
a4a51084cfb715c7076c810520542af38a854868
|
/src/main/java/com/c/a/c/b/a/f.java
|
a4f01f9783b20f9d08ad630f5b943a4b2b6af679
|
[] |
no_license
|
BharathPalanivelu/repotest
|
ddaf56a94eb52867408e0e769f35bef2d815da72
|
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
|
refs/heads/master
| 2020-09-30T18:55:04.802341
| 2019-12-02T10:52:08
| 2019-12-02T10:52:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 435
|
java
|
package com.c.a.c.b.a;
import android.graphics.Bitmap;
public class f implements e {
public void a() {
}
public void a(int i) {
}
public void a(Bitmap bitmap) {
bitmap.recycle();
}
public Bitmap a(int i, int i2, Bitmap.Config config) {
return Bitmap.createBitmap(i, i2, config);
}
public Bitmap b(int i, int i2, Bitmap.Config config) {
return a(i, i2, config);
}
}
|
[
"noiz354@gmail.com"
] |
noiz354@gmail.com
|
15e7f1a92c0623d19a4a2fab3d3b89009c642ccf
|
59fbfc924372e0acdf318d2f76893444717eb6ea
|
/src/main/java/net/marsbytes/app/recruitment/security/AuthoritiesConstants.java
|
1360c33a130206de9d3a43b7e72cf772ae750845
|
[] |
no_license
|
ErYaminiPal/RecruitmentApp
|
894c27277393e45318cc61a48489aaf99713aa7b
|
2eb5a56b96d78875bd3eee95be32ed1503f0e3cb
|
refs/heads/master
| 2023-06-16T22:44:40.375802
| 2021-07-06T09:08:22
| 2021-07-06T09:08:22
| 383,397,514
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 354
|
java
|
package net.marsbytes.app.recruitment.security;
/**
* Constants for Spring Security authorities.
*/
public final class AuthoritiesConstants {
public static final String ADMIN = "ROLE_ADMIN";
public static final String USER = "ROLE_USER";
public static final String ANONYMOUS = "ROLE_ANONYMOUS";
private AuthoritiesConstants() {}
}
|
[
"a@b.c"
] |
a@b.c
|
189190ec74aa0944cf9741d69d1b0d9609f9248d
|
9fe800087ef8cc6e5b17fa00f944993b12696639
|
/batik-test-old/src/test/java/org/apache/batik/dom/DocumentRenameNodeTest.java
|
8622a9943d0ba1b1a0c729fd41e53f7de5a7982d
|
[
"Apache-2.0"
] |
permissive
|
balabit-deps/balabit-os-7-batik
|
14b80a316321cbd2bc29b79a1754cc4099ce10a2
|
652608f9d210de2d918d6fb2146b84c0cc771842
|
refs/heads/master
| 2023-08-09T03:24:18.809678
| 2023-05-22T20:34:34
| 2023-05-27T08:21:21
| 158,242,898
| 0
| 0
|
Apache-2.0
| 2023-07-20T04:18:04
| 2018-11-19T15:03:51
|
Java
|
UTF-8
|
Java
| false
| false
| 1,870
|
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.batik.dom;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.svg.SVGGElement;
import org.w3c.dom.svg.SVGSVGElement;
/**
* Tests Document.renameNode.
*
* @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a>
* @version $Id: DocumentRenameNodeTest.java 1733420 2016-03-03 07:41:59Z gadams $
*/
public class DocumentRenameNodeTest extends DOM3Test {
public boolean runImplBasic() throws Exception {
Document doc = newSVGDoc();
Element e2 = doc.createElementNS(SVG_NAMESPACE_URI, "g");
boolean pass = e2 instanceof SVGGElement;
e2 = (Element) ((AbstractDocument) doc).renameNode(e2, SVG_NAMESPACE_URI, "svg");
pass = pass && e2 instanceof SVGSVGElement;
Attr a = doc.createAttributeNS(null, "test");
a = (Attr) ((AbstractDocument) doc).renameNode(a, EX_NAMESPACE_URI, "test2");
pass = pass && a.getNamespaceURI().equals(EX_NAMESPACE_URI)
&& a.getLocalName().equals("test2");
return pass;
}
}
|
[
"testbot@balabit.com"
] |
testbot@balabit.com
|
9b153add3ede63d989935ca861bfbc437064142b
|
6839e7abfa2e354becd034ea46f14db3cbcc7488
|
/src/cn/com/sinosoft/service/impl/PresentCategoryServiceImpl.java
|
ace2a58b77f329449226700a2b9fe182469378fd
|
[] |
no_license
|
trigrass2/wj
|
aa2d310baa876f9e32a65238bcd36e7a2440b8c6
|
0d4da9d033c6fa2edb014e3a80715c9751a93cd5
|
refs/heads/master
| 2021-04-19T11:03:25.609807
| 2018-01-12T09:26:11
| 2018-01-12T09:26:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,283
|
java
|
package cn.com.sinosoft.service.impl;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.Hibernate;
import org.springframework.stereotype.Service;
import org.springmodules.cache.annotations.CacheFlush;
import org.springmodules.cache.annotations.Cacheable;
import cn.com.sinosoft.dao.ChannelDao;
import cn.com.sinosoft.dao.PresentCategoryDao;
import cn.com.sinosoft.entity.Channel;
import cn.com.sinosoft.entity.Present;
import cn.com.sinosoft.entity.PresentCategory;
import cn.com.sinosoft.service.PresentCategoryService;
/**
* Service实现类 - 礼品分类
* ============================================================================
*
*
*
*
*
*
* KEY:SINOSOFT9C63255F0E5AAEE7DD3D83FB323FC00D
* ============================================================================
*/
@Service
public class PresentCategoryServiceImpl extends BaseServiceImpl<PresentCategory, String> implements
PresentCategoryService {
@Resource
private PresentCategoryDao presentCategoryDao;
@Resource
private ChannelDao channelDao;
@Resource
public void setBaseDao(PresentCategoryDao presentCategoryDao) {
super.setBaseDao(presentCategoryDao);
}
@Cacheable(modelId = "caching")
public List<PresentCategory> getRootPresentCategoryList() {
List<PresentCategory> rootPresentCategoryList = presentCategoryDao.getRootPresentCategoryList();
if (rootPresentCategoryList != null) {
for (PresentCategory rootPresentCategory : rootPresentCategoryList) {
Hibernate.initialize(rootPresentCategory);
}
}
return rootPresentCategoryList;
}
@Cacheable(modelId = "caching")
public List<PresentCategory> getParentPresentCategoryList(PresentCategory presentCategory) {
List<PresentCategory> parentPresentCategoryList = presentCategoryDao.getParentPresentCategoryList(presentCategory);
if (parentPresentCategoryList != null) {
for (PresentCategory parentPresentCategory : parentPresentCategoryList) {
Hibernate.initialize(parentPresentCategory);
}
}
return parentPresentCategoryList;
}
public List<PresentCategory> getParentPresentCategoryList(Present present) {
PresentCategory presentCategory = present.getPresentCategory();
List<PresentCategory> presentCategoryList = new ArrayList<PresentCategory>();
presentCategoryList.addAll(this.getParentPresentCategoryList(presentCategory));
presentCategoryList.add(presentCategory);
return presentCategoryList;
}
public List<PresentCategory> getPresentCategoryPathList(PresentCategory presentCategory) {
List<PresentCategory> presentCategoryPathList = new ArrayList<PresentCategory>();
presentCategoryPathList.addAll(this.getParentPresentCategoryList(presentCategory));
presentCategoryPathList.add(presentCategory);
return presentCategoryPathList;
}
public List<PresentCategory> getPresentCategoryPathList(Present present) {
PresentCategory presentCategory = present.getPresentCategory();
List<PresentCategory> presentCategoryList = new ArrayList<PresentCategory>();
presentCategoryList.addAll(this.getParentPresentCategoryList(presentCategory));
presentCategoryList.add(presentCategory);
return presentCategoryList;
}
@Cacheable(modelId = "caching")
public List<PresentCategory> getChildrenPresentCategoryList(PresentCategory presentCategory) {
List<PresentCategory> childrenPresentCategoryList = presentCategoryDao.getChildrenPresentCategoryList(presentCategory);
if (childrenPresentCategoryList != null) {
for (PresentCategory childrenPresentCategory : childrenPresentCategoryList) {
Hibernate.initialize(childrenPresentCategory);
}
}
return childrenPresentCategoryList;
}
public List<PresentCategory> getChildrenPresentCategoryList(Present present) {
PresentCategory presentCategory = present.getPresentCategory();
List<PresentCategory> presentCategoryList = getChildrenPresentCategoryList(presentCategory);
if (presentCategoryList == null) {
presentCategoryList = new ArrayList<PresentCategory>();
}
presentCategoryList.add(presentCategory);
return presentCategoryList;
}
//获取渠道列表
public List<Channel> getPresentCategoryChannelList(){
List<Channel> allPresentCategoryChannelList=channelDao.getAll();
return allPresentCategoryChannelList;
}
@Cacheable(modelId = "caching")
public List<PresentCategory> getPresentCategoryTreeList() {
List<PresentCategory> allPresentCategoryList = this.getAll();
return recursivPresentCategoryTreeList(allPresentCategoryList, null, null);
}
// 递归父类排序分类树
private List<PresentCategory> recursivPresentCategoryTreeList(List<PresentCategory> allPresentCategoryList, PresentCategory p, List<PresentCategory> temp) {
if (temp == null) {
temp = new ArrayList<PresentCategory>();
}
for (PresentCategory presentCategory : allPresentCategoryList) {
PresentCategory parent = presentCategory.getParent();
if ((p == null && parent == null) || (presentCategory != null && parent == p)) {
temp.add(presentCategory);
if (presentCategory.getChildren() != null && presentCategory.getChildren().size() > 0) {
recursivPresentCategoryTreeList(allPresentCategoryList, presentCategory, temp);
}
}
}
return temp;
}
@Override
@Cacheable(modelId = "caching")
public List<PresentCategory> getAll() {
List<PresentCategory> allPresentCategory = presentCategoryDao.getAll();
if (allPresentCategory != null) {
for (PresentCategory presentCategory : allPresentCategory) {
Hibernate.initialize(presentCategory);
}
}
return allPresentCategory;
}
@Override
@CacheFlush(modelId = "flushing")
public void delete(PresentCategory presentCategory) {
presentCategoryDao.delete(presentCategory);
}
@Override
@CacheFlush(modelId = "flushing")
public void delete(String id) {
presentCategoryDao.delete(id);
}
@Override
@CacheFlush(modelId = "flushing")
public void delete(String[] ids) {
presentCategoryDao.delete(ids);
}
@Override
@CacheFlush(modelId = "flushing")
public String save(PresentCategory presentCategory) {
return presentCategoryDao.save(presentCategory);
}
@Override
@CacheFlush(modelId = "flushing")
public void update(PresentCategory presentCategory) {
presentCategoryDao.update(presentCategory);
}
}
|
[
"liyinfeng0520@163.com"
] |
liyinfeng0520@163.com
|
c8154404a2bfb41238b3717edf4055666ae0f2c5
|
ba0657f835fe4a2fb0b0524ad2a38012be172bc8
|
/src/test/java/test/designpatterns/hf/behavioural/decorator/starbuzz/beverage/BeverageBuilder.java
|
0a8cb25b3e9585a02e1c056aeba62650c7b68992
|
[] |
no_license
|
jsdumas/java-dev-practice
|
bc2e29670dd6f1784b3a84f52e526a56a66bbba2
|
db85b830e7927fea863d95f5ea8baf8d3bdc448b
|
refs/heads/master
| 2020-12-02T16:28:41.081765
| 2017-12-08T23:10:53
| 2017-12-08T23:10:53
| 96,547,922
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 838
|
java
|
package test.designpatterns.hf.behavioural.decorator.starbuzz.beverage;
import designpatterns.hf.behavioural.decorator.starbuzz.beverage.Beverage;
import designpatterns.hf.behavioural.decorator.starbuzz.pattern.Mocha;
import designpatterns.hf.behavioural.decorator.starbuzz.pattern.Soy;
import designpatterns.hf.behavioural.decorator.starbuzz.pattern.Whip;
public class BeverageBuilder {
private Beverage houseBlend;
public BeverageBuilder(Beverage houseBlend) {
this.houseBlend = houseBlend;
}
public BeverageBuilder withSoy() {
houseBlend = new Soy(houseBlend);
return this;
}
public BeverageBuilder withMocha() {
houseBlend = new Mocha(houseBlend);
return this;
}
public BeverageBuilder withWhip() {
houseBlend = new Whip(houseBlend);
return this;
}
public Beverage build() {
return houseBlend;
}
}
|
[
"jsdumas@free.fr"
] |
jsdumas@free.fr
|
39ec862f02b3a613717ed1d80a5a0bef5a38e87c
|
d16f17f3b9d0aa12c240d01902a41adba20fad12
|
/src/codeforces/contest1760/ProblemF.java
|
4fe6909e96af727b0e04df8d5ef340d1d849af7d
|
[] |
no_license
|
redsun9/leetcode
|
79f9293b88723d2fd123d9e10977b685d19b2505
|
67d6c16a1b4098277af458849d352b47410518ee
|
refs/heads/master
| 2023-06-23T19:37:42.719681
| 2023-06-09T21:11:39
| 2023-06-09T21:11:39
| 242,967,296
| 38
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,523
|
java
|
package codeforces.contest1760;
import java.util.Arrays;
import java.util.Scanner;
public class ProblemF {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int tests = scanner.nextInt();
for (int t = 0; t < tests; t++) {
int n = scanner.nextInt();
long c = scanner.nextLong();
int d = scanner.nextInt();
int[] quests = new int[n];
for (int i = 0; i < n; i++) quests[i] = scanner.nextInt();
int ans = solve(quests, d, c);
if (ans < 0) System.out.println("Impossible");
else if (ans > d) System.out.println("Infinity");
else System.out.println(ans);
}
}
private static int solve(int[] quests, int d, long c) {
int n = quests.length;
Arrays.sort(quests);
if ((long) quests[n - 1] * d < c) return -1;
long[] prefSum = new long[n + 1];
for (int i = 0, j = n - 1; i < n; i++, j--) prefSum[i + 1] = prefSum[i] + quests[j];
if (n <= d && prefSum[n] >= c || n >= d && prefSum[d] >= c) return d + 1;
int lo = 0, hi = d - 2;
while (lo < hi) {
int mid = lo + (hi - lo + 1) / 2;
if (getVal(prefSum, n, d, mid) >= c) lo = mid;
else hi = mid - 1;
}
return lo;
}
private static long getVal(long[] pref, int n, int d, int k) {
return pref[Math.min(n, k + 1)] * (d / (k + 1)) + pref[Math.min(n, d % (k + 1))];
}
}
|
[
"mokeev.vladimir@gmail.com"
] |
mokeev.vladimir@gmail.com
|
3ca2821b33aa13f46b8fcd3be873b0d82c80256c
|
c6a0f71bc10963e445360392fafc1506cc470404
|
/pride-inspector/tags/0.1.0/pride-viewer/src/main/java/uk/ac/ebi/pride/data/core/Chromatogram.java
|
167776b506b8ac3a45e8f23d1e6d7ceaacc727ca
|
[] |
no_license
|
PRIDE-Toolsuite/old-pride-toolsuite
|
2d93fcef247a42343b661c9e3bf6310389e924fb
|
cac6b82d51b177eabc2c475c2c0e276aa485fd67
|
refs/heads/master
| 2021-01-17T05:56:19.073023
| 2015-03-02T09:59:23
| 2015-03-02T09:59:23
| 33,008,557
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,013
|
java
|
package uk.ac.ebi.pride.data.core;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
/**
* Created by IntelliJ IDEA.
* User: rwang
* Date: 03-Feb-2010
* Time: 09:07:38
*/
public class Chromatogram extends MzGraph {
public Chromatogram(String id,
BigInteger index,
Instrument instrument,
DataProcessing dataProcessing,
int arrLength,
SourceFile sourceFile,
Sample sample,
Date timeStamp,
List<Precursor> precursors,
List<Product> products,
List<BinaryDataArray> binaryArr,
ParamGroup params) {
super(id, index, instrument, dataProcessing,
arrLength, sourceFile, sample, timeStamp,
precursors, products,
binaryArr, params);
}
}
|
[
"harry.r.wang@gmail.com"
] |
harry.r.wang@gmail.com
|
5f8cb56a078dd4e213606eb28689a0869e0273c3
|
25d6acbf88063fe00ccd080c8349318e5af6e74b
|
/src/main/java/com/codeworld/fc/system/user/service/impl/UserDeptServiceImpl.java
|
b14fa1414d0b0fb312ac8b32a92a7f174f97f8c6
|
[] |
no_license
|
javaenigneer/codeworld-api-system
|
bbe31913a8ab2d68c95b00a1d5fc4b34553342f7
|
14f3d8b7cabe1e945f16429b571234d486b5861b
|
refs/heads/master
| 2023-01-28T04:44:17.313771
| 2020-12-07T00:44:13
| 2020-12-07T00:44:13
| 298,988,767
| 12
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,396
|
java
|
package com.codeworld.fc.system.user.service.impl;
import com.codeworld.fc.common.enums.HttpFcStatus;
import com.codeworld.fc.common.enums.HttpMsg;
import com.codeworld.fc.common.response.FCResponse;
import com.codeworld.fc.system.user.entity.User;
import com.codeworld.fc.system.user.entity.UserDept;
import com.codeworld.fc.system.user.mapper.UserDeptMapper;
import com.codeworld.fc.system.user.service.UserDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* ClassName UserDeptServiceImpl
* Description TODO
* Author Lenovo
* Date 2020/10/14
* Version 1.0
**/
@Service
public class UserDeptServiceImpl implements UserDeptService {
@Autowired(required = false)
private UserDeptMapper userDeptMapper;
/**
* 根据用户Id获取部门Id
*
* @param userId
* @return
*/
@Override
public FCResponse<List<UserDept>> getDeptIdByUserId(Long userId) {
if (userId == null || userId <= 0){
return FCResponse.dataResponse(HttpFcStatus.PARAMSERROR.getCode(), HttpMsg.user.USER_ID_ERROR.getMsg(),null);
}
List<UserDept> userDepts = this.userDeptMapper.getDeptIdByUserId(userId);
return FCResponse.dataResponse(HttpFcStatus.DATASUCCESSGET.getCode(),HttpMsg.dept.DEPT_GET_SUCCESS.getMsg(),userDepts);
}
}
|
[
"1692454247@qq.com"
] |
1692454247@qq.com
|
6c674e70e713b4700d2539a28e4f4d828b873859
|
cf64ff59a0292500d65d69fcfb0b42d7e4dba9d8
|
/samples/excel/build/src/excel/ITableStyleElements.java
|
f9d3f2399f9220aebe3381522ddb8ed1b714db9b
|
[
"BSD-2-Clause"
] |
permissive
|
nosdod/CDWriterJava
|
0bb3db2e68278c445b78afc665731e058dc42ea4
|
7146689889d8d50d7162b21ea0b98fc5c2364306
|
refs/heads/main
| 2023-09-06T01:32:33.614647
| 2021-11-23T15:14:42
| 2021-11-23T15:14:42
| 431,142,538
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,650
|
java
|
package excel ;
import com4j.*;
@IID("{000244A6-0001-0000-C000-000000000046}")
public interface ITableStyleElements extends Com4jObject,Iterable<Com4jObject> {
// Methods:
/**
* <p>
* Getter method for the COM property "Application"
* </p>
* @return Returns a value of type excel._Application
*/
@VTID(7)
excel._Application getApplication();
/**
* <p>
* Getter method for the COM property "Creator"
* </p>
* @return Returns a value of type excel.XlCreator
*/
@VTID(8)
excel.XlCreator getCreator();
/**
* <p>
* Getter method for the COM property "Parent"
* </p>
* @return Returns a value of type com4j.Com4jObject
*/
@VTID(9)
@ReturnValue(type=NativeType.Dispatch)
com4j.Com4jObject getParent();
/**
* <p>
* Getter method for the COM property "Count"
* </p>
* @return Returns a value of type int
*/
@VTID(10)
int getCount();
/**
* @param index Mandatory excel.XlTableStyleElementType parameter.
* @return Returns a value of type excel.TableStyleElement
*/
@VTID(11)
excel.TableStyleElement item(
excel.XlTableStyleElementType index);
/**
* <p>
* Getter method for the COM property "_Default"
* </p>
* @param index Mandatory excel.XlTableStyleElementType parameter.
* @return Returns a value of type excel.TableStyleElement
*/
@VTID(12)
@DefaultMethod
excel.TableStyleElement get_Default(
excel.XlTableStyleElementType index);
/**
* <p>
* Getter method for the COM property "_NewEnum"
* </p>
*/
@VTID(13)
java.util.Iterator<Com4jObject> iterator();
// Properties:
}
|
[
"mark.dodson@dodtech.co.uk"
] |
mark.dodson@dodtech.co.uk
|
a4aa01d10aef77e1b8c247c3f3e3f018e9036c49
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/3/3_3dac38138d2c636e1f76bdf8104a14133455515c/PageUrlTag/3_3dac38138d2c636e1f76bdf8104a14133455515c_PageUrlTag_s.java
|
4a1cf6923356912ec07a9470840c56f0cef18b1f
|
[] |
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
| 3,082
|
java
|
/* ===============================================================================
*
* Part of the InfoGlue Content Management Platform (www.infoglue.org)
*
* ===============================================================================
*
* Copyright (C)
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2, as published by the
* Free Software Foundation. See the file LICENSE.html for more information.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY, including 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, write to the Free Software Foundation, Inc. / 59 Temple
* Place, Suite 330 / Boston, MA 02111-1307 / USA.
*
* ===============================================================================
*/
package org.infoglue.deliver.taglib.structure;
import javax.servlet.jsp.JspException;
import org.infoglue.deliver.taglib.TemplateControllerTag;
import org.infoglue.deliver.taglib.component.ComponentLogicTag;
public class PageUrlTag extends ComponentLogicTag {
/**
*
*/
private static final long serialVersionUID = 4050485595074016051L;
private String propertyName;
private boolean useInheritance = true;
private Integer siteNodeId;
private Integer languageId;
private Integer contentId = new Integer(-1);
private String extraParameters;
public PageUrlTag()
{
super();
}
public int doEndTag() throws JspException
{
produceResult(getPageUrl());
return EVAL_PAGE;
}
private String getPageUrl() throws JspException
{
if(this.languageId == null)
this.languageId = getController().getLanguageId();
if(this.propertyName != null)
return getComponentLogic().getPageUrl(propertyName, contentId, languageId, useInheritance);
else
return getController().getPageUrl(siteNodeId, languageId, contentId);
}
public void setSiteNodeId(final String siteNodeId) throws JspException
{
this.siteNodeId = evaluateInteger("pageUrl", "siteNodeId", siteNodeId);
}
public void setLanguageId(final String languageId) throws JspException
{
this.languageId = evaluateInteger("pageUrl", "languageId", languageId);
}
public void setContentId(final String contentId) throws JspException
{
this.contentId = evaluateInteger("pageUrl", "contentId", contentId);
}
public void setPropertyName(String propertyName)
{
this.propertyName = propertyName;
}
public void setUseInheritance(boolean useInheritance)
{
this.useInheritance = useInheritance;
}
public void setExtraParameters(String extraParameters)
{
this.extraParameters = extraParameters;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
e1a92bb49005f52dd97f34d4811e8e6faa3b934b
|
c10792907346756ab025f4586b6f34a40568df5c
|
/andengine/src/main/java/org/andengine/engine/handler/timer/ITimerCallback.java
|
f21796d24d7ffd388ed5eab50e5dbae269a01c5f
|
[
"Apache-2.0"
] |
permissive
|
triplesky/AndEngineExample
|
1753f5f663e2e2a3532f8f5960c3f8c3258309a1
|
c4478e45f6554faf415af23c38961961f4c0950f
|
refs/heads/master
| 2023-03-15T14:27:18.853722
| 2020-10-25T01:44:38
| 2020-10-25T01:44:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 269
|
java
|
package org.andengine.engine.handler.timer;
/**
* (c) 2010 Nicolas Gramlich
* (c) 2011 Zynga Inc.
*
* @author Nicolas Gramlich
* @since 16:23:25 - 12.03.2010
*/
public interface ITimerCallback {
public void onTimePassed(final TimerHandler pTimerHandler);
}
|
[
"731620591@qq.com"
] |
731620591@qq.com
|
3064d6ef3266b9de14844bd0ba9ea4f2116c9eb5
|
67cbc9c5125df76324d78624e2281cb1fefc8a12
|
/application/src/main/java/org/mifos/application/master/business/CustomValueListElement.java
|
7c88617920f7f6ec3455be1063067b5a37b7a0af
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
mifos/1.5.x
|
86e785c062cb14be4597b33d15c38670c176120e
|
5734370912c47973de3889db21debb3ff7f0f6db
|
refs/heads/master
| 2023-08-28T09:48:46.266018
| 2010-07-12T04:43:46
| 2010-07-12T04:43:46
| 2,946,757
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,115
|
java
|
/*
* Copyright (c) 2005-2010 Grameen Foundation USA
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
* See also http://www.apache.org/licenses/LICENSE-2.0.html for an
* explanation of the license and how it is applied.
*/
package org.mifos.application.master.business;
import java.io.Serializable;
import org.mifos.application.master.MessageLookup;
import org.mifos.framework.business.View;
/**
* It is unclear why this class extends View. Note that the class
* {@link BusinessActivityEntity} serves the same purpose but doesn't include
* the additional id. A CustomValueListElement represents a
* {@link CustomValueList} element for a given locale. This corresponds to a
* {@link LookUpValueEntity} with the text pulled in from a
* {@link LookUpValueLocaleEntity} for a given locale.
*
* A better name for this class might be ValueListElementForLocale.
*/
public class CustomValueListElement extends View implements Serializable {
/**
* The id of an associated object linked to this list element. This only
* appears to be used with {@link CustomerAttendanceType} for use related to
* bulk entry.
*/
private Integer associatedId;
/**
* The id of the {@link LookUpValueEntity} corresponding to this value list
* element
*/
private Integer lookUpId;
/**
* The text value of this list element for a given locale (from the
* {@link LookUpValueLocaleEntity})
*/
private String lookUpValue;
/**
* The text value of the key from {@link LookUpValueEntity} for looking up
* text in a given locale.)
*/
private String lookUpValueKey;
public CustomValueListElement() {
}
public CustomValueListElement(java.lang.Integer lookUpId, String lookUpValue, String lookUpValueKey) {
this.lookUpId = lookUpId;
this.lookUpValue = lookUpValue;
this.lookUpValueKey = lookUpValueKey;
}
/**
* Possibly used in MasterPersistence.getCustomValueListElements
*/
public CustomValueListElement(java.lang.Short id, java.lang.Integer lookUpId, String lookUpValue,
String lookUpValueKey) {
this.lookUpId = lookUpId;
this.lookUpValue = lookUpValue;
this.associatedId = id.intValue();
this.lookUpValueKey = lookUpValueKey;
}
/**
* Possibly used in MasterPersistence.getCustomValueListElements
*/
public CustomValueListElement(java.lang.Integer id, java.lang.Integer lookUpId, String lookUpValue) {
this.lookUpId = lookUpId;
this.lookUpValue = lookUpValue;
this.associatedId = id;
}
/**
* This method is used in some places, but it is unclear if the id value is
* ever set.
*/
public java.lang.Integer getAssociatedId() {
return associatedId;
}
public java.lang.Integer getLookUpId() {
return lookUpId;
}
/*
* Use the key for the LookUpValueEntity to resolve the value.
*/
public java.lang.String getLookUpValue() {
return MessageLookup.getInstance().lookup(lookUpValueKey);
}
public void setLookupValue(String newValue) {
lookUpValue = newValue;
}
public String getName() {
return getLookUpValue();
}
public Integer getId() {
return lookUpId;
}
public void setId(Integer id) {
lookUpId = id;
}
public String getLookUpValueKey() {
return lookUpValueKey;
}
public void setLookUpValueKey(String lookUpValueKey) {
this.lookUpValueKey = lookUpValueKey;
}
}
|
[
"meonkeys@a8845c50-7012-0410-95d3-8e1449b9b1e4"
] |
meonkeys@a8845c50-7012-0410-95d3-8e1449b9b1e4
|
d1681619080f86df29021ea281d55b084ea2d628
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/1/1_e9b53475ce1f481bdeb98b29571126fec95b6c35/Text/1_e9b53475ce1f481bdeb98b29571126fec95b6c35_Text_s.java
|
6832f1402b73eea045e40fe7b09fb9beb17b1cee
|
[] |
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,914
|
java
|
/*
* Copyright 2010 The MITRE Corporation (http://www.mitre.org/). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mitre.medcafe.util;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex .*;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.*;
/**
* Representation of the text data
* @author: Jeffrey Hoyt
*/
public class Text
{
private String patientId = "";
private String userId = "";
private String title = "";
private String text = "";
public static final String SAVE_TEXT_INSERT = "INSERT INTO user_text (username, patient_id, subject, note) values (?,?,?,?)";
public static final String SAVE_TEXT_UPDATE = "UPDATE user_text SET note = ? where username = ? and patient_id = ? and subject = ?";
public static final String SAVE_TEXT_SELECT_CNT = "SELECT count(*) from user_text where username = ? and patient_id = ? and subject = ?";
public static final String SAVE_TEXT_SELECT = "SELECT note, note_added from user_text where username = ? and patient_id = ? and subject = ?";
public static final String SAVE_TEXTS_SELECT = "SELECT subject, note, note_added from user_text where username = ? and patient_id = ? ";
public static final String SAVE_TEXT_DELETE = "DELETE from user_text where username = ? and patient_id = ? and subject= ?";
public Text(String patientId, String userId, String title, String text)
{
this(patientId, userId, title);
this.text = text;
}
public Text(String patientId, String userId, String title)
{
this(patientId, userId);
this.title = title;
}
public Text(String patientId, String userId)
{
this.patientId = patientId;
this.userId = userId;
}
public String getPatientId() {
return patientId;
}
public void setPatientId(String patientId) {
this.patientId = patientId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
0477f022594136a0f388c9e329b60e0a5da375d8
|
fb0e19758824bbbd5dda39a8ef911e5590eb1841
|
/gper-pattern/src/main/java/vip/designpattern/decorator/battercake/v1/BattercakeWithEgg.java
|
5c231495c562d49fc6f0e538ed7c88a4db4dad34
|
[] |
no_license
|
aqqje/bexercise
|
e16ceefd5a89ce75e20fa419e212ffaf15ff5a5f
|
bcc6a52d147d5b910cd4d495501bb986007168f3
|
refs/heads/master
| 2022-12-23T17:42:58.965990
| 2021-05-02T10:45:34
| 2021-05-02T10:45:34
| 182,517,809
| 0
| 0
| null | 2022-12-16T15:45:43
| 2019-04-21T10:07:28
|
Java
|
UTF-8
|
Java
| false
| false
| 264
|
java
|
package vip.designpattern.decorator.battercake.v1;
/**
* Created by Tom.
*/
public class BattercakeWithEgg extends Battercake {
protected String getMsg(){ return super.getMsg() + "+1个鸡蛋";}
public int getPrice(){ return super.getPrice() + 1;}
}
|
[
"1042136232@qq.com"
] |
1042136232@qq.com
|
c1a4c73c2da2ed792ebfcb6d08f162d0779f5210
|
15af49c89103f1e3c565514f927a34d74a0a078d
|
/disco-test/disco-normal-code-tests/src/test/java/uk/co/exemel/disco/tests/updatedcomponenttests/standardtesting/rest/RestPostRequestTypesDateTimeMapJSON24HoursTest.java
|
a8cf8a59cff466f98e2ccb9315079029e650270c
|
[
"Apache-2.0"
] |
permissive
|
fossabot/disco
|
d09f7ad42231882f7cab8e802848396801780058
|
fa24f0e05d14aac8b5a63d435e45febe8444ad5e
|
refs/heads/master
| 2020-03-12T04:26:52.096334
| 2018-04-21T06:05:19
| 2018-04-21T06:05:19
| 130,445,041
| 0
| 0
| null | 2018-04-21T06:05:18
| 2018-04-21T06:05:18
| null |
UTF-8
|
Java
| false
| false
| 5,524
|
java
|
/*
* Copyright 2013, The Sporting Exchange Limited
*
* 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.
*/
// Originally from UpdatedComponentTests/StandardTesting/REST/Rest_Post_RequestTypes_DateTimeMap_JSON_24Hours.xls;
package uk.co.exemel.disco.tests.updatedcomponenttests.standardtesting.rest;
import uk.co.exemel.testing.utils.disco.misc.XMLHelpers;
import uk.co.exemel.testing.utils.JSONHelpers;
import uk.co.exemel.testing.utils.disco.assertions.AssertionUtils;
import uk.co.exemel.testing.utils.disco.beans.HttpCallBean;
import uk.co.exemel.testing.utils.disco.beans.HttpResponseBean;
import uk.co.exemel.testing.utils.disco.enums.DiscoMessageContentTypeEnum;
import uk.co.exemel.testing.utils.disco.enums.DiscoMessageProtocolRequestTypeEnum;
import uk.co.exemel.testing.utils.disco.enums.DiscoMessageProtocolResponseTypeEnum;
import uk.co.exemel.testing.utils.disco.manager.AccessLogRequirement;
import uk.co.exemel.testing.utils.disco.manager.DiscoManager;
import org.json.JSONObject;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.ByteArrayInputStream;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;
/**
* Ensure that Disco can't handle the dateTimeMap data type in the post body of a JSON request containing a date with the time set to 24:00:00 (will rolll to 00:00:00 the next day)
*/
public class RestPostRequestTypesDateTimeMapJSON24HoursTest {
@Test
public void doTest() throws Exception {
// Set up the Http Call Bean to make the request
DiscoManager discoManager1 = DiscoManager.getInstance();
HttpCallBean hbean = discoManager1.getNewHttpCallBean("87.248.113.14");
DiscoManager hinstance = discoManager1;
discoManager1.setDiscoFaultControllerJMXMBeanAttrbiute("DetailedFaults","false");
try {
hbean.setOperationName("dateTimeMapOperation");
hbean.setServiceName("baseline", "discoBaseline");
hbean.setVersion("v2");
// Set the post body to contain a date time map object
Map map4 = new HashMap();
map4.put("RESTJSON","{\"message\":{\"dateTimeMap\":{ \n\"date1\":\"2009-06-01T24:00:00.0Z\", \"date2\":\"2009-07-01T24:00:00.0Z\"} \n}}");
hbean.setPostQueryObjects(map4);
// Get current time for getting log entries later
Timestamp getTimeAsTimeStamp11 = new Timestamp(System.currentTimeMillis());
// Make JSON call to the operation requesting an XML response
hinstance.makeRestDiscoHTTPCall(hbean, DiscoMessageProtocolRequestTypeEnum.RESTJSON, DiscoMessageContentTypeEnum.XML);
// Make JSON call to the operation requesting a JSON response
hinstance.makeRestDiscoHTTPCall(hbean, DiscoMessageProtocolRequestTypeEnum.RESTJSON, DiscoMessageContentTypeEnum.JSON);
// Create the expected response as an XML document (using the date object created earlier)
XMLHelpers xMLHelpers6 = new XMLHelpers();
Document expectedResponseXML = xMLHelpers6.createAsDocument(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(("<fault><faultcode>Client</faultcode><faultstring>DSC-0044</faultstring><detail/></fault>").getBytes())));
// Create the expected response as a JSON object (using the date object created earlier)
JSONHelpers jSONHelpers7 = new JSONHelpers();
JSONObject expectedResponseJSON = jSONHelpers7.createAsJSONObject(new JSONObject("{\"detail\":{},\"faultcode\":\"Client\",\"faultstring\":\"DSC-0044\"}"));
// Check the 2 responses are as expected
HttpResponseBean response8 = hbean.getResponseObjectsByEnum(DiscoMessageProtocolResponseTypeEnum.RESTJSONXML);
AssertionUtils.multiAssertEquals(expectedResponseXML, response8.getResponseObject());
AssertionUtils.multiAssertEquals((int) 400, response8.getHttpStatusCode());
AssertionUtils.multiAssertEquals("Bad Request", response8.getHttpStatusText());
HttpResponseBean response9 = hbean.getResponseObjectsByEnum(DiscoMessageProtocolResponseTypeEnum.RESTJSONJSON);
AssertionUtils.multiAssertEquals(expectedResponseJSON, response9.getResponseObject());
AssertionUtils.multiAssertEquals((int) 400, response9.getHttpStatusCode());
AssertionUtils.multiAssertEquals("Bad Request", response9.getHttpStatusText());
// Check the log entries are as expected
discoManager1.verifyAccessLogEntriesAfterDate(getTimeAsTimeStamp11, new AccessLogRequirement("87.248.113.14", "/discoBaseline/v2/dateTimeMapOperation", "BadRequest"),new AccessLogRequirement("87.248.113.14", "/discoBaseline/v2/dateTimeMapOperation", "BadRequest") );
}
finally {
discoManager1.setDiscoFaultControllerJMXMBeanAttrbiute("DetailedFaults","true");
}
}
}
|
[
"simon@exemel.co.uk"
] |
simon@exemel.co.uk
|
b99df996eb896483aa177b0afa85a328be1f6ed7
|
71b912e47ad8e73a651c79670a8a9377eaff2110
|
/lac3/lac3-core/src/main/java/com/linkallcloud/core/spring/SpringContextHolder.java
|
da5e4e1f350b0c518f819d61b79097b261fe7c70
|
[] |
no_license
|
jasonzhoumj/lac3
|
5f47cc227e631fd1be201e005ab9f3bbac5431bf
|
fba08c10693f5745914d446222718cfacec3def9
|
refs/heads/master
| 2021-03-28T12:55:26.875522
| 2020-03-11T01:28:52
| 2020-03-11T01:28:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,696
|
java
|
package com.linkallcloud.core.spring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/**
* @Description: 以静态变量保存Spring ApplicationContext, 可在任何代码任何地方任何时候中取出ApplicaitonContext.
*/
public class SpringContextHolder implements ApplicationContextAware {
private static ApplicationContext applicationContext;
/**
* 实现ApplicationContextAware接口的context注入函数, 将其存入静态变量.
*/
public void setApplicationContext(ApplicationContext applicationContext) {
SpringContextHolder.applicationContext = applicationContext;
}
/**
* 取得存储在静态变量中的ApplicationContext.
*/
public static ApplicationContext getApplicationContext() {
checkApplicationContext();
return applicationContext;
}
/**
* 从静态变量ApplicationContext中取得Bean, 自动转型为所赋值对象的类型.
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) {
checkApplicationContext();
return (T) applicationContext.getBean(name);
}
/**
* 从静态变量ApplicationContext中取得Bean, 自动转型为所赋值对象的类型.
*/
public static <T> T getBean(Class<T> clazz) {
checkApplicationContext();
return applicationContext.getBean(clazz);
}
private static void checkApplicationContext() {
if (applicationContext == null) {
throw new IllegalStateException("applicaitonContext未注入,请在applicationContext.xml中定义SpringContextHolder");
}
}
}
|
[
"838485220@qq.com"
] |
838485220@qq.com
|
3de4b5b9827ac2ace6e7c9f60bc72a4d13e6aff1
|
229f62e5dda59c4e9d1be17fae6ffd3635ceb0f3
|
/app/src/main/java/com/gdlife/candypie/serivce/UploadService.java
|
54016a94b9dd42360f8ec052fa5647ba250ccdc0
|
[] |
no_license
|
heboot/Candypie
|
c180ec247f481da8b5d38f2fc3f2ac1711c2e0dd
|
3c89919e201c0916c6b8cd000ac3fc0e6496f38d
|
refs/heads/master
| 2021-07-05T09:20:15.602412
| 2019-04-08T12:59:21
| 2019-04-08T12:59:21
| 145,056,641
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,067
|
java
|
package com.gdlife.candypie.serivce;
import com.alibaba.sdk.android.oss.ClientException;
import com.alibaba.sdk.android.oss.ServiceException;
import com.alibaba.sdk.android.oss.callback.OSSCompletedCallback;
import com.alibaba.sdk.android.oss.model.OSSRequest;
import com.alibaba.sdk.android.oss.model.OSSResult;
import com.gdlife.candypie.utils.ImageUtils;
import com.gdlife.candypie.utils.OssUtils;
import com.heboot.req.UploadAvatarReq;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Observer;
import static io.reactivex.Observable.create;
/**
* Created by heboot on 2018/3/9.
*/
public class UploadService {
/**
* 上传头像
*
* @param avatarPath 头像路径
*/
public static void doUploadAvatar(String avatarPath, Observer<UploadAvatarReq> subscriber) {
//头像的阿里objectKey
String avatarObjectKey = ImageUtils.getImageUploadName(avatarPath);
OssUtils.getInstance().uploadFile(avatarObjectKey, new OSSCompletedCallback() {
@Override
public void onSuccess(OSSRequest ossRequest, OSSResult ossResult) {
int[] avatarWH = ImageUtils.getImageWH(avatarPath);
File picFile = new File(avatarPath);
UploadAvatarReq req = new UploadAvatarReq(".jpg", avatarWH[1], avatarWH[0], avatarObjectKey.substring(7, avatarObjectKey.length()), picFile.length());
subscriber.onNext(req);
}
@Override
public void onFailure(OSSRequest ossRequest, ClientException e, ServiceException e1) {
subscriber.onError(e);
}
}, avatarPath);
}
public static Observable<UploadAvatarReq> doUploadAvatar(String avatarPath) {
String avatarObjectKey = ImageUtils.getImageUploadName(avatarPath);
return Observable.create(new ObservableOnSubscribe<UploadAvatarReq>() {
@Override
public void subscribe(ObservableEmitter<UploadAvatarReq> emitter) throws Exception {
OssUtils.getInstance().uploadFile(avatarObjectKey, new OSSCompletedCallback() {
@Override
public void onSuccess(OSSRequest ossRequest, OSSResult ossResult) {
int[] avatarWH = ImageUtils.getImageWH(avatarPath);
File picFile = new File(avatarPath);
UploadAvatarReq req = new UploadAvatarReq(".jpg", avatarWH[1], avatarWH[0], avatarObjectKey.substring(7, avatarObjectKey.length()), picFile.length());
emitter.onNext(req);
}
@Override
public void onFailure(OSSRequest ossRequest, ClientException e, ServiceException e1) {
emitter.onError(e);
}
}, avatarPath);
}
});
}
}
|
[
"heboot@126.com"
] |
heboot@126.com
|
179a1f653ecac0e45688e52c1f7cf6f27ad4933a
|
cd2bdcb938a985852d3e46b508ca587f8127613c
|
/java/core/src/main/java/com/google/protobuf/MapFieldBuilder.java
|
84ac1b08415370fe94b3afce024179d079697ae2
|
[
"LicenseRef-scancode-protobuf"
] |
permissive
|
ksikorsk/protobuf
|
02bb108aa4d7a73ba708ba9bb577a1c166802348
|
4cc258a6a1cb6d3e526e3ca2f6ab7748ee84e2e3
|
refs/heads/master
| 2023-08-03T06:48:42.140584
| 2023-07-20T20:00:35
| 2023-07-20T20:09:55
| 265,636,136
| 0
| 0
|
NOASSERTION
| 2020-05-20T17:17:49
| 2020-05-20T17:17:48
| null |
UTF-8
|
Java
| false
| false
| 7,912
|
java
|
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.protobuf;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
/**
* Internal representation of map fields in generated builders.
*
* <p>This class supports accessing the map field as a {@link Map} to be used in generated API and
* also supports accessing the field as a {@link List} to be used in reflection API. It keeps track
* of where the data is currently stored and do necessary conversions between map and list.
*
* <p>This class is a protobuf implementation detail. Users shouldn't use this class directly.
*/
public class MapFieldBuilder<
KeyT,
MessageOrBuilderT extends MessageOrBuilder,
MessageT extends MessageOrBuilderT,
BuilderT extends MessageOrBuilderT>
extends MapFieldReflectionAccessor {
// Only one of the three fields may be non-null at any time.
/** nullable */
Map<KeyT, MessageOrBuilderT> builderMap = new LinkedHashMap<>();
/** nullable */
Map<KeyT, MessageT> messageMap = null;
// messageList elements are always MapEntry<KeyT, MessageT>, but we need a List<Message> for
// reflection.
/** nullable */
List<Message> messageList = null;
Converter<KeyT, MessageOrBuilderT, MessageT> converter;
/** Convert a MessageOrBuilder to a Message regardless of which it holds. */
public interface Converter<
KeyT, MessageOrBuilderT extends MessageOrBuilder, MessageT extends MessageOrBuilderT> {
MessageT build(MessageOrBuilderT val);
MapEntry<KeyT, MessageT> defaultEntry();
}
public MapFieldBuilder(Converter<KeyT, MessageOrBuilderT, MessageT> converter) {
this.converter = converter;
}
@SuppressWarnings("unchecked")
private void forEachListEntry(BiConsumer<KeyT, MessageT> f) {
messageList.forEach(
entry -> {
MapEntry<KeyT, MessageT> typedEntry = (MapEntry<KeyT, MessageT>) entry;
f.accept(typedEntry.getKey(), typedEntry.getValue());
});
}
public Map<KeyT, MessageOrBuilderT> ensureBuilderMap() {
if (builderMap != null) {
return builderMap;
}
if (messageMap != null) {
builderMap = new LinkedHashMap<>(messageMap.size());
messageMap.forEach((key, value) -> builderMap.put(key, value));
messageMap = null;
return builderMap;
}
builderMap = new LinkedHashMap<>(messageList.size());
forEachListEntry((key, value) -> builderMap.put(key, value));
messageList = null;
return builderMap;
}
public List<Message> ensureMessageList() {
if (messageList != null) {
return messageList;
}
if (builderMap != null) {
messageList = new ArrayList<>(builderMap.size());
builderMap.forEach(
(key, value) ->
messageList.add(
converter.defaultEntry().toBuilder()
.setKey(key)
.setValue(converter.build(value))
.build()));
builderMap = null;
return messageList;
}
messageList = new ArrayList<>(messageMap.size());
messageMap.forEach(
(key, value) ->
messageList.add(
converter.defaultEntry().toBuilder().setKey(key).setValue(value).build()));
messageMap = null;
return messageList;
}
public Map<KeyT, MessageT> ensureMessageMap() {
messageMap = populateMutableMap();
builderMap = null;
messageList = null;
return messageMap;
}
public Map<KeyT, MessageT> getImmutableMap() {
return new MapField.MutabilityAwareMap<>(MutabilityOracle.IMMUTABLE, populateMutableMap());
}
private Map<KeyT, MessageT> populateMutableMap() {
if (messageMap != null) {
return messageMap;
}
if (builderMap != null) {
Map<KeyT, MessageT> toReturn = new LinkedHashMap<>(builderMap.size());
builderMap.forEach((key, value) -> toReturn.put(key, converter.build(value)));
return toReturn;
}
Map<KeyT, MessageT> toReturn = new LinkedHashMap<>(messageList.size());
forEachListEntry((key, value) -> toReturn.put(key, value));
return toReturn;
}
public void mergeFrom(MapField<KeyT, MessageT> other) {
ensureBuilderMap().putAll(MapFieldLite.copy(other.getMap()));
}
public void clear() {
builderMap = new LinkedHashMap<>();
messageMap = null;
messageList = null;
}
private boolean typedEquals(MapFieldBuilder<KeyT, MessageOrBuilderT, MessageT, BuilderT> other) {
return MapFieldLite.<KeyT, MessageOrBuilderT>equals(
ensureBuilderMap(), other.ensureBuilderMap());
}
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object object) {
if (!(object instanceof MapFieldBuilder)) {
return false;
}
return typedEquals((MapFieldBuilder<KeyT, MessageOrBuilderT, MessageT, BuilderT>) object);
}
@Override
public int hashCode() {
return MapFieldLite.<KeyT, MessageOrBuilderT>calculateHashCodeForMap(ensureBuilderMap());
}
/** Returns a deep copy of this MapFieldBuilder. */
public MapFieldBuilder<KeyT, MessageOrBuilderT, MessageT, BuilderT> copy() {
MapFieldBuilder<KeyT, MessageOrBuilderT, MessageT, BuilderT> clone =
new MapFieldBuilder<>(converter);
clone.ensureBuilderMap().putAll(ensureBuilderMap());
return clone;
}
/** Converts this MapFieldBuilder to a MapField. */
public MapField<KeyT, MessageT> build(MapEntry<KeyT, MessageT> defaultEntry) {
MapField<KeyT, MessageT> mapField = MapField.newMapField(defaultEntry);
Map<KeyT, MessageT> map = mapField.getMutableMap();
ensureBuilderMap().forEach((key, value) -> map.put(key, converter.build(value)));
mapField.makeImmutable();
return mapField;
}
// MapFieldReflectionAccessor implementation.
/** Gets the content of this MapField as a read-only List. */
@Override
List<Message> getList() {
return ensureMessageList();
}
/** Gets a mutable List view of this MapField. */
@Override
List<Message> getMutableList() {
return ensureMessageList();
}
/** Gets the default instance of the message stored in the list view of this map field. */
@Override
Message getMapEntryMessageDefaultInstance() {
return converter.defaultEntry();
}
}
|
[
"copybara-worker@google.com"
] |
copybara-worker@google.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.