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
6d1114befec59b04342af54a25a2f7e6eefba443
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/27/27_b2a1dbc353c1dc5577b1cbb3abb25fcd012017cf/DynECTConnection/27_b2a1dbc353c1dc5577b1cbb3abb25fcd012017cf_DynECTConnection_s.java
b4ca2359d8332436e6772673cae977f4549b2f08
[]
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
926
java
package denominator.dynect; import static com.google.common.base.Strings.emptyToNull; import static denominator.CredentialsConfiguration.credentials; import static java.lang.System.getProperty; import denominator.DNSApiManager; import denominator.Denominator; public class DynECTConnection { final DNSApiManager manager; final String mutableZone; DynECTConnection() { String customer = emptyToNull(getProperty("dynect.customer")); String username = emptyToNull(getProperty("dynect.username")); String password = emptyToNull(getProperty("dynect.password")); if (customer != null && username != null && password != null) { manager = Denominator.create(new DynECTProvider(), credentials(customer, username, password)); } else { manager = null; } mutableZone = emptyToNull(getProperty("dynect.zone")); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1c961b368abbc0f5e12a523bb10806c4d7e2a6ab
23111dd86c4b9da73cffd756489d63246572c020
/app/src/main/java/com/xq/myaliwxpay/wxpay/uikit/AlertAdapter.java
7f785b12edd7b5d21957c3bbd83a690328ab18d1
[]
no_license
Ablexq/MyAliWxPay
8dff01857c494271f1c1e93dc4f35256a906f323
bee4a3c5086caea4ecd69d7b8ec4af6c18b9f8df
refs/heads/master
2020-04-10T03:38:48.197860
2018-12-07T05:40:57
2018-12-07T05:40:57
160,776,402
0
0
null
null
null
null
UTF-8
Java
false
false
3,142
java
package com.xq.myaliwxpay.wxpay.uikit; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.xq.myaliwxpay.R; import com.xq.myaliwxpay.wxpay.Util; import java.util.ArrayList; import java.util.List; /** * Created by lenovo on 2018/12/7. */ class AlertAdapter extends BaseAdapter { // private static final String TAG = "AlertAdapter"; public static final int TYPE_BUTTON = 0; public static final int TYPE_TITLE = 1; public static final int TYPE_EXIT = 2; public static final int TYPE_CANCEL = 3; private List<String> items; private int[] types; // private boolean isSpecial = false; private boolean isTitle = false; // private boolean isExit = false; private Context context; public AlertAdapter(Context context, String title, String[] items, String exit, String cancel) { if (items == null || items.length == 0) { this.items = new ArrayList<String>(); } else { this.items = Util.stringsToList(items); } this.types = new int[this.items.size() + 3]; this.context = context; if (title != null && !title.equals("")) { types[0] = TYPE_TITLE; this.isTitle = true; this.items.add(0, title); } if (exit != null && !exit.equals("")) { // this.isExit = true; types[this.items.size()] = TYPE_EXIT; this.items.add(exit); } if (cancel != null && !cancel.equals("")) { // this.isSpecial = true; types[this.items.size()] = TYPE_CANCEL; this.items.add(cancel); } } @Override public int getCount() { return items.size(); } @Override public Object getItem(int position) { return items.get(position); } @Override public long getItemId(int position) { return 0; } @Override public boolean isEnabled(int position) { if (position == 0 && isTitle) { return false; } else { return super.isEnabled(position); } } @Override public View getView(int position, View convertView, ViewGroup parent) { final String textString = (String) getItem(position); ViewHolder holder; int type = types[position]; if (convertView == null || ((ViewHolder) convertView.getTag()).type != type) { holder = new ViewHolder(); if (type == TYPE_CANCEL) { convertView = View.inflate(context, R.layout.alert_dialog_menu_list_layout_cancel, null); } else if (type == TYPE_BUTTON) { convertView = View.inflate(context, R.layout.alert_dialog_menu_list_layout, null); } else if (type == TYPE_TITLE) { convertView = View.inflate(context, R.layout.alert_dialog_menu_list_layout_title, null); } else if (type == TYPE_EXIT) { convertView = View.inflate(context, R.layout.alert_dialog_menu_list_layout_special, null); } // holder.view = (LinearLayout) convertView.findViewById(R.id.popup_layout); holder.text = (TextView) convertView.findViewById(R.id.popup_text); holder.type = type; convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.text.setText(textString); return convertView; } static class ViewHolder { // LinearLayout view; TextView text; int type; } }
[ "776356314@qq.com" ]
776356314@qq.com
6c1fcc6073194e3c468b497b78a38f2e8808e384
3f79f02b44eb2f47df05b754a0d63e5347ca754a
/contrib/scripting/org.apache.sling.scripting.thymeleaf/src/main/java/org/apache/sling/scripting/thymeleaf/internal/SlingResourceTemplateResolver.java
790cfdcc1cb868a1938e2ae1fc68c2ff6d8880bb
[ "Apache-2.0", "JSON" ]
permissive
bjoernweide/sling
cc1afe32c46cf2bc1cb6fff2013c20765b3c7d39
d433c81768937ec7fb8eee196387331df2d57e40
refs/heads/trunk
2021-01-13T16:19:15.150216
2017-01-25T19:07:00
2017-01-25T19:07:00
80,058,317
0
0
null
2017-01-25T21:11:13
2017-01-25T21:11:13
null
UTF-8
Java
false
false
5,511
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.sling.scripting.thymeleaf.internal; import java.util.Map; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.scripting.thymeleaf.SlingContext; import org.apache.sling.scripting.thymeleaf.TemplateModeProvider; import org.osgi.framework.Constants; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; import org.osgi.service.component.annotations.Modified; import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ReferenceCardinality; import org.osgi.service.component.annotations.ReferencePolicy; import org.osgi.service.component.annotations.ReferencePolicyOption; import org.osgi.service.metatype.annotations.Designate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.thymeleaf.IEngineConfiguration; import org.thymeleaf.cache.ICacheEntryValidity; import org.thymeleaf.cache.NonCacheableCacheEntryValidity; import org.thymeleaf.context.IContext; import org.thymeleaf.templatemode.TemplateMode; import org.thymeleaf.templateresolver.ITemplateResolver; import org.thymeleaf.templateresolver.TemplateResolution; import org.thymeleaf.templateresource.ITemplateResource; @Component( immediate = true, property = { Constants.SERVICE_DESCRIPTION + "=Sling Resource TemplateResolver for Sling Scripting Thymeleaf", Constants.SERVICE_VENDOR + "=The Apache Software Foundation" } ) @Designate( ocd = SlingResourceTemplateResolverConfiguration.class ) public class SlingResourceTemplateResolver implements ITemplateResolver { @Reference( cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY, bind = "setTemplateModeProvider", unbind = "unsetTemplateModeProvider" ) private volatile TemplateModeProvider templateModeProvider; private SlingResourceTemplateResolverConfiguration configuration; private final Logger logger = LoggerFactory.getLogger(SlingResourceTemplateResolver.class); public SlingResourceTemplateResolver() { } public void setTemplateModeProvider(final TemplateModeProvider templateModeProvider) { logger.debug("setting template mode provider: {}", templateModeProvider); } public void unsetTemplateModeProvider(final TemplateModeProvider templateModeProvider) { logger.debug("unsetting template mode provider: {}", templateModeProvider); } @Activate private void activate(final SlingResourceTemplateResolverConfiguration configuration) { logger.debug("activating"); this.configuration = configuration; } @Modified private void modified(final SlingResourceTemplateResolverConfiguration configuration) { logger.debug("modifying"); this.configuration = configuration; } @Deactivate private void deactivate() { logger.debug("deactivating"); } @Override public String getName() { return getClass().getName(); } @Override public Integer getOrder() { return configuration.order(); } @Override public TemplateResolution resolveTemplate(final IEngineConfiguration engineConfiguration, final IContext context, final String ownerTemplate, final String template, final Map<String, Object> templateResolutionAttributes) { logger.debug("resolving template '{}'", template); if (context instanceof SlingContext) { final SlingContext slingContext = (SlingContext) context; final ResourceResolver resourceResolver = slingContext.getResourceResolver(); final Resource resource = resourceResolver.getResource(template); final ITemplateResource templateResource = new SlingTemplateResource(resource); final boolean templateResourceExistenceVerified = false; final TemplateMode templateMode = templateModeProvider.provideTemplateMode(resource); logger.debug("using template mode {} for template '{}'", templateMode, template); final boolean useDecoupledLogic = templateMode.isMarkup() && configuration.useDecoupledLogic(); final ICacheEntryValidity validity = NonCacheableCacheEntryValidity.INSTANCE; return new TemplateResolution(templateResource, templateResourceExistenceVerified, templateMode, useDecoupledLogic, validity); } else { logger.error("context is not an instance of SlingContext"); return null; } } }
[ "olli@apache.org" ]
olli@apache.org
a4db61c3ac82ecedf05bdd355297115bd7b8a263
0adcb787c2d7b3bbf81f066526b49653f9c8db40
/src/main/java/com/alipay/api/response/AlipayEcoMycarParkingCardbarcodeCreateResponse.java
1729e616b8b44f53f0b244c6954535168ccda916
[ "Apache-2.0" ]
permissive
yikey/alipay-sdk-java-all
1cdca570c1184778c6f3cad16fe0bcb6e02d2484
91d84898512c5a4b29c707b0d8d0cd972610b79b
refs/heads/master
2020-05-22T13:40:11.064476
2019-04-11T14:11:02
2019-04-11T14:11:02
186,365,665
1
0
null
2019-05-13T07:16:09
2019-05-13T07:16:08
null
UTF-8
Java
false
false
836
java
package com.alipay.api.response; import java.util.List; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; import com.alipay.api.domain.QRcode; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.eco.mycar.parking.cardbarcode.create response. * * @author auto create * @since 1.0, 2019-03-28 10:39:17 */ public class AlipayEcoMycarParkingCardbarcodeCreateResponse extends AlipayResponse { private static final long serialVersionUID = 8253422646825458482L; /** * 停车车卡对应二维码列表 */ @ApiListField("qrcodes") @ApiField("q_rcode") private List<QRcode> qrcodes; public void setQrcodes(List<QRcode> qrcodes) { this.qrcodes = qrcodes; } public List<QRcode> getQrcodes( ) { return this.qrcodes; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
cab6a2df8e56b7d3b6271550d8c61c7b248d84f8
01756c52a70301f867aa2242de456b61690cdadf
/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/message/MessageNonInterruptingBoundaryEventTest.java
72e415a7ae5081b0391db38a1cb7c3cd164c3540
[ "Apache-2.0" ]
permissive
chenlingyx/activitiUI
fe518348c3c50a26c47379c281bba87660feafb8
465aaedbf2438f83cafae4917eef8f5b04621867
refs/heads/master
2022-07-12T02:34:16.491470
2019-12-16T04:00:10
2019-12-16T04:00:10
228,295,589
0
0
Apache-2.0
2022-07-08T19:05:12
2019-12-16T03:32:25
Java
UTF-8
Java
false
false
4,196
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 org.activiti.engine.test.bpmn.event.message; import org.activiti.engine.impl.test.PluggableActivitiTestCase; import org.activiti.engine.runtime.Execution; import org.activiti.engine.task.Task; import org.activiti.engine.test.Deployment; /** * * @author Tijs Rademakers */ public class MessageNonInterruptingBoundaryEventTest extends PluggableActivitiTestCase { @Deployment public void testSingleNonInterruptingBoundaryMessageEvent() { runtimeService.startProcessInstanceByKey("process"); assertEquals(3, runtimeService.createExecutionQuery().count()); Task userTask = taskService.createTaskQuery().taskDefinitionKey("task").singleResult(); assertNotNull(userTask); Execution execution = runtimeService.createExecutionQuery().messageEventSubscriptionName("messageName").singleResult(); assertNotNull(execution); // 1. case: message received before completing the task runtimeService.messageEventReceived("messageName", execution.getId()); // event subscription not removed execution = runtimeService.createExecutionQuery().messageEventSubscriptionName("messageName").singleResult(); assertNotNull(execution); assertEquals(2, taskService.createTaskQuery().count()); userTask = taskService.createTaskQuery().taskDefinitionKey("taskAfterMessage").singleResult(); assertNotNull(userTask); assertEquals("taskAfterMessage", userTask.getTaskDefinitionKey()); taskService.complete(userTask.getId()); assertEquals(1, runtimeService.createProcessInstanceQuery().count()); // send a message a second time runtimeService.messageEventReceived("messageName", execution.getId()); // event subscription not removed execution = runtimeService.createExecutionQuery().messageEventSubscriptionName("messageName").singleResult(); assertNotNull(execution); assertEquals(2, taskService.createTaskQuery().count()); userTask = taskService.createTaskQuery().taskDefinitionKey("taskAfterMessage").singleResult(); assertNotNull(userTask); assertEquals("taskAfterMessage", userTask.getTaskDefinitionKey()); taskService.complete(userTask.getId()); assertEquals(1, runtimeService.createProcessInstanceQuery().count()); // now complete the user task with the message boundary event userTask = taskService.createTaskQuery().taskDefinitionKey("task").singleResult(); assertNotNull(userTask); taskService.complete(userTask.getId()); // event subscription removed execution = runtimeService.createExecutionQuery().messageEventSubscriptionName("messageName").singleResult(); assertNull(execution); userTask = taskService.createTaskQuery().taskDefinitionKey("taskAfterTask").singleResult(); assertNotNull(userTask); taskService.complete(userTask.getId()); assertEquals(0, runtimeService.createProcessInstanceQuery().count()); // 2nd. case: complete the user task cancels the message subscription runtimeService.startProcessInstanceByKey("process"); userTask = taskService.createTaskQuery().taskDefinitionKey("task").singleResult(); assertNotNull(userTask); taskService.complete(userTask.getId()); execution = runtimeService.createExecutionQuery().messageEventSubscriptionName("messageName").singleResult(); assertNull(execution); userTask = taskService.createTaskQuery().taskDefinitionKey("taskAfterTask").singleResult(); assertNotNull(userTask); assertEquals("taskAfterTask", userTask.getTaskDefinitionKey()); taskService.complete(userTask.getId()); assertEquals(0, runtimeService.createProcessInstanceQuery().count()); } }
[ "chenling@deepexi.com" ]
chenling@deepexi.com
574662e02eec41751ad0b288311be1b2a7f0ae6b
3b91ed788572b6d5ac4db1bee814a74560603578
/com/tencent/mm/plugin/appbrand/jsapi/version/JsApiUpdateApp$SyncResult.java
0af1c8d379ac9eec5cbdbfaf2bdd70abf0a76992
[]
no_license
linsir6/WeChat_java
a1deee3035b555fb35a423f367eb5e3e58a17cb0
32e52b88c012051100315af6751111bfb6697a29
refs/heads/master
2020-05-31T05:40:17.161282
2018-08-28T02:07:02
2018-08-28T02:07:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
807
java
package com.tencent.mm.plugin.appbrand.jsapi.version; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; final class JsApiUpdateApp$SyncResult implements Parcelable { public static final Creator<JsApiUpdateApp$SyncResult> CREATOR = new 1(); private int cbu; private boolean fZK; JsApiUpdateApp$SyncResult(boolean z, int i) { this.fZK = z; this.cbu = i; } public final int describeContents() { return 0; } public final void writeToParcel(Parcel parcel, int i) { parcel.writeByte(this.fZK ? (byte) 1 : (byte) 0); parcel.writeInt(this.cbu); } JsApiUpdateApp$SyncResult(Parcel parcel) { this.fZK = parcel.readByte() != (byte) 0; this.cbu = parcel.readInt(); } }
[ "707194831@qq.com" ]
707194831@qq.com
8ae84888822aa3676b633f451087183f8ca321d9
e53b7a02300de2b71ac429d9ec619d12f21a97cc
/src/com/coda/common/schemas/homepagetemplatemaster/AddResponseVerb.java
997d201ebc9de4bb725931ef74decc36cba5f8c0
[]
no_license
phi2039/coda_xmli
2ad13c08b631d90a26cfa0a02c9c6c35416e796f
4c391b9a88f776c2bf636e15d7fcc59b7fcb7531
refs/heads/master
2021-01-10T05:36:22.264376
2015-12-03T16:36:23
2015-12-03T16:36:23
47,346,047
0
0
null
null
null
null
UTF-8
Java
false
false
2,502
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.12.03 at 01:45:01 AM EST // package com.coda.common.schemas.homepagetemplatemaster; import java.io.Serializable; 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; import com.coda.efinance.schemas.common.ResponseVerb; /** * Contains the responses to your requests with this verb. * * <p>Java class for AddResponseVerb complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AddResponseVerb"&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.coda.com/efinance/schemas/common}ResponseVerb"&gt; * &lt;sequence&gt; * &lt;element name="Response" type="{http://www.coda.com/common/schemas/homepagetemplatemaster}AddResponse" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AddResponseVerb", propOrder = { "response" }) public class AddResponseVerb extends ResponseVerb implements Serializable { @XmlElement(name = "Response") protected List<AddResponse> response; /** * Gets the value of the response 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 response property. * * <p> * For example, to add a new item, do as follows: * <pre> * getResponse().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link AddResponse } * * */ public List<AddResponse> getResponse() { if (response == null) { response = new ArrayList<AddResponse>(); } return this.response; } }
[ "climber2039@gmail.com" ]
climber2039@gmail.com
71b011ad502cc97b7981072ee58b97f745e0dda7
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14263-32-26-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/com/xpn/xwiki/render/DefaultVelocityManager_ESTest.java
f61c4135d121b66b0467a3c3bf6f07dd83a29086
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
/* * This file was automatically generated by EvoSuite * Tue Apr 07 02:58:17 UTC 2020 */ package com.xpn.xwiki.render; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class DefaultVelocityManager_ESTest extends DefaultVelocityManager_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
c39bc4f969f40554156ba3760b3d73f62670b60b
47798511441d7b091a394986afd1f72e8f9ff7ab
/src/main/java/com/alipay/api/domain/AlipayEcoRenthouseLeaseStateSyncModel.java
5f1b1968db04ca6e711c299b5827856ee58c7a30
[ "Apache-2.0" ]
permissive
yihukurama/alipay-sdk-java-all
c53d898371032ed5f296b679fd62335511e4a310
0bf19c486251505b559863998b41636d53c13d41
refs/heads/master
2022-07-01T09:33:14.557065
2020-05-07T11:20:51
2020-05-07T11:20:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,256
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 租约状态同步 * * @author auto create * @since 1.0, 2020-05-07 15:28:19 */ public class AlipayEcoRenthouseLeaseStateSyncModel extends AlipayObject { private static final long serialVersionUID = 3774119378752658683L; /** * 租约电子合同图片,内容字节组Base64处理,支持jpg、png、jpeg、bmp格式 */ @ApiField("lease_ca_file") private String leaseCaFile; /** * 租约编号(KA内部租约业务编号) */ @ApiField("lease_code") private String leaseCode; /** * 租约状态 0-未确认 1-已确认 2-已退房 3-已撤销 */ @ApiField("lease_status") private Long leaseStatus; public String getLeaseCaFile() { return this.leaseCaFile; } public void setLeaseCaFile(String leaseCaFile) { this.leaseCaFile = leaseCaFile; } public String getLeaseCode() { return this.leaseCode; } public void setLeaseCode(String leaseCode) { this.leaseCode = leaseCode; } public Long getLeaseStatus() { return this.leaseStatus; } public void setLeaseStatus(Long leaseStatus) { this.leaseStatus = leaseStatus; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
b3b150f419a6db50033184232744789ea372345a
9623f83defac3911b4780bc408634c078da73387
/powercraft v1.4.4/src/minecraft_server/net/minecraft/src/NetworkListenThread.java
f4af5fb40da25699cac85433813f8f71b2c59105
[]
no_license
BlearStudio/powercraft-legacy
42b839393223494748e8b5d05acdaf59f18bd6c6
014e9d4d71bd99823cf63d4fbdb65c1b83fde1f8
refs/heads/master
2021-01-21T21:18:55.774908
2015-04-06T20:45:25
2015-04-06T20:45:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,402
java
package net.minecraft.src; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import net.minecraft.server.MinecraftServer; public abstract class NetworkListenThread { /** Reference to the logger. */ public static Logger logger = Logger.getLogger("Minecraft"); /** Reference to the MinecraftServer object. */ private final MinecraftServer mcServer; private final List connections = Collections.synchronizedList(new ArrayList()); /** Whether the network listener object is listening. */ public volatile boolean isListening = false; public NetworkListenThread(MinecraftServer par1MinecraftServer) throws IOException { this.mcServer = par1MinecraftServer; this.isListening = true; } /** * adds this connection to the list of currently connected players */ public void addPlayer(NetServerHandler par1NetServerHandler) { this.connections.add(par1NetServerHandler); } public void stopListening() { this.isListening = false; } /** * processes packets and pending connections */ public void networkTick() { for (int var1 = 0; var1 < this.connections.size(); ++var1) { NetServerHandler var2 = (NetServerHandler)this.connections.get(var1); try { var2.networkTick(); } catch (Exception var5) { if (var2.netManager instanceof MemoryConnection) { CrashReport var4 = CrashReport.func_85055_a(var5, "Ticking memory connection"); throw new ReportedException(var4); } logger.log(Level.WARNING, "Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.func_71114_r() + ": " + var5, var5); var2.kickPlayerFromServer("Internal server error"); } if (var2.connectionClosed) { this.connections.remove(var1--); } var2.netManager.wakeThreads(); } } public MinecraftServer getServer() { return this.mcServer; } }
[ "nils.h.emmerich@gmail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c" ]
nils.h.emmerich@gmail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c
dd0c5680c5f836ccac4eb9b11f33632c9a3c9447
0a4710d75f8256da50bfb62ac538e7e7baec0651
/LeetCode/test/johnny/algorithm/leetcode/test/Solution536Test.java
acc0cd07b97425e3f5882b3f84973d468b605933
[]
no_license
tuyen03a128/algorithm-java-jojozhuang
4bacbe8ce0497e6b2851b184e0b42ee34c904f95
5ca9f4ae711211689b2eb92dfddec482a062d537
refs/heads/master
2020-04-25T09:05:32.723463
2019-02-24T17:32:30
2019-02-24T17:32:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
561
java
package johnny.algorithm.leetcode.test; import static org.junit.Assert.*; import org.junit.Test; import johnny.algorithm.leetcode.Solution536; import johnny.algorithm.leetcode.common.TreeNode; public class Solution536Test extends JunitBase { @Test public void test() { System.out.println("str2tree"); Solution536 instance = new Solution536(); TreeNode expect1 = TreeNode.createInstance(new String[] {"4","2","6","3","1","5","#"}); assertTrue(TreeNode.isSame(expect1, instance.str2tree("4(2(3)(1))(6(5))"))); } }
[ "jojozhuang@gmail.com" ]
jojozhuang@gmail.com
07026f24dfa42f4a3fc738f8afffcb418e8e7407
b4b411a19f7ca6ca4ed6e5ddd00aa630daea6e2a
/src/test/java/com/algorithm/problems/merge_two_binary_trees/Tester.java
e2a8b87ae773ea45cab8c5908e22170f0ddcf48a
[]
no_license
unknown-peter/algorithm-problems
ca9d4fdf31cb09cbaa0728a09f22e06d4363cc90
7185679c671caf567619242417e020a8da624e82
refs/heads/master
2022-10-24T10:55:22.860449
2022-10-23T04:58:40
2022-10-23T04:58:40
186,918,222
0
0
null
null
null
null
UTF-8
Java
false
false
3,167
java
/** * Leetcode - merge_two_binary_trees */ package com.algorithm.problems.merge_two_binary_trees; import com.algorithm.util.TreeNodeConvertClass; import com.ciaoshen.leetcode.util.TreeNode; import org.junit.*; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Arrays; import java.util.Collection; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; @RunWith(Parameterized.class) public class Tester { /** * =========================== static for every test cases ============================== */ // Solution instance to test private static Solution solution; // use this Object to print the log (call from slf4j facade) private static final Logger LOGGER = LoggerFactory.getLogger(TesterRunner.class); /** * Execute once before any of the test methods in this class. */ @BeforeClass public static void setUpBeforeClass() throws Exception { /* uncomment to switch solutions */ // solution = new Solution1(); solution = new Solution2(); } /** * Execute once after all of the test methods are executed in this class. */ @AfterClass public static void tearDownAfterClass() throws Exception { } /** * Initialize test cases */ @Parameters public static Collection<Object[]> testcases() { return Arrays.asList(new Object[][]{ {"[1,3,2,5]", "[2,1,3,null,4,null,7]", "[3,4,5,5,4,null,7]"}, {"[1]", "[1,2]", "[2,2]"} }); } /**=========================== for each test case ============================== */ /** * Parameters for each test (initialized in testcases() method) * You can change the type of parameters */ private String para1; // parameter 1 private String para2; // parameter 2 private String expected; // parameter 3 (expected answer) /** * This constructor must be provided to run parameterized test. */ public Tester(String para1, String para2, String expected) { // initialize test parameters this.para1 = para1; this.para2 = para2; this.expected = expected; } /** * Execute before each test method in this class is executed. */ @Before public void setUp() throws Exception { } /** * Executed as a test case. */ @Test public void test() { TreeNode actual = solution.mergeTrees(TreeNodeConvertClass.stringToTreeNode(para1), TreeNodeConvertClass.stringToTreeNode(para2)); assertThat(TreeNodeConvertClass.treeNodeToString(actual), is(equalTo(expected))); if (LOGGER.isDebugEnabled()) { LOGGER.debug("mergeTrees() pass unit test!"); } } /** * Execute after each test method in this class is executed. */ @After public void tearDown() throws Exception { } }
[ "unknown-peter@protonmail.com" ]
unknown-peter@protonmail.com
eb5db5475d1170bdab76d6a57bf3256a44521364
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/9/org/apache/commons/math3/geometry/euclidean/threed/FieldRotation_vector_710.java
1d86f3d2d3465294322752feafb6f1a0dbe30194
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,628
java
org apach common math3 geometri euclidean threed implement link rotat link extend field element extendedfieldel instanc guarante immut param type field element version vector3 ddsd vector3ddsd rotat order rotationord field rotat fieldrot extend field element extendedfieldel serializ creat constant vector param abscissa param ordin param height constant vector field vector3 fieldvector3d vector field getfield getzero field vector3 fieldvector3d add add add
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
0a17034f58a1054144c4b0abbb760a321f6e151d
8593978dba0c1bc08e92811b1defada5cf7ccf3c
/layui_system_web/src/main/java/com/zzg/controller/FileController.java
8c4215711a6454afe11ac0a34ab78339d091c927
[]
no_license
zhouzhiwengang/layui_system
f23468f81ffc926cfd31d2eef0849de22cfb956d
bf28411abbb6021985142f28745e6a44166fcba2
refs/heads/main
2023-02-28T11:22:57.006035
2021-02-10T04:00:49
2021-02-10T04:00:49
337,610,156
0
0
null
null
null
null
UTF-8
Java
false
false
8,381
java
package com.zzg.controller; import java.util.List; import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zzg.common.constants.FileUploadConstant; import com.zzg.common.controller.AbstractController; import com.zzg.common.entity.ChunkInfoModel; import com.zzg.common.entity.PageParame; import com.zzg.common.entity.Result; import com.zzg.component.fileupload.AttachmentComponent; import com.zzg.entity.SysEfileInfo; import com.zzg.entity.SysEfileStore; import com.zzg.service.SysEfileInfoService; import com.zzg.service.SysEfileStoreService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @RestController @RequestMapping("/api/file") public class FileController extends AbstractController { // 日志记录 public static final Logger logger = LoggerFactory.getLogger(FileController.class); @Autowired private AttachmentComponent upload; @Autowired private SysEfileInfoService sysEfileInfoService; @Autowired private SysEfileStoreService sysEfileStoreService; /** * 通用文件上传功能; 备注:文件大小<=30M,如果超出规定文件大小,建议采用大文件上传 * * @param entity * @return */ @RequestMapping(value = "/fileUpload", method = { RequestMethod.POST }) @ResponseBody @ApiOperation(httpMethod = "POST", value = "文件上传(小于等于30M)") public Result upload(ChunkInfoModel entity) { if (logger.isDebugEnabled()) { logger.debug(entity.toString()); } SysEfileInfo model = null; try { model = upload.smallAttachUpload(entity, "default"); } catch (Exception e) { // TODO Auto-generated catch block logger.error("error: {}", e.getMessage(), e); } return Result.ok("文件上传成功").setDatas("model", model); } /** * 通用文件删除功能 * * @param entity * @return */ @RequestMapping(value = "/fileDelete", method = { RequestMethod.POST }) @ResponseBody @ApiOperation(httpMethod = "POST", value = "附件删除") @ApiImplicitParams({ @ApiImplicitParam(name = "efileSid", value = "efileSid", required = false, dataType = "String", paramType = "query") }) public Result fileDelete( @RequestBody @ApiParam(name = "JSONObject对象", value = "json格式对象", required = true) Map<String, Object> parameter) { if (logger.isDebugEnabled()) { logger.debug(String.valueOf(parameter.get("sid"))); } if (parameter.get("sid") != null) { String sid = String.valueOf(parameter.get("sid")); if (StringUtils.isNotBlank(sid)) { sysEfileInfoService.removeById(sid); return Result.ok("文件删除成功").setDatas("efileSid", sid); } } return Result.error("请求参数sid缺失"); } /** * 通用大文件分块上传; 设计思路:大文件按照指定文件大小分割成大小统一的文件块,文件块生成的规则是按数字递增生成创建。 * * @param entity * @return */ @ApiOperation(httpMethod = "POST", value = "文件块上传") @RequestMapping(value = "/fileBlockUpload", method = { RequestMethod.POST }) @ResponseBody public Result blockUpload(ChunkInfoModel entity) { if (logger.isDebugEnabled()) { logger.debug(entity.toString()); } Result result = null; try{ result = upload.attachBlockUpload(entity, "bigFile"); }catch(Exception e){ e.printStackTrace(); logger.error("error{}", e.getMessage(), e); } return result; } /** * 通用大文件分块合并; 设计思路:文件块按照数字递增的顺序合并为大文件 * * @param entity * @return */ @ApiOperation(httpMethod = "POST", value = "文件块合并") @RequestMapping(value = "/fileMerge", method = { RequestMethod.POST }) @ResponseBody public Result merge(ChunkInfoModel entity) { if (logger.isDebugEnabled()) { logger.debug(entity.toString()); } SysEfileInfo model = null; try { model = upload.bigAttachMerge(entity, "bigFile"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); logger.error("error{}", e.getMessage(), e); } ; return Result.ok("文件合并成功").setDatas("model", model); } /** * 通用大文件 暂停/重新上传功能; 设计思路:返回大文件已经正常上传完成的文件块信息。 * * @param entity * @return */ @ApiOperation(httpMethod = "POST", value = "文件上传记录") @RequestMapping(value = "/find", method = { RequestMethod.POST }) @ResponseBody public Result find(ChunkInfoModel entity) { if (logger.isDebugEnabled()) { logger.debug(entity.toString()); } Result result = null; try{ result = upload.breakRenewal(entity, "bigFile"); } catch(Exception e){ e.printStackTrace(); logger.error("error{}", e.getMessage(), e); } return result; } // 查 @ApiOperation(httpMethod = "POST", value = "查询符合条件上传文件记录") @RequestMapping(value = "/getList", method = { RequestMethod.POST }) @ApiImplicitParams({ @ApiImplicitParam(name = "businessSid", value = "业务Sid", required = false, dataType = "String", paramType = "query") }) public Result getList(@RequestBody Map<String, Object> parame) { // 动态构建添加参数 QueryWrapper<SysEfileInfo> query = new QueryWrapper<SysEfileInfo>(); this.buildQuery(parame, query); List<SysEfileInfo> list = sysEfileInfoService.list(query); return Result.ok().setDatas(list); } // 查 @ApiOperation(httpMethod = "POST", value = "基于分页查询符合条件上传文件记录") @RequestMapping(value = "/getPage", method = { RequestMethod.POST }) @ApiImplicitParams({ @ApiImplicitParam(name = "businessSid", value = "业务Sid", required = false, dataType = "String", paramType = "query") }) public Result getPage(@RequestBody Map<String, Object> parame) { // 动态构建添加参数 QueryWrapper<SysEfileInfo> query = new QueryWrapper<SysEfileInfo>(); this.buildQuery(parame, query); PageParame pageParame = this.initPageBounds(parame); Page<SysEfileInfo> page = new Page<SysEfileInfo>(pageParame.getPage(), pageParame.getLimit()); IPage<SysEfileInfo> list = sysEfileInfoService.page(page, query); QueryWrapper<SysEfileStore> queryWrapper = new QueryWrapper<SysEfileStore>(); queryWrapper.eq("store_code", FileUploadConstant.EFILE_UPLOAD_DIR_PATH); Map<String, Object> map = sysEfileStoreService.getMap(queryWrapper); String pathPrefix = String.valueOf(map.get(FileUploadConstant.IDENTIFIER)); list.getRecords().stream().filter(item->{ return StringUtils.isNotEmpty(item.getFilePath()); }).forEach(item->{ String filePath = item.getFilePath().replace(pathPrefix.concat("\\"), ""); item.setFilePath(filePath); }); return Result.ok().setDatas(list); } // 删 @ApiOperation(httpMethod = "POST", value = "上传文件记录删除") @RequestMapping(value = "/delete", method = { RequestMethod.POST }, produces = "application/json;charset=UTF-8") public Result delete(@RequestBody SysEfileInfo entity) { String sid = entity.getSid(); if (StringUtils.isNotEmpty(sid)) { QueryWrapper<SysEfileInfo> query = new QueryWrapper<SysEfileInfo>(); query.eq("sid", entity.getSid()); sysEfileInfoService.remove(query); return Result.ok(); } return Result.error("请求参数缺失Sid"); } @Override public void buildQuery(Map<String, Object> param, Object query) { // TODO Auto-generated method stub if (query != null) { QueryWrapper<SysEfileInfo> queryWrapper = (QueryWrapper<SysEfileInfo>) query; if (param.get("businessSid") != null) { if (StringUtils.isNotBlank(String.valueOf(param.get("businessSid")))) { queryWrapper.eq("business_sid", param.get("businessSid")); } } } } }
[ "zhouzhiwengang@163.com" ]
zhouzhiwengang@163.com
85a2830c530d2fc63889cb56a04e580ca4801574
1061216c2c33c1ed4ffb33e6211565575957e48f
/android/src/main/java/org/openapitools/client/model/JsonSuccessBase.java
8961128fd5f53043f8228c8baa3369b6e12f1890
[]
no_license
MSurfer20/test2
be9532f54839e8f58b60a8e4587348c2810ecdb9
13b35d72f33302fa532aea189e8f532272f1f799
refs/heads/main
2023-07-03T04:19:57.548080
2021-08-11T19:16:42
2021-08-11T19:16:42
393,920,506
0
0
null
null
null
null
UTF-8
Java
false
false
2,089
java
/** * Zulip REST API * Powerful open source group chat * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import org.openapitools.client.model.JsonResponseBase; import org.openapitools.client.model.JsonSuccessBaseAllOf; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; @ApiModel(description = "") public class JsonSuccessBase { public enum ResultEnum { success, }; @SerializedName("result") private ResultEnum result = null; @SerializedName("msg") private String msg = null; /** **/ @ApiModelProperty(required = true, value = "") public ResultEnum getResult() { return result; } public void setResult(ResultEnum result) { this.result = result; } /** **/ @ApiModelProperty(required = true, value = "") public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } JsonSuccessBase jsonSuccessBase = (JsonSuccessBase) o; return (this.result == null ? jsonSuccessBase.result == null : this.result.equals(jsonSuccessBase.result)) && (this.msg == null ? jsonSuccessBase.msg == null : this.msg.equals(jsonSuccessBase.msg)); } @Override public int hashCode() { int result = 17; result = 31 * result + (this.result == null ? 0: this.result.hashCode()); result = 31 * result + (this.msg == null ? 0: this.msg.hashCode()); return result; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class JsonSuccessBase {\n"); sb.append(" result: ").append(result).append("\n"); sb.append(" msg: ").append(msg).append("\n"); sb.append("}\n"); return sb.toString(); } }
[ "suyash.mathur@research.iiit.ac.in" ]
suyash.mathur@research.iiit.ac.in
8231b9ea8ee6032c6ec2e145918cb39d1985cd32
ed865190ed878874174df0493b4268fccb636a29
/PuridiomAssets/src/com/tsa/puridiom/assetservice/tasks/AssetServiceRetrieveBy.java
bb986047935b6b1550c8cf79a9fd94101f098945
[]
no_license
zach-hu/srr_java8
6841936eda9fdcc2e8185b85b4a524b509ea4b1b
9b6096ba76e54da3fe7eba70989978edb5a33d8e
refs/heads/master
2021-01-10T00:57:42.107554
2015-11-06T14:12:56
2015-11-06T14:12:56
45,641,885
0
0
null
null
null
null
UTF-8
Java
false
false
3,968
java
package com.tsa.puridiom.assetservice.tasks; import com.tsagate.foundation.database.DBSession; import com.tsagate.foundation.processengine.Task; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.hibernate.Hibernate; import org.hibernate.type.Type; public class AssetServiceRetrieveBy extends Task { public Object executeTask (Object object) throws Exception { Map incomingRequest = (Map)object; DBSession dbs = (DBSession)incomingRequest.get("dbsession") ; StringBuffer queryString = new StringBuffer("from AssetService as assetservice where 1=1 "); List args = new ArrayList(); List<Type> types = new ArrayList<Type>(); if(incomingRequest.containsKey("AssetService_tagNumber")) { String tagNumber = (String) incomingRequest.get("AssetService_tagNumber"); args.add(tagNumber); types.add(Hibernate.STRING); queryString.append(" AND assetservice.id.tagNumber = ?"); } if(incomingRequest.containsKey("AssetService_sequenceNo")) { String sequenceNo = (String) incomingRequest.get("AssetService_sequenceNo"); args.add(sequenceNo); types.add(Hibernate.STRING); queryString.append(" AND assetservice.id.sequenceNo = ?"); } if(incomingRequest.containsKey("AssetService_serviceCallDate")) { String serviceCallDate = (String) incomingRequest.get("AssetService_serviceCallDate"); args.add(serviceCallDate); types.add(Hibernate.STRING); queryString.append(" AND assetservice.serviceCallDate = ?"); } if(incomingRequest.containsKey("AssetService_callInitiatedBy")) { String callInitiatedBy = (String) incomingRequest.get("AssetService_callInitiatedBy"); args.add(callInitiatedBy); types.add(Hibernate.STRING); queryString.append(" AND assetservice.callInitiatedBy = ?"); } if(incomingRequest.containsKey("AssetService_dateInitiated")) { String dateInitiated = (String) incomingRequest.get("AssetService_dateInitiated"); args.add(dateInitiated); types.add(Hibernate.STRING); queryString.append(" AND assetservice.dateInitiated = ?"); } if(incomingRequest.containsKey("AssetService_responseDate")) { String responseDate = (String) incomingRequest.get("AssetService_responseDate"); args.add(responseDate); types.add(Hibernate.STRING); queryString.append(" AND assetservice.responseDate = ?"); } if(incomingRequest.containsKey("AssetService_completionDate")) { String completionDate = (String) incomingRequest.get("AssetService_completionDate"); args.add(completionDate); types.add(Hibernate.STRING); queryString.append(" AND assetservice.completionDate = ?"); } if(incomingRequest.containsKey("AssetService_serviceAction")) { String serviceAction = (String) incomingRequest.get("AssetService_serviceAction"); args.add(serviceAction); types.add(Hibernate.STRING); queryString.append(" AND assetservice.serviceAction = ?"); } if(incomingRequest.containsKey("AssetService_serviceCost")) { String serviceCost = (String) incomingRequest.get("AssetService_serviceCost"); args.add(serviceCost); types.add(Hibernate.STRING); queryString.append(" AND assetservice.serviceCost = ?"); } if(incomingRequest.containsKey("AssetService_lastChgBy")) { String lastChgBy = (String) incomingRequest.get("AssetService_lastChgBy"); args.add(lastChgBy); types.add(Hibernate.STRING); queryString.append(" AND assetservice.lastChgBy = ?"); } if(incomingRequest.containsKey("AssetService_dateChanged")) { String dateChanged = (String) incomingRequest.get("AssetService_dateChanged"); args.add(dateChanged); types.add(Hibernate.STRING); queryString.append(" AND assetservice.dateChanged = ?"); } List result = dbs.query(queryString.toString(), args.toArray(), types.toArray(new Type[types.size()])) ; this.setStatus(dbs.getStatus()) ; return result ; } }
[ "brickerz@9227675a-84a3-4efe-bc6c-d7b3a3cf6466" ]
brickerz@9227675a-84a3-4efe-bc6c-d7b3a3cf6466
febf33c3123c39ac78d2e04918add847a59c40ed
a20eadeabb624a9a2b9a93e1d942d35e0b23e18c
/diulala/src/main/java/me/zbl/diulala/auth/WXHandlerIntercepter.java
83b438780ed0521aea1ac126c51ff8fe7273636d
[]
no_license
JamesZBL/diulala-server
44a1159e9ca76a8e0cab9c18780b9172f0a8f3d5
6babc4b51400cb2c5d394a5d84be35123e02cf0b
refs/heads/master
2020-04-15T02:16:31.510062
2019-03-17T14:14:32
2019-03-17T14:14:32
164,308,533
4
0
null
null
null
null
UTF-8
Java
false
false
3,289
java
/* * Copyright 2018 JamesZBL * * 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 me.zbl.diulala.auth; import me.zbl.auth.annotation.CurrentUser; import me.zbl.diulala.entity.response.ApiLoginResponse; import me.zbl.diulala.exception.AuthFailedException; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Optional; /** * 小程序鉴权拦截器 * 拦截 Controller 中带有 @CurrentUser 注解的 Handler Method,校验 Token 有效性 * * @author JamesZBL * @email 1146556298@qq.com * @date 2018-05-04 */ @Component public class WXHandlerIntercepter implements HandlerInterceptor { @Autowired private WXTokenManager tokenManager; @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { // 防止静态资源请求被拦截,产生类型转换异常 if (!(handler instanceof HandlerMethod)) { return true; } // 获取 handler 方法 HandlerMethod method = (HandlerMethod) handler; // 是否需要用户用户认证 boolean onlyCurrentUser = method.hasMethodAnnotation(CurrentUser.class); if (onlyCurrentUser) { String tokenParam = request.getHeader(WXAuthConstants.HEADER_TOKEN); if (StringUtils.isEmpty(tokenParam)) { // 请求头中未包含 token,抛出异常 throw new AuthFailedException("未获取到认证信息"); } if (!tokenManager.hasToken(tokenParam)) { throw new AuthFailedException("认证过期,请重新登录"); } Optional<ApiLoginResponse> info = tokenManager.getTokenInfo(tokenParam); info.orElseThrow(AuthFailedException::new); // 判断请求用户是否为当前登录用户 ApiLoginResponse get = info.get(); String userid = request.getParameter(WXAuthConstants.PARAM_USERID); if (!get.getOpenid().equals(userid)) { throw new AuthFailedException("无权操作"); } // 认证成功,token 续期 tokenManager.flushToken(tokenParam); } return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { } }
[ "1146556298@qq.com" ]
1146556298@qq.com
406c5c5bd050084785989cadbbda0ca7e9a227c1
92fa08ae33fd552b78f388a95290713827074bea
/src/main/java/wxmg/basicInfo/dao/IFansGroupDao.java
e6b357ea204047070ab7e599e5f6a24defe34752
[]
no_license
lyouyue/frontnew
76c1eccce4b9b8a15789f3f33e502b2cb6f95627
8546ab96e002fcbba601142977711d66b6b90d8a
refs/heads/master
2021-07-06T15:42:57.725901
2017-09-20T11:14:29
2017-09-20T11:14:29
104,205,500
0
0
null
null
null
null
UTF-8
Java
false
false
214
java
package wxmg.basicInfo.dao; import util.dao.IBaseDao; import wxmg.basicInfo.pojo.FansGroup; /** * 粉丝分组Dao接口 * @author 郑月龙 * */ public interface IFansGroupDao extends IBaseDao <FansGroup>{ }
[ "136861916@qq.com" ]
136861916@qq.com
ee30bc35323cdd6a5cbf2f72a859efdf8699cb0b
778da6dbb2eb27ace541338d0051f44353c3f924
/src/main/java/com/espertech/esper/event/bean/ArrayFastPropertyGetter.java
6f5909abc0ff94827d4da6f508a02277e921510b
[]
no_license
jiji87432/ThreadForEsperAndBenchmark
daf7188fb142f707f9160173d48c2754e1260ec7
fd2fc3579b3dd4efa18e079ce80d3aee98bf7314
refs/heads/master
2021-12-12T02:15:18.810190
2016-12-01T12:15:01
2016-12-01T12:15:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,816
java
/************************************************************************************** * Copyright (C) 2006-2015 EsperTech Inc. All rights reserved. * * http://www.espertech.com/esper * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * **************************************************************************************/ package com.espertech.esper.event.bean; import com.espertech.esper.client.EventBean; import com.espertech.esper.client.PropertyAccessException; import com.espertech.esper.event.EventAdapterService; import com.espertech.esper.event.EventPropertyGetterAndIndexed; import com.espertech.esper.event.vaevent.PropertyUtility; import net.sf.cglib.reflect.FastMethod; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; /** * Getter for an array property identified by a given index, using the CGLIB fast method. */ public class ArrayFastPropertyGetter extends BaseNativePropertyGetter implements BeanEventPropertyGetter, EventPropertyGetterAndIndexed { private final FastMethod fastMethod; private final int index; /** * Constructor. * @param fastMethod is the method to use to retrieve a value from the object * @param index is tge index within the array to get the property from * @param eventAdapterService factory for event beans and event types */ public ArrayFastPropertyGetter(FastMethod fastMethod, int index, EventAdapterService eventAdapterService) { super(eventAdapterService, fastMethod.getReturnType().getComponentType(), null); this.index = index; this.fastMethod = fastMethod; if (index < 0) { throw new IllegalArgumentException("Invalid negative index value"); } } public Object getBeanProp(Object object) throws PropertyAccessException { return getBeanPropInternal(object, index); } private Object getBeanPropInternal(Object object, int index) throws PropertyAccessException { try { Object value = fastMethod.invoke(object, null); if (Array.getLength(value) <= index) { return null; } return Array.get(value, index); } catch (ClassCastException e) { throw PropertyUtility.getMismatchException(fastMethod.getJavaMethod(), object, e); } catch (InvocationTargetException e) { throw PropertyUtility.getInvocationTargetException(fastMethod.getJavaMethod(), e); } } public boolean isBeanExistsProperty(Object object) { return true; // Property exists as the property is not dynamic (unchecked) } public final Object get(EventBean obj) throws PropertyAccessException { return getBeanProp(obj.getUnderlying()); } public Object get(EventBean eventBean, int index) throws PropertyAccessException { return getBeanPropInternal(eventBean.getUnderlying(), index); } public String toString() { return "ArrayFastPropertyGetter " + " fastMethod=" + fastMethod.toString() + " index=" + index; } public boolean isExistsProperty(EventBean eventBean) { return true; // Property exists as the property is not dynamic (unchecked) } }
[ "qinjie2012@163.com" ]
qinjie2012@163.com
cc33c89cf6387a667a86fe7702bd8b7819010cbb
c2d8181a8e634979da48dc934b773788f09ffafb
/storyteller/output/mazdasalestool/GrepResultAndProductivityOnNewcustomerincrementAction.java
b60f52c07d487e4a7e05a857d6618350a42b0a59
[]
no_license
toukubo/storyteller
ccb8281cdc17b87758e2607252d2d3c877ffe40c
6128b8d275efbf18fd26d617c8503a6e922c602d
refs/heads/master
2021-05-03T16:30:14.533638
2016-04-20T12:52:46
2016-04-20T12:52:46
9,352,300
0
0
null
null
null
null
UTF-8
Java
false
false
1,579
java
package net.mazdasalestool.web; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.mazdasalestool.model.*; import net.mazdasalestool.model.crud.*; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.criterion.Restrictions; import org.springframework.beans.factory.BeanFactory; import org.springframework.web.context.support.WebApplicationContextUtils; import net.enclosing.util.HibernateSession; public class GrepResultAndProductivityOnNewcustomerincrementAction extends Action{ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception{ Session session = new HibernateSession().currentSession(this .getServlet().getServletContext()); Criteria criteria = session.createCriteria(ResultAndProductivity.class); if(req.getParameter("q") !=null && !req.getParameter("q").equals("")){ criteria.add(Restrictions.like("newcustomerincrement","%" + new String(req.getParameter("q").getBytes("8859_1"), "UTF-8") + "%")); } session.flush(); req.setAttribute("intrausers", criteria.list()); req.setAttribute("from","GrepResultAndProductivityOnNewcustomerincrement"); return mapping.findForward("success"); } }
[ "toukubo@gmail.com" ]
toukubo@gmail.com
499261c1c0aae4bde0fd0fc02563fb16c4e3676a
73601deb01f3c3f90fbe6346c5d407653431609a
/First_Step/data/43/235/submittedfiles/Executable.java
58ab7451764936b5dee4bd35c4a2ac3a08a962b0
[]
no_license
Benjam73/ComplexityAnalyzer
145fbac896ac18e6239791a636fe871efc3de332
27a0f1d5528ee66f2913b18137425aae59d06b0f
refs/heads/master
2020-03-17T09:25:31.308634
2018-07-20T13:34:17
2018-07-20T13:34:17
133,474,612
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
/** * A class to perform your own tests * @author hadrien cambazard */ public class Executable { public static void main(String[] args) { //I can test my class here: create instances and call the method(s), check the results //TODO //int[] p1 = {0,0,0,2,3,3,1,1,1,5,3,3}; int[] p1 = {0,0,0,2,3,3,1,1,1}; IntegerProfile ip=new IntegerProfile(p1); int plateau=ip.sizeLongestPlateau() ; System.out.println("Le plateau vaut "+plateau); int[] p2={1,0,0,0,1}; IntegerProfile ip2=new IntegerProfile(p2); int plateau2=ip2.sizeLongestPlateau() ; System.out.println("Le plateau vaut "+plateau2); int[] p3={0,0,0,1,1,0}; IntegerProfile ip3=new IntegerProfile(p3); int plateau3=ip3.sizeLongestPlateau() ; System.out.println("Le plateau vaut "+plateau3); } }
[ "besnierbenjamin73@gmail.com" ]
besnierbenjamin73@gmail.com
033a2b075a3aeadfd1145564de208a3b70a90bb0
433eae1806c7c4a0b2ddbc16bb59d296df2482ea
/WMb2b-service/src/main/java/com/wangmeng/redis/XJedisConnectionFactory.java
601c9dfcd9f8162dca1bce9cd4c8f2a87e48a8c7
[]
no_license
tomdev2008/zxzshop-parent
23dbb7dadcf2d342abb8685f8970312a73199d81
c08568df051b8e592ac35f7ca13e0d4940780a72
refs/heads/master
2021-01-12T01:03:25.156508
2017-01-06T05:39:40
2017-01-06T05:39:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,431
java
package com.wangmeng.redis; import org.apache.commons.lang.StringUtils; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; /** * <ul> * <li> * <p> * 系统名程     : 浙江网盟B2B平台项目 <br/> * 子系统名称    : 系统 <br/> * 类/接口名    : XJedisConnectionFactory <br/> * 版本信息     : 1.00 <br/> * 新建日期     : 2016年12月22日 <br/> * 作者       : 衣奎德 <br/> * <!-- <b>修改历史(修改者):</b> --> <br/> * * redis 连接工厂 * 主要处理密码为空的时候忽略校验的功能 * * Copyright (c) wangmeng Co., Ltd. 2016. All rights reserved. * </p> * * </li> * </ul> */ public class XJedisConnectionFactory extends JedisConnectionFactory { /** * 构造器 * @param poolConfig */ public XJedisConnectionFactory(GenericObjectPoolConfig poolConfig) { super(JedisPoolConfigBuilder.build(poolConfig)); } @Override public String getPassword() { return StringUtils.trimToNull(super.getPassword()); } @Override public void setPassword(String password) { super.setPassword(StringUtils.trimToNull(password)); } }
[ "admin" ]
admin
abeed208b4ac2b387c7c8cd77344f17910cc3ac4
e2a1e8432fdfa91aaabdfc45d4d38173a8e293e0
/db-upgrader/src/main/java/org/diveintojee/poc/digitaloceancluster/app1/DbMigrationConfiguration.java
041c9259673ae5594408c28eb35bdca3dab0eb77
[]
no_license
lgueye/app1
1d98707d86f6900f00b22f694681a8fd8e1484ea
924a01ccea8e4d82085ab64fd6b8c76399fd095d
refs/heads/master
2016-08-08T06:51:15.003079
2015-04-27T22:05:40
2015-04-27T22:05:40
29,881,802
0
0
null
null
null
null
UTF-8
Java
false
false
1,495
java
package org.diveintojee.poc.digitaloceancluster.app1; import org.flywaydb.core.Flyway; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.SimpleDriverDataSource; import java.sql.Driver; @Configuration public class DbMigrationConfiguration { @Value("${datasource.driverClassName}") private String driverClassName; @Value("${datasource.username}") private String userName; @Value("${datasource.password}") private String password; @Value("${datasource.url}") private String url; @Bean public SimpleDriverDataSource dataSource() throws ClassNotFoundException { SimpleDriverDataSource dataSource = new SimpleDriverDataSource(); dataSource.setDriverClass((Class<? extends Driver>) Class.forName(driverClassName)); dataSource.setUsername(userName); dataSource.setUrl(url); dataSource.setPassword(password); return dataSource; } @Bean public Flyway flyway() throws ClassNotFoundException { Flyway flyway = new Flyway(); flyway.setLocations("migrations"); flyway.setDataSource(dataSource()); return flyway; } @Bean public JdbcTemplate jdbcTemplate() throws ClassNotFoundException { return new JdbcTemplate(dataSource()); } }
[ "louis.gueye@gmail.com" ]
louis.gueye@gmail.com
7e06af36569b3d63f9427a5bf201bc91e5820884
aa82c44707cbb70da67c3dabdde11e162e56a1b6
/com.jtrent238.jtcraft/src/main/java/anw.java
5e38e9f98d02355ea6d9d7033de015a150c867dc
[]
no_license
jtrent238/jtcraft
c6804899969c7e5776253c5122539848c7de5f50
290820012690e87a491eaa450b9154fd9cf96115
refs/heads/master
2021-01-10T09:28:28.084577
2016-03-03T02:52:04
2016-03-03T02:52:04
53,013,456
0
0
null
null
null
null
UTF-8
Java
false
false
1,646
java
/* */ import java.util.List; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class anw /* */ extends aji /* */ { /* 16 */ public static final String[] a = { "default", "mossy", "cracked", "chiseled" }; /* */ /* */ /* */ /* 20 */ public static final String[] b = { null, "mossy", "cracked", "carved" }; /* */ /* */ private rf[] M; /* */ /* */ /* */ public anw() /* */ { /* 27 */ super(awt.e); /* 28 */ a(abt.b); /* */ } /* */ /* */ public rf a(int paramInt1, int paramInt2) /* */ { /* 33 */ if ((paramInt2 < 0) || (paramInt2 >= b.length)) paramInt2 = 0; /* 34 */ return this.M[paramInt2]; /* */ } /* */ /* */ public int a(int paramInt) /* */ { /* 39 */ return paramInt; /* */ } /* */ /* */ public void a(adb paramadb, abt paramabt, List paramList) /* */ { /* 44 */ for (int i = 0; i < 4; i++) { /* 45 */ paramList.add(new add(paramadb, 1, i)); /* */ } /* */ } /* */ /* */ public void a(rg paramrg) /* */ { /* 51 */ this.M = new rf[b.length]; /* */ /* 53 */ for (int i = 0; i < this.M.length; i++) { /* 54 */ String str = N(); /* 55 */ if (b[i] != null) str = str + "_" + b[i]; /* 56 */ this.M[i] = paramrg.a(str); /* */ } /* */ } /* */ } /* Location: C:\Users\trent\.gradle\caches\minecraft\net\minecraft\minecraft\1.7.10\minecraft-1.7.10.jar!\anw.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "jtrent238@outlook.com" ]
jtrent238@outlook.com
9d2b6aa28601eb71f687c524e320bec41be94eac
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14462-12-28-NSGA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/job/AbstractJob_ESTest_scaffolding.java
66c9499e8c7ecc2d6eb71176d2f9169cc1dff0d0
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Apr 03 02:19:16 UTC 2020 */ package org.xwiki.job; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class AbstractJob_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
648774912d9593403e29273483dbf5e84db88ccc
69b04a05d0a478af6e2b5d2e763cb50663bb688f
/rakam-aws/src/main/java/org/rakam/aws/lambda/AWSLambdaConfig.java
efed6d7dbfe2eedd95c3bc08ce830aeb90cdb547
[ "Apache-2.0" ]
permissive
mehhmetoz/rakam
f337a4b6a3201632a0aa1f36e4d9dc157edd7941
987d4090ac60c02ed260b8bdeeeb2c5e259e3293
refs/heads/master
2020-06-22T07:16:44.181850
2016-11-23T00:23:39
2016-11-23T00:23:39
74,599,327
1
0
null
2016-11-23T17:28:04
2016-11-23T17:28:04
null
UTF-8
Java
false
false
911
java
package org.rakam.aws.lambda; import io.airlift.configuration.Config; public class AWSLambdaConfig { String marketS3Bucket = "rakam-task-market"; private String roleArn; private String stackId; @Config("task.market_s3_bucket") public AWSLambdaConfig setMarketS3Bucket(String marketS3Bucket) { this.marketS3Bucket = marketS3Bucket; return this; } @Config("task.role_arn") public AWSLambdaConfig setRoleArn(String roleArn) { this.roleArn = roleArn; return this; } public String getRoleArn() { return roleArn; } @Config("task.stack_id") public AWSLambdaConfig setStackId(String stackId) { this.stackId = stackId; return this; } public String getStackId() { return stackId; } public String getMarketS3Bucket() { return marketS3Bucket; } }
[ "emrekabakci@gmail.com" ]
emrekabakci@gmail.com
f6b3141a9ce7c48a767ba0263d5cc44278b54b76
1a512c1c818823c44b8efb19009e14bf950dde05
/project/psychologicalprj/WebContent/src/com/Consultation/appointmentconsult/controller/PaymentResultResponseController.java
ad889f85938b4027552a4140677e31cf877c705b
[]
no_license
bao9777/Software
0af426f09a5ba7e42c2cff86f69ff55996f0c6a2
b7d12e3074667aab02b6327e8feefe2b2d343e50
refs/heads/master
2020-04-01T04:13:44.778795
2019-01-04T12:35:45
2019-01-04T12:44:56
152,854,885
0
3
null
null
null
null
UTF-8
Java
false
false
3,109
java
package com.Consultation.appointmentconsult.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import com.util.ConfigInfo; import com.util.PaymentUtil; /** * * @desc:支付成功之后的响应,返回给商户一些数据 * @author chunhui * @date:Nov 26, 201812:57:13 PM */ @Controller public class PaymentResultResponseController { /** * * @desc:一句话描述 * @param request * @param hmac * @param sCmd * 业务类型 * @param sResultCode支付结果 * @param sTrxId * 第三方支付交易流水号 * @param amount * 交易金额 * @param currency * 交易币种 * @param productId * 商品名称 * @param orderId * 商品订单号 * @param userId * 第三方支付会员id * @param mp * 商户扩展信息 * @param bType * 交易结果返回类型 * @param rb_BankId * 交易的银行编码 * @param rp_PayDate * 交易时间 * @return * @return:String * @trhows */ @RequestMapping("/PaymentResultResponseServlet") public String getResponse(HttpServletRequest request, @RequestParam(value = "hmac", required = false) String hmac, @RequestParam(value = "r0_Cmd", required = false) String sCmd, @RequestParam(value = "r1_Code", required = false) String sResultCode, @RequestParam(value = "r2_TrxId", required = false) String sTrxId, @RequestParam(value = "r3_Amt", required = false) String amount, @RequestParam(value = "r4_Cur", required = false) String currency, @RequestParam(value = "r5_Pid", required = false) String productId, @RequestParam(value = "r6_Order", required = false) String orderId, @RequestParam(value = "r7_Uid", required = false) String userId, @RequestParam(value = "r8_MP", required = false) String mp, @RequestParam(value = "r9_BType", required = false) String bType, @RequestParam(value = "rb_BankId", required = false) String rb_BankId, @RequestParam(value = "rp_PayDate", required = false) String rp_PayDate) { String merchantID = ConfigInfo.getValue("p1_MerId"); String keyValue = ConfigInfo.getValue("keyValue"); boolean result = PaymentUtil.verifyCallback(hmac, merchantID, sCmd, sResultCode, sTrxId, amount, currency, productId, orderId, userId, mp, bType, keyValue); if (result) { if ("1".equals(sResultCode)) { // 数据库中的订单的支付状态设成 已支付(考虑用户多次刷新多次更新数据库的问题) String message = "订单号为" + orderId + "的订单支付成功!"; message += "用户支付了" + amount + "元"; message += "易宝订单流水号为" + sTrxId; request.setAttribute("message", message); } else { request.setAttribute("message", "支付失败"); } } else { request.setAttribute("message", "数据被修改,出现错误"); } return "showpayresult"; } }
[ "977702305@qq.com" ]
977702305@qq.com
a82575a6fbaa1cd55365246e196a71d01d6756e9
e1ac9ac57f697620bf73ef6b49eff3c027c50825
/SystemSplit/repository/Repository.java
104db6438bf84d495bb82f4f12e6685a6fd75b9b
[]
no_license
vdjalov/JAVA
845738bde1fd445b224b7734f8957c2109c8d08d
0392faa7e24250d4bd875e707087d7d1cd2f2175
refs/heads/master
2020-05-02T15:39:35.758690
2019-04-12T10:17:48
2019-04-12T10:17:48
178,048,614
0
0
null
null
null
null
UTF-8
Java
false
false
5,491
java
package systemSplit.repository; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import systemSplit.hardwareComponents.BaseHardware; import systemSplit.softwareComponents.BaseSoftware; public class Repository { private Map<String, BaseHardware> repository; public Repository() { this.repository = new LinkedHashMap<String, BaseHardware>(); } public void addHardware(String name, BaseHardware bh) { this.repository.put(name, bh); } public Map <String, BaseHardware> getRepository() { return Collections.unmodifiableMap(this.repository); } public void addSoftware(String hardwareName, BaseSoftware bs) { if(this.repository.containsKey(hardwareName)) { int currentAvailableDiskCapacity = this.repository.get(hardwareName).getMaximumCapacity(); int necessaryDiskCapacity = bs.getCapacityConsumption(); int availableDiskCapacity = currentAvailableDiskCapacity - necessaryDiskCapacity; int currentAvailableMemoryCapacity = this.getRepository().get(hardwareName).getMaximumMemory(); int necessaryMemory = bs.getMemoryConsumption(); int availableMemory = currentAvailableMemoryCapacity - necessaryMemory; if(availableDiskCapacity >= 0 && availableMemory >= 0) { this.repository.get(hardwareName).setMaximumCapacity(availableDiskCapacity); this.repository.get(hardwareName).setMaximumMemory(availableMemory); this.repository.get(hardwareName).getAllSoftware().add(bs); } } } public void destroyComponent(String hardwareName, String softwareName) { if(this.repository.containsKey(hardwareName)) { for(int i = 0; i < this.repository.get(hardwareName).getAllSoftware().size(); i++) { String name = this.repository.get(hardwareName).getAllSoftware().get(i).getName(); int memory = this.repository.get(hardwareName).getAllSoftware().get(i).getMemoryConsumption(); int capacity = this.repository.get(hardwareName).getAllSoftware().get(i).getCapacityConsumption(); if(name.equals(softwareName)) { int currentComponentMemory = this.repository.get(hardwareName).getMaximumMemory(); int currentComponentCapacity = this.repository.get(hardwareName).getMaximumCapacity(); this.repository.get(hardwareName).getAllSoftware().remove(i); this.repository.get(hardwareName).setMaximumMemory(memory + currentComponentMemory); this.repository.get(hardwareName).setMaximumCapacity(capacity + currentComponentCapacity); } } } } public int getSoftwareComponentsCount() { int totalComponents = 0; for(String value: this.repository.keySet()) { int currentSoftware = this.repository.get(value).getAllSoftware().size(); totalComponents = totalComponents + currentSoftware; } return totalComponents; } public int getTotalOperationalMemoryInUse() { int totalMemoryInUse = 0; for(String value: this.repository.keySet()) { List<BaseSoftware> currentList = this.repository.get(value).getAllSoftware(); for(int i = 0; i < currentList.size(); i++) { totalMemoryInUse = totalMemoryInUse + currentList.get(i).getMemoryConsumption(); } } return totalMemoryInUse; } public int getToatalOperationalMemoryLeft() { int totalMemoryLeft = 0; for(String value: this.repository.keySet()) { totalMemoryLeft = totalMemoryLeft + this.repository.get(value).getMaximumMemory(); } return totalMemoryLeft; } public int getTotalCapacityTaken() { int totalCapacityTaken = 0; for(String value: this.repository.keySet()) { List<BaseSoftware> currentList = this.repository.get(value).getAllSoftware(); for(int i = 0; i < currentList.size(); i++) { totalCapacityTaken = totalCapacityTaken + currentList.get(i).getCapacityConsumption(); } } return totalCapacityTaken; } public int getTotalCapacityLeft() { int totalCapacityLeft = 0; for(String value: this.repository.keySet()) { totalCapacityLeft = totalCapacityLeft + this.repository.get(value).getMaximumCapacity(); } return totalCapacityLeft; } public int countExpressComponenst(String key) { AtomicInteger countExpressComponents = new AtomicInteger(); this.repository.get(key).getAllSoftware().forEach(a -> { if(a.getType().equals("Express")) { countExpressComponents.incrementAndGet(); } }); return countExpressComponents.get(); } public int countLightComponents(String key) { AtomicInteger countLightComponents = new AtomicInteger(); this.repository.get(key).getAllSoftware().forEach(a -> { if(a.getType().equals("Light")) { countLightComponents.incrementAndGet(); } }); return countLightComponents.get(); } public int getUsedMemory(String key) { int totalMemoryUsed = 0; List<BaseSoftware> bs = this.repository.get(key).getAllSoftware(); for(int i = 0; i < bs.size(); i++) { totalMemoryUsed+=bs.get(i).getMemoryConsumption(); } return totalMemoryUsed; } public int getUsedCapacity(String key) { int totalCapacityUsed = 0; List<BaseSoftware> bs = this.repository.get(key).getAllSoftware(); for(int i = 0; i < bs.size(); i++) { totalCapacityUsed+=bs.get(i).getCapacityConsumption(); } return totalCapacityUsed; } public void removeHardwareComponent(String key) { this.repository.remove(key); } }
[ "vdjalov@gmail.com" ]
vdjalov@gmail.com
74eeb223d65cf7cbcc025bb5016217fe75f225a6
3de0296164a969abbb1f066e04a194360c9e1c5c
/src/main/java/org/jocean/j2se/unit/LocalRef.java
c29f596b919f77e0454751d459590b9173082157
[]
no_license
isdom/jocean-j2se
5c7b55e41b45b2ae78caf50f08c8c57aaf3a01ce
bbacc5640ab5d9848f3956a0664bb767c02433b6
refs/heads/master
2023-09-06T04:30:50.829888
2023-08-20T13:19:21
2023-08-20T13:19:21
18,402,550
0
0
null
null
null
null
UTF-8
Java
false
false
1,338
java
package org.jocean.j2se.unit; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.springframework.core.io.Resource; import com.google.common.collect.Maps; public class LocalRef implements UnitKeeperAware { public void setLocation(final Resource location) { this._location = location; } public void stop() { if (null != this._unitKeeper) { this._unitKeeper.deleteUnit("#"); } } private static String[] genSourceFrom(final Properties properties) { final String value = properties.getProperty(SPRING_XML_KEY); properties.remove(SPRING_XML_KEY); return null!=value ? value.split(",") : null; } @Override public void setUnitKeeper(final UnitKeeper keeper) { this._unitKeeper = keeper; try (final InputStream is = this._location.getInputStream()) { final Properties props = new Properties(); props.load(is); final String[] source = genSourceFrom(props); this._unitKeeper.createOrUpdateUnit("#", source, Maps.fromProperties(props)); } catch (IOException e) { } } private Resource _location; private UnitKeeper _unitKeeper; private static final String SPRING_XML_KEY = "__spring.xml"; }
[ "isdom.maming@gmail.com" ]
isdom.maming@gmail.com
131ce83f1b7d500277684034d6632b35c62d8a5a
947e71b34d21f3c9f5c0a197d91a880f346afa6c
/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
f5bc0eb618902b25878b4f6a2cf60630671163df
[ "MIT", "Apache-2.0", "GPL-1.0-or-later", "GPL-2.0-or-later", "OFL-1.1", "MS-PL", "AFL-2.1", "GPL-2.0-only", "Python-2.0", "BSD-2-Clause", "BSD-3-Clause", "LicenseRef-scancode-free-unknown" ]
permissive
liuwenru/Apache-Ambari-ZH
4bc432d4ea7087bb353a6dd97ffda0a85cb0fef0
7879810067f1981209b658ceb675ac76e951b07b
refs/heads/master
2023-01-14T14:43:06.639598
2020-07-28T12:06:25
2020-07-28T12:06:25
223,551,095
38
44
Apache-2.0
2023-01-02T21:55:10
2019-11-23T07:43:49
Java
UTF-8
Java
false
false
6,316
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.ambari.logfeeder.metrics; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.TreeMap; import org.apache.ambari.logfeeder.conf.LogFeederSecurityConfig; import org.apache.ambari.logfeeder.conf.MetricsCollectorConfig; import org.apache.ambari.logfeeder.plugin.common.MetricData; import org.apache.ambari.logfeeder.util.LogFeederUtil; import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric; import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics; import org.apache.log4j.Logger; import javax.annotation.PostConstruct; import javax.inject.Inject; public class MetricsManager { private static final Logger LOG = Logger.getLogger(MetricsManager.class); private boolean isMetricsEnabled = false; private String appId = "logfeeder"; private long lastPublishTimeMS = 0; // Let's do the first publish immediately private long lastFailedPublishTimeMS = System.currentTimeMillis(); // Reset the clock private int publishIntervalMS = 60 * 1000; private int maxMetricsBuffer = 60 * 60 * 1000; // If AMS is down, we should not keep the metrics in memory forever private HashMap<String, TimelineMetric> metricsMap = new HashMap<>(); private LogFeederAMSClient amsClient = null; @Inject private MetricsCollectorConfig metricsCollectorConfig; @Inject private LogFeederSecurityConfig logFeederSecurityConfig; @PostConstruct public void init() { LOG.info("Initializing MetricsManager()"); if (amsClient == null) { amsClient = new LogFeederAMSClient(metricsCollectorConfig, logFeederSecurityConfig); } if (amsClient.getCollectorUri(null) != null) { if (LogFeederUtil.hostName == null) { isMetricsEnabled = false; LOG.error("Failed getting hostname for node. Disabling publishing LogFeeder metrics"); } else { isMetricsEnabled = true; LOG.info("LogFeeder Metrics is enabled. Metrics host=" + amsClient.getCollectorUri(null)); } } else { LOG.info("LogFeeder Metrics publish is disabled"); } } public boolean isMetricsEnabled() { return isMetricsEnabled; } public synchronized void useMetrics(List<MetricData> metricsList) { if (!isMetricsEnabled) { return; } LOG.info("useMetrics() metrics.size=" + metricsList.size()); long currMS = System.currentTimeMillis(); gatherMetrics(metricsList, currMS); publishMetrics(currMS); } private void gatherMetrics(List<MetricData> metricsList, long currMS) { Long currMSLong = new Long(currMS); for (MetricData metric : metricsList) { if (metric.metricsName == null) { LOG.debug("metric.metricsName is null"); continue; } long currCount = metric.value; if (!metric.isPointInTime && metric.publishCount > 0 && currCount <= metric.prevPublishValue) { LOG.debug("Nothing changed. " + metric.metricsName + ", currCount=" + currCount + ", prevPublishCount=" + metric.prevPublishValue); continue; } metric.publishCount++; LOG.debug("Ensuring metrics=" + metric.metricsName); TimelineMetric timelineMetric = metricsMap.get(metric.metricsName); if (timelineMetric == null) { LOG.debug("Creating new metric obbject for " + metric.metricsName); timelineMetric = new TimelineMetric(); timelineMetric.setMetricName(metric.metricsName); timelineMetric.setHostName(LogFeederUtil.hostName); timelineMetric.setAppId(appId); timelineMetric.setStartTime(currMS); timelineMetric.setType("Long"); timelineMetric.setMetricValues(new TreeMap<Long, Double>()); metricsMap.put(metric.metricsName, timelineMetric); } LOG.debug("Adding metrics=" + metric.metricsName); if (metric.isPointInTime) { timelineMetric.getMetricValues().put(currMSLong, new Double(currCount)); } else { Double value = timelineMetric.getMetricValues().get(currMSLong); if (value == null) { value = new Double(0); } value += (currCount - metric.prevPublishValue); timelineMetric.getMetricValues().put(currMSLong, value); metric.prevPublishValue = currCount; } } } private void publishMetrics(long currMS) { if (!metricsMap.isEmpty() && currMS - lastPublishTimeMS > publishIntervalMS) { try { TimelineMetrics timelineMetrics = new TimelineMetrics(); timelineMetrics.setMetrics(new ArrayList<TimelineMetric>(metricsMap.values())); amsClient.emitMetrics(timelineMetrics); LOG.info("Published " + timelineMetrics.getMetrics().size() + " metrics to AMS"); metricsMap.clear(); lastPublishTimeMS = currMS; } catch (Throwable t) { LOG.warn("Error sending metrics to AMS.", t); if (currMS - lastFailedPublishTimeMS > maxMetricsBuffer) { LOG.error("AMS was not sent for last " + maxMetricsBuffer / 1000 + " seconds. Purging it and will start rebuilding it again"); metricsMap.clear(); lastFailedPublishTimeMS = currMS; } } } else { LOG.info("Not publishing metrics. metrics.size()=" + metricsMap.size() + ", lastPublished=" + (currMS - lastPublishTimeMS) / 1000 + " seconds ago, intervalConfigured=" + publishIntervalMS / 1000); } } public void setAmsClient(LogFeederAMSClient amsClient) { this.amsClient = amsClient; } }
[ "ijarvis@sina.com" ]
ijarvis@sina.com
2c1e9a236b331380ef6c06737fdca207532782d3
ac94ac4e2dca6cbb698043cef6759e328c2fe620
/labs/greenqloud-compute/src/test/java/org/jclouds/greenqloud/compute/services/GreenQloudInstanceClientLiveTest.java
349711b5e5e4a54ae0fd1abdcb31ef7d2417314a
[ "Apache-2.0" ]
permissive
andreisavu/jclouds
25c528426c8144d330b07f4b646aa3b47d0b3d17
34d9d05eca1ed9ea86a6977c132665d092835364
refs/heads/master
2021-01-21T00:04:41.914525
2012-11-13T18:11:04
2012-11-13T18:11:04
2,503,585
2
0
null
2012-10-16T21:03:12
2011-10-03T09:11:27
Java
UTF-8
Java
false
false
1,240
java
/** * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. jclouds 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.jclouds.greenqloud.compute.services; import org.jclouds.ec2.services.InstanceClientLiveTest; import org.testng.annotations.Test; /** * * @author Adrian Cole */ @Test(groups = "live", singleThreaded = true, testName = "GreenQloudInstanceClientLiveTest") public class GreenQloudInstanceClientLiveTest extends InstanceClientLiveTest { public GreenQloudInstanceClientLiveTest() { provider = "greenqloud-compute"; } }
[ "adrian@jclouds.org" ]
adrian@jclouds.org
3a73f15c95a9e9a56518ad7bd3f97cec2a4b52be
81b0bb3cfb2e9501f53451e7f03ec072ee2b0e13
/src/com/google/android/gms/flags/impl/zzb.java
f8ea38e300cfbd339d7e537773794380606e3c04
[]
no_license
reverseengineeringer/me.lyft.android
48bb85e8693ce4dab50185424d2ec51debf5c243
8c26caeeb54ffbde0711d3ce8b187480d84968ef
refs/heads/master
2021-01-19T02:32:03.752176
2016-07-19T16:30:00
2016-07-19T16:30:00
63,710,356
3
0
null
null
null
null
UTF-8
Java
false
false
807
java
package com.google.android.gms.flags.impl; import android.content.Context; import android.content.SharedPreferences; import com.google.android.gms.internal.zzui; import java.util.concurrent.Callable; public class zzb { private static SharedPreferences QA = null; public static SharedPreferences zzn(Context paramContext) { try { if (QA == null) { QA = (SharedPreferences)zzui.zzb(new Callable() { public SharedPreferences zzbfv() { return getSharedPreferences("google_sdk_flags", 1); } }); } paramContext = QA; return paramContext; } finally {} } } /* Location: * Qualified Name: com.google.android.gms.flags.impl.zzb * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
4153771302e9cd0c67ba484b5956022504d0110d
b2ed02fe65e6a31474d37a484be838742d59e626
/gxpenses-client/src/main/java/com/nuvola/gxpenses/client/web/application/budget/widget/BudgetSiderUiHandlers.java
74f45df57c71b849d09b4ec958299e956b9f2ead
[]
no_license
imrabti/gxpenses-old
5fdbf558508dbb023d574afdd06a53b46d798f7c
2f81421b88d211b23ec3843a1363a3061a228f83
refs/heads/master
2021-01-13T01:15:09.791346
2014-03-25T08:31:31
2014-03-25T08:31:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.nuvola.gxpenses.client.web.application.budget.widget; import com.google.gwt.user.client.ui.Widget; import com.gwtplatform.mvp.client.UiHandlers; import com.nuvola.gxpenses.common.shared.business.Budget; public interface BudgetSiderUiHandlers extends UiHandlers { void addNewBudget(Widget relativeTo); void budgetSelected(Budget budget); }
[ "imrabti@gmail.com" ]
imrabti@gmail.com
c9afb82929f2ca55b8ecabf2837b5713d14d78ae
225e9c2aebb7b47971c738f45775713d7cfb15f5
/jdk/jdk1.8/src/main/org/omg/CORBA/WStringSeqHelper.java
20c17ee6bab423760371706d9a8aeccda1eef0ae
[]
no_license
smalldoctor/source-code
6bb53559840f138a456c160aa22d0d7bba5322a0
c7571807e8d29d46a353148de6dfce3e52f5cfe9
refs/heads/master
2022-11-05T19:01:27.152507
2019-07-02T09:57:44
2019-07-02T09:57:44
106,514,195
0
0
null
2022-10-05T19:09:17
2017-10-11T06:27:26
Java
UTF-8
Java
false
false
1,848
java
package org.omg.CORBA; /** * org/omg/CORBA/WStringSeqHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u141/9370/corba/src/share/classes/org/omg/PortableInterceptor/CORBAX.idl * Wednesday, July 12, 2017 4:36:59 AM PDT */ /** An array of WStrings */ abstract public class WStringSeqHelper { private static String _id = "IDL:omg.org/CORBA/WStringSeq:1.0"; public static void insert (org.omg.CORBA.Any a, String[] that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static String[] extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { __typeCode = org.omg.CORBA.ORB.init ().create_wstring_tc (0); __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.WStringSeqHelper.id (), "WStringSeq", __typeCode); } return __typeCode; } public static String id () { return _id; } public static String[] read (org.omg.CORBA.portable.InputStream istream) { String value[] = null; int _len0 = istream.read_long (); value = new String[_len0]; for (int _o1 = 0;_o1 < value.length; ++_o1) value[_o1] = istream.read_wstring (); return value; } public static void write (org.omg.CORBA.portable.OutputStream ostream, String[] value) { ostream.write_long (value.length); for (int _i0 = 0;_i0 < value.length; ++_i0) ostream.write_wstring (value[_i0]); } }
[ "15312408287@163.com" ]
15312408287@163.com
6e8938c1c40a626cebc440a2c89e5343dc280ec9
8bdd68a4c79fa30b6f5f71aa3252ea9cbc8e834c
/OCPay_api/src/main/java/com/odwallet/common/util/AES.java
b116af1081249187990abc2d9a24d00fc77b470d
[]
no_license
OdysseyProtocol/OCPay
3d82c5312d5d9e806acf7f47d8101664c938baac
ead8192d4c1dc6e333ecd984fc3a2aad5c250392
refs/heads/master
2020-03-10T00:52:04.868526
2018-05-27T03:23:47
2018-05-27T03:23:47
129,093,497
12
3
null
null
null
null
UTF-8
Java
false
false
2,838
java
package com.odwallet.common.util; import org.apache.commons.codec.binary.Base64; import javax.crypto.*; import javax.crypto.spec.SecretKeySpec; import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.Key; import java.security.NoSuchAlgorithmException; /** * Created by zxb on 8/31/16. */ public class AES { private static final String ENCODING = "UTF-8"; private static final String KEY_ALGORITHM = "AES";//产生密钥的算法 private static final String CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";//加解密算法 格式:算法/工作模式/填充模式 注意:ECB不使用IV参数 public static final String DESKEY = "PIlpNkvKoNGyM4CCGBA2gQ=="; /** * 产生密钥 */ public static String getKey() throws NoSuchAlgorithmException { KeyGenerator keyGenerator = KeyGenerator.getInstance(KEY_ALGORITHM); keyGenerator.init(128);//初始化密钥长度,128,192,256(选用192和256的时候需要配置无政策限制权限文件--JDK6) SecretKey key = keyGenerator.generateKey();//产生密钥 return Base64.encodeBase64String(key.getEncoded()); } /** * 还原密钥:二进制字节数组转换为Java对象 */ public static Key toKey(byte[] keyByte) { return new SecretKeySpec(keyByte, KEY_ALGORITHM); } /** * AES加密 * * @param data 带加密数据 * @param base64Key base64加密后的密钥 */ public static String encrypt(String data, String base64Key) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, UnsupportedEncodingException { Key key = toKey(Base64.decodeBase64(base64Key));//还原密钥 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);//JDK下用 cipher.init(Cipher.ENCRYPT_MODE, key);//设置加密模式并且初始化key byte[] encodedByte = cipher.doFinal(data.getBytes(ENCODING)); return Base64.encodeBase64String(encodedByte); } /** * AES解密 * @param data 待解密数据为字符串 * @param base64Key 密钥 */ public static String decrypt(String data, String base64Key) { try{ Key key = toKey(Base64.decodeBase64(base64Key));//还原密钥 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);//JDK下用 cipher.init(Cipher.DECRYPT_MODE, key); byte[] encodedByte = cipher.doFinal(Base64.decodeBase64(data)); return new String(encodedByte); }catch (Exception e){ e.printStackTrace(); } return null; } }
[ "developer@ocoin.sg" ]
developer@ocoin.sg
7a8a948e44aebb68a1e430d75e4fbdccb3530694
53b95b8940411003fb4fa82f920c91326656fea0
/release/1.4.2/java/proj/zoie/impl/indexing/internal/DiskSearchIndex.java
e1d2129426ec6acc337efb0907d9fe638819f561
[]
no_license
BGCX261/zoie-svn-to-git
a8a9c272a952e96490e159f56e9d901885760e23
092ccdb992d57872337420ba9f7218b73e7118c5
refs/heads/master
2016-08-04T22:19:45.459439
2015-08-25T15:35:52
2015-08-25T15:35:52
41,485,815
0
0
null
null
null
null
UTF-8
Java
false
false
6,052
java
package proj.zoie.impl.indexing.internal; import java.io.File; import java.io.IOException; import java.nio.channels.ReadableByteChannel; import org.apache.log4j.Logger; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.IndexWriter.MaxFieldLength; import org.apache.lucene.search.Similarity; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.NIOFSDirectory; import proj.zoie.api.ZoieIndexReader; import proj.zoie.api.indexing.IndexReaderDecorator; public class DiskSearchIndex extends BaseSearchIndex{ private final File _location; private final IndexReaderDispenser _dispenser; private MergePolicy _mergePolicy; private ZoieIndexDeletionPolicy _deletionPolicy; public static final Logger log = Logger.getLogger(DiskSearchIndex.class); DiskSearchIndex(File location, IndexReaderDecorator<?> decorator, MergePolicy mergePolicy) { _location = location; _dispenser = new IndexReaderDispenser(_location, decorator); _mergePolicy = mergePolicy; _mergeScheduler = new SerialMergeScheduler(); _deletionPolicy = new ZoieIndexDeletionPolicy(); } public long getVersion() { return _dispenser.getCurrentVersion(); } /** * Gets the number of docs in the current loaded index * @return number of docs */ public int getNumdocs() { IndexReader reader=_dispenser.getIndexReader(); if (reader!=null) { return reader.numDocs(); } else { return 0; } } /** * Close and releases dispenser and clean up */ public void close() { super.close(); // close the dispenser if (_dispenser != null) { _dispenser.close(); } } /** * Refreshes the index reader. Actual creation of a new index reader is deferred */ public void refresh() { _dispenser.closeReader(); } @Override protected void finalize() { close(); } public static FSDirectory getIndexDir(File location) throws IOException { IndexSignature sig = null; if (location.exists()) { sig = IndexReaderDispenser.getCurrentIndexSignature(location); } if (sig == null) { File directoryFile = new File(location, IndexReaderDispenser.INDEX_DIRECTORY); sig = new IndexSignature(IndexReaderDispenser.INDEX_DIR_NAME, 0L); try { sig.save(directoryFile); } catch (IOException e) { throw e; } } File idxDir = new File(location, sig.getIndexPath()); FSDirectory directory = NIOFSDirectory.getDirectory(idxDir); return directory; } /** * Opens an index modifier. * @param analyzer Analyzer * @return IndexModifer instance */ public IndexWriter openIndexWriter(Analyzer analyzer,Similarity similarity) throws IOException { // create the parent directory _location.mkdirs(); FSDirectory directory = getIndexDir(_location); log.info("opening index writer at: "+directory.getFile().getAbsolutePath()); // create a new modifier to the index, assuming at most one instance is running at any given time boolean create = !IndexReader.indexExists(directory); IndexWriter idxWriter = new IndexWriter(directory, analyzer, create, _deletionPolicy, MaxFieldLength.UNLIMITED); idxWriter.setMergeScheduler(_mergeScheduler); idxWriter.setMergePolicy(_mergePolicy); idxWriter.setRAMBufferSizeMB(5); if (similarity != null) { idxWriter.setSimilarity(similarity); } return idxWriter; } /** * Gets the current reader */ public ZoieIndexReader openIndexReader() throws IOException { // use dispenser to get the reader return _dispenser.getIndexReader(); } @Override protected IndexReader openIndexReaderForDelete() throws IOException { _location.mkdirs(); FSDirectory directory = getIndexDir(_location); if (IndexReader.indexExists(directory)){ return IndexReader.open(directory,false); } else{ return null; } } /** * Gets a new reader, force a reader refresh * @return * @throws IOException */ public ZoieIndexReader getNewReader() throws IOException { return _dispenser.getNewReader(); } /** * Writes the current version/SCN to the disk */ public void setVersion(long version) throws IOException { // update new index file File directoryFile = new File(_location, IndexReaderDispenser.INDEX_DIRECTORY); IndexSignature sig = IndexSignature.read(directoryFile); sig.updateVersion(version); try { // make sure atomicity of the index publication File tmpFile = new File(_location, IndexReaderDispenser.INDEX_DIRECTORY + ".new"); sig.save(tmpFile); File tmpFile2 = new File(_location, IndexReaderDispenser.INDEX_DIRECTORY + ".tmp"); directoryFile.renameTo(tmpFile2); tmpFile.renameTo(directoryFile); tmpFile2.delete(); } catch (IOException e) { throw e; } } public DiskIndexSnapshot getSnapshot() { IndexSignature sig = IndexReaderDispenser.getCurrentIndexSignature(_location); if(sig != null) { ZoieIndexDeletionPolicy.Snapshot snapshot = _deletionPolicy.getSnapshot(); if(snapshot != null) { return new DiskIndexSnapshot(sig, snapshot); } } return null; } public void importSnapshot(ReadableByteChannel channel) throws IOException { File idxDir = new File(_location, IndexReaderDispenser.INDEX_DIR_NAME); idxDir.mkdirs(); DiskIndexSnapshot.readSnapshot(channel, _location); } }
[ "you@example.com" ]
you@example.com
459bd1fd05573dd53e8465cceddfde7a023f2976
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/yauaa/learning/3920/MatcherRequireAction.java
a84a2ee20bc2429c4ef67bfe82bea7d5625feee2
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,450
java
/* * Yet Another UserAgent Analyzer * Copyright (C) 2013-2018 Niels Basjes * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package nl.basjes.parse.useragent.analyze; import nl.basjes.parse.useragent.analyze.treewalker.steps.WalkList.WalkResult; import nl.basjes.parse.useragent.parser.UserAgentTreeWalkerParser; import org.antlr.v4.runtime.ParserRuleContext;import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MatcherRequireAction extends MatcherAction { private static final Logger LOG = LoggerFactory.getLogger(MatcherRequireAction.class); public MatcherRequireAction(String config, Matcher matcher) { init(config, matcher); } protected ParserRuleContext parseWalkerExpression(UserAgentTreeWalkerParser parser) { return parser.matcherRequire(); } @Override public void initialize() { super.initialize(); evaluator.pruneTrailingStepsThatCannotFail(); } protected void setFixedValue(String fixedValue) { throw new InvalidParserConfigurationException( "It is useless to put a fixed value \"" + fixedValue + "\" in the require section."); } private boolean foundRequiredValue = false; @Override public void inform(String key, WalkResult foundValue) { foundRequiredValue = true; if (verbose) { LOG.info("Info REQUIRE: {}", key); LOG.info("NEED REQUIRE: {}", getMatchExpression()); LOG.info("KEPT REQUIRE: {}", key); } } @Override public boolean obtainResult() { if (isValidIsNull()) { foundRequiredValue = true; } processInformedMatches(); return foundRequiredValue; } @Override public void reset() { super.reset(); foundRequiredValue = false; } @Override public String toString() { return "Require: " + getMatchExpression(); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
0d3d723d29873d31a81361368c6754dd927ed42d
b4ff19bae9cbb1ba773aceb4ec263d6d4bc98cd9
/vucAndroid/app/src/main/java/dk/lundogbendsen/vuc/diverse/DiverseIO.java
e8ac6a33a58e1bca2dba0812b5212ba6ea85e6ef
[]
no_license
elek90/VUC-app
df769c889be4ae18d6bb9de01a5cfddb8eb03310
5d50a96e4e3d608504cce8a1a5e9d3998f756dc1
refs/heads/master
2021-01-18T07:04:09.243892
2016-02-09T20:36:54
2016-02-09T20:36:54
51,397,462
0
0
null
2016-02-09T20:30:50
2016-02-09T20:30:49
null
UTF-8
Java
false
false
5,556
java
package dk.lundogbendsen.vuc.diverse; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.Reader; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.URL; import java.net.UnknownHostException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import dk.lundogbendsen.vuc.App; public class DiverseIO { /** * Tjek for om vi er på et netværk der kræver login eller lignende. * Se 'Handling Network Sign-On' i http://developer.android.com/reference/java/net/HttpURLConnection.html */ private static void tjekOmdirigering(URL u, HttpURLConnection urlConnection) throws IOException { URL u2 = urlConnection.getURL(); if (!u.getHost().equals(u2.getHost())) { // Vi blev omdirigeret Log.d("tjekOmdirigering " + u); Log.d("tjekOmdirigering " + u2); //Log.rapporterFejl(omdirigeringsfejl); throw new UnknownHostException("Der blev omdirigeret fra " + u.getHost() + " til " + u2.getHost()); } } public static String læsStreng(InputStream is) throws IOException, UnsupportedEncodingException { // Det kan være nødvendigt at hoppe over BOM mark - se http://android.forums.wordpress.org/topic/xml-pull-error?replies=2 //is.read(); is.read(); is.read(); // - dette virker kun hvis der ALTID er en BOM // Hop over BOM - hvis den er der! is = new BufferedInputStream(is); // bl.a. FileInputStream understøtter ikke mark, så brug BufferedInputStream is.mark(1); // vi har faktisk kun brug for at søge én byte tilbage if (is.read() == 0xef) { is.read(); is.read(); } // Der var en BOM! Læs de sidste 2 byte else is.reset(); // Der var ingen BOM - hop tilbage til start final char[] buffer = new char[0x3000]; StringBuilder out = new StringBuilder(); Reader in = new InputStreamReader(is, "UTF-8"); int read; do { read = in.read(buffer, 0, buffer.length); if (read > 0) { out.append(buffer, 0, read); } } while (read >= 0); in.close(); return out.toString(); } public static ArrayList<String> jsonArrayTilArrayListString(JSONArray j) throws JSONException { int n = j.length(); ArrayList<String> res = new ArrayList<String>(n); for (int i = 0; i < n; i++) { res.add(j.getString(i)); } return res; } public static String hentUrlSomStreng(String url) throws IOException { Log.d("hentUrlSomStreng lgd=" + url.length() + " " + url); URL u = new URL(url); HttpURLConnection urlConnection = (HttpURLConnection) u.openConnection(); urlConnection.setConnectTimeout(15000); urlConnection.setReadTimeout(90 * 1000); // 1 1/2 minut urlConnection.connect(); // http://stackoverflow.com/questions/8179658/urlconnection-getcontent-return-null InputStream is = urlConnection.getInputStream(); Log.d("åbnGETURLConnection url.length()=" + url.length() + " is=" + is + " is.available()=" + is.available()); if (urlConnection.getResponseCode() != 200) throw new IOException("HTTP-svar var " + urlConnection.getResponseCode() + " " + urlConnection.getResponseMessage() + " for " + u); tjekOmdirigering(u, urlConnection); return læsStreng(is); } public static JSONObject postJson(String url, String data) throws IOException, JSONException { //Log.d("postJson " + url+" med data="+data); URL u = new URL(url); HttpURLConnection urlConnection = (HttpURLConnection) u.openConnection(); urlConnection.setConnectTimeout(15000); urlConnection.setReadTimeout(90 * 1000); // 1 1/2 minut urlConnection.setRequestProperty("Content-Type", "application/json"); urlConnection.setDoOutput(true); urlConnection.connect(); // http://stackoverflow.com/questions/8179658/urlconnection-getcontent-return-null OutputStream os = urlConnection.getOutputStream(); os.write(data.getBytes()); os.close(); InputStream is = urlConnection.getInputStream(); if (urlConnection.getResponseCode() != 200) throw new IOException("HTTP-svar var " + urlConnection.getResponseCode() + " " + urlConnection.getResponseMessage() + " for " + u); tjekOmdirigering(u, urlConnection); return new JSONObject(læsStreng(is)); } public static int sletFilerÆldreEnd(File mappe, long tidsstempel) { int antalByteDerBlevSlettet = 0; int antalFilerDerBlevSlettet = 0; File[] files = mappe.listFiles(); if (files != null) { for (File file : files) { if (file.lastModified() < tidsstempel) { antalByteDerBlevSlettet += file.length(); antalFilerDerBlevSlettet++; file.delete(); } } } Log.d("sletFilerÆldreEnd: " + mappe.getName() + ": " + antalFilerDerBlevSlettet + " filer blev slettet, og " + antalByteDerBlevSlettet / 1000 + " kb frigivet"); return antalByteDerBlevSlettet; } public static File opretUnikFil(String filnavn, String endelse) { String tidsstempel = new SimpleDateFormat("MMdd_HHmm").format(new Date()); int n = 0; File fil; do { // lav unikt filnavn fil = new File(App.fillager, filnavn+"_"+tidsstempel+(n++==0?"":"_"+n) + endelse); Log.d("opretUnikFil "+fil); } while (fil.exists()); fil.getParentFile().mkdirs(); return fil; } }
[ "jacob.nordfalk@gmail.com" ]
jacob.nordfalk@gmail.com
362fc1f802778e56b2566a3254fc9513f770031d
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/serge-rider--dbeaver/0e63cf47bc4e548a934d29afd59209faed35ffb9/after/DataSourceDescriptorManager.java
94ccb11712e3bf7ea2a506de1bd58f4005466d7f
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
4,273
java
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org) * * 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. * * 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., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package org.jkiss.dbeaver.registry; import org.jkiss.code.Nullable; import org.jkiss.dbeaver.core.DBeaverCore; import org.jkiss.dbeaver.core.DBeaverUI; import org.jkiss.dbeaver.model.DBPConnectionConfiguration; import org.jkiss.dbeaver.model.edit.DBECommandContext; import org.jkiss.dbeaver.model.edit.DBEObjectMaker; import org.jkiss.dbeaver.model.impl.DBSObjectCache; import org.jkiss.dbeaver.model.impl.edit.AbstractObjectManager; import org.jkiss.dbeaver.model.struct.DBSObject; import org.jkiss.dbeaver.ui.actions.datasource.DataSourceHandler; import org.jkiss.dbeaver.ui.dialogs.connection.CreateConnectionDialog; import org.jkiss.dbeaver.ui.dialogs.connection.NewConnectionWizard; import java.util.Map; /** * DataSourceDescriptorManager */ public class DataSourceDescriptorManager extends AbstractObjectManager<DataSourceDescriptor> implements DBEObjectMaker<DataSourceDescriptor, DataSourceRegistry> { @Override public long getMakerOptions() { return 0; } @Nullable @Override public DBSObjectCache<? extends DBSObject, DataSourceDescriptor> getObjectsCache(DataSourceDescriptor object) { return null; } @Override public boolean canCreateObject(DataSourceRegistry parent) { return true; } @Override public boolean canDeleteObject(DataSourceDescriptor object) { return true; } @Override public DataSourceDescriptor createNewObject(DBECommandContext commandContext, DataSourceRegistry parent, Object copyFrom) { if (copyFrom != null) { DataSourceDescriptor dsTpl = (DataSourceDescriptor)copyFrom; DataSourceRegistry registry = parent != null ? parent : dsTpl.getRegistry(); DataSourceDescriptor dataSource = new DataSourceDescriptor( registry, DataSourceDescriptor.generateNewId(dsTpl.getDriver()), dsTpl.getDriver(), new DBPConnectionConfiguration(dsTpl.getConnectionConfiguration())); dataSource.copyFrom(dsTpl); // Generate new name String origName = dsTpl.getName(); String newName = origName; for (int i = 0; ; i++) { if (registry.findDataSourceByName(newName) == null) { break; } newName = origName + " " + (i + 1); } dataSource.setName(newName); registry.addDataSource(dataSource); } else { DataSourceRegistry registry; if (parent != null) { registry = parent; } else { registry = DBeaverCore.getInstance().getProjectRegistry().getActiveDataSourceRegistry(); } CreateConnectionDialog dialog = new CreateConnectionDialog( DBeaverUI.getActiveWorkbenchWindow(), new NewConnectionWizard(registry)); dialog.open(); } return null; } @Override public void deleteObject(DBECommandContext commandContext, final DataSourceDescriptor object, Map<String, Object> options) { Runnable remover = new Runnable() { @Override public void run() { object.getRegistry().removeDataSource(object); } }; if (object.isConnected()) { DataSourceHandler.disconnectDataSource(object, remover); } else { remover.run(); } } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
2c4c3d5cd7ba7a567b61a54852c37b6d388350ae
d60e287543a95a20350c2caeabafbec517cabe75
/LACCPlus/Camel/1168_2.java
95a1eb97e0e16707d62e21afa66915e166b5e2cc
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
968
java
//,temp,FhirPatchIT.java,97,113,temp,BoxFoldersManagerIT.java,135,152 //,3 public class xxx { @Test public void testCreateSharedLink() throws Exception { final Map<String, Object> headers = new HashMap<>(); // parameter type is String headers.put("CamelBox.folderId", testFolder.getID()); // parameter type is com.box.sdk.BoxSharedLink.Access headers.put("CamelBox.access", BoxSharedLink.Access.COLLABORATORS); // parameter type is java.util.Date headers.put("CamelBox.unshareDate", null); // parameter type is com.box.sdk.BoxSharedLink.Permissions headers.put("CamelBox.permissions", new BoxSharedLink.Permissions()); final com.box.sdk.BoxSharedLink result = requestBodyAndHeaders("direct://CREATEFOLDERSHAREDLINK", null, headers); assertNotNull(result, "createFolderSharedLink result"); LOG.debug("createFolderSharedLink: " + result); } };
[ "SHOSHIN\\sgholamian@shoshin.uwaterloo.ca" ]
SHOSHIN\sgholamian@shoshin.uwaterloo.ca
046839fafbe3fac176a718c2fc9d167f80e378b3
a8a57531e0d18ead4dbb54f444d049e9803a3280
/API/src/main/java/me/matamor/generalapi/api/entries/DataStorageManager.java
f9fbcfc83df82f754731361ce92d6598a5623892
[]
no_license
MaTaMoR/GeneralAPI
225bbb96c9d4e8190cee3a7b268f528af2ecccfa
07ce263da6f71119362212b4330a87c7f09975a3
refs/heads/master
2023-05-02T22:20:01.480168
2021-05-21T14:45:16
2021-05-21T14:45:16
369,565,207
0
0
null
null
null
null
UTF-8
Java
false
false
1,146
java
package me.matamor.generalapi.api.entries; import me.matamor.minesoundapi.storage.DataStorage; import me.matamor.minesoundapi.utils.Validate; import java.util.Collection; import java.util.Collections; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public class DataStorageManager { private final Map<Class<? extends DataStorage>, DataStorage> entries = new ConcurrentHashMap<>(); public <T extends DataStorage> T registerStorage(T storageManager) { Validate.isFalse(this.entries.containsKey(storageManager.getClass()), "The ConnectionHandler " + storageManager.getClass().getName() + " is already registered"); this.entries.put(storageManager.getClass(), storageManager); return storageManager; } public <T extends DataStorage> T getDatabase(Class<T> clazz) { DataStorage database = this.entries.get(clazz); return (database == null ? null : (T) database); } public Collection<DataStorage> getEntries() { return Collections.unmodifiableCollection(this.entries.values()); } public void unload() { this.entries.clear(); } }
[ "matamor98@hotmail.com" ]
matamor98@hotmail.com
075c5fbedc7a65556d29d7344241a30ff362e18a
99cbd6f329c21ef0e75082fedae229e785531c9e
/Ej00_Criptografia/src/_04_Cifrado_asimetrico/RandomKeyElGamalExample.java
0401513a05a40df7bf9078ccd03650e99ae0aefa
[]
no_license
Fsgilp/seguridad_java
ad331582e4fa67acf7109fd6d09eb2643d2ef450
ea48ad983102377a6c7b81c291140aa453ae37b6
refs/heads/master
2023-03-30T11:45:47.341067
2021-04-06T16:00:07
2021-04-06T16:00:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,451
java
package _04_Cifrado_asimetrico; import java.security.Key; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.SecureRandom; import javax.crypto.Cipher; /** * El Gamal example with random key generation. */ public class RandomKeyElGamalExample { public static void main( String[] args) throws Exception { byte[] input = new byte[] { (byte)0xbe, (byte)0xef }; Cipher cipher = Cipher.getInstance("ElGamal/None/NoPadding", "BC"); SecureRandom random = Utils.createFixedRandom(); // create the keys KeyPairGenerator generator = KeyPairGenerator.getInstance("ElGamal", "BC"); generator.initialize(256, random); KeyPair pair = generator.generateKeyPair(); Key pubKey = pair.getPublic(); Key privKey = pair.getPrivate(); System.out.println("input : " + Utils.toHex(input)); // encryption step cipher.init(Cipher.ENCRYPT_MODE, pubKey, random); byte[] cipherText = cipher.doFinal(input); System.out.println("cipher: " + Utils.toHex(cipherText)); // decryption step cipher.init(Cipher.DECRYPT_MODE, privKey); byte[] plainText = cipher.doFinal(cipherText); System.out.println("plain : " + Utils.toHex(plainText)); } }
[ "a@b.c" ]
a@b.c
9624675546f348efb3f36a27f5ace216a61102c1
0e0343f1ceacde0b67d7cbf6b0b81d08473265ab
/aurora_ide/aurora.ide.meta/src/aurora/ide/meta/extensions/ExtensionComponent.java
41635fda564908bfe97a350911dea60f3219a815
[]
no_license
Chajunghun/aurora-project
33d5f89e9f21c49d01d3d09d32102d3c496df851
d4d39861446ea941929780505987dbaf9e3b7a8d
refs/heads/master
2021-01-01T05:39:36.339810
2015-03-24T07:41:45
2015-03-24T07:41:45
33,435,911
0
1
null
null
null
null
UTF-8
Java
false
false
2,466
java
package aurora.ide.meta.extensions; import java.util.ArrayList; import java.util.List; import aurora.ide.helpers.DialogUtil; import aurora.ide.meta.gef.editors.components.ComponentCreator; public class ExtensionComponent { private String categoryId; private String creator; private String descriptor; private String id; private String name; private List<String> types = new ArrayList<String>(); private ComponentCreator cc; private String ioHandler; public ExtensionComponent(String categoryId, String creator, String descriptor, String id, String name, String ioHandler) { super(); this.categoryId = categoryId; this.creator = creator; this.descriptor = descriptor; this.id = id; this.name = name; this.ioHandler = ioHandler; } public ComponentCreator getCreator() { if (cc == null) { try { cc = (ComponentCreator) Class.forName(creator).newInstance(); } catch (InstantiationException e) { DialogUtil.logErrorException(e); } catch (IllegalAccessException e) { DialogUtil.logErrorException(e); } catch (ClassNotFoundException e) { DialogUtil.logErrorException(e); } } return cc; } public void setCreator(String creator) { this.creator = creator; } public String getDescriptor() { return descriptor; } public void setDescriptor(String descriptor) { this.descriptor = descriptor; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCategoryId() { return categoryId; } public void setCategoryId(String categoryId) { this.categoryId = categoryId; } // public DefaultIOHandler getIoHandler(String type) { // if (dio == null) { // try { // dio = (DefaultIOHandler) Class.forName(ioHandler).newInstance(); // } catch (InstantiationException e) { // DialogUtil.logErrorException(e); // } catch (IllegalAccessException e) { // DialogUtil.logErrorException(e); // } catch (ClassNotFoundException e) { // DialogUtil.logErrorException(e); // } // } // return dio; // } public void setIoHandler(String ioHandler) { this.ioHandler = ioHandler; } public List<String> getTypes() { return types; } public void setTypes(String types) { if (types != null) { String[] split = types.split(","); for (String s : split) { this.types.add(s.trim().toLowerCase()); } } } }
[ "rufus.sly@gmail.com@c3805726-bc34-11dd-8164-2ff6f70dce53" ]
rufus.sly@gmail.com@c3805726-bc34-11dd-8164-2ff6f70dce53
b79416aafe9397441b49f0ef3a8beff8d63cd406
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/protocal/protobuf/ghy.java
c9e549e39d7043de7ba4d708f6d009dcb28b8939
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
6,870
java
package com.tencent.mm.protocal.protobuf; import com.tencent.matrix.trace.core.AppMethodBeat; import java.util.LinkedList; import org.json.JSONObject; public final class ghy extends com.tencent.mm.bx.a { public int IJG; public long YYo; public dhb aaLr; public acm aaLs; public int aayc; public LinkedList<String> acer; public LinkedList<aem> aces; public String vYk; public String yts; public ghy() { AppMethodBeat.i(117951); this.acer = new LinkedList(); this.aces = new LinkedList(); AppMethodBeat.o(117951); } private JSONObject toJSON() { AppMethodBeat.i(258719); JSONObject localJSONObject = new JSONObject(); try { com.tencent.mm.bk.a.a(localJSONObject, "ConfigKeys", this.acer, false); com.tencent.mm.bk.a.a(localJSONObject, "H5Version", Integer.valueOf(this.aayc), false); com.tencent.mm.bk.a.a(localJSONObject, "Language", this.yts, false); com.tencent.mm.bk.a.a(localJSONObject, "Scene", Integer.valueOf(this.IJG), false); com.tencent.mm.bk.a.a(localJSONObject, "BusinessType", Long.valueOf(this.YYo), false); com.tencent.mm.bk.a.a(localJSONObject, "NetType", this.vYk, false); com.tencent.mm.bk.a.a(localJSONObject, "Location", this.aaLr, false); com.tencent.mm.bk.a.a(localJSONObject, "ExtParams", this.aces, false); com.tencent.mm.bk.a.a(localJSONObject, "ChildMode", this.aaLs, false); label121: AppMethodBeat.o(258719); return localJSONObject; } catch (Exception localException) { break label121; } } public final int op(int paramInt, Object... paramVarArgs) { AppMethodBeat.i(117952); if (paramInt == 0) { paramVarArgs = (i.a.a.c.a)paramVarArgs[0]; paramVarArgs.e(1, 1, this.acer); paramVarArgs.bS(2, this.aayc); if (this.yts != null) { paramVarArgs.g(3, this.yts); } paramVarArgs.bS(4, this.IJG); paramVarArgs.bv(5, this.YYo); if (this.vYk != null) { paramVarArgs.g(6, this.vYk); } if (this.aaLr != null) { paramVarArgs.qD(7, this.aaLr.computeSize()); this.aaLr.writeFields(paramVarArgs); } paramVarArgs.e(8, 8, this.aces); if (this.aaLs != null) { paramVarArgs.qD(9, this.aaLs.computeSize()); this.aaLs.writeFields(paramVarArgs); } AppMethodBeat.o(117952); return 0; } int i; if (paramInt == 1) { i = i.a.a.a.c(1, 1, this.acer) + 0 + i.a.a.b.b.a.cJ(2, this.aayc); paramInt = i; if (this.yts != null) { paramInt = i + i.a.a.b.b.a.h(3, this.yts); } i = paramInt + i.a.a.b.b.a.cJ(4, this.IJG) + i.a.a.b.b.a.q(5, this.YYo); paramInt = i; if (this.vYk != null) { paramInt = i + i.a.a.b.b.a.h(6, this.vYk); } i = paramInt; if (this.aaLr != null) { i = paramInt + i.a.a.a.qC(7, this.aaLr.computeSize()); } i += i.a.a.a.c(8, 8, this.aces); paramInt = i; if (this.aaLs != null) { paramInt = i + i.a.a.a.qC(9, this.aaLs.computeSize()); } AppMethodBeat.o(117952); return paramInt; } if (paramInt == 2) { paramVarArgs = (byte[])paramVarArgs[0]; this.acer.clear(); this.aces.clear(); paramVarArgs = new i.a.a.a.a(paramVarArgs, unknownTagHandler); for (paramInt = com.tencent.mm.bx.a.getNextFieldNumber(paramVarArgs); paramInt > 0; paramInt = com.tencent.mm.bx.a.getNextFieldNumber(paramVarArgs)) { if (!super.populateBuilderWithField(paramVarArgs, this, paramInt)) { paramVarArgs.kFT(); } } AppMethodBeat.o(117952); return 0; } if (paramInt == 3) { Object localObject1 = (i.a.a.a.a)paramVarArgs[0]; ghy localghy = (ghy)paramVarArgs[1]; paramInt = ((Integer)paramVarArgs[2]).intValue(); Object localObject2; switch (paramInt) { default: AppMethodBeat.o(117952); return -1; case 1: localghy.acer.add(((i.a.a.a.a)localObject1).ajGk.readString()); AppMethodBeat.o(117952); return 0; case 2: localghy.aayc = ((i.a.a.a.a)localObject1).ajGk.aar(); AppMethodBeat.o(117952); return 0; case 3: localghy.yts = ((i.a.a.a.a)localObject1).ajGk.readString(); AppMethodBeat.o(117952); return 0; case 4: localghy.IJG = ((i.a.a.a.a)localObject1).ajGk.aar(); AppMethodBeat.o(117952); return 0; case 5: localghy.YYo = ((i.a.a.a.a)localObject1).ajGk.aaw(); AppMethodBeat.o(117952); return 0; case 6: localghy.vYk = ((i.a.a.a.a)localObject1).ajGk.readString(); AppMethodBeat.o(117952); return 0; case 7: paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt); i = paramVarArgs.size(); paramInt = 0; while (paramInt < i) { localObject1 = (byte[])paramVarArgs.get(paramInt); localObject2 = new dhb(); if ((localObject1 != null) && (localObject1.length > 0)) { ((dhb)localObject2).parseFrom((byte[])localObject1); } localghy.aaLr = ((dhb)localObject2); paramInt += 1; } AppMethodBeat.o(117952); return 0; case 8: paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt); i = paramVarArgs.size(); paramInt = 0; while (paramInt < i) { localObject1 = (byte[])paramVarArgs.get(paramInt); localObject2 = new aem(); if ((localObject1 != null) && (localObject1.length > 0)) { ((aem)localObject2).parseFrom((byte[])localObject1); } localghy.aces.add(localObject2); paramInt += 1; } AppMethodBeat.o(117952); return 0; } paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt); i = paramVarArgs.size(); paramInt = 0; while (paramInt < i) { localObject1 = (byte[])paramVarArgs.get(paramInt); localObject2 = new acm(); if ((localObject1 != null) && (localObject1.length > 0)) { ((acm)localObject2).parseFrom((byte[])localObject1); } localghy.aaLs = ((acm)localObject2); paramInt += 1; } AppMethodBeat.o(117952); return 0; } AppMethodBeat.o(117952); return -1; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.protocal.protobuf.ghy * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
305bdb212d05c477e0b4ec40e56611bfdff122e3
4b401eac46bc2f28b91a285a159f0c535d87fb89
/src/main/java/net/foxdenstudio/sponge/foxguard/plugin/region/world/WorldRegionBase.java
4a18185cd782b557c2b037c9bc71fd9f188d3381
[ "MIT" ]
permissive
FaeyUmbrea/FoxGuard
4e6eb402778f79a03374f35c2c2f2313b19ece9d
82264c5b6302651111bf19da7f837eba0882d5a2
refs/heads/master
2021-05-31T09:15:43.058350
2016-04-24T03:09:41
2016-04-24T03:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,650
java
/* * This file is part of FoxGuard, licensed under the MIT License (MIT). * * Copyright (c) gravityfox - https://gravityfox.net/ * Copyright (c) contributors * * 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 net.foxdenstudio.sponge.foxguard.plugin.region.world; import com.google.common.collect.ImmutableList; import net.foxdenstudio.sponge.foxguard.plugin.FGManager; import net.foxdenstudio.sponge.foxguard.plugin.object.FGObjectBase; import net.foxdenstudio.sponge.foxguard.plugin.handler.IHandler; import org.spongepowered.api.world.World; import java.util.ArrayList; import java.util.List; public abstract class WorldRegionBase extends FGObjectBase implements IWorldRegion { private final List<IHandler> handlers; private World world; WorldRegionBase(String name) { super(name); this.handlers = new ArrayList<>(); } @Override public List<IHandler> getHandlers() { return ImmutableList.copyOf(this.handlers); } @Override public boolean addHandler(IHandler handler) { if (!FGManager.getInstance().isRegistered(handler)) { return false; } return this.handlers.add(handler); } @Override public boolean removeHandler(IHandler handler) { return this.handlers.remove(handler); } @Override public void clearHandlers() { this.handlers.clear(); } @Override public World getWorld() { return this.world; } @Override public void setWorld(World world) { if (this.world == null) { this.world = world; } } }
[ "gravityreallyhatesme@gmail.com" ]
gravityreallyhatesme@gmail.com
4bc0e939f266327c07903abaa85b28654e769a88
c5b1841d84f5a75573d79b4272a6d574a35113b8
/src/main/java/com/hardik/flenderson/exception/handler/AccessTokenExpiredExceptionHandler.java
20f1687264b2d66313b97e54c46e6b81403821dd
[]
no_license
spring-open-source/human-resource-management-system
f835eee6c0e2525ffcdf1d6817c40ec9a72663e3
444b04577f4fbf8673ce1908405578b20f144d08
refs/heads/main
2023-04-17T21:34:06.370960
2021-04-27T04:10:01
2021-04-27T04:10:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,155
java
package com.hardik.flenderson.exception.handler; import java.time.LocalDateTime; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import com.hardik.flenderson.exception.AccessTokenExpiredException; import com.hardik.flenderson.exception.dto.ExceptionResponseDto; @RestControllerAdvice public class AccessTokenExpiredExceptionHandler extends ResponseEntityExceptionHandler { @ExceptionHandler(AccessTokenExpiredException.class) public ResponseEntity<ExceptionResponseDto> handler(Exception exception, WebRequest webRequest) { return ResponseEntity.status(HttpStatus.BAD_REQUEST) .body(ExceptionResponseDto.builder().timestamp(LocalDateTime.now()) .statusCode(HttpStatus.BAD_REQUEST.value()).message(exception.getMessage()) .exception(exception.getClass().getSimpleName().toUpperCase()).build()); } }
[ "hardik.behl7444@gmail.com" ]
hardik.behl7444@gmail.com
d8f5a17e1b791f307f21bc3e72aad43c31a469be
92225460ebca1bb6a594d77b6559b3629b7a94fa
/src/com/kingdee/eas/fdc/schedule/IBizType.java
77b3f3f6d522691ab2335cab787d597ea7a5c1d3
[]
no_license
yangfan0725/sd
45182d34575381be3bbdd55f3f68854a6900a362
39ebad6e2eb76286d551a9e21967f3f5dc4880da
refs/heads/master
2023-04-29T01:56:43.770005
2023-04-24T05:41:13
2023-04-24T05:41:13
512,073,641
0
1
null
null
null
null
UTF-8
Java
false
false
1,318
java
package com.kingdee.eas.fdc.schedule; import com.kingdee.bos.BOSException; //import com.kingdee.bos.metadata.*; import com.kingdee.bos.framework.*; import com.kingdee.bos.util.*; import com.kingdee.bos.Context; import java.lang.String; import com.kingdee.bos.util.*; import com.kingdee.eas.common.EASBizException; import com.kingdee.bos.metadata.entity.EntityViewInfo; import com.kingdee.bos.dao.IObjectPK; import com.kingdee.bos.Context; import com.kingdee.bos.BOSException; import com.kingdee.eas.framework.CoreBaseInfo; import com.kingdee.bos.framework.*; import com.kingdee.eas.framework.IDataBase; import com.kingdee.bos.metadata.entity.SelectorItemCollection; import com.kingdee.eas.framework.CoreBaseCollection; public interface IBizType extends IDataBase { public BizTypeInfo getBizTypeInfo(IObjectPK pk) throws BOSException, EASBizException; public BizTypeInfo getBizTypeInfo(IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException; public BizTypeInfo getBizTypeInfo(String oql) throws BOSException, EASBizException; public BizTypeCollection getBizTypeCollection() throws BOSException; public BizTypeCollection getBizTypeCollection(EntityViewInfo view) throws BOSException; public BizTypeCollection getBizTypeCollection(String oql) throws BOSException; }
[ "yfsmile@qq.com" ]
yfsmile@qq.com
f45eefc75c18e712c88b0d23e3cef1dcecdf2867
2c87edb3c63040e33c85f483d71ea8cb40f13693
/src/main/java/com/example/demo/repository/SimpleSingerRepository.java
3142dc99654b2fb4c46dcd584a5e0dd37db09a00
[]
no_license
sieunkr/graphql-gds-sample
d159408983c73c1774525c6a05f0343488423e7e
331ea5dc3d45add809d8955efad5e8deb577362d
refs/heads/master
2023-03-26T10:47:43.184105
2021-03-21T03:48:55
2021-03-21T03:48:55
347,296,849
0
1
null
null
null
null
UTF-8
Java
false
false
1,572
java
package com.example.demo.repository; import com.example.demo.type.GenderCode; import com.example.demo.type.Singer; import org.springframework.stereotype.Repository; import javax.annotation.PostConstruct; import java.util.*; import java.util.stream.Collectors; @Repository public class SimpleSingerRepository implements SingerRepository { private List<Singer> singerList = new ArrayList<>(); private Map<String, Singer> singerMap = new HashMap<>(); @PostConstruct void init() { singerList = List.of( Singer.builder() .name("아이유") .age(29) .gender(GenderCode.FEMALE) .build(), Singer.builder() .name("피오") .age(29) .gender(GenderCode.MALE) .build(), Singer.builder() .name("백아연") .age(29) .gender(GenderCode.FEMALE) .build(), Singer.builder() .name("지수") .age(27) .gender(GenderCode.FEMALE) .build() ); } @Override public List<Singer> findAll() { return singerList; } @Override public List<Singer> findByName(String name) { return findAll().stream().filter(s -> s.getName().contains(name)).collect(Collectors.toList()); } }
[ "sieunkr@gmail.com" ]
sieunkr@gmail.com
bf0fb6f69bdddc7404a1e71b4576a73ac1c54b62
77b3b4b3e08253c0fd8ca4bc5f5176e9d0507986
/Eighth_Config_Context_Example/src/EmployeeRegistration.java
83a3090937c77587cec0d8977aa57c9aa0f7092e
[]
no_license
debiprasadmishra50/Advance-Java-Practice---JAVA-EE
413bcffd6631b85d0d892403f571b0a69dbf1f2b
40edbb070c3c92885fd0f33ebabe1fd70e8b5b62
refs/heads/master
2022-11-10T17:09:23.478424
2020-06-28T07:17:26
2020-06-28T07:17:26
275,529,224
0
0
null
null
null
null
UTF-8
Java
false
false
2,537
java
import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class EmployeeRegistration */ public class EmployeeRegistration extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public EmployeeRegistration() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); response.setContentType("text/html"); int empid = Integer.parseInt(request.getParameter("empid")); String ename = request.getParameter("ename"); double salary = Double.parseDouble(request.getParameter("salary")); out.print("<br>Roll : "+empid); out.print("<br><hr>Name : "+ename); out.print("<br><hr>Cgpa : "+salary); out.print("<hr>"); try { ServletContext context = getServletContext(); ServletConfig config = getServletConfig(); String driver = context.getInitParameter("driver"); String url = context.getInitParameter("url"); String username = config.getInitParameter("username"); String password = config.getInitParameter("password"); Class.forName(driver); Connection con = DriverManager.getConnection(url,username,password); String sql = "insert into Employee values (?,?,?)"; PreparedStatement pst = con.prepareStatement(sql); pst.setInt(1, empid); pst.setString(2, ename); pst.setDouble(3, salary); int status = pst.executeUpdate(); if(status > 0) out.println("<h1>Employee Records inserted Successfully</h1>"); else out.println("<h1>Error insertion in Employee Registration</h1>"); } catch (Exception e) { e.printStackTrace(); } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "debiprasadmishra50@gmail.com" ]
debiprasadmishra50@gmail.com
85577e2bc0432bbb5e4f4d5f1d27d07b054cfc84
fe49bebdae362679d8ea913d97e7a031e5849a97
/bqerpweb/src/power/web/manage/stat/action/StatItemRealtimeAction.java
f6640222af47a22550bc5f71acd6da150b5e19f2
[]
no_license
loveyeah/BQMIS
1f87fad2c032e2ace7e452f13e6fe03d8d09ce0d
a3f44db24be0fcaa3cf560f9d985a6ed2df0b46b
refs/heads/master
2020-04-11T05:21:26.632644
2018-03-08T02:13:18
2018-03-08T02:13:18
124,322,652
0
2
null
null
null
null
UTF-8
Java
false
false
3,290
java
package power.web.manage.stat.action; import power.ear.comm.ejb.PageObject; import power.ejb.manage.stat.BpCStatItemRealtime; import power.ejb.manage.stat.BpCStatItemRealtimeFacadeRemote; import power.ejb.manage.stat.form.StatItemFrom; import power.web.comm.AbstractAction; import power.web.comm.Constants; import com.googlecode.jsonplugin.JSONException; import com.googlecode.jsonplugin.JSONUtil; @SuppressWarnings("serial") public class StatItemRealtimeAction extends AbstractAction { private BpCStatItemRealtimeFacadeRemote realtimeRemote; public StatItemRealtimeAction() { realtimeRemote = (BpCStatItemRealtimeFacadeRemote) factory.getFacadeRemote("BpCStatItemRealtimeFacade"); } /** * 查询指标对应数据 * */ public void getStatItemList() throws JSONException { String argFuzzy = request.getParameter("argFuzzy"); PageObject obj = new PageObject(); int start = Integer.parseInt(request.getParameter("start")); int limit = Integer.parseInt(request.getParameter("limit")); obj = realtimeRemote.findStatItemForCorrespond(argFuzzy,start,limit); String str = JSONUtil.serialize(obj); if ("".equals(str)) { str = "{\"list\":[],\"totalCount\":null}"; } write(str); } // /** // * 查询节点对应数据 // * // */ // public void getDcsNodeList() throws JSONException { // PageObject obj = new PageObject(); // int start = Integer.parseInt(request.getParameter("start")); // int limit = Integer.parseInt(request.getParameter("limit")); // String queryKey = request.getParameter("queryKey"); // obj = realtimeRemote.findDcsNodeForCorrespond(queryKey,start,limit); // String str = JSONUtil.serialize(obj); // if ("".equals(str)) { // str = "{\"list\":[],\"totalCount\":null}"; // } // write(str); // } /** * 查询指标对应的采集点信息 * @throws JSONException */ public void findCorrespondByItem() throws JSONException{ String itemCode = request.getParameter("itemCode"); StatItemFrom model=realtimeRemote.findItemCorrespondInfo(itemCode); write(JSONUtil.serialize(model)); } /** * 生成指标编码与节点的对应信息 */ public void generateCorrespond() { String itemCode = request.getParameter("itemCode"); String nodeCode = request.getParameter("nodeCode"); String apartCode = request.getParameter("apartCode"); BpCStatItemRealtime model = realtimeRemote.findById(itemCode); if(model == null) { BpCStatItemRealtime entity=new BpCStatItemRealtime(); entity.setItemCode(itemCode); entity.setNodeCode(nodeCode); entity.setApartCode(apartCode); realtimeRemote.save(entity); } else { model.setNodeCode(nodeCode); model.setApartCode(apartCode); realtimeRemote.update(model); } write(Constants.ADD_SUCCESS); } /** * 删除指标编码与节点的对应信息 */ public void cancelCorrespond() { String itemCode = request.getParameter("itemCode"); BpCStatItemRealtime entity = new BpCStatItemRealtime(); entity.setItemCode(itemCode); BpCStatItemRealtime returnEntity = realtimeRemote.delete(entity); if(returnEntity != null ) { write(Constants.DELETE_SUCCESS); } else { write(Constants.DELETE_FAILURE); } } }
[ "yexinhua@rtdata.cn" ]
yexinhua@rtdata.cn
1b7706ab94f41ca2bf9352829c19bf891a229453
77099bed3ce32eab5298af75677e5f1a88e484ec
/src/main/java/com/jin/service/GreetingService.java
5885daf7cc75191603f4b186b7de961ba83b34e7
[]
no_license
cicadasworld/spring-framework-in-depth
c841aa584392c05ca9af3e4e759727a8583f2be7
29f5efdffda3825f057f6ec3d062080f1c1afff4
refs/heads/master
2022-04-16T06:18:25.022363
2020-04-19T04:15:16
2020-04-19T04:15:16
256,908,759
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package com.jin.service; public class GreetingService { private final String greeting; public GreetingService(String greeting) { this.greeting = greeting; } public String getGreeting(String name) { return greeting + " " + name; } }
[ "flyterren@163.com" ]
flyterren@163.com
2031ae46eadd73e61802f9586b8490c3db413ed3
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/plugin/topstory/ui/video/fs/b.java
d31b645d55c3b8a3cad494842992e94f85681492
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
6,949
java
package com.tencent.mm.plugin.topstory.ui.video.fs; import android.graphics.PointF; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.i; import android.support.v7.widget.RecyclerView.r.b; import android.support.v7.widget.ah; import android.support.v7.widget.am; import android.view.View; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.plugin.topstory.ui.widget.g; public final class b extends g { private am amf; private am amg; private static int a(RecyclerView.i parami, View paramView, am paramam) { AppMethodBeat.i(1866); int i = paramam.bf(paramView); int j = paramam.bj(paramView) / 2; if (parami.getClipToPadding()); for (int k = paramam.je() + paramam.jg() / 2; ; k = paramam.getEnd() / 2) { AppMethodBeat.o(1866); return j + i - k; } } private static View a(RecyclerView.i parami, am paramam) { View localView1 = null; View localView2 = null; AppMethodBeat.i(1867); int i = parami.getChildCount(); if (i == 0) { AppMethodBeat.o(1867); return localView2; } int j; label49: int m; if (parami.getClipToPadding()) { j = paramam.je() + paramam.jg() / 2; int k = 2147483647; m = 0; localView2 = localView1; label58: if (m >= i) break label123; localView1 = parami.getChildAt(m); int n = Math.abs(paramam.bf(localView1) + paramam.bj(localView1) / 2 - j); if (n >= k) break label132; localView2 = localView1; k = n; } label132: while (true) { m++; break label58; j = paramam.getEnd() / 2; break label49; label123: AppMethodBeat.o(1867); break; } } private am b(RecyclerView.i parami) { AppMethodBeat.i(1869); if ((this.amf == null) || (this.amf.getLayoutManager() != parami)) this.amf = am.e(parami); parami = this.amf; AppMethodBeat.o(1869); return parami; } private am c(RecyclerView.i parami) { AppMethodBeat.i(1870); if ((this.amg == null) || (this.amg.getLayoutManager() != parami)) this.amg = am.d(parami); parami = this.amg; AppMethodBeat.o(1870); return parami; } private static View c(RecyclerView.i parami, am paramam) { View localView1 = null; View localView2 = null; AppMethodBeat.i(1868); int i = parami.getChildCount(); if (i == 0) { AppMethodBeat.o(1868); return localView2; } int j = 2147483647; int k = 0; localView2 = localView1; label38: if (k < i) { localView1 = parami.getChildAt(k); int m = paramam.bf(localView1); if (m >= j) break label87; localView2 = localView1; j = m; } label87: while (true) { k++; break label38; AppMethodBeat.o(1868); break; } } public final int a(RecyclerView.i parami, int paramInt1, int paramInt2) { int i = 0; int j = -1; AppMethodBeat.i(1864); if ((Math.abs(paramInt2) <= 500) || (Math.abs(paramInt1) >= Math.abs(paramInt2))) { AppMethodBeat.o(1864); paramInt1 = j; } while (true) { return paramInt1; int k = parami.getItemCount(); if (k == 0) { AppMethodBeat.o(1864); paramInt1 = j; } else { View localView = null; if (parami.iH()) localView = c(parami, b(parami)); while (true) { if (localView != null) break label126; AppMethodBeat.o(1864); paramInt1 = j; break; if (parami.iG()) localView = c(parami, c(parami)); } label126: int m = RecyclerView.i.bt(localView); if (m == -1) { AppMethodBeat.o(1864); paramInt1 = j; } else { if (parami.iG()) if (paramInt1 > 0) paramInt1 = 1; while (true) { paramInt2 = i; if ((parami instanceof RecyclerView.r.b)) { parami = ((RecyclerView.r.b)parami).bX(k - 1); paramInt2 = i; if (parami != null) if (parami.x >= 0.0F) { paramInt2 = i; if (parami.y >= 0.0F); } else { paramInt2 = 1; } } if (paramInt2 == 0) break label271; if (paramInt1 == 0) break label259; paramInt1 = m - 1; AppMethodBeat.o(1864); break; paramInt1 = 0; continue; if (paramInt2 > 0) paramInt1 = 1; else paramInt1 = 0; } label259: AppMethodBeat.o(1864); paramInt1 = m; continue; label271: if (paramInt1 != 0) { paramInt1 = m + 1; AppMethodBeat.o(1864); } else { AppMethodBeat.o(1864); paramInt1 = m; } } } } } public final View a(RecyclerView.i parami) { AppMethodBeat.i(1863); if (parami.iH()) { parami = a(parami, b(parami)); AppMethodBeat.o(1863); } while (true) { return parami; if (parami.iG()) { parami = a(parami, c(parami)); AppMethodBeat.o(1863); } else { parami = null; AppMethodBeat.o(1863); } } } public final int[] a(RecyclerView.i parami, View paramView) { AppMethodBeat.i(1862); int[] arrayOfInt = new int[2]; if (parami.iG()) { arrayOfInt[0] = a(parami, paramView, c(parami)); if (!parami.iH()) break label65; arrayOfInt[1] = a(parami, paramView, b(parami)); } while (true) { AppMethodBeat.o(1862); return arrayOfInt; arrayOfInt[0] = 0; break; label65: arrayOfInt[1] = 0; } } public final ah f(RecyclerView.i parami) { AppMethodBeat.i(1865); if (!(parami instanceof RecyclerView.r.b)) { parami = null; AppMethodBeat.o(1865); } while (true) { return parami; parami = new b.1(this, this.aiB.getContext()); AppMethodBeat.o(1865); } } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes7-dex2jar.jar * Qualified Name: com.tencent.mm.plugin.topstory.ui.video.fs.b * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
d741907059e01069e7592316187ae13adca3b1d8
f458dc768b285e2c36d873c8fc8d790aadbd5743
/entity/src/main/java/com/alonelaval/cornerstone/entity/constants/State.java
0908bda66c84fc88271962e3d7ed0d9991eac294
[]
no_license
miraclehjt/cornerstone
faaf3601eec6c0602c8a05613e83e95bc4a7af90
e9c6d0b77aefa6cfd12813013fa3136741872a0c
refs/heads/master
2022-12-27T08:45:35.384218
2020-04-09T04:31:06
2020-04-09T04:31:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
package com.alonelaval.cornerstone.entity.constants; import com.alonelaval.common.entity.IEnum; /*** * * @author huawei * @create 2018-07-07 **/ public enum State implements IEnum { ENABLED(0,"正常"), DISABLED(1,"禁用"), DELETE(2,"删除"); private final int value; private final String desc; @Override public int value() { return value; } @Override public String desc() { return this.desc; } State(int value, String desc) { this.value = value; this.desc = desc; } public static String typeName() { return "状态"; } public static State valueOf(Integer value) { if(State.ENABLED.value() ==value) { return ENABLED; } else if(State.DISABLED.value() ==value) { return DISABLED; } else{ return DELETE; } } @Override public IEnum value(int value) { return valueOf(value); } }
[ "huawei@bit-s.cn" ]
huawei@bit-s.cn
fab8e056dc72c901cc9ff1018cafd4297a5edc98
79595075622ded0bf43023f716389f61d8e96e94
/app/src/main/java/com/android/internal/telephony/cat/CallSetupParams.java
4216ad9d19270d3ade0f7b86d1e833811d5e92d4
[]
no_license
dstmath/OppoR15
96f1f7bb4d9cfad47609316debc55095edcd6b56
b9a4da845af251213d7b4c1b35db3e2415290c96
refs/heads/master
2020-03-24T16:52:14.198588
2019-05-27T02:24:53
2019-05-27T02:24:53
142,840,716
7
4
null
null
null
null
UTF-8
Java
false
false
845
java
package com.android.internal.telephony.cat; import android.graphics.Bitmap; /* compiled from: CommandParams */ class CallSetupParams extends CommandParams { TextMessage mCallMsg; TextMessage mConfirmMsg; CallSetupParams(CommandDetails cmdDet, TextMessage confirmMsg, TextMessage callMsg) { super(cmdDet); this.mConfirmMsg = confirmMsg; this.mCallMsg = callMsg; } boolean setIcon(Bitmap icon) { if (icon == null) { return false; } if (this.mConfirmMsg != null && this.mConfirmMsg.icon == null) { this.mConfirmMsg.icon = icon; return true; } else if (this.mCallMsg == null || this.mCallMsg.icon != null) { return false; } else { this.mCallMsg.icon = icon; return true; } } }
[ "toor@debian.toor" ]
toor@debian.toor
16550a2b99bf618b518c875e4b65dbc77ece6c7d
db6e498dd76a6ce78d83e1e7801674783230a90d
/thirdlib/base-protocol/protocol/src/main/java/pb4client/LvUpEquipRtOrBuilder.java
d9a4118ba3be7eea701bd537d8fc2f1e1c3a59b3
[]
no_license
daxingyou/game-4
3d78fb460c4b18f711be0bb9b9520d3e8baf8349
2baef6cebf5eb0991b1f5c632c500b522c41ab20
refs/heads/master
2023-03-19T15:57:56.834881
2018-10-10T06:35:57
2018-10-10T06:35:57
null
0
0
null
null
null
null
UTF-8
Java
false
true
2,147
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: client2server.proto package pb4client; public interface LvUpEquipRtOrBuilder extends // @@protoc_insertion_point(interface_extends:client2server.LvUpEquipRt) com.google.protobuf.MessageOrBuilder { /** * <pre> * 返回值 * </pre> * * <code>required int32 rt = 1;</code> */ boolean hasRt(); /** * <pre> * 返回值 * </pre> * * <code>required int32 rt = 1;</code> */ int getRt(); /** * <pre> * 要强化的装备 * </pre> * * <code>optional int64 equipId = 2;</code> */ boolean hasEquipId(); /** * <pre> * 要强化的装备 * </pre> * * <code>optional int64 equipId = 2;</code> */ long getEquipId(); /** * <pre> * 强化后等级 * </pre> * * <code>optional int32 lv = 3;</code> */ boolean hasLv(); /** * <pre> * 强化后等级 * </pre> * * <code>optional int32 lv = 3;</code> */ int getLv(); /** * <pre> *装备属性 * </pre> * * <code>repeated .client2server.EquipProps props = 4;</code> */ java.util.List<pb4client.EquipProps> getPropsList(); /** * <pre> *装备属性 * </pre> * * <code>repeated .client2server.EquipProps props = 4;</code> */ pb4client.EquipProps getProps(int index); /** * <pre> *装备属性 * </pre> * * <code>repeated .client2server.EquipProps props = 4;</code> */ int getPropsCount(); /** * <pre> *装备属性 * </pre> * * <code>repeated .client2server.EquipProps props = 4;</code> */ java.util.List<? extends pb4client.EquipPropsOrBuilder> getPropsOrBuilderList(); /** * <pre> *装备属性 * </pre> * * <code>repeated .client2server.EquipProps props = 4;</code> */ pb4client.EquipPropsOrBuilder getPropsOrBuilder( int index); /** * <pre> *强化后经验 * </pre> * * <code>optional int32 exp = 5;</code> */ boolean hasExp(); /** * <pre> *强化后经验 * </pre> * * <code>optional int32 exp = 5;</code> */ int getExp(); }
[ "weiwei.witch@gmail.com" ]
weiwei.witch@gmail.com
3819fa556cd3ff8ef629ea42d548e8194e5a19b7
1698eaa2d9ffaac28ced3b4239a8de9f2621b032
/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java
d8f9f943e9b3fda4a4c64f38264d2ce2023dae0c
[]
no_license
k42jc/java8-src
ff264ce6669dc46b4362a190e3060628b87d0503
0ff109df18e441f698a5b3f8cd3cb76cc796f9b8
refs/heads/master
2020-03-21T08:09:28.750430
2018-07-09T14:58:34
2018-07-09T14:58:34
138,324,536
1
1
null
null
null
null
UTF-8
Java
false
false
2,360
java
package org.omg.CosNaming.NamingContextPackage; /** * org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/workspace/8-2-build-windows-i586-cygwin/jdk8u144/9417/corba/src/share/classes/org/omg/CosNaming/nameservice.idl * Friday, July 21, 2017 9:58:50 PM PDT */ abstract public class AlreadyBoundHelper { private static String _id = "IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0"; public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.NamingContextPackage.AlreadyBound that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static org.omg.CosNaming.NamingContextPackage.AlreadyBound extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; private static boolean __active = false; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { synchronized (org.omg.CORBA.TypeCode.class) { if (__typeCode == null) { if (__active) { return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); } __active = true; org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0]; org.omg.CORBA.TypeCode _tcOf_members0 = null; __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper.id (), "AlreadyBound", _members0); __active = false; } } } return __typeCode; } public static String id () { return _id; } public static org.omg.CosNaming.NamingContextPackage.AlreadyBound read (org.omg.CORBA.portable.InputStream istream) { org.omg.CosNaming.NamingContextPackage.AlreadyBound value = new org.omg.CosNaming.NamingContextPackage.AlreadyBound (); // read and discard the repository ID istream.read_string (); return value; } public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.NamingContextPackage.AlreadyBound value) { // write the repository ID ostream.write_string (id ()); } }
[ "liao" ]
liao
580d3732a4e193c83f2bf277b55d79a5101318a4
d8e695d863aea3293e04efd91f01f4298adbc3a0
/apache-ode-1.3.5/ode-bpel-dao/src/main/java/org/apache/ode/bpel/dao/CorrelatorDAO.java
162c0f806a7654dc22a066b34f848a6a8b1eaa6c
[]
no_license
polyu-lsgi-xiaofei/bpelcube
685469261d5ca9b7ee4c7288cf47a950d116b21f
45b371a9353209bcc7c4b868cbae2ce500f54e01
refs/heads/master
2021-01-13T02:31:47.445295
2012-11-01T16:20:11
2012-11-01T16:20:11
35,921,433
0
0
null
null
null
null
UTF-8
Java
false
false
4,480
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.ode.bpel.dao; import java.util.List; import org.apache.ode.bpel.common.CorrelationKey; import org.apache.ode.bpel.common.CorrelationKeySet; import java.util.Collection; /** * <p> * Data access object representing a <em>correlator</em>. A correlator * does not have a simple explanation: it acts as match-maker connecting * messages with <em>message consumers</em> (i.e. BPEL pick and receive * operations) across time. For each partnerLink "myRole" and operation * there is one correlator. * </p> * <p> * The correlator functions as a two-sided queue: when a message is * received the correlator is used to dequeue a consumer based on the * keys from the message. If no consumer matches the keys in the message, * the message itself is enqueued along with its keys. Conversely, when * a BPEL pick/receive operation is performed, the correlator is used * to dequeue a message matching a given correlation key. If no message is * found, the consumer (i.e. the pick/receive operation) is enqueued * along with the target key. * </p> * <p> * The end result is matching of messages to pick/receive operations, * irrespective of whether the operation or the message arrives first. * Make sense? * </p> */ public interface CorrelatorDAO { /** * Get the correlator identifier. * @return correlator identifier */ String getCorrelatorId(); void setCorrelatorId(String newId); /** * Enqueue a message exchange to the queue with a set of correlation keys. * * @param mex message exchange * @param correlationKeys pre-computed set of correlation keys for this message */ void enqueueMessage(MessageExchangeDAO mex, CorrelationKeySet correlationKeySet); /** * Dequeue a message exchange matching a correlationKey constraint. * * @param correlationKey correlation correlationKey constraint * @return opaque message-related data previously enqueued with the * given correlation correlationKey */ MessageExchangeDAO dequeueMessage(CorrelationKeySet correlationKeySet); /** * @return all messages waiting on this correlator, use with care as it can potentially return a lot of values */ Collection<CorrelatorMessageDAO> getAllMessages(); /** * Find a route matching the given correlation key. * @param correlationKey correlation key * @return route matching the given correlation key */ List<MessageRouteDAO> findRoute(CorrelationKeySet correlationKeySet); /** * Check if corresponding key set is free to register (see ODE-804) * @param correlationKeySet * @return true - available, false - not available */ boolean checkRoute(CorrelationKeySet correlationKeySet); /** * Add a route from the given correlation key to the given process instance. * @param routeGroupId identifier of the group of routes to which this route belongs * @param target target process instance * @param index relative order in which the route should be considered * @param correlationKey correlation key to match */ void addRoute(String routeGroupId, ProcessInstanceDAO target, int index, CorrelationKeySet correlationKeySet, String routePolicy); /** * Remove all routes with the given route-group identifier. * @param routeGroupId */ void removeRoutes(String routeGroupId, ProcessInstanceDAO target); /** * @return all routes registered on this correlator, use with care as it can potentially return a lot of values */ Collection<MessageRouteDAO> getAllRoutes(); }
[ "michael.pantazoglou@gmail.com@f004a122-f478-6e0f-c15d-9ccb889b5864" ]
michael.pantazoglou@gmail.com@f004a122-f478-6e0f-c15d-9ccb889b5864
87e04bb5b9fe2b74f9dc7267fced61d7c8440eec
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/fts/ui/widget/FTSLocalPageRelevantView.java
91ff818cd9a7796795c877fb0fd538f48e7395a2
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,253
java
package com.tencent.mm.plugin.fts.ui.widget; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import android.widget.TextView; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.R; import com.tencent.mm.protocal.protobuf.btf; import com.tencent.mm.sdk.platformtools.bo; import java.util.LinkedList; import java.util.List; public class FTSLocalPageRelevantView extends LinearLayout implements OnClickListener { public String hlm = null; public LinearLayout jbJ; private b mMb = null; public List<btf> mMc = null; public String query = null; class a { public btf mMe; public int position; public a(btf btf, int i) { this.mMe = btf; this.position = i; } } public interface b { void a(btf btf, String str, int i); } public FTSLocalPageRelevantView(Context context) { super(context); AppMethodBeat.i(62138); post(new Runnable() { public final void run() { AppMethodBeat.i(62136); FTSLocalPageRelevantView.a(FTSLocalPageRelevantView.this); AppMethodBeat.o(62136); } }); AppMethodBeat.o(62138); } public FTSLocalPageRelevantView(Context context, AttributeSet attributeSet) { super(context, attributeSet); } public FTSLocalPageRelevantView(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); } public void setOnRelevantClickListener(b bVar) { this.mMb = bVar; } public void onClick(View view) { AppMethodBeat.i(62139); if (!(this.mMb == null || view.getTag() == null || !(view.getTag() instanceof a))) { a aVar = (a) view.getTag(); this.mMb.a(aVar.mMe, this.hlm, aVar.position); } AppMethodBeat.o(62139); } public final void b(List<btf> list, LinearLayout linearLayout) { AppMethodBeat.i(62140); linearLayout.removeAllViews(); for (btf btf : list) { if (btf != null) { Object obj; View inflate = LayoutInflater.from(linearLayout.getContext()).inflate(R.layout.a22, linearLayout, false); TextView textView = (TextView) inflate.findViewById(R.id.m5); inflate.setOnClickListener(new OnClickListener() { public final void onClick(View view) { AppMethodBeat.i(62137); FTSLocalPageRelevantView.this.onClick(view); AppMethodBeat.o(62137); } }); textView.setText(btf.wVl); int indexOf = list.indexOf(btf); if (list == null || indexOf >= list.size()) { obj = null; } else { obj = new a((btf) list.get(indexOf), indexOf + 1); } inflate.setTag(obj); linearLayout.addView(inflate); } } AppMethodBeat.o(62140); } public static List<btf> ca(List<btf> list) { AppMethodBeat.i(62141); LinkedList linkedList = new LinkedList(); for (btf btf : list) { if (!bo.isNullOrNil(btf.wVl)) { linkedList.add(btf); } } AppMethodBeat.o(62141); return linkedList; } public String getSearchId() { return this.hlm != null ? this.hlm : ""; } public String getWordList() { AppMethodBeat.i(62142); StringBuilder stringBuilder = new StringBuilder(""); if (this.mMc != null) { for (btf btf : this.mMc) { if (stringBuilder.length() > 0) { stringBuilder.append("|"); } stringBuilder.append(btf.wVl); } } String stringBuilder2 = stringBuilder.toString(); AppMethodBeat.o(62142); return stringBuilder2; } public String getQuery() { return this.query != null ? this.query : ""; } static /* synthetic */ void a(FTSLocalPageRelevantView fTSLocalPageRelevantView) { int dimensionPixelSize; AppMethodBeat.i(62143); fTSLocalPageRelevantView.setOrientation(1); fTSLocalPageRelevantView.setGravity(16); fTSLocalPageRelevantView.setVisibility(8); try { dimensionPixelSize = fTSLocalPageRelevantView.getResources().getDimensionPixelSize(R.dimen.ho); } catch (Exception e) { dimensionPixelSize = com.tencent.mm.bz.a.fromDPToPix(fTSLocalPageRelevantView.getContext(), 48); } fTSLocalPageRelevantView.setMinimumHeight(dimensionPixelSize); LayoutParams layoutParams = (LayoutParams) fTSLocalPageRelevantView.getLayoutParams(); layoutParams.width = -1; layoutParams.height = -2; fTSLocalPageRelevantView.setLayoutParams(layoutParams); AppMethodBeat.o(62143); } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
be62f73bc747c80f732db9ed69df3e4dc17675f2
075b5a0b7ca631494201ac554aaf051c14cd45d9
/src/me/itsatacoshop247/TreeAssist/core/TreeBlock.java
6c5bfdd2e090dde228accaf662585a2dca9e8685
[]
no_license
SidShakal/TreeAssist
629dbfc1fa5dac8403f4b2dff908b8adb351bd35
a9acc51b8363c161ca02243ce7c10952b30a4af5
refs/heads/master
2020-12-27T15:04:59.160402
2016-08-16T18:22:31
2016-08-16T18:22:31
54,504,810
0
0
null
2016-03-22T19:57:50
2016-03-22T19:57:50
null
UTF-8
Java
false
false
2,165
java
package me.itsatacoshop247.TreeAssist.core; import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.configuration.serialization.ConfigurationSerializable; import java.util.HashMap; import java.util.Map; public class TreeBlock implements ConfigurationSerializable { private final int x, y, z; public final String world; public final long time; public TreeBlock(final Block b, final long timestamp) { x = b.getX(); y = b.getY(); z = b.getZ(); world = b.getWorld().getName(); time = timestamp; } public TreeBlock(final Map<String, Object> map) { x = (Integer) map.get("x"); y = (Integer) map.get("y"); z = (Integer) map.get("z"); world = map.get("w").toString(); time = (Long) map.get("t"); } public Block getBukkitBlock() { return Bukkit.getWorld(world).getBlockAt(x, y, z); } @Override public Map<String, Object> serialize() { final Map<String, Object> map = new HashMap<String, Object>(); map.put("w", world); map.put("x", x); map.put("y", y); map.put("z", z); map.put("t", time); return map; } @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null) { return false; } if (getClass() != other.getClass()) { return false; } final TreeBlock theOther = (TreeBlock) other; if (this.x != theOther.x) { return false; } if (this.y != theOther.y) { return false; } if (this.z != theOther.z) { return false; } return this.world.equals(theOther.world); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (world == null ? 0 : world.hashCode()); result = prime * result + (x ^ x >>> 32); result = prime * result + (y ^ y >>> 32); result = prime * result + (z ^ z >>> 32); return result; } }
[ "chris@slipcor.de" ]
chris@slipcor.de
a67c335322ae4a3ee34bf211a81872fd00e52b56
a1e0706bf1bc83919654b4517730c9aed6499355
/drools/gen/com/intellij/plugins/drools/lang/psi/impl/DroolsVariableInitializerImpl.java
955c08b23e2b19074846a0b3cd73052b55ae52d7
[ "Apache-2.0" ]
permissive
JetBrains/intellij-plugins
af734c74c10e124011679e3c7307b63d794da76d
f6723228208bfbdd49df463046055ea20659b519
refs/heads/master
2023-08-23T02:59:46.681310
2023-08-22T13:35:06
2023-08-22T15:23:46
5,453,324
2,018
1,202
null
2023-09-13T10:51:36
2012-08-17T14:31:20
Java
UTF-8
Java
false
false
1,336
java
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. // This is a generated file. Not intended for manual editing. package com.intellij.plugins.drools.lang.psi.impl; import java.util.List; import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; import static com.intellij.plugins.drools.lang.lexer.DroolsTokenTypes.*; import com.intellij.plugins.drools.lang.psi.*; public class DroolsVariableInitializerImpl extends DroolsPsiCompositeElementImpl implements DroolsVariableInitializer { public DroolsVariableInitializerImpl(@NotNull ASTNode node) { super(node); } public void accept(@NotNull DroolsVisitor visitor) { visitor.visitVariableInitializer(this); } @Override public void accept(@NotNull PsiElementVisitor visitor) { if (visitor instanceof DroolsVisitor) accept((DroolsVisitor)visitor); else super.accept(visitor); } @Override @Nullable public DroolsArrayInitializer getArrayInitializer() { return findChildByClass(DroolsArrayInitializer.class); } @Override @Nullable public DroolsExpression getExpression() { return findChildByClass(DroolsExpression.class); } }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
cf6784f5696169294af38b0fe9763d6a985dd966
8b4f30926eef1d7832ab666e27b6fe615d8604fd
/src/main/java/org/librairy/service/nlp/service/ServiceManager.java
d8faa03e9addb5786ae017247842b9feb818ef35
[ "Apache-2.0" ]
permissive
librairy/nlpES-service
3dfb0888e992eb4f60971d56a3ce7b1080cec85d
5f07f08ee1059595ce9d4e817372e689d903f679
refs/heads/master
2021-05-12T14:05:37.348728
2019-03-12T23:55:37
2019-03-12T23:55:37
116,943,132
0
0
null
null
null
null
UTF-8
Java
false
false
6,372
java
package org.librairy.service.nlp.service; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import org.librairy.service.nlp.annotators.StanfordAnnotatorWrapperES; import org.librairy.service.nlp.annotators.StanfordPipeAnnotatorES; import org.librairy.service.nlp.annotators.StanfordWordnetPipeAnnotatorES; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; import java.util.concurrent.ExecutionException; /** * @author Badenes Olmedo, Carlos <cbadenes@fi.upm.es> */ @Component public class ServiceManager { private static final Logger LOG = LoggerFactory.getLogger(ServiceManager.class); @Value("#{environment['RESOURCE_FOLDER']?:'${resource.folder}'}") String resourceFolder; @Value("#{environment['SPOTLIGHT_ENDPOINT']?:'${spotlight.endpoint}'}") String endpoint; @Value("#{environment['SPOTLIGHT_THRESHOLD']?:${spotlight.threshold}}") Double threshold; LoadingCache<String, CoreNLPService> coreServices; LoadingCache<String, IXAService> ixaModels; LoadingCache<String, DBpediaService> dbpediaServices; LoadingCache<String, CoreNLPService> wordnetServices; @PostConstruct public void setup(){ ixaModels = CacheBuilder.newBuilder() .maximumSize(100) .build( new CacheLoader<String, IXAService>() { public IXAService load(String key) throws ExecutionException { try{ LOG.info("Initializing IXA service for thread: " + key); IXAService ixaService = new IXAService(resourceFolder); ixaService.setup(); return ixaService; }catch(Exception e){ LOG.error("Unexpected error",e); throw new ExecutionException(e); } } }); coreServices = CacheBuilder.newBuilder() .maximumSize(100) .build( new CacheLoader<String, CoreNLPService>() { public CoreNLPService load(String key) throws ExecutionException { LOG.info("Initializing CoreNLP service for thread: " + key); try{ CoreNLPService coreService = new CoreNLPService(); coreService.setAnnotator(new StanfordPipeAnnotatorES()); coreService.setTokenizer(new StanfordAnnotatorWrapperES()); return coreService; }catch(Exception e){ LOG.error("Unexpected error",e); throw new ExecutionException(e); } } }); wordnetServices = CacheBuilder.newBuilder() .maximumSize(100) .build( new CacheLoader<String, CoreNLPService>() { public CoreNLPService load(String key) throws ExecutionException { try{ LOG.info("Initializing CoreNLP with Wordnet service for thread: " + key); CoreNLPService coreService = new CoreNLPService(); coreService.setAnnotator(new StanfordWordnetPipeAnnotatorES(resourceFolder)); coreService.setTokenizer(new StanfordAnnotatorWrapperES()); return coreService; }catch(Exception e){ LOG.error("Unexpected error",e); throw new ExecutionException(e); } } }); dbpediaServices = CacheBuilder.newBuilder() .maximumSize(100) .build( new CacheLoader<String, DBpediaService>() { public DBpediaService load(String key) throws ExecutionException { try{ LOG.info("Initializing DBpedia service for thread: " + key); return new DBpediaService(endpoint, threshold); }catch(Exception e){ LOG.error("Unexpected error",e); throw new ExecutionException(e); } } }); } public IXAService getIXAService(Thread thread) { try { return ixaModels.get("thread"+thread.getId()); } catch (ExecutionException e) { throw new RuntimeException(e); } } public CoreNLPService getCoreService(Thread thread) { try { return coreServices.get("thread"+thread.getId()); } catch (ExecutionException e) { throw new RuntimeException(e); } } public CoreNLPService getWordnetService(Thread thread) { try { return wordnetServices.get("thread"+thread.getId()); } catch (ExecutionException e) { throw new RuntimeException(e); } } public DBpediaService getDBpediaService(Thread thread) { try { return dbpediaServices.get("thread"+thread.getId()); } catch (ExecutionException e) { throw new RuntimeException(e); } } public void setResourceFolder(String resourceFolder) { this.resourceFolder = resourceFolder; } public void setEndpoint(String endpoint) { this.endpoint = endpoint; } public void setThreshold(Double threshold) { this.threshold = threshold; } }
[ "cbadenes@gmail.com" ]
cbadenes@gmail.com
dd3b62b9c622d8e883d47dc465514e448cb2d30b
5ec9ad33ba409ddb2f7e93c8ace9a024618e5e9b
/DannyGit/src/util/Attachments.java
5c7bd14c6a7ea9e01a02e1c05528392bc01a5b94
[]
no_license
majordillow1/plugintest
55493b2f55a8809925c5619ffa555d97aaab03fb
0a7d01a84ec59a0a151eea9eb52dd3a41435a330
refs/heads/master
2021-01-25T09:01:15.932788
2017-06-27T21:22:23
2017-06-27T21:22:23
93,774,289
0
0
null
null
null
null
UTF-8
Java
false
false
1,105
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package util; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; /** * * @author knightmare */ public class Attachments { public static Boolean canAttachThorsHammer(ItemStack item){ if(item.getType() == Material.DIAMOND_AXE){ return true; } if(item.getType() == Material.STICK){ return true; } return false; } public static Boolean canAttachPoisionSword(ItemStack item){ if(item.getType() == Material.WOOD_SWORD || item.getType() == Material.IRON_SWORD || item.getType()==Material.STONE_SWORD||item.getType()==Material.GOLD_SWORD||item.getType()==Material.DIAMOND_SWORD){ return true; } return false; } public static Boolean canAttachAchoo(ItemStack item){ if(item.getType() == Material.SLIME_BALL){ return true; } return false; } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
800d4b62502b0cb508114a5300defdd9e845583f
ba15925bedd986dbcc3ca615ea990606e51793d3
/app/src/main/java/com/sunfusheng/scrollable/adapter/FragmentPagerItemAdapter.java
60930f4fdd4c759f7438e0f88d94a68b9d520156
[]
no_license
sunfusheng/NestedScrollableDemo
07b58da395f69e26a5cc16ba99ff98e8f4ccd3cd
face6b206d9475ba70e53443ed7bbd940bef1520
refs/heads/master
2021-09-19T08:10:49.079311
2018-07-25T11:57:13
2018-07-25T11:57:13
98,730,452
3
0
null
null
null
null
UTF-8
Java
false
false
3,650
java
package com.sunfusheng.scrollable.adapter; import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.util.SparseArray; import android.view.ViewGroup; import java.util.ArrayList; import java.util.List; /** * Created by sunfusheng on 2017/7/20. */ public class FragmentPagerItemAdapter extends FragmentPagerAdapter { private Context context; private List<FragmentPagerItem> items; private SparseArray<Fragment> fragments = new SparseArray<>(); private OnInstantiateFragmentListener listener; private FragmentPagerItemAdapter(Context context, FragmentManager fragmentManager, List<FragmentPagerItem> items) { super(fragmentManager); this.context = context; this.items = items; } @Override public Object instantiateItem(ViewGroup container, int position) { Fragment fragment = (Fragment) super.instantiateItem(container, position); fragments.put(position, fragment); if (listener != null) { listener.onInstantiate(position, fragment, items.get(position).getArgs()); } return fragment; } @Override public Fragment getItem(int position) { return items.get(position).newInstance(context); } @Override public void destroyItem(ViewGroup container, int position, Object object) { super.destroyItem(container, position, object); fragments.remove(position); } @Override public int getCount() { return items.size(); } public Fragment getFragment(int position) { return fragments.get(position); } @Override public String getPageTitle(int position) { return items.get(position).getPageTitle(); } public void setOnInstantiateFragmentListener(OnInstantiateFragmentListener listener) { this.listener = listener; } public interface OnInstantiateFragmentListener { void onInstantiate(int position, Fragment fragment, Bundle args); } public static class Builder { private Context context; private FragmentManager fragmentManager; private List<FragmentPagerItem> items = new ArrayList<>(); public Builder(Context context, FragmentManager fragmentManager) { this.context = context; this.fragmentManager = fragmentManager; } public Builder add(FragmentPagerItem item) { items.add(item); return this; } public Builder add(int resId, Fragment fragment) { return add(context.getString(resId), fragment); } public Builder add(int resId, Class<? extends Fragment> clazz) { return add(context.getString(resId), clazz); } public Builder add(int resId, Class<? extends Fragment> clazz, Bundle args) { return add(context.getString(resId), clazz, args); } public Builder add(String title, Fragment fragment) { return add(FragmentPagerItem.create(title, fragment)); } public Builder add(String title, Class<? extends Fragment> clazz) { return add(FragmentPagerItem.create(title, clazz)); } public Builder add(String title, Class<? extends Fragment> clazz, Bundle args) { return add(FragmentPagerItem.create(title, clazz, args)); } public FragmentPagerItemAdapter build() { return new FragmentPagerItemAdapter(context, fragmentManager, items); } } }
[ "sfsheng0322@gmail.com" ]
sfsheng0322@gmail.com
31addf2587f9aa37303eaa3311cda5ba13fea5cb
7e74f8e6cf410c476b822b4ca362587fbaa341a1
/app/src/main/java/com/app/discovergolf/Model/ModMissionModel.java
109c022054f05f00c565c0000284b446a045244d
[]
no_license
nisargtrivedi/GolfApp
ecd6d8b3b72297021c92c282c6428019755de933
ba6e13fcca904f2e9d629d708537ed0d90104f5b
refs/heads/main
2023-01-08T16:13:09.345463
2020-11-10T06:49:16
2020-11-10T06:49:16
311,570,857
0
0
null
null
null
null
UTF-8
Java
false
false
1,748
java
package com.app.discovergolf.Model; import java.io.Serializable; import java.util.ArrayList; public class ModMissionModel implements Serializable { public int id; public String academy_id; public String ageRange; public String cat_id; public String class_id; public String course_id; public String created_at; public int create_team; public String description; public String gameFrame; public String metrics; public String missionDuration; public int my_team_id; public String scheduled_date; public String status; public String teamSize; public int team_admin; public String timeDuration; public String title; public String updated_at; public String upload_video; public String mission_type; public String is_Class; public String TeamID; public MissionTeam missionTeam; public MissionTeam getMissionTeam() { return missionTeam; } public void setMissionTeam(MissionTeam missionTeam) { this.missionTeam = missionTeam; } public class MissionTeam implements Serializable { public int id; public int TeamID; public String team; public String score; public ArrayList<PlayerModel> playerModels=new ArrayList<>(); public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTeam() { return team; } public void setTeam(String team) { this.team = team; } public String getScore() { return score; } public void setScore(String score) { this.score = score; } } }
[ "nisarg.trivedi@vovance.com" ]
nisarg.trivedi@vovance.com
3350e69ebe93b98c49ed50639ff19ed796ef2ab6
6e256043a49ecf35801c657ef41dee29bc064452
/src/java/com/epic/cms/camm/applicationconfirmation/servlet/LoadBinProfilesServlet.java
b92ca7b0ba2d5c0d067442ec7065281c8678714d
[]
no_license
chinthakasajith/epic
19ac105981176edf7f8a585b60bd4144c10be605
a6bf9555663d85bb3b1fdc3fedb71443c38b3491
refs/heads/master
2021-01-01T02:49:52.954515
2020-02-08T14:24:32
2020-02-08T14:24:32
239,144,084
0
0
null
null
null
null
UTF-8
Java
false
false
4,001
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.epic.cms.camm.applicationconfirmation.servlet; import com.epic.cms.admin.controlpanel.systemconfigmgt.bean.CardBinBean; import com.epic.cms.admin.controlpanel.systemconfigmgt.bean.ProductionModeBean; import com.epic.cms.camm.applicationconfirmation.businesslogic.ApplicationConfirmationManager; import com.epic.cms.system.util.json.JSONException; import com.epic.cms.system.util.json.JSONObject; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author mahesh_m */ public class LoadBinProfilesServlet extends HttpServlet { private ApplicationConfirmationManager confirmationManager; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, JSONException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { // String productionModeCode = request.getParameter("promode"); String cardProductVal = request.getParameter("cardProductVal"); //String cardType = request.getParameter("cardType"); List<CardBinBean> cardBinList = new ArrayList<CardBinBean>(); try { confirmationManager = new ApplicationConfirmationManager(); JSONObject jCombo = new JSONObject();// if there are several combo box to load //load combo box data JSONObject jObject = new JSONObject(); cardBinList = confirmationManager.getBinList(cardProductVal); //jObject.put("", "-------------SELECT-------------"); for (int i = 0; i < cardBinList.size(); i++) { jObject.put(cardBinList.get(i).getBinNumber(), cardBinList.get(i).getDescription()); } jCombo.put("combo1", jObject); out.print(jCombo); } catch (Exception e) { } } finally { out.close(); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (JSONException ex) { Logger.getLogger(LoadBinProfilesServlet.class.getName()).log(Level.SEVERE, null, ex); } } /** * Handles the HTTP <code>POST</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (JSONException ex) { Logger.getLogger(LoadBinProfilesServlet.class.getName()).log(Level.SEVERE, null, ex); } } /** * Returns a short description of the servlet. * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "sajithdoo@gmail.com" ]
sajithdoo@gmail.com
2ba5406a6905f218de6dc17e74d248c825fb9e1d
70af297144558943cd1d160922a50a3a10c63ab6
/src/com/mateusborja/java1/aula11/VariaveisFlutuante.java
6daf8796bd2e25fb709a598f4a3c774e944f42ea
[]
no_license
mateusborja/loianetraining-java1
deeb0976bb4c08d0c90444d3ba3a1b987ae7d0d4
526d15123dbc06a0b6e510278f6fbf31df8d3efb
refs/heads/main
2023-01-27T19:47:14.226479
2020-12-01T21:43:03
2020-12-01T21:43:03
304,153,267
0
0
null
null
null
null
UTF-8
Java
false
false
686
java
//java 1 loiane aula 11 package com.mateusborja.java1.aula11; import java.text.DecimalFormat; public class VariaveisFlutuante { public static void main(String[] args) { DecimalFormat dc = new DecimalFormat(); double valorPassagem = 2.90; float valorTomate = 3.95f; //utilizando o metodo format System.out.println("Valor da passagem = " + dc.format(valorPassagem)); System.out.println("Valor do Tomate= " + dc.format(valorTomate)); //utilizando o metodo de impressao printf com duas casas decimais System.out.println(); System.out.printf("Valor da Passagem = %.2f%n", valorPassagem); System.out.printf("Valor do Tomate = %.2f%n", valorTomate); } }
[ "mateus.borja@gmail.com" ]
mateus.borja@gmail.com
3d7231da4042c5f24e8e6af2680fafc7b32639bb
29980b09a34bba2f53cfbe2101cfd1c67bca9a89
/src/main/java/com/yt/app/api/v1/controller/CustomertransferresourcesController.java
f232bf223bc778ffd346da8aba3f22b2545a4224
[]
no_license
mzjzhaojun/dfgj
0abd60d026467a02d942de46f0bbf257d8af7991
74fa9632cfddcd2ed6af43a5f16cb1e2b5d59be9
refs/heads/master
2021-01-19T23:22:14.397805
2017-05-27T07:33:21
2017-05-27T07:33:21
88,966,753
0
1
null
null
null
null
UTF-8
Java
false
false
1,985
java
package com.yt.app.api.v1.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.RequestEntity; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RequestMapping; import com.yt.app.frame.m.IPage; import io.swagger.annotations.ApiOperation; import com.yt.app.common.base.impl.BaseControllerImpl; import com.yt.app.api.v1.resource.CustomertransferresourcesResourceAssembler; import com.yt.app.api.v1.service.CustomertransferresourcesService; import com.yt.app.api.v1.entity.Customertransferresources; /** * @author zj default test * * @version v1 * @createdate 2017-04-27 19:22:19 */ @RestController @RequestMapping("/rest/v1/customertransferresources") public class CustomertransferresourcesController extends BaseControllerImpl<Customertransferresources, Long> { protected Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private CustomertransferresourcesService service; @Override @ApiOperation(value = "列表分页", response = Customertransferresources.class) @RequestMapping(value = "/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> list(RequestEntity<Object> requestEntity, HttpServletRequest request, HttpServletResponse response) { IPage<Customertransferresources> pagebean = service.list(requestEntity); return new ResponseEntity<Object>(new CustomertransferresourcesResourceAssembler().toResources(pagebean.getPageList()), pagebean.getHeaders(), HttpStatus.OK); } }
[ "mzjzhaojun@163.com" ]
mzjzhaojun@163.com
396ec90588d5dde84c1091b5af24d245b9022c35
b308232b5f9a1acd400fe15b45780e348048fccd
/Entity/src/main/java/com/param/entity/model/pharmacy/BatchAllocation.java
65d1dc07090b971bfb3d7e74cc8d64a5f95330e6
[]
no_license
PravatKumarPradhan/his
2aae12f730b7d652b9590ef976b12443fc2c2afb
afb2b3df65c0bc1b1864afc1f958ca36a2562e3f
refs/heads/master
2022-12-22T20:43:44.895342
2018-07-31T17:04:26
2018-07-31T17:04:26
143,041,254
1
0
null
2022-12-16T03:59:53
2018-07-31T16:43:36
HTML
UTF-8
Java
false
false
2,003
java
package com.param.entity.model.pharmacy; import java.io.Serializable; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import com.param.entity.model.base.BaseEntity; import com.param.entity.model.inventory.Batch; import com.param.entity.model.master.Store; @Entity(name="BatchAllocation") @Table(name="t_batch_allocation", schema="pharmacy") public class BatchAllocation extends BaseEntity implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Integer id; @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name="batch_id") private Batch batch; private Integer quantity; @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name="store_id") private Store store; @Column(name="temp_bill_id") private Long tempBillId; public BatchAllocation() { } public BatchAllocation(Long tempBillId, Store store, Batch batch, Integer quantity) { super(); this.batch = batch; this.quantity = quantity; this.store = store; this.tempBillId = tempBillId; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Batch getBatch() { return batch; } public void setBatch(Batch batch) { this.batch = batch; } public Integer getQuantity() { return quantity; } public void setQuantity(Integer quantity) { this.quantity = quantity; } public Store getStore() { return store; } public void setStore(Store store) { this.store = store; } public Long getTempBillId() { return tempBillId; } public void setTempBillId(Long tempBillId) { this.tempBillId = tempBillId; } }
[ "pkp751989@gmail.com" ]
pkp751989@gmail.com
5cf0e0caaeaa966041e93004922e4f845c980b1f
0e6268fd8a7dab3e4d7b830d6cac079be0a8a0fe
/src/mat25/Lab06.java
72dd9f9c24962bc5b9fc287d64963c1ceb4e55be
[]
no_license
uday246/March18
fc5fafbe20e12095da2e4e3fe94d1bc49dbc1df0
44ae546660f400b96b469c26decbe0c562b88a94
refs/heads/master
2020-08-15T07:27:19.063010
2019-10-15T13:07:02
2019-10-15T13:07:02
215,300,429
0
0
null
null
null
null
UTF-8
Java
false
false
533
java
package mat25; public class Lab06 { public static void main(String[] args) { try{ someMethod();} catch(Exception e){ System.err.println(e.getMessage()); e.printStackTrace(); } } public static void someMethod() throws Exception{ try{ someMethod2(); } catch(Exception e){ throw new Exception("This Exception caught in someMethod2, chained,and thrown as a new Exception"); } } public static void someMethod2() throws Exception{ throw new Exception("This Exception thrown in someMethod2"); } }
[ "teegalaudaykumar@gmail.com" ]
teegalaudaykumar@gmail.com
b3f3fed2c36266c4e6522924e2d9d921270953f6
f194a68667602c90e8a38dc61ba3200c07606852
/app/src/main/java/com/example/javademo/typeinfo/typeinfo/InnerImplementation.java
9cd1d658131955a9eb32fdd960bee2ed93d4c2c6
[]
no_license
cxydxpx/JavaSpace
f30e1495f9a54b6ab743adf1622fa10eeed6420b
e4c73fca478d126c5e28f025f561a80d025405ca
refs/heads/master
2022-06-19T07:07:18.091118
2020-05-09T06:06:00
2020-05-09T06:06:00
262,501,402
0
0
null
null
null
null
UTF-8
Java
false
false
1,185
java
package com.example.javademo.typeinfo.typeinfo;//: typeinfo/InnerImplementation.java // Private inner classes can't hide from reflection. import com.example.javademo.typeinfo.typeinfo.interfacea.A; import com.example.javademo.typeinfo.typeinfo.pets.*; import static net.mindview.util.Print.print; class InnerA { private static class C implements A { public void f() { print("public C.f()"); } public void g() { print("public C.g()"); } void u() { print("package C.u()"); } protected void v() { print("protected C.v()"); } private void w() { print("private C.w()"); } } public static A makeA() { return new C(); } } public class InnerImplementation { public static void main(String[] args) throws Exception { A a = InnerA.makeA(); a.f(); System.out.println(a.getClass().getName()); // Reflection still gets into the private class: HiddenImplementation.callHiddenMethod(a, "g"); HiddenImplementation.callHiddenMethod(a, "u"); HiddenImplementation.callHiddenMethod(a, "v"); HiddenImplementation.callHiddenMethod(a, "w"); } } /* Output: public C.f() InnerA$C public C.g() package C.u() protected C.v() private C.w() *///:~
[ "cxydxpx@163.com" ]
cxydxpx@163.com
8e91b77aad42742e3ca19687247751365809044b
622053c570d178ea9f9a68784822cfa829e4ac63
/jetrix/tags/0.2.0/src/java/net/jetrix/config/FilterConfig.java
30c2721236c6108731cbd2e58017adeef05c4e21
[]
no_license
ebourg/jetrix-full
41acb3f2aa19155dd39071fea038625a4ba022f4
10fb59ee2d8b46f3553978f46726fd4ee6c90058
refs/heads/master
2023-07-31T21:36:12.712631
2014-03-17T21:40:47
2014-03-17T21:40:47
179,978,734
0
0
null
null
null
null
UTF-8
Java
false
false
1,648
java
/** * Jetrix TetriNET Server * Copyright (C) 2001-2003 Emmanuel Bourg * * 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 net.jetrix.config; /** * Filter configuration. * * @author Emmanuel Bourg * @version $Revision$, $Date$ */ public class FilterConfig extends Configuration { private String name; private String classname; private boolean global; public void setName(String name) { this.name = name; } public String getName() { return name; } public void setClassname(String classname) { this.classname = classname; } public String getClassname() { return classname; } public boolean isGlobal() { return global; } public void setGlobal(boolean global) { this.global = global; } public String toString() { return "[FilterConfig name=" + name + " class=" + classname + " params=" + props + "]"; } }
[ "ebourg@apache.org" ]
ebourg@apache.org
2960005b4bfeffae06230a6769674d37fd8e5605
7dd73504d783c7ebb0c2e51fa98dea2b25c37a11
/eaglercraftx-1.8-main/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/buffer/IntBuffer.java
5183798ecd96ef06264eb26f354cb8ced8bd358b
[ "LicenseRef-scancode-proprietary-license" ]
permissive
bagel-man/bagel-man.github.io
32813dd7ef0b95045f53718a74ae1319dae8c31e
eaccb6c00aa89c449c56a842052b4e24f15a8869
refs/heads/master
2023-04-05T10:27:26.743162
2023-03-16T04:24:32
2023-03-16T04:24:32
220,102,442
3
21
MIT
2022-12-14T18:44:43
2019-11-06T22:29:24
C++
UTF-8
Java
false
false
1,286
java
package net.lax1dude.eaglercraft.v1_8.internal.buffer; /** * Copyright (c) 2022 LAX1DUDE. All Rights Reserved. * * WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES * NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED * TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE * SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. * * NOT FOR COMMERCIAL OR MALICIOUS USE * * (please read the 'LICENSE' file this repo's root directory for more info) * */ public interface IntBuffer extends Buffer { IntBuffer slice(); IntBuffer duplicate(); IntBuffer asReadOnlyBuffer(); int get(); IntBuffer put(int b); int get(int index); IntBuffer put(int index, int b); int getElement(int index); void putElement(int index, int value); IntBuffer get(int[] dst, int offset, int length); IntBuffer get(int[] dst); IntBuffer put(IntBuffer src); IntBuffer put(int[] src, int offset, int length); IntBuffer put(int[] src); int getArrayOffset(); IntBuffer compact(); boolean isDirect(); IntBuffer mark(); IntBuffer reset(); IntBuffer clear(); IntBuffer flip(); IntBuffer rewind(); IntBuffer limit(int newLimit); IntBuffer position(int newPosition); }
[ "tom@blowmage.com" ]
tom@blowmage.com
a51e2f0560b0bb833c497491006c6bb420cd9eff
0ccbf91b11e5212b5179e9a1979362106f30fccd
/misc/instrumentation/parsers/java_1.4c_plain/syntaxtree/FieldDeclaration.java
feffc709fc28840f7205a7181c74d3bba5c70c90
[]
no_license
fmselab/codecover2
e3161be22a1601a4aa00f2933fb7923074aea2ce
9ad4be4b7e54c49716b71b3e81937404ab5af9c6
refs/heads/master
2023-02-21T05:22:00.372690
2021-03-08T22:04:17
2021-03-08T22:04:17
133,975,747
5
1
null
null
null
null
UTF-8
Java
false
false
1,803
java
// // Generated by JTB 1.3.2 // package syntaxtree; /** * Grammar production: * <PRE> * f0 -> ( "public" | "protected" | "private" | "static" | "final" | "transient" | "volatile" )* * f1 -> Type() * f2 -> VariableDeclarator() * f3 -> ( "," VariableDeclarator() )* * f4 -> ";" * </PRE> */ public class FieldDeclaration implements Node { private Node parent; public NodeListOptional f0; public Type f1; public VariableDeclarator f2; public NodeListOptional f3; public NodeToken f4; public FieldDeclaration(NodeListOptional n0, Type n1, VariableDeclarator n2, NodeListOptional n3, NodeToken n4) { f0 = n0; if ( f0 != null ) f0.setParent(this); f1 = n1; if ( f1 != null ) f1.setParent(this); f2 = n2; if ( f2 != null ) f2.setParent(this); f3 = n3; if ( f3 != null ) f3.setParent(this); f4 = n4; if ( f4 != null ) f4.setParent(this); } public FieldDeclaration(NodeListOptional n0, Type n1, VariableDeclarator n2, NodeListOptional n3) { f0 = n0; if ( f0 != null ) f0.setParent(this); f1 = n1; if ( f1 != null ) f1.setParent(this); f2 = n2; if ( f2 != null ) f2.setParent(this); f3 = n3; if ( f3 != null ) f3.setParent(this); f4 = new NodeToken(";"); if ( f4 != null ) f4.setParent(this); } public void accept(visitor.Visitor v) { v.visit(this); } public <R,A> R accept(visitor.GJVisitor<R,A> v, A argu) { return v.visit(this,argu); } public <R> R accept(visitor.GJNoArguVisitor<R> v) { return v.visit(this); } public <A> void accept(visitor.GJVoidVisitor<A> v, A argu) { v.visit(this,argu); } public void setParent(Node n) { parent = n; } public Node getParent() { return parent; } }
[ "angelo.gargantini@unibg.it" ]
angelo.gargantini@unibg.it
301d09fef314ed61a33c7f7ba909fdfc3208db0f
b98514eaefbc30b7b573922bd09887162d31aedd
/huanxinim/src/main/java/com/hyphenate/chatui/group/model/GroupSetting.java
d0fadb7d1379953a660bbab86d205d2256ed24de
[]
no_license
mofangwan23/LimsOA
c7a6c664531fcd8b950aed62d02f8a5fe6ca233c
37da27081432a719fddd1a7784f9a2f29274a083
refs/heads/main
2023-05-29T22:25:44.839145
2021-06-18T09:41:17
2021-06-18T09:41:17
363,003,883
3
2
null
null
null
null
UTF-8
Java
false
false
340
java
package com.hyphenate.chatui.group.model; import android.support.annotation.Keep; /** * Created by klc on 2018/2/2. */ @Keep public class GroupSetting { private boolean allowInvite; public boolean isAllowInvite() { return allowInvite; } public void setAllowInvite(boolean allowInvite) { this.allowInvite = allowInvite; } }
[ "mofangwan23@gmail.com" ]
mofangwan23@gmail.com
5bdae076a0007626cd4896b86c63cbe0a72e27e5
58973ee65fa89126d26df76b941da3dcce80b3b7
/kie-remote/kie-services-client/src/main/java/org/kie/services/client/api/RestRequestHelper.java
48bdd26d73a6711be34934dee29478247daa1d6a
[ "Apache-2.0" ]
permissive
Jahia/droolsjbpm-integration
5e0c4911a8ee95abf3a7d06a382cc0f0508fe615
163324cc4328e6e16e281bbb39ee84e0bc4ee88a
refs/heads/master
2021-01-18T18:46:26.184784
2013-12-09T21:21:59
2013-12-11T13:13:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,244
java
package org.kie.services.client.api; import static org.kie.services.client.api.command.RemoteConfiguration.*; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientRequestFactory; import org.kie.services.client.api.command.RemoteConfiguration; /** * This class is meant to help users help interact with the (kie-wb or business-central) REST api by creating * either {@link ClientRequest} (REST request) instances or {@link ClientRequestFactory} instances to * create {@link ClientRequest} instances. */ public class RestRequestHelper { private ClientRequestFactory requestFactory; private static int DEFAULT_TIMEOUT = 5; /** * Helper methods */ private URL addRestToPath(URL origUrl) { StringBuilder urlString = new StringBuilder(origUrl.toExternalForm()); if (!urlString.toString().endsWith("/")) { urlString.append("/"); } urlString.append("rest/"); URL origPlusRestUrl = convertStringToUrl(urlString.toString()); return origPlusRestUrl; } private static URL convertStringToUrl(String urlString) { URL realUrl; try { realUrl = new URL(urlString); } catch (MalformedURLException murle) { throw new IllegalArgumentException("URL (" + urlString + ") is incorrectly formatted: " + murle.getMessage(), murle); } return realUrl; } /** * Creates a {@link RestRequestHelper} instance. * * @param serverPortUrl in the format of "http://server:port/" * @param username The username (registered on the kie-wb or business-central server) * @param password The password associated with the username. * @param timeout The timeout used for REST requests. */ public RestRequestHelper(URL serverPortUrl, String username, String password, int timeout) { super(); URL serverPlusRestUrl = addRestToPath(serverPortUrl); this.requestFactory = createAuthenticatingRequestFactory(serverPlusRestUrl, username, password, timeout); } /** * Creates a {@link RestRequestHelper} instance. A default timeout of 5 seconds is used for REST requests. * * @param serverPortUrl in the format of "http://server:port/" * @param username The username (registered on the kie-wb or business-central server) * @param password The password associated with the username. * */ public RestRequestHelper(URL serverPortUrl, String username, String password) { super(); URL serverPlusRestUrl = addRestToPath(serverPortUrl); this.requestFactory = createAuthenticatingRequestFactory(serverPlusRestUrl, username, password, DEFAULT_TIMEOUT); } /** * Creates a REST request for the given REST operation URL. * </p> * For example, if you wanted to create a REST request for the following URL:<ul> * <li><code>http://my.server.com:8080/rest/runtime/test-deploy/process/org.jbpm:HR:1.0/start</code></li> * </ul> * Then you could call this method as follows: <code> * restRequestHelperInstance.createRestRequest( "runtime/test-deploy/process/org.jbpm:HR:1.0/start" ); * </code> * @param restOperationUrl The URL of the REST operation, exculding the server/port and "/rest" base. * @return A {@link ClientRequest} instance that authenticates based on the username/password arguments * given to the constructor of this {@link RestRequestHelper} instance. */ public ClientRequest createRestRequest(String restOperationUrl) { if (restOperationUrl.startsWith("/")) { restOperationUrl = restOperationUrl.substring(1); } return this.requestFactory.createRelativeRequest(restOperationUrl); } /** * This method creates a {@link ClientRequestFactory} instance that can be used to create {@link ClientRequest} instances * that will authenticate against a kie-wb or business-central server using the given username and password. * </p> * The {@link ClientRequestFactory} instance can then be used like this to create {@link ClientRequest} REST request instances: * <pre> * {@link ClientRequestFactory} requestFactory = {@link RestRequestHelper}.createRestRequest( "http://my.server:8080/rest", "user", "pass", 10); * {@link ClientRequest} restRequest = requestFactory.createRelativeRequest( "task/2/start" ); * ClientResponse restResponse = restRequest.post(); * // do something with the response * </pre> * * @param restBaseUrl The base URL of the rest server, which will have this format: "http://server[:port]/rest". * @param username The username to use when authenticating. * @param password The password to use when authenticating. * @param timeout The timeout to use for the REST request. * @return A {@link ClientRequestFactory} in order to create REST request ( {@link ClientRequest} ) instances * to interact with the REST api. */ public static ClientRequestFactory createRestRequestFactory(String restBaseUrlString, String username, String password, int timeout) { URL url = convertStringToUrl(restBaseUrlString); return createAuthenticatingRequestFactory(url, username, password, timeout); } /** * See {@link RestRequestHelper#createRestRequestFactory(String, String, String, int)}. This method uses a default timeout of * 5 seconds, whereas the referred method allows users to pass the value for the timeout. * * @param restBaseUrlString The base URL of the rest server, which will have this format: "http://server[:port]/rest". * @param username The username to use when authenticating. * @param password The password to use when authenticating. * @return A {@link ClientRequestFactory} in order to create REST request ( {@link ClientRequest} ) instances * to interact with the REST api. */ public static ClientRequestFactory createRestRequestFactory(String restBaseUrlString, String username, String password) { URL url = convertStringToUrl(restBaseUrlString); return createAuthenticatingRequestFactory(url, username, password, DEFAULT_TIMEOUT); } /** * See {@link RestRequestHelper#createRestRequestFactory(String, String, String, int)}. This method uses a default timeout of * 5 seconds, whereas the referred method allows users to pass the value for the timeout. * * @param restBaseUrl The base URL of the rest server, which will have this format: "http://server[:port]/rest". * @param username The username to use when authenticating. * @param password The password to use when authenticating. * @return A {@link ClientRequestFactory} in order to create REST request ( {@link ClientRequest} ) instances * to interact with the REST api. */ public static ClientRequestFactory createRestRequestFactory(URL restBaseUrl, String username, String password) { return createAuthenticatingRequestFactory(restBaseUrl, username, password, DEFAULT_TIMEOUT); } }
[ "mrietvel@redhat.com" ]
mrietvel@redhat.com
fd6fca333c7272f273a44a40ac82015e80a2c5f2
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--intellij-community/50d519ac751953eca52006768915098a46a419d4/before/ModuleGroupNode.java
735539a5743129fa21fee3fb1ca36e3cba589945
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,947
java
package com.intellij.packageDependencies.ui; import com.intellij.analysis.AnalysisScopeBundle; import com.intellij.ide.projectView.impl.ModuleGroup; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.IconLoader; import com.intellij.psi.PsiFile; import javax.swing.*; import java.util.Set; /** * User: anna * Date: 24-Jan-2006 */ public class ModuleGroupNode extends PackageDependenciesNode { public static final Icon CLOSED_ICON = IconLoader.getIcon("/nodes/moduleGroupClosed.png"); public static final Icon OPENED_ICON = IconLoader.getIcon("/nodes/moduleGroupOpen.png"); private ModuleGroup myModuleGroup; public ModuleGroupNode(ModuleGroup moduleGroup) { myModuleGroup = moduleGroup; setUserObject(toString()); } public void fillFiles(Set<PsiFile> set, boolean recursively) { super.fillFiles(set, recursively); int count = getChildCount(); for (int i = 0; i < count; i++) { PackageDependenciesNode child = (PackageDependenciesNode)getChildAt(i); child.fillFiles(set, true); } } public Icon getOpenIcon() { return OPENED_ICON; } public Icon getClosedIcon() { return CLOSED_ICON; } public String toString() { return myModuleGroup == null ? AnalysisScopeBundle.message("unknown.node.text") : myModuleGroup.toString(); } public String getModuleGroupName() { return myModuleGroup.presentableText(); } public ModuleGroup getModuleGroup() { return myModuleGroup; } public int getWeight() { return 0; } public boolean equals(Object o) { if (isEquals()){ return super.equals(o); } if (this == o) return true; if (!(o instanceof ModuleGroupNode)) return false; final ModuleGroupNode moduleNode = (ModuleGroupNode)o; return Comparing.equal(myModuleGroup, moduleNode.myModuleGroup); } public int hashCode() { return myModuleGroup == null ? 0 : myModuleGroup.hashCode(); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
e0ec474f5472971f153f76d064a602bf6df3aeb9
a59ac307b503ff470e9be5b1e2927844eff83dbe
/wheatfield/branches/rkylin-wheatfield-DGYZ/wheatfield/src/main/java/com/rkylin/wheatfield/manager/impl/SettleTransTabManagerImpl.java
8e7fd340d3e370390332be04457a3c7a23f11c40
[]
no_license
yangjava/kylin-wheatfield
2cc82ee9e960543264b1cfc252f770ba62669e05
4127cfca57a332d91f8b2ae1fe1be682b9d0f5fc
refs/heads/master
2020-12-02T22:07:06.226674
2017-07-03T07:59:15
2017-07-03T07:59:15
96,085,446
0
4
null
null
null
null
UTF-8
Java
false
false
1,671
java
/* * Powered By rkylin-code-generator * Web Site: http://www.chanjetpay.com * Since 2014 - 2015 */ package com.rkylin.wheatfield.manager.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; import com.rkylin.wheatfield.dao.SettleTransTabDao; import com.rkylin.wheatfield.manager.SettleTransTabManager; import com.rkylin.wheatfield.pojo.SettleTransTab; import com.rkylin.wheatfield.pojo.SettleTransTabQuery; @Component("settleTransTabManager") public class SettleTransTabManagerImpl implements SettleTransTabManager { @Autowired @Qualifier("settleTransTabDao") private SettleTransTabDao settleTransTabDao; @Override public void saveSettleTransTab(SettleTransTab settleTransTab) { if (settleTransTab.getTabId() == null) { settleTransTabDao.insertSelective(settleTransTab); } else { settleTransTabDao.updateByPrimaryKeySelective(settleTransTab); } } @Override public SettleTransTab findSettleTransTabById(Long id) { return settleTransTabDao.selectByPrimaryKey(id); } @Override public List<SettleTransTab> queryList(SettleTransTabQuery query) { return settleTransTabDao.selectByExample(query); } @Override public void deleteSettleTransTabById(Long id) { settleTransTabDao.deleteByPrimaryKey(id); } @Override public void deleteSettleTransTab(SettleTransTabQuery query) { settleTransTabDao.deleteByExample(query); } @Override public void saveSettleTransTabs(List<SettleTransTab> settleTransTabs) { settleTransTabDao.insertSelectiveBatch(settleTransTabs); } }
[ "yangjava@users.noreply.github.com" ]
yangjava@users.noreply.github.com
01eda8929e269153ccce932858ddb11cd4063160
90cc5f32611d15b0a996c236976afc117ecfa565
/src/listener/MyHttpSessionAttributeListener.java
f5ff06d8014142890e3148bc433ad1592b142d25
[]
no_license
liuchenwei2000/Servlet_JSP
dece12c6ccd280205a197adb4a6f2a79382d844c
4b77f865780373d3e37a35a9fc45d2d8e9fa0d1c
refs/heads/master
2021-01-10T08:12:06.785606
2019-12-11T06:50:20
2019-12-11T06:50:20
47,015,145
0
0
null
null
null
null
UTF-8
Java
false
false
853
java
/** * */ package listener; import javax.servlet.http.HttpSessionAttributeListener; import javax.servlet.http.HttpSessionBindingEvent; /** * HttpSessionAttributeListener示例 * <p> * HttpSessionAttributeListener用于监听HttpSession范围内属性的改变。 * * @author 刘晨伟 * * 创建日期:2014-1-11 */ public class MyHttpSessionAttributeListener implements HttpSessionAttributeListener { /** * 当程序向 ServletContext 添加属性时触发。 */ @Override public void attributeAdded(HttpSessionBindingEvent arg0) { } /** * 当程序从 ServletContext 删除属性时触发。 */ @Override public void attributeRemoved(HttpSessionBindingEvent arg0) { } /** * 当程序替换 ServletContext 中的属性时触发。 */ @Override public void attributeReplaced(HttpSessionBindingEvent arg0) { } }
[ "liuchenwei2000@163.com" ]
liuchenwei2000@163.com
2b7571a694888cc2a8e178f0a944c01f0dc9fa78
a8082a7a9f7309b8beea12b6336125bebda62a4d
/IFCtoLBD_Geometry/src/main/java/de/rwth_aachen/dc/lbd/IFCBoundingBoxes.java
3c53efa967b249c70ce61440da46fdc7e524fa4f
[ "Apache-2.0" ]
permissive
arashhosseiniarash/IFCtoLBD
df831bca108bb523ec8d935c508c0a4df18e732f
9f76faf45c2f7e8dce0037d3f98f5d3a2676382a
refs/heads/master
2023-08-11T16:18:59.441122
2021-09-22T11:53:22
2021-09-22T11:53:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,856
java
package de.rwth_aachen.dc.lbd; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import javax.vecmath.Point3d; import org.bimserver.geometry.Matrix; import org.bimserver.plugins.deserializers.DeserializeException; import org.bimserver.plugins.renderengine.RenderEngineException; import org.ifcopenshell.IfcGeomServerClientEntity; import org.ifcopenshell.IfcOpenShellEngine; import org.ifcopenshell.IfcOpenShellEntityInstance; import org.ifcopenshell.IfcOpenShellModel; import de.rwth_aachen.dc.OperatingSystemCopyOf_IfcGeomServer; public class IFCBoundingBoxes { private IfcOpenShellModel renderEngineModel=null; public IFCBoundingBoxes(File ifcFile) throws DeserializeException, IOException, RenderEngineException { this.renderEngineModel = getRenderEngineModel(ifcFile); ExecutorService executor = Executors.newCachedThreadPool(); Callable<IfcOpenShellModel> task = new Callable<IfcOpenShellModel>() { public IfcOpenShellModel call() { return getRenderEngineModel(ifcFile); } }; Future<IfcOpenShellModel> future = executor.submit(task); try { // Should be done in 4 minutes this.renderEngineModel = future.get(4, TimeUnit.MINUTES); } catch (TimeoutException ex) { System.out.println("Timeout"); } catch (InterruptedException e) { } catch (ExecutionException e) { } finally { future.cancel(true); // may or may not desire this } } public BoundingBox getBoundingBox(String guid) { BoundingBox boundingBox = null; if(renderEngineModel==null) return null; IfcOpenShellEntityInstance renderEngineInstance; renderEngineInstance = renderEngineModel.getInstanceFromGUID(guid); if (renderEngineInstance == null) { return null; } try { IfcGeomServerClientEntity geometry = renderEngineInstance.generateGeometry(); if (geometry != null && geometry.getIndices().length > 0) { boundingBox = new BoundingBox(); double[] tranformationMatrix = new double[16]; Matrix.setIdentityM(tranformationMatrix, 0); if (renderEngineInstance.getTransformationMatrix() != null) { tranformationMatrix = renderEngineInstance.getTransformationMatrix(); } for (int i = 0; i < geometry.getIndices().length; i++) { Point3d p=processExtends(tranformationMatrix, geometry.getPositions(), geometry.getIndices()[i] * 3); boundingBox.add(p); } } } catch (Exception e) { e.printStackTrace(); } return boundingBox; } private IfcOpenShellModel getRenderEngineModel(File ifcFile) { try { String ifcGeomServerLocation = OperatingSystemCopyOf_IfcGeomServer.getIfcGeomServer(); System.out.println("ifcGeomServerLocation: " + ifcGeomServerLocation); Path ifcGeomServerLocationPath = Paths.get(ifcGeomServerLocation); IfcOpenShellEngine ifcOpenShellEngine = new IfcOpenShellEngine(ifcGeomServerLocationPath, false, false); System.out.println("init"); ifcOpenShellEngine.init(); System.out.println("init done"); FileInputStream ifcFileInputStream = new FileInputStream(ifcFile); System.out.println("ifcFile: " + ifcFile); IfcOpenShellModel model = ifcOpenShellEngine.openModel(ifcFileInputStream); System.out.println("IfcOpenShell opens ifc: " + ifcFile.getAbsolutePath()); model.generateGeneralGeometry(); return model; } catch (Exception e) { e.printStackTrace(); } return null; } private Point3d processExtends(double[] transformationMatrix, float[] ds, int index) { double x = ds[index]; double y = ds[index + 1]; double z = ds[index + 2]; double[] result = new double[4]; Matrix.multiplyMV(result, 0, transformationMatrix, 0, new double[] { x, y, z, 1 }, 0); Point3d point = new Point3d(result[0], result[1], result[2]); return point; } public void close() { if(this.renderEngineModel!=null) { try { this.renderEngineModel.close(); } catch (RenderEngineException e) { // Just do it } } } }
[ "31693668+jyrkioraskari@users.noreply.github.com" ]
31693668+jyrkioraskari@users.noreply.github.com
892977e86d928c1daca7935b4f7afaaccd3a0309
65423f57d25e34d9440bf894584b92be29946825
/target/generated-sources/xjc/com/clincab/web/app/eutils/jaxb/e2br3/XActStatusActiveComplete.java
d0c2d5b789b794d748414a4160033f3014934d23
[]
no_license
kunalcabcsi/toolsr3
0b518cfa6813a88a921299ab8b8b5d6cbbd362fe
5071990dc2325bc74c34a3383792ad5448dee1b0
refs/heads/master
2021-08-31T04:20:23.924815
2017-12-20T09:25:33
2017-12-20T09:25:33
114,867,895
0
0
null
null
null
null
UTF-8
Java
false
false
1,593
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.12.20 at 02:30:39 PM IST // package com.clincab.web.app.eutils.jaxb.e2br3; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for x_ActStatusActiveComplete. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="x_ActStatusActiveComplete"&gt; * &lt;restriction base="{urn:hl7-org:v3}cs"&gt; * &lt;enumeration value="active"/&gt; * &lt;enumeration value="completed"/&gt; * &lt;/restriction&gt; * &lt;/simpleType&gt; * </pre> * */ @XmlType(name = "x_ActStatusActiveComplete") @XmlEnum public enum XActStatusActiveComplete { @XmlEnumValue("active") ACTIVE("active"), @XmlEnumValue("completed") COMPLETED("completed"); private final String value; XActStatusActiveComplete(String v) { value = v; } public String value() { return value; } public static XActStatusActiveComplete fromValue(String v) { for (XActStatusActiveComplete c: XActStatusActiveComplete.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "ksingh@localhost.localdomain" ]
ksingh@localhost.localdomain
135ccdb5ffff79be3ffe54e15599f2e2f60ff95a
9e061e9c964888c8ddfe38d9ac3778352f02dc7e
/src/dynamicArray/Test.java
7fbadf5d53a38030cfab01d0d3f7deee4ffa19ac
[]
no_license
Peg-008/dataStructure
0d29f82ae19a35e1c168be951d364e86b8ed1283
8f6e662423fff6bd876d90d68991a2a1194b5c41
refs/heads/master
2020-05-22T11:23:15.968430
2019-05-13T01:01:13
2019-05-13T01:01:13
186,322,311
0
0
null
null
null
null
UTF-8
Java
false
false
645
java
package dynamicArray; import array.ArrayT; import dynamicArray.Array; /** * @author Anthony on 2019/3/24 */ public class Test { public static void main(String [] args){ Array<Integer> arr = new Array<>(); for(int i = 0 ; i < 10 ; i ++){ arr.addLast(i); } System.out.println(arr); arr.add(1,100); System.out.println(arr); //arr.addFirst(-1); //System.out.println(arr); arr.remove(2); System.out.println(arr); arr.removeElement(4); System.out.println(arr); arr.removeFirst(); System.out.println(arr); } }
[ "123456@qq.com" ]
123456@qq.com
da9fe6bb2618f863b2e7e5d279d8625307602408
1ca86d5d065372093c5f2eae3b1a146dc0ba4725
/spring-web-modules/spring-mvc-forms-thymeleaf/src/test/java/com/surya/sessionattrs/TodoControllerWithScopedProxyIntegrationTest.java
153240036a322e06a4677e82dd5d097a207e8759
[]
no_license
Suryakanta97/DemoExample
1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e
5c6b831948e612bdc2d9d578a581df964ef89bfb
refs/heads/main
2023-08-10T17:30:32.397265
2021-09-22T16:18:42
2021-09-22T16:18:42
391,087,435
0
1
null
null
null
null
UTF-8
Java
false
false
2,711
java
package com.surya.sessionattrs; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Import; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.util.StringUtils; import org.springframework.web.context.WebApplicationContext; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK) @AutoConfigureMockMvc @Import(TestConfig.class) public class TodoControllerWithScopedProxyIntegrationTest { @Autowired private MockMvc mockMvc; @Autowired private WebApplicationContext wac; @Before public void setup() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac) .build(); } @Test public void whenFirstRequest_thenContainsUnintializedTodo() throws Exception { MvcResult result = mockMvc.perform(get("/scopedproxy/form")) .andExpect(status().isOk()) .andExpect(model().attributeExists("todo")) .andReturn(); TodoItem item = (TodoItem) result.getModelAndView().getModel().get("todo"); assertFalse(StringUtils.isEmpty(item.getDescription())); } @Test public void whenSubmit_thenSubsequentFormRequestContainsMostRecentTodo() throws Exception { mockMvc.perform(post("/scopedproxy/form") .param("description", "newtodo")) .andExpect(status().is3xxRedirection()) .andReturn(); MvcResult result = mockMvc.perform(get("/scopedproxy/form")) .andExpect(status().isOk()) .andExpect(model().attributeExists("todo")) .andReturn(); TodoItem item = (TodoItem) result.getModelAndView().getModel().get("todo"); assertEquals("newtodo", item.getDescription()); } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
9abbf356413f4afba80a48dcfd5b64654e56e125
7639435d1ae43e18c37a2291a93ae811dd92d58d
/eip-exercises/src/main/java/eipcourse/exercises/jms/basic/route/JMSRouter.java
c2e67c39da94541d248b2405ab17f0fed9c7040a
[]
no_license
caires-kaires/EIP-Course
c8675d7b9eb8c7310466636a1fd96a39e8c8d3b0
29401bef9185be993043bfb5cb6fe36d5a2783bc
refs/heads/master
2020-12-29T07:25:28.701007
2017-08-15T22:18:57
2017-08-15T22:18:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,209
java
package eipcourse.exercises.jms.basic.route; import java.util.Random; import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.Destination; import javax.jms.JMSContext; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; /** * * Funciona apenas em servidores que suportam JMS 2.0 (não funciona em ActiveMQ * 5) * */ public class JMSRouter { private static ConnectionFactory factory; public static void main(String[] args) throws Exception { Context ctx = new InitialContext(); factory = (ConnectionFactory) ctx.lookup("ConnectionFactory"); Destination caixaDeEntrada = (Destination) ctx.lookup("entrada"); Destination caixaDeSaida = (Destination) ctx.lookup("saida"); Destination filaProcessamento = (Destination) ctx.lookup("msgxml"); Destination filaInvalida = (Destination) ctx.lookup("invalida"); try (Connection con = factory.createConnection(); Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE)) { con.start(); session.createConsumer(caixaDeEntrada) .setMessageListener((m) -> { try { switch(m.getStringProperty("content-type")) { case "text/plain": routeTo(m, caixaDeSaida, con); System.out.println("Enviada para saida."); break; case "text/xml": routeTo(m, filaProcessamento, con); System.out.println("Enviada para processamento."); break; default: routeTo(m, filaInvalida, con); System.out.println("Enviada para fila de mensages inválidas."); } } catch (JMSException e) { e.printStackTrace(); } }); System.out.println("30 segundos para rotear mensagens. "); Thread.sleep(30000); System.out.println("Fim."); } } private static void routeTo(Message m, Destination destino, Connection con) throws JMSException { try (Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE)) { MessageProducer producer = session.createProducer(destino); producer.send(m); } } }
[ "helder.darocha@gmail.com" ]
helder.darocha@gmail.com
de69a39c106b4c6f30ebb00ffb09e5d8e828d107
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-481-33-30-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/velocity/internal/DefaultVelocityEngine_ESTest.java
e60d4b6546caf0863cfa68487e747d9b84e17b63
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
576
java
/* * This file was automatically generated by EvoSuite * Mon Apr 06 23:46:37 UTC 2020 */ package org.xwiki.velocity.internal; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class DefaultVelocityEngine_ESTest extends DefaultVelocityEngine_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
36d7e139afbf891dd5adcf140b7517e59745b5d7
c8be60ab61186dbec835dd4d4996c00cf051791c
/src/main/java/com/chriniko/springbootintegrationsample/service/DbgResultProducer.java
1a9904ba035a6285b755420feb423bc6eb01e222
[]
no_license
chriniko13/spring-boot-integration-sample
a6e5198da33eebef6a2a45ab1d193f5dd7cae2e4
c029c3528a534187da9384bd085f9be0324d025b
refs/heads/master
2020-03-26T18:19:30.477195
2018-09-10T08:26:04
2018-09-10T08:26:04
145,207,536
0
0
null
null
null
null
UTF-8
Java
false
false
1,231
java
package com.chriniko.springbootintegrationsample.service; import com.chriniko.springbootintegrationsample.dto.DbgResult; import com.chriniko.springbootintegrationsample.dto.DrawInfo; import com.chriniko.springbootintegrationsample.dto.Ticket; import org.springframework.messaging.Message; import org.springframework.messaging.support.MessageBuilder; import java.util.List; import java.util.stream.Collectors; public class DbgResultProducer { public Message<DbgResult> produce(Message<List<Ticket>> message) { System.out.println(" >>>DbgResultProducer#produce, message: " + message); List<Ticket> payload = message.getPayload(); DrawInfo drawInfo = (DrawInfo) message.getHeaders().get(RandomTicketCreator.DRAW_INFO); DbgResult dbgResult = new DbgResult(); dbgResult.setDrawInfo(drawInfo); dbgResult.setTickets(payload); dbgResult.setGroupingByOutcome( payload .stream() .collect(Collectors.groupingBy(Ticket::getOutcome)) ); return MessageBuilder .withPayload(dbgResult) .copyHeadersIfAbsent(message.getHeaders()) .build(); } }
[ "nick.christidis@glispamedia.com" ]
nick.christidis@glispamedia.com
68c7a74ff12db4afb0ecacefed03d84644df8c9e
f62e813cd0486ebe4ae66bc98a9ca1a5cc84cb16
/im/src/main/java/com/android/im/imui/fragment/IMFindFragment.java
556d79a45302aef57470d8cbbb2cb478e78c5c2a
[]
no_license
loading103/im_master
f61fe6b51d7b1f414525482b4faf5b163ecbf05b
478fcdee3c346945b5998c19532f1d90909a87d5
refs/heads/master
2022-11-04T03:05:16.286749
2020-06-21T02:57:00
2020-06-21T02:57:00
273,819,994
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
package com.android.im.imui.fragment;//package com.android.im.imui.fragment; import android.content.Intent; import android.view.View; import android.widget.RelativeLayout; import com.android.im.R; import com.android.im.imui.activity.IMQRCActivity; import com.android.im.imui.activity.SmallProgramSearchActivity; public class IMFindFragment extends IMBaseFragment implements View.OnClickListener { private View view; private RelativeLayout mllScan; private RelativeLayout mllXcx; @Override public View initView() { view = View.inflate(getActivity(), R.layout.fragment_im_finds, null); mllScan=view.findViewById(R.id.im_rl_scan); mllXcx=view.findViewById(R.id.im_rl_xcx); mllScan.setOnClickListener(this); mllXcx.setOnClickListener(this); return view; } @Override public void iniData() { } @Override public void onClick(View v) { if(v.getId()==R.id.im_rl_scan){ Intent intent2 = new Intent(getActivity(), IMQRCActivity.class); getActivity().startActivity(intent2); }else if(v.getId()==R.id.im_rl_xcx){ Intent intent = new Intent( getActivity(), SmallProgramSearchActivity.class); getActivity().startActivity(intent); } } }
[ "951686695@qq.com" ]
951686695@qq.com
1f401690c873b61c7ae41761504a465454320307
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21_ReducedClassCount/applicationModule/src/test/java/applicationModulepackageJava6/Foo285Test.java
63787806e4a683aaf0e3e4be2ba8dc6bf4c14cf8
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package applicationModulepackageJava6; import org.junit.Test; public class Foo285Test { @Test public void testFoo0() { new Foo285().foo0(); } @Test public void testFoo1() { new Foo285().foo1(); } @Test public void testFoo2() { new Foo285().foo2(); } @Test public void testFoo3() { new Foo285().foo3(); } @Test public void testFoo4() { new Foo285().foo4(); } @Test public void testFoo5() { new Foo285().foo5(); } @Test public void testFoo6() { new Foo285().foo6(); } @Test public void testFoo7() { new Foo285().foo7(); } @Test public void testFoo8() { new Foo285().foo8(); } @Test public void testFoo9() { new Foo285().foo9(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
4989c1dbeb923b036600b2295c838a3b70b4bc7a
bbd28259824e8feec7add6f62ab8133344a5a9e5
/app/src/main/java/com/fanchen/imovie/retrofit/service/DyttService.java
56bdcc6f4b38d0ce9209b38beae3340bffdaa543
[]
no_license
superbase-zz/Bangumi
dc3ff6a10a1a8ac5d05bbc28c840ebf1091c5eb0
8d0bf9c005d4bbd9c6f1e2c8fcae2784d2e0bf61
refs/heads/master
2021-05-18T17:42:41.511726
2019-10-12T08:19:39
2019-10-12T08:19:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,027
java
package com.fanchen.imovie.retrofit.service; import com.fanchen.imovie.annotation.RetrofitSource; import com.fanchen.imovie.annotation.RetrofitType; import com.fanchen.imovie.entity.dytt.DyttLive; import com.fanchen.imovie.entity.dytt.DyttLiveBody; import com.fanchen.imovie.entity.dytt.DyttRoot; import com.fanchen.imovie.entity.dytt.DyttShortVideo; import java.util.List; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Headers; import retrofit2.http.Query; /** * DyttService * Created by fanchen on 2017/9/20. */ @RetrofitType(RetrofitSource.DYTT_API) public interface DyttService { /** * 短视频 * @param tid * @param page * @return */ @GET("newmovie/api/hotshortvideo") @RetrofitType(isJsonResponse = true) @Headers({"platVersion:5.1.1", "userId:WWNl6KssHOIDAFGqNssEweUo", "platform:android", "xigua:true", "thunder:true", "package:com.ghost.movieheaven", "appVersion:5.6.0"}) Call<DyttRoot<List<DyttShortVideo>>> shortVideo(@Query("tid") String tid, @Query("page") Integer page); /** * * @param groupId * @param vc * @param _t * @return */ @GET("newmovie/api/tvlive_channels") @RetrofitType(isJsonResponse = true) @Headers({"platVersion:5.1.1", "userId:WWNl6KssHOIDAFGqNssEweUo", "platform:android", "xigua:true", "thunder:true", "package:com.ghost.movieheaven", "appVersion:5.6.0"}) Call<DyttRoot<List<DyttLive>>> liveVideo(@Query("groupId") String groupId, @Query("vc") String vc,@Query("_t") Long _t); /** * * @param channelId * @param vc * @param _t * @return */ @GET("newmovie/api/tvlive_channel_info") @RetrofitType(isJsonResponse = true) @Headers({"platVersion:5.1.1", "userId:WWNl6KssHOIDAFGqNssEweUo", "platform:android", "xigua:true", "thunder:true", "package:com.ghost.movieheaven", "appVersion:5.6.0"}) Call<DyttRoot<DyttLiveBody>> livesInfo(@Query("channelId") String channelId, @Query("vc") String vc,@Query("_t") Long _t); }
[ "happy1993_chen@sina.cn" ]
happy1993_chen@sina.cn
601ccf6fe06cf0cc71b400da584263f6404ddc4c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/29/29_b93dd0ee3cf0b41cf5828f9cac19d87dedab40da/BasicTicketForPrinter/29_b93dd0ee3cf0b41cf5828f9cac19d87dedab40da_BasicTicketForPrinter_t.java
225e7faef22e01fc8485839c03cf39bfb16dc7b9
[]
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
1,469
java
// Openbravo POS is a point of sales application designed for touch screens. // Copyright (C) 2007-2009 Openbravo, S.L. // http://www.openbravo.com/product/pos // // This file is part of Openbravo POS. // // Openbravo POS 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. // // Openbravo POS 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 Openbravo POS. If not, see <http://www.gnu.org/licenses/>. package com.openbravo.pos.printer.ticket; import java.awt.Font; import java.awt.geom.AffineTransform; /** * * @author jaroslawwozniak */ public class BasicTicketForPrinter extends BasicTicket { static { // BASEFONT = new Font("Monospaced", Font.PLAIN, 7).deriveFont(AffineTransform.getScaleInstance(1.0, 1.50)); // FONTHEIGHT = 14; BASEFONT = new Font("Monospaced", Font.TYPE1_FONT , 16).deriveFont(AffineTransform.getScaleInstance(1.0, 1.40)); FONTHEIGHT = 22; IMAGE_SCALE = 1.0; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
f42b6ed9eec2df2af56f2b3f212cefa4ad757af5
a15d4565864d8cecf88f4a9a92139c9c41578c8f
/modules/core/org.jowidgets.cap.common/src/main/java/org/jowidgets/cap/common/api/exception/DeletedBeanException.java
9a5e8b7bbad1ef9c65214491bd85c0b01b3c753a
[]
no_license
jo-source/jo-client-platform
f4800d121df6b982639390f3507da237fc5426c1
2f346b26fa956c6d6612fef2d0ef3eedbb390d7a
refs/heads/master
2021-01-23T10:03:16.067646
2019-04-29T11:43:04
2019-04-29T11:43:04
39,776,103
2
3
null
2016-08-24T13:53:07
2015-07-27T13:33:59
Java
UTF-8
Java
false
false
2,406
java
/* * Copyright (c) 2011, grossmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the jo-widgets.org 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 jo-widgets.org BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ package org.jowidgets.cap.common.api.exception; public class DeletedBeanException extends BeanException { private static final long serialVersionUID = -7579908469741974763L; public DeletedBeanException(final Object beanId) { super(beanId); } public DeletedBeanException(final Object beanId, final String message) { super(beanId, message); } public DeletedBeanException(final Object beanId, final String message, final Throwable cause) { super(beanId, message, cause); } public DeletedBeanException(final Object beanId, final String message, final String userMessage) { super(beanId, message, userMessage); } public DeletedBeanException(final Object beanId, final String message, final String userMessage, final Throwable cause) { super(beanId, message, userMessage, cause); } }
[ "herr.grossmann@gmx.de" ]
herr.grossmann@gmx.de
e2d2104d132d6b8cacd1999b0bf651d56d343eca
6eb9945622c34e32a9bb4e5cd09f32e6b826f9d3
/src/org/apache/http/message/BasicStatusLine.java
51ddb8725ece7d2adc60a907a6fbd3c183a7927f
[]
no_license
alexivaner/GadgetX-Android-App
6d700ba379d0159de4dddec4d8f7f9ce2318c5cc
26c5866be12da7b89447814c05708636483bf366
refs/heads/master
2022-06-01T09:04:32.347786
2020-04-30T17:43:17
2020-04-30T17:43:17
260,275,241
0
0
null
null
null
null
UTF-8
Java
false
false
1,492
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package org.apache.http.message; import java.io.Serializable; import org.apache.http.ProtocolVersion; import org.apache.http.StatusLine; import org.apache.http.util.Args; import org.apache.http.util.CharArrayBuffer; // Referenced classes of package org.apache.http.message: // BasicLineFormatter public class BasicStatusLine implements StatusLine, Cloneable, Serializable { private static final long serialVersionUID = 0xde17a42b501ecf7bL; private final ProtocolVersion protoVersion; private final String reasonPhrase; private final int statusCode; public BasicStatusLine(ProtocolVersion protocolversion, int i, String s) { protoVersion = (ProtocolVersion)Args.notNull(protocolversion, "Version"); statusCode = Args.notNegative(i, "Status code"); reasonPhrase = s; } public Object clone() throws CloneNotSupportedException { return super.clone(); } public ProtocolVersion getProtocolVersion() { return protoVersion; } public String getReasonPhrase() { return reasonPhrase; } public int getStatusCode() { return statusCode; } public String toString() { return BasicLineFormatter.INSTANCE.formatStatusLine(null, this).toString(); } }
[ "hutomoivan@gmail.com" ]
hutomoivan@gmail.com
29091315b51d058b05b0745429c81dc44f653945
8f6b78fe97e13831516c30896376c6ad3094b8fb
/src/test/java/org/ycx/gateway/web/rest/AccountResourceIntTest.java
71683a6caccb6d783c72f2e140215a00670392e0
[]
no_license
zhaolj214/microGateway
386ca6842f8483dc2e97db83329ea239529f4025
a86978dbd75c91ae623f24c9744b6e458a0afcd7
refs/heads/master
2020-03-22T03:00:11.137595
2018-07-02T07:32:15
2018-07-02T07:32:15
139,407,321
0
0
null
null
null
null
UTF-8
Java
false
false
4,998
java
package org.ycx.gateway.web.rest; import org.ycx.gateway.MicroGatewayApp; import org.ycx.gateway.domain.Authority; import org.ycx.gateway.domain.User; import org.ycx.gateway.repository.UserRepository; import org.ycx.gateway.security.AuthoritiesConstants; import org.ycx.gateway.service.UserService; import org.ycx.gateway.web.rest.errors.ExceptionTranslator; import org.apache.commons.lang3.RandomStringUtils; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.util.HashSet; import java.util.Set; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.context.WebApplicationContext; /** * Test class for the AccountResource REST controller. * * @see AccountResource */ @RunWith(SpringRunner.class) @SpringBootTest(classes = MicroGatewayApp.class) public class AccountResourceIntTest{ @Autowired private UserRepository userRepository; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private UserService userService; private MockMvc restUserMockMvc; @Autowired private WebApplicationContext context; @Before public void setup() { MockitoAnnotations.initMocks(this); AccountResource accountUserMockResource = new AccountResource(userService); this.restUserMockMvc = MockMvcBuilders.standaloneSetup(accountUserMockResource) .setControllerAdvice(exceptionTranslator) .build(); } @Test public void testNonAuthenticatedUser() throws Exception { restUserMockMvc.perform(get("/api/authenticate") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().string("")); } @Test public void testAuthenticatedUser() throws Exception { restUserMockMvc.perform(get("/api/authenticate") .with(request -> { request.setRemoteUser("test"); return request; }) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().string("test")); } @Test @Transactional public void testGetExistingAccount() throws Exception { Set<Authority> authorities = new HashSet<>(); Authority authority = new Authority(); authority.setName(AuthoritiesConstants.ADMIN); authorities.add(authority); User user = new User(); user.setId(RandomStringUtils.randomAlphanumeric(50)); user.setLogin("test"); user.setFirstName("john"); user.setLastName("doe"); user.setEmail("john.doe@jhipster.com"); user.setImageUrl("http://placehold.it/50x50"); user.setLangKey("en"); user.setAuthorities(authorities); userRepository.save(user); // create security-aware mockMvc restUserMockMvc = MockMvcBuilders .webAppContextSetup(context) .apply(springSecurity()) .build(); restUserMockMvc.perform(get("/api/account") .with(user(user.getLogin()).roles("ADMIN")) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.login").value("test")) .andExpect(jsonPath("$.firstName").value("john")) .andExpect(jsonPath("$.lastName").value("doe")) .andExpect(jsonPath("$.email").value("john.doe@jhipster.com")) .andExpect(jsonPath("$.imageUrl").value("http://placehold.it/50x50")) .andExpect(jsonPath("$.langKey").value("en")) .andExpect(jsonPath("$.authorities").value(AuthoritiesConstants.ADMIN)); } @Test public void testGetUnknownAccount() throws Exception { restUserMockMvc.perform(get("/api/account") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isInternalServerError()); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
416c5d33fb17085306ebfb4e7b5811824f86ad5d
47034e7fcb058b3df4bf5928455951e5f455897e
/markdown4j/src/main/java/com/github/rjeschke/txtmark/Configuration.java
1881ade4e69d1985eaf0d14dfa886f3981244c26
[]
no_license
KingBowser/hatter-source-code
2858a651bc557e3aacb4a07133450f62dc7a15c6
f10d4f0ec5f5adda1baa942e179f76301ebc328a
refs/heads/master
2021-01-01T06:49:52.889183
2015-03-21T17:00:28
2015-03-21T17:00:28
32,662,581
3
1
null
null
null
null
UTF-8
Java
false
false
7,346
java
/* * Copyright (C) 2011 René Jeschke <rene_jeschke@yahoo.de> * * 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.github.rjeschke.txtmark; import java.util.ArrayList; import java.util.List; import org.markdown4j.Plugin; /** * Txtmark configuration. * * @author René Jeschke <rene_jeschke@yahoo.de> * @since 0.7 */ public class Configuration { final boolean safeMode; final String encoding; final Decorator decorator; final BlockEmitter codeBlockEmitter; final boolean forceExtendedProfile; final boolean convertNewline2Br; final SpanEmitter specialLinkEmitter; final List<Plugin> plugins; /** * <p> * This is the default configuration for txtmark's <code>process</code> * methods * </p> * * <ul> * <li><code>safeMode = false</code></li> * <li><code>encoding = UTF-8</code></li> * <li><code>decorator = DefaultDecorator</code></li> * <li><code>codeBlockEmitter = null</code></li> * </ul> */ public final static Configuration DEFAULT = Configuration.builder().build(); /** * <p> * Default safe configuration * </p> * * <ul> * <li><code>safeMode = true</code></li> * <li><code>encoding = UTF-8</code></li> * <li><code>decorator = DefaultDecorator</code></li> * <li><code>codeBlockEmitter = null</code></li> * </ul> */ public final static Configuration DEFAULT_SAFE = Configuration.builder().enableSafeMode().build(); /** * Constructor. * * @param safeMode * @param encoding * @param decorator */ Configuration(boolean safeMode, String encoding, Decorator decorator, BlockEmitter codeBlockEmitter, boolean forceExtendedProfile, boolean convertNewline2Br, SpanEmitter specialLinkEmitter, List<Plugin> plugins) { this.safeMode = safeMode; this.encoding = encoding; this.decorator = decorator; this.codeBlockEmitter = codeBlockEmitter; this.convertNewline2Br = convertNewline2Br; this.forceExtendedProfile = forceExtendedProfile; this.specialLinkEmitter = specialLinkEmitter; this.plugins = plugins; } /** * Creates a new Builder instance. * * @return A new Builder instance. */ public static Builder builder() { return new Builder(); } /** * Configuration builder. * * @author René Jeschke <rene_jeschke@yahoo.de> * @since 0.7 */ public static class Builder { private boolean safeMode = false; private boolean forceExtendedProfile = false; private boolean convertNewline2Br = false; private String encoding = "UTF-8"; private Decorator decorator = new DefaultDecorator(); private BlockEmitter codeBlockEmitter = null; private SpanEmitter specialLinkEmitter = null; private List<Plugin> plugins = new ArrayList<Plugin>(); /** * Constructor. * */ Builder() { // empty } /** * Enables HTML safe mode. * * Default: <code>false</code> * * @return This builder * @since 0.7 */ public Builder enableSafeMode() { this.safeMode = true; return this; } /** * Forces extened profile to be enabled by default. * * @return This builder. * @since 0.7 */ public Builder forceExtentedProfile() { this.forceExtendedProfile = true; return this; } /** * convertNewline2Br. * * @return This builder. */ public Builder convertNewline2Br() { this.convertNewline2Br = true; return this; } /** * Sets the HTML safe mode flag. * * Default: <code>false</code> * * @param flag * <code>true</code> to enable safe mode * @return This builder * @since 0.7 */ public Builder setSafeMode(boolean flag) { this.safeMode = flag; return this; } /** * Sets the character encoding for txtmark. * * Default: <code>&quot;UTF-8&quot;</code> * * @param encoding * The encoding * @return This builder * @since 0.7 */ public Builder setEncoding(String encoding) { this.encoding = encoding; return this; } /** * Sets the decorator for txtmark. * * Default: <code>DefaultDecorator()</code> * * @param decorator * The decorator * @return This builder * @see DefaultDecorator * @since 0.7 */ public Builder setDecorator(Decorator decorator) { this.decorator = decorator; return this; } /** * Sets the code block emitter. * * Default: <code>null</code> * * @param emitter * The BlockEmitter * @return This builder * @see BlockEmitter * @since 0.7 */ public Builder setCodeBlockEmitter(BlockEmitter emitter) { this.codeBlockEmitter = emitter; return this; } /** * Sets the emitter for special link spans ([[ ... ]]). * * @param emitter * The emitter. * @return This builder. * @since 0.7 */ public Builder setSpecialLinkEmitter(SpanEmitter emitter) { this.specialLinkEmitter = emitter; return this; } /** * Sets the plugins. * * @param plugins * The plugins. * @return This builder. */ public Builder registerPlugins(Plugin... plugins) { for(Plugin plugin : plugins) { this.plugins.add(plugin); } return this; } /** * Builds a configuration instance. * * @return a Configuration instance * @since 0.7 */ public Configuration build() { return new Configuration(this.safeMode, this.encoding, this.decorator, this.codeBlockEmitter, this.forceExtendedProfile, this.convertNewline2Br, this.specialLinkEmitter, this.plugins); } public Decorator getDecorator() { return decorator; } } }
[ "jht5945@gmail.com@dd6f9e7e-b4fe-0bd6-ab9c-0ed876a8e821" ]
jht5945@gmail.com@dd6f9e7e-b4fe-0bd6-ab9c-0ed876a8e821
a90eb74c4df101d9134ee483f2ce1be13c03de95
4312a71c36d8a233de2741f51a2a9d28443cd95b
/RawExperiments/TB/Math74Tg/AstorMain-math74/src/variant-411/org/apache/commons/math/ode/MultistepIntegrator.java
d43382b81c5f6bbfadbe948b5fbfc7c2b2ecfc48
[]
no_license
SajjadZaidi/AutoRepair
5c7aa7a689747c143cafd267db64f1e365de4d98
e21eb9384197bae4d9b23af93df73b6e46bb749a
refs/heads/master
2021-05-07T00:07:06.345617
2017-12-02T18:48:14
2017-12-02T18:48:14
112,858,432
0
0
null
null
null
null
UTF-8
Java
false
false
6,760
java
package org.apache.commons.math.ode; public abstract class MultistepIntegrator extends org.apache.commons.math.ode.nonstiff.AdaptiveStepsizeIntegrator { protected double[] scaled; protected org.apache.commons.math.linear.Array2DRowRealMatrix nordsieck; private org.apache.commons.math.ode.FirstOrderIntegrator starter; private final int nSteps; private double exp; private double safety; private double minReduction; private double maxGrowth; protected MultistepIntegrator(final java.lang.String name ,final int nSteps ,final int order ,final double minStep ,final double maxStep ,final double scalAbsoluteTolerance ,final double scalRelativeTolerance) { super(name, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance); if (nSteps <= 0) { throw org.apache.commons.math.MathRuntimeException.createIllegalArgumentException("{0} method needs at least one previous point", name); } starter = new org.apache.commons.math.ode.nonstiff.DormandPrince853Integrator(minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance); this.nSteps = nSteps; exp = (-1.0) / order; setSafety(0.9); setMinReduction(0.2); setMaxGrowth(java.lang.Math.pow(2.0, (-(exp)))); } protected MultistepIntegrator(final java.lang.String name ,final int nSteps ,final int order ,final double minStep ,final double maxStep ,final double[] vecAbsoluteTolerance ,final double[] vecRelativeTolerance) { super(name, minStep, maxStep, vecAbsoluteTolerance, vecRelativeTolerance); starter = new org.apache.commons.math.ode.nonstiff.DormandPrince853Integrator(minStep , maxStep , vecAbsoluteTolerance , vecRelativeTolerance); this.nSteps = nSteps; exp = (-1.0) / order; setSafety(0.9); setMinReduction(0.2); setMaxGrowth(java.lang.Math.pow(2.0, (-(exp)))); } public org.apache.commons.math.ode.ODEIntegrator getStarterIntegrator() { return starter; } public void setStarterIntegrator(org.apache.commons.math.ode.FirstOrderIntegrator starterIntegrator) { org.apache.commons.math.ode.MultistepIntegrator.this.starter = starterIntegrator; } protected void start(final double t0, final double[] y0, final double t) throws org.apache.commons.math.ode.DerivativeException, org.apache.commons.math.ode.IntegratorException { starter.clearEventHandlers(); starter.clearStepHandlers(); starter.addStepHandler(new org.apache.commons.math.ode.MultistepIntegrator.NordsieckInitializer(y0.length)); try { starter.integrate(new org.apache.commons.math.ode.MultistepIntegrator.CountingDifferentialEquations(y0.length), t0, y0, t, new double[y0.length]); } catch (org.apache.commons.math.ode.DerivativeException de) { if (!(de instanceof org.apache.commons.math.ode.MultistepIntegrator.InitializationCompletedMarkerException)) { throw de; } } starter.clearStepHandlers(); } protected abstract org.apache.commons.math.linear.Array2DRowRealMatrix initializeHighOrderDerivatives(final double[] first, final double[][] multistep); public double getMinReduction() { return minReduction; } public void setMinReduction(final double minReduction) { org.apache.commons.math.ode.MultistepIntegrator.this.minReduction = minReduction; } public double getMaxGrowth() { return maxGrowth; } public void setMaxGrowth(final double maxGrowth) { org.apache.commons.math.ode.MultistepIntegrator.this.maxGrowth = maxGrowth; } public double getSafety() { return safety; } public void setSafety(final double safety) { org.apache.commons.math.ode.MultistepIntegrator.this.safety = safety; } protected double computeStepGrowShrinkFactor(final double error) { return java.lang.Math.min(maxGrowth, java.lang.Math.max(minReduction, ((safety) * (java.lang.Math.pow(error, exp))))); } public static interface NordsieckTransformer { org.apache.commons.math.linear.RealMatrix initializeHighOrderDerivatives(double[] first, double[][] multistep); } private class NordsieckInitializer implements org.apache.commons.math.ode.sampling.StepHandler { private final int n; public NordsieckInitializer(final int n) { this.n = n; } public void handleStep(org.apache.commons.math.ode.sampling.StepInterpolator interpolator, boolean isLast) throws org.apache.commons.math.ode.DerivativeException { final double prev = interpolator.getPreviousTime(); final double curr = interpolator.getCurrentTime(); stepStart = prev; stepSize = (curr - prev) / ((nSteps) + 1); clear(); scaled = interpolator.getInterpolatedDerivatives().clone(); for (int j = 0 ; j < (n) ; ++j) { scaled[j] *= stepSize; } final double[][] multistep = new double[nSteps][]; for (int i = 1 ; i <= (nSteps) ; ++i) { interpolator.setInterpolatedTime((prev + ((stepSize) * i))); final double[] msI = interpolator.getInterpolatedDerivatives().clone(); for (int j = 0 ; j < (n) ; ++j) { msI[j] *= stepSize; } multistep[(i - 1)] = msI; } nordsieck = initializeHighOrderDerivatives(scaled, multistep); throw new org.apache.commons.math.ode.MultistepIntegrator.InitializationCompletedMarkerException(); } public boolean requiresDenseOutput() { return true; } public void reset() { } } private static class InitializationCompletedMarkerException extends org.apache.commons.math.ode.DerivativeException { private static final long serialVersionUID = -4105805787353488365L; public InitializationCompletedMarkerException() { super(((java.lang.Throwable)(null))); } } private class CountingDifferentialEquations implements org.apache.commons.math.ode.FirstOrderDifferentialEquations { private final int dimension; public CountingDifferentialEquations(final int dimension) { this.dimension = dimension; } public void computeDerivatives(double t, double[] y, double[] dot) throws org.apache.commons.math.ode.DerivativeException { org.apache.commons.math.ode.MultistepIntegrator.this.computeDerivatives(t, y, dot); } public int getDimension() { return dimension; } } }
[ "sajjad.syed@ucalgary.ca" ]
sajjad.syed@ucalgary.ca
67a4c2e1a1c1e79e981537a3a7fada9c4ad8c071
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/flink/2015/8/TestHarnessUtil.java
0732b641d5b73edf31eb4529b490cd518a1cfc05
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
2,226
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.flink.streaming.util; import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; import org.junit.Assert; import java.util.LinkedList; import java.util.List; import java.util.Queue; /** * Utils for working with the various test harnesses. */ public class TestHarnessUtil { /** * Extracts the StreamRecords from the given output list. */ @SuppressWarnings("unchecked") public static <OUT> List<StreamRecord<OUT>> getStreamRecordsFromOutput(List<Object> output) { List<StreamRecord<OUT>> resultElements = new LinkedList<StreamRecord<OUT>>(); for (Object e: output) { if (e instanceof StreamRecord) { resultElements.add((StreamRecord<OUT>) e); } } return resultElements; } /** * Extracts the raw elements from the given output list. */ @SuppressWarnings("unchecked") public static <OUT> List<OUT> getRawElementsFromOutput(Queue<Object> output) { List<OUT> resultElements = new LinkedList<OUT>(); for (Object e: output) { if (e instanceof StreamRecord) { resultElements.add(((StreamRecord<OUT>) e).getValue()); } } return resultElements; } /** * Compare the two queues containing operator/task output by converting them to an array first. */ public static void assertOutputEquals(String message, Queue<Object> expected, Queue<Object> actual) { Assert.assertArrayEquals(message, expected.toArray(), actual.toArray()); } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
7165f99e810c198191fa9f9ddc15437143687700
7d68a34e09e2ab22fbe0efe43ff6b3ccf44cf8a3
/Servlet/loginappcookie/src/com/javatpoint/ProfileServlet.java
7f3b142f0914da9baf05bef61023c08ec008ce46
[]
no_license
ALLISWELL-REPO/Natraj
293a9d65eb1de585fbf3d9b4f233a2c5ace1c6f6
cab1ce5c12df97e59b5cac0f53bf77c99012951a
refs/heads/master
2022-12-02T01:08:41.704483
2019-10-01T19:30:40
2019-10-01T19:30:40
212,178,682
0
0
null
2022-11-24T07:12:43
2019-10-01T19:09:51
Java
UTF-8
Java
false
false
1,065
java
package com.javatpoint; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class ProfileServlet extends HttpServlet { private static final long serialVersionUID = 1L; public ProfileServlet() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out=response.getWriter(); request.getRequestDispatcher("link.html").include(request,response); Cookie ck[]=request.getCookies(); if(ck!=null){ String name=ck[0].getValue(); if(!name.equals("")||name!=null){ out.print("<b>Welcome to profile</b>"); out.print("<br>Welcome, "+name); } }else{ out.print("please login first"); request.getRequestDispatcher("login.html").include(request, response); } out.close(); } }
[ "alliswellrepo@gmail.com" ]
alliswellrepo@gmail.com
88f423befcf41d6f459c2417f9c69b51ace3f8ad
126b90c506a84278078510b5979fbc06d2c61a39
/src/ANXCamera/sources/com/oppo/statistics/agent/ExceptionAgent.java
290e0f67b13ea296b63a391898ff16a5120c0d6a
[]
no_license
XEonAX/ANXRealCamera
196bcbb304b8bbd3d86418cac5e82ebf1415f68a
1d3542f9e7f237b4ef7ca175d11086217562fad0
refs/heads/master
2022-08-02T00:24:30.864763
2020-05-29T14:01:41
2020-05-29T14:01:41
261,256,968
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
package com.oppo.statistics.agent; import android.content.Context; import com.oppo.statistics.data.ExceptionBean; import com.oppo.statistics.record.RecordHandler; public class ExceptionAgent { public static void recordException(Context context, ExceptionBean exceptionBean) { RecordHandler.addTask(context, exceptionBean); } }
[ "sv.xeon@gmail.com" ]
sv.xeon@gmail.com
1b5d0e9067f70b8a71da444737d4a5a3c2326f5f
0e65f01a122f4590430d387c0495bcc5c0d1e173
/src/main/java/cn/edu/nju/nowcode/async_queue/handler/DislikeHandler.java
a158ca7f7e970de7f20c6a44e46b5034d3863cad
[]
no_license
congye6/nowcode
96e157dc0d1da4e73521c85ae273d15b902afce3
9ac539eb47a09813bdecdabc0faad90768d65f98
refs/heads/master
2020-03-17T00:51:55.906481
2018-07-13T14:00:17
2018-07-13T14:00:17
133,132,856
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package cn.edu.nju.nowcode.async_queue.handler; import cn.edu.nju.nowcode.async_queue.EventHandler; import cn.edu.nju.nowcode.enumeration.EventType; import cn.edu.nju.nowcode.util.RedisUtil; import cn.edu.nju.nowcode.vo.EventVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @Service public class DislikeHandler implements EventHandler { private static final List<EventType> SUPPORT_TYPE= Arrays.asList(EventType.DISLIKE); @Autowired private RedisUtil redisUtil; @Autowired private LikeHandler likeHandler; @Override public void handle(EventVO event) { String ownerId=likeHandler.getOwnerId(event); redisUtil.desc(likeHandler.getUserLikeKey(ownerId)); } @Override public boolean isSupport(EventType eventType) { return SUPPORT_TYPE.contains(eventType); } @Override public List<EventType> supportTypes() { return new ArrayList<>(SUPPORT_TYPE); } }
[ "244053679@qq.com" ]
244053679@qq.com
2f17b7b6e38445f0365761ac8f9dc03485c69a7c
7201a64a8f2380d4ec58edfa0f4c3526c9c3b0fe
/app/src/main/java/com/jc/account/AccountActivity.java
314295914e010e775adeb462708f93e74b2b3d26
[]
no_license
bsty2015/hsdandroid
3a37a729eb025e563e6beb2927dfbff82b7fcb79
8f16c356c5be0481e023c49e3a02d6afb51c9776
refs/heads/master
2021-01-10T12:54:06.555882
2015-11-27T08:01:17
2015-11-27T08:01:17
46,967,090
0
0
null
null
null
null
UTF-8
Java
false
false
3,940
java
package com.jc.account; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.android.volley.Response; import com.jc.bank.AddCardActivity; import com.jc.base.Configure; import com.jc.base.ResultData; import com.jc.ui.HeadMenuActiviyt; import com.jc.ui.WaitDialog; import com.jc.user.UserInfo; import com.jc.utils.GsonRequest; import java.util.Map; /** * Created by zy on 15/8/10. */ public class AccountActivity extends HeadMenuActiviyt { private TextView telephone; private TextView realName; private TextView identity; private LinearLayout modifyPasswd; private LinearLayout authenticationButton; private String reqUrl = Configure.API_HOST+"/api/ user/index"; private UserInfo userInfo; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override protected void onStart() { super.onStart(); userInfo = app.userInfo; if(userInfo == null || !userInfo.getIsVerify()){ requestUserInfo(); }else{ displayContent(); } } private void initAuthenticated(UserInfo userInfo){ realName = (TextView) findViewById(com.jc.R.id.realName); realName.setText(userInfo.getRealName()); identity = (TextView) findViewById(com.jc.R.id.identity); identity.setText(userInfo.getIdentity()); } private void displayContent(){ if(userInfo != null && userInfo.getIsVerify()){ setContentView(com.jc.R.layout.authenticated); initAuthenticated(userInfo); }else{ setContentView(com.jc.R.layout.not_authenticated); authenticationButton = (LinearLayout) findViewById(com.jc.R.id.authenticationButton); } initView(); setHeadTitleName("用户信息"); telephone = (TextView) findViewById(com.jc.R.id.telephone); telephone.setText(userInfo.getTelephone()); modifyPasswd = (LinearLayout) findViewById(com.jc.R.id.modifyPasswd); modifyPasswd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(AccountActivity.this, ChangepasswordActivity.class)); } }); if(authenticationButton != null ){ authenticationButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(AccountActivity.this,AddCardActivity.class)); } }); } } private void requestUserInfo(){ final WaitDialog waitDialog = WaitDialog.show(AccountActivity.this); GsonRequest request = new GsonRequest(reqUrl, new Response.Listener<ResultData>() { @Override public void onResponse(ResultData response) { waitDialog.dismiss(); try{ if(response.isSucc()){ Map<String,Object> rs = (Map<String, Object>) response.getData(); Object user = rs.get("userInfo"); userInfo = gson.fromJson(gson.toJson(user), UserInfo.class); app.userInfo = userInfo; handler.post(new Runnable() { @Override public void run() { displayContent(); } }); }else { showErrMsg(response.getErrMsg()); } }catch (Exception e){ } } }); request.withRequestParams("userId",app.getUserId().toString()); addRequest(request); } }
[ "xxx@xxx.com" ]
xxx@xxx.com
dc5088900af13d8278d2cd8ec04963e47f350e9a
9f028db2ca474cf39b15b60179b59e159869549c
/streamlet-main/src/main/java/com/linxz/main/mvp/appui/MainActivity.java
b02a3702901c81432b772a2938c9a76ef6415021
[]
no_license
paomian2/NewStreamlet
059f7b22e6c310e25fa1c9717581d76cf12dccce
86ed86d208e891744aac7af6f06a3b8c6510c2f4
refs/heads/master
2020-03-13T22:08:36.704486
2018-04-28T08:10:11
2018-04-28T08:10:11
131,310,652
0
0
null
null
null
null
UTF-8
Java
false
false
3,648
java
package com.linxz.main.mvp.appui; import android.graphics.Color; import android.support.v4.app.Fragment; import com.alibaba.android.arouter.facade.annotation.Route; import com.linxz.core.activitys.bottom.BaseBottomActivity; import com.linxz.core.activitys.bottom.BottomTabBean; import com.linxz.core.activitys.bottom.ItemBuilder; import com.linxz.core.base.ClassUtils; import com.linxz.core.base.IViewDelegate; import com.linxz.core.base.ViewManager; import com.linxz.core.fragments.BaseFragment; import com.linxz.main.mvp.appui.frags.IndexDelegate; import java.util.LinkedHashMap; import java.util.List; /** * <p> * Function: TODO * <p> * ver date author * ────────────────────────────────── * V1.0 2018年03月07日17:44 lin_xiao_zhang@163.com * <p> * Copyright (c) 2018, All Rights Reserved. * * @author linxz */ @Route(path = "/main/home") public class MainActivity extends BaseBottomActivity { @Override public LinkedHashMap<BottomTabBean, Fragment> setItems(ItemBuilder builder) { final LinkedHashMap<BottomTabBean, Fragment> items = new LinkedHashMap<>(); /* items.put(new BottomTabBean("{fa-home}", "主页"), new IndexDelegate()); items.put(new BottomTabBean("{icon-msg}", "消息"), getUsersFragment());*/ items.put(new BottomTabBean("{icon-study}", "基础"), getStudyFragment()); items.put(new BottomTabBean("{icon-offer}", "面试"), getInterviewsFragment()); return builder.addItems(items).build(); } @Override public int setIndexDelegate() { return 0; } @Override public int setOffscreenPageLimit() { return 4; } @Override public int setClickedColor() { return Color.parseColor("#ffff8800"); } @Override public void initEnvent() { super.initEnvent(); hideToolBar(true); } /** * 在Users模块中寻找实现的Fragment * * @return Fragment */ private BaseFragment getUsersFragment() { List<BaseFragment> frags=ViewManager.getInstance().getAllFragment(); BaseFragment newsFragment = null; List<IViewDelegate> viewDelegates = ClassUtils.getObjectsWithInterface(this, IViewDelegate.class, "com.linxz.users"); if (viewDelegates != null && !viewDelegates.isEmpty()) { newsFragment = viewDelegates.get(0).getFragment(""); } return newsFragment; } /** * 在Study模块中寻找实现的Fragment * * @return Fragment */ private BaseFragment getStudyFragment() { List<BaseFragment> frags=ViewManager.getInstance().getAllFragment(); BaseFragment newsFragment = null; List<IViewDelegate> viewDelegates = ClassUtils.getObjectsWithInterface(this, IViewDelegate.class, "com.linxz.androidstudy"); if (viewDelegates != null && !viewDelegates.isEmpty()) { newsFragment = viewDelegates.get(0).getFragment(""); } return newsFragment; } /** * 在Interviews模块中寻找实现的Fragment * * @return Fragment */ private BaseFragment getInterviewsFragment() { List<BaseFragment> frags=ViewManager.getInstance().getAllFragment(); BaseFragment newsFragment = null; List<IViewDelegate> viewDelegates = ClassUtils.getObjectsWithInterface(this, IViewDelegate.class, "com.linxz.interviews"); if (viewDelegates != null && !viewDelegates.isEmpty()) { newsFragment = viewDelegates.get(0).getFragment(""); } return newsFragment; } }
[ "497490337@qq.com" ]
497490337@qq.com