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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0f74595e55db1338ebfa2d0f1379c13a36481055
|
d2c7893a967738a97583368dbf1e41caeb1d47c7
|
/aTalk/src/main/java/org/jivesoftware/smackx/rayo/HeaderExtension.java
|
d24113817e88bf469b0dbdcc1908705ce0e16591
|
[
"Apache-2.0"
] |
permissive
|
cmeng-git/atalk-android
|
0b5a7f48d04ba0173852d2f2ccbe786830669603
|
a821544edc644fdb3f63402340051dc1e86c1c59
|
refs/heads/master
| 2023-07-08T08:58:44.604534
| 2023-07-07T14:24:52
| 2023-07-07T14:24:52
| 116,449,957
| 148
| 79
|
Apache-2.0
| 2023-03-28T10:31:34
| 2018-01-06T03:27:17
|
Java
|
UTF-8
|
Java
| false
| false
| 2,327
|
java
|
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* 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.jivesoftware.smackx.rayo;
import org.jivesoftware.smackx.AbstractExtensionElement;
/**
* Header packet extension optionally included in {@link RayoIqProvider.RayoIq}. Holds 'name' and
* 'value' attributes.
*
* @author Pawel Domas
*/
public class HeaderExtension extends AbstractExtensionElement
{
/**
* XML element name.
*/
public static final String ELEMENT = "header";
/**
* The name of 'name' attribute.
*/
public static final String NAME_ATTR_NAME = "name";
/**
* The name of 'value' attribute.
*/
public static final String VALUE_ATTR_NAME = "value";
/**
* Creates new instance of <code>HeaderPacketExtension</code>.
*/
public HeaderExtension()
{
super(ELEMENT, RayoIqProvider.NAMESPACE);
}
/**
* Return the value of 'name' attribute.
*
* @return the value of 'name' attribute.
*/
public String getName()
{
return getAttributeAsString(NAME_ATTR_NAME);
}
/**
* Sets new value for 'name' attribute of this extension.
*
* @param name the new value to set for 'name' attribute.
*/
public void setName(String name)
{
setAttribute(NAME_ATTR_NAME, name);
}
/**
* Returns the value of 'value' attribute.
*
* @return the value of 'value' attribute.
*/
public String getValue()
{
return getAttributeAsString(VALUE_ATTR_NAME);
}
/**
* Sets new value for the 'value' attribute.
*
* @param value new value for the 'value' attribute to set.
*/
public void setValue(String value)
{
setAttribute(VALUE_ATTR_NAME, value);
}
}
|
[
"cmeng.gm@gmail.com"
] |
cmeng.gm@gmail.com
|
b105e252370cbe4d3c2632cd13e17996b3bfa8c7
|
3f4f2f045b2a426e9ef91863e12458f47c0d7ce1
|
/URA_Multiplus_V2/WEB-INF/src/flow/subflow/OuvirProcedimentos/Retorno.java
|
65a13bb58e3b1fcfaa841c2aef7346971e9a532b
|
[] |
no_license
|
gtau/URA_Multiplus
|
786de99c9a68aa625597c139a19ec7d0ca8348be
|
a001d543ad71d8c4c5be492cc34111eb37a59414
|
refs/heads/master
| 2016-09-14T00:13:23.053748
| 2016-05-03T20:43:33
| 2016-05-03T20:43:33
| 56,319,735
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 562
|
java
|
package flow.subflow.OuvirProcedimentos;
/**
* This servlet is the exit point of a subflow. The base class handles
* the logic for forwarding to the next servlet.
* Last generated by Orchestration Designer at: 2016-APR-29 09:38:36 PM
*/
public class Retorno extends com.avaya.sce.runtime.SubflowReturn {
//{{START:CLASS:FIELDS
//}}END:CLASS:FIELDS
/**
* Default constructor
* Last generated by Orchestration Designer at: 2016-APR-29 09:38:36 PM
*/
public Retorno() {
//{{START:CLASS:CONSTRUCTOR
super();
//}}END:CLASS:CONSTRUCTOR
}
}
|
[
"gabrieltau@365ti.com.br"
] |
gabrieltau@365ti.com.br
|
d6046b20e18ea920ef2f3bdc88a8c9b8518fae36
|
ce8afc9981be5f7d78cfa8a0243c9d059818d1b3
|
/services/hrdb/src/com/auto_hlyknyxrjx/hrdb/service/HrdbProcedureExecutorService.java
|
ed4291759eff5547bfa5e50d5314bf653adcf658
|
[] |
no_license
|
wavemakerapps/Auto_hlyKNYXrJX
|
cfde669f7f842bae333ce643b7c43955412df191
|
af5387daabcdce34f4b1c3aa975d80898d5f737d
|
refs/heads/master
| 2021-09-01T12:21:56.176761
| 2017-12-27T00:30:39
| 2017-12-27T00:30:39
| 115,464,690
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 519
|
java
|
/*Copyright (c) 2015-2016 wavemaker.com All Rights Reserved.
This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance
with the terms of the source code license agreement you entered into with wavemaker.com*/
package com.auto_hlyknyxrjx.hrdb.service;
/*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/
public interface HrdbProcedureExecutorService {
}
|
[
"automate1@wavemaker.com"
] |
automate1@wavemaker.com
|
81c14005dafe494f911d8795b9e4641c315df9d5
|
d6de3bd8574333a697d8f9c607e95fda7d1163c1
|
/ahome-titanium/src/main/java/com/ait/toolkit/titanium/mobile/client/core/events/ui/DoubleTapEvent.java
|
4df1cabba9a332d7948c1c74c90b0424c7080039
|
[] |
no_license
|
dikalo/ahome-titanium
|
c565a489778d5301a9517d3b7bf9331c0d7103e6
|
48104da303de2f8704728e199ac97e26b9a29fb2
|
refs/heads/master
| 2021-06-01T03:57:55.840203
| 2016-07-27T00:36:55
| 2016-07-27T00:36:55
| 30,990,755
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,350
|
java
|
/*
Copyright (c) 2014 Ahomé Innovation Technologies. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.ait.toolkit.titanium.mobile.client.core.events.ui;
import com.ait.toolkit.titanium.mobile.client.core.handlers.ui.DoubleTapHandler;
import com.ait.toolkit.titanium.mobile.client.ui.Point;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.event.dom.client.DomEvent.Type;
public class DoubleTapEvent extends InteractionEvent{
public static String EVENT_NAME = "doubletap";
/**
* UiBinder implementations
*/
private static Type<DoubleTapHandler> TYPE = new Type<DoubleTapHandler>(EVENT_NAME, null);
public static Type<DoubleTapHandler> getType() {
return TYPE;
}
public static Type<DoubleTapHandler> getAssociatedType() {
return TYPE;
}
protected DoubleTapEvent() {
}
private DoubleTapEvent(JavaScriptObject jso) {
this.jsObj = jso;
}
public native double getX() /*-{
var jso = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();
return jso.x;
}-*/;
public native double getY() /*-{
var jso = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();
return jso.y;
}-*/;
private native double _getGlobalX() /*-{
var jso = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();
return jso.globalPoint.x;
}-*/;
private native double _getGlobalY() /*-{
var jso = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();
return jso.globalPoint.y;
}-*/;
public Point getGlobalPoint() {
return new Point(_getGlobalX(), _getGlobalY());
}
public native boolean bubbles() /*-{
var jso = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();
return jso.bubbles;
}-*/;
public native boolean bubbleCanceled() /*-{
var jso = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();
return jso.cancelBubble;
}-*/;
}
|
[
"alainekambi@alaineksmacbook.fritz.box"
] |
alainekambi@alaineksmacbook.fritz.box
|
cd718ffee7f2463594926e826e9f57d5279e8ff8
|
cf52b3064d536af626339ddd30b28c0b8e15aaee
|
/gameserver/src/main/java/org/l2junity/gameserver/model/skills/conditiontypes/CannotUseInTransformSkillCondition.java
|
81c203454b552038a98004062e85f53cd0a6573b
|
[] |
no_license
|
LegacyofAden/emu-ungp
|
7aaa7d9fd60698cb784d8c2c1eaaa20ef0a8d59b
|
b76dc91157e43d67f886b6926afd11b110ed5dce
|
refs/heads/master
| 2021-01-01T18:21:03.529671
| 2017-04-08T23:08:37
| 2017-04-08T23:08:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,496
|
java
|
/*
* Copyright (C) 2004-2015 L2J Unity
*
* This file is part of L2J Unity.
*
* L2J Unity 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.
*
* L2J Unity is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2junity.gameserver.model.skills.conditiontypes;
import org.l2junity.gameserver.model.StatsSet;
import org.l2junity.gameserver.model.WorldObject;
import org.l2junity.gameserver.model.actor.Creature;
import org.l2junity.gameserver.model.skills.ISkillCondition;
import org.l2junity.gameserver.model.skills.Skill;
/**
* @author Sdw
*/
public class CannotUseInTransformSkillCondition implements ISkillCondition {
private final int _transformId;
public CannotUseInTransformSkillCondition(StatsSet params) {
_transformId = params.getInt("transformId", -1);
}
@Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) {
return (_transformId > 0) ? caster.getTransformationId() != _transformId : !caster.isTransformed();
}
}
|
[
"RaaaGEE@users.noreply.github.com"
] |
RaaaGEE@users.noreply.github.com
|
d97193b4aa56601587edf6026aebc5787cc2fbf7
|
8f84b92a84c5a2f5a640ca0a7cbba3cfa957154d
|
/mediatek/packages/apps/RCSe/core/src/com/orangelabs/rcs/core/ims/service/richcall/video/VideoSdpBuilder.java
|
4d1991f5f2fc47d9f4f106bf0f3a7373d73227b3
|
[
"BSD-2-Clause",
"Apache-2.0",
"NIST-PD"
] |
permissive
|
Al3XKOoL/MT65x2_kernel_lk
|
c7a23c2d41fb4c593d1bb9054a15d3b51ffaa224
|
51fe3f27e90e42dbdebae928e6b787f82bee4ddc
|
refs/heads/master
| 2021-01-18T10:25:35.483668
| 2015-03-25T07:17:37
| 2015-03-25T07:17:37
| 32,857,246
| 0
| 4
| null | 2015-03-25T10:16:26
| 2015-03-25T10:16:26
| null |
UTF-8
|
Java
| false
| false
| 6,970
|
java
|
/*******************************************************************************
* Software Name : RCS IMS Stack
*
* Copyright (C) 2010 France Telecom S.A.
*
* 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.orangelabs.rcs.core.ims.service.richcall.video;
import java.util.Vector;
import com.orangelabs.rcs.core.ims.network.sip.SipUtils;
import com.orangelabs.rcs.core.ims.protocol.rtp.RtpUtils;
import com.orangelabs.rcs.core.ims.protocol.sdp.MediaDescription;
import com.orangelabs.rcs.service.api.client.media.MediaCodec;
import com.orangelabs.rcs.service.api.client.media.video.VideoCodec;
import com.orangelabs.rcs.utils.logger.Logger;
/**
* Builds the Video SDP
*
* @author Deutsche Telekom
*/
public class VideoSdpBuilder {
/**
* Extension attribute name, RFC5285
*/
public static final String ATTRIBUTE_EXTENSION = "extmap";
/**
* The logger
*/
private static Logger logger = Logger.getLogger(VideoSdpBuilder.class.getName());
/**
* Build SDP offer without the orientation extension ordered by the
* preferred codec
*
* @param supportedCodecs Codecs to create SDP
* @param localRtpPort Local RTP port
* @return SDP offer
*/
public static String buildSdpOfferWithoutOrientation(MediaCodec[] supportedCodecs, int localRtpPort) {
StringBuilder result = new StringBuilder();
// Create video codec list
Vector<VideoCodec> codecs = new Vector<VideoCodec>();
for (int i = 0; i < supportedCodecs.length; i++) {
codecs.add(new VideoCodec(supportedCodecs[i]));
}
result.append("m=video " + localRtpPort + " RTP/AVP");
for (VideoCodec codec : codecs) {
result.append(" ").append(codec.getPayload());
}
result.append(SipUtils.CRLF);
int framerate = 0;
for (VideoCodec codec : codecs) {
if (codec.getFramerate() > framerate) {
framerate = codec.getFramerate();
}
}
if (framerate > 0) {
result.append("a=framerate:" + framerate + SipUtils.CRLF);
}
for (VideoCodec codec : codecs) {
result.append("a=rtpmap:" + codec.getPayload() + " " + codec.getCodecName() + "/" + codec.getClockRate() + SipUtils.CRLF);
if (codec.getWidth() != 0 && codec.getHeight() != 0) {
result.append("a=framesize:" + codec.getPayload() + " " + codec.getWidth() + "-" + codec.getHeight() + SipUtils.CRLF);
}
result.append("a=fmtp:" + codec.getPayload() + " " + codec.getCodecParams() + SipUtils.CRLF);
}
return result.toString();
}
/**
* Build SDP offer without the orientation extension ordered by the
* preferred codec
*
* @param supportedCodecs Codecs to create SDP
* @param localRtpPort Local RTP port
* @return SDP offer
*/
public static String buildSdpOfferWithOrientation(MediaCodec[] supportedCodecs, int localRtpPort) {
StringBuilder sdp = new StringBuilder(buildSdpOfferWithoutOrientation(supportedCodecs, localRtpPort))
.append("a=").append(ATTRIBUTE_EXTENSION).append(':').append(RtpUtils.RTP_DEFAULT_EXTENSION_ID)
.append(" " + SdpOrientationExtension.VIDEO_ORIENTATION_URI).append(SipUtils.CRLF);
return sdp.toString();
}
/**
* Create the SDP part for a given codec
*
* @param codec Media codec
* @param localRtpPort Local RTP port
* @return SDP
*/
private static String buildSdpWithoutOrientation(MediaCodec codec, int localRtpPort) {
if (codec == null) {
logger.info("Invalid codec");
return "";
}
VideoCodec videoCodec = new VideoCodec(codec);
StringBuilder sdp = new StringBuilder()
.append("m=video ").append(localRtpPort).append(" RTP/AVP ")
.append(videoCodec.getPayload()).append(SipUtils.CRLF)
.append("a=rtpmap:").append(videoCodec.getPayload()).append(" ")
.append(videoCodec.getCodecName()).append("/")
.append(videoCodec.getClockRate()).append(SipUtils.CRLF);
if (videoCodec.getWidth() != 0 && videoCodec.getHeight() != 0) {
sdp.append("a=framesize:").append(videoCodec.getPayload()).append(" ")
.append(videoCodec.getWidth()).append("-").append(videoCodec.getHeight())
.append(SipUtils.CRLF);
}
if (videoCodec.getFramerate() != 0) {
sdp.append("a=framerate:").append(videoCodec.getFramerate()).append(SipUtils.CRLF);
}
sdp.append("a=fmtp:").append(videoCodec.getPayload()).append(" ")
.append(videoCodec.getCodecParams()).append(SipUtils.CRLF);
return sdp.toString();
}
/**
* Create the SDP part with orientation extension for a given codec
*
* @param codec Media Codec
* @param localRtpPort Local RTP Port
* @param extensionId
* @return SDP
*/
private static String buildSdpWithOrientationExtension(MediaCodec codec, int localRtpPort, int extensionId) {
StringBuilder sdp = new StringBuilder(buildSdpWithoutOrientation(codec, localRtpPort))
.append("a=").append(ATTRIBUTE_EXTENSION).append(':').append(extensionId)
.append(" " + SdpOrientationExtension.VIDEO_ORIENTATION_URI).append(SipUtils.CRLF);
return sdp.toString();
}
/**
* Builds the {@link MediaCodec} SDP for a SIP INVITE response. If the SIP
* INVITE SDP doesn't have the orientation extension then the response SDP
* also shouldn't have.
*
* @param codec Media Codec
* @param localRtpPort Local RTP Port
* @param videoMedia Invite video media
* @return SDP answer
*/
public static String buildSdpAnswer(MediaCodec codec, int localRtpPort, MediaDescription inviteVideoMedia) {
if (inviteVideoMedia != null) {
SdpOrientationExtension extension = SdpOrientationExtension.create(inviteVideoMedia);
if (extension != null) {
return buildSdpWithOrientationExtension(codec, localRtpPort,
extension.getExtensionId());
}
}
return buildSdpWithoutOrientation(codec, localRtpPort);
}
}
|
[
"inspektor.po13@gmail.com"
] |
inspektor.po13@gmail.com
|
19346f515f1b88986be515ed2416a9e109d511d5
|
a741d82fb5ee0203161455353587ffcc902ef351
|
/aylson-dao/src/main/java/com/aylson/dc/sys/vo/CouponActivityVo.java
|
0e52eba991a547b98c5918979b495aaea16fb153
|
[] |
no_license
|
xiaofeifei321/aylson-parent
|
b48121272d5e92a1acc4b671ab7af63aa6c06b0b
|
3749a0f1ef45851b4aa513b324ef23a04e4421d3
|
refs/heads/master
| 2022-12-23T20:15:51.598455
| 2019-08-29T11:30:13
| 2019-08-29T11:30:13
| 204,696,341
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 844
|
java
|
package com.aylson.dc.sys.vo;
import com.aylson.dc.sys.po.CouponActivity;
public class CouponActivityVo extends CouponActivity {
private static final long serialVersionUID = 454577187134709521L;
private String startTimeStr; //活动开始时间
private String endTimeStr; //活动结束时间
private String curAuditOpinion; //当前审核意见
public String getStartTimeStr() {
return startTimeStr;
}
public void setStartTimeStr(String startTimeStr) {
this.startTimeStr = startTimeStr;
}
public String getEndTimeStr() {
return endTimeStr;
}
public void setEndTimeStr(String endTimeStr) {
this.endTimeStr = endTimeStr;
}
public String getCurAuditOpinion() {
return curAuditOpinion;
}
public void setCurAuditOpinion(String curAuditOpinion) {
this.curAuditOpinion = curAuditOpinion;
}
}
|
[
"874189630@qq.com"
] |
874189630@qq.com
|
8906f3332fbb59bb500e3b3384451da8c89089a1
|
8c604e804cf5e1e85661a204960fbda5e9c76b66
|
/wegas-core/src/main/java/com/wegas/core/IndentLogger.java
|
64a4283504e6d64239c6c8d8f1a695a135e3a044
|
[
"MIT"
] |
permissive
|
Heigvd/Wegas
|
70a3723e021e6ba24badf0e9f9a8b88e86254ae0
|
2b7d9c369b1dcc0c751ddfb6e8ab19bdb4f87893
|
refs/heads/master
| 2023-09-01T05:19:32.371274
| 2023-08-25T10:12:47
| 2023-08-25T11:26:08
| 3,102,131
| 29
| 13
|
MIT
| 2023-09-06T09:40:06
| 2012-01-04T13:31:04
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 1,342
|
java
|
/**
* Wegas
* http://wegas.albasim.ch
*
* Copyright (c) 2013-2021 School of Management and Engineering Vaud, Comem, MEI
* Licensed under the MIT License
*/
package com.wegas.core;
import org.slf4j.Logger;
public class IndentLogger {
private static final String SEP = " ";
private int indentLevel = 0;
private final Logger logger;
public IndentLogger(Logger logger) {
this.logger = logger;
}
public void info(String msg, Object... args) {
logger.info(this.buildMessage(msg), args);
}
public void error(String msg, Object... args) {
logger.error(this.buildMessage(msg), args);
}
public void debug(String msg, Object... args) {
logger.debug(this.buildMessage(msg), args);
}
public void warn(String msg, Object... args) {
logger.warn(this.buildMessage(msg), args);
}
public void trace(String msg, Object... args) {
logger.trace(this.buildMessage(msg), args);
}
private String buildMessage(String msg) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < indentLevel; i++) {
sb.append(SEP);
}
sb.append(msg);
return sb.toString();
}
public void indent() {
indentLevel++;
}
public void unindent() {
indentLevel--;
}
}
|
[
"maxence.laurent@gmail.com"
] |
maxence.laurent@gmail.com
|
acb4b0299fe52749dddb6d62862e8bb8d4a3bd10
|
b06acf556b750ac1fa5b28523db7188c05ead122
|
/IfcXML/src/org/tech/iai/ifc/xml/ifc/_2x3/final_/IfcInternalOrExternalEnumType.java
|
6d570417a262896c3a5e7aa84c82eaa2326103dc
|
[] |
no_license
|
christianharrington/MDD
|
3500afbe5e1b1d1a6f680254095bb8d5f63678ba
|
64beecdaed65ac22b0047276c616c269913afd7f
|
refs/heads/master
| 2021-01-10T21:42:53.686724
| 2012-12-17T03:27:05
| 2012-12-17T03:27:05
| 6,157,471
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,182
|
java
|
/**
*/
package org.tech.iai.ifc.xml.ifc._2x3.final_;
import java.math.BigInteger;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Ifc Internal Or External Enum Type</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnumType#getValue <em>Value</em>}</li>
* <li>{@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnumType#getId <em>Id</em>}</li>
* <li>{@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnumType#getPath <em>Path</em>}</li>
* <li>{@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnumType#getPos <em>Pos</em>}</li>
* </ul>
* </p>
*
* @see org.tech.iai.ifc.xml.ifc._2x3.final_.FinalPackage#getIfcInternalOrExternalEnumType()
* @model extendedMetaData="name='IfcInternalOrExternalEnum_._type' kind='simple'"
* @generated
*/
public interface IfcInternalOrExternalEnumType extends EObject {
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* The literals are from the enumeration {@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnum}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnum
* @see #setValue(IfcInternalOrExternalEnum)
* @see org.tech.iai.ifc.xml.ifc._2x3.final_.FinalPackage#getIfcInternalOrExternalEnumType_Value()
* @model unsettable="true"
* extendedMetaData="name=':0' kind='simple'"
* @generated
*/
IfcInternalOrExternalEnum getValue();
/**
* Sets the value of the '{@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnumType#getValue <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Value</em>' attribute.
* @see org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnum
* @see #getValue()
* @generated
*/
void setValue(IfcInternalOrExternalEnum value);
/**
* Returns the value of the '<em><b>Id</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Id</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Id</em>' attribute.
* @see #setId(String)
* @see org.tech.iai.ifc.xml.ifc._2x3.final_.FinalPackage#getIfcInternalOrExternalEnumType_Id()
* @model id="true" dataType="org.eclipse.emf.ecore.xml.type.ID"
* extendedMetaData="kind='attribute' name='id'"
* @generated
*/
String getId();
/**
* Sets the value of the '{@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnumType#getId <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Id</em>' attribute.
* @see #getId()
* @generated
*/
void setId(String value);
/**
* Returns the value of the '<em><b>Path</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Path</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Path</em>' attribute.
* @see #setPath(List)
* @see org.tech.iai.ifc.xml.ifc._2x3.final_.FinalPackage#getIfcInternalOrExternalEnumType_Path()
* @model dataType="org.eclipse.emf.ecore.xml.type.NMTOKENS" many="false"
* extendedMetaData="kind='attribute' name='path'"
* @generated
*/
List<String> getPath();
/**
* Sets the value of the '{@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnumType#getPath <em>Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Path</em>' attribute.
* @see #getPath()
* @generated
*/
void setPath(List<String> value);
/**
* Returns the value of the '<em><b>Pos</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Pos</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Pos</em>' attribute.
* @see #setPos(List)
* @see org.tech.iai.ifc.xml.ifc._2x3.final_.FinalPackage#getIfcInternalOrExternalEnumType_Pos()
* @model dataType="org.iso.standard._10303.part._28.version._2.xmlschema.common.PosType" many="false"
* extendedMetaData="kind='attribute' name='pos'"
* @generated
*/
List<BigInteger> getPos();
/**
* Sets the value of the '{@link org.tech.iai.ifc.xml.ifc._2x3.final_.IfcInternalOrExternalEnumType#getPos <em>Pos</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Pos</em>' attribute.
* @see #getPos()
* @generated
*/
void setPos(List<BigInteger> value);
} // IfcInternalOrExternalEnumType
|
[
"christian@harrington.dk"
] |
christian@harrington.dk
|
2ddbb1ec15cc9050039e7b37ffa02e989b85e04f
|
2d3d94352bbbfe920dc43c95cefa19dd0be6e8a5
|
/flink/src/main/java/com/test/flink/TestCollect.java
|
77fa0fc936c23eedb6163fd4c39f2687e63fd761
|
[] |
no_license
|
shenfl/test
|
42649c2b4ef4397c99b56ed0a46beeff92a783d0
|
c2abe2b34b06945822726c6601c3e1d37a187219
|
refs/heads/master
| 2022-12-23T12:47:05.752131
| 2021-05-20T16:09:22
| 2021-05-20T16:09:22
| 137,750,493
| 0
| 1
| null | 2022-12-15T23:39:41
| 2018-06-18T12:43:46
|
Java
|
UTF-8
|
Java
| false
| false
| 7,568
|
java
|
package com.test.flink;
import org.apache.flink.api.common.restartstrategy.RestartStrategies;
import org.apache.flink.api.common.time.Time;
import org.apache.flink.streaming.api.TimeCharacteristic;
import org.apache.flink.streaming.api.collector.selector.OutputSelector;
import org.apache.flink.streaming.api.datastream.ConnectedStreams;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.SplitStream;
import org.apache.flink.streaming.api.environment.CheckpointConfig;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.co.CoFlatMapFunction;
import org.apache.flink.streaming.api.functions.sink.SinkFunction;
import org.apache.flink.streaming.api.functions.source.ParallelSourceFunction;
import org.apache.flink.streaming.api.functions.source.SourceFunction;
import org.apache.flink.util.Collector;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
/**
* Created by shenfl on 2018/9/28
* 用connect算子传递配置流
* https://github.com/streaming-olap/training/blob/master/flink-api-example/src/main/java/Main.java
*/
public class TestCollect {
public static void main(String[] args) throws Exception {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);
if (true) {
// 设置checkpoint
env.enableCheckpointing(60000);
CheckpointConfig checkpointConf = env.getCheckpointConfig();
checkpointConf.setMinPauseBetweenCheckpoints(30000L);
checkpointConf.setCheckpointTimeout(10000L);
checkpointConf.enableExternalizedCheckpoints(CheckpointConfig.ExternalizedCheckpointCleanup.RETAIN_ON_CANCELLATION);
} else {
// non checkpoint
env.setRestartStrategy(RestartStrategies.fixedDelayRestart(
Integer.MAX_VALUE, // number of restart attempts
Time.of(5, TimeUnit.SECONDS) // delay
));
}
//为什么要 broadcast ?
//配置流
DataStream<String> configDataStream = env.addSource(new SocketSource())
.broadcast();
DataStream<Record> dataStream = env.addSource(new ConnectSource());
ConnectedStreams<Record, String> connectedStreams = dataStream.connect(configDataStream);
DataStream<Record> flatMapDataStream = connectedStreams.flatMap(new CoFlatMapFunction<Record, String, Record>() {
private String config;
@Override
public void flatMap1(Record record, Collector<Record> collector) throws Exception {
/*
*
*
* 处理业务逻辑
*
* */
if (config.equals("0")) {
collector.collect(record);
} else if(config.equals("1")) {
collector.collect(record);
}
System.out.println("Received config");
}
@Override
public void flatMap2(String s, Collector<Record> collector) throws Exception {
/*
* 处理配置
*/
config = s;
System.out.println(s);
}
});
SplitStream<Record> splitStream = dataStream.split(new OutputSelector<Record>() {
@Override
public Iterable<String> select(Record record) {
List<String> output = new ArrayList<String>();
String biz = "" + record.getBizId();
output.add(biz);
return output;
}
});
splitStream.select("1").addSink(new SinkFunction<Record>() {
@Override
public void invoke(Record record) throws Exception {
System.out.println(record);
}
});
splitStream.select("2").addSink(new SinkFunction<Record>() {
@Override
public void invoke(Record record) throws Exception {
System.out.println(record);
}
});
env.execute();
}
static class ConnectSource implements ParallelSourceFunction<Record> {
private static Random random = new Random();
/**
*
* 产生数据
*/
@Override
public void run(SourceContext<Record> sourceContext) throws Exception {
while (true) {
/*
* v1 业务线
* v2 业务Id
* v3 业务属性值
* v4 时间戳
* ....
*/
Random random = new Random(100);
Record record = new Record();
for (int i = 0 ; i < 4 ; i++) {
record.setBizName("" + i);
record.setBizId(i);
record.setAttr(Integer.valueOf(random.nextInt() / 10));
record.setData("json string or other");
record.setTimestamp(new Long(System.currentTimeMillis()) / 1000);
sourceContext.collect(record);
}
Thread.sleep(200);
}
}
/**
* 关闭资源
*/
@Override
public void cancel() {
}
}
static class SocketSource implements SourceFunction<String> {
private volatile boolean running = true;
@Override
public void run(SourceContext<String> sourceContext) throws Exception {
while (running) {
try {
String response = SocketSource.sendGet("http://172.17.40.234:13080/partition/getMetrics", "");
sourceContext.collect(response);
} catch (Exception e) {
//TODO
}
Thread.sleep(60000);
}
}
@Override
public void cancel() {
running = false;
}
public static String sendGet(String url, String param) throws Exception {
String result = "";
BufferedReader in = null;
try {
String e = url + param;
URL realUrl = new URL(e);
URLConnection connection = realUrl.openConnection();
connection.setConnectTimeout(3000);
connection.connect();
String line;
for(in = new BufferedReader(new InputStreamReader(connection.getInputStream())); (line = in.readLine()) != null; result = result + line) {
;
}
} catch (Exception var15) {
var15.printStackTrace();
throw new Exception("发送GET请求出现异常!" + var15);
} finally {
try {
if(in != null) {
in.close();
}
} catch (Exception var14) {
var14.printStackTrace();
throw new Exception("关闭网络请求异常!" + var14);
}
}
return result;
}
}
}
|
[
"shenfeilong@souche.com"
] |
shenfeilong@souche.com
|
0c1ba528fc5dd03f2a320844e48c88fe5f877ff3
|
7d8c64f1f09e13043f14a5a235c4e61272a77506
|
/sources/org/appcelerator/titanium/view/TiBackgroundColorWrapper.java
|
525a87db9a80ed2a5cc9dcea33e6a5aa29f4fe31
|
[] |
no_license
|
AlexKohanim/QuickReturn
|
168530c2ef4035faff817a901f1384ed8a554f73
|
1ce10de7020951d49f80b66615fe3537887cea80
|
refs/heads/master
| 2022-06-25T19:00:59.818761
| 2020-05-08T20:11:14
| 2020-05-08T20:11:14
| 262,418,565
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,408
|
java
|
package org.appcelerator.titanium.view;
import android.annotation.TargetApi;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.os.Build.VERSION;
import android.view.View;
import android.view.ViewParent;
import java.lang.reflect.Field;
import org.appcelerator.kroll.common.Log;
public class TiBackgroundColorWrapper {
private static final String COLOR_DRAWABLE_STATE_VAR = "mState";
private static final String COLOR_DRAWABLE_USE_COLOR_VAR = "mUseColor";
private static final String ERR_BACKGROUND_COLOR = "Unable to determine the current background color. Transparent will be returned as the color value.";
private static final boolean IS_HONEYCOMB_OR_GREATER = (VERSION.SDK_INT >= 11);
private static final String TAG = TiBackgroundColorWrapper.class.getSimpleName();
private static boolean cdBackgroundReflectionReady = false;
private static Field cdBackgroundStateColorField = null;
private static Field cdBackgroundStateField = null;
private final View view;
public TiBackgroundColorWrapper(View view2) {
this.view = view2;
}
public static TiBackgroundColorWrapper wrap(View v) {
return new TiBackgroundColorWrapper(v);
}
private Drawable findNearestBackgroundDrawable(View view2) {
Drawable backgroundDrawable = null;
View checkView = view2;
while (backgroundDrawable == null && checkView != null) {
backgroundDrawable = checkView.getBackground();
if (backgroundDrawable != null) {
backgroundDrawable = backgroundDrawable.getCurrent();
if (backgroundDrawable instanceof LayerDrawable) {
LayerDrawable layerDrawable = (LayerDrawable) backgroundDrawable;
int layerCount = layerDrawable.getNumberOfLayers();
if (layerCount > 0) {
backgroundDrawable = layerDrawable.getDrawable(layerCount - 1);
if (backgroundDrawable != null) {
backgroundDrawable = backgroundDrawable.getCurrent();
}
}
}
}
if (backgroundDrawable == null) {
ViewParent parent = checkView.getParent();
checkView = null;
if (parent instanceof View) {
checkView = (View) parent;
}
}
}
return backgroundDrawable;
}
public int getBackgroundColor() {
if (this.view == null) {
Log.m44w(TAG, "View was not set. Unable to determine the current background color. Returning Color.TRANSPARENT.");
return 0;
}
Drawable backgroundDrawable = findNearestBackgroundDrawable(this.view);
if (backgroundDrawable == null) {
Log.m44w(TAG, ERR_BACKGROUND_COLOR);
return 0;
} else if (backgroundDrawable instanceof ColorDrawable) {
return getColorFromColorDrawable((ColorDrawable) backgroundDrawable);
} else {
if (backgroundDrawable instanceof TiGradientDrawable) {
int[] gradientColors = ((TiGradientDrawable) backgroundDrawable).getColors();
if (gradientColors.length > 0) {
return gradientColors[gradientColors.length - 1];
}
Log.m44w(TAG, ERR_BACKGROUND_COLOR);
return 0;
}
if (backgroundDrawable instanceof ShapeDrawable) {
Paint paint = ((ShapeDrawable) backgroundDrawable).getPaint();
if (paint != null) {
return paint.getColor();
}
}
Log.m44w(TAG, ERR_BACKGROUND_COLOR);
return 0;
}
}
private void initColorDrawableReflection(ColorDrawable colorDrawable) {
cdBackgroundReflectionReady = true;
try {
cdBackgroundStateField = ColorDrawable.class.getDeclaredField(COLOR_DRAWABLE_STATE_VAR);
cdBackgroundStateField.setAccessible(true);
try {
cdBackgroundStateColorField = cdBackgroundStateField.getType().getDeclaredField(COLOR_DRAWABLE_USE_COLOR_VAR);
cdBackgroundStateColorField.setAccessible(true);
} catch (Exception e) {
Log.m34e(TAG, "Reflection failed while trying to determine background color of view.", (Throwable) e);
cdBackgroundStateColorField = null;
}
} catch (Exception e2) {
Log.m34e(TAG, "Reflection failed while trying to determine background color of view.", (Throwable) e2);
cdBackgroundStateField = null;
}
}
private int getColorFromColorDrawable(ColorDrawable colorDrawable) {
if (IS_HONEYCOMB_OR_GREATER) {
return getColorFromColorDrawableHC(colorDrawable);
}
if (!cdBackgroundReflectionReady) {
initColorDrawableReflection(colorDrawable);
}
if (cdBackgroundStateField == null || cdBackgroundStateColorField == null) {
Log.m44w(TAG, ERR_BACKGROUND_COLOR);
return 0;
}
try {
Object colorStatusInstance = cdBackgroundStateField.get(colorDrawable);
if (colorStatusInstance == null) {
Log.m44w(TAG, ERR_BACKGROUND_COLOR);
return 0;
}
boolean z = false;
try {
return cdBackgroundStateColorField.getInt(colorStatusInstance);
} catch (Exception e) {
Log.m46w(TAG, ERR_BACKGROUND_COLOR, (Throwable) e);
return z;
}
} catch (Exception e2) {
Log.m46w(TAG, ERR_BACKGROUND_COLOR, (Throwable) e2);
return 0;
}
}
@TargetApi(11)
private int getColorFromColorDrawableHC(ColorDrawable colorDrawable) {
return colorDrawable.getColor();
}
public void setBackgroundColor(int value) {
if (this.view == null) {
Log.m44w(TAG, "Wrapped view is null. Cannot set background color.");
} else {
this.view.setBackgroundColor(value);
}
}
}
|
[
"akohanim@sfsu.edu"
] |
akohanim@sfsu.edu
|
93799f2c9b98000c5dadf110c72a9b98d13f0547
|
6b2a8dd202fdce77c971c412717e305e1caaac51
|
/solutions_5648941810974720_0/java/r00T/GettingTheDigits.java
|
4370a4fff8345aad96acf875fbb0515caa730311
|
[] |
no_license
|
alexandraback/datacollection
|
0bc67a9ace00abbc843f4912562f3a064992e0e9
|
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
|
refs/heads/master
| 2021-01-24T18:27:24.417992
| 2017-05-23T09:23:38
| 2017-05-23T09:23:38
| 84,313,442
| 2
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,083
|
java
|
import java.util.Scanner;
public class GettingTheDigits {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
for(int i = 1; i <= n ; i++) {
String str = scanner.next();
processTestCase(i, str);
}
}
private static void processTestCase(int t, String str) {
int arr[] = new int[26];
for(int i = 0; i<str.length();i++) {
arr[str.charAt(i) - 'A']++;
}
int digit[] = new int[10];
digit[2] = arr['W'-'A'];
digit[4] = arr['U'-'A'];
digit[6] = arr['X'-'A'];
digit[8] = arr['G'-'A'];
digit[0] = arr['Z'-'A'];
digit[5] = arr['F'-'A'] - digit[4];
digit[7] = arr['V'-'A'] - digit[5];
digit[9] = arr['I'-'A'] - digit[8] - digit[6] - digit[5];
digit[3] = arr['R'-'A']- digit[4] - digit[0];
digit[1] = arr['O'-'A']- digit[4] - digit[0] - digit[2];
System.out.print("Case #" + t + ": ");
for(int i = 0; i < 10 ;i++) {
for(int j = 0;j < digit[i];j++) {
System.out.print(i);
}
}
System.out.println();
}
}
|
[
"alexandra1.back@gmail.com"
] |
alexandra1.back@gmail.com
|
123c1fc66fdb471efbe7267fd8d6d198ec613bcc
|
95c49f466673952b465e19a5ee3ae6eff76bee00
|
/src/main/java/com/zhihu/android/app/p1311ui/activity/action/impl/GlobalPopup.java
|
73f5a8d448359483307abed582bc4269d3d153d5
|
[] |
no_license
|
Phantoms007/zhihuAPK
|
58889c399ae56b16a9160a5f48b807e02c87797e
|
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
|
refs/heads/main
| 2023-01-24T01:34:18.716323
| 2020-11-25T17:14:55
| 2020-11-25T17:14:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,016
|
java
|
package com.zhihu.android.app.p1311ui.activity.action.impl;
import android.annotation.SuppressLint;
import android.os.Bundle;
import com.trello.rxlifecycle2.android.ActivityEvent;
import com.zhihu.android.app.p1121k.GlobalPopUpEvent;
import com.zhihu.android.app.p1121k.GlobalPopupHandler;
import com.zhihu.android.app.p1311ui.activity.MainActivity;
import com.zhihu.android.app.p1311ui.activity.action.ActionOnPostCreate;
import com.zhihu.android.app.p1311ui.activity.action.ActionOnResume;
import com.zhihu.android.app.p1311ui.activity.action.ActionOnStop;
import com.zhihu.android.base.util.RxBus;
import java.util.concurrent.TimeUnit;
import p2189io.reactivex.Observable;
import p2189io.reactivex.p2205a.p2207b.AndroidSchedulers;
import p2189io.reactivex.p2231i.Schedulers;
/* renamed from: com.zhihu.android.app.ui.activity.action.impl.GlobalPopup */
public enum GlobalPopup implements ActionOnPostCreate.AbstractC15750a, ActionOnResume.AbstractC15755a, ActionOnStop.AbstractC15758a {
INSTANCE;
static /* synthetic */ void lambda$asyncOnPostCreate$1(Throwable th) throws Exception {
}
@Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnStop.AbstractC15758a
/* renamed from: a_ */
public /* synthetic */ void mo79178a_(MainActivity mainActivity) {
ActionOnStop.AbstractC15758a.CC.$default$a_(this, mainActivity);
}
@Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnPostCreate.AbstractC15750a
public /* synthetic */ void onPostCreate(MainActivity mainActivity, Bundle bundle) {
ActionOnPostCreate.AbstractC15750a.CC.$default$onPostCreate(this, mainActivity, bundle);
}
@Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnResume.AbstractC15755a
public /* synthetic */ void onResume(MainActivity mainActivity) {
ActionOnResume.AbstractC15755a.CC.$default$onResume(this, mainActivity);
}
@Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnPostCreate.AbstractC15750a
@SuppressLint({"CheckResult"})
public void asyncOnPostCreate(MainActivity mainActivity, Bundle bundle) {
RxBus.m86979a().mo84369b(GlobalPopUpEvent.class).compose(mainActivity.bindUntilEvent(ActivityEvent.DESTROY)).observeOn(AndroidSchedulers.m147557a()).subscribe($$Lambda$GlobalPopup$1Gw2drIzZv9yXiJFltPwA14xhM.INSTANCE, $$Lambda$GlobalPopup$9X37E1iZAIJbvz6gPOUW3kD1Qw.INSTANCE);
}
@Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnResume.AbstractC15755a
@SuppressLint({"CheckResult"})
public void asyncOnResume(MainActivity mainActivity) {
Observable.just(1).subscribeOn(Schedulers.m148537b()).delay(2, TimeUnit.SECONDS).observeOn(AndroidSchedulers.m147557a()).subscribe($$Lambda$GlobalPopup$ckHvapmvgJAFWtGxCXFZVAg03pc.INSTANCE);
}
@Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnStop.AbstractC15758a
public void onStop(MainActivity mainActivity) {
GlobalPopupHandler.m63465a().mo68153c();
}
}
|
[
"seasonpplp@qq.com"
] |
seasonpplp@qq.com
|
6654b3f911fded3a8c70fa72f265dccc4d120a73
|
d291f1872a8275b7794f91827a5a4f615934cd73
|
/jOOQ/src/main/java/org/jooq/impl/DateDiff.java
|
8ef93a03a1727a8c8b1564c80cf6fa08ff5069fe
|
[
"Apache-2.0"
] |
permissive
|
pecko/jOOQ
|
2c9930e55bbd3b139651c4cba01ee453e9ff5ea0
|
cab313f6730a48edb1ad6afa1f56327dd400eafc
|
refs/heads/master
| 2020-12-02T16:32:37.041672
| 2015-12-29T12:56:48
| 2015-12-29T12:56:48
| 15,281,817
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,718
|
java
|
/**
* Copyright (c) 2009-2015, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq.impl;
import static org.jooq.impl.DSL.field;
import static org.jooq.impl.DSL.function;
import java.sql.Date;
import org.jooq.Configuration;
import org.jooq.Field;
/**
* @author Lukas Eder
*/
class DateDiff extends AbstractFunction<Integer> {
/**
* Generated UID
*/
private static final long serialVersionUID = -4813228000332771961L;
private final Field<Date> date1;
private final Field<Date> date2;
DateDiff(Field<Date> date1, Field<Date> date2) {
super("datediff", SQLDataType.INTEGER, date1, date2);
this.date1 = date1;
this.date2 = date2;
}
@Override
final Field<Integer> getFunction0(Configuration configuration) {
switch (configuration.family()) {
case MARIADB:
case MYSQL:
return function("datediff", getDataType(), date1, date2);
case DERBY:
return field("{fn {timestampdiff}({sql_tsi_day}, {0}, {1}) }", getDataType(), date2, date1);
case FIREBIRD:
return field("{datediff}(day, {0}, {1})", getDataType(), date2, date1);
case H2:
case HSQLDB:
/* [pro] xx
xxxx xxxxxxxxx
xx [/pro] */
return field("{datediff}('day', {0}, {1})", getDataType(), date2, date1);
case SQLITE:
return field("({strftime}('%s', {0}) - {strftime}('%s', {1})) / 86400", getDataType(), date1, date2);
/* [pro] xx
xxxx xxxxxxx
xx [/pro] */
case CUBRID:
case POSTGRES:
// [#4481] Parentheses are important in case this expression is
// placed in the context of other arithmetic
return field("({0} - {1})", getDataType(), date1, date2);
/* [pro] xx
xxxx xxxxxxx
xxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxx xxxxxx xxxxxxxxxxxxxx xxxxxx xxxxxxx
xxxx xxxx
xxxx xxxxxxxxxx
xxxx xxxxxxx
xxxx xxxxxxxx
xxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxx xxxxxx xxxxxxxxxxxxxx xxxxxx xxxxxxx
xxxx xxxx
xxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxx
xxxxxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxx
xxxx xxxxx
xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxx xxxxxx xxxxxxx
xx xxxx xxxxxxx xx xxxxxxx
xxxx xxxxxxx
xx [/pro] */
}
// Default implementation for equals() and hashCode()
return date1.sub(date2).cast(Integer.class);
}
}
|
[
"lukas.eder@gmail.com"
] |
lukas.eder@gmail.com
|
e593e0760692c1f5bad6ccf5d802dee3d25b58e9
|
669033961046d67b45ed7d3f5ea00a97bef7ef60
|
/Spring Advanced Exam/src/main/java/springadvanced/exam/utils/init/InitializeDefaultUsers.java
|
d5996983b67cf7bef49719a653bb119b627aa562
|
[] |
no_license
|
soheili/Spring-Advanced-Exam
|
76b5fe4e6e89c92b7c01d57c0d04d9647bd8667c
|
e243151573cf08aa0886f854dc300df82f7d9419
|
refs/heads/master
| 2023-01-22T05:58:38.144854
| 2020-12-07T15:36:19
| 2020-12-07T15:36:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,171
|
java
|
package springadvanced.exam.utils.init;
import org.springframework.boot.CommandLineRunner;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
import springadvanced.exam.cart.domain.Cart;
import springadvanced.exam.user.domain.userEntity.UserEntity;
import springadvanced.exam.user.domain.userRole.UserRole;
import springadvanced.exam.user.repository.UserEntityRepository;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Component
public class InitializeDefaultUsers implements CommandLineRunner {
private final UserEntityRepository userEntityRepository;
private final PasswordEncoder passwordEncoder;
public InitializeDefaultUsers(UserEntityRepository userEntityRepository, PasswordEncoder passwordEncoder) {
this.userEntityRepository = userEntityRepository;
this.passwordEncoder = passwordEncoder;
}
@Override
public void run(String... args) throws Exception {
if (this.userEntityRepository.count() > 2) {
return;
}
List<UserEntity> users = new ArrayList<>();
for (int i = 1; i <=3 ; i++) {
UserEntity userEntity = new UserEntity();
userEntity.setUsername("TestUser" + i);
userEntity.setPassword(passwordEncoder.encode("123"));
userEntity.setEmail("TestUser" + i + "@test.com");
userEntity.setPersonalDiscount(0.0);
userEntity.setTotalPurchases(0);
userEntity.setRegisteredOn(LocalDateTime.now());
Cart cart = new Cart();
cart.setUser(userEntity);
userEntity.setCart(cart);
UserRole user = new UserRole("ROLE_USER");
user.setUser(userEntity);
if (i == 1) {
UserRole admin = new UserRole("ROLE_ADMIN");
admin.setUser(userEntity);
userEntity.setRoles(List.of(user, admin));
} else {
userEntity.setRoles(List.of(user));
}
users.add(userEntity);
}
this.userEntityRepository.saveAll(users);
}
}
|
[
"53002640+kostovvl@users.noreply.github.com"
] |
53002640+kostovvl@users.noreply.github.com
|
4efb3ba349e657970db6050608bae304dac93861
|
5ab300a1302d0ba6464facfe6dc1bc59637b5332
|
/src/main/java/com/matsg/nationsbans/sql/SQLManager.java
|
4334218a61578e005e3912c1ff807b8dbb0fdb08
|
[] |
no_license
|
matsgemmeke/nations-bans-plugin
|
9472ce5196761e6f10ab8f2f760d77c3cc43f425
|
5a28e6257d3617e397e3e20c5625f9c969ef524d
|
refs/heads/master
| 2021-07-01T20:12:13.580945
| 2017-09-20T16:08:13
| 2017-09-20T16:08:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,225
|
java
|
package com.matsg.nationsbans.sql;
import com.matsg.nationsbans.Ban;
import com.matsg.nationsbans.NationsBans;
import com.matsg.nationsbans.SettingsManager;
import com.matsg.nationsbans.config.SQLConfig;
import net.md_5.bungee.api.plugin.Plugin;
import java.sql.*;
import java.util.*;
public class SQLManager {
private static SQLManager instance;
private final String ip, database, username, password;
private Connection connection;
private SQLConfig sql;
private SQLManager(Plugin plugin) {
this.sql = SettingsManager.getInstance().getSQLConfig();
this.ip = sql.getDatabaseIP();
this.database = sql.getDatabaseName();
this.username = sql.getUsername();
this.password = sql.getPassword();
try {
connection = openConnection();
plugin.getLogger().info("Connection to database established.");
} catch (Exception e) {
plugin.getLogger().warning("Can not connect to the SQL database! Have you configured everything correctly?");
} finally {
closeConnection();
}
}
public static SQLManager getInstance() {
if (instance == null) {
instance = new SQLManager(NationsBans.getPlugin());
}
return instance;
}
public void closeConnection() {
try {
if (isConnected()) {
connection.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
public Ban getBan(String name) {
try {
connection = openConnection();
PreparedStatement ps = connection.prepareStatement("SELECT * FROM `bans` WHERE PlayerName = ? AND PardonDate > CURRENT_TIMESTAMP;");
ps.setString(1, name);
ResultSet rs = ps.executeQuery();
if (!rs.next()) {
return null;
}
Ban ban = new Ban(
UUID.fromString(rs.getString("PlayerUUID")),
rs.getString("PlayerName"),
rs.getString("StaffName"),
rs.getString("Reason"),
rs.getTimestamp("BanDate"),
rs.getTimestamp("PardonDate")
);
ps.close();
rs.close();
return ban;
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeConnection();
}
return null;
}
public Ban getBan(UUID uuid) {
try {
connection = openConnection();
PreparedStatement ps = connection.prepareStatement("SELECT * FROM `bans` WHERE PlayerUUID = ? AND PardonDate > CURRENT_TIMESTAMP;");
ps.setString(1, uuid.toString());
ResultSet rs = ps.executeQuery();
if (!rs.next()) {
return null;
}
Ban ban = new Ban(
UUID.fromString(rs.getString("PlayerUUID")),
rs.getString("PlayerName"),
rs.getString("StaffName"),
rs.getString("Reason"),
rs.getTimestamp("BanDate"),
rs.getTimestamp("PardonDate")
);
ps.close();
rs.close();
return ban;
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeConnection();
}
return null;
}
public boolean isConnected() throws SQLException {
return connection != null || !connection.isClosed();
}
public Connection openConnection() throws SQLException {
Connection connection = DriverManager.getConnection("jdbc:mysql://" + ip + ":3306/" + database, username, password);
return connection;
}
public void registerBan(Ban ban) {
try {
connection = openConnection();
PreparedStatement ps = connection.prepareStatement("INSERT INTO `bans`(PlayerUUID, PlayerName, StaffName, Reason, BanDate, PardonDate) VALUES(?, ?, ?, ?, ?, ?);");
ps.setString(1, ban.getPlayerUUID().toString());
ps.setString(2, ban.getPlayerName());
ps.setString(3, ban.getStaffName());
ps.setString(4, ban.getReason());
ps.setTimestamp(5, ban.getBanDate());
ps.setTimestamp(6, ban.getPardonDate());
ps.execute();
ps.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeConnection();
}
}
public void removeBan(Ban ban) {
try {
connection = openConnection();
//We want the record to continue to exist in the database, so update the pardon date rather than removing the ban
PreparedStatement ps = connection.prepareStatement("UPDATE `bans` SET PardonDate = CURRENT_TIMESTAMP WHERE PlayerUUID = ? AND PardonDate > CURRENT_TIMESTAMP;");
ps.setString(1, ban.getPlayerUUID().toString());
ps.execute();
ps.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeConnection();
}
}
}
|
[
"matsgemmeke@gmail.com"
] |
matsgemmeke@gmail.com
|
bcb4c4ceb60add9a011f26cf4e27e6c986e3c938
|
851d7883e667b1883a327fe29e24c180ec63cb09
|
/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Type.java
|
dc1f28035b18b060b29c9618ee445d91ae97d0ba
|
[
"Apache-2.0"
] |
permissive
|
sri-desai/Cocoon
|
6772622f5e4b45339df25825cfc5bc50360b48a3
|
a513391476ea1d8c835df03187947bf0fde913c2
|
refs/heads/master
| 2021-07-10T22:46:35.108428
| 2017-10-06T03:36:02
| 2017-10-06T03:36:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,238
|
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.cocoon.components.elementprocessor.impl.poi.hssf.elements;
import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
import org.apache.cocoon.components.elementprocessor.types.NumericResult;
import org.apache.cocoon.components.elementprocessor.types.Validator;
import java.io.IOException;
/**
* No-op implementation of ElementProcessor to handle the "type" tag
*
* This element is not used in HSSFSerializer 1.0
*
* This element has no attributes, but has string content, which is
* numeric.
*
* @author Marc Johnson (marc_johnson27591@hotmail.com)
* @version CVS $Id$
*/
public class EP_Type extends BaseElementProcessor {
private NumericResult _type;
private static final Validator _validator = new Validator()
{
public IOException validate(final Number number) {
return GTKTypes.isValid(number.intValue()) ? null :
new IOException("\"" + number + "\" is not a legal value");
}
};
/**
* constructor
*/
public EP_Type() {
super(null);
_type = null;
}
/**
* @return the type
*
* @exception IOException if the type is not numeric
*/
int getType() throws IOException {
if (_type == null) {
_type = NumericConverter.extractInteger(getData(), _validator);
}
return _type.intValue();
}
} // end public class EP_Type
|
[
"srinivas.desai491@gmail.com"
] |
srinivas.desai491@gmail.com
|
68ad06d2d9a0bf3ff0287459c3e3b7227075c8a4
|
64455b7ce0658de6992bb219d8b150dddb30881c
|
/DesignPatterns/src/main/java/br/com/bcp/pattern/templatemethod/HTMLData.java
|
089278e31a0be022a30520896c21629ef13d005c
|
[] |
no_license
|
bproenca/java
|
f1fba9f21026a67ec3131fed39692999ef6faed0
|
0b9a9c9620e60b22a57cc61fa3bd467269e270db
|
refs/heads/master
| 2023-01-09T15:34:48.597389
| 2019-12-21T21:46:42
| 2019-12-21T21:46:42
| 202,936,509
| 0
| 0
| null | 2023-01-02T21:58:51
| 2019-08-17T22:25:25
|
HTML
|
UTF-8
|
Java
| false
| false
| 322
|
java
|
package br.com.bcp.pattern.templatemethod;
public class HTMLData extends Template {
@Override
protected String link(final String texto, final String url) {
return "<a href='" + url + "'>" + texto + "</a>";
}
@Override
protected String transform(final String texto) {
return texto.toLowerCase();
}
}
|
[
"bruno.proenca@synchro.com.br"
] |
bruno.proenca@synchro.com.br
|
56da50f21bfee459f7b501271b87294a72a99e3d
|
c0ddb018492b892c5c4d136d13f08e0f659e9e85
|
/app/src/main/java/com/example/themoon/entity/MeteorParam.java
|
478a245b4f829f114acacbf676976b3e4dcbd0b4
|
[] |
no_license
|
cuiwenju2017/TheMoon
|
f30f9e1d6ceac6154f8a5f6660e7ae560d6795cd
|
eca7b121864d577db6562c9c19997643d2db2eb0
|
refs/heads/master
| 2023-08-05T05:51:02.864302
| 2021-09-17T10:45:47
| 2021-09-17T10:45:47
| 407,047,383
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,031
|
java
|
package com.example.themoon.entity;
import android.content.Context;
import com.example.themoon.utils.Unit;
public class MeteorParam {
public double translateX;
public double translateY;
public double radians;
public int width, height;
public double widthRatio;
/**
* 初始化数据
* @param width
* @param height
* @param widthRatio
*/
public void init(int width, int height, double widthRatio) {
this.width = width;
this.height = height;
this.widthRatio = widthRatio;
reset();
}
/**
* 重置数据
*/
public void reset() {
translateX = width + Math.random() * 20.0 * width;
radians = - (Math.random() * 5 - 0.05);
translateY = Math.random() * 0.5 * height * widthRatio;
}
/**
* 移动
*/
public void move(Context context) {
translateX -= Unit.dip2px(context,30);
if (translateX <= -1.0 * width / widthRatio) {
reset();
}
}
}
|
[
"1755140651@qq.com"
] |
1755140651@qq.com
|
73dbc9f711541b51cafdd6c451af7f77b3d5c2e8
|
ccf3b9914a04e121a323de4050dc8a1c450bf21b
|
/20_JAVA_Training_Practice/20_JAVA_Multi_Threading/Concurrent/L_27_task_2710/MailServer.java
|
5b666a8e14ce3b1e096d8261ef6f37b6a1a76173
|
[] |
no_license
|
PetrBelmst/JavaRush_Course_Rep
|
81333e65963bb69ee2f032acbaab025580cc5bde
|
39e6fb64f8d5fc9b5284c8477b70cd1c62a769d5
|
refs/heads/master
| 2021-05-23T14:20:51.674509
| 2020-05-05T05:45:25
| 2020-05-05T05:45:25
| 253,335,289
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 803
|
java
|
package com.company;
public class MailServer implements Runnable {
private Mail mail;
public MailServer(Mail mail) {
this.mail = mail;
}
@Override
public void run() {
long startTime = System.currentTimeMillis();
//сделайте что-то тут - do something here
synchronized (mail) {
try {
while (mail.getText() == null) {
mail.wait();
}
} catch (InterruptedException e) {}
String name = Thread.currentThread().getName();
long endTime = System.currentTimeMillis();
System.out.format("%s MailServer received: [%s] in %d ms after start", name, mail.getText(),
(endTime - startTime));
}
}
}
|
[
"PetrBelmst@users.noreply.github.com"
] |
PetrBelmst@users.noreply.github.com
|
1a3a8c18638a63a81e9a587013bab52f85c97ffb
|
d62b103a0e904173ba7eb61323add5b81b0f1b8e
|
/src/main/java/cn/greenflash/soft/config/DatabaseConfiguration.java
|
6f493c2c99350727ea786ca504195e1ecc91ba60
|
[] |
no_license
|
xxqj/jhipster-sample-application
|
701202904da9e188d63c1d5aa361562664580aa4
|
0bdc6a6c9e30b97939544536851b5f6f4fb0cde5
|
refs/heads/master
| 2022-12-21T20:09:08.944950
| 2019-12-23T08:19:43
| 2019-12-23T08:19:43
| 229,708,310
| 0
| 0
| null | 2022-12-16T04:43:01
| 2019-12-23T08:19:26
|
Java
|
UTF-8
|
Java
| false
| false
| 952
|
java
|
package cn.greenflash.soft.config;
import io.github.jhipster.config.JHipsterConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableJpaRepositories("cn.greenflash.soft.repository")
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
@EnableTransactionManagement
@EnableElasticsearchRepositories("cn.greenflash.soft.repository.search")
public class DatabaseConfiguration {
private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class);
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
d8b514a29c4f97089f273dd1a51d6798ebb4e21a
|
3568c9772fad54ffe71683de31525464642f3cf9
|
/office2/src/main/java/eu/doppel_helix/jna/tlb/office2/MsoCalloutType.java
|
58fbda67538c5906b95d76ddad049c169bd6b175
|
[
"MIT"
] |
permissive
|
NoonRightsWarriorBehindHovering/COMTypelibraries
|
c853c41bb495031702d0ad7a4d215ab894c12bbd
|
c17acfca689305c0e23d4ff9d8ee437e0ee3d437
|
refs/heads/master
| 2023-06-21T20:52:51.519721
| 2020-03-13T22:33:48
| 2020-03-13T22:33:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 593
|
java
|
package eu.doppel_helix.jna.tlb.office2;
import com.sun.jna.platform.win32.COM.util.IComEnum;
public enum MsoCalloutType implements IComEnum {
/**
* (-2)
*/
msoCalloutMixed(-2),
/**
* (1)
*/
msoCalloutOne(1),
/**
* (2)
*/
msoCalloutTwo(2),
/**
* (3)
*/
msoCalloutThree(3),
/**
* (4)
*/
msoCalloutFour(4),
;
private MsoCalloutType(long value) {
this.value = value;
}
private long value;
public long getValue() {
return this.value;
}
}
|
[
"mblaesing@doppel-helix.eu"
] |
mblaesing@doppel-helix.eu
|
16dc38298cb10d76f4f4df8f6a7d7a1c7ea3b6a7
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/openhab--openhab1-addons/fa12b4995431363abd730bab812fbdf659cb459a/after/RFXComHumidityMessage.java
|
f4f9cd315f2e143452573284b6b087e0de695cb4
|
[] |
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
| 5,608
|
java
|
/**
* Copyright (c) 2010-2013, openHAB.org and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.openhab.binding.rfxcom.internal.messages;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.DatatypeConverter;
import org.openhab.binding.rfxcom.RFXComValueSelector;
import org.openhab.binding.rfxcom.internal.RFXComException;
import org.openhab.core.library.items.NumberItem;
import org.openhab.core.library.items.StringItem;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.StringType;
import org.openhab.core.types.State;
import org.openhab.core.types.Type;
import org.openhab.core.types.UnDefType;
/**
* RFXCOM data class for humidity message.
*
* @author Pauli Anttila, Jan Sjölander
* @since 1.4.0
*/
public class RFXComHumidityMessage extends RFXComBaseMessage {
public enum SubType {
LACROSSE_TX3(1),
LACROSSE_WS2300(2),
UNKNOWN(255);
private final int subType;
SubType(int subType) {
this.subType = subType;
}
SubType(byte subType) {
this.subType = subType;
}
public byte toByte() {
return (byte) subType;
}
}
public enum HumidityStatus {
NORMAL(0),
COMFORT(1),
DRY(2),
WET(3),
UNKNOWN(255);
private final int humidityStatus;
HumidityStatus(int humidityStatus) {
this.humidityStatus = humidityStatus;
}
HumidityStatus(byte humidityStatus) {
this.humidityStatus = humidityStatus;
}
public byte toByte() {
return (byte) humidityStatus;
}
}
private final static List<RFXComValueSelector> supportedValueSelectors = Arrays
.asList(RFXComValueSelector.RAW_DATA,
RFXComValueSelector.SIGNAL_LEVEL,
RFXComValueSelector.BATTERY_LEVEL,
RFXComValueSelector.HUMIDITY,
RFXComValueSelector.HUMIDITY_STATUS);
public SubType subType = SubType.LACROSSE_TX3;
public int sensorId = 0;
public byte humidity = 0;
public HumidityStatus humidityStatus = HumidityStatus.NORMAL;
public byte signalLevel = 0;
public byte batteryLevel = 0;
public RFXComHumidityMessage() {
packetType = PacketType.HUMIDITY;
}
public RFXComHumidityMessage(byte[] data) {
encodeMessage(data);
}
@Override
public String toString() {
String str = "";
str += super.toString();
str += "\n - Sub type = " + subType;
str += "\n - Id = " + sensorId;
str += "\n - Humidity = " + humidity;
str += "\n - Humidity status = " + humidityStatus;
str += "\n - Signal level = " + signalLevel;
str += "\n - Battery level = " + batteryLevel;
return str;
}
@Override
public void encodeMessage(byte[] data) {
super.encodeMessage(data);
try {
subType = SubType.values()[super.subType];
} catch (Exception e) {
subType = SubType.UNKNOWN;
}
sensorId = (data[4] & 0xFF) << 8 | (data[5] & 0xFF);
humidity = data[6];
try {
humidityStatus = HumidityStatus.values()[data[7]];
} catch (Exception e) {
humidityStatus = HumidityStatus.UNKNOWN;
}
signalLevel = (byte) ((data[8] & 0xF0) >> 4);
batteryLevel = (byte) (data[8] & 0x0F);
}
@Override
public byte[] decodeMessage() {
byte[] data = new byte[9];
data[0] = 0x0A;
data[1] = RFXComBaseMessage.PacketType.HUMIDITY.toByte();
data[2] = subType.toByte();
data[3] = seqNbr;
data[4] = (byte) ((sensorId & 0xFF00) >> 8);
data[5] = (byte) (sensorId & 0x00FF);
data[6] = humidity;
data[7] = humidityStatus.toByte();
data[8] = (byte) (((signalLevel & 0x0F) << 4) | (batteryLevel & 0x0F));// Janne
return data;
}
@Override
public String generateDeviceId() {
return String.valueOf(sensorId);
}
@Override
public State convertToState(RFXComValueSelector valueSelector)
throws RFXComException {
org.openhab.core.types.State state = UnDefType.UNDEF;
if (valueSelector.getItemClass() == NumberItem.class) {
if (valueSelector == RFXComValueSelector.SIGNAL_LEVEL) {
state = new DecimalType(signalLevel);
} else if (valueSelector == RFXComValueSelector.BATTERY_LEVEL) {
state = new DecimalType(batteryLevel);
} else if (valueSelector == RFXComValueSelector.HUMIDITY) {
state = new DecimalType(humidity);
} else {
throw new RFXComException("Can't convert "
+ valueSelector + " to NumberItem");
}
} else if (valueSelector.getItemClass() == StringItem.class) {
if (valueSelector == RFXComValueSelector.RAW_DATA) {
state = new StringType(
DatatypeConverter.printHexBinary(rawMessage));
} else if (valueSelector == RFXComValueSelector.HUMIDITY_STATUS) {
state = new StringType(humidityStatus.toString());
} else {
throw new RFXComException("Can't convert "
+ valueSelector + " to StringItem");
}
} else {
throw new RFXComException("Can't convert " + valueSelector
+ " to " + valueSelector.getItemClass());
}
return state;
}
@Override
public void convertFromState(RFXComValueSelector valueSelector, String id,
Object subType, Type type, byte seqNumber) throws RFXComException {
throw new RFXComException("Not supported");
}
@Override
public Object convertSubType(String subType) throws RFXComException {
for (SubType s : SubType.values()) {
if (s.toString().equals(subType)) {
return s;
}
}
throw new RFXComException("Unknown sub type " + subType);
}
@Override
public List<RFXComValueSelector> getSupportedValueSelectors() throws RFXComException {
return supportedValueSelectors;
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
c3d31f406b7ace64424083f3383c36d3266af502
|
573b9c497f644aeefd5c05def17315f497bd9536
|
/src/main/java/com/alipay/api/response/AlipayDataDataserviceAdUserbalanceOnlineResponse.java
|
482d6dd20ca9717d70826d7538662821507d26d3
|
[
"Apache-2.0"
] |
permissive
|
zzzyw-work/alipay-sdk-java-all
|
44d72874f95cd70ca42083b927a31a277694b672
|
294cc314cd40f5446a0f7f10acbb5e9740c9cce4
|
refs/heads/master
| 2022-04-15T21:17:33.204840
| 2020-04-14T12:17:20
| 2020-04-14T12:17:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 877
|
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.AlipayResponse;
/**
* ALIPAY API: alipay.data.dataservice.ad.userbalance.online response.
*
* @author auto create
* @since 1.0, 2019-11-01 10:52:57
*/
public class AlipayDataDataserviceAdUserbalanceOnlineResponse extends AlipayResponse {
private static final long serialVersionUID = 5421236288944253692L;
/**
* 操作成功投放账户id列表
*/
@ApiListField("success_user_id_list")
@ApiField("number")
private List<Long> successUserIdList;
public void setSuccessUserIdList(List<Long> successUserIdList) {
this.successUserIdList = successUserIdList;
}
public List<Long> getSuccessUserIdList( ) {
return this.successUserIdList;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
85cd42308c8c10c064f0566967b9004560f2ab86
|
f7fadc413cad92f03721742b9c5d94281c12ba02
|
/Java/project/ATM/Cash.java
|
5af2d514f867da40be2814b887a5df5ccdd2d59c
|
[] |
no_license
|
amitmca/EducationalMaterial
|
f7acc7f701b42fb5f2821e56bab4ce253532c3f7
|
088a1fe34a0bdd4b46ea5cc7f930d8d1a3f510d0
|
refs/heads/master
| 2021-06-06T18:20:39.774159
| 2019-11-30T15:52:07
| 2019-11-30T15:52:07
| 134,157,178
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,087
|
java
|
import java.awt.*; //
import java.awt.event.*; // PACKAGES
import javax.swing.*; //
import java.sql.*; //
public class Cash extends JFrame implements ActionListener{
public JButton button1,button2,button3,button4,button5,button6,cancelBut;
private JLabel label1,label2,label3,label4,label5,label6;
private JTextField textField;
static String url = "jdbc:odbc:abc";
//---Constructor---
public Cash(){
super("Cash");
Container container=getContentPane() ;
container.setLayout(null);
textField=new JTextField(10);
button1 = new JButton(">>>");
button1.setPreferredSize(new Dimension(100,30));
button1.setSize(button1.getPreferredSize());
button1.setLocation(50,50);
button1.addActionListener(this);
container.add(button1);
button2 = new JButton(">>>");
button2.setPreferredSize(new Dimension(100,30));
button2.setSize(button2.getPreferredSize());
button2.setLocation(50,100);
button2.addActionListener(this);
container.add(button2);
button3 = new JButton(">>>");
button3.setPreferredSize(new Dimension(100,30));
button3.setSize(button3.getPreferredSize());
button3.setLocation(50,150);
button3.addActionListener(this);
container.add(button3);
button4 = new JButton("<<<");
button4.setPreferredSize(new Dimension(100,30));
button4.setSize(button4.getPreferredSize());
button4.setLocation(375,50);
//---makes the communication with the odbc Driver---
button4.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
if(event.getSource()==button1){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(ClassNotFoundException a){
JOptionPane.showMessageDialog(null, url,"CLASS NOT FOUND EXCEPTION !!!",JOptionPane.INFORMATION_MESSAGE);
}}DB s=new DB();s.CashScreen();}
});
container.add(button4);
button5 = new JButton("<<<");
button5.setPreferredSize(new Dimension(100,30));
button5.setSize(button5.getPreferredSize());
button5.setLocation(375,100);
button5.addActionListener(this);
container.add(button5);
button6 = new JButton("<<<");
button6.setPreferredSize(new Dimension(100,30));
button6.setSize(button6.getPreferredSize());
button6.setLocation(375,150);
//---makes the communication with the odbc Driver---
button6.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
if(event.getSource()==button1){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(ClassNotFoundException a){
JOptionPane.showMessageDialog(null, url,"CLASS NOT FOUND EXCEPTION !!!",JOptionPane.INFORMATION_MESSAGE);
}}DB s=new DB();s.ExecutionForAnother();}
});
container.add(button6);
cancelBut = new JButton("CANCEL");
cancelBut.setPreferredSize(new Dimension(100,30));
cancelBut.setSize(cancelBut.getPreferredSize());
cancelBut.setLocation(375,200);
cancelBut.addActionListener(this);
container.add(cancelBut);
label1=new JLabel(" 10 $");
label1.setPreferredSize(new Dimension(75,30));
label1.setSize(label1.getPreferredSize());
label1.setLocation(150,50);
container.add(label1);
label2=new JLabel(" 20 $");
label2.setPreferredSize(new Dimension(75,30));
label2.setSize(label2.getPreferredSize());
label2.setLocation(300,50);
container.add(label2);
label3=new JLabel(" 40 $");
label3.setPreferredSize(new Dimension(75,30));
label3.setSize(label3.getPreferredSize());
label3.setLocation(150,100);
container.add(label3);
label4=new JLabel(" 50 $");
label4.setPreferredSize(new Dimension(75,30));
label4.setSize(label4.getPreferredSize());
label4.setLocation(300,100);
container.add(label4);
label5=new JLabel(" 100 $");
label5.setPreferredSize(new Dimension(75,30));
label5.setSize(label5.getPreferredSize());
label5.setLocation(150,150);
container.add(label5);
label6=new JLabel(" Another..");
label6.setPreferredSize(new Dimension(85,30));
label6.setSize(label6.getPreferredSize());
label6.setLocation(300,150);
container.add(label6);
setSize(500,400);
setVisible(true);
}//---Method for Actionlistener---
public void actionPerformed(ActionEvent event){
if(event.getSource()==cancelBut){
this.hide();//closes the present application
MainMenu s=new MainMenu();s.Main();//and goes to MainMenu
}
}
}
|
[
"amitbaramatimca@gmail.com"
] |
amitbaramatimca@gmail.com
|
a886837f2700d3c37c2707d3771f0f8f449934d5
|
7d966c22c83258cc21ffc040271d62aea122d658
|
/MegaMek/src/megamek/common/weapons/CLPrototypeRL15.java
|
9b8be744e3cee588d7c90dbebb48c4cfffc11e56
|
[] |
no_license
|
Ayamin0x539/MegaMek
|
5f1f2db42f01a907b8467cefc95cf56d697bdf8f
|
9ea4712f2ddf5a7af8c65b9e09211d7b76904f8e
|
refs/heads/master
| 2021-01-09T11:42:01.513443
| 2015-12-03T02:04:04
| 2015-12-03T02:04:04
| 59,911,944
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,574
|
java
|
/**
* MegaMek - Copyright (C) 2005 Ben Mazur (bmazur@sev.org)
*
* 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.
*/
package megamek.common.weapons;
import megamek.common.TechConstants;
/**
* @author Sebastian Brocks
*/
public class CLPrototypeRL15 extends PrototypeRLWeapon {
/**
*
*/
private static final long serialVersionUID = 5888570332510350564L;
/**
*
*/
public CLPrototypeRL15() {
super();
techLevel.put(3071, TechConstants.T_IS_EXPERIMENTAL);
name = "Rocket Launcher 15 (PP)";
setInternalName("CLRocketLauncher15Prototype");
heat = 5;
rackSize = 15;
shortRange = 4;
mediumRange = 9;
longRange = 15;
extremeRange = 18;
tonnage = 1.0f;
criticals = 2;
bv = 21;
cost = 30000;
shortAV = 9;
medAV = 9;
maxRange = RANGE_MED;
introDate = 2801;
extinctDate =2823;
techLevel.put(2801, techLevel.get(3071));
availRating = new int[] { RATING_X, RATING_C, RATING_X };
techRating = RATING_C;
}
}
|
[
"tms08012@dds-227.ad.engr.uconn.edu"
] |
tms08012@dds-227.ad.engr.uconn.edu
|
e199b42a7000aa3737bd42f19fb054beccc29cf1
|
6d109557600329b936efe538957dfd0a707eeafb
|
/src/com/google/api/ads/dfp/v201302/TypeError.java
|
8d8ce631291ff840dc2aa8b388e4e3be8cc92059
|
[
"Apache-2.0"
] |
permissive
|
google-code-export/google-api-dfp-java
|
51b0142c19a34cd822a90e0350eb15ec4347790a
|
b852c716ef6e5d300363ed61e15cbd6242fbac85
|
refs/heads/master
| 2020-05-20T03:52:00.420915
| 2013-12-19T23:08:40
| 2013-12-19T23:08:40
| 32,133,590
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,706
|
java
|
/**
* TypeError.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.google.api.ads.dfp.v201302;
/**
* An error for a field which is an invalid type.
*/
public class TypeError extends com.google.api.ads.dfp.v201302.ApiError implements java.io.Serializable {
public TypeError() {
}
public TypeError(
java.lang.String fieldPath,
java.lang.String trigger,
java.lang.String errorString,
java.lang.String apiErrorType) {
super(
fieldPath,
trigger,
errorString,
apiErrorType);
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof TypeError)) return false;
TypeError other = (TypeError) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj);
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(TypeError.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201302", "TypeError"));
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
[
"api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098"
] |
api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098
|
6ad2c4464e913f76e864c7ed344bf01d7ddae17c
|
2176aca76ca2b6c7efcfdfba1a50b8e5389e6251
|
/parser/src/test/java/com/gandb/xml/ConfigureTest.java
|
059d8c04fc3bf1e0d1593a578aca3cd7f412f12f
|
[] |
no_license
|
York9715/DOM4J-SAX-Sample
|
a953e9a955cc48435dceac0d4b89212a237cdb6f
|
c8fcb2472751325c446ec1bd435a82baaffa52b5
|
refs/heads/master
| 2020-09-17T12:35:13.159474
| 2016-09-01T03:12:54
| 2016-09-01T03:12:54
| 67,038,229
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,192
|
java
|
/**
*
*/
package com.gandb.xml;
import static org.junit.Assert.*;
import java.io.InputStream;
import java.util.List;
import java.util.TreeMap;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author Misato
*
*/
public class ConfigureTest {
public ConfigureTest() {
}
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
System.out.println("---- Initializing ConfigureTest ----");
try {
InputStream in = AppTest.class.getResourceAsStream("/"
+ App.CONFIGURATION_FILE);
if (in == null)
fail(App.CONFIGURATION_FILE + " not found");
} catch (Exception e) {
fail(e.getMessage());
}
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}
/**
* Test method for {@link com.gandb.xml.Configure#Configure(java.lang.String)}.
*/
@Test
public final void testConfigure() {
System.out.println("---- testConfigure ---");
Configure configure = new Configure(App.CONFIGURATION_FILE);
TreeMap<String, List<MatchedElement>> map = configure.getElementMap();
assertNotNull(map);
if (map.size() < 1)
fail("Not yet implemented"); // TODO
}
/**
* Test method for {@link com.gandb.xml.Configure#getElementMap()}.
*/
@Test
public final void testGetElementMap() {
System.out.println("---- testGetElementMap ---");
Configure configure = new Configure(App.CONFIGURATION_FILE);
TreeMap<String, List<MatchedElement>> map = configure.getElementMap();
assertNotNull(map);
}
/**
* Test method for {@link com.gandb.xml.Configure#getConf(java.lang.String)}.
*/
@Test
public final void testGetConf() {
Configure configure = new Configure(App.CONFIGURATION_FILE);
TreeMap<String, List<MatchedElement>> map =configure.getConf(App.CONFIGURATION_FILE);
assertNotNull(map);
//fail("Not yet implemented"); // TODO
}
}
|
[
"york.tips@gmail.com"
] |
york.tips@gmail.com
|
46965122a6982e6e349360ebf6c546d3abce7a34
|
40d0f44a9399a70bba22e1d0316a6413788d89cd
|
/indicator/indicator-calculator/src/test/java/pro/crypto/indicator/ma/WeightedMovingAverageTest.java
|
b65b08ce1bbedb8041b641cf433dc64c48684b72
|
[] |
no_license
|
CaymanJava/crypto-analyzer
|
45352dbe84ae7d98b8b117c54abc0e0b418fd531
|
91f0965b36a5f221fedce53abeb6fa5fb83b4cc3
|
refs/heads/master
| 2023-02-20T03:52:54.798521
| 2019-12-20T14:55:41
| 2019-12-20T14:55:41
| 122,776,981
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,177
|
java
|
package pro.crypto.indicator.ma;
import org.junit.Test;
import pro.crypto.exception.WrongIncomingParametersException;
import pro.crypto.indicator.IndicatorAbstractTest;
import pro.crypto.model.tick.Tick;
import pro.crypto.response.IndicatorResult;
import static org.junit.Assert.assertArrayEquals;
import static pro.crypto.model.indicator.IndicatorType.WEIGHTED_MOVING_AVERAGE;
import static pro.crypto.model.tick.PriceType.CLOSE;
public class WeightedMovingAverageTest extends IndicatorAbstractTest {
@Test
public void testWeightedMovingAverageWithPeriodFifteen() {
IndicatorResult[] expectedResult = loadExpectedResult("weighted_moving_average_1.json", MAResult[].class);
MAResult[] actualResult = MovingAverageFactory.create(buildRequest(15)).getResult();
assertArrayEquals(expectedResult, actualResult);
}
@Test
public void testWeightedMovingAverageWithPeriodTwenty() {
IndicatorResult[] expectedResult = loadExpectedResult("weighted_moving_average_2.json", MAResult[].class);
MAResult[] actualResult = MovingAverageFactory.create(buildRequest(20)).getResult();
assertArrayEquals(expectedResult, actualResult);
}
@Test
public void emptyOriginalDataTest() {
expectedException.expect(WrongIncomingParametersException.class);
expectedException.expectMessage("Incoming tick data size should be > 0 {indicator: {WEIGHTED_MOVING_AVERAGE}, size: {0}}");
MovingAverageFactory.create(MARequest.builder()
.originalData(new Tick[0])
.period(5)
.indicatorType(WEIGHTED_MOVING_AVERAGE)
.priceType(CLOSE)
.build()).getResult();
}
@Test
public void nullOriginalDataTest() {
expectedException.expect(WrongIncomingParametersException.class);
expectedException.expectMessage("Incoming tick data is null {indicator: {WEIGHTED_MOVING_AVERAGE}}");
MovingAverageFactory.create(MARequest.builder()
.originalData(null)
.period(5)
.indicatorType(WEIGHTED_MOVING_AVERAGE)
.priceType(CLOSE)
.build()).getResult();
}
@Test
public void periodMoreThanTickDataTest() {
expectedException.expect(WrongIncomingParametersException.class);
expectedException.expectMessage("Period should be less than tick data size {indicator: {WEIGHTED_MOVING_AVERAGE}, period: {5}, size: {1}}");
MovingAverageFactory.create(MARequest.builder()
.originalData(new Tick[1])
.period(5)
.indicatorType(WEIGHTED_MOVING_AVERAGE)
.priceType(CLOSE)
.build()).getResult();
}
@Test
public void periodLessThanZeroTest() {
expectedException.expect(WrongIncomingParametersException.class);
expectedException.expectMessage("Period should be more than 0 {indicator: {WEIGHTED_MOVING_AVERAGE}, period: {-5}}");
MovingAverageFactory.create(MARequest.builder()
.originalData(new Tick[1])
.period(-5)
.indicatorType(WEIGHTED_MOVING_AVERAGE)
.priceType(CLOSE)
.build()).getResult();
}
@Test
public void emptyPriceTypeTest() {
expectedException.expect(WrongIncomingParametersException.class);
expectedException.expectMessage("Incoming price type is null {indicator: {WEIGHTED_MOVING_AVERAGE}}");
MovingAverageFactory.create(MARequest.builder()
.originalData(new Tick[30])
.period(5)
.indicatorType(WEIGHTED_MOVING_AVERAGE)
.priceType(null)
.build()).getResult();
}
@Override
protected MARequest buildRequest() {
return MARequest.builder()
.originalData(originalData)
.indicatorType(WEIGHTED_MOVING_AVERAGE)
.priceType(CLOSE)
.build();
}
private MARequest buildRequest(int period) {
MARequest request = buildRequest();
request.setPeriod(period);
return request;
}
}
|
[
"bosenko_dmitriy@mail.ru"
] |
bosenko_dmitriy@mail.ru
|
19a720cab52b0575ecd19e723ac43df7afb91198
|
f2779f63aab6a59b64ac211f1160c9883003f1ec
|
/src/main/java/org/atmosphere/atmosph4rx/defaults/AxSubscriberInvoker.java
|
843b12340acf2169c5e6c0821e464ecde99a7928
|
[
"Apache-2.0"
] |
permissive
|
Atmosphere/Atmosph4rX
|
c304762cdd29ee6d2f08231cbbbcdf6e516a7bc6
|
3ce9f3b73d991fd95395f5fb0bec0555b1f53d4f
|
refs/heads/master
| 2023-03-17T02:58:17.852490
| 2022-03-31T18:36:08
| 2022-03-31T18:36:08
| 130,418,164
| 37
| 5
|
Apache-2.0
| 2019-11-13T13:31:25
| 2018-04-20T22:08:20
|
Java
|
UTF-8
|
Java
| false
| false
| 3,516
|
java
|
/**
* Copyright 2018-2020 Async-IO.org
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.atmosphere.atmosph4rx.defaults;
import org.atmosphere.atmosph4rx.AxSocket;
import org.atmosphere.atmosph4rx.AxSubscriber;
import org.atmosphere.atmosph4rx.AxSubscription;
import org.atmosphere.atmosph4rx.core.AxMetaData;
import org.atmosphere.atmosph4rx.defaults.DefaultAxRouter.AxProcessor;
import org.reactivestreams.Subscription;
import reactor.core.publisher.FluxProcessor;
class AxSubscriberInvoker<T> implements AxSubscriber<T> {
private final AxSubscriber<T> axSubscriber;
private final AxMetaData metaData;
private final AxProcessor<FluxProcessor<String, String>> outputProcessor;
public AxSubscriberInvoker(AxSubscriber<T> axSubscriber, AxMetaData metaData, AxProcessor<FluxProcessor<String, String>> outputProcessor) {
this.axSubscriber = axSubscriber;
this.metaData = metaData;
this.outputProcessor = outputProcessor;
}
@Override
public void onNext(T payload) {
axSubscriber.onNext(payload);
AxSocket<FluxProcessor<String, String>, String> single = new AxSocket<FluxProcessor<String, String>, String>() {
@Override
public AxSocket<FluxProcessor<String, String>, String> publish(String message) {
toProcessor().onNext(message);
return this;
}
@Override
public FluxProcessor<String, String> toProcessor() {
return outputProcessor.out();
}
@Override
public String id() {
return outputProcessor.id();
}
@Override
public String toString() {
return "$classname{}";
}
};
axSubscriber.onNext(single);
axSubscriber.onNext(single, (String) payload);
}
@Override
public void onSubscribe(Subscription s) {
s.request(Integer.MAX_VALUE);
axSubscriber.onSubscribe(s);
onSubscribe(new AxSubscription(s, metaData, outputProcessor));
}
@Override
public void onComplete() {
axSubscriber.onComplete();
}
@Override
public void onError(Throwable t) {
axSubscriber.onError(t);
}
public void onSubscribe(AxSubscription s) {
axSubscriber.onSubscribe(s);
}
public void onNext(byte[] payload) {
axSubscriber.onNext(payload);
}
public <U extends FluxProcessor<? super String, ? super String>> void onNext(AxSocket<U, String> single, String payload) {
axSubscriber.onNext(single, payload);
}
@Override
public <U extends FluxProcessor<? super String, ? super String>, V> void onNext(AxSocket<U, V> single) {
axSubscriber.onNext(single);
}
public <U extends FluxProcessor<? super String, ? super String>> void onNext(AxSocket<U, byte[]> single, byte[] payload) {
axSubscriber.onNext(single, payload);
}
}
|
[
"jfarcand@apache.org"
] |
jfarcand@apache.org
|
a356d7ccfbb5f7ae364d04acefcd6ec40bbf9955
|
e39843b2dead25cce89aec95f0cf2953fb43321d
|
/apiClient/src/main/java/io/swagger/client/model/BinanceExecutionType.java
|
10311a5d80e790279fc306e23d439c3cc582e096
|
[] |
no_license
|
GenesisVision/android-client
|
6727d5c61f2134ea00b308b00a52fc531a78d110
|
319b7dfd53ad498a65c2ee80b0e0ce15aef8aec6
|
refs/heads/develop
| 2022-05-13T08:56:00.715425
| 2022-04-18T11:17:16
| 2022-04-18T11:17:16
| 118,433,575
| 16
| 7
| null | 2021-04-01T19:41:53
| 2018-01-22T09:14:35
|
Java
|
UTF-8
|
Java
| false
| false
| 1,790
|
java
|
/*
* Core API v2.0
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v2.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
/**
* Gets or Sets BinanceExecutionType
*/
@JsonAdapter(BinanceExecutionType.Adapter.class)
public enum BinanceExecutionType {
NEW("New"),
CANCELED("Canceled"),
REPLACED("Replaced"),
REJECTED("Rejected"),
TRADE("Trade"),
EXPIRED("Expired"),
AMENDMENT("Amendment");
private String value;
BinanceExecutionType(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static BinanceExecutionType fromValue(String text) {
for (BinanceExecutionType b : BinanceExecutionType.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<BinanceExecutionType> {
@Override
public void write(final JsonWriter jsonWriter, final BinanceExecutionType enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public BinanceExecutionType read(final JsonReader jsonReader) throws IOException {
Object value = jsonReader.nextString();
return BinanceExecutionType.fromValue(String.valueOf(value));
}
}
}
|
[
"dev.prus@gmail.com"
] |
dev.prus@gmail.com
|
520d16c3c8c61d4aea42b7085e84bc79d4498ce6
|
144044f9282c50253a75bd8d5c23f619ad38fdf8
|
/biao-boss/src/main/java/com/thinkgem/jeesite/modules/market/dao/MkDividendStatDao.java
|
2476ca1d24c012c6e35b802ed3a1901d6a1a1c9e
|
[] |
no_license
|
clickear/biao
|
ba645de06b4e92b0539b05404c061194669f4570
|
af71fd055c4ff3aa0b767a0a8b4eb74328e00f6f
|
refs/heads/master
| 2020-05-16T15:47:33.675136
| 2019-09-25T08:20:28
| 2019-09-25T08:20:28
| 183,143,104
| 0
| 0
| null | 2019-04-24T03:46:28
| 2019-04-24T03:46:28
| null |
UTF-8
|
Java
| false
| false
| 522
|
java
|
/**
* Copyright © 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.market.dao;
import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
import com.thinkgem.jeesite.modules.market.entity.MkDividendStat;
/**
* 分红统计DAO接口
* @author zhangzijun
* @version 2018-08-02
*/
@MyBatisDao
public interface MkDividendStatDao extends CrudDao<MkDividendStat> {
}
|
[
"1072163919@qq.com"
] |
1072163919@qq.com
|
3887f10a20a4603d6c1c9d29297e81e343b89419
|
eb273108e5e3a10dcae11dc8e420aa307c03bf4a
|
/src/main/java/com/tmri/rfid/access/dao/jdbc/EriAccessDaoJdbc.java
|
56bb1d3d240a3cdc18f4c3797ceaca387107e063
|
[] |
no_license
|
wwhtiancai/tlwww
|
03e674feef0d63421433e3c17df9cd7a35970e78
|
b442ac5c8b06534b8fb42cd26e75c247b78d0fa3
|
refs/heads/master
| 2022-12-20T08:56:10.905292
| 2019-12-26T04:37:02
| 2019-12-26T04:37:02
| 230,195,179
| 1
| 0
| null | 2022-12-16T08:01:04
| 2019-12-26T04:33:24
|
Java
|
UTF-8
|
Java
| false
| false
| 2,938
|
java
|
package com.tmri.rfid.access.dao.jdbc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.tmri.rfid.access.dao.EriAccessDao;
import com.tmri.rfid.access.mapper.EriAccessMapper;
import com.tmri.rfid.framework.util.DbResult;
import com.tmri.rfid.rfid.bean.RfidApply;
import com.tmri.rfid.rfid.bean.RfidApplyDoc;
@Repository
public class EriAccessDaoJdbc implements EriAccessDao {
@Autowired
private EriAccessMapper eriAccessMapper;
public DbResult saveApply(RfidApply app) throws Exception{
DbResult dr=new DbResult();
dr.setCode(-1);
app.setClyw("1");
app.setClzt("0");
app.setHphm(null);
app.setKh(null);
app.setSycplx(null);
app.setSycpid(null);
int count=eriAccessMapper.existApply(new RfidApply(app.getSqbh(),null));
if(count<1) {
if(app.getXsztp()==null||app.getXsztp().length<1) {
dr.setMsg("汽车电子标识卡("+app.getKh()+")业务中缺少行驶证上传图片");
return dr;
}
if(app.getBsktp()==null||app.getBsktp().length<1) {
dr.setMsg("汽车电子标识卡("+app.getKh()+")业务中缺少标识卡上传图片");
return dr;
}
if(app.getQctp()==null||app.getQctp().length<1) {
dr.setMsg("汽车电子标识卡("+app.getKh()+")业务中缺少汽车正面上传图片");
return dr;
}
int r=eriAccessMapper.insertApply(app);
if(r==1) {
dr.setCode(1);
}else {
dr.setMsg("业务主表数据新增错误,返回为:"+String.valueOf(r));
}
}else {
app.setHpzl(null);
app.setHphm(null);
app.setKh(null);
app.setSycplx(null);
app.setSycpid(null);
int r=eriAccessMapper.updateApply(app);
if(r==1) {
dr.setCode(1);
}else {
dr.setMsg("业务主表数据更新错误,返回为:"+String.valueOf(r));
}
}
return dr;
}
public DbResult saveOrDeleteApplyFK(RfidApply app) throws Exception{
DbResult dr=new DbResult();
dr.setCode(-1);
int count=eriAccessMapper.existApply(new RfidApply(app.getSqbh(),null));
if(count<1) {
dr.setMsg("该笔业务不存在");
return dr;
}
app.setHpzl(null);
app.setHphm(null);
int r=eriAccessMapper.updateApply(app);
if(r==1) {
dr.setCode(1);
}else {
dr.setMsg("业务主表数据更新错误,返回为:"+String.valueOf(r));
}
return dr;
}
public DbResult saveApplyDoc(RfidApplyDoc appDoc) throws Exception{
DbResult dr=new DbResult();
dr.setCode(-1);
int count=eriAccessMapper.existApplyDoc(new RfidApplyDoc(appDoc.getXh()));
if(count<1) {
int r=eriAccessMapper.insertApplyDoc(appDoc);
if(r==1) {
dr.setCode(1);
}else {
dr.setMsg("图片主表数据新增错误,返回为:"+String.valueOf(r));
}
}else {
int r=eriAccessMapper.updateApplyDoc(appDoc);
if(r==1) {
dr.setCode(1);
}else {
dr.setMsg("图片主表数据更新错误,返回为:"+String.valueOf(r));
}
}
return dr;
}
}
|
[
"626961224@qq.com"
] |
626961224@qq.com
|
71ab6f7dddd56c0eaeb557dd06268fc1094b7a45
|
cc328476eba0f9dcbac108688cf1b97d1d06c189
|
/src/main/java/com/cisco/policyconversiontool/dto/wsa/asyncos806/DESTIP.java
|
42e9f67f2b47b1cf4d4089a740506d215ade5dff
|
[] |
no_license
|
SecurView/cws-wsa
|
b9278caee8d52afd9f71b925516bc18380b5c331
|
c3e9c245722f89d9a3189bf7bc9700e8b4c7f1d6
|
refs/heads/master
| 2016-09-06T21:35:20.674191
| 2014-12-19T14:45:23
| 2014-12-19T14:45:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,277
|
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: 2014.11.26 at 05:46:49 PM IST
//
package com.cisco.policyconversiontool.dto.wsa.asyncos806;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
@XmlRootElement(name = "DEST_IP")
public class DESTIP {
@XmlValue
protected String value;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getvalue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setvalue(String value) {
this.value = value;
}
}
|
[
"kgadekar@securview.com"
] |
kgadekar@securview.com
|
cc4407c92b2f14d3c89a0b6f212508ebced967ed
|
ccbecd673ec01d3da3afe8c07bd3a9e8a0e772fd
|
/demo/v3-demo-portlet/src/main/java/org/apache/portals/pluto/demo/v3/ActEvtProxyServlet.java
|
99ca2d4a418bcb7c4d70ce658780badb173aee46
|
[
"Apache-2.0",
"EPL-2.0",
"CDDL-1.0"
] |
permissive
|
ngriffin7a/portals-pluto
|
9b111b896ff9dab9268d15dc179517d8190b6b17
|
daf4d3748e6d57af62075e5cdd74486b53a7a02a
|
refs/heads/master
| 2021-01-19T03:49:06.082390
| 2019-04-28T00:17:47
| 2019-04-28T00:17:47
| 69,889,534
| 1
| 0
|
Apache-2.0
| 2018-11-15T23:49:00
| 2016-10-03T16:32:49
|
Java
|
UTF-8
|
Java
| false
| false
| 2,899
|
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.portals.pluto.demo.v3;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import static org.apache.portals.pluto.demo.v3.TagLibPortlet.ATTRIB_TXT;
import static org.apache.portals.pluto.demo.v3.TagLibPortlet.PROXY;
import static org.apache.portals.pluto.demo.v3.TagLibPortlet.TEST;
/**
* Servlet used by the {@link TagLibPortlet}.
*/
@WebServlet(urlPatterns = PROXY)
public class ActEvtProxyServlet extends HttpServlet {
private static final long serialVersionUID = -1798128019502989930L;
private static final Logger logger = LoggerFactory.getLogger(ActEvtProxyServlet.class);
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
ProxyRespWrapper wrapped = new ProxyRespWrapper(resp);
String ttype = req.getParameter(TEST);
RequestDispatcher rd = req.getRequestDispatcher(ParamUtil.getJsp(ttype));
rd.include(req, wrapped);
String output = wrapped.getOutput();
req.getSession().setAttribute(ATTRIB_TXT, output);
logger.debug("Proxy executed. Output length: " + ((output == null) ? "null" : output.length()));
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req, resp);
}
private static class ProxyRespWrapper extends HttpServletResponseWrapper {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
public ProxyRespWrapper(HttpServletResponse response) {
super(response);
}
public String getOutput() {
pw.flush();
return sw.toString();
}
@Override
public PrintWriter getWriter() throws IOException {
return pw;
}
}
}
|
[
"neil.griffin.scm@gmail.com"
] |
neil.griffin.scm@gmail.com
|
bbadc04dd7754586faa3507c4cffdb653a6604c9
|
885faeb6aeab35128890169a303350c3674eda5f
|
/infer/models/java/src/java/util/AbstractList.java
|
771ff28106f9d57c9e7a04abf3d767b2cac9c5bd
|
[
"MIT",
"GPL-1.0-or-later"
] |
permissive
|
gatarelib/infer
|
8ea79e012c7e8e3128fca77b8ef1aa6922b5a360
|
21145c75c920962b3c2970d1224eca7b6dc8ba8d
|
refs/heads/master
| 2020-03-28T20:59:31.248792
| 2018-09-17T11:01:20
| 2018-09-17T11:19:32
| 149,120,550
| 0
| 0
|
MIT
| 2020-02-13T23:15:43
| 2018-09-17T12:17:46
|
OCaml
|
UTF-8
|
Java
| false
| false
| 1,254
|
java
|
/*
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package java.util;
import com.facebook.infer.builtins.InferUndefined;
// could make List an abstract class directly instead, but that breaks other models
public abstract class AbstractList<T> {
// need three-value state for unknown (-1), false (0), or true (1)
// the reason we can't use a bool is that we want to return either true or false each time we call
// isEmpty, and we want to get the same result each time
private int mIsEmpty;
native T any();
public AbstractList() {
mIsEmpty = 1;
}
public boolean isEmpty() {
if (mIsEmpty < 0) {
if (InferUndefined.boolean_undefined()) {
mIsEmpty = 1;
} else {
mIsEmpty = 0;
}
}
return mIsEmpty == 1;
}
public void add(int index, T toAdd) {
mIsEmpty = 0;
}
public T remove(int index) {
mIsEmpty = -1;
return any();
}
public boolean remove(Object o) {
boolean result = InferUndefined.boolean_undefined();
if (result) {
mIsEmpty = -1;
}
return result;
}
public void clear() {
mIsEmpty = 1;
}
}
|
[
"facebook-github-bot@users.noreply.github.com"
] |
facebook-github-bot@users.noreply.github.com
|
585a3144fee99e0ffb7e3ab7d137db9bf92788d5
|
29b6a856a81a47ebab7bfdba7fe8a7b845123c9e
|
/dingtalk/java/src/main/java/com/aliyun/dingtalkindustry_1_0/models/CampusCreateRenterResponse.java
|
b61da2a43f595711ccfc934df1d927b67e757879
|
[
"Apache-2.0"
] |
permissive
|
aliyun/dingtalk-sdk
|
f2362b6963c4dbacd82a83eeebc223c21f143beb
|
586874df48466d968adf0441b3086a2841892935
|
refs/heads/master
| 2023-08-31T08:21:14.042410
| 2023-08-30T08:18:22
| 2023-08-30T08:18:22
| 290,671,707
| 22
| 9
| null | 2021-08-12T09:55:44
| 2020-08-27T04:05:39
|
PHP
|
UTF-8
|
Java
| false
| false
| 1,406
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.dingtalkindustry_1_0.models;
import com.aliyun.tea.*;
public class CampusCreateRenterResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("statusCode")
@Validation(required = true)
public Integer statusCode;
@NameInMap("body")
@Validation(required = true)
public CampusCreateRenterResponseBody body;
public static CampusCreateRenterResponse build(java.util.Map<String, ?> map) throws Exception {
CampusCreateRenterResponse self = new CampusCreateRenterResponse();
return TeaModel.build(map, self);
}
public CampusCreateRenterResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public CampusCreateRenterResponse setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
return this;
}
public Integer getStatusCode() {
return this.statusCode;
}
public CampusCreateRenterResponse setBody(CampusCreateRenterResponseBody body) {
this.body = body;
return this;
}
public CampusCreateRenterResponseBody getBody() {
return this.body;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
af7db6f71cfcad918d448ccda2f1370c14060dda
|
5b20675279b8c3559512397563b7dacc690e8785
|
/gameserver/branches/obfuscated/game-src/com/l2jfrozen/gameserver/network/serverpackets/ExDuelEnd.java
|
4b6de27a28451158acffd2be4fd78aab47766180
|
[] |
no_license
|
Bokoa/l2jfrozen
|
0226a1d30eaf4bfa0078fedb46ac4f650cbca805
|
624d29604b1626f379929f0100c6a3a431a7f89b
|
refs/heads/master
| 2023-02-11T01:39:49.699822
| 2020-05-10T12:50:46
| 2020-05-10T12:50:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,451
|
java
|
/* L2jFrozen Project - www.l2jfrozen.com
*
* 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, 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.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2jfrozen.gameserver.network.serverpackets;
/**
* Format: ch d.
* @author KenM
*/
public class ExDuelEnd extends L2GameServerPacket
{
/** The Constant _S__FE_4E_EXDUELEND. */
private static final String _S__FE_4E_EXDUELEND = "[S] FE:4E ExDuelEnd";
/** The _unk1. */
private final int _unk1;
/**
* Instantiates a new ex duel end.
* @param unk1 the unk1
*/
public ExDuelEnd(final int unk1)
{
_unk1 = unk1;
}
@Override
protected void writeImpl()
{
C(0xfe);
H(0x4e);
D(_unk1);
}
/**
* Gets the type.
* @return the type
*/
@Override
public String getType()
{
return _S__FE_4E_EXDUELEND;
}
}
|
[
"77194947+Shyla-L2jFrozen@users.noreply.github.com"
] |
77194947+Shyla-L2jFrozen@users.noreply.github.com
|
6f93d8ff3c5526bc0d44b8b4bcc365a63a4dcbbf
|
6baf1fe00541560788e78de5244ae17a7a2b375a
|
/hollywood/com.oculus.socialplatform-base/sources/X/EnumC03060ku.java
|
2c70e5a21459989eb85f1bc46f01e4e13612ff95
|
[] |
no_license
|
phwd/quest-tracker
|
286e605644fc05f00f4904e51f73d77444a78003
|
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
|
refs/heads/main
| 2023-03-29T20:33:10.959529
| 2021-04-10T22:14:11
| 2021-04-10T22:14:11
| 357,185,040
| 4
| 2
| null | 2021-04-12T12:28:09
| 2021-04-12T12:28:08
| null |
UTF-8
|
Java
| false
| false
| 472
|
java
|
package X;
/* renamed from: X.0ku reason: invalid class name and case insensitive filesystem */
public enum EnumC03060ku {
NOT_SO("not_so"),
X86("x86"),
ARM("armeabi-v7a"),
X86_64("x86_64"),
AARCH64("arm64-v8a"),
OTHERS("others");
public final String value;
/* access modifiers changed from: public */
EnumC03060ku(String str) {
this.value = str;
}
public String toString() {
return this.value;
}
}
|
[
"cyuubiapps@gmail.com"
] |
cyuubiapps@gmail.com
|
002516dd7a714bada13cd9cea150201058d06622
|
507a96543784eedb7aa1802d5900807660b7ddbb
|
/xingguang-loan-system/src/test/java/com/xingguang/cus/CusUserTest.java
|
380c836ee88b5b0ed2d4e6537ba797df50f77220
|
[] |
no_license
|
dalianghe/xingguang-loan
|
a60562d112c7369c82a58b89d0b9fc6a0e86f931
|
1bbdef3d405b93c38117c113e310f763bd7a44b7
|
refs/heads/master
| 2021-05-16T12:55:46.139561
| 2017-12-14T15:30:19
| 2017-12-14T15:30:19
| 105,276,134
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,409
|
java
|
package com.xingguang.cus;
import com.xingguang.cus.baseinfo.domain.CusUserDomain;
import com.xingguang.cus.baseinfo.service.ICusUserInfoService;
import com.xingguang.cus.linkinfo.entity.CusUserLinkEntity;
import com.xingguang.cus.linkinfo.service.ICusUserLinkService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.HashMap;
import java.util.Map;
/**
* Created by admin on 2017/10/11.
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class CusUserTest {
@Autowired
private ICusUserInfoService service;
@Autowired
private ICusUserLinkService linkService;
@Test
public void testFindAll() throws Exception{
Map<String,Integer> pager = new HashMap<>();
pager.put("page",1);
pager.put("pageSize",10);
CusUserDomain domain = new CusUserDomain();
domain.setName(null);
domain.setPager(pager);
Map<String ,Object> map = service.findCusUserAll(domain);
System.out.println(map.get("total"));
}
@Test
public void testFindCusUserLinkByUserId() throws Exception{
CusUserLinkEntity entity = linkService.findCusUserLinkByUserId(2L);
System.out.println(entity.getLinkName());
}
}
|
[
"276420284@qq.com"
] |
276420284@qq.com
|
5c7327348b983b6ed38bb5cf20a4642b67dbb76d
|
38933bae7638a11fef6836475fef0d73e14c89b5
|
/magma-asserts/src/test/java/eu/lunisolar/magma/asserts/func/function/to/LToLongBiFunctionAttestTest.java
|
70d5fc297e1c2ba126217cfcbc816c1b5b52e887
|
[
"Apache-2.0"
] |
permissive
|
lunisolar/magma
|
b50ed45ce2f52daa5c598e4760c1e662efbbc0d4
|
41d3db2491db950685fe403c934cfa71f516c7dd
|
refs/heads/master
| 2023-08-03T10:13:20.113127
| 2023-07-24T15:01:49
| 2023-07-24T15:01:49
| 29,874,142
| 5
| 0
|
Apache-2.0
| 2023-05-09T18:25:01
| 2015-01-26T18:03:44
|
Java
|
UTF-8
|
Java
| false
| false
| 4,616
|
java
|
/*
* This file is part of "lunisolar-magma".
*
* (C) Copyright 2014-2023 Lunisolar (http://lunisolar.eu/).
*
* 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 eu.lunisolar.magma.asserts.func.function.to;
import eu.lunisolar.magma.asserts.func.FuncAttests;
import eu.lunisolar.magma.func.supp.check.Checks;
import eu.lunisolar.magma.func.supp.*; // NOSONAR
import eu.lunisolar.magma.func.*; // NOSONAR
import javax.annotation.Nonnull; // NOSONAR
import javax.annotation.Nullable; // NOSONAR
import java.util.Objects;// NOSONAR
import eu.lunisolar.magma.basics.meta.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.type.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.domain.*; // NOSONAR
import eu.lunisolar.magma.func.function.to.LToLongBiFunction;
import org.testng.annotations.*; //NOSONAR
import java.util.regex.Pattern; //NOSONAR
import java.text.ParseException; //NOSONAR
import eu.lunisolar.magma.basics.exceptions.*; //NOSONAR
import java.util.concurrent.atomic.*; //NOSONAR
import java.util.function.*; //NOSONAR
@SuppressWarnings("ALL")
public class LToLongBiFunctionAttestTest<T1,T2> {
private long testValue = 100L;
private LToLongBiFunction<Integer,Integer> function = (a1,a2) ->
testValue;
private LToLongBiFunction<Integer,Integer> functionThrowing = (a1,a2) -> {
throw new UnsupportedOperationException();
};
@Test
public void testAssertPositive() throws ParseException {
FuncAttests.attestToLongBiFunc(function)
.doesApplyAsLong(100,100)
.to(a -> a.mustEx(Be::equalEx, testValue));
}
@Test(expectedExceptions = AssertionError.class)
public void testAssertNegative() throws ParseException {
FuncAttests.attestToLongBiFunc(function)
.doesApplyAsLong(100,100)
.to(a -> a.mustEx(Be::equalEx, 0L));
}
@Test(expectedExceptions = AssertionError.class, expectedExceptionsMessageRegExp = "(?s)Actual .+: Case .+, check \\?; Should evaluate without problem: null")
public void testAssertThrowsUnexpected() throws ParseException {
FuncAttests.attestToLongBiFunc(functionThrowing)
.doesApplyAsLong(100,100)
.to(a -> a.mustEx(Be::equalEx, 0L));
}
@Test
public void testAssertThrowsExpected() throws ParseException {
FuncAttests.attestToLongBiFunc(functionThrowing)
.doesApplyAsLong(100,100).withException(a -> a
.mustEx(Be::exactlyInstanceOfEx, UnsupportedOperationException.class)
.mustEx(Have::noMsgEx));
}
@Test
public void testRecurringAssertsPositive() throws ParseException {
final AtomicInteger recurringAssertsCalls = new AtomicInteger(0);
FuncAttests.attestToLongBiFunc(function)
.inAllFollowingCases(a-> {
recurringAssertsCalls.incrementAndGet();
a.mustEx(Be::equalEx, testValue);
})
.doesApplyAsLong(100,100)
.to(a -> a.mustEx(Be::equalEx, testValue))
.doesApplyAsLong(100,100)
.to(a -> a.mustEx(Be::equalEx, testValue));
Checks.attest(recurringAssertsCalls.get()).mustEx(Be::equalEx, 2);
}
@Test(expectedExceptions = AssertionError.class, expectedExceptionsMessageRegExp = "(?s)Actual .+: Case .+, check \\?; Recurring assertion failed: .*")
public void testRecurringAssertsNegative() throws ParseException {
final AtomicInteger recurringAssertsCalls = new AtomicInteger(0);
FuncAttests.attestToLongBiFunc(function)
.inAllFollowingCases(a-> {
int i = recurringAssertsCalls.incrementAndGet();
if (i>1) {
a.mustEx(Be::equalEx, 0L);
}
})
.doesApplyAsLong(100,100)
.to(a -> a.mustEx(Be::equalEx, testValue))
.doesApplyAsLong(100,100)
.to(a -> a.mustEx(Be::equalEx, testValue));
Checks.attest(recurringAssertsCalls.get()).mustEx(Be::equalEx, 2);
}
}
|
[
"open@lunisolar.eu"
] |
open@lunisolar.eu
|
81bbbee92296e969e58ae6d3086ce275cf1961e3
|
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
|
/sources/io/reactivex/rxjava3/internal/subscribers/BlockingSubscriber.java
|
84b742878721ac72673e3749d30aef8d8e5ad69f
|
[] |
no_license
|
Auch-Auch/avito_source
|
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
|
76fdcc5b7e036c57ecc193e790b0582481768cdc
|
refs/heads/master
| 2023-05-06T01:32:43.014668
| 2021-05-25T10:19:22
| 2021-05-25T10:19:22
| 370,650,685
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,848
|
java
|
package io.reactivex.rxjava3.internal.subscribers;
import io.reactivex.rxjava3.core.FlowableSubscriber;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;
import io.reactivex.rxjava3.internal.util.NotificationLite;
import java.util.Queue;
import java.util.concurrent.atomic.AtomicReference;
import org.reactivestreams.Subscription;
public final class BlockingSubscriber<T> extends AtomicReference<Subscription> implements FlowableSubscriber<T>, Subscription {
public static final Object TERMINATED = new Object();
private static final long serialVersionUID = -4875965440900746268L;
public final Queue<Object> a;
public BlockingSubscriber(Queue<Object> queue) {
this.a = queue;
}
@Override // org.reactivestreams.Subscription
public void cancel() {
if (SubscriptionHelper.cancel(this)) {
this.a.offer(TERMINATED);
}
}
public boolean isCancelled() {
return get() == SubscriptionHelper.CANCELLED;
}
@Override // org.reactivestreams.Subscriber
public void onComplete() {
this.a.offer(NotificationLite.complete());
}
@Override // org.reactivestreams.Subscriber
public void onError(Throwable th) {
this.a.offer(NotificationLite.error(th));
}
@Override // org.reactivestreams.Subscriber
public void onNext(T t) {
this.a.offer(NotificationLite.next(t));
}
@Override // io.reactivex.rxjava3.core.FlowableSubscriber, org.reactivestreams.Subscriber
public void onSubscribe(Subscription subscription) {
if (SubscriptionHelper.setOnce(this, subscription)) {
this.a.offer(NotificationLite.subscription(this));
}
}
@Override // org.reactivestreams.Subscription
public void request(long j) {
((Subscription) get()).request(j);
}
}
|
[
"auchhunter@gmail.com"
] |
auchhunter@gmail.com
|
fc9deaf1edebae1235542958363046ca15829c91
|
eb5f5353f49ee558e497e5caded1f60f32f536b5
|
/com/sun/xml/internal/stream/buffer/XMLStreamBufferMark.java
|
63e7f51bbb7399c49ced166064d0bea961c0ef85
|
[] |
no_license
|
mohitrajvardhan17/java1.8.0_151
|
6fc53e15354d88b53bd248c260c954807d612118
|
6eeab0c0fd20be34db653f4778f8828068c50c92
|
refs/heads/master
| 2020-03-18T09:44:14.769133
| 2018-05-23T14:28:24
| 2018-05-23T14:28:24
| 134,578,186
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 974
|
java
|
package com.sun.xml.internal.stream.buffer;
import java.util.Map;
public class XMLStreamBufferMark
extends XMLStreamBuffer
{
public XMLStreamBufferMark(Map<String, String> paramMap, AbstractCreatorProcessor paramAbstractCreatorProcessor)
{
if (paramMap != null) {
_inscopeNamespaces = paramMap;
}
_structure = _currentStructureFragment;
_structurePtr = _structurePtr;
_structureStrings = _currentStructureStringFragment;
_structureStringsPtr = _structureStringsPtr;
_contentCharactersBuffer = _currentContentCharactersBufferFragment;
_contentCharactersBufferPtr = _contentCharactersBufferPtr;
_contentObjects = _currentContentObjectFragment;
_contentObjectsPtr = _contentObjectsPtr;
treeCount = 1;
}
}
/* Location: C:\Program Files (x86)\Java\jre1.8.0_151\lib\rt.jar!\com\sun\xml\internal\stream\buffer\XMLStreamBufferMark.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 0.7.1
*/
|
[
"mohit.rajvardhan@ericsson.com"
] |
mohit.rajvardhan@ericsson.com
|
49cc053245d73e979d7324fb2447d31a3a523c74
|
738172e924a45763b260c2acf2cea35e02cb112d
|
/bukkit/src/main/java/com/github/stefvanschie/quickskript/bukkit/psi/literal/PsiPlayerLiteralImpl.java
|
9c42403c958024cdc628d01fda098cdb4cbc69e7
|
[
"MIT"
] |
permissive
|
stefvanschie/QuickSkript
|
8b2b2022794b9187da88c8b230e53222cb7bf34c
|
3533a045d6ccd4e3d3a8b797839c950c27dab909
|
refs/heads/master
| 2023-08-08T17:29:44.856006
| 2023-07-27T19:21:21
| 2023-07-27T19:21:21
| 142,689,934
| 14
| 5
|
MIT
| 2022-05-21T18:52:20
| 2018-07-28T15:50:47
|
Java
|
UTF-8
|
Java
| false
| false
| 1,744
|
java
|
package com.github.stefvanschie.quickskript.bukkit.psi.literal;
import com.github.stefvanschie.quickskript.bukkit.context.ContextImpl;
import com.github.stefvanschie.quickskript.core.context.Context;
import com.github.stefvanschie.quickskript.core.skript.SkriptRunEnvironment;
import com.github.stefvanschie.quickskript.core.psi.exception.ExecutionException;
import com.github.stefvanschie.quickskript.core.psi.literal.PsiPlayerLiteral;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Returns the player from the given context. Can never be pre computed since it relies completely on context.
*
* @since 0.1.0
*/
public class PsiPlayerLiteralImpl extends PsiPlayerLiteral {
private PsiPlayerLiteralImpl(int lineNumber) {
super(lineNumber);
}
@NotNull
@Override
protected Player executeImpl(@Nullable SkriptRunEnvironment environment, @Nullable Context context) {
if (context == null) {
throw new ExecutionException("Cannot find a player without a context", lineNumber);
}
CommandSender sender = ((ContextImpl) context).getCommandSender();
if (!(sender instanceof Player)) {
throw new ExecutionException("Command wasn't executed by a player", lineNumber);
}
return (Player) sender;
}
/**
* A factory for creating player literals
*
* @since 0.1.0
*/
public static class Factory extends PsiPlayerLiteral.Factory {
@NotNull
@Override
public PsiPlayerLiteralImpl create(int lineNumber) {
return new PsiPlayerLiteralImpl(lineNumber);
}
}
}
|
[
"stefvanschiedev@gmail.com"
] |
stefvanschiedev@gmail.com
|
8f1968ceec6a0be295368189d7c57df9c742d809
|
10186b7d128e5e61f6baf491e0947db76b0dadbc
|
/jp/cssj/f/a/c.java
|
23385bcc1438307cf6b78bacf29e94d34925bfbf
|
[
"SMLNJ",
"Apache-1.1",
"Apache-2.0",
"BSD-2-Clause"
] |
permissive
|
MewX/contendo-viewer-v1.6.3
|
7aa1021e8290378315a480ede6640fd1ef5fdfd7
|
69fba3cea4f9a43e48f43148774cfa61b388e7de
|
refs/heads/main
| 2022-07-30T04:51:40.637912
| 2021-03-28T05:06:26
| 2021-03-28T05:06:26
| 351,630,911
| 2
| 0
|
Apache-2.0
| 2021-10-12T22:24:53
| 2021-03-26T01:53:24
|
Java
|
UTF-8
|
Java
| false
| false
| 3,495
|
java
|
/* */ package jp.cssj.f.a;
/* */
/* */ import java.io.IOException;
/* */ import java.util.ArrayList;
/* */ import java.util.List;
/* */ import jp.cssj.f.a;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class c
/* */ extends d
/* */ implements a
/* */ {
/* 20 */ private List<a> d = new ArrayList<>();
/* */
/* 22 */ private a e = null; private a f = null;
/* */ private static final boolean b = false;
/* */
/* */ private class a {
/* */ public final int a;
/* 27 */ public a b = null; public a c = null;
/* */
/* 29 */ public long d = 0L;
/* */
/* */ public a(c this$0, int id) {
/* 32 */ this.a = id;
/* */ }
/* */ }
/* */
/* */ public c(a builder) {
/* 37 */ super(builder);
/* 38 */ if (!a && builder.c()) throw new AssertionError();
/* */ }
/* */
/* */ protected int f() {
/* 42 */ return this.d.size();
/* */ }
/* */
/* */ protected a c(int id) {
/* 46 */ return this.d.get(id);
/* */ }
/* */
/* */ protected void a(int id, a frg) {
/* 50 */ if (!a && id != this.d.size()) throw new AssertionError();
/* 51 */ this.d.add(frg);
/* */ }
/* */
/* */ public a.a d() {
/* 55 */ long[] idToPosition = new long[this.d.size()];
/* 56 */ long position = 0L;
/* 57 */ a frg = this.e;
/* 58 */ while (frg != null) {
/* */
/* 60 */ idToPosition[frg.a] = position;
/* 61 */ position += frg.d;
/* 62 */ frg = frg.c;
/* */ }
/* 64 */ return new a.a(this, idToPosition) {
/* */ public long a(int id) {
/* 66 */ long position = this.a[id];
/* 67 */ return position;
/* */ }
/* */ };
/* */ }
/* */
/* */ public void b() throws IOException {
/* 73 */ int id = f();
/* 74 */ a frg = new a(this, id);
/* 75 */ if (this.e == null) {
/* 76 */ this.e = frg;
/* */ } else {
/* 78 */ this.f.c = frg;
/* 79 */ frg.b = this.f;
/* */ }
/* 81 */ a(id, frg);
/* 82 */ this.f = frg;
/* 83 */ super.b();
/* */ }
/* */
/* */ public void a(int anchorId) throws IOException {
/* 87 */ int id = f();
/* 88 */ a anchor = c(anchorId);
/* 89 */ a frg = new a(this, id);
/* 90 */ a(id, frg);
/* 91 */ frg.b = anchor.b;
/* 92 */ frg.c = anchor;
/* 93 */ anchor.b.c = frg;
/* 94 */ anchor.b = frg;
/* 95 */ if (this.e == anchor) {
/* 96 */ this.e = frg;
/* */ }
/* 98 */ super.a(anchorId);
/* */ }
/* */
/* */ public void a(int id, byte[] b, int off, int len) throws IOException {
/* 102 */ a frg = c(id);
/* 103 */ frg.d += len;
/* 104 */ super.a(id, b, off, len);
/* */ }
/* */
/* */ public void b(int id) throws IOException {
/* 108 */ super.b(id);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public void a() throws IOException {
/* 116 */ this.e = null;
/* 117 */ this.f = null;
/* 118 */ this.d.clear();
/* 119 */ super.a();
/* */ }
/* */ }
/* Location: /mnt/r/ConTenDoViewer.jar!/jp/cssj/f/a/c.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/
|
[
"xiayuanzhong+gpg2020@gmail.com"
] |
xiayuanzhong+gpg2020@gmail.com
|
472902be57a68e80d01447a6b78c9dbead662974
|
e9adf9227baee96486bb61bfc78fca99660a6bfc
|
/cat-job/src/main/java/com/dianping/cat/job/joblet/LocationJoblet.java
|
c48df62471c24238179d2573ec2a1b92e6533a82
|
[] |
no_license
|
lietou/insight
|
b1cacc2902c755982a71ea4659311a75ed4acb86
|
4757005689201327eed6e5dd62740a88e84658f0
|
refs/heads/master
| 2021-01-22T12:17:01.291886
| 2013-04-20T01:38:29
| 2013-04-20T01:38:29
| 8,964,847
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,158
|
java
|
package com.dianping.cat.job.joblet;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.codehaus.plexus.logging.LogEnabled;
import org.codehaus.plexus.logging.Logger;
import com.dianping.cat.job.joblet.LocationJoblet.Location;
import com.dianping.cat.job.joblet.LocationJoblet.LocationStat;
import com.dianping.cat.job.spi.JobCmdLine;
import com.dianping.cat.job.spi.joblet.Joblet;
import com.dianping.cat.job.spi.joblet.JobletContext;
import com.dianping.cat.job.spi.joblet.JobletMeta;
import com.dianping.cat.job.spi.mapreduce.MessageTreeWritable;
import com.dianping.cat.job.spi.mapreduce.PojoWritable;
import com.dianping.cat.job.sql.dal.LocationRecord;
import com.dianping.cat.job.sql.dal.LocationRecordDao;
import com.dianping.cat.message.Event;
import com.dianping.cat.message.Message;
import com.dianping.cat.message.Transaction;
import com.dianping.cat.message.spi.MessageTree;
import org.unidal.dal.jdbc.DalException;
import org.unidal.lookup.ContainerHolder;
import org.unidal.lookup.annotation.Inject;
@JobletMeta(name = "location", description = "Location analysis", keyClass = Location.class, valueClass = LocationStat.class, combine = true, reducerNum = 1)
public class LocationJoblet extends ContainerHolder implements Joblet<Location, LocationStat> {
private static final MessageFormat m_format = new MessageFormat("{2}?lat={0,number}&lng={1,number}&{3}");
@Inject
private LocationOutputter m_outputter;
private Location getLocation(Transaction root) {
List<Message> children = root.getChildren();
for (Message child : children) {
if (child instanceof Event && child.getType().equals("URL") && child.getName().equals("Payload")) {
// URL:Payload
// /location.bin?lat=31.20334&lng=121.58017&accuracy=1385
String data = child.getData().toString();
try {
Object[] parts = m_format.parse(data);
Number lat = (Number) parts[0];
Number lng = (Number) parts[1];
return new Location(convertForPrecision(lat.doubleValue()), convertForPrecision(lng.doubleValue()),
root.getTimestamp());
} catch (Exception e) {
// ignore it
}
break;
}
}
return null;
}
private double convertForPrecision(double value) {
final double precise = 100000d;
return ((long) (value * precise)) / precise;
}
@Override
public boolean initialize(JobCmdLine cmdLine) {
String inputPath = cmdLine.getArg("inputPath", 0, null);
String outputPath = cmdLine.getArg("outputPath", 1, null);
if (inputPath != null) {
cmdLine.setProperty("inputPath", inputPath);
}
if (outputPath != null) {
cmdLine.setProperty("outputPath", outputPath);
}
String outputter = cmdLine.getProperty("outputter", null);
if (outputter != null) {
m_outputter = lookup(LocationOutputter.class, outputter);
}
return true;
}
@Override
public void map(JobletContext context, MessageTreeWritable treeWritable) throws IOException, InterruptedException {
MessageTree tree = treeWritable.get();
Message root = tree.getMessage();
final String type = root.getType();
final String name = root.getName();
if (root instanceof Transaction && type.equals("URL")
&& (name.equals("/location.bin") || name.equals("/locationhd.bin"))) {
Location location = getLocation((Transaction) root);
if (location != null) {
context.write(location, LocationStat.ONCE);
}
}
}
@Override
public void reduce(JobletContext context, Location location, Iterable<LocationStat> stats) throws IOException,
InterruptedException {
LocationStat all = new LocationStat();
for (LocationStat stat : stats) {
all.add(stat.getCount());
}
if (context.isInCombiner()) {
context.write(location, all);
} else {
m_outputter.out(context, location, all);
}
}
@Override
public void summary() {
System.out.println(m_outputter);
}
public static class Location extends PojoWritable {
private double m_lat;
private double m_lng;
private long m_transactionDate;
public Location() {
}
public Location(double lat, double lng, long transactionDate) {
m_lat = lat;
m_lng = lng;
m_transactionDate = transactionDate;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (!(obj instanceof Location))
return false;
Location other = (Location) obj;
if (Double.doubleToLongBits(m_lat) != Double.doubleToLongBits(other.m_lat))
return false;
if (Double.doubleToLongBits(m_lng) != Double.doubleToLongBits(other.m_lng))
return false;
if (m_transactionDate != other.m_transactionDate)
return false;
return true;
}
public double getLat() {
return m_lat;
}
public double getLng() {
return m_lng;
}
public long getTransactionDate() {
return m_transactionDate;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
long temp;
temp = Double.doubleToLongBits(m_lat);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(m_lng);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + (int) (m_transactionDate ^ (m_transactionDate >>> 32));
return result;
}
}
public static class LocationDatabaseDumper implements LocationOutputter, LogEnabled {
@Inject
private LocationRecordDao m_dao;
private List<LocationRecord> m_records = new ArrayList<LocationRecord>();
private int m_count;
private Logger m_logger;
@Override
public void enableLogging(Logger logger) {
m_logger = logger;
}
private void flushToDatabase() {
if (m_records.size() > 0) {
try {
final LocationRecord[] batch = m_records.toArray(new LocationRecord[0]);
m_dao.insert(batch);
m_records.clear();
m_count += batch.length;
m_logger.info(String.format("%s records inserted.", m_count));
} catch (DalException e) {
m_logger.error("Error when batch inserting data to database.", e);
}
}
}
@Override
public void out(JobletContext context, Location location, LocationStat stat) throws IOException,
InterruptedException {
if (m_records.size() >= 200) {
flushToDatabase();
}
LocationRecord record = m_dao.createLocal();
record.setLat(location.getLat());
record.setLng(location.getLng());
record.setTransactionDate(new Date(location.getTransactionDate()));
record.setTotal(stat.getCount());
m_records.add(record);
}
@Override
public String toString() {
flushToDatabase();
return "";
}
}
public static interface LocationOutputter {
public void out(JobletContext context, Location location, LocationStat all) throws IOException,
InterruptedException;
}
public static class LocationReporter implements LocationOutputter {
private Map<Location, LocationStat> m_stats = new TreeMap<Location, LocationStat>();
@Override
public void out(JobletContext context, Location location, LocationStat stat) throws IOException,
InterruptedException {
m_stats.put(location, stat);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder(8192);
boolean first = true;
sb.append('[');
for (Map.Entry<Location, LocationStat> e : m_stats.entrySet()) {
Location location = e.getKey();
LocationStat stat = e.getValue();
if (first) {
first = false;
} else {
sb.append(',');
sb.append('\n');
}
sb.append('[');
sb.append(location.getLat()).append(',').append(location.getLng()).append(',').append(stat.getCount());
sb.append(']');
}
sb.append(']');
return sb.toString();
}
}
public static class LocationStat extends PojoWritable {
public static final LocationStat ONCE = new LocationStat().add(1);
private int m_count;
public LocationStat add(int count) {
m_count += count;
return this;
}
public int getCount() {
return m_count;
}
@Override
public int hashCode() {
return m_count;
}
}
}
|
[
"qmwu2000@gmail.com"
] |
qmwu2000@gmail.com
|
ed2957dc20b1aa946fd98ad35dffb75e6cb2ce95
|
ff9501f65d7e0a124ff09648a05f3e5dc30e7b00
|
/freedom-fw1/src/org/freedom/library/business/object/Historico.java
|
59c27db8994d452bc8a18477c9f6cbb4a3aca3a3
|
[] |
no_license
|
train7719/red
|
927563cb244547547cc84ad431b675982bca5cd4
|
7308f986e2018daa5ef6f2f26067de6c7ba413d3
|
refs/heads/master
| 2021-01-12T13:55:34.427827
| 2016-09-26T11:55:10
| 2016-09-26T11:55:10
| 68,921,569
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,335
|
java
|
package org.freedom.library.business.object;
import java.math.BigDecimal;
import org.freedom.infra.model.jdbc.DbConnection;
import org.freedom.library.functions.Funcoes;
import org.freedom.library.persistence.ListaCampos;
import org.freedom.library.swing.frame.Aplicativo;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Date;
public class Historico {
private String historicocodificado;
private String documento;
private String portador;
private String historicoant;
private BigDecimal valor;
// private String serie;
private Date data;
private String historicodecodificado;
private boolean isDecoded = false;
public Historico() {
super();
}
public String getHistoricoant() {
return historicoant;
}
public void setHistoricoant(String historicoant) {
this.historicoant = historicoant;
}
public Historico(final Integer codhist, DbConnection con) {
super();
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = con.prepareStatement("SELECT TXAHISTPAD FROM FNHISTPAD WHERE CODEMP=? AND CODFILIAL=? AND CODHIST=?");
ps.setInt(1, Aplicativo.iCodEmp);
ps.setInt(2, ListaCampos.getMasterFilial("FNHISTPAD"));
ps.setInt(3, codhist);
rs = ps.executeQuery();
if (rs.next()) {
setHistoricocodificado(rs.getString(1));
}
rs.close();
ps.close();
con.commit();
}
catch (Exception e) {
e.printStackTrace();
}
}
protected void decodeHistorico() {
String decoded = null;
if (historicocodificado != null) {
try {
String tmp = historicocodificado;
String vlr = "0,00";
if (getValor() != null) {
vlr = Funcoes.bdToStr(getValor()).toString();
}
tmp = tmp.replaceAll("<HISTORICO>", getHistoricoant() != null ? getHistoricoant() : "");
tmp = tmp.replaceAll("<DOCUMENTO>", getDocumento() != null ? getDocumento() : "");
tmp = tmp.replaceAll("<VALOR>", vlr);
tmp = tmp.replaceAll("<DATA>", getData() != null ? Funcoes.dateToStrDate(getData()) : "");
tmp = tmp.replaceAll("<PORTADOR>", getPortador() != null ? getPortador() : "");
decoded = tmp;
isDecoded = true;
}
catch (Exception e) {
e.printStackTrace();
}
}
setHistoricodecodificado(decoded);
}
public Date getData() {
return data;
}
public void setData(Date data) {
this.data = data;
}
public String getDocumento() {
return documento;
}
public void setDocumento(String documento) {
this.documento = documento;
}
/*
* public String getSerie() {
*
* return serie; }
*
*
* public void setSerie( String serie ) {
*
* this.serie = serie; }
*/
public BigDecimal getValor() {
return valor;
}
public void setValor(BigDecimal valor) {
this.valor = valor;
}
public String getHistoricocodificado() {
return historicocodificado;
}
public void setHistoricocodificado(String historicocodificado) {
this.historicocodificado = historicocodificado;
}
public String getHistoricodecodificado() {
if (!isDecoded) {
decodeHistorico();
}
return historicodecodificado;
}
public void setHistoricodecodificado(String historicodecodificado) {
this.historicodecodificado = historicodecodificado;
}
public String getPortador() {
return portador;
}
public void setPortador(String portador) {
this.portador = portador;
}
}
|
[
"train7730@gmail.com"
] |
train7730@gmail.com
|
aeb893666aec77de638f6bccf2d62d2de6186128
|
bcf03d43318239f6242e53e0bdd3c4753c08fc79
|
/java/defpackage/apd.java
|
4c6ba905549c04494cbca1f5a9ad7bee942d35da
|
[] |
no_license
|
morristech/Candid
|
24699d45f9efb08787316154d05ad5e6a7a181a5
|
102dd9504cac407326b67ca7a36df8adf6a8b450
|
refs/heads/master
| 2021-01-22T21:07:12.067146
| 2016-12-22T18:40:30
| 2016-12-22T18:40:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,546
|
java
|
package defpackage;
import java.util.concurrent.TimeUnit;
import rx.internal.operators.OperatorMerge;
import rx.internal.operators.OperatorZip;
import rx.internal.util.ScalarSynchronousObservable;
import rx.schedulers.Schedulers;
/* compiled from: Observable */
public class apd<T> {
static final asa b = asc.a().c();
final apd$a<T> a;
public apd(apd$a<T> f) {
this.a = f;
}
public static <T> apd<T> a(apd$a<T> f) {
return new apd(b.a((apd$a) f));
}
public final <R> apd<R> a(apd$b<? extends R, ? super T> operator) {
return new apd(new apd$2(this, operator));
}
public aph<T> a() {
return new aph(apz.a(this));
}
public static <T> apd<T> a(Throwable exception) {
return new apd$c(exception);
}
public static <T> apd<T> a(T value) {
return ScalarSynchronousObservable.b(value);
}
public static <T> apd<T> a(apd<? extends apd<? extends T>> source) {
if (source.getClass() == ScalarSynchronousObservable.class) {
return ((ScalarSynchronousObservable) source).e(aqt.a());
}
return source.a(OperatorMerge.a(false));
}
public static apd<Long> a(long delay, TimeUnit unit) {
return apd.a(delay, unit, Schedulers.computation());
}
public static apd<Long> a(long delay, TimeUnit unit, apg scheduler) {
return apd.a(new aqa(delay, unit, scheduler));
}
public static <T1, T2, R> apd<R> a(apd<? extends T1> o1, apd<? extends T2> o2, apv<? super T1, ? super T2, ? extends R> zipFunction) {
return apd.a(new apd[]{o1, o2}).a(new OperatorZip(zipFunction));
}
public final apd<T> a(apr<Throwable> onError) {
return a(new aqb(new apd$1(this, onError)));
}
public final apd<T> a(apu<? super T, Boolean> predicate) {
return a(new aqc(predicate));
}
public final <R> apd<R> b(apu<? super T, ? extends apd<? extends R>> func) {
if (getClass() == ScalarSynchronousObservable.class) {
return ((ScalarSynchronousObservable) this).e(func);
}
return apd.a(c(func));
}
public final <R> apd<R> c(apu<? super T, ? extends R> func) {
return a(new aqd(func));
}
public final apd<T> a(apg scheduler) {
if (this instanceof ScalarSynchronousObservable) {
return ((ScalarSynchronousObservable) this).c(scheduler);
}
return a(new aqe(scheduler, false));
}
public final apd<T> a(long capacity) {
return a(new aqf(capacity));
}
public final apd<T> d(apu<Throwable, ? extends T> resumeFunction) {
return a(aqg.a((apu) resumeFunction));
}
public final apk b(apr<? super T> onNext) {
if (onNext != null) {
return b(new apd$3(this, onNext));
}
throw new IllegalArgumentException("onNext can not be null");
}
public final apk a(apj<? super T> subscriber) {
try {
subscriber.onStart();
b.a(this, this.a).call(subscriber);
return b.a((apk) subscriber);
} catch (Throwable e2) {
app.a(e2);
b.a(new RuntimeException("Error occurred attempting to subscribe [" + e.getMessage() + "] and then again while trying to pass to onError.", e2));
}
}
public final apk b(apj<? super T> subscriber) {
return apd.a((apj) subscriber, this);
}
private static <T> apk a(apj<? super T> subscriber, apd<T> observable) {
apk subscriber2;
if (subscriber == null) {
throw new IllegalArgumentException("observer can not be null");
} else if (observable.a == null) {
throw new IllegalStateException("onSubscribe function can not be null.");
} else {
subscriber.onStart();
if (!(subscriber instanceof arw)) {
subscriber2 = new arw(subscriber);
}
try {
b.a(observable, observable.a).call(subscriber2);
return b.a(subscriber2);
} catch (Throwable e2) {
app.a(e2);
b.a(new RuntimeException("Error occurred attempting to subscribe [" + e.getMessage() + "] and then again while trying to pass to onError.", e2));
}
}
}
public final apd<T> b(apg scheduler) {
if (this instanceof ScalarSynchronousObservable) {
return ((ScalarSynchronousObservable) this).c(scheduler);
}
return apd.a(new aqh(this, scheduler));
}
}
|
[
"admin@timo.de.vc"
] |
admin@timo.de.vc
|
dfea578b0e6209a7e90eec884299ee936311bcc1
|
754acca536134b49837787982226b5c9d903645e
|
/app/src/main/java/freeman/rx/gxj/com/freeman/drag/LinearDragActivity.java
|
cf67c5e75ccea57c4c5c3dd2b6b75b7f3e55e2df
|
[] |
no_license
|
guoxiaojun001/FreeMan
|
7a9d4067cf8741692b0fa4b0211087cbd62dd626
|
210203c7348deca834d4db7982c188b54f02a891
|
refs/heads/master
| 2021-01-17T12:53:35.103036
| 2016-07-21T02:19:48
| 2016-07-21T02:19:48
| 59,624,504
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,473
|
java
|
package freeman.rx.gxj.com.freeman.drag;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import com.ldzs.recyclerlibrary.DragRecyclerView;
import com.ldzs.recyclerlibrary.anim.SlideInLeftAnimator;
import freeman.rx.gxj.com.freeman.activity.R;
import freeman.rx.gxj.com.freeman.adapter.SimpleAdapter;
import freeman.rx.gxj.com.freeman.data.Date;
/**
* Created by cz on 16/1/27.
*/
public class LinearDragActivity extends AppCompatActivity {
private DragRecyclerView mRecyclerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drag);
setTitle(getIntent().getStringExtra("title"));
mRecyclerView = (DragRecyclerView) findViewById(R.id.recycler_view);
mRecyclerView.setItemAnimator(new SlideInLeftAnimator());
mRecyclerView.getItemAnimator().setAddDuration(300);
mRecyclerView.getItemAnimator().setRemoveDuration(300);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setAdapter(new SimpleAdapter(this, Date.createItems(this, 100)));
mRecyclerView.setLongPressDrawEnable(true);
mRecyclerView.setOnDragItemEnableListener(position -> true);
}
}
|
[
"guoxiaojun8804@126.com"
] |
guoxiaojun8804@126.com
|
8c7a2dfcb9c4dece1587477a6e971b139cb9c343
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/large-multiproject/project33/src/main/java/org/gradle/test/performance33_5/Production33_428.java
|
4f6800dcd5ed9feb3a8b09831c9f35c5058b6902
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276
| 2022-11-24T05:18:33
| 2022-11-24T05:18:33
| 80,121,268
| 17
| 15
| null | 2022-09-30T08:04:35
| 2017-01-26T14:25:33
| null |
UTF-8
|
Java
| false
| false
| 305
|
java
|
package org.gradle.test.performance33_5;
public class Production33_428 extends org.gradle.test.performance13_5.Production13_428 {
private final String property;
public Production33_428() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
483bd5c4ae85714bde9d5d8ff9c0ab02b7ae7f2e
|
928bdfb9b0f4b6db0043526e095fe1aa822b8e64
|
/src/main/java/com/taobao/api/response/TmallItemSizemappingTemplatesListResponse.java
|
f4254265aba7c38097e39909329ed644df071e52
|
[] |
no_license
|
yu199195/jsb
|
de4f4874fb516d3e51eb3badb48d89be822e00f7
|
591ad717121dd8da547348aeac551fc71da1b8bd
|
refs/heads/master
| 2021-09-07T22:25:09.457212
| 2018-03-02T04:54:18
| 2018-03-02T04:54:18
| 102,316,111
| 4
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 824
|
java
|
package com.taobao.api.response;
import com.taobao.api.TaobaoResponse;
import com.taobao.api.domain.SizeMappingTemplate;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import java.util.List;
public class TmallItemSizemappingTemplatesListResponse
extends TaobaoResponse {
private static final long serialVersionUID = 8646298876483452882L;
@ApiListField("size_mapping_templates")
@ApiField("size_mapping_template")
private List<SizeMappingTemplate> sizeMappingTemplates;
public void setSizeMappingTemplates(List<SizeMappingTemplate> sizeMappingTemplates) {
this.sizeMappingTemplates = sizeMappingTemplates;
}
public List<SizeMappingTemplate> getSizeMappingTemplates() {
return this.sizeMappingTemplates;
}
}
|
[
"yu.xiao@happylifeplat.com"
] |
yu.xiao@happylifeplat.com
|
b82db5f6f47749c8d303642ea956fe5bddaefb0a
|
2bd7643730a0048e0ba1e7bb663a97166c54dc54
|
/EBPSv2/src/main/java/com/model/processing/Manjurinama.java
|
0ad863c597407a1a5c3fe83db90528847059547f
|
[] |
no_license
|
bkings/BuildingPermitDynamic
|
3f8b4d7fa8aaff45b43f05fc16fcb1ea54da3ad7
|
bb7322f6e04b2017854a5ceebcf4b37d755d000b
|
refs/heads/master
| 2023-02-16T20:46:37.209422
| 2021-01-17T06:40:25
| 2021-01-17T06:40:25
| 299,945,567
| 1
| 0
| null | 2020-10-21T13:30:47
| 2020-09-30T14:25:30
|
Java
|
UTF-8
|
Java
| false
| false
| 7,377
|
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 com.model.processing;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name = "manjurinama")
public class Manjurinama implements Serializable {
@Id
@Column(name = "application_no")
private Long applicationNo;
@Column(name = "json_data",columnDefinition = "varchar")
private String jsonData;
@Column(name = "enter_by")
private String enterBy;
@Column(name = "enter_date")
@Temporal(TemporalType.DATE)
private java.util.Date enterDate;
@Column(name = "amini_name")
private String aminiName;
@Column(name = "amini_date")
@Temporal(TemporalType.DATE)
private java.util.Date aminiDate;
@Column(name = "AMINI_STATUS", updatable = false, columnDefinition = "VARCHAR(1) DEFAULT 'P'")
private String aminiStatus;
@Column(name = "ser_date")
@Temporal(TemporalType.DATE)
private java.util.Date serDate;
@Column(name = "ser_name")
private String serName;
@Column(name = "er_name")
private String erName;
@Column(name = "er_date")
@Temporal(TemporalType.DATE)
private java.util.Date erDate;
@Column(name = "er_status")
private String erStatus;
@Column(name = "ser_status")
private String serStatus;
@Column(name = "chief_name")
private String chiefName;
@Column(name = "chief_date")
@Temporal(TemporalType.DATE)
private java.util.Date chiefDate;
@Column(name = "chief_status")
private String chiefStatus;
@Column(name = "RW_NAME", updatable = false)
private String rwName;
@Column(name = "RW_DATE", updatable = false)
@Temporal(TemporalType.DATE)
private java.util.Date rwDate;
@Column(name = "RW_STATUS", updatable = false, columnDefinition = "VARCHAR(1) DEFAULT 'P'")
private String rwStatus;
public Long getApplicationNo() {
return applicationNo;
}
public void setApplicationNo(Long applicationNo) {
this.applicationNo = applicationNo;
}
public String getJsonData() {
return jsonData;
}
public void setJsonData(String jsonData) {
this.jsonData = jsonData;
}
public String getEnterBy() {
return enterBy;
}
public void setEnterBy(String enterBy) {
this.enterBy = enterBy;
}
public java.util.Date getEnterDate() {
return enterDate;
}
public void setEnterDate(java.util.Date enterDate) {
this.enterDate = enterDate;
}
public String getAminiName() {
return aminiName;
}
public void setAminiName(String aminiName) {
this.aminiName = aminiName;
}
public Date getAminiDate() {
return aminiDate;
}
public void setAminiDate(Date aminiDate) {
this.aminiDate = aminiDate;
}
public String getAminiStatus() {
return aminiStatus;
}
public void setAminiStatus(String aminiStatus) {
this.aminiStatus = aminiStatus;
}
public java.util.Date getSerDate() {
return serDate;
}
public void setSerDate(java.util.Date serDate) {
this.serDate = serDate;
}
public String getSerName() {
return serName;
}
public void setSerName(String serName) {
this.serName = serName;
}
public String getErName() {
return erName;
}
public void setErName(String erName) {
this.erName = erName;
}
public java.util.Date getErDate() {
return erDate;
}
public void setErDate(java.util.Date erDate) {
this.erDate = erDate;
}
public String getErStatus() {
return erStatus;
}
public void setErStatus(String erStatus) {
this.erStatus = erStatus;
}
public String getSerStatus() {
return serStatus;
}
public void setSerStatus(String serStatus) {
this.serStatus = serStatus;
}
public String getchiefName() {
return chiefName;
}
public void setchiefName(String chiefName) {
this.chiefName = chiefName;
}
public Date getchiefDate() {
return chiefDate;
}
public void setchiefDate(Date chiefDate) {
this.chiefDate = chiefDate;
}
public String getchiefStatus() {
return chiefStatus;
}
public void setchiefStatus(String chiefStatus) {
this.chiefStatus = chiefStatus;
}
public String getRwName() {
return rwName;
}
public void setRwName(String rwName) {
this.rwName = rwName;
}
public Date getRwDate() {
return rwDate;
}
public void setRwDate(Date rwDate) {
this.rwDate = rwDate;
}
public String getRwStatus() {
return rwStatus;
}
public void setRwStatus(String rwStatus) {
this.rwStatus = rwStatus;
}
@Override
public String toString() {
return "DosrocharanAbedan{" + "applicationNo=" + applicationNo + ", jsonData=" + jsonData + ", enterBy=" + enterBy + ", enterDate=" + enterDate + ", aminiName=" + aminiName + ", aminiDate=" + aminiDate + ", aminiStatus=" + aminiStatus + ", serDate=" + serDate + ", serName=" + serName + ", erName=" + erName + ", erDate=" + erDate + ", erStatus=" + erStatus + ", serStatus=" + serStatus + ", chiefName=" + chiefName + ", chiefDate=" + chiefDate + ", chiefStatus=" + chiefStatus + ", rwName=" + rwName + ", rwDate=" + rwDate + ", rwStatus=" + rwStatus + '}';
}
@Column(name = "E_NAME", updatable = false)
private String eName;
@Column(name = "E_DATE", updatable = false)
@Temporal(TemporalType.DATE)
private java.util.Date eDate;
@Column(name = "E_STATUS", updatable = false, columnDefinition = "VARCHAR(1000) DEFAULT 'P'")
private String eStatus;
@Column(name = "F_NAME", updatable = false)
private String fName;
@Column(name = "F_DATE", updatable = false)
@Temporal(TemporalType.DATE)
private java.util.Date fDate;
@Column(name = "F_STATUS", updatable = false, columnDefinition = "VARCHAR(1000) DEFAULT 'P'")
private String fStatus;
@Column(name = "G_NAME", updatable = false)
private String gName;
@Column(name = "G_DATE", updatable = false)
@Temporal(TemporalType.DATE)
private java.util.Date gDate;
@Column(name = "G_STATUS", updatable = false, columnDefinition = "VARCHAR(1000) DEFAULT 'P'")
private String gStatus;
public String geteName() {
return eName;
}
public void seteName(String eName) {
this.eName = eName;
}
public Date geteDate() {
return eDate;
}
public void seteDate(Date eDate) {
this.eDate = eDate;
}
public String geteStatus() {
return eStatus;
}
public void seteStatus(String eStatus) {
this.eStatus = eStatus;
}
public String getfName() {
return fName;
}
public void setfName(String fName) {
this.fName = fName;
}
public Date getfDate() {
return fDate;
}
public void setfDate(Date fDate) {
this.fDate = fDate;
}
public String getfStatus() {
return fStatus;
}
public void setfStatus(String fStatus) {
this.fStatus = fStatus;
}
public String getgName() {
return gName;
}
public void setgName(String gName) {
this.gName = gName;
}
public Date getgDate() {
return gDate;
}
public void setgDate(Date gDate) {
this.gDate = gDate;
}
public String getgStatus() {
return gStatus;
}
public void setgStatus(String gStatus) {
this.gStatus = gStatus;
}
}
|
[
"bbikings@yahoo.com"
] |
bbikings@yahoo.com
|
7d9a4039235aad87941f7ade1f3d605bc8e1a317
|
e5c7c02675b43da0a0a1aa53d4b9074755714e54
|
/app/src/main/java/com/ying/administrator/masterappdemo/entity/Chat.java
|
598091afa4fc3df7a5ad83cf72019f301e7ee058
|
[] |
no_license
|
brmnh666/MasterApp
|
bde7b40c62ac17b733ddf9aebb0603a0f650feb2
|
5e1c6cf9276f7e03d0810bf34538f2b23163d50d
|
refs/heads/master
| 2021-06-25T01:37:13.758503
| 2020-01-14T07:34:04
| 2020-01-14T07:34:04
| 164,409,217
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 558
|
java
|
package com.ying.administrator.masterappdemo.entity;
import java.io.Serializable;
public class Chat implements Serializable {
private String question;
private String answer;
public Chat(String question) {
this.question = question;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
}
|
[
"765316930@qq.com"
] |
765316930@qq.com
|
ec7bdfbcda816c18ef5900fc90980b98ab5d6633
|
7df40f6ea2209b7d48979465fd8081ec2ad198cc
|
/TOOLS/server/org/fourthline/cling/support/model/dlna/types/NormalPlayTime.java
|
e1246ed4c946eafb47052fdf11e6f590996d967d
|
[
"IJG"
] |
permissive
|
warchiefmarkus/WurmServerModLauncher-0.43
|
d513810045c7f9aebbf2ec3ee38fc94ccdadd6db
|
3e9d624577178cd4a5c159e8f61a1dd33d9463f6
|
refs/heads/master
| 2021-09-27T10:11:56.037815
| 2021-09-19T16:23:45
| 2021-09-19T16:23:45
| 252,689,028
| 0
| 0
| null | 2021-09-19T16:53:10
| 2020-04-03T09:33:50
|
Java
|
UTF-8
|
Java
| false
| false
| 5,097
|
java
|
/* */ package org.fourthline.cling.support.model.dlna.types;
/* */
/* */ import java.util.Locale;
/* */ import java.util.concurrent.TimeUnit;
/* */ import java.util.regex.Matcher;
/* */ import java.util.regex.Pattern;
/* */ import org.fourthline.cling.model.types.InvalidValueException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class NormalPlayTime
/* */ {
/* */ public enum Format
/* */ {
/* 30 */ SECONDS,
/* 31 */ TIME;
/* */ }
/* 33 */ static final Pattern pattern = Pattern.compile("^(\\d+):(\\d{1,2}):(\\d{1,2})(\\.(\\d{1,3}))?|(\\d+)(\\.(\\d{1,3}))?$", 2);
/* */ private long milliseconds;
/* */
/* */ public NormalPlayTime(long milliseconds) {
/* 37 */ if (milliseconds < 0L) {
/* 38 */ throw new InvalidValueException("Invalid parameter milliseconds: " + milliseconds);
/* */ }
/* */
/* 41 */ this.milliseconds = milliseconds;
/* */ }
/* */
/* */ public NormalPlayTime(long hours, long minutes, long seconds, long milliseconds) throws InvalidValueException {
/* 45 */ if (hours < 0L) {
/* 46 */ throw new InvalidValueException("Invalid parameter hours: " + hours);
/* */ }
/* */
/* 49 */ if (minutes < 0L || minutes > 59L) {
/* 50 */ throw new InvalidValueException("Invalid parameter minutes: " + hours);
/* */ }
/* */
/* 53 */ if (seconds < 0L || seconds > 59L) {
/* 54 */ throw new InvalidValueException("Invalid parameter seconds: " + hours);
/* */ }
/* 56 */ if (milliseconds < 0L || milliseconds > 999L) {
/* 57 */ throw new InvalidValueException("Invalid parameter milliseconds: " + milliseconds);
/* */ }
/* */
/* 60 */ this.milliseconds = (hours * 60L * 60L + minutes * 60L + seconds) * 1000L + milliseconds;
/* */ }
/* */
/* */
/* */
/* */
/* */ public long getMilliseconds() {
/* 67 */ return this.milliseconds;
/* */ }
/* */
/* */
/* */
/* */
/* */ public void setMilliseconds(long milliseconds) {
/* 74 */ if (milliseconds < 0L) {
/* 75 */ throw new InvalidValueException("Invalid parameter milliseconds: " + milliseconds);
/* */ }
/* */
/* 78 */ this.milliseconds = milliseconds;
/* */ }
/* */
/* */ public String getString() {
/* 82 */ return getString(Format.SECONDS);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public String getString(Format format) {
/* 90 */ long hours, minutes, seconds = TimeUnit.MILLISECONDS.toSeconds(this.milliseconds);
/* 91 */ long ms = this.milliseconds % 1000L;
/* 92 */ switch (format) {
/* */ case TIME:
/* 94 */ seconds = TimeUnit.MILLISECONDS.toSeconds(this.milliseconds) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(this.milliseconds));
/* 95 */ hours = TimeUnit.MILLISECONDS.toHours(this.milliseconds);
/* 96 */ minutes = TimeUnit.MILLISECONDS.toMinutes(this.milliseconds) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(this.milliseconds));
/* 97 */ return String.format(Locale.ROOT, "%d:%02d:%02d.%03d", new Object[] { Long.valueOf(hours), Long.valueOf(minutes), Long.valueOf(seconds), Long.valueOf(ms) });
/* */ }
/* 99 */ return String.format(Locale.ROOT, "%d.%03d", new Object[] { Long.valueOf(seconds), Long.valueOf(ms) });
/* */ }
/* */
/* */
/* */ public static NormalPlayTime valueOf(String s) throws InvalidValueException {
/* 104 */ Matcher matcher = pattern.matcher(s);
/* 105 */ if (matcher.matches()) {
/* 106 */ int msMultiplier = 0;
/* */ try {
/* 108 */ if (matcher.group(1) != null) {
/* 109 */ msMultiplier = (int)Math.pow(10.0D, (3 - matcher.group(5).length()));
/* 110 */ return new NormalPlayTime(
/* 111 */ Long.parseLong(matcher.group(1)),
/* 112 */ Long.parseLong(matcher.group(2)),
/* 113 */ Long.parseLong(matcher.group(3)),
/* 114 */ Long.parseLong(matcher.group(5)) * msMultiplier);
/* */ }
/* 116 */ msMultiplier = (int)Math.pow(10.0D, (3 - matcher.group(8).length()));
/* 117 */ return new NormalPlayTime(
/* 118 */ Long.parseLong(matcher.group(6)) * 1000L + Long.parseLong(matcher.group(8)) * msMultiplier);
/* */ }
/* 120 */ catch (NumberFormatException numberFormatException) {}
/* */ }
/* */
/* 123 */ throw new InvalidValueException("Can't parse NormalPlayTime: " + s);
/* */ }
/* */ }
/* Location: C:\Users\leo\Desktop\server.jar!\org\fourthline\cling\support\model\dlna\types\NormalPlayTime.class
* Java compiler version: 7 (51.0)
* JD-Core Version: 1.1.3
*/
|
[
"warchiefmarkus@gmail.com"
] |
warchiefmarkus@gmail.com
|
d3fe82f566afa6f27ac24fddc6f0a6cda0efc0a7
|
c95c03f659007f347cc02e293faeb339eff85a59
|
/Corpus/hbase-rel-2.1.2/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/RefreshPeerProcedure.java
|
6fe7662bdd9e9e4de2b662852e5fe9c7f8dfdf71
|
[
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-protobuf",
"CC-BY-3.0",
"Apache-2.0"
] |
permissive
|
dormaayan/TestsReposirotry
|
e2bf6c247d933b278fcc47082afa7282dd916baa
|
75520c8fbbbd5f721f4c216ae7f142ec861e2c67
|
refs/heads/master
| 2020-04-11T21:34:56.287920
| 2019-02-06T13:34:31
| 2019-02-06T13:34:31
| 162,110,352
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,820
|
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.hadoop.hbase.master.replication;
import java.io.IOException;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv;
import org.apache.hadoop.hbase.master.procedure.PeerProcedureInterface;
import org.apache.hadoop.hbase.master.procedure.RSProcedureDispatcher.ServerOperation;
import org.apache.hadoop.hbase.procedure2.FailedRemoteDispatchException;
import org.apache.hadoop.hbase.procedure2.Procedure;
import org.apache.hadoop.hbase.procedure2.ProcedureEvent;
import org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer;
import org.apache.hadoop.hbase.procedure2.ProcedureSuspendedException;
import org.apache.hadoop.hbase.procedure2.ProcedureYieldException;
import org.apache.hadoop.hbase.procedure2.RemoteProcedureDispatcher.RemoteOperation;
import org.apache.hadoop.hbase.procedure2.RemoteProcedureDispatcher.RemoteProcedure;
import org.apache.hadoop.hbase.procedure2.RemoteProcedureException;
import org.apache.hadoop.hbase.replication.regionserver.RefreshPeerCallable;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationType;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.RefreshPeerParameter;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.RefreshPeerStateData;
@InterfaceAudience.Private
public class RefreshPeerProcedure extends Procedure<MasterProcedureEnv>
implements PeerProcedureInterface, RemoteProcedure<MasterProcedureEnv, ServerName> {
private static final Logger LOG = LoggerFactory.getLogger(RefreshPeerProcedure.class);
private String peerId;
private PeerOperationType type;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "IS2_INCONSISTENT_SYNC",
justification = "Will never change after construction")
private ServerName targetServer;
private boolean dispatched;
private ProcedureEvent<?> event;
private boolean succ;
public RefreshPeerProcedure() {
}
public RefreshPeerProcedure(String peerId, PeerOperationType type, ServerName targetServer) {
this.peerId = peerId;
this.type = type;
this.targetServer = targetServer;
}
@Override
public String getPeerId() {
return peerId;
}
@Override
public PeerOperationType getPeerOperationType() {
return PeerOperationType.REFRESH;
}
private static PeerModificationType toPeerModificationType(PeerOperationType type) {
switch (type) {
case ADD:
return PeerModificationType.ADD_PEER;
case REMOVE:
return PeerModificationType.REMOVE_PEER;
case ENABLE:
return PeerModificationType.ENABLE_PEER;
case DISABLE:
return PeerModificationType.DISABLE_PEER;
case UPDATE_CONFIG:
return PeerModificationType.UPDATE_PEER_CONFIG;
default:
throw new IllegalArgumentException("Unknown type: " + type);
}
}
private static PeerOperationType toPeerOperationType(PeerModificationType type) {
switch (type) {
case ADD_PEER:
return PeerOperationType.ADD;
case REMOVE_PEER:
return PeerOperationType.REMOVE;
case ENABLE_PEER:
return PeerOperationType.ENABLE;
case DISABLE_PEER:
return PeerOperationType.DISABLE;
case UPDATE_PEER_CONFIG:
return PeerOperationType.UPDATE_CONFIG;
default:
throw new IllegalArgumentException("Unknown type: " + type);
}
}
@Override
public RemoteOperation remoteCallBuild(MasterProcedureEnv env, ServerName remote) {
assert targetServer.equals(remote);
return new ServerOperation(this, getProcId(), RefreshPeerCallable.class,
RefreshPeerParameter.newBuilder().setPeerId(peerId).setType(toPeerModificationType(type))
.setTargetServer(ProtobufUtil.toServerName(remote)).build().toByteArray());
}
private void complete(MasterProcedureEnv env, Throwable error) {
if (event == null) {
LOG.warn("procedure event for {} is null, maybe the procedure is created when recovery",
getProcId());
return;
}
if (error != null) {
LOG.warn("Refresh peer {} for {} on {} failed", peerId, type, targetServer, error);
this.succ = false;
} else {
LOG.info("Refresh peer {} for {} on {} suceeded", peerId, type, targetServer);
this.succ = true;
}
event.wake(env.getProcedureScheduler());
event = null;
}
@Override
public synchronized boolean remoteCallFailed(MasterProcedureEnv env, ServerName remote,
IOException exception) {
complete(env, exception);
return true;
}
@Override
public synchronized void remoteOperationCompleted(MasterProcedureEnv env) {
complete(env, null);
}
@Override
public synchronized void remoteOperationFailed(MasterProcedureEnv env,
RemoteProcedureException error) {
complete(env, error);
}
@Override
protected synchronized Procedure<MasterProcedureEnv>[] execute(MasterProcedureEnv env)
throws ProcedureYieldException, ProcedureSuspendedException, InterruptedException {
if (dispatched) {
if (succ) {
return null;
}
// retry
dispatched = false;
}
try {
env.getRemoteDispatcher().addOperationToNode(targetServer, this);
} catch (FailedRemoteDispatchException frde) {
LOG.info("Can not add remote operation for refreshing peer {} for {} to {}, " +
"this is usually because the server is already dead, " +
"give up and mark the procedure as complete", peerId, type, targetServer, frde);
return null;
}
dispatched = true;
event = new ProcedureEvent<>(this);
event.suspendIfNotReady(this);
throw new ProcedureSuspendedException();
}
@Override
protected void rollback(MasterProcedureEnv env) throws IOException, InterruptedException {
throw new UnsupportedOperationException();
}
@Override
protected boolean abort(MasterProcedureEnv env) {
// TODO: no correctness problem if we just ignore this, implement later.
return false;
}
@Override
protected boolean waitInitialized(MasterProcedureEnv env) {
return env.waitInitialized(this);
}
@Override
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException {
serializer.serialize(
RefreshPeerStateData.newBuilder().setPeerId(peerId).setType(toPeerModificationType(type))
.setTargetServer(ProtobufUtil.toServerName(targetServer)).build());
}
@Override
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException {
RefreshPeerStateData data = serializer.deserialize(RefreshPeerStateData.class);
peerId = data.getPeerId();
type = toPeerOperationType(data.getType());
targetServer = ProtobufUtil.toServerName(data.getTargetServer());
}
}
|
[
"dor.d.ma@gmail.com"
] |
dor.d.ma@gmail.com
|
8fe266d69067a892584576b3785811e63de71a61
|
b88dedd8086d5b2e802ab6c25de38d83ce6173c8
|
/src/com/msi/tough/model/gi/ImageMetadataBean.java
|
578a4de420774d124f477c1bdbd580ec2f3f8306
|
[
"Apache-2.0"
] |
permissive
|
TranscendComputing/TopStackCore
|
92b3f24f1e60f15507ead6715412bb2657c34b1e
|
71760c895cef7314b10f5fcfbcaf9bea2a0bbce7
|
refs/heads/master
| 2021-01-15T23:35:12.138661
| 2013-10-28T19:33:45
| 2013-10-28T19:33:45
| 12,146,242
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,530
|
java
|
/*
* TopStack (c) Copyright 2012-2013 Transcend Computing, Inc.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.msi.tough.model.gi;
import javax.persistence.*;
import java.util.Set;
import com.msi.tough.model.gi.enums.*;
@Entity
@Table( name = "gi_image_metadata")
public class ImageMetadataBean {
@Id
@Column( name = "long_id")
@GeneratedValue (strategy = GenerationType.IDENTITY)
private long id;
@Column( name = "image_id")
private String image_id;
@Column( name = "type")
@Enumerated(EnumType.STRING)
private ImageType type;
@Column( name = "platform")
private String platform;
@Column( name = "os")
private String os;
@Column( name = "architecture")
private String architecture;
@ElementCollection
@Column( name = "associations")
private Set<String> associations;
@Column( name = "GoldenStatus")
@Enumerated(EnumType.STRING)
private GoldenStatus status;
@Column( name = "cloud")
private String cloud;
public ImageMetadataBean(){
}
public ImageMetadataBean(String image, String givenOS, String givenArch){
image_id = image;
if(image_id.contains("emi"))
type = ImageType.machine;
if(image_id.contains("eki"))
type = ImageType.kernel;
if(image_id.contains("eri"))
type = ImageType.ramdisk;
os = givenOS;
architecture = givenArch;
}
public ImageMetadataBean(String image, String givenOS, Set<String> assoc, GoldenStatus stamp){
image_id = image;
if(image_id.contains("emi"))
type = ImageType.machine;
if(image_id.contains("eki"))
type = ImageType.kernel;
if(image_id.contains("eri"))
type = ImageType.ramdisk;
os = givenOS;
associations = assoc;
status = stamp;
}
public long getId(){
return id;
}
public void setId(long givenId){
id = givenId;
}
public String getImage_id(){
return image_id;
}
public void setImage_id(String img){
image_id = img;
}
public ImageType getType(){
return type;
}
public void setType(ImageType givenType){
type = givenType;
}
public String getPlatform() {
return platform;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public String getOs(){
return os;
}
public void setOs(String os_name){
os = os_name;
}
public String getArchitecture() {
return architecture;
}
public void setArchitecture(String givenArch) {
architecture = givenArch;
}
public Set<String> getAssociations(){
return associations;
}
public void setAssociations(Set<String> assoc){
associations = assoc;
}
public GoldenStatus getStatus(){
return status;
}
public void setStatus(GoldenStatus newStatus){
status = newStatus;
}
public boolean isGolden(){
return status == GoldenStatus.accepted;
}
public void addAssociation(String newAssoc){
associations.add(newAssoc);
}
public void deleteAssociation(String delAssoc){
associations.remove(delAssoc);
}
public String getCloud() {
return cloud;
}
public void setCloud(String cloud) {
this.cloud = cloud;
}
}
|
[
"jgardner@transcendcomputing.com"
] |
jgardner@transcendcomputing.com
|
e642a87c7786e1fc4016064f8dda8293eae918fc
|
d49e3ff34467c71630681df5a791cb3e4bd72ab7
|
/src/android/support/v4/media/MediaBrowserCompat$MediaItem$1.java
|
df85b43c5bc59a28dd53ceca21136cd7a32fac20
|
[] |
no_license
|
reverseengineeringer/com.gogoair.ife
|
124691cf49e832f5dd8009ceb590894a7a058dfa
|
e88a26eec5640274844e6cdafcd706be727e8ae3
|
refs/heads/master
| 2020-09-15T19:45:27.094286
| 2016-09-01T13:32:34
| 2016-09-01T13:32:34
| 67,133,682
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 612
|
java
|
package android.support.v4.media;
import android.os.Parcel;
import android.os.Parcelable.Creator;
final class MediaBrowserCompat$MediaItem$1
implements Parcelable.Creator
{
public MediaBrowserCompat.MediaItem createFromParcel(Parcel paramParcel)
{
return new MediaBrowserCompat.MediaItem(paramParcel, null);
}
public MediaBrowserCompat.MediaItem[] newArray(int paramInt)
{
return new MediaBrowserCompat.MediaItem[paramInt];
}
}
/* Location:
* Qualified Name: android.support.v4.media.MediaBrowserCompat.MediaItem.1
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
8b590b142b0ba7ee8ba2d88e068e41f117a93333
|
9f10ae2158d4cbefc58e96fd1671eedde88e2b94
|
/common-http/src/test/java/com/lingdonge/http/webmagic/webmagic/selector/LinksSelectorTest.java
|
ee3befef64c6e9c478c67c04c6ff91291f58a9ef
|
[] |
no_license
|
shimaomao/java-utility
|
f8e322397938d83fcf3bde4f7f60bb157ee146f7
|
8fe3b197c6e94aacfcea8f6eebe9bd327b70d7b3
|
refs/heads/master
| 2020-06-19T22:44:54.139947
| 2019-06-12T06:34:03
| 2019-06-12T06:34:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 941
|
java
|
package com.lingdonge.http.webmagic.webmagic.selector;
import com.lingdonge.http.webmagic.selector.LinksSelector;
import org.jsoup.Jsoup;
import org.testng.annotations.Test;
import java.util.List;
/**
* @author code4crafter@gmail.com
* Date: 17/4/8
* Time: 下午9:41
*/
public class LinksSelectorTest {
private String html = "<div><a href='http://whatever.com/aaa'></a></div><div><a href='http://whatever.com/bbb'></a></div>";
@Test
public void testLinks() throws Exception {
LinksSelector linksSelector = new LinksSelector();
List<String> links = linksSelector.selectList(html);
System.out.println(links);
html = "<div><a href='aaa'></a></div><div><a href='http://whatever.com/bbb'></a></div><div><a href='http://other.com/bbb'></a></div>";
links = linksSelector.selectList(Jsoup.parse(html, "http://whatever.com/"));
System.out.println(links);
}
}
|
[
"hackerpayne@gmail.com"
] |
hackerpayne@gmail.com
|
e95646e9c64a2942699aea2f88d362448c4a738d
|
40d844c1c780cf3618979626282cf59be833907f
|
/src/testcases/CWE190_Integer_Overflow/s06/CWE190_Integer_Overflow__short_max_postinc_52c.java
|
5d819bb98b124216556ebebf592871ef5884bc5e
|
[] |
no_license
|
rubengomez97/juliet
|
f9566de7be198921113658f904b521b6bca4d262
|
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
|
refs/heads/master
| 2023-06-02T00:37:24.532638
| 2021-06-23T17:22:22
| 2021-06-23T17:22:22
| 379,676,259
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,845
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__short_max_postinc_52c.java
Label Definition File: CWE190_Integer_Overflow.label.xml
Template File: sources-sinks-52c.tmpl.java
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: max Set data to the max value for short
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: increment
* GoodSink: Ensure there will not be an overflow before incrementing data
* BadSink : Increment data, which can cause an overflow
* Flow Variant: 52 Data flow: data passed as an argument from one method to another to another in three different classes in the same package
*
* */
package testcases.CWE190_Integer_Overflow.s06;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE190_Integer_Overflow__short_max_postinc_52c
{
public void badSink(short data ) throws Throwable
{
/* POTENTIAL FLAW: if data == Short.MAX_VALUE, this will overflow */
data++;
short result = (short)(data);
IO.writeLine("result: " + result);
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(short data ) throws Throwable
{
/* POTENTIAL FLAW: if data == Short.MAX_VALUE, this will overflow */
data++;
short result = (short)(data);
IO.writeLine("result: " + result);
}
/* goodB2G() - use badsource and goodsink */
public void goodB2GSink(short data ) throws Throwable
{
/* FIX: Add a check to prevent an overflow from occurring */
if (data < Short.MAX_VALUE)
{
data++;
short result = (short)(data);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("data value is too large to increment.");
}
}
}
|
[
"you@example.com"
] |
you@example.com
|
d6d80928e8cfa24b170ddc4c0fb063bc702ad2d7
|
176c1f9b86e6bd360edc8430b962e9c25fa852cb
|
/src/main/java/org/jacop/examples/stochastic/StochasticTSP.java
|
2e822439289c6540959860728ab4d697efc70054
|
[] |
no_license
|
velarm/jacop
|
71b780f5ddb94e5211fae5a967573b4458829ff1
|
7e7b1d54bdfd475bbbd3327150bbc926997f617d
|
refs/heads/master
| 2020-12-14T09:02:41.053788
| 2013-10-28T10:24:11
| 2013-10-28T10:24:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,427
|
java
|
package org.jacop.examples.stochastic;
import java.util.ArrayList;
import java.util.Arrays;
import org.jacop.constraints.Circuit;
import org.jacop.constraints.Sum;
import org.jacop.constraints.XplusYeqC;
import org.jacop.core.IntVar;
import org.jacop.core.Store;
import org.jacop.examples.fd.ExampleFD;
import org.jacop.search.DepthFirstSearch;
import org.jacop.search.IndomainMin;
import org.jacop.search.SelectChoicePoint;
import org.jacop.search.SimpleSelect;
import org.jacop.search.PrintOutListener;
import org.jacop.stochastic.constraints.Element;
import org.jacop.stochastic.constraints.Expectation;
import org.jacop.stochastic.constraints.PrOfElement;
import org.jacop.stochastic.core.StochasticVar;
/**
* Implements a Stochastic Travelling Salesman Problem where
* the weights (travelling times) between the cities (nodes)
* are stochastic variables.
*/
public class StochasticTSP extends ExampleFD{
/**
* Generates a StochasticTSP instance.
*/
public void model() {
store = new Store();
vars = new ArrayList<IntVar>();
int noCities = 5;
int res = 1000;
StochasticVar[][] distance = new StochasticVar[noCities][noCities];
for (int i = 0; i < noCities; i++) {
for (int j = 0; j < noCities; j++){
if (i == j)
distance[i][j] = new StochasticVar(store, "distance["+ i + "][" + j + "]", true, 1, 1000, 1000);
else
distance[i][j] = new StochasticVar(store, "distance["+ i + "][" + j + "]", true, 3, 10, 150);
//System.out.println(distance[i][j]);
}
}
IntVar[] cities = new IntVar[noCities];
IntVar[] Ecosts = new IntVar[noCities];
for (int i = 0; i < cities.length; i++) {
cities[i] = new IntVar(store, "cities" + i, 1, cities.length);
Ecosts[i] = new IntVar(store, "Ecosts" + i, 0 , 1000000);
vars.add(cities[i]);
//vars.add(Ecosts[i]);
}
IntVar[][] Ps = new IntVar[cities.length][];
StochasticVar[] costs = new StochasticVar[noCities];
for (int i = 0; i < cities.length; i++){
costs[i] = new StochasticVar(store, "costs"+i, distance);
Ps[i] = new IntVar[costs[i].getSize()];
for (int j=0; j < costs[i].getSize(); j++){
Ps[i][j] = new IntVar(store, "PEl"+ i + "_" + costs[i].dom().values[j], 0, res);
//vars.add(Ps[i][j]);
}
store.impose(new PrOfElement(costs[i], costs[i].dom().values, Ps[i], res));
}
store.impose(new Circuit(cities));
for (int i = 0; i < cities.length; i++) {
//System.out.println("Element)"+cities[i]+", "+ Arrays.asList(distance[i]) + ", "+ costs[i]+")");
store.impose(new Element(cities[i], distance[i], costs[i], 1));
store.imposeDecomposition(new Expectation(Ps[i], costs[i].dom().values, Ecosts[i]));
}
IntVar goal = new IntVar(store, "goal", 0, 1000000);
vars.add(goal);
store.impose(new Sum(Ecosts, goal));
IntVar goalNegation= new IntVar(store, "goalNegation", -1000000, 0);
store.impose(new XplusYeqC(goal, goalNegation, 0));
cost = goalNegation;
}
/**
* It executes the program to solve this Travelling Salesman Problem.
* @param args no argument is used.
*/
public static void main(String args[]) {
StochasticTSP example = new StochasticTSP();
example.model();
if (example.searchAllAtOnce()) {
System.out.println("Solution(s) found");
}
//example.search.printAllSolutions();
}
/**
* It specifies simple search method based on most constrained static and lexigraphical
* ordering of values. It searches for all solutions.
*
* @return true if there is a solution, false otherwise.
*/
@Override
public boolean searchAllAtOnce() {
long T1, T2;
T1 = System.currentTimeMillis();
SelectChoicePoint<IntVar> select = new SimpleSelect<IntVar>(vars.toArray(new IntVar[1]),
null, new IndomainMin<IntVar>());
search = new DepthFirstSearch<IntVar>();
search.setSolutionListener(new PrintOutListener<IntVar>());
search.getSolutionListener().searchAll(true);
search.getSolutionListener().recordSolutions(true);
search.setAssignSolution(true);
boolean result = search.labeling(store, select);
T2 = System.currentTimeMillis();
if (result) {
System.out.println("Number of solutions " + search.getSolutionListener().solutionsNo());
//search.printAllSolutions();
}
else
System.out.println("Failed to find any solution");
System.out.println("\n\t*** Execution time = " + (T2 - T1) + " ms");
return result;
}
}
|
[
"radoslaw.szymanek@gmail.com"
] |
radoslaw.szymanek@gmail.com
|
fdac5a48845e197f1138fc7e29bec146c1e82ba2
|
a4724c64fef0feb5db66388668c33262248cc388
|
/Spectrum-based_FaultLoc_MT/SpecBased_FaultLoc_MT/src/jointPackage_CPL2SPL/SrcSwitchedPriority.java
|
4045fd05d899a5239c9a6d9cf1345755d1cac7b7
|
[] |
no_license
|
tigerqiu712/SBFL_MT
|
10ba85e255dd53e7d3664d1a3de5508f06b55f9a
|
6f623acab0d4b673314feca58d72cac705dc0967
|
refs/heads/master
| 2020-03-26T22:47:52.458481
| 2017-10-10T07:30:59
| 2017-10-10T07:30:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,213
|
java
|
/**
*/
package jointPackage_CPL2SPL;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Src Switched Priority</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link jointPackage_CPL2SPL.SrcSwitchedPriority#getLess <em>Less</em>}</li>
* <li>{@link jointPackage_CPL2SPL.SrcSwitchedPriority#getGreater <em>Greater</em>}</li>
* <li>{@link jointPackage_CPL2SPL.SrcSwitchedPriority#getEqual <em>Equal</em>}</li>
* </ul>
*
* @see jointPackage_CPL2SPL.JointPackage_CPL2SPLPackage#getSrcSwitchedPriority()
* @model
* @generated
*/
public interface SrcSwitchedPriority extends SrcNodeContainer {
/**
* Returns the value of the '<em><b>Less</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Less</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Less</em>' attribute.
* @see #setLess(String)
* @see jointPackage_CPL2SPL.JointPackage_CPL2SPLPackage#getSrcSwitchedPriority_Less()
* @model unique="false" ordered="false"
* @generated
*/
String getLess();
/**
* Sets the value of the '{@link jointPackage_CPL2SPL.SrcSwitchedPriority#getLess <em>Less</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Less</em>' attribute.
* @see #getLess()
* @generated
*/
void setLess(String value);
/**
* Returns the value of the '<em><b>Greater</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Greater</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Greater</em>' attribute.
* @see #setGreater(String)
* @see jointPackage_CPL2SPL.JointPackage_CPL2SPLPackage#getSrcSwitchedPriority_Greater()
* @model unique="false" ordered="false"
* @generated
*/
String getGreater();
/**
* Sets the value of the '{@link jointPackage_CPL2SPL.SrcSwitchedPriority#getGreater <em>Greater</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Greater</em>' attribute.
* @see #getGreater()
* @generated
*/
void setGreater(String value);
/**
* Returns the value of the '<em><b>Equal</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Equal</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Equal</em>' attribute.
* @see #setEqual(String)
* @see jointPackage_CPL2SPL.JointPackage_CPL2SPLPackage#getSrcSwitchedPriority_Equal()
* @model unique="false" ordered="false"
* @generated
*/
String getEqual();
/**
* Sets the value of the '{@link jointPackage_CPL2SPL.SrcSwitchedPriority#getEqual <em>Equal</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Equal</em>' attribute.
* @see #getEqual()
* @generated
*/
void setEqual(String value);
} // SrcSwitchedPriority
|
[
"jtroya@us.es"
] |
jtroya@us.es
|
89de70e25883ccc20d135d637f890494d918cb0f
|
d5c5cfe894ae5833918bd396c5bd01fc8a1a8ffa
|
/orig/fitlibrary/fitlibrary-2.0-cloned-from-sourceforge/src/fitlibrary/runner/CopyFiles.java
|
b042fa1b256a25ba561694c34ebd2567181ee8b7
|
[] |
no_license
|
afamee/DbFit-deps
|
80db2fc3919c30b900c01012788d293ea5e1c07c
|
2610dfc6f4573e3eda3a8c68369d23b4571547da
|
refs/heads/master
| 2020-04-02T18:28:37.519147
| 2015-07-11T13:55:42
| 2015-07-11T13:55:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,521
|
java
|
/*
* Copyright (c) 2006 Rick Mugridge, www.RimuResearch.com
* Released under the terms of the GNU General Public License version 2 or later.
*/
package fitlibrary.runner;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class CopyFiles {
public static void copyFilesRecursively(File sourceFiles, File targetFiles, String diryName) throws IOException, SecurityException {
if (!targetFiles.exists())
targetFiles.mkdir();
File targetDiry = new File(targetFiles,diryName);
targetDiry.mkdir();
copyFilesRecursively(new File(sourceFiles,diryName),targetDiry);
}
private static void copyFilesRecursively(File sourceDiry, File targetDiry) throws IOException, SecurityException {
File[] files = sourceDiry.listFiles();
for (int i = 0; i < files.length; i++) {
File file = files[i];
File target = new File(targetDiry,file.getName());
if (file.isDirectory()) {
target.mkdir();
copyFilesRecursively(file,target);
}
else
copyFile(file,target);
}
}
private static void copyFile(File source, File target) throws IOException {
BufferedInputStream reader = new BufferedInputStream(new FileInputStream(source));
BufferedOutputStream writer = new BufferedOutputStream(new FileOutputStream(target));
while (true) {
int in = reader.read();
if (in < 0)
break;
writer.write(in);
}
reader.close();
writer.close();
}
}
|
[
"mark_matten@hotmail.com"
] |
mark_matten@hotmail.com
|
161a11c93a7b34d65c32247cc35b9270ea313b4a
|
beffc6542dc4bf85946ceca7cca4a31ac230d376
|
/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java
|
8fe8430f482dd7d8c167d255684e1eb78712cb4e
|
[
"Apache-2.0"
] |
permissive
|
ZhouKaiDongGitHub/spring-boot-2.0.x
|
4395970b183eff7321748d4ad0155784aa94eaa6
|
3f443764747c4ee01085bed6381292fa44744a49
|
refs/heads/master
| 2023-01-07T07:27:51.067468
| 2020-09-13T07:13:04
| 2020-09-13T07:13:04
| 215,676,265
| 1
| 0
|
Apache-2.0
| 2022-12-27T14:52:46
| 2019-10-17T01:24:02
|
Java
|
UTF-8
|
Java
| false
| false
| 5,726
|
java
|
/*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.gradle.plugin;
import java.io.File;
import java.io.IOException;
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Arrays;
import java.util.List;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import org.gradle.api.GradleException;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.ResolvableDependencies;
import org.gradle.util.GradleVersion;
import org.springframework.boot.gradle.dsl.SpringBootExtension;
import org.springframework.boot.gradle.tasks.bundling.BootJar;
import org.springframework.boot.gradle.tasks.bundling.BootWar;
/**
* Gradle plugin for Spring Boot.
*
* @author Phillip Webb
* @author Dave Syer
* @author Andy Wilkinson
* @author Danny Hyun
* @since 1.2.7
*/
public class SpringBootPlugin implements Plugin<Project> {
private static final String SPRING_BOOT_VERSION = determineSpringBootVersion();
/**
* The name of the {@link Configuration} that contains Spring Boot archives.
* @since 2.0.0
*/
public static final String BOOT_ARCHIVES_CONFIGURATION_NAME = "bootArchives";
/**
* The name of the default {@link BootJar} task.
* @since 2.0.0
*/
public static final String BOOT_JAR_TASK_NAME = "bootJar";
/**
* The name of the default {@link BootWar} task.
* @since 2.0.0
*/
public static final String BOOT_WAR_TASK_NAME = "bootWar";
/**
* The coordinates {@code (group:name:version)} of the
* {@code spring-boot-dependencies} bom.
*/
public static final String BOM_COORDINATES = "org.springframework.boot:spring-boot-dependencies:"
+ SPRING_BOOT_VERSION;
@Override
public void apply(Project project) {
verifyGradleVersion();
createExtension(project);
Configuration bootArchives = createBootArchivesConfiguration(project);
registerPluginActions(project, bootArchives);
unregisterUnresolvedDependenciesAnalyzer(project);
}
private void verifyGradleVersion() {
if (GradleVersion.current().compareTo(GradleVersion.version("4.0")) < 0) {
throw new GradleException("Spring Boot plugin requires Gradle 4.0 or later." + " The current version is "
+ GradleVersion.current());
}
}
private void createExtension(Project project) {
project.getExtensions().create("springBoot", SpringBootExtension.class, project);
}
private Configuration createBootArchivesConfiguration(Project project) {
Configuration bootArchives = project.getConfigurations().create(BOOT_ARCHIVES_CONFIGURATION_NAME);
bootArchives.setDescription("Configuration for Spring Boot archive artifacts.");
return bootArchives;
}
private void registerPluginActions(Project project, Configuration bootArchives) {
SinglePublishedArtifact singlePublishedArtifact = new SinglePublishedArtifact(bootArchives.getArtifacts());
List<PluginApplicationAction> actions = Arrays.asList(new JavaPluginAction(singlePublishedArtifact),
new WarPluginAction(singlePublishedArtifact), new MavenPluginAction(bootArchives.getUploadTaskName()),
new DependencyManagementPluginAction(), new ApplicationPluginAction(), new KotlinPluginAction());
for (PluginApplicationAction action : actions) {
Class<? extends Plugin<? extends Project>> pluginClass = action.getPluginClass();
if (pluginClass != null) {
project.getPlugins().withType(pluginClass, (plugin) -> action.execute(project));
}
}
}
private void unregisterUnresolvedDependenciesAnalyzer(Project project) {
UnresolvedDependenciesAnalyzer unresolvedDependenciesAnalyzer = new UnresolvedDependenciesAnalyzer();
project.getConfigurations().all((configuration) -> {
ResolvableDependencies incoming = configuration.getIncoming();
incoming.afterResolve((resolvableDependencies) -> {
if (incoming.equals(resolvableDependencies)) {
unresolvedDependenciesAnalyzer.analyze(configuration.getResolvedConfiguration()
.getLenientConfiguration().getUnresolvedModuleDependencies());
}
});
});
project.getGradle().buildFinished((buildResult) -> unresolvedDependenciesAnalyzer.buildFinished(project));
}
private static String determineSpringBootVersion() {
String implementationVersion = DependencyManagementPluginAction.class.getPackage().getImplementationVersion();
if (implementationVersion != null) {
return implementationVersion;
}
URL codeSourceLocation = DependencyManagementPluginAction.class.getProtectionDomain().getCodeSource()
.getLocation();
try {
URLConnection connection = codeSourceLocation.openConnection();
if (connection instanceof JarURLConnection) {
return getImplementationVersion(((JarURLConnection) connection).getJarFile());
}
try (JarFile jarFile = new JarFile(new File(codeSourceLocation.toURI()))) {
return getImplementationVersion(jarFile);
}
}
catch (Exception ex) {
return null;
}
}
private static String getImplementationVersion(JarFile jarFile) throws IOException {
return jarFile.getManifest().getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_VERSION);
}
}
|
[
"Kaidong.Zhou@eisgroup.com"
] |
Kaidong.Zhou@eisgroup.com
|
ba65a273ac227e6ae84bb124f044ce0074d3a39a
|
11d6020b70c4ba465abd976a5aed866bcf9c4fac
|
/src/com/fameden/model/FamedenLoginRequest.java
|
a3e35941cc4a6034ac259b8b97f3efbb702e4799
|
[] |
no_license
|
ravjot28/FameDenWebService
|
e19a5f86c0fc296b65fc76d35d5ebfdf758e305b
|
fdc96092a5f00d85c01eb96a9b904443dbfad464
|
refs/heads/master
| 2021-01-20T11:23:13.636142
| 2013-10-20T15:44:37
| 2013-10-20T15:44:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 435
|
java
|
package com.fameden.model;
public class FamedenLoginRequest extends GenericRequest {
private String password;
private String loginMode;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getLoginMode() {
return loginMode;
}
public void setLoginMode(String loginMode) {
this.loginMode = loginMode;
}
}
|
[
"ravjot28@gmail.com"
] |
ravjot28@gmail.com
|
f24d76c05a9029ccc7442b33bfcb818b627a032d
|
6252c165657baa6aa605337ebc38dd44b3f694e2
|
/org.eclipse.epsilon.egl.sync/Scalability-Tests/boiler-To-Generate-900-Files/boiler-To-Generate-900-Files/syncregions-900Files/TemperatureController4168.java
|
fed41906766561591eb5a1c0a27c3fb09e4228e3
|
[] |
no_license
|
soha500/EglSync
|
00fc49bcc73f7f7f7fb7641d0561ca2b9a8ea638
|
55101bc781349bb14fefc178bf3486e2b778aed6
|
refs/heads/master
| 2021-06-23T02:55:13.464889
| 2020-12-11T19:10:01
| 2020-12-11T19:10:01
| 139,832,721
| 0
| 1
| null | 2019-05-31T11:34:02
| 2018-07-05T10:20:00
|
Java
|
UTF-8
|
Java
| false
| false
| 367
|
java
|
package syncregions;
public class TemperatureController4168 {
public execute(int temperature4168, int targetTemperature4168) {
//sync _bfpnFUbFEeqXnfGWlV4168, behaviour
1-if(temperatureDifference > 0 && boilerStatus == true) { return 1; } else if (temperatureDifference < 0 && boilerStatus == false) { return 2; } else return 0;
//endSync
}
}
|
[
"sultanalmutairi@172.20.10.2"
] |
sultanalmutairi@172.20.10.2
|
4267839e2dfbfb77e2d958c69729ff01125b1983
|
a1fe6aece3e4816563f5a39dd2b9c11b21235980
|
/modules/global/src/com/haulmont/cuba/security/entity/PermissionType.java
|
8977c1c55f22c39a4adf75170f8a06b1c5a40658
|
[
"Apache-2.0"
] |
permissive
|
ayahuascabufo/cuba
|
262100b6801e6f089adea7e252fd799be1fe9d9c
|
be47db01d4553e151bb463db6824aa12ebdade4d
|
refs/heads/master
| 2021-09-02T00:39:31.547974
| 2017-12-29T12:39:47
| 2017-12-29T12:40:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,773
|
java
|
/*
* Copyright (c) 2008-2016 Haulmont.
*
* 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.haulmont.cuba.security.entity;
import com.haulmont.chile.core.datatypes.impl.EnumClass;
import org.apache.commons.lang.ObjectUtils;
/**
* Type of permission. <br>
* {@link #id} - corresponding value stored in the database
*/
public enum PermissionType implements EnumClass<Integer> {
/** Permission to screen */
SCREEN(10),
/** Permission to entity operation (see {@link EntityOp}) */
ENTITY_OP(20),
/** Permission to entity attribute (see {@link EntityAttrAccess}) */
ENTITY_ATTR(30),
/** Application-specific permission */
SPECIFIC(40),
/** Permissions for UI components in screens */
UI(50);
private int id;
PermissionType(int id) {
this.id = id;
}
/** Returns corresponding database value */
@Override
public Integer getId() {
return id;
}
/** Constructs type from corresponding database value */
public static PermissionType fromId(Integer id) {
for (PermissionType type : PermissionType.values()) {
if (ObjectUtils.equals(type.getId(), id)) {
return type;
}
}
return null;
}
}
|
[
"artamonov@haulmont.com"
] |
artamonov@haulmont.com
|
28c1581c8f936f57d61a5d948f76a4b2775e3be0
|
88252dad1b411dd2a580f1182af707d0c0981841
|
/JavaSE210301/day13/src/com/atguigu/exer/ScoreTest.java
|
a3dbeabf3ac0e8dbff31e2044eb645ed03264a08
|
[] |
no_license
|
FatterXiao/myJavaLessons
|
37db50d24cbcc5524e5b8060803ab08ab3b3ac0c
|
fa6ff208b46048527b899001561bd952f48bbe15
|
refs/heads/main
| 2023-04-20T09:18:06.694611
| 2021-04-29T10:18:30
| 2021-04-29T10:18:30
| 347,562,482
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,626
|
java
|
package com.atguigu.exer;
import java.util.Scanner;
import java.util.Vector;
/**
* 利用Vector代替数组处理:从键盘读入学生成绩(以负数代表输入结束),找出最高分,
* 并输出学生成绩等级。
* <p>
* 提示:数组一旦创建,长度就固定不变,所以在创建数组前就需要知道它的长度。
* 而向量类java.util.Vector可以根据需要动态伸缩。
* <p>
* 创建Vector对象:Vector v=new Vector();
* 给向量添加元素:v.addElement(Object obj); //obj必须是对象
* 取出向量中的元素:Object obj=v.elementAt(0);
* 注意第一个元素的下标是0,返回值是Object类型的。
* 计算向量的长度:v.size();
* 若与最高分相差10分内:A等;20分内:B等;
* 30分内:C等;其它:D等
*
* @author shkstart
* @create 11:12
*/
public class ScoreTest {
public static void main(String[] args) {
//1. 实例化Vector
Vector v = new Vector();
//2. 实例化Scanner
Scanner scann = new Scanner(System.in);
//3. 通过循环的方式,多次从键盘获取学生成绩
int maxScore = 0;//记录最高分
for(;;){
System.out.println("请输入学生的成绩(以负数代表输入结束):");
int score = scann.nextInt();
//判断score是否是负数,如果是,退出循环
if(score < 0){
break;
}
//4. 调用Vector的addElement(Object obj)
//方式1:
// v.add(new Integer(score));//jdk5.0之前的做法
//方式2:
v.addElement(score);//自动装箱
//5. 获取学生成绩的最高分
if(maxScore < score){
maxScore = score;
}
}
//6. 遍历各个学生的成绩,并根据其与最高分的差值,计算等级
for(int i = 0; i < v.size();i++){
char grade;
//jdk5之前的做法
// Object obj = v.elementAt(i);
// Integer int1 = (Integer) obj;
// int score = int1.intValue();
//jdk5及之后的做法
int score = (int) v.elementAt(i);
if(score >= maxScore - 10){
grade = 'A';
}else if(score >= maxScore - 20){
grade = 'B';
}else if(score >= maxScore - 30){
grade = 'C';
}else{
grade = 'D';
}
System.out.println("student " + i +" score is " + score + " grade is " + grade);
}
}
}
|
[
"xuweijunxinlan@yeah.net"
] |
xuweijunxinlan@yeah.net
|
44c37d454ec566caf71478d9f05fb7de76ce5dab
|
f092877c3dc58880dbc648aaeed3e424ba4a61fc
|
/src/main/java/exercises/ex1_lambda/SerialData.java
|
a10a2cb66333bd4e8a2b13368e465989b3ac6022
|
[] |
no_license
|
MikiKru/java_adv_sda
|
a39f645fd54242fbfb814bdce8cf83bc96a0bfb7
|
b489fa0a97cadc8da9582bc8a51b57ff43d3a177
|
refs/heads/master
| 2023-04-18T23:35:09.259072
| 2021-04-26T13:57:29
| 2021-04-26T13:57:29
| 359,376,985
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 990
|
java
|
package exercises.ex1_lambda;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public interface SerialData {
Video v1 = new Video("GOT1", "got1.com", VideoType.CLIP);
Video v2 = new Video("GOT2", "got2.com", VideoType.EPISODE);
Video v3 = new Video("GOT3", "got3.com", VideoType.PREVIEW);
Video v4 = new Video("GOT4", "got4.com", VideoType.PREVIEW);
Video v5 = new Video("GOT5", "got5.com", VideoType.CLIP);
Video v6 = new Video("GOT6", "got6.com", VideoType.EPISODE);
Episode e1 = new Episode("got1", 1, new ArrayList<>(Arrays.asList(v1,v2)));
Episode e2 = new Episode("got2", 2, new ArrayList<>(Arrays.asList(v3,v4)));
Episode e3 = new Episode("got3", 2, new ArrayList<>(Arrays.asList(v5,v6)));
Season s1 = new Season("GOTS1", 1, new ArrayList<>(Arrays.asList(e1,e2)));
Season s2 = new Season("GOTS2", 2, new ArrayList<>(Arrays.asList(e3)));
List<Season> seasons = new ArrayList<>(Arrays.asList(s1, s2));
}
|
[
"michal_kruczkowski@o2.pl"
] |
michal_kruczkowski@o2.pl
|
5ec724700bdcf81bd077f46b8631401e852f707c
|
0857e94d17e6e0a01ec82530761fd73dc5be11e5
|
/db/src/main/java/org/solovyev/android/db/ListMapper.java
|
acbc7efc47efefb0e6dd523c35419d2fc60ccb76
|
[
"Apache-2.0"
] |
permissive
|
FlakyTestDetection/android-common
|
634195e98de7d6cd3b938daa532c0be2ab4ee3aa
|
8bc7bc5af88d36f9af488ca8e01391df3299d92b
|
refs/heads/master
| 2021-01-20T06:38:32.480599
| 2017-09-11T12:34:05
| 2017-09-11T12:34:05
| 89,903,660
| 0
| 0
| null | 2017-05-01T06:46:29
| 2017-05-01T06:46:29
| null |
UTF-8
|
Java
| false
| false
| 1,559
|
java
|
/*
* Copyright 2013 serso aka se.solovyev
*
* 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.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.db;
import android.database.Cursor;
import org.solovyev.common.Converter;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
/**
* User: serso
* Date: 6/3/12
* Time: 4:43 PM
*/
public class ListMapper<T> implements Converter<Cursor, List<T>> {
@Nonnull
private final Converter<Cursor, ? extends T> elementMapper;
public ListMapper(@Nonnull Converter<Cursor, ? extends T> elementMapper) {
this.elementMapper = elementMapper;
}
@Nonnull
@Override
public List<T> convert(@Nonnull Cursor cursor) {
final List<T> result = new ArrayList<T>();
if (cursor.moveToFirst()) {
while (!cursor.isAfterLast()) {
result.add(elementMapper.convert(cursor));
cursor.moveToNext();
}
}
return result;
}
}
|
[
"se.solovyev@gmail.com"
] |
se.solovyev@gmail.com
|
fafb448e29a5fa6e424e6e9c3edef3a6fddd1b43
|
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
|
/WeaselWeb/src/com/puttysoftware/weaselweb/maze/effects/CounterPoisoned.java
|
3f69476942a0f8f99629bfaf746aa4acbd202ab9
|
[
"Unlicense"
] |
permissive
|
retropipes/older-java-games
|
777574e222f30a1dffe7936ed08c8bfeb23a21ba
|
786b0c165d800c49ab9977a34ec17286797c4589
|
refs/heads/master
| 2023-04-12T14:28:25.525259
| 2021-05-15T13:03:54
| 2021-05-15T13:03:54
| 235,693,016
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,070
|
java
|
/* WeaselWeb: A Maze-Solving Game
Copyright (C) 2008-2010 Eric Ahnell
Any questions should be directed to the author via email at: products@puttysoftware.com
*/
package com.puttysoftware.weaselweb.maze.effects;
import com.puttysoftware.weaselweb.WeaselWeb;
import com.puttysoftware.weaselweb.maze.objects.CounterpoisonAmulet;
public class CounterPoisoned extends MazeEffect {
// Constructor
public CounterPoisoned(final int newRounds) {
super("Counter-Poisoned", newRounds);
}
@Override
public void customExtendLogic() {
// Apply the effect
WeaselWeb.getApplication().getMazeManager().getMaze()
.doCounterpoisonAmulet();
}
@Override
public void customTerminateLogic() {
// Remove item that granted effect from inventory
WeaselWeb.getApplication().getGameManager().getObjectInventory()
.removeItem(new CounterpoisonAmulet());
// Undo the effect
WeaselWeb.getApplication().getMazeManager().getMaze()
.undoPoisonAmulets();
}
}
|
[
"eric.ahnell@puttysoftware.com"
] |
eric.ahnell@puttysoftware.com
|
d2ddb687fa4c0dd862c1cc98424fe0f1236ca3c0
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/MOCKITO-3b-5-25-NSGA_II-WeightedSum:TestLen:CallDiversity/org/mockito/internal/verification/Times_ESTest.java
|
f08ef5ee069a703742ec7d628cb12f17ce1030c0
|
[] |
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
| 550
|
java
|
/*
* This file was automatically generated by EvoSuite
* Wed Apr 01 09:08:57 UTC 2020
*/
package org.mockito.internal.verification;
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 Times_ESTest extends Times_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
b0fd33113492ebd4dfe832f702eb2d91a3f15131
|
569519e9c9d13b6d57ae328817bcadc10f4eb5d8
|
/src/com/sun/ts/lib/implementation/sun/javaee/runtime/ejb/SunEjbJar.java
|
1e1de55156c85fa33381715c80bce397f8c4d1f5
|
[] |
no_license
|
dblevins/jakartaeetck-8.0.2
|
eaf8db78c4538163076187c861d2f10e12a329f4
|
7006f6ad04fc6716a2b49934cbb6078174e88931
|
refs/heads/main
| 2023-04-04T16:45:51.006672
| 2021-04-07T18:42:03
| 2021-04-07T18:42:03
| 355,641,241
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,668
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// 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: 2020.01.14 at 10:40:54 PM UTC
//
package com.sun.ts.lib.implementation.sun.javaee.runtime.ejb;
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.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"securityRoleMapping",
"enterpriseBeans"
})
@XmlRootElement(name = "sun-ejb-jar")
public class SunEjbJar
implements Serializable
{
private final static long serialVersionUID = 1L;
@XmlElement(name = "security-role-mapping")
protected List<SecurityRoleMapping> securityRoleMapping;
@XmlElement(name = "enterprise-beans", required = true)
protected EnterpriseBeans enterpriseBeans;
/**
* Gets the value of the securityRoleMapping 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 securityRoleMapping property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSecurityRoleMapping().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SecurityRoleMapping }
*
*
*/
public List<SecurityRoleMapping> getSecurityRoleMapping() {
if (securityRoleMapping == null) {
securityRoleMapping = new ArrayList<SecurityRoleMapping>();
}
return this.securityRoleMapping;
}
/**
* Gets the value of the enterpriseBeans property.
*
* @return
* possible object is
* {@link EnterpriseBeans }
*
*/
public EnterpriseBeans getEnterpriseBeans() {
return enterpriseBeans;
}
/**
* Sets the value of the enterpriseBeans property.
*
* @param value
* allowed object is
* {@link EnterpriseBeans }
*
*/
public void setEnterpriseBeans(EnterpriseBeans value) {
this.enterpriseBeans = value;
}
}
|
[
"david.blevins@gmail.com"
] |
david.blevins@gmail.com
|
c655faff0546a91c6289bccc903515c2f5341129
|
5c819746334d7bcd57df6a3ab5c2def322d4e9cb
|
/src/main/java/org/everit/atlassian/restclient/jiracloud/v2/model/Priority.java
|
51848c999262d9055a5832f2d2cbbe2141a02137
|
[
"Apache-2.0"
] |
permissive
|
zhangyongjiang/atlassian-restclient-jiracloud
|
56641bf8561e73d61f03039e42bceae11e9d930a
|
7fecff5647a06f54a080cf277458e0f2ac120ee1
|
refs/heads/master
| 2020-09-07T06:17:33.471821
| 2019-10-31T13:14:36
| 2019-10-31T13:14:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,270
|
java
|
/*
* Copyright © 2011 Everit Kft. (http://www.everit.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* The Jira Cloud platform REST API
* Jira Cloud platform REST API documentation
*
* The version of the OpenAPI document: 1001.0.0-SNAPSHOT
* Contact: ecosystem@atlassian.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.everit.atlassian.restclient.jiracloud.v2.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
/**
* An issue priority.
*/
@ApiModel(description = "An issue priority.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-05T12:17:30.184+02:00[Europe/Prague]")
public class Priority {
@JsonProperty("self")
private String self;
@JsonProperty("statusColor")
private String statusColor;
@JsonProperty("description")
private String description;
@JsonProperty("iconUrl")
private String iconUrl;
@JsonProperty("name")
private String name;
@JsonProperty("id")
private String id;
private HashMap<String, Object> additionalProperties_ = new HashMap<String, Object>();
public Priority self(String self) {
this.self = self;
return this;
}
/**
* The URL of the issue priority.
* @return self
**/
@ApiModelProperty(value = "The URL of the issue priority.")
public String getSelf() {
return self;
}
public void setSelf(String self) {
this.self = self;
}
public Priority statusColor(String statusColor) {
this.statusColor = statusColor;
return this;
}
/**
* The color used to indicate the issue priority.
* @return statusColor
**/
@ApiModelProperty(value = "The color used to indicate the issue priority.")
public String getStatusColor() {
return statusColor;
}
public void setStatusColor(String statusColor) {
this.statusColor = statusColor;
}
public Priority description(String description) {
this.description = description;
return this;
}
/**
* The description of the issue priority.
* @return description
**/
@ApiModelProperty(value = "The description of the issue priority.")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Priority iconUrl(String iconUrl) {
this.iconUrl = iconUrl;
return this;
}
/**
* The URL of the icon for the issue priority.
* @return iconUrl
**/
@ApiModelProperty(value = "The URL of the icon for the issue priority.")
public String getIconUrl() {
return iconUrl;
}
public void setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
}
public Priority name(String name) {
this.name = name;
return this;
}
/**
* The name of the issue priority.
* @return name
**/
@ApiModelProperty(value = "The name of the issue priority.")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Priority id(String id) {
this.id = id;
return this;
}
/**
* The ID of the issue priority.
* @return id
**/
@ApiModelProperty(value = "The ID of the issue priority.")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@com.fasterxml.jackson.annotation.JsonAnyGetter
public Map<String, Object> any() {
return this.additionalProperties_;
}
@com.fasterxml.jackson.annotation.JsonAnySetter
public void set(String name, Object value) {
this.additionalProperties_.put(name, value);
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Priority priority = (Priority) o;
return Objects.equals(this.self, priority.self) &&
Objects.equals(this.statusColor, priority.statusColor) &&
Objects.equals(this.description, priority.description) &&
Objects.equals(this.iconUrl, priority.iconUrl) &&
Objects.equals(this.name, priority.name) &&
Objects.equals(this.id, priority.id) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(self, statusColor, description, iconUrl, name, id, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Priority {\n");
sb.append(" self: ").append(toIndentedString(self)).append("\n");
sb.append(" statusColor: ").append(toIndentedString(statusColor)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" iconUrl: ").append(toIndentedString(iconUrl)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties_)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"balazs.zsoldos@everit.biz"
] |
balazs.zsoldos@everit.biz
|
561d89a19d774ac3e4b4f9bbeabd0a73d5d6131d
|
0205999a193bf670cd9d6e5b37e342b75f4e15b8
|
/spring-aop/src/test/java/org/springframework/aop/interceptor/JamonPerformanceMonitorInterceptorTests.java
|
470d64f4324177527f6c40601c04713d08def87c
|
[
"Apache-2.0"
] |
permissive
|
leaderli/spring-source
|
18aa9a8c7c5e22d6faa6167e999ff88ffa211ba0
|
0edd75b2cedb00ad1357e7455a4fe9474b3284da
|
refs/heads/master
| 2022-02-18T16:34:19.625966
| 2022-01-29T08:56:48
| 2022-01-29T08:56:48
| 204,468,286
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,084
|
java
|
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop.interceptor;
import com.jamonapi.MonitorFactory;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
/**
* @author Steve Souza
* @since 4.1
*/
public class JamonPerformanceMonitorInterceptorTests {
private final JamonPerformanceMonitorInterceptor interceptor = new JamonPerformanceMonitorInterceptor();
private final MethodInvocation mi = mock(MethodInvocation.class);
private final Log log = mock(Log.class);
@Before
public void setUp() {
MonitorFactory.reset();
}
@After
public void tearDown() {
MonitorFactory.reset();
}
@Test
public void testInvokeUnderTraceWithNormalProcessing() throws Throwable {
given(mi.getMethod()).willReturn(String.class.getMethod("toString"));
interceptor.invokeUnderTrace(mi, log);
assertThat(MonitorFactory.getNumRows() > 0).as("jamon must track the method being invoked").isTrue();
assertThat(MonitorFactory.getReport().contains("toString")).as("The jamon report must contain the toString method that was invoked").isTrue();
}
@Test
public void testInvokeUnderTraceWithExceptionTracking() throws Throwable {
given(mi.getMethod()).willReturn(String.class.getMethod("toString"));
given(mi.proceed()).willThrow(new IllegalArgumentException());
assertThatIllegalArgumentException().isThrownBy(() ->
interceptor.invokeUnderTrace(mi, log));
assertThat(MonitorFactory.getNumRows()).as("Monitors must exist for the method invocation and 2 exceptions").isEqualTo(3);
assertThat(MonitorFactory.getReport().contains("toString")).as("The jamon report must contain the toString method that was invoked").isTrue();
assertThat(MonitorFactory.getReport().contains(MonitorFactory.EXCEPTIONS_LABEL)).as("The jamon report must contain the generic exception: " + MonitorFactory.EXCEPTIONS_LABEL).isTrue();
assertThat(MonitorFactory.getReport().contains("IllegalArgumentException")).as("The jamon report must contain the specific exception: IllegalArgumentException'").isTrue();
}
}
|
[
"429243408@qq.com"
] |
429243408@qq.com
|
ecde72a2cc0baee7aa9d2bf858917bded2a7b7e3
|
90ece9f4ae98bc9207eb80dce23fefadd7ce116d
|
/trunk/coupon/coupon-server/src/main/java/com/gaoshin/coupon/webservice/JAXBContextResolver.java
|
152cda613f4f9c496063d58b0edbd503f8b0a839
|
[] |
no_license
|
zhangyongjiang/unfuddle
|
3709018baafefd16003d3666aae6808c106ee038
|
e07a6268f46eee7bc2b4890c44b736462ab89642
|
refs/heads/master
| 2021-01-24T06:12:21.603134
| 2014-07-06T16:14:18
| 2014-07-06T16:14:18
| 21,543,421
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,807
|
java
|
package com.gaoshin.coupon.webservice;
import java.util.HashSet;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
import javax.xml.bind.JAXBContext;
import com.gaoshin.coupon.bean.CategoryList;
import com.gaoshin.coupon.bean.CouponList;
import com.gaoshin.coupon.bean.StoreAndCoupon;
import com.gaoshin.coupon.bean.StoreAndCouponList;
import com.gaoshin.coupon.bean.StoreList;
import com.gaoshin.coupon.bean.StoreTree;
import com.gaoshin.coupon.entity.Coupon;
import com.gaoshin.coupon.entity.Store;
import com.gaoshin.coupon.entity.User;
import com.sun.jersey.api.json.JSONConfiguration;
import com.sun.jersey.api.json.JSONJAXBContext;
@Provider
public class JAXBContextResolver implements ContextResolver<JAXBContext> {
private JAXBContext context;
private HashSet<Class> allTypes = new HashSet<Class>();
private Class[] types = {
User.class,
Store.class,
StoreList.class,
StoreTree.class,
Coupon.class,
CouponList.class,
StoreAndCoupon.class,
StoreAndCouponList.class,
CategoryList.class,
};
public JAXBContextResolver() throws Exception {
this.context = new JSONJAXBContext(JSONConfiguration
.mapped()
.arrays("list", "children", "items", "scenes", "msgs",
"values", "ucmList", "members", "attrNames",
"friends", "checkins", "pageFans", "pages", "dailyHours").build(),
types);
for (Class type : types) {
allTypes.add(type);
}
}
public JAXBContext getContext(Class<?> objectType) {
if(allTypes.contains(objectType))
return context;
else
return null;
}
}
|
[
"zhangyongjiang@yahoo.com"
] |
zhangyongjiang@yahoo.com
|
4bfd2afdc289fca4e295d1d8a16ad6b862bfcbca
|
e5bb4c1c5cb3a385a1a391ca43c9094e746bb171
|
/FMP/trunk/FMP/src/main/java/com/hzfh/fmp/model/baseInfo/CodeCus2Model.java
|
abc2f12496c255d2da2a801407f7fe828f9e4525
|
[] |
no_license
|
FashtimeDotCom/huazhen
|
397143967ebed9d50073bfa4909c52336a883486
|
6484bc9948a29f0611855f84e81b0a0b080e2e02
|
refs/heads/master
| 2021-01-22T14:25:04.159326
| 2016-01-11T09:52:40
| 2016-01-11T09:52:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 267
|
java
|
package com.hzfh.fmp.model.baseInfo;
import com.hzfh.api.baseInfo.model.CodeCus2;
import com.hzfh.fmp.facade.baseInfo.CodeCus2Facade;
public class CodeCus2Model {
public static int getCode() {
return CodeCus2Facade.add(new CodeCus2());
}
}
|
[
"ulei0343@163.com"
] |
ulei0343@163.com
|
a0b9e9d86057b3af3ed2037df1712c62ef7e6a71
|
07174aa43b1644b795e9d7dd6fc6a376669265c1
|
/library/src/main/java/com/tom_roush/pdfbox/contentstream/operator/Operator.java
|
42e0bb6ed4bd4d1cb59217cd28d3494b9461c565
|
[
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"APAFML",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
sbassomp/PdfBox-Android
|
a505a0afc930305544358d2b3d4b17eca70d2e4b
|
c9b99fa03e6f2cfca3574bceb763fbd54530c4c3
|
refs/heads/master
| 2020-03-13T22:47:16.923659
| 2018-04-27T16:53:02
| 2018-04-27T16:53:02
| 131,322,744
| 0
| 0
|
Apache-2.0
| 2018-04-27T16:53:04
| 2018-04-27T16:50:39
|
Java
|
UTF-8
|
Java
| false
| false
| 3,543
|
java
|
package com.tom_roush.pdfbox.contentstream.operator;
import com.tom_roush.pdfbox.cos.COSDictionary;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* An Operator in a PDF content stream.
*
* @author Ben Litchfield
*/
public final class Operator
{
private final String theOperator;
private byte[] imageData;
private COSDictionary imageParameters;
/** map for singleton operator objects; use {@link ConcurrentHashMap} for better scalability with multiple threads */
private static final ConcurrentMap<String,Operator> operators = new ConcurrentHashMap<String, Operator>();
/**
* Constructor.
*
* @param aOperator The operator that this object will represent.
* @throws IllegalArgumentException if the operator starts with "/".
*/
private Operator(String aOperator)
{
theOperator = aOperator;
if( aOperator.startsWith( "/" ) )
{
throw new IllegalArgumentException("Operators are not allowed to start with / '" + aOperator + "'");
}
}
/**
* This is used to create/cache operators in the system.
*
* @param operator The operator for the system.
*
* @return The operator that matches the operator keyword.
*/
public static Operator getOperator( String operator )
{
Operator operation;
if( operator.equals( "ID" ) || operator.equals( "BI" ) )
{
//we can't cache the ID operators.
operation = new Operator( operator );
}
else
{
operation = operators.get( operator );
if( operation == null )
{
// another thread may has already added an operator of this kind
// make sure that we get the same operator
operation = operators.putIfAbsent( operator, new Operator( operator ) );
if ( operation == null )
{
operation = operators.get( operator );
}
}
}
return operation;
}
/**
* This will get the name of the operator.
*
* @return The string representation of the operation.
*/
public String getName()
{
return theOperator;
}
/**
* This will print a string rep of this class.
*
* @return A string rep of this class.
*/
@Override
public String toString()
{
return "PDFOperator{" + theOperator + "}";
}
/**
* This is the special case for the ID operator where there are just random
* bytes inlined the stream.
*
* @return Value of property imageData.
*/
public byte[] getImageData()
{
return this.imageData;
}
/**
* This will set the image data, this is only used for the ID operator.
*
* @param imageDataArray New value of property imageData.
*/
public void setImageData(byte[] imageDataArray)
{
imageData = imageDataArray;
}
/**
* This will get the image parameters, this is only valid for BI operators.
*
* @return The image parameters.
*/
public COSDictionary getImageParameters()
{
return imageParameters;
}
/**
* This will set the image parameters, this is only valid for BI operators.
*
* @param params The image parameters.
*/
public void setImageParameters( COSDictionary params)
{
imageParameters = params;
}
}
|
[
"birdbrain2@comcast.net"
] |
birdbrain2@comcast.net
|
a52eaffce38282a0e9e74d91e76c43c5d05f7cdb
|
0f3125c76530e16d4ce45377f3fa6b29c4d98477
|
/Yjpty/app/src/main/java/cn/kiway/activity/main/growth/GrowthActivity.java
|
1a6b654e8bb78fcd2c5c3f1f29334b2a1a9aa4e5
|
[] |
no_license
|
ZHENGZX123/Edu
|
496f3c2430355333b5406e9b62f9ef4221e52e6e
|
9f890cb7663b05c581fb0372457c8741c96b0d01
|
refs/heads/master
| 2021-01-01T19:36:05.278918
| 2017-07-28T06:55:48
| 2017-07-28T06:55:48
| 98,618,546
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,807
|
java
|
package cn.kiway.activity.main.growth;
import handmark.pulltorefresh.library.PullToRefreshBase;
import handmark.pulltorefresh.library.PullToRefreshBase.Mode;
import handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener2;
import handmark.pulltorefresh.library.PullToRefreshListView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import cn.kiway.IConstant;
import cn.kiway.IUrContant;
import cn.kiway.Yjpty.R;
import cn.kiway.activity.BaseNetWorkActicity;
import cn.kiway.adapter.main.growth.GrowthAdapter;
import cn.kiway.dialog.IsNetWorkDialog;
import cn.kiway.http.HttpResponseModel;
import cn.kiway.model.GrowthListModel;
import cn.kiway.utils.AppUtil;
import cn.kiway.utils.StringUtil;
import cn.kiway.utils.ViewUtil;
import com.nostra13.universalimageloader.core.listener.PauseOnScrollListener;
public class GrowthActivity extends BaseNetWorkActicity implements
OnRefreshListener2<ListView> {
PullToRefreshListView listView;
ListView lv;
GrowthAdapter adapter;
View view;// listview头部的view
int page = 1;// 当前加载的页数
int pageCount;// 总共有多少页
GrowthListModel model;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
model = (GrowthListModel) bundle
.getSerializable(IConstant.BUNDLE_PARAMS);
if (!AppUtil.isNetworkAvailable(this)// 判断是否有网咯
&& mCache.getAsJSONObject(IUrContant.GET_GROWTH_LIST_URL
+ model.getChildId()) == null) {
newWorkdialog = new IsNetWorkDialog(context, this,
resources.getString(R.string.dqsjmylrhlwqljhlwl),
resources.getString(R.string.ljhlw));
if (newWorkdialog != null && !newWorkdialog.isShowing()) {
newWorkdialog.show();
return;
}
}
try {
initView();
loadData();
setData();
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putSerializable("model", model);
}
@Override
public void restoreInstanceState(Bundle inState) {
super.restoreInstanceState(inState);
if (inState.containsKey("model"))
model = (GrowthListModel) inState.getSerializable("model");
}
@Override
public void initView() throws Exception {
setContentView(R.layout.activity_growth_profile);
float w = displayMetrics.widthPixels;
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
(int) w, (int) (w / 3));
view = ViewUtil.inflate(this, R.layout.class_ring_header);
view.findViewById(R.id.bg).setLayoutParams(layoutParams);
adapter = new GrowthAdapter(this, new ArrayList<GrowthListModel>());
listView = ViewUtil.findViewById(this, R.id.boy_list);
listView.setMode(Mode.BOTH);
listView.setOnRefreshListener(this);
lv = listView.getRefreshableView();
lv.addHeaderView(view);
lv.setAdapter(adapter);
lv.setOnScrollListener(new PauseOnScrollListener(imageLoader, true,
true));// 滑动不加载图片
ViewUtil.setContent(view, R.id.name, model.getUserName());
imageLoader.displayImage(StringUtil.imgUrl(this, model.getUserImg()),
(ImageView) view.findViewById(R.id.profile), fadeOptions);
}
@Override
public void loadData() throws Exception {
super.loadData();
if (model == null)
return;
isRefresh = true;
Map<String, String> map = new HashMap<>();
map.put("childId", model.getChildId() + "");
map.put("pageNo", "1");
map.put("pageSize", "10");
IConstant.HTTP_CONNECT_POOL.addRequest(
IUrContant.GET_CHILDE_GROWTH_URL, map, activityHandler);
};
@Override
public void setData() throws Exception {
if (model == null)
return;
JSONObject data = mCache.getAsJSONObject(IUrContant.GET_GROWTH_LIST_URL
+ model.getChildId());
if (isRefresh)
adapter.list.clear();
if (data != null) {
JSONArray growthList = data.optJSONArray("growthJList");
for (int i = 0; i < growthList.length(); i++) {
JSONObject item = growthList.optJSONObject(i);
if (item != null) {
GrowthListModel model = new GrowthListModel();
model.setContent(item.optString("content"));// 创建内容
model.setCreateTime(item.optString("create_time"));// 创建时间
model.setId(item.optInt("id"));// 足迹的id
model.setUid(item.optInt("owner"));// 谁发的id
JSONArray imgList = item.optJSONArray("imagList");// 图像列表
List<String> list = new ArrayList<String>();
for (int j = 0; j < imgList.length(); j++) {// 图像地址
JSONObject it = imgList.optJSONObject(j);
list.add(it.optString("image_path"));
}
model.setPicList(list);
adapter.list.add(model);
}
}
adapter.notifyDataSetChanged();
}
}
@Override
public void httpSuccess(HttpResponseModel message) throws Exception {
super.httpSuccess(message);
if (message.getUrl().equals(IUrContant.GET_CHILDE_GROWTH_URL)) {
listView.onRefreshComplete();
if (!isRefresh)
page = page + 1;
else
page = 2;
JSONObject data = new JSONObject(new String(message.getResponse()));
if (data.optInt("retcode") == 1) {
pageCount = data.optInt("pageCount");// 获取到总共有多少页数
if (pageCount + 1 < page) {// 如果超过 了最大页数,则不保存,也不设置数据
page = page - 1;
return;
}
mCache.put(IUrContant.GET_GROWTH_LIST_URL + model.getChildId(),
data);
setData();
}
}
}
@Override
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
isRefresh = true;// 刷新
Map<String, String> map = new HashMap<>();
map.put("childId", model.getChildId() + "");// 孩子id
map.put("pageNo", "1");// 加载第几页
map.put("pageSize", "10");// 加载多少条
IConstant.HTTP_CONNECT_POOL.addRequest(
IUrContant.GET_CHILDE_GROWTH_URL, map, activityHandler);
}
@Override
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {// 加载
if (page > pageCount) {
handler.sendEmptyMessage(0);
return;
}
isRefresh = false;
Map<String, String> map = new HashMap<>();
map.put("childId", model.getChildId() + "");
map.put("pageNo", page + "");
map.put("pageSize", "10");
IConstant.HTTP_CONNECT_POOL.addRequest(
IUrContant.GET_CHILDE_GROWTH_URL, map, activityHandler);
}
@SuppressLint("HandlerLeak")
Handler handler = new Handler() {
public void handleMessage(android.os.Message msg) {
ViewUtil.showMessage(GrowthActivity.this, "已加载全部");
listView.onRefreshComplete();
};
};
}
|
[
"656701179@qq.com"
] |
656701179@qq.com
|
bbd2e891fbfa38619a2eac308974d861d7c40ab4
|
7b3651fd7af9697566257e4849ce9e109b01fb29
|
/src/main/java/com/homurax/chapter04/server/parallel/client/QueryTask.java
|
dff8d7dbe47e2b0bf02c94929134efdf4be52198
|
[] |
no_license
|
lixiangqi-github/concurrency-learn
|
812ac4e20aef9996894db5905ef32605786cd82d
|
b904d5e9f12e1dadf3e8e99adcf2a6c844f5e453
|
refs/heads/master
| 2022-02-20T19:16:08.240239
| 2019-10-22T02:08:24
| 2019-10-22T02:08:24
| 256,743,981
| 1
| 0
| null | 2020-04-18T12:07:14
| 2020-04-18T12:07:14
| null |
UTF-8
|
Java
| false
| false
| 1,655
|
java
|
package com.homurax.chapter04.server.parallel.client;
import com.homurax.chapter03.server.common.Constants;
import com.homurax.chapter03.server.wdi.data.WDI;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.Socket;
import java.util.List;
import java.util.Random;
public class QueryTask implements Runnable {
private List<WDI> data;
private String username;
public QueryTask(List<WDI> data, String username) {
this.data = data;
this.username = username;
}
@Override
public void run() {
Random randomGenerator = new Random();
try (Socket echoSocket = new Socket("localhost", Constants.CONCURRENT_PORT);
PrintWriter out = new PrintWriter(echoSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(echoSocket.getInputStream()))) {
WDI wdi = data.get(randomGenerator.nextInt(data.size()));
StringWriter writer = new StringWriter();
writer.write("q");
writer.write(";");
writer.write(username);
writer.write(";");
writer.write(String.valueOf(5));
writer.write(";");
writer.write(wdi.getCountryCode());
writer.write(";");
writer.write(wdi.getIndicatorCode());
String command = writer.toString();
out.println(command);
String output = in.readLine();
System.out.println(output);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
[
"homuraxenoblade@gmail.com"
] |
homuraxenoblade@gmail.com
|
01419343da736d3776a402f6aa8eb4863aff4efe
|
2f7ecc75bc13ef9e49ca1994a84c4400053b08c9
|
/src/com/javarush/test/level07/lesson09/task04/Solution.java
|
a8c088ab2c9507950601b3856dd0431c66e5a035
|
[] |
no_license
|
BogdanKartawcew/JavaRushHomeWork
|
d47574392db5c4720245dec08d8ea0b896138402
|
70bf310ed564293c1855a2650197bff74dce2271
|
refs/heads/master
| 2021-01-01T20:22:06.234055
| 2018-01-30T19:58:33
| 2018-01-30T19:58:33
| 80,110,449
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,750
|
java
|
package com.javarush.test.level07.lesson09.task04;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/* Буква «р» и буква «л»
1. Создай список слов, заполни его самостоятельно.
2. Метод fix должен:
2.1. удалять из списка строк все слова, содержащие букву «р»
2.2. удваивать все слова содержащие букву «л».
2.3. если слово содержит и букву «р» и букву «л», то оставить это слово без изменений.
2.4. с другими словами ничего не делать.
Пример:
роза
лира
лоза
Выходные данные:
лира
лоза
лоза
*/
public class Solution
{
public static void main(String[] args) throws Exception
{BufferedReader bis = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<String>();
list.add("роза");
list.add("лира");
list.add("лоза");
list = fix(list);
for (String s : list)
{
System.out.println(s);
}
}
public static ArrayList<String> fix(ArrayList<String> list)
{
for (int i = 0; i < list.size();) {
if (!list.get(i).contains("л") && list.get(i).contains("р"))
list.remove(i);
else if (list.get(i).contains("л") && !list.get(i).contains("р"))
{ list.add(i + 1, list.get(i));
i= i+2;}
else
i++;
}
return list;
}
}
|
[
"kartawcew.b@gmail.com"
] |
kartawcew.b@gmail.com
|
886f32e5dac6223f283b00088158655740e5b033
|
bb2467e8b615cd98729bec01498505f23e2bf2f5
|
/spring-custom/src/main/java/com/hcl/spring/po/Course.java
|
ca2547279c9c4bbfcb337d327006e5a05319ae60
|
[] |
no_license
|
SuperHcl/study
|
61e5f7722b514acbfebb4aa8c1c9ce092dbeaca8
|
95ecf96965750654c7802c1faf326f64216d0290
|
refs/heads/master
| 2023-08-17T00:19:29.523744
| 2023-08-07T08:11:40
| 2023-08-07T08:11:40
| 193,214,220
| 1
| 0
| null | 2023-03-03T07:45:52
| 2019-06-22T09:09:27
|
Java
|
UTF-8
|
Java
| false
| false
| 509
|
java
|
package com.hcl.spring.po;
public class Course {
private String name;
private Integer age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public void init() {
System.out.println("我是对象初始化方法");
}
@Override
public String toString() {
return "Course{" +
"name='" + name + '\'' +
", age=" + age +
'}';
}
}
|
[
"157223522@qq.com"
] |
157223522@qq.com
|
af64a06275c63ae47b0c0a5e279f404164bc5e56
|
24a439a68d20be0fb590acc690e2047d42b50a3c
|
/DevJavaSecond/src/core/less11/Main.java
|
8763f2bd75f11cb514dca54ad9f422cb11e68209
|
[] |
no_license
|
Prototype-n/DevJava
|
17d0332da86767b65d8c8777343b70a2a98767e5
|
2ffff658a4d421a66a6f2f488dd8f35a560350b0
|
refs/heads/master
| 2021-01-17T17:41:00.981418
| 2016-08-28T09:46:00
| 2016-08-28T09:46:00
| 66,860,603
| 0
| 1
| null | 2016-08-29T16:28:20
| 2016-08-29T16:28:19
| null |
UTF-8
|
Java
| false
| false
| 1,433
|
java
|
package core.less11;
import java.util.Scanner;
public class Main {
private static final Scanner SC = new Scanner(System.in);
private static final PersonManagement PM = new PersonManagement();
public static void main(String[] args) {
boolean isRun = true;
while (isRun) {
System.out.println("Enter 1 to add person");
System.out.println("Enter 2 to change age");
System.out.println("Enter 3 to exit");
switch (SC.next()) {
case "1": {
addPerson();
break;
}
case "2": {
changeAge();
break;
}
default: {
isRun = false;
break;
}
}
System.out.println(PM);
}
}
private static void changeAge() {
try{
System.out.println("Enter name");
String name = SC.next();
System.out.println("Enter age");
String age = SC.next();
PM.changeAge(name, age);
}catch(NumberFormatException e){
System.err.println("Idiot enter correct age");
}catch (IllegalArgumentException e) {
System.err.println("Idiot enter correct age betwean 0 and 120");
}
}
private static void addPerson() {
try{
System.out.println("Enter name");
String name = SC.next();
System.out.println("Enter age");
String age = SC.next();
PM.addPerson(name, age);
}catch(NumberFormatException e){
System.err.println("Idiot enter correct age");
}catch (IllegalArgumentException e) {
System.err.println("Idiot enter correct age betwean 0 and 120");
}
}
}
|
[
"sokol.serhij@gmail.com"
] |
sokol.serhij@gmail.com
|
1068fad2295be679d735d459a43ae0ab9db36043
|
93fb0f3b89015dc483a75c0c8d60fcbadd5dfc9c
|
/fpinjava-parent/fpinjava-laziness-solutions/src/main/java/com/fpinjava/laziness/exercise09_16/Stream.java
|
7004283a70072d5924c71b331562c322ed810901
|
[] |
no_license
|
andyglick/fpinjava
|
e0e2d11fbd6bf3d2bcf4903d5eedcba26b600299
|
29c7470447e0e920be371dc32efc59d46a41c770
|
refs/heads/master
| 2023-07-08T11:48:47.172233
| 2023-02-26T02:05:29
| 2023-02-26T02:05:29
| 61,913,583
| 0
| 0
| null | 2016-06-24T21:33:58
| 2016-06-24T21:33:58
| null |
UTF-8
|
Java
| false
| false
| 5,665
|
java
|
package com.fpinjava.laziness.exercise09_16;
import com.fpinjava.common.Function;
import com.fpinjava.common.List;
import com.fpinjava.common.Result;
import com.fpinjava.common.Supplier;
import com.fpinjava.common.TailCall;
import static com.fpinjava.common.TailCall.ret;
import static com.fpinjava.common.TailCall.sus;
abstract class Stream<A> {
private static Stream EMPTY = new Empty();
public abstract A head();
public abstract Stream<A> tail();
public abstract Boolean isEmpty();
public abstract Result<A> headOption();
public abstract Stream<A> take(int n);
public abstract Stream<A> drop(int n);
public abstract Stream<A> takeWhile_(Function<A, Boolean> f);
public abstract <B> B foldRight(Supplier<B> z, Function<A, Function<Supplier<B>, B>> f);
public Result<A> find(Function<A, Boolean> p) {
return filter(p).headOption();
}
public <B> Stream<B> flatMap(Function<A, Stream<B>> f) {
return foldRight(Stream::empty, a -> b -> f.apply(a).append(b));
}
public Stream<A> append(Supplier<Stream<A>> s) {
return foldRight(s, a -> b -> cons(() -> a, b));
}
public Stream<A> filter(Function<A, Boolean> p) {
return foldRight(Stream::empty, a -> b -> p.apply(a)
? cons(() -> a, b)
: b.get());
}
public <B> Stream<B> map(Function<A, B> f) {
return foldRight(Stream::empty, a -> b -> cons(() -> f.apply(a), b));
}
public Result<A> headOptionViaFoldRight() {
return foldRight(Result::empty, a -> ignore -> Result.success(a));
}
public Stream<A> takeWhile(Function<A, Boolean> f) {
return foldRight(Stream::empty, a -> b -> f.apply(a)
? cons(() -> a, b)
: empty());
}
public boolean exists(Function<A, Boolean> p) {
return exists(this, p).eval();
}
private TailCall<Boolean> exists(Stream<A> s, Function<A, Boolean> p) {
return s.isEmpty()
? ret(false)
: p.apply(s.head())
? ret(true)
: sus(() -> exists(s.tail(), p));
}
public Stream<A> dropWhile(Function<A, Boolean> f) {
return dropWhile(this, f).eval();
}
private TailCall<Stream<A>> dropWhile(Stream<A> acc, Function<A, Boolean> f) {
return acc.isEmpty()
? ret(acc)
: f.apply(acc.head())
? sus(() -> dropWhile(acc.tail(), f))
: ret(acc);
}
public List<A> toList() {
return toList(this, List.list()).eval().reverse();
}
private TailCall<List<A>> toList(Stream<A> s, List<A> acc) {
return s.isEmpty()
? ret(acc)
: sus(() -> toList(s.tail(), List.cons(s.head(), acc)));
}
private Stream() {}
private static class Empty<A> extends Stream<A> {
@Override
public Stream<A> tail() {
throw new IllegalStateException("tail called on empty");
}
@Override
public A head() {
throw new IllegalStateException("head called on empty");
}
@Override
public Boolean isEmpty() {
return true;
}
@Override
public Result<A> headOption() {
return Result.empty();
}
@Override
public Stream<A> take(int n) {
return this;
}
@Override
public Stream<A> drop(int n) {
return this;
}
@Override
public Stream<A> takeWhile_(Function<A, Boolean> f) {
return this;
}
@Override
public <B> B foldRight(Supplier<B> z, Function<A, Function<Supplier<B>, B>> f) {
return z.get();
}
}
private static class Cons<A> extends Stream<A> {
private final Supplier<A> head;
private A h;
private final Supplier<Stream<A>> tail;
private Stream<A> t;
private Cons(Supplier<A> h, Supplier<Stream<A>> t) {
head = h;
tail = t;
}
@Override
public A head() {
if (h == null) {
h = head.get();
}
return h;
}
@Override
public Stream<A> tail() {
if (t == null) {
t = tail.get();
}
return t;
}
@Override
public Boolean isEmpty() {
return false;
}
@Override
public Result<A> headOption() {
return Result.success(head());
}
@Override
public Stream<A> take(int n) {
return n <= 0
? empty()
: cons(head, () -> tail().take(n - 1));
}
@Override
public Stream<A> drop(int n) {
return drop(this, n).eval();
}
@Override
public Stream<A> takeWhile_(Function<A, Boolean> f) {
return f.apply(head())
? cons(head, () -> tail().takeWhile_(f))
: empty();
}
@Override
public <B> B foldRight(Supplier<B> z, Function<A, Function<Supplier<B>, B>> f) {
return f.apply(head()).apply(() -> tail().foldRight(z, f));
}
public TailCall<Stream<A>> drop(Stream<A> acc, int n) {
return acc.isEmpty() || n <= 0
? ret(acc)
: sus(() -> drop(acc.tail(), n - 1));
}
}
static <A> Stream<A> cons(Supplier<A> hd, Supplier<Stream<A>> tl) {
return new Cons<>(hd, tl);
}
static <A> Stream<A> cons(Supplier<A> hd, Stream<A> tl) {
return new Cons<>(hd, () -> tl);
}
@SuppressWarnings("unchecked")
public static <A> Stream<A> empty() {
return EMPTY;
}
public static Stream<Integer> from_(int i) {
return cons(() -> i, () -> from_(i + 1));
}
public static <A> Stream<A> repeat_(A a) {
return cons(() -> a, () -> repeat_(a));
}
public static <A> Stream<A> iterate(A seed, Function<A, A> f) {
return cons(() -> seed, () -> iterate(f.apply(seed), f));
}
public static <A> Stream<A> repeat(A a) {
return iterate(a, x -> x);
}
public static Stream<Integer> from(int i) {
return iterate(i, x -> x + 1);
}
}
|
[
"pys@volga.fr"
] |
pys@volga.fr
|
065e2c5f4dd297938130cbe07b0b00d5ae1e61f4
|
a2679a7f8c7ab85134718a0933802e41aaa64bf1
|
/src/main/java/com/jp/jhipster/monolith/service/MailService.java
|
87a4ad5ea7358795c6e05452a1929895a3c5e4fe
|
[] |
no_license
|
JayaprakashRavindran/jhipster-sample-app-monolith
|
f49a873a148bbe39e2d1fb9fca658200796d8e5c
|
4c2e32e3091f81b8ca31e73419e10821d4fab354
|
refs/heads/master
| 2023-04-08T06:41:12.476782
| 2020-05-13T15:40:24
| 2020-05-13T15:40:24
| 263,672,527
| 0
| 0
| null | 2021-04-29T21:54:51
| 2020-05-13T15:40:07
|
Java
|
UTF-8
|
Java
| false
| false
| 4,101
|
java
|
package com.jp.jhipster.monolith.service;
import com.jp.jhipster.monolith.domain.User;
import io.github.jhipster.config.JHipsterProperties;
import java.nio.charset.StandardCharsets;
import java.util.Locale;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;
import org.springframework.mail.MailException;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
/**
* Service for sending emails.
* <p>
* We use the {@link Async} annotation to send emails asynchronously.
*/
@Service
public class MailService {
private final Logger log = LoggerFactory.getLogger(MailService.class);
private static final String USER = "user";
private static final String BASE_URL = "baseUrl";
private final JHipsterProperties jHipsterProperties;
private final JavaMailSender javaMailSender;
private final MessageSource messageSource;
private final SpringTemplateEngine templateEngine;
public MailService(
JHipsterProperties jHipsterProperties,
JavaMailSender javaMailSender,
MessageSource messageSource,
SpringTemplateEngine templateEngine
) {
this.jHipsterProperties = jHipsterProperties;
this.javaMailSender = javaMailSender;
this.messageSource = messageSource;
this.templateEngine = templateEngine;
}
@Async
public void sendEmail(String to, String subject, String content, boolean isMultipart, boolean isHtml) {
log.debug(
"Send email[multipart '{}' and html '{}'] to '{}' with subject '{}' and content={}",
isMultipart,
isHtml,
to,
subject,
content
);
// Prepare message using a Spring helper
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
try {
MimeMessageHelper message = new MimeMessageHelper(mimeMessage, isMultipart, StandardCharsets.UTF_8.name());
message.setTo(to);
message.setFrom(jHipsterProperties.getMail().getFrom());
message.setSubject(subject);
message.setText(content, isHtml);
javaMailSender.send(mimeMessage);
log.debug("Sent email to User '{}'", to);
} catch (MailException | MessagingException e) {
log.warn("Email could not be sent to user '{}'", to, e);
}
}
@Async
public void sendEmailFromTemplate(User user, String templateName, String titleKey) {
if (user.getEmail() == null) {
log.debug("Email doesn't exist for user '{}'", user.getLogin());
return;
}
Locale locale = Locale.forLanguageTag(user.getLangKey());
Context context = new Context(locale);
context.setVariable(USER, user);
context.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl());
String content = templateEngine.process(templateName, context);
String subject = messageSource.getMessage(titleKey, null, locale);
sendEmail(user.getEmail(), subject, content, false, true);
}
@Async
public void sendActivationEmail(User user) {
log.debug("Sending activation email to '{}'", user.getEmail());
sendEmailFromTemplate(user, "mail/activationEmail", "email.activation.title");
}
@Async
public void sendCreationEmail(User user) {
log.debug("Sending creation email to '{}'", user.getEmail());
sendEmailFromTemplate(user, "mail/creationEmail", "email.activation.title");
}
@Async
public void sendPasswordResetMail(User user) {
log.debug("Sending password reset email to '{}'", user.getEmail());
sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title");
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
739cf8fd4f538a9806f361093e13b1bb2e2609e0
|
39b6f83641d1a80a48937c42beb6a73311aebc55
|
/integration-tests/kafka-avro-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaAvroTestBase.java
|
74e17f9f88d26eb1358b0f8e391308ed8512601d
|
[
"Apache-2.0"
] |
permissive
|
quarkusio/quarkus
|
112ecda7236bc061920978ac49289da6259360f4
|
68af440f3081de7a26bbee655f74bb8b2c57c2d5
|
refs/heads/main
| 2023-09-04T06:39:33.043251
| 2023-09-04T05:44:43
| 2023-09-04T05:44:43
| 139,914,932
| 13,109
| 2,940
|
Apache-2.0
| 2023-09-14T21:31:23
| 2018-07-06T00:44:20
|
Java
|
UTF-8
|
Java
| false
| false
| 3,170
|
java
|
package io.quarkus.it.kafka;
import java.time.Duration;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import io.quarkus.it.kafka.avro.AvroKafkaCreator;
import io.quarkus.it.kafka.avro.Pet;
import io.restassured.RestAssured;
public abstract class KafkaAvroTestBase {
static final String CONFLUENT_PATH = "/avro/confluent";
static final String APICURIO_PATH = "/avro/apicurio";
abstract AvroKafkaCreator creator();
@Test
public void testUrls() {
Assertions.assertTrue(creator().getApicurioRegistryUrl().endsWith("/apis/registry/v2"));
Assertions.assertTrue(creator().getConfluentRegistryUrl().endsWith("/apis/ccompat/v6"));
}
@Test
public void testConfluentAvroProducer() {
KafkaConsumer<Integer, Pet> consumer = creator().createConfluentConsumer(
"test-avro-confluent",
"test-avro-confluent-producer");
testAvroProducer(consumer, CONFLUENT_PATH);
}
@Test
public void testConfluentAvroConsumer() {
KafkaProducer<Integer, Pet> producer = creator().createConfluentProducer("test-avro-confluent-test");
testAvroConsumer(producer, CONFLUENT_PATH, "test-avro-confluent-consumer");
}
@Test
public void testApicurioAvroProducer() {
KafkaConsumer<Integer, Pet> consumer = creator().createApicurioConsumer(
"test-avro-apicurio",
"test-avro-apicurio-producer");
testAvroProducer(consumer, APICURIO_PATH);
}
@Test
public void testApicurioAvroConsumer() {
KafkaProducer<Integer, Pet> producer = creator().createApicurioProducer("test-avro-apicurio-test");
testAvroConsumer(producer, APICURIO_PATH, "test-avro-apicurio-consumer");
}
protected void testAvroProducer(KafkaConsumer<Integer, Pet> consumer, String path) {
RestAssured.given()
.header("content-type", "application/json")
.body("{\"name\":\"neo\", \"color\":\"tricolor\"}")
.post(path);
ConsumerRecord<Integer, Pet> records = consumer.poll(Duration.ofMillis(20000)).iterator().next();
Assertions.assertEquals(records.key(), (Integer) 0);
Pet pet = records.value();
Assertions.assertEquals("neo", pet.getName());
Assertions.assertEquals("tricolor", pet.getColor());
consumer.close();
}
protected void testAvroConsumer(KafkaProducer<Integer, Pet> producer, String path, String topic) {
producer.send(new ProducerRecord<>(topic, 1, createPet()));
Pet retrieved = RestAssured.when().get(path).as(Pet.class);
Assertions.assertEquals("neo", retrieved.getName());
Assertions.assertEquals("white", retrieved.getColor());
producer.close();
}
private Pet createPet() {
Pet pet = new Pet();
pet.setName("neo");
pet.setColor("white");
return pet;
}
}
|
[
"lthon@redhat.com"
] |
lthon@redhat.com
|
a0ff569c70bd4238ab687de73b2ba7f42d895b4f
|
508da7012b304f5d698adcaa21ef1ea444417851
|
/connectors/camel-xmpp-kafka-connector/src/main/java/org/apache/camel/kafkaconnector/xmpp/CamelXmppSourceConnector.java
|
b338f0cc19f94292bec07e76d3bb862044ea8ea3
|
[
"Apache-2.0"
] |
permissive
|
jboss-fuse/camel-kafka-connector
|
02fd86c99ee4d2ac88ac5cf8b4cf56bd0bbcc007
|
8411f2f772a00d1d4a53ca8f24e13128306f5c02
|
refs/heads/master
| 2021-07-02T19:43:30.085652
| 2020-10-19T13:17:53
| 2020-10-19T13:18:04
| 181,911,766
| 16
| 7
|
Apache-2.0
| 2019-12-04T08:44:47
| 2019-04-17T14:45:05
|
Java
|
UTF-8
|
Java
| false
| false
| 1,482
|
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.camel.kafkaconnector.xmpp;
import javax.annotation.Generated;
import org.apache.camel.kafkaconnector.CamelSourceConnector;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.connect.connector.Task;
@Generated("This class has been generated by camel-kafka-connector-generator-maven-plugin, remove this annotation to prevent it from being generated.")
public class CamelXmppSourceConnector extends CamelSourceConnector {
@Override
public ConfigDef config() {
return CamelXmppSourceConnectorConfig.conf();
}
@Override
public Class<? extends Task> taskClass() {
return CamelXmppSourceTask.class;
}
}
|
[
"andrea.tarocchi@gmail.com"
] |
andrea.tarocchi@gmail.com
|
119e062b66062695b6e83a166f2f3eb42a130cd3
|
a983d2b50a6b708fcbb2a481574aa02ba7374ea7
|
/Inheritance - Composition/src/prob1/PersonWithJob.java
|
770b430261eecca402510873def26fb7b1e97484
|
[] |
no_license
|
jimkatunguka/MPP_2
|
28dddae51bd7a9b36656d0b70b2c549017b8eb7e
|
6c48d9ac4d97ebc0cf5aed69ff05b7df67b3a68b
|
refs/heads/master
| 2020-12-06T06:10:44.635086
| 2020-01-07T17:47:10
| 2020-01-07T17:47:10
| 232,368,882
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,036
|
java
|
package prob1;
public class PersonWithJob extends Person {
private double salary;
public double getSalary() {
return salary;
}
PersonWithJob(String n, double s) {
super(n);
salary = s;
}
@Override
public boolean equals(Object aPerson) {
if(aPerson == null) return false;
if(!(aPerson instanceof PersonWithJob)) return false;
PersonWithJob p = (PersonWithJob)aPerson;
boolean isEqual = this.getName().equals(p.getName()) &&
this.getSalary()==p.getSalary();
return isEqual;
}
public static void main(String[] args) {
Person p1 = new PersonWithJob("Joe", 30000);
Person p2 = new Person("Joe");
//As PersonsWithJobs, p1 should be equal to p2
System.out.println("p1.equals(p2)? " + p1.equals(p2));
System.out.println("p2.equals(p1)? " + p2.equals(p1));
}
/* P1 is a PersonWithJob and has all the features of Person
P1 compared to its parent P2 will return true but
P2 is a parent of P1 and thus P2 cannot have access to extra features of P1.
*/
}
|
[
"jimkatunguka@gmail.com"
] |
jimkatunguka@gmail.com
|
51426839266d0a60dc16b47243c29bf4f017fca2
|
eeb40ec64e7782cd643b9a900b1630f5b64b7dc8
|
/component/common/src/main/java/org/exoplatform/commons/serialization/serial/SerializationStatus.java
|
430d9f2bb8a07363f2c282adfc62edfdbe952952
|
[] |
no_license
|
trongtt/exogtn
|
3eedd3ada6d0b670ac18c9d0cb5cebadb861404c
|
68fe2bc8081502857ae957d89cbaff0cc186de45
|
refs/heads/master
| 2020-12-25T03:30:14.704926
| 2011-11-21T12:55:44
| 2011-11-23T11:38:30
| 1,406,085
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,044
|
java
|
/*
* Copyright (C) 2009 eXo Platform SAS.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.exoplatform.commons.serialization.serial;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
enum SerializationStatus
{
NONE,
PARTIAL,
FULL
}
|
[
"thomas.heute@jboss.com@fb34874e-041c-4b43-9091-f025c444618b"
] |
thomas.heute@jboss.com@fb34874e-041c-4b43-9091-f025c444618b
|
f6dc2db16ec424b9650bc1d56441a1c3c5d40e2b
|
300f9a5476d80533b4cec1081a621d156cb934b2
|
/mmm-search/mmm-search-engine/mmm-search-engine-api/src/main/java/net/sf/mmm/search/api/config/SearchConfiguration.java
|
4a5b72a94caa42ad8740ad0e6bef3aad2ee76d11
|
[
"Apache-2.0"
] |
permissive
|
cbonami/mmm
|
931157236175aa749280e71851fda1d8f5a4c5dc
|
cd69e59a9696ff44e87678ab1cc879d20d7188f7
|
refs/heads/master
| 2021-01-20T17:12:37.355366
| 2014-01-29T22:27:15
| 2014-01-29T22:27:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,906
|
java
|
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.search.api.config;
import java.util.Collection;
/**
* This is the interface for the configuration of the entire search (e.g. for the
* {@link net.sf.mmm.search.engine.api.SearchEngine}).<br>
* You will typically provide your configuration as XML in the {@link #DEFAULT_CONFIGURATION_URL default
* configuration file}. The base-implementation comes with an according (un)marshaler.
*
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
* @since 1.0.0
*/
public abstract interface SearchConfiguration {
/** The default location of the configuration for the search. */
String DEFAULT_CONFIGURATION_URL = "file://~/.mmm/search.xml";
/**
* This method gets the {@link SearchIndexConfiguration}.
*
* @return the {@link SearchIndexConfiguration}.
*/
SearchIndexConfiguration getSearchIndex();
/**
* This method gets the {@link Collection} of {@link SearchSource sources}.
*
* @return the {@link SearchSource}s.
*/
Collection<? extends SearchSource> getSources();
/**
* This method gets the {@link SearchSource} with the given {@link SearchSource#getId() ID}.
*
* @param id is the {@link SearchSource#getId() ID} of the requested {@link SearchSource}.
* @return the requested {@link SearchSource} or <code>null</code> if none is configured for the given
* <code>id</code>.
*/
SearchSource getSource(String id);
/**
* This method gets the general purpose {@link SearchProperties}.
*
* @return the {@link SearchProperties}.
*/
SearchProperties getProperties();
/**
* This method gets the {@link SearchFields}.
*
* @return the {@link SearchFields}.
*/
SearchFields getFields();
}
|
[
"joerg@j-hohwiller.de"
] |
joerg@j-hohwiller.de
|
bde035f874e19e0ab46e814a301c7cfbec90dd1b
|
95e944448000c08dd3d6915abb468767c9f29d3c
|
/sources/com/p280ss/android/ugc/aweme/feed/model/React.java
|
7897ffcf8f92a9b60c062a55625850fe1debd3aa
|
[] |
no_license
|
xrealm/tiktok-src
|
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
|
90f305b5f981d39cfb313d75ab231326c9fca597
|
refs/heads/master
| 2022-11-12T06:43:07.401661
| 2020-07-04T20:21:12
| 2020-07-04T20:21:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,777
|
java
|
package com.p280ss.android.ugc.aweme.feed.model;
import com.google.gson.p276a.C6593c;
import com.p280ss.android.ugc.aweme.account.C6861a;
import com.p280ss.android.ugc.aweme.app.api.C6866d;
import com.p280ss.android.ugc.aweme.base.api.BaseResponse;
import java.io.Serializable;
/* renamed from: com.ss.android.ugc.aweme.feed.model.React */
public class React extends BaseResponse implements C6866d, Serializable {
@C6593c(mo15949a = "origin")
Aweme origin;
@C6593c(mo15949a = "can_react_origin")
boolean originReactable;
@C6593c(mo15949a = "can_react_current")
boolean reactable;
String requestId;
public Aweme getOrigin() {
return this.origin;
}
public boolean getOriginReactable() {
return this.originReactable;
}
public boolean getReactable() {
return this.reactable;
}
public String getRequestId() {
return this.requestId;
}
public void setOrigin(Aweme aweme) {
this.origin = aweme;
}
public void setOriginReactable(boolean z) {
this.originReactable = z;
}
public void setReactable(boolean z) {
this.reactable = z;
}
public void setRequestId(String str) {
this.requestId = str;
}
public int getReactionPermission(Aweme aweme, Aweme aweme2) {
if ((this.reactable || C6861a.m21337f().isMe(aweme.getAuthor().getUid())) && (this.originReactable || C6861a.m21337f().isMe(aweme2.getAuthor().getUid()))) {
return 3;
}
if (this.reactable || C6861a.m21337f().isMe(aweme.getAuthor().getUid())) {
return 2;
}
if (this.originReactable || C6861a.m21337f().isMe(aweme2.getAuthor().getUid())) {
return 1;
}
return 0;
}
}
|
[
"65450641+Xyzdesk@users.noreply.github.com"
] |
65450641+Xyzdesk@users.noreply.github.com
|
8e70ca004085221129d0a18cfc7828fb35427515
|
86a4f4a2dc3f38c0b3188d994950f4c79f036484
|
/src/com/adobe/b/a/b/a$a.java
|
8fe811419e8f0d00d4ac784606c34b1160d5d607
|
[] |
no_license
|
reverseengineeringer/com.cbs.app
|
8f6f3532f119898bfcb6d7ddfeb465eae44d5cd4
|
7e588f7156f36177b0ff8f7dc13151c451a65051
|
refs/heads/master
| 2021-01-10T05:08:31.000287
| 2016-03-19T20:39:17
| 2016-03-19T20:39:17
| 54,283,808
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 565
|
java
|
package com.adobe.b.a.b;
import com.adobe.b.a.b;
final class a$a
{
private final b a;
private final Object b;
a$a(b paramb, Object paramObject)
{
if (paramb == null) {
throw new Error("Event handler callback cannot be null");
}
a = paramb;
if (paramObject == null) {
throw new Error("Event handler context cannot be null");
}
b = paramObject;
}
public final b a()
{
return a;
}
}
/* Location:
* Qualified Name: com.adobe.b.a.b.a.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
7556ec957bd347f7359ff5839f9f0ca4a6c6c679
|
4e81c9107c0dd12679f119f4e97014c6ba84df85
|
/opengl_es_shader_test/src/main/java/com/example/pp/opengl_es_shader_test/MainActivity.java
|
4a6fcd5c41ec8b3bedb7c499e60436ed67559785
|
[] |
no_license
|
PPQingZhao/FFmpegTest_ubuntu
|
29b738931a393e3fa293ad29a91ecdac869048b5
|
74b14c111b9cc377b00794adb6ab358f330ae931
|
refs/heads/master
| 2020-04-01T04:16:52.353946
| 2019-07-05T07:50:08
| 2019-07-05T07:50:08
| 152,856,876
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,975
|
java
|
package com.example.pp.opengl_es_shader_test;
import android.Manifest;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.widget.FrameLayout;
import com.example.pp.opengl_es_shader_test.XPlay.ThreadPool;
import com.example.pp.opengl_es_shader_test.XPlay.XPlay;
import com.tbruyelle.rxpermissions2.Permission;
import com.tbruyelle.rxpermissions2.RxPermissions;
import io.reactivex.functions.Consumer;
public class MainActivity extends AppCompatActivity {
private static final String TAG = MainActivity.class.getSimpleName();
private String SDCARDPATH = Environment.getExternalStorageDirectory().getAbsolutePath();
private FrameLayout xplay;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
xplay = findViewById(R.id.xplay);
requestPermissionList();
}
private void requestPermissionList() {
new RxPermissions(this).
requestEachCombined(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe(new Consumer<Permission>() {
@Override
public void accept(Permission permission) throws Exception {
if (permission.granted) { //全部权限授权成功
init();
} else if (permission.shouldShowRequestPermissionRationale) { //至少有一个权限未授权 并且该权限未勾选不再询问
// showDialogWithoutNeverAgain();
} else { //至少有一个权限未授权 并且已勾选不再询问
// showDialogWithSetting();
}
}
});
}
private void init() {
XPlay xPlay = ThreadPool.obtain(getApplicationContext());
this.xplay.addView(xPlay);
}
}
|
[
"="
] |
=
|
5d541b55e1b7d551247ca728bc52171a20516706
|
60e6e48b0ae8dfc8067ec7b6709d71993455a4d2
|
/spf4j-jaxrs-client/src/main/java/org/spf4j/jaxrs/common/providers/gp/CharSequenceMessageProvider.java
|
f30588e723f174e70adbcee0c29b75660e633960
|
[] |
no_license
|
zolyfarkas/spf4j-jaxrs
|
106932be7223ee777678861185f69b23c07912e2
|
f6f64f27ebbf6474057a9e26d6ea799a1d601a1c
|
refs/heads/master
| 2023-02-16T12:31:53.360133
| 2023-02-11T12:46:11
| 2023-02-11T12:46:11
| 167,740,031
| 3
| 0
| null | 2022-12-08T16:41:31
| 2019-01-26T21:18:36
|
Java
|
UTF-8
|
Java
| false
| false
| 5,471
|
java
|
/*
* Copyright 2019 SPF4J.
*
* 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.spf4j.jaxrs.common.providers.gp;
/**
*
* @author Zoltan Farkas
*/
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* http://glassfish.java.net/public/CDDL+GPL_1_1.html
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.inject.Singleton;
import javax.ws.rs.ext.Provider;
import org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider;
import static org.glassfish.jersey.message.internal.ReaderWriter.BUFFER_SIZE;
@Provider
@Produces({"text/plain", "*/*"})
@Consumes({"text/plain", "*/*"})
@Singleton
public final class CharSequenceMessageProvider extends AbstractMessageReaderWriterProvider<CharSequence> {
@Override
public boolean isReadable(final Class<?> type, final Type genericType, final Annotation[] annotations,
final MediaType mediaType) {
return CharSequence.class == type;
}
@Override
public CharSequence readFrom(
final Class<CharSequence> type,
final Type genericType,
final Annotation[] annotations,
final MediaType mediaType,
final MultivaluedMap<String, String> httpHeaders,
final InputStream entityStream) throws IOException {
return readFromAsString(new InputStreamReader(entityStream, getCharset(mediaType)));
}
private static CharSequence readFromAsString(final Reader reader) throws IOException {
StringBuilder sb = new StringBuilder(128);
char[] c = new char[BUFFER_SIZE];
int l;
while ((l = reader.read(c)) != -1) {
sb.append(c, 0, l);
}
return sb;
}
@Override
public boolean isWriteable(final Class<?> type, final Type genericType, final Annotation[] annotations,
final MediaType mediaType) {
return CharSequence.class.isAssignableFrom(type) && DirectStringMessageProvider.isRaw(annotations);
}
@Override
public long getSize(final CharSequence s, final Class<?> type, final Type genericType, final Annotation[] annotations,
final MediaType mediaType) {
return s.length();
}
@Override
public void writeTo(
final CharSequence t,
final Class<?> type,
final Type genericType,
final Annotation[] annotations,
final MediaType mediaType,
final MultivaluedMap<String, Object> httpHeaders,
final OutputStream entityStream) throws IOException {
writeToAsString(t, entityStream, mediaType);
}
public static void writeToAsString(final CharSequence s, final OutputStream out, final MediaType type)
throws IOException {
Writer osw = new OutputStreamWriter(out, getCharset(type));
osw.append(s);
osw.flush();
}
}
|
[
"zolyfarkas@yahoo.com"
] |
zolyfarkas@yahoo.com
|
57d293284487ed16e329b5275de318f28f8f2c9f
|
a8ecc1424182200da5769f361ea6cc6496a0db79
|
/app/src/main/java/com/footballcitymobileandroid/Entity/ClubEntity/club/Worth.java
|
f0a23804c639220c7f3cdc31fbe6fdb77482ca57
|
[] |
no_license
|
tempest1/FootballCityMobileAndroid
|
c74cdf9c4ffd43866efd4717d172a4513ae10b4e
|
d44d74659d295392660a60d1f72f76b4bd7f9ad6
|
refs/heads/master
| 2020-05-30T08:44:57.736963
| 2016-09-22T07:37:09
| 2016-09-22T07:37:09
| 68,896,455
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 583
|
java
|
package com.footballcitymobileandroid.Entity.ClubEntity.club;
import java.io.Serializable;
/**
* Created by smartlab on 16/5/30.
*/
public class Worth implements Serializable{
private String arena_Name;
private String arena_worth;
public void setArena_Name(String arena_Name) {
this.arena_Name = arena_Name;
}
public String getArena_Name() {
return arena_Name;
}
public void setArena_worth(String arena_worth) {
this.arena_worth = arena_worth;
}
public String getArena_worth() {
return arena_worth;
}
}
|
[
"505675592@qq.com"
] |
505675592@qq.com
|
03b5a9b138b48ac68c4a3e872de80ad622da4ffa
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/training/org/eclipse/jetty/http2/client/SessionFailureTest.java
|
6b673b28541fb3c418808ab07d61338196e081f1
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 4,665
|
java
|
/**
*
*/
/**
* ========================================================================
*/
/**
* Copyright (c) 1995-2019 Mort Bay Consulting Pty. Ltd.
*/
/**
* ------------------------------------------------------------------------
*/
/**
* All rights reserved. This program and the accompanying materials
*/
/**
* are made available under the terms of the Eclipse Public License v1.0
*/
/**
* and Apache License v2.0 which accompanies this distribution.
*/
/**
*
*/
/**
* The Eclipse Public License is available at
*/
/**
* http://www.eclipse.org/legal/epl-v10.html
*/
/**
*
*/
/**
* The Apache License v2.0 is available at
*/
/**
* http://www.opensource.org/licenses/apache2.0.php
*/
/**
*
*/
/**
* You may elect to redistribute this code under either of these licenses.
*/
/**
* ========================================================================
*/
/**
*
*/
package org.eclipse.jetty.http2.client;
import Stream.Listener;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http2.api.Session;
import org.eclipse.jetty.http2.api.Stream;
import org.eclipse.jetty.http2.api.server.ServerSessionListener;
import org.eclipse.jetty.http2.frames.HeadersFrame;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.Promise;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class SessionFailureTest extends AbstractTest {
@Test
public void testWrongPreface() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
start(new ServerSessionListener.Adapter() {
@Override
public void onFailure(Session session, Throwable failure) {
latch.countDown();
}
});
try (Socket socket = new Socket("localhost", connector.getLocalPort())) {
// Preface starts with byte 0x50, send something different.
OutputStream output = socket.getOutputStream();
output.write(0);
output.flush();
Assertions.assertTrue(latch.await(5, TimeUnit.SECONDS));
// The server will reply with a GOAWAY frame, and then shutdown.
// Read until EOF.
socket.setSoTimeout(1000);
InputStream input = socket.getInputStream();
while (true) {
if ((input.read()) < 0)
break;
}
}
}
@Test
public void testWriteFailure() throws Exception {
final CountDownLatch writeLatch = new CountDownLatch(1);
final CountDownLatch serverFailureLatch = new CountDownLatch(1);
start(new ServerSessionListener.Adapter() {
@Override
public Listener onNewStream(Stream stream, HeadersFrame frame) {
// Forcibly close the connection.
getEndPoint().close();
// Now try to write something: it should fail.
stream.headers(frame, new Callback() {
@Override
public void failed(Throwable x) {
writeLatch.countDown();
}
});
return null;
}
@Override
public void onFailure(Session session, Throwable failure) {
serverFailureLatch.countDown();
}
});
final CountDownLatch clientFailureLatch = new CountDownLatch(1);
Session session = newClient(new Session.Listener.Adapter() {
@Override
public void onFailure(Session session, Throwable failure) {
clientFailureLatch.countDown();
}
});
HeadersFrame frame = new HeadersFrame(newRequest("GET", new HttpFields()), null, true);
Promise<Stream> promise = new Promise.Adapter<>();
session.newStream(frame, promise, null);
Assertions.assertTrue(writeLatch.await(5, TimeUnit.SECONDS));
Assertions.assertTrue(serverFailureLatch.await(5, TimeUnit.SECONDS));
Assertions.assertTrue(clientFailureLatch.await(5, TimeUnit.SECONDS));
long start = System.nanoTime();
long now = System.nanoTime();
while (getEndPoint().isOpen()) {
MatcherAssert.assertThat(TimeUnit.NANOSECONDS.toSeconds((now - start)), Matchers.lessThanOrEqualTo(5L));
Thread.sleep(10);
now = System.nanoTime();
}
}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
6f352f9446a38bdbb14dc8788e3960b7c179c7ab
|
99391f2c4a45b57c5df2e973ae8034789fabfcb0
|
/webserver/workspace/FadeCandyTest/src/emilylights/audio/Audio.java
|
16cc70d4113d050844fc177f755917b11b50e9a6
|
[] |
no_license
|
egold555/EmilyLights
|
86a47565127aa85692dec429d5a93ee1d9445d12
|
56738043b04919ff5e43dd6b0047503930a0a62e
|
refs/heads/master
| 2022-12-13T22:40:46.917261
| 2019-09-24T19:53:30
| 2019-09-24T19:53:30
| 139,094,629
| 5
| 1
| null | 2022-12-09T04:58:36
| 2018-06-29T03:07:40
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 4,698
|
java
|
package emilylights.audio;
import java.io.*;
import javax.sound.sampled.*;
public class Audio
{
//private static final int BUFFER_LENGTH = 2048;
//private static final int AUDIO_LEVEL_BUFFER_LENGTH = 100;
ByteArrayOutputStream byteArrayOutputStream;
AudioFormat audioFormat;
TargetDataLine targetDataLine;
AudioInputStream audioInputStream;
SourceDataLine sourceDataLine;
Mixer.Info[] mixerInfo;
Mixer.Info[] supported_mixerInfo;
Mixer mixer;
boolean mixer_opened;
byte[] tempBuffer;
SoundSpectrum sound_spectrum;
private int[] audio_level_buffer;
public Audio() {
this.mixer_opened = false;
this.tempBuffer = new byte[2048];
this.sound_spectrum = new SoundSpectrum();
this.audio_level_buffer = new int[100];
for (int i = 0; i < 100; ++i) {
this.audio_level_buffer[i] = 0;
}
}
public Mixer.Info[] GetMixerInfo() {
int count = 0;
try {
final Line.Info targetDLInfo = new Line.Info(TargetDataLine.class);
this.mixerInfo = AudioSystem.getMixerInfo();
this.supported_mixerInfo = AudioSystem.getMixerInfo();
for (int cnt = 0; cnt < this.mixerInfo.length; ++cnt) {
final Mixer currentMixer = AudioSystem.getMixer(this.mixerInfo[cnt]);
if (currentMixer.isLineSupported(targetDLInfo)) {
this.supported_mixerInfo[count] = this.mixerInfo[cnt];
++count;
}
}
this.mixerInfo = new Mixer.Info[count];
for (int i = 0; i < this.mixerInfo.length; ++i) {
this.mixerInfo[i] = this.supported_mixerInfo[i];
}
}
catch (Exception e) {
e.printStackTrace();
}
return this.mixerInfo;
}
public void SetAudioFormat() {
this.audioFormat = this.getAudioFormat();
}
public void Set_and_Start_Mixer(final int dev) {
final DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, this.audioFormat);
try {
this.mixer = AudioSystem.getMixer(this.mixerInfo[dev]);
(this.targetDataLine = (TargetDataLine)this.mixer.getLine(dataLineInfo)).open(this.audioFormat);
this.targetDataLine.start();
this.mixer_opened = true;
}
catch (Exception e) {
e.printStackTrace();
this.mixer_opened = false;
}
}
public void Stop_Mixer() {
this.mixer.close();
this.mixer_opened = false;
}
public int[] processAudio(final AudioPropertiers audio_properties) {
final int[] stereo_level = new int[2];
if (this.mixer_opened) {
try {
//final int cnt = this.targetDataLine.read(this.tempBuffer, 0, this.tempBuffer.length);
audio_properties.fft = this.do_fft_and_spectrum(this.tempBuffer, audio_properties.fft_binns, stereo_level);
stereo_level[0] *= (int)(audio_properties.gain / 10.0f);
stereo_level[1] *= (int)(audio_properties.gain / 10.0f);
if (stereo_level[0] > 100) {
stereo_level[0] = 100;
}
if (stereo_level[1] > 100) {
stereo_level[1] = 100;
}
audio_properties.stereo_audio_level = (stereo_level[0] + stereo_level[1]) / 2;
int average_audio_level = 0;
for (int i = 0; i < 99; ++i) {
this.audio_level_buffer[i] = this.audio_level_buffer[i + 1];
average_audio_level += this.audio_level_buffer[i];
}
this.audio_level_buffer[99] = audio_properties.stereo_audio_level;
average_audio_level += this.audio_level_buffer[99];
average_audio_level /= 100;
audio_properties.average_audio_level = average_audio_level;
}
catch (Exception e) {
e.printStackTrace();
}
}
return stereo_level;
}
private AudioFormat getAudioFormat() {
final float sampleRate = 44100.0f;
final int sampleSizeInBits = 16;
final int channels = 2;
final boolean signed = true;
final boolean bigEndian = false;
return new AudioFormat(sampleRate, sampleSizeInBits, channels, signed, bigEndian);
}
float[] do_fft_and_spectrum(final byte[] buffer, final int number_of_binns, final int[] stereo_level) {
return this.sound_spectrum.do_fft(buffer, number_of_binns, stereo_level);
}
}
|
[
"eric@golde.org"
] |
eric@golde.org
|
6d9babebfd1f1b7225fcebf9d86b5842df085231
|
440e5bff3d6aaed4b07eca7f88f41dd496911c6b
|
/myapplication/src/main/java/com/vlocker/setting/a/a/i.java
|
08b2c0b54ef34a746048c406006bb22751a9fdc1
|
[] |
no_license
|
freemanZYQ/GoogleRankingHook
|
4d4968cf6b2a6c79335b3ba41c1c9b80e964ddd3
|
bf9affd70913127f4cd0f374620487b7e39b20bc
|
refs/heads/master
| 2021-04-29T06:55:00.833701
| 2018-01-05T06:14:34
| 2018-01-05T06:14:34
| 77,991,340
| 7
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,240
|
java
|
package com.vlocker.setting.a.a;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Build;
import android.os.Build.VERSION;
import android.util.Log;
import com.vlocker.setting.a.a;
import com.vlocker.setting.a.b;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
public class i {
private static Map a = new HashMap();
private String b = null;
private String c = null;
private int d = 1;
private String a(String str) {
String str2 = (String) a.get(this.b);
if (!a.containsKey(str)) {
if ("display".equals(this.b)) {
str2 = Build.DISPLAY;
} else if ("device".equals(this.b)) {
str2 = Build.DEVICE;
} else if ("manufacturer".equals(this.b)) {
str2 = Build.MANUFACTURER;
} else if ("product".equals(this.b)) {
str2 = Build.PRODUCT;
} else if ("model".equals(this.b)) {
str2 = Build.MODEL;
} else if ("sdk".equals(this.b)) {
str2 = "" + VERSION.SDK_INT;
} else if ("brand".equals(this.b)) {
str2 = Build.BRAND;
} else if (this.b.startsWith("ro.")) {
str2 = b.getPropertyByName(this.b);
if ("ro.com.google.gmsversion".equals(this.b) && str2 == "") {
str2 = "-";
}
} else {
str2 = this.b;
}
str2 = str2 == null ? "" : str2.toLowerCase(Locale.ENGLISH);
if (str2.contains("h2os")) {
str2 = str2.replaceAll("h2os", "");
}
a.put(this.b, str2);
Log.d(getClass().getSimpleName(), this.b + ":" + str2);
}
return str2;
}
private final boolean a(String str, String str2) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(str, str2));
return a.getInstance().getContext().getPackageManager().queryIntentActivities(intent, 1).size() > 0;
}
public boolean matched() {
boolean z = true;
boolean z2 = false;
String a = a(this.b);
if (!(a == null || a.isEmpty())) {
long versionCodeByString;
boolean z3;
switch (this.d) {
case 1:
z2 = a.contains(this.c);
break;
case 2:
z2 = a.startsWith(this.c);
break;
case 3:
z2 = a.endsWith(this.c);
break;
case 4:
z2 = a.equals(this.c);
break;
case 5:
versionCodeByString = b.getVersionCodeByString(this.c);
if (versionCodeByString != -1) {
if (b.getVersionCodeByString(a) < versionCodeByString) {
z = false;
}
z2 = z;
break;
}
break;
case 7:
versionCodeByString = b.getVersionCodeByString(this.c);
if (versionCodeByString != -1) {
if (b.getVersionCodeByString(a) <= versionCodeByString) {
z3 = false;
break;
}
z3 = true;
break;
}
case 6:
z3 = false;
break;
case 8:
z2 = a(this.b, this.c);
break;
}
versionCodeByString = b.getVersionCodeByString(this.c);
if (versionCodeByString != -1) {
if (b.getVersionCodeByString(a) >= versionCodeByString) {
z = false;
}
z2 = z;
} else {
z2 = z3;
}
}
Log.d(getClass().getSimpleName(), this.b + ":" + this.d + "@" + a + "#" + this.c + "=" + z2);
return z2;
}
@com.vlocker.setting.common.a.b(a = "condition")
public void setCondition(String str) {
String toLowerCase = str.toLowerCase(Locale.ENGLISH);
if ("any".equals(toLowerCase)) {
this.d = 1;
} else if ("left".equals(toLowerCase)) {
this.d = 2;
} else if ("right".equals(toLowerCase)) {
this.d = 3;
} else if ("equal".equals(toLowerCase)) {
this.d = 4;
} else if ("ge".equals(toLowerCase)) {
this.d = 5;
} else if ("lt".equals(toLowerCase)) {
this.d = 6;
} else if ("intent".equals(toLowerCase)) {
this.d = 8;
} else if ("gt".equals(toLowerCase)) {
this.d = 7;
}
}
@com.vlocker.setting.common.a.b(a = "key")
public void setKey(String str) {
this.b = str.toLowerCase(Locale.ENGLISH);
}
@com.vlocker.setting.common.a.b(a = "value")
public void setValue(String str) {
this.c = str.toLowerCase(Locale.ENGLISH);
}
}
|
[
"zhengyuqin@youmi.net"
] |
zhengyuqin@youmi.net
|
511426f9467ef36c3bf55b2798d581d1b74cc83f
|
326c758417e1d3de91b5d9f648bda597aada75ca
|
/wayn-mall/src/main/java/com/wayn/mall/config/WebConfig.java
|
8cb612691fb36d27d06d9a84d96ac450fa19f06c
|
[
"Apache-2.0"
] |
permissive
|
bluemapleleaf/waynboot-sso
|
4bd0f57303a3c50222e687a7c5328326552bdcb3
|
4637281e0fb742d10602e0e6e0539f3114e0ecb9
|
refs/heads/master
| 2023-06-07T00:52:36.456179
| 2021-07-04T11:01:13
| 2021-07-04T11:01:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,908
|
java
|
package com.wayn.mall.config;
import com.wayn.mall.intercepter.MallLoginValidateIntercepter;
import com.wayn.mall.intercepter.MallShopCartNumberInterceptor;
import com.wayn.mall.intercepter.RepeatSubmitInterceptor;
import com.wayn.ssocore.filter.SsoFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.servlet.DispatcherType;
import java.util.Arrays;
import java.util.LinkedHashMap;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Value("${wayn.uploadDir}")
private String uploadDir;
@Value("${wayn.ssoServerUrl}")
private String ssoServerUrl;
@Value("${wayn.currentServerUrl}")
private String currentServerUrl;
@Value("${wayn.xssFilter.excludeUrls}")
private String excludeUrls;
@Autowired
private RepeatSubmitInterceptor repeatSubmitInterceptor;
@Bean
public FilterRegistrationBean filterRegistrationBean() {
FilterRegistrationBean bean = new FilterRegistrationBean();
SsoFilter ssoFilter = new SsoFilter();
ssoFilter.setSsoServerUrl(ssoServerUrl);
bean.setFilter(ssoFilter);
bean.setDispatcherTypes(DispatcherType.REQUEST);
bean.setName("ssoFilter");
bean.setUrlPatterns(Arrays.asList("/admin/*"));
LinkedHashMap<String, Object> linkedHashMap = new LinkedHashMap<>();
linkedHashMap.put("excludeUrls", excludeUrls);
bean.setInitParameters(linkedHashMap);
return bean;
}
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addRedirectViewController("/", "/index");
registry.addRedirectViewController("/admin/logout", ssoServerUrl + "/logout?backUrl=" + currentServerUrl);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
/** 本地文件上传路径 */
registry.addResourceHandler("/upload/**").addResourceLocations("file:" + uploadDir + "/");
registry.addResourceHandler("/goods-img/**").addResourceLocations("file:" + uploadDir + "/");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new MallLoginValidateIntercepter())
.excludePathPatterns("/login")
.excludePathPatterns("/logout")
.excludePathPatterns("/")
.excludePathPatterns("/index")
.excludePathPatterns("/search")
.excludePathPatterns("/coupon")
.excludePathPatterns("/goods/**")
.excludePathPatterns("/seckill/list")
.excludePathPatterns("/seckill/detail/*")
.excludePathPatterns("/seckill/time/now")
.excludePathPatterns("/seckill/*/exposer")
.excludePathPatterns("/register")
.excludePathPatterns("/upload/**")
.excludePathPatterns("/goods-img/**")
.excludePathPatterns("/common/**")
.excludePathPatterns("/mall/**")
.excludePathPatterns("/admin/**");
// 购物车中的数量统一处理
registry.addInterceptor(mallShopCartNumberInterceptor())
.excludePathPatterns("/admin/**")
.excludePathPatterns("/register")
.excludePathPatterns("/login")
.excludePathPatterns("/logout")
.excludePathPatterns("/common/**")
.excludePathPatterns("/**/*.jpg")
.excludePathPatterns("/**/*.png")
.excludePathPatterns("/**/*.gif")
.excludePathPatterns("/**/*.map")
.excludePathPatterns("/**/*.css")
.excludePathPatterns("/**/*.js");
// 添加一个拦截器,拦截以/admin为前缀的url路径(后台登陆拦截)
/*registry.addInterceptor(new AdminLoginInterceptor())
.addPathPatterns("/admin/**")
.excludePathPatterns("/admin/login")
.excludePathPatterns("/admin/dist/**")
.excludePathPatterns("/admin/plugins/**");*/
registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
}
@Bean
public MallShopCartNumberInterceptor mallShopCartNumberInterceptor() {
return new MallShopCartNumberInterceptor();
}
}
|
[
"1669738430@qq.com"
] |
1669738430@qq.com
|
10bb576bd47228ba39ee30fb3cd654bd99bd1f9d
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XWIKI-14263-54-8-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/velocity/internal/DefaultVelocityEngine_ESTest.java
|
009318c0fb7f4adefb89253c97aebf50da599829
|
[] |
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
* Sun Apr 05 01:48:41 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
|
7e72f09928b48312ea199abf504497e71457a7d1
|
616e7e56a78aec1448a4b24b436d948546131aeb
|
/14-LojaAppPUT/src/br/com/fiap/resource/AulaResource.java
|
106e4de4e4af69b3a9d7e2d084bad53da2e3f19b
|
[] |
no_license
|
GabrielRossanezi/restful_novo
|
296681853442e273903d6220949b50a0bc92ad5b
|
3230fcf30cb1e914407983ba87dcbfe367f4e4e9
|
refs/heads/master
| 2020-05-01T00:07:22.475905
| 2019-03-22T15:04:35
| 2019-03-22T15:04:35
| 177,160,930
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 872
|
java
|
package br.com.fiap.resource;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import br.com.fiap.dao.impl.AulaDaoImpl;
import br.com.fiap.entity.AulaTO;
import br.com.fiap.exception.CodigoInexistenteException;
import br.com.fiap.singleton.EntityManagerFactorySingleton;
@Path("/aula")
public class AulaResource {
private EntityManagerFactory fabrica = EntityManagerFactorySingleton.getInstance();
@GET
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public AulaTO buscar(@PathParam("id") int codigo) throws CodigoInexistenteException{
EntityManager em = fabrica.createEntityManager();
AulaDaoImpl aulaDao = new AulaDaoImpl(em);
return aulaDao.pesquisar(codigo);
}
}
|
[
"logonrmlocal@fiap.com.br"
] |
logonrmlocal@fiap.com.br
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.