blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
e04f11a7bf3b7cc7e1bf337ec4c1e08491fd668f
45c898435632d4302d1d499bb3067250ad935e00
/src/test/java/com/ega/datarepositorysevice/utils/ConnectionChecker.java
19e321c63182282a6ef490d02edfda4798b34720
[]
no_license
EbiEga/gsoc-drs
b7a77c233ca785de36b0ec2c434fefac2d89c491
e504ce7c63f2f8fa67b477440dbe31e10e20da46
refs/heads/master
2020-05-25T12:28:33.062715
2019-07-09T14:56:57
2019-07-09T14:56:57
187,798,851
0
2
null
2019-08-16T08:00:03
2019-05-21T08:50:54
Java
UTF-8
Java
false
false
686
java
package com.ega.datarepositorysevice.utils; import org.springframework.beans.factory.annotation.Value; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectionChecker { @Value("${spring.datasource.url}") private String uri; @Value("${spring.datasource.password}") private String password; @Value("${spring.datasource.username}") private String username; public boolean connect() { try (Connection conn = DriverManager.getConnection( uri, username, password)) { return conn != null; } catch (Exception e) { return false; } } }
[ "dilschat@yandex.ru" ]
dilschat@yandex.ru
ba7636a83a17824e2c13fc4191eea714e5f43e9d
f0528fcbe00e58d5fca326cdaca80496da37219a
/java/src/main/java/minijava/backend/i386/InstrUnary.java
e952a76f08f0c6fdeb501ca9814df2f7258ee6fb
[]
no_license
uelis/Compiler
c231ea6bc096a948f12a93b63ad42c6765eecfb4
91dcd7eed969ecb3c0d381bb91ffa2100653cae5
refs/heads/master
2021-01-05T23:57:26.346094
2020-02-17T17:56:48
2020-02-20T17:07:53
241,172,262
0
0
null
null
null
null
UTF-8
Java
false
false
2,618
java
package minijava.backend.i386; import minijava.backend.i386.Operand.Reg; import minijava.intermediate.Label; import minijava.intermediate.Temp; import minijava.util.Pair; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.function.Function; final class InstrUnary implements I386Instruction { enum Kind { PUSH, POP, NEG, NOT, INC, DEC, IDIV, IMUL } private Operand op; private final Kind kind; InstrUnary(Kind kind, Operand op) { assert (!(kind == Kind.POP || kind == Kind.NEG || kind == Kind.NOT || kind == Kind.INC || kind == Kind.DEC || kind == Kind.IDIV) || !(op instanceof Operand.Imm)); this.op = op; this.kind = kind; } @Override public List<Temp> use() { switch (kind) { case POP: return Collections.emptyList(); case PUSH: case NEG: case NOT: case INC: case DEC: return op.use(); case IDIV: { List<Temp> use = new ArrayList<>(op.use()); use.add(Registers.eax); use.add(Registers.edx); return use; } case IMUL: { List<Temp> use = new ArrayList<>(op.use()); use.add(Registers.eax); return use; } default: assert (false); return null; } } @Override public List<Temp> def() { switch (kind) { case PUSH: return Collections.emptyList(); case POP: case NEG: case NOT: case INC: case DEC: if (op instanceof Operand.Reg) { return Collections.singletonList(((Reg) op).reg); } else { return Collections.emptyList(); } case IDIV: { List<Temp> def = new ArrayList<>(2); def.add(Registers.eax); def.add(Registers.edx); return def; } case IMUL: { List<Temp> def = new ArrayList<>(2); def.add(Registers.eax); def.add(Registers.edx); return def; } default: assert (false); return null; } } @Override public List<Label> jumps() { return Collections.emptyList(); } @Override public boolean isFallThrough() { return true; } @Override public Pair<Temp, Temp> isMoveBetweenTemps() { return null; } @Override public Label isLabel() { return null; } @Override public void render(StringBuilder s) { s.append('\t') .append(kind) .append(' '); op.render(s); s.append('\n'); } @Override public void rename(Function<Temp, Temp> sigma) { op = op.rename(sigma); } }
[ "info@ulrichschoepp.de" ]
info@ulrichschoepp.de
d14dd1ffe29a6aca45c6524a5bd4a9acd5c12b70
cedde114183afbe0ca758ff2edbba40439780519
/web_first/day13_Filter_Listener/day13_Filter&Listener/src/web/filter/FilterTest07.java
542e62da5b0c9fce830d5084aa19dc99b4b651f2
[]
no_license
Koi-lucky/javaWeb
3e310bb4bcad9d6cd8ff62a131d2162b729f65e1
ab697e9a741965621bfec2469b2b37e665f7531b
refs/heads/master
2023-02-10T15:00:53.259848
2021-01-11T10:06:42
2021-01-11T10:06:42
282,159,785
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
package web.filter; import javax.servlet.*; import javax.servlet.annotation.WebFilter; import java.io.IOException; @WebFilter("/*") public class FilterTest07 implements Filter { public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException { System.out.println("FilterTest07被执行了~~~"); //放行 chain.doFilter(req, resp); System.out.println("FilterTest07回来了~~~"); } public void init(FilterConfig config) throws ServletException { } public void destroy() { } }
[ "2465585664@qq.com" ]
2465585664@qq.com
2823d656b664d068b48c55ae5d151d8e25a228d8
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/aosp-mirror--platform_frameworks_base/a772e5fc062c8de48cb9c1d61755110f6b2e189b/before/SoundTrigger.java
b95da712c478ed8def8781debedd477cb828034d
[]
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
47,391
java
/** * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.soundtrigger; import android.media.AudioFormat; import android.os.Handler; import android.os.Parcel; import android.os.Parcelable; import java.util.ArrayList; import java.util.Arrays; import java.util.UUID; import static android.system.OsConstants.*; /** * The SoundTrigger class provides access via JNI to the native service managing * the sound trigger HAL. * * @hide */ public class SoundTrigger { public static final int STATUS_OK = 0; public static final int STATUS_ERROR = Integer.MIN_VALUE; public static final int STATUS_PERMISSION_DENIED = -EPERM; public static final int STATUS_NO_INIT = -ENODEV; public static final int STATUS_BAD_VALUE = -EINVAL; public static final int STATUS_DEAD_OBJECT = -EPIPE; public static final int STATUS_INVALID_OPERATION = -ENOSYS; /***************************************************************************** * A ModuleProperties describes a given sound trigger hardware module * managed by the native sound trigger service. Each module has a unique * ID used to target any API call to this paricular module. Module * properties are returned by listModules() method. ****************************************************************************/ public static class ModuleProperties implements Parcelable { /** Unique module ID provided by the native service */ public final int id; /** human readable voice detection engine implementor */ public final String implementor; /** human readable voice detection engine description */ public final String description; /** Unique voice engine Id (changes with each version) */ public final UUID uuid; /** Voice detection engine version */ public final int version; /** Maximum number of active sound models */ public final int maxSoundModels; /** Maximum number of key phrases */ public final int maxKeyphrases; /** Maximum number of users per key phrase */ public final int maxUsers; /** Supported recognition modes (bit field, RECOGNITION_MODE_VOICE_TRIGGER ...) */ public final int recognitionModes; /** Supports seamless transition to capture mode after recognition */ public final boolean supportsCaptureTransition; /** Maximum buffering capacity in ms if supportsCaptureTransition() is true */ public final int maxBufferMs; /** Supports capture by other use cases while detection is active */ public final boolean supportsConcurrentCapture; /** Rated power consumption when detection is active with TDB silence/sound/speech ratio */ public final int powerConsumptionMw; /** Returns the trigger (key phrase) capture in the binary data of the * recognition callback event */ public final boolean returnsTriggerInEvent; ModuleProperties(int id, String implementor, String description, String uuid, int version, int maxSoundModels, int maxKeyphrases, int maxUsers, int recognitionModes, boolean supportsCaptureTransition, int maxBufferMs, boolean supportsConcurrentCapture, int powerConsumptionMw, boolean returnsTriggerInEvent) { this.id = id; this.implementor = implementor; this.description = description; this.uuid = UUID.fromString(uuid); this.version = version; this.maxSoundModels = maxSoundModels; this.maxKeyphrases = maxKeyphrases; this.maxUsers = maxUsers; this.recognitionModes = recognitionModes; this.supportsCaptureTransition = supportsCaptureTransition; this.maxBufferMs = maxBufferMs; this.supportsConcurrentCapture = supportsConcurrentCapture; this.powerConsumptionMw = powerConsumptionMw; this.returnsTriggerInEvent = returnsTriggerInEvent; } public static final Parcelable.Creator<ModuleProperties> CREATOR = new Parcelable.Creator<ModuleProperties>() { public ModuleProperties createFromParcel(Parcel in) { return ModuleProperties.fromParcel(in); } public ModuleProperties[] newArray(int size) { return new ModuleProperties[size]; } }; private static ModuleProperties fromParcel(Parcel in) { int id = in.readInt(); String implementor = in.readString(); String description = in.readString(); String uuid = in.readString(); int version = in.readInt(); int maxSoundModels = in.readInt(); int maxKeyphrases = in.readInt(); int maxUsers = in.readInt(); int recognitionModes = in.readInt(); boolean supportsCaptureTransition = in.readByte() == 1; int maxBufferMs = in.readInt(); boolean supportsConcurrentCapture = in.readByte() == 1; int powerConsumptionMw = in.readInt(); boolean returnsTriggerInEvent = in.readByte() == 1; return new ModuleProperties(id, implementor, description, uuid, version, maxSoundModels, maxKeyphrases, maxUsers, recognitionModes, supportsCaptureTransition, maxBufferMs, supportsConcurrentCapture, powerConsumptionMw, returnsTriggerInEvent); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(id); dest.writeString(implementor); dest.writeString(description); dest.writeString(uuid.toString()); dest.writeInt(version); dest.writeInt(maxSoundModels); dest.writeInt(maxKeyphrases); dest.writeInt(maxUsers); dest.writeInt(recognitionModes); dest.writeByte((byte) (supportsCaptureTransition ? 1 : 0)); dest.writeInt(maxBufferMs); dest.writeByte((byte) (supportsConcurrentCapture ? 1 : 0)); dest.writeInt(powerConsumptionMw); dest.writeByte((byte) (returnsTriggerInEvent ? 1 : 0)); } @Override public int describeContents() { return 0; } @Override public String toString() { return "ModuleProperties [id=" + id + ", implementor=" + implementor + ", description=" + description + ", uuid=" + uuid + ", version=" + version + ", maxSoundModels=" + maxSoundModels + ", maxKeyphrases=" + maxKeyphrases + ", maxUsers=" + maxUsers + ", recognitionModes=" + recognitionModes + ", supportsCaptureTransition=" + supportsCaptureTransition + ", maxBufferMs=" + maxBufferMs + ", supportsConcurrentCapture=" + supportsConcurrentCapture + ", powerConsumptionMw=" + powerConsumptionMw + ", returnsTriggerInEvent=" + returnsTriggerInEvent + "]"; } } /***************************************************************************** * A SoundModel describes the attributes and contains the binary data used by the hardware * implementation to detect a particular sound pattern. * A specialized version {@link KeyphraseSoundModel} is defined for key phrase * sound models. ****************************************************************************/ public static class SoundModel { /** Undefined sound model type */ public static final int TYPE_UNKNOWN = -1; /** Keyphrase sound model */ public static final int TYPE_KEYPHRASE = 0; /** Unique sound model identifier */ public final UUID uuid; /** Sound model type (e.g. TYPE_KEYPHRASE); */ public final int type; /** Unique sound model vendor identifier */ public final UUID vendorUuid; /** Opaque data. For use by vendor implementation and enrollment application */ public final byte[] data; public SoundModel(UUID uuid, UUID vendorUuid, int type, byte[] data) { this.uuid = uuid; this.vendorUuid = vendorUuid; this.type = type; this.data = data; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(data); result = prime * result + type; result = prime * result + ((uuid == null) ? 0 : uuid.hashCode()); result = prime * result + ((vendorUuid == null) ? 0 : vendorUuid.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof SoundModel)) return false; SoundModel other = (SoundModel) obj; if (!Arrays.equals(data, other.data)) return false; if (type != other.type) return false; if (uuid == null) { if (other.uuid != null) return false; } else if (!uuid.equals(other.uuid)) return false; if (vendorUuid == null) { if (other.vendorUuid != null) return false; } else if (!vendorUuid.equals(other.vendorUuid)) return false; return true; } } /***************************************************************************** * A Keyphrase describes a key phrase that can be detected by a * {@link KeyphraseSoundModel} ****************************************************************************/ public static class Keyphrase implements Parcelable { /** Unique identifier for this keyphrase */ public final int id; /** Recognition modes supported for this key phrase in the model */ public final int recognitionModes; /** Locale of the keyphrase. JAVA Locale string e.g en_US */ public final String locale; /** Key phrase text */ public final String text; /** Users this key phrase has been trained for. countains sound trigger specific user IDs * derived from system user IDs {@link android.os.UserHandle#getIdentifier()}. */ public final int[] users; public Keyphrase(int id, int recognitionModes, String locale, String text, int[] users) { this.id = id; this.recognitionModes = recognitionModes; this.locale = locale; this.text = text; this.users = users; } public static final Parcelable.Creator<Keyphrase> CREATOR = new Parcelable.Creator<Keyphrase>() { public Keyphrase createFromParcel(Parcel in) { return Keyphrase.fromParcel(in); } public Keyphrase[] newArray(int size) { return new Keyphrase[size]; } }; private static Keyphrase fromParcel(Parcel in) { int id = in.readInt(); int recognitionModes = in.readInt(); String locale = in.readString(); String text = in.readString(); int[] users = null; int numUsers = in.readInt(); if (numUsers >= 0) { users = new int[numUsers]; in.readIntArray(users); } return new Keyphrase(id, recognitionModes, locale, text, users); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(id); dest.writeInt(recognitionModes); dest.writeString(locale); dest.writeString(text); if (users != null) { dest.writeInt(users.length); dest.writeIntArray(users); } else { dest.writeInt(-1); } } @Override public int describeContents() { return 0; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((text == null) ? 0 : text.hashCode()); result = prime * result + id; result = prime * result + ((locale == null) ? 0 : locale.hashCode()); result = prime * result + recognitionModes; result = prime * result + Arrays.hashCode(users); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Keyphrase other = (Keyphrase) obj; if (text == null) { if (other.text != null) return false; } else if (!text.equals(other.text)) return false; if (id != other.id) return false; if (locale == null) { if (other.locale != null) return false; } else if (!locale.equals(other.locale)) return false; if (recognitionModes != other.recognitionModes) return false; if (!Arrays.equals(users, other.users)) return false; return true; } @Override public String toString() { return "Keyphrase [id=" + id + ", recognitionModes=" + recognitionModes + ", locale=" + locale + ", text=" + text + ", users=" + Arrays.toString(users) + "]"; } } /***************************************************************************** * A KeyphraseSoundModel is a specialized {@link SoundModel} for key phrases. * It contains data needed by the hardware to detect a certain number of key phrases * and the list of corresponding {@link Keyphrase} descriptors. ****************************************************************************/ public static class KeyphraseSoundModel extends SoundModel implements Parcelable { /** Key phrases in this sound model */ public final Keyphrase[] keyphrases; // keyword phrases in model public KeyphraseSoundModel( UUID uuid, UUID vendorUuid, byte[] data, Keyphrase[] keyphrases) { super(uuid, vendorUuid, TYPE_KEYPHRASE, data); this.keyphrases = keyphrases; } public static final Parcelable.Creator<KeyphraseSoundModel> CREATOR = new Parcelable.Creator<KeyphraseSoundModel>() { public KeyphraseSoundModel createFromParcel(Parcel in) { return KeyphraseSoundModel.fromParcel(in); } public KeyphraseSoundModel[] newArray(int size) { return new KeyphraseSoundModel[size]; } }; private static KeyphraseSoundModel fromParcel(Parcel in) { UUID uuid = UUID.fromString(in.readString()); UUID vendorUuid = null; int length = in.readInt(); if (length >= 0) { vendorUuid = UUID.fromString(in.readString()); } byte[] data = in.readBlob(); Keyphrase[] keyphrases = in.createTypedArray(Keyphrase.CREATOR); return new KeyphraseSoundModel(uuid, vendorUuid, data, keyphrases); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(uuid.toString()); if (vendorUuid == null) { dest.writeInt(-1); } else { dest.writeInt(vendorUuid.toString().length()); dest.writeString(vendorUuid.toString()); } dest.writeBlob(data); dest.writeTypedArray(keyphrases, flags); } @Override public String toString() { return "KeyphraseSoundModel [keyphrases=" + Arrays.toString(keyphrases) + ", uuid=" + uuid + ", vendorUuid=" + vendorUuid + ", type=" + type + ", data=" + (data == null ? 0 : data.length) + "]"; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + Arrays.hashCode(keyphrases); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof KeyphraseSoundModel)) return false; KeyphraseSoundModel other = (KeyphraseSoundModel) obj; if (!Arrays.equals(keyphrases, other.keyphrases)) return false; return true; } } /** * Modes for key phrase recognition */ /** Simple recognition of the key phrase */ public static final int RECOGNITION_MODE_VOICE_TRIGGER = 0x1; /** Trigger only if one user is identified */ public static final int RECOGNITION_MODE_USER_IDENTIFICATION = 0x2; /** Trigger only if one user is authenticated */ public static final int RECOGNITION_MODE_USER_AUTHENTICATION = 0x4; /** * Status codes for {@link RecognitionEvent} */ /** Recognition success */ public static final int RECOGNITION_STATUS_SUCCESS = 0; /** Recognition aborted (e.g. capture preempted by anotehr use case */ public static final int RECOGNITION_STATUS_ABORT = 1; /** Recognition failure */ public static final int RECOGNITION_STATUS_FAILURE = 2; /** * A RecognitionEvent is provided by the * {@link StatusListener#onRecognition(RecognitionEvent)} * callback upon recognition success or failure. */ public static class RecognitionEvent implements Parcelable { /** Recognition status e.g {@link #RECOGNITION_STATUS_SUCCESS} */ public final int status; /** Sound Model corresponding to this event callback */ public final int soundModelHandle; /** True if it is possible to capture audio from this utterance buffered by the hardware */ public final boolean captureAvailable; /** Audio session ID to be used when capturing the utterance with an AudioRecord * if captureAvailable() is true. */ public final int captureSession; /** Delay in ms between end of model detection and start of audio available for capture. * A negative value is possible (e.g. if keyphrase is also available for capture) */ public final int captureDelayMs; /** Duration in ms of audio captured before the start of the trigger. 0 if none. */ public final int capturePreambleMs; /** True if the trigger (key phrase capture is present in binary data */ public final boolean triggerInData; /** Audio format of either the trigger in event data or to use for capture of the * rest of the utterance */ public AudioFormat captureFormat; /** Opaque data for use by system applications who know about voice engine internals, * typically during enrollment. */ public final byte[] data; public RecognitionEvent(int status, int soundModelHandle, boolean captureAvailable, int captureSession, int captureDelayMs, int capturePreambleMs, boolean triggerInData, AudioFormat captureFormat, byte[] data) { this.status = status; this.soundModelHandle = soundModelHandle; this.captureAvailable = captureAvailable; this.captureSession = captureSession; this.captureDelayMs = captureDelayMs; this.capturePreambleMs = capturePreambleMs; this.triggerInData = triggerInData; this.captureFormat = captureFormat; this.data = data; } public static final Parcelable.Creator<RecognitionEvent> CREATOR = new Parcelable.Creator<RecognitionEvent>() { public RecognitionEvent createFromParcel(Parcel in) { return RecognitionEvent.fromParcel(in); } public RecognitionEvent[] newArray(int size) { return new RecognitionEvent[size]; } }; private static RecognitionEvent fromParcel(Parcel in) { int status = in.readInt(); int soundModelHandle = in.readInt(); boolean captureAvailable = in.readByte() == 1; int captureSession = in.readInt(); int captureDelayMs = in.readInt(); int capturePreambleMs = in.readInt(); boolean triggerInData = in.readByte() == 1; AudioFormat captureFormat = null; if (in.readByte() == 1) { int sampleRate = in.readInt(); int encoding = in.readInt(); int channelMask = in.readInt(); captureFormat = (new AudioFormat.Builder()) .setChannelMask(channelMask) .setEncoding(encoding) .setSampleRate(sampleRate) .build(); } byte[] data = in.readBlob(); return new RecognitionEvent(status, soundModelHandle, captureAvailable, captureSession, captureDelayMs, capturePreambleMs, triggerInData, captureFormat, data); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(status); dest.writeInt(soundModelHandle); dest.writeByte((byte) (captureAvailable ? 1 : 0)); dest.writeInt(captureSession); dest.writeInt(captureDelayMs); dest.writeInt(capturePreambleMs); dest.writeByte((byte) (triggerInData ? 1 : 0)); if (captureFormat != null) { dest.writeByte((byte)1); dest.writeInt(captureFormat.getSampleRate()); dest.writeInt(captureFormat.getEncoding()); dest.writeInt(captureFormat.getChannelMask()); } else { dest.writeByte((byte)0); } dest.writeBlob(data); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (captureAvailable ? 1231 : 1237); result = prime * result + captureDelayMs; result = prime * result + capturePreambleMs; result = prime * result + captureSession; result = prime * result + (triggerInData ? 1231 : 1237); if (captureFormat != null) { result = prime * result + captureFormat.getSampleRate(); result = prime * result + captureFormat.getEncoding(); result = prime * result + captureFormat.getChannelMask(); } result = prime * result + Arrays.hashCode(data); result = prime * result + soundModelHandle; result = prime * result + status; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RecognitionEvent other = (RecognitionEvent) obj; if (captureAvailable != other.captureAvailable) return false; if (captureDelayMs != other.captureDelayMs) return false; if (capturePreambleMs != other.capturePreambleMs) return false; if (captureSession != other.captureSession) return false; if (!Arrays.equals(data, other.data)) return false; if (soundModelHandle != other.soundModelHandle) return false; if (status != other.status) return false; if (triggerInData != other.triggerInData) return false; if (captureFormat.getSampleRate() != other.captureFormat.getSampleRate()) return false; if (captureFormat.getEncoding() != other.captureFormat.getEncoding()) return false; if (captureFormat.getChannelMask() != other.captureFormat.getChannelMask()) return false; return true; } @Override public String toString() { return "RecognitionEvent [status=" + status + ", soundModelHandle=" + soundModelHandle + ", captureAvailable=" + captureAvailable + ", captureSession=" + captureSession + ", captureDelayMs=" + captureDelayMs + ", capturePreambleMs=" + capturePreambleMs + ", triggerInData=" + triggerInData + ((captureFormat == null) ? "" : (", sampleRate=" + captureFormat.getSampleRate())) + ((captureFormat == null) ? "" : (", encoding=" + captureFormat.getEncoding())) + ((captureFormat == null) ? "" : (", channelMask=" + captureFormat.getChannelMask())) + ", data=" + (data == null ? 0 : data.length) + "]"; } } /** * A RecognitionConfig is provided to * {@link SoundTriggerModule#startRecognition(int, RecognitionConfig)} to configure the * recognition request. */ public static class RecognitionConfig implements Parcelable { /** True if the DSP should capture the trigger sound and make it available for further * capture. */ public final boolean captureRequested; /** * True if the service should restart listening after the DSP triggers. * Note: This config flag is currently used at the service layer rather than by the DSP. */ public final boolean allowMultipleTriggers; /** List of all keyphrases in the sound model for which recognition should be performed with * options for each keyphrase. */ public final KeyphraseRecognitionExtra keyphrases[]; /** Opaque data for use by system applications who know about voice engine internals, * typically during enrollment. */ public final byte[] data; public RecognitionConfig(boolean captureRequested, boolean allowMultipleTriggers, KeyphraseRecognitionExtra keyphrases[], byte[] data) { this.captureRequested = captureRequested; this.allowMultipleTriggers = allowMultipleTriggers; this.keyphrases = keyphrases; this.data = data; } public static final Parcelable.Creator<RecognitionConfig> CREATOR = new Parcelable.Creator<RecognitionConfig>() { public RecognitionConfig createFromParcel(Parcel in) { return RecognitionConfig.fromParcel(in); } public RecognitionConfig[] newArray(int size) { return new RecognitionConfig[size]; } }; private static RecognitionConfig fromParcel(Parcel in) { boolean captureRequested = in.readByte() == 1; boolean allowMultipleTriggers = in.readByte() == 1; KeyphraseRecognitionExtra[] keyphrases = in.createTypedArray(KeyphraseRecognitionExtra.CREATOR); byte[] data = in.readBlob(); return new RecognitionConfig(captureRequested, allowMultipleTriggers, keyphrases, data); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeByte((byte) (captureRequested ? 1 : 0)); dest.writeByte((byte) (allowMultipleTriggers ? 1 : 0)); dest.writeTypedArray(keyphrases, flags); dest.writeBlob(data); } @Override public int describeContents() { return 0; } @Override public String toString() { return "RecognitionConfig [captureRequested=" + captureRequested + ", allowMultipleTriggers=" + allowMultipleTriggers + ", keyphrases=" + Arrays.toString(keyphrases) + ", data=" + Arrays.toString(data) + "]"; } } /** * Confidence level for users defined in a keyphrase. * - The confidence level is expressed in percent (0% -100%). * When used in a {@link KeyphraseRecognitionEvent} it indicates the detected confidence level * When used in a {@link RecognitionConfig} it indicates the minimum confidence level that * should trigger a recognition. * - The user ID is derived from the system ID {@link android.os.UserHandle#getIdentifier()}. */ public static class ConfidenceLevel implements Parcelable { public final int userId; public final int confidenceLevel; public ConfidenceLevel(int userId, int confidenceLevel) { this.userId = userId; this.confidenceLevel = confidenceLevel; } public static final Parcelable.Creator<ConfidenceLevel> CREATOR = new Parcelable.Creator<ConfidenceLevel>() { public ConfidenceLevel createFromParcel(Parcel in) { return ConfidenceLevel.fromParcel(in); } public ConfidenceLevel[] newArray(int size) { return new ConfidenceLevel[size]; } }; private static ConfidenceLevel fromParcel(Parcel in) { int userId = in.readInt(); int confidenceLevel = in.readInt(); return new ConfidenceLevel(userId, confidenceLevel); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(userId); dest.writeInt(confidenceLevel); } @Override public int describeContents() { return 0; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + confidenceLevel; result = prime * result + userId; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ConfidenceLevel other = (ConfidenceLevel) obj; if (confidenceLevel != other.confidenceLevel) return false; if (userId != other.userId) return false; return true; } @Override public String toString() { return "ConfidenceLevel [userId=" + userId + ", confidenceLevel=" + confidenceLevel + "]"; } } /** * Additional data conveyed by a {@link KeyphraseRecognitionEvent} * for a key phrase detection. */ public static class KeyphraseRecognitionExtra implements Parcelable { /** The keyphrase ID */ public final int id; /** Recognition modes matched for this event */ public final int recognitionModes; /** Confidence level for mode RECOGNITION_MODE_VOICE_TRIGGER when user identification * is not performed */ public final int coarseConfidenceLevel; /** Confidence levels for all users recognized (KeyphraseRecognitionEvent) or to * be recognized (RecognitionConfig) */ public final ConfidenceLevel[] confidenceLevels; public KeyphraseRecognitionExtra(int id, int recognitionModes, int coarseConfidenceLevel, ConfidenceLevel[] confidenceLevels) { this.id = id; this.recognitionModes = recognitionModes; this.coarseConfidenceLevel = coarseConfidenceLevel; this.confidenceLevels = confidenceLevels; } public static final Parcelable.Creator<KeyphraseRecognitionExtra> CREATOR = new Parcelable.Creator<KeyphraseRecognitionExtra>() { public KeyphraseRecognitionExtra createFromParcel(Parcel in) { return KeyphraseRecognitionExtra.fromParcel(in); } public KeyphraseRecognitionExtra[] newArray(int size) { return new KeyphraseRecognitionExtra[size]; } }; private static KeyphraseRecognitionExtra fromParcel(Parcel in) { int id = in.readInt(); int recognitionModes = in.readInt(); int coarseConfidenceLevel = in.readInt(); ConfidenceLevel[] confidenceLevels = in.createTypedArray(ConfidenceLevel.CREATOR); return new KeyphraseRecognitionExtra(id, recognitionModes, coarseConfidenceLevel, confidenceLevels); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(id); dest.writeInt(recognitionModes); dest.writeInt(coarseConfidenceLevel); dest.writeTypedArray(confidenceLevels, flags); } @Override public int describeContents() { return 0; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(confidenceLevels); result = prime * result + id; result = prime * result + recognitionModes; result = prime * result + coarseConfidenceLevel; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; KeyphraseRecognitionExtra other = (KeyphraseRecognitionExtra) obj; if (!Arrays.equals(confidenceLevels, other.confidenceLevels)) return false; if (id != other.id) return false; if (recognitionModes != other.recognitionModes) return false; if (coarseConfidenceLevel != other.coarseConfidenceLevel) return false; return true; } @Override public String toString() { return "KeyphraseRecognitionExtra [id=" + id + ", recognitionModes=" + recognitionModes + ", coarseConfidenceLevel=" + coarseConfidenceLevel + ", confidenceLevels=" + Arrays.toString(confidenceLevels) + "]"; } } /** * Specialized {@link RecognitionEvent} for a key phrase detection. */ public static class KeyphraseRecognitionEvent extends RecognitionEvent { /** Indicates if the key phrase is present in the buffered audio available for capture */ public final KeyphraseRecognitionExtra[] keyphraseExtras; public KeyphraseRecognitionEvent(int status, int soundModelHandle, boolean captureAvailable, int captureSession, int captureDelayMs, int capturePreambleMs, boolean triggerInData, AudioFormat captureFormat, byte[] data, KeyphraseRecognitionExtra[] keyphraseExtras) { super(status, soundModelHandle, captureAvailable, captureSession, captureDelayMs, capturePreambleMs, triggerInData, captureFormat, data); this.keyphraseExtras = keyphraseExtras; } public static final Parcelable.Creator<KeyphraseRecognitionEvent> CREATOR = new Parcelable.Creator<KeyphraseRecognitionEvent>() { public KeyphraseRecognitionEvent createFromParcel(Parcel in) { return KeyphraseRecognitionEvent.fromParcel(in); } public KeyphraseRecognitionEvent[] newArray(int size) { return new KeyphraseRecognitionEvent[size]; } }; private static KeyphraseRecognitionEvent fromParcel(Parcel in) { int status = in.readInt(); int soundModelHandle = in.readInt(); boolean captureAvailable = in.readByte() == 1; int captureSession = in.readInt(); int captureDelayMs = in.readInt(); int capturePreambleMs = in.readInt(); boolean triggerInData = in.readByte() == 1; AudioFormat captureFormat = null; if (in.readByte() == 1) { int sampleRate = in.readInt(); int encoding = in.readInt(); int channelMask = in.readInt(); captureFormat = (new AudioFormat.Builder()) .setChannelMask(channelMask) .setEncoding(encoding) .setSampleRate(sampleRate) .build(); } byte[] data = in.readBlob(); KeyphraseRecognitionExtra[] keyphraseExtras = in.createTypedArray(KeyphraseRecognitionExtra.CREATOR); return new KeyphraseRecognitionEvent(status, soundModelHandle, captureAvailable, captureSession, captureDelayMs, capturePreambleMs, triggerInData, captureFormat, data, keyphraseExtras); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(status); dest.writeInt(soundModelHandle); dest.writeByte((byte) (captureAvailable ? 1 : 0)); dest.writeInt(captureSession); dest.writeInt(captureDelayMs); dest.writeInt(capturePreambleMs); dest.writeByte((byte) (triggerInData ? 1 : 0)); if (captureFormat != null) { dest.writeByte((byte)1); dest.writeInt(captureFormat.getSampleRate()); dest.writeInt(captureFormat.getEncoding()); dest.writeInt(captureFormat.getChannelMask()); } else { dest.writeByte((byte)0); } dest.writeBlob(data); dest.writeTypedArray(keyphraseExtras, flags); } @Override public int describeContents() { return 0; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + Arrays.hashCode(keyphraseExtras); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; KeyphraseRecognitionEvent other = (KeyphraseRecognitionEvent) obj; if (!Arrays.equals(keyphraseExtras, other.keyphraseExtras)) return false; return true; } @Override public String toString() { return "KeyphraseRecognitionEvent [keyphraseExtras=" + Arrays.toString(keyphraseExtras) + ", status=" + status + ", soundModelHandle=" + soundModelHandle + ", captureAvailable=" + captureAvailable + ", captureSession=" + captureSession + ", captureDelayMs=" + captureDelayMs + ", capturePreambleMs=" + capturePreambleMs + ", triggerInData=" + triggerInData + ((captureFormat == null) ? "" : (", sampleRate=" + captureFormat.getSampleRate())) + ((captureFormat == null) ? "" : (", encoding=" + captureFormat.getEncoding())) + ((captureFormat == null) ? "" : (", channelMask=" + captureFormat.getChannelMask())) + ", data=" + (data == null ? 0 : data.length) + "]"; } } /** * Status codes for {@link SoundModelEvent} */ /** Sound Model was updated */ public static final int SOUNDMODEL_STATUS_UPDATED = 0; /** * A SoundModelEvent is provided by the * {@link StatusListener#onSoundModelUpdate(SoundModelEvent)} * callback when a sound model has been updated by the implementation */ public static class SoundModelEvent implements Parcelable { /** Status e.g {@link #SOUNDMODEL_STATUS_UPDATED} */ public final int status; /** The updated sound model handle */ public final int soundModelHandle; /** New sound model data */ public final byte[] data; SoundModelEvent(int status, int soundModelHandle, byte[] data) { this.status = status; this.soundModelHandle = soundModelHandle; this.data = data; } public static final Parcelable.Creator<SoundModelEvent> CREATOR = new Parcelable.Creator<SoundModelEvent>() { public SoundModelEvent createFromParcel(Parcel in) { return SoundModelEvent.fromParcel(in); } public SoundModelEvent[] newArray(int size) { return new SoundModelEvent[size]; } }; private static SoundModelEvent fromParcel(Parcel in) { int status = in.readInt(); int soundModelHandle = in.readInt(); byte[] data = in.readBlob(); return new SoundModelEvent(status, soundModelHandle, data); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(status); dest.writeInt(soundModelHandle); dest.writeBlob(data); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(data); result = prime * result + soundModelHandle; result = prime * result + status; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SoundModelEvent other = (SoundModelEvent) obj; if (!Arrays.equals(data, other.data)) return false; if (soundModelHandle != other.soundModelHandle) return false; if (status != other.status) return false; return true; } @Override public String toString() { return "SoundModelEvent [status=" + status + ", soundModelHandle=" + soundModelHandle + ", data=" + (data == null ? 0 : data.length) + "]"; } } /** * Native service state. {@link StatusListener#onServiceStateChange(int)} */ // Keep in sync with system/core/include/system/sound_trigger.h /** Sound trigger service is enabled */ public static final int SERVICE_STATE_ENABLED = 0; /** Sound trigger service is disabled */ public static final int SERVICE_STATE_DISABLED = 1; /** * Returns a list of descriptors for all harware modules loaded. * @param modules A ModuleProperties array where the list will be returned. * @return - {@link #STATUS_OK} in case of success * - {@link #STATUS_ERROR} in case of unspecified error * - {@link #STATUS_PERMISSION_DENIED} if the caller does not have system permission * - {@link #STATUS_NO_INIT} if the native service cannot be reached * - {@link #STATUS_BAD_VALUE} if modules is null * - {@link #STATUS_DEAD_OBJECT} if the binder transaction to the native service fails */ public static native int listModules(ArrayList <ModuleProperties> modules); /** * Get an interface on a hardware module to control sound models and recognition on * this module. * @param moduleId Sound module system identifier {@link ModuleProperties#id}. mandatory. * @param listener {@link StatusListener} interface. Mandatory. * @param handler the Handler that will receive the callabcks. Can be null if default handler * is OK. * @return a valid sound module in case of success or null in case of error. */ public static SoundTriggerModule attachModule(int moduleId, StatusListener listener, Handler handler) { if (listener == null) { return null; } SoundTriggerModule module = new SoundTriggerModule(moduleId, listener, handler); return module; } /** * Interface provided by the client application when attaching to a {@link SoundTriggerModule} * to received recognition and error notifications. */ public static interface StatusListener { /** * Called when recognition succeeds of fails */ public abstract void onRecognition(RecognitionEvent event); /** * Called when a sound model has been updated */ public abstract void onSoundModelUpdate(SoundModelEvent event); /** * Called when the sound trigger native service state changes. * @param state Native service state. One of {@link SoundTrigger#SERVICE_STATE_ENABLED}, * {@link SoundTrigger#SERVICE_STATE_DISABLED} */ public abstract void onServiceStateChange(int state); /** * Called when the sound trigger native service dies */ public abstract void onServiceDied(); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
2598e795b0ea1e62e3572ab81f71f002b93bbe76
a0a15b9b4b20bb7b716a8228060c0c9fff090318
/3_JavaSE01/src/day05/SortListDemo.java
89609501c5a3961882fa810beb7380a9cd9c45ec
[]
no_license
JasonkayZK/java_learn
8d0f4d8504430cd3b1eef0751fe210af5b30bda3
b3b9a2af883d79cb3c07da3834eaf5197c3e0968
refs/heads/main
2023-02-01T19:08:31.263291
2020-12-22T08:16:16
2020-12-22T08:16:16
323,563,166
1
1
null
null
null
null
UTF-8
Java
false
false
593
java
package day05; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class SortListDemo { public static void main(String[] args) { // 1. Interface Comparable List<Point> list = new ArrayList<Point> (); list.add(new Point(1, 2)); list.add(new Point(1, 3)); list.add(new Point(4, 2)); list.add(new Point(2, 4)); list.add(new Point(3, 3)); list.add(new Point(9 ,2)); list.add(new Point(8, 3)); list.add(new Point(1, 1)); System.out.println(); System.out.println(list); Collections.sort(list); System.out.println(list); } }
[ "271226192@qq.com" ]
271226192@qq.com
b2aed9f8568d404da1ec648ed7b7b6ac9ef9e6df
d5d4ae7cea2a49613b041ef00fdef9aa8dc052e4
/src/第五章代码/test15.java
f7c3671cfba040c4286bd3feef1f9366c81802eb
[]
no_license
changyjc/SwingRefer
409a202062786075bb8564be6127e46ce3c521b0
354b7a27f44667aa5524f9005039e695d6082d87
refs/heads/master
2020-02-26T15:20:56.509775
2014-12-17T06:58:18
2014-12-17T06:58:18
null
0
0
null
null
null
null
GB18030
Java
false
false
3,495
java
package 第五章代码; import java.awt.CardLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class test15 { static final int WIDTH=300; static final int HEIGHT=150; JButton b1; JButton b2; JButton b3; JButton b4; JButton b5; JButton b6; JButton b7; JButton b8; JButton b9; JPanel pane; JPanel p1; JPanel p2; JPanel p3; JPanel p4; JPanel p5; JPanel p6; JPanel p7; JPanel p8; JPanel p9; CardLayout card; public void Test15() { JFrame frame=new JFrame(); frame.setTitle("数字翻滚窗口"); frame.setSize(WIDTH,HEIGHT); frame.setVisible(true); pane=new JPanel(); p1=new JPanel(); p2=new JPanel(); p3=new JPanel(); p4=new JPanel(); p5=new JPanel(); p6=new JPanel(); p7=new JPanel(); p8=new JPanel(); p9=new JPanel(); frame.setContentPane(pane); b1=new JButton("1"); b2=new JButton("2"); b3=new JButton("3"); b4=new JButton("4"); b5=new JButton("5"); b6=new JButton("6"); b7=new JButton("7"); b8=new JButton("8"); b9=new JButton("9"); card=new CardLayout(); pane.setLayout(card); p1.add(b1); p2.add(b2); p3.add(b3); p4.add(b4); p5.add(b5); p6.add(b6); p7.add(b7); p8.add(b8); p9.add(b9); pane.add(p1,"p1"); pane.add(p2,"p2"); pane.add(p3,"p3"); pane.add(p4,"p4"); pane.add(p5,"p5"); pane.add(p6,"p6"); pane.add(p7,"p7"); pane.add(p8,"p8"); pane.add(p9,"p9"); b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p2"); } }); b2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p3"); } }); b3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p4"); } }); b4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p5"); } }); b5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p6"); } }); b6.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p7"); } }); b7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p8"); } }); b8.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p9"); } }); b9.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { card.show(pane, "p1"); } }); } public static void main(String[] args) { new test15(); } }
[ "changyjc@gmail.com" ]
changyjc@gmail.com
0e96973d95a8ff640d45331ff954e5ef45ed5790
d59781b6735bc2b50970a0c366c5703f7e4377a4
/src/main/java/com/javier/service/ICategoriasService.java
f01e9cc36adc6ae2a83f9743ed66ad9604cc18f0
[]
no_license
javierefe/empleosapp
d4763e2c3449bcda5ee3b19f4f5415367c233fca
2b9a12efdf573a5a8199df6120fddc91facb38dc
refs/heads/master
2022-11-13T17:32:09.911599
2020-06-22T04:21:20
2020-06-22T04:21:20
274,016,809
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package com.javier.service; import java.util.List; import com.javier.model.Categoria; public interface ICategoriasService { void guardar(Categoria categoria); List<Categoria> buscarTodas(); Categoria buscarPorId(Integer idCategoria); void eliminar(Integer idCategoria); }
[ "jcfloresq@gmail.com" ]
jcfloresq@gmail.com
e2168766d1532ae48eb7b6c0b1f08a64cc15d8b8
10fb6cf1914195a05a2ed0ab7931bdb074829202
/src/main/java/com/tencentcloudapi/live/v20180801/models/DescribeLiveStreamOnlineInfoRequest.java
dbbe210ba48d1e13da203556382ce75e16bb8f4c
[ "Apache-2.0" ]
permissive
ZqqqRemote/tencentcloud-sdk-java
7cf4510f42719ad2e44dddefc872376a12efdc37
dce6d7a4baa05d0235fd998bcbc3398aa64b8c2c
refs/heads/master
2020-04-17T06:49:00.830501
2019-01-11T12:26:11
2019-01-11T12:26:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,822
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.tencentcloudapi.live.v20180801.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class DescribeLiveStreamOnlineInfoRequest extends AbstractModel{ /** * 取得第几页。 默认值:1 */ @SerializedName("PageNum") @Expose private Integer PageNum; /** * 分页大小。 最大值:100。 取值范围:10~100 之前的任意整数。 默认值:10 */ @SerializedName("PageSize") @Expose private Integer PageSize; /** * 0:未开始推流 1:正在推流 2:服务出错 3:已关闭。 */ @SerializedName("Status") @Expose private Integer Status; /** * 流名称。 */ @SerializedName("StreamName") @Expose private String StreamName; /** * 获取取得第几页。 默认值:1 * @return PageNum 取得第几页。 默认值:1 */ public Integer getPageNum() { return this.PageNum; } /** * 设置取得第几页。 默认值:1 * @param PageNum 取得第几页。 默认值:1 */ public void setPageNum(Integer PageNum) { this.PageNum = PageNum; } /** * 获取分页大小。 最大值:100。 取值范围:10~100 之前的任意整数。 默认值:10 * @return PageSize 分页大小。 最大值:100。 取值范围:10~100 之前的任意整数。 默认值:10 */ public Integer getPageSize() { return this.PageSize; } /** * 设置分页大小。 最大值:100。 取值范围:10~100 之前的任意整数。 默认值:10 * @param PageSize 分页大小。 最大值:100。 取值范围:10~100 之前的任意整数。 默认值:10 */ public void setPageSize(Integer PageSize) { this.PageSize = PageSize; } /** * 获取0:未开始推流 1:正在推流 2:服务出错 3:已关闭。 * @return Status 0:未开始推流 1:正在推流 2:服务出错 3:已关闭。 */ public Integer getStatus() { return this.Status; } /** * 设置0:未开始推流 1:正在推流 2:服务出错 3:已关闭。 * @param Status 0:未开始推流 1:正在推流 2:服务出错 3:已关闭。 */ public void setStatus(Integer Status) { this.Status = Status; } /** * 获取流名称。 * @return StreamName 流名称。 */ public String getStreamName() { return this.StreamName; } /** * 设置流名称。 * @param StreamName 流名称。 */ public void setStreamName(String StreamName) { this.StreamName = StreamName; } /** * 内部实现,用户禁止调用 */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "PageNum", this.PageNum); this.setParamSimple(map, prefix + "PageSize", this.PageSize); this.setParamSimple(map, prefix + "Status", this.Status); this.setParamSimple(map, prefix + "StreamName", this.StreamName); } }
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
3ae2ee9f309aa29e6528c011900dc8e342f2f773
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/is/snd/ds/IS_SND_1250_LDataSet.java
c0e4df36ff4dc8b953b16203d531ddbf7b3bff27
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
9,275
java
/*************************************************************************************************** * 파일명 : .java * 기능 : 독자우대-구독신청 * 작성일자 : 2007-05-22 * 작성자 : 김대섭 ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.is.snd.ds; import java.sql.*; import java.util.*; import somo.framework.db.*; import somo.framework.util.*; import chosun.ciis.is.snd.dm.*; import chosun.ciis.is.snd.rec.*; /** * */ public class IS_SND_1250_LDataSet extends somo.framework.db.BaseDataSet implements java.io.Serializable{ public ArrayList curlist1 = new ArrayList(); public String errcode; public String errmsg; public String wh_cd; public String send_dt; public String send_seq; public String send_atic_no; public String send_atic_nm; public String sendclsf; public String serv_ref; public String cntc_plac; public String send_fee; public String start_tm; public String end_tm; public String remk; public IS_SND_1250_LDataSet(){} public IS_SND_1250_LDataSet(String errcode, String errmsg, String wh_cd, String send_dt, String send_seq, String send_atic_no, String send_atic_nm, String sendclsf, String serv_ref, String cntc_plac, String send_fee, String start_tm, String end_tm, String remk){ this.errcode = errcode; this.errmsg = errmsg; this.wh_cd = wh_cd; this.send_dt = send_dt; this.send_seq = send_seq; this.send_atic_no = send_atic_no; this.send_atic_nm = send_atic_nm; this.sendclsf = sendclsf; this.serv_ref = serv_ref; this.cntc_plac = cntc_plac; this.send_fee = send_fee; this.start_tm = start_tm; this.end_tm = end_tm; this.remk = remk; } public void setErrcode(String errcode){ this.errcode = errcode; } public void setErrmsg(String errmsg){ this.errmsg = errmsg; } public void setWh_cd(String wh_cd){ this.wh_cd = wh_cd; } public void setSend_dt(String send_dt){ this.send_dt = send_dt; } public void setSend_seq(String send_seq){ this.send_seq = send_seq; } public void setSend_atic_no(String send_atic_no){ this.send_atic_no = send_atic_no; } public void setSend_atic_nm(String send_atic_nm){ this.send_atic_nm = send_atic_nm; } public void setSendclsf(String sendclsf){ this.sendclsf = sendclsf; } public void setServ_ref(String serv_ref){ this.serv_ref = serv_ref; } public void setCntc_plac(String cntc_plac){ this.cntc_plac = cntc_plac; } public void setSend_fee(String send_fee){ this.send_fee = send_fee; } public void setStart_tm(String start_tm){ this.start_tm = start_tm; } public void setEnd_tm(String end_tm){ this.end_tm = end_tm; } public void setRemk(String remk){ this.remk = remk; } public String getErrcode(){ return this.errcode; } public String getErrmsg(){ return this.errmsg; } public String getWh_cd(){ return this.wh_cd; } public String getSend_dt(){ return this.send_dt; } public String getSend_seq(){ return this.send_seq; } public String getSend_atic_no(){ return this.send_atic_no; } public String getSend_atic_nm(){ return this.send_atic_nm; } public String getSendclsf(){ return this.sendclsf; } public String getServ_ref(){ return this.serv_ref; } public String getCntc_plac(){ return this.cntc_plac; } public String getSend_fee(){ return this.send_fee; } public String getStart_tm(){ return this.start_tm; } public String getEnd_tm(){ return this.end_tm; } public String getRemk(){ return this.remk; } public void getValues(CallableStatement cstmt) throws SQLException{ this.errcode = Util.checkString(cstmt.getString(1)); this.errmsg = Util.checkString(cstmt.getString(2)); if(!"".equals(this.errcode)){ return; } this.wh_cd = Util.checkString(cstmt.getString(23)); this.send_dt = Util.checkString(cstmt.getString(24)); this.send_seq = Util.checkString(cstmt.getString(25)); this.send_atic_no = Util.checkString(cstmt.getString(26)); this.send_atic_nm = Util.checkString(cstmt.getString(27)); this.sendclsf = Util.checkString(cstmt.getString(28)); this.serv_ref = Util.checkString(cstmt.getString(29)); this.cntc_plac = Util.checkString(cstmt.getString(30)); this.send_fee = Util.checkString(cstmt.getString(31)); this.start_tm = Util.checkString(cstmt.getString(32)); this.end_tm = Util.checkString(cstmt.getString(33)); this.remk = Util.checkString(cstmt.getString(34)); ResultSet rset0 = (ResultSet) cstmt.getObject(35); while(rset0.next()){ IS_SND_1250_LCURLIST1Record rec = new IS_SND_1250_LCURLIST1Record(); rec.send_cmpy_cd = Util.checkString(rset0.getString("send_cmpy_cd")); rec.advcs_cd = Util.checkString(rset0.getString("advcs_cd")); rec.advcs_cd_nm = Util.checkString(rset0.getString("advcs_cd_nm")); rec.advt_nm = Util.checkString(rset0.getString("advt_nm")); rec.std_cd = Util.checkString(rset0.getString("std_cd")); rec.std_cd_nm = Util.checkString(rset0.getString("std_cd_nm")); rec.scat_dt = Util.checkString(rset0.getString("scat_dt")); rec.bnch_qty = Util.checkString(rset0.getString("bnch_qty")); rec.qunt = Util.checkString(rset0.getString("qunt")); rec.bnch_qunt = Util.checkString(rset0.getString("bnch_qunt")); rec.asnt_dstc_cd = Util.checkString(rset0.getString("asnt_dstc_cd")); rec.asnt_dstc_cd_nm = Util.checkString(rset0.getString("asnt_dstc_cd_nm")); rec.purc_dlco_no = Util.checkString(rset0.getString("purc_dlco_no")); rec.purc_dlco_nm = Util.checkString(rset0.getString("purc_dlco_nm")); rec.dstc_seqo = Util.checkString(rset0.getString("dstc_seqo")); rec.cmpy_cd_nm = Util.checkString(rset0.getString("cmpy_cd_nm")); rec.dept_cd = Util.checkString(rset0.getString("dept_cd")); rec.sub_dept_cd = Util.checkString(rset0.getString("sub_dept_cd")); rec.chrg_pers = Util.checkString(rset0.getString("chrg_pers")); rec.chrg_pers_nm = Util.checkString(rset0.getString("chrg_pers_nm")); rec.acwr_reg_dt = Util.checkString(rset0.getString("acwr_reg_dt")); rec.acwr_reg_seq = Util.checkString(rset0.getString("acwr_reg_seq")); rec.purc_reg_dt = Util.checkString(rset0.getString("purc_reg_dt")); rec.purc_reg_seq = Util.checkString(rset0.getString("purc_reg_seq")); rec.group_cnt = Util.checkString(rset0.getString("group_cnt")); rec.group_order = Util.checkString(rset0.getString("group_order")); this.curlist1.add(rec); } } }/*---------------------------------------------------------------------------------------------------- Web Tier에서 DataSet 객체 관련 코드 작성시 사용하십시오. <% IS_SND_1250_LDataSet ds = (IS_SND_1250_LDataSet)request.getAttribute("ds"); %> Web Tier에서 Record 객체 관련 코드 작성시 사용하십시오. <% for(int i=0; i<ds.curlist1.size(); i++){ IS_SND_1250_LCURLIST1Record curlist1Rec = (IS_SND_1250_LCURLIST1Record)ds.curlist1.get(i);%> HTML 코드들.... <%}%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 DataSet 객체의 <%= %> 작성시 사용하십시오. <%= ds.getErrcode()%> <%= ds.getErrmsg()%> <%= ds.getWh_cd()%> <%= ds.getSend_dt()%> <%= ds.getSend_seq()%> <%= ds.getSend_atic_no()%> <%= ds.getSend_atic_nm()%> <%= ds.getSendclsf()%> <%= ds.getServ_ref()%> <%= ds.getCntc_plac()%> <%= ds.getSend_fee()%> <%= ds.getStart_tm()%> <%= ds.getEnd_tm()%> <%= ds.getRemk()%> <%= ds.getCurlist1()%> ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 Record 객체의 <%= %> 작성시 사용하십시오. <%= curlist1Rec.send_cmpy_cd%> <%= curlist1Rec.advcs_cd%> <%= curlist1Rec.advcs_cd_nm%> <%= curlist1Rec.advt_nm%> <%= curlist1Rec.std_cd%> <%= curlist1Rec.std_cd_nm%> <%= curlist1Rec.scat_dt%> <%= curlist1Rec.bnch_qty%> <%= curlist1Rec.qunt%> <%= curlist1Rec.bnch_qunt%> <%= curlist1Rec.asnt_dstc_cd%> <%= curlist1Rec.asnt_dstc_cd_nm%> <%= curlist1Rec.purc_dlco_no%> <%= curlist1Rec.purc_dlco_nm%> <%= curlist1Rec.dstc_seqo%> <%= curlist1Rec.cmpy_cd_nm%> <%= curlist1Rec.dept_cd%> <%= curlist1Rec.sub_dept_cd%> <%= curlist1Rec.chrg_pers%> <%= curlist1Rec.chrg_pers_nm%> <%= curlist1Rec.acwr_reg_dt%> <%= curlist1Rec.acwr_reg_seq%> <%= curlist1Rec.purc_reg_dt%> <%= curlist1Rec.purc_reg_seq%> <%= curlist1Rec.group_cnt%> <%= curlist1Rec.group_order%> ----------------------------------------------------------------------------------------------------*/ /* 작성시간 : Fri Jan 11 10:26:37 KST 2013 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
76fbaa55d428a87d5b921fe98c9af5b65860849c
89c0ea1728f36c6bf0efb43089574b97231a84e7
/flightsearchusingHibernate/src/main/java/compare/CompareFare.java
08c9bef5be62867a1872724feb6b6411727f9e4f
[]
no_license
PrashukJain/WorkSpace
87391e4712301b1753991bb962e3d1f4f515a64d
dd90b46fdd3e92fd4d8dcebe77df51c90b8104b7
refs/heads/main
2023-08-24T18:34:35.069540
2021-10-12T09:57:14
2021-10-12T09:57:14
416,262,770
0
0
null
null
null
null
UTF-8
Java
false
false
618
java
package compare; import java.util.Collections; import java.util.Comparator; import java.util.List; import details.FlightDetails; public class CompareFare { /* * Sorts specified list according to fare of a flight */ public void sort(List<FlightDetails> myList) { Collections.sort(myList, new Comparator<FlightDetails>() { public int compare(FlightDetails f1, FlightDetails f2) { Double fare1 = f1.getFare(); Double fare2 = f2.getFare(); return Double.compare(fare1, fare2); } }); } }
[ "noreply@github.com" ]
PrashukJain.noreply@github.com
796a0ac652bd712acd81e820fb14255f46edb15c
3ac7ef9b3938bfe4677829e55f82c16647ad9e37
/TesteProgramador/src/br/com/testebc/controller/IFachada.java
74353479e837c8ceedc0c01289d5996dab791c5d
[]
no_license
erikkenji/testeprogramadorjunior
c4de9c5fce1f5f60247383eeca1c08f66e97bf0f
6ad533e82f94122529593aa3c7091fb661a36850
refs/heads/master
2020-07-25T10:48:30.876550
2019-09-13T12:59:57
2019-09-13T12:59:57
208,263,971
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
package br.com.testebc.controller; import br.com.testebc.dominio.EntidadeDominio; import br.com.testebc.util.Resultado; public interface IFachada { public Resultado salvar(EntidadeDominio entidade); public Resultado alterar(EntidadeDominio entidade); public Resultado excluir(EntidadeDominio entidade); public Resultado consultar(EntidadeDominio entidade); public Resultado editar(EntidadeDominio entidade); }
[ "noreply@github.com" ]
erikkenji.noreply@github.com
559bcddd1604bd6f38bdb581a348d1a1e56fec0d
995e655293513d0b9f93d62e28f74b436245ae74
/src/a/a/e/b/a/l.java
2cfeece2ca766658d59b9900b5d9f17e1ac9c957
[]
no_license
JALsnipe/HTC-RE-YouTube-Live-Android
796e7c97898cac41f0f53120e79cde90d3f2fab1
f941b64ad6445c0a0db44318651dc76715291839
refs/heads/master
2021-01-17T09:46:50.725810
2015-01-09T23:32:14
2015-01-09T23:32:14
29,039,855
3
0
null
null
null
null
UTF-8
Java
false
false
1,995
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package a.a.e.b.a; class l implements java.util.Map.Entry { final int b; final Object c; volatile Object d; volatile l e; l(int i, Object obj, Object obj1, l l1) { b = i; c = obj; d = obj1; e = l1; } l a(int i, Object obj) { if (obj != null) { do { if (b == i) { Object obj1 = c; if (obj1 == obj || obj1 != null && obj.equals(obj1)) { return this; } } this = e; } while (this != null); } return null; } public final boolean equals(Object obj) { if (obj instanceof java.util.Map.Entry) { java.util.Map.Entry entry = (java.util.Map.Entry)obj; Object obj1 = entry.getKey(); if (obj1 != null) { Object obj2 = entry.getValue(); if (obj2 != null && (obj1 == c || obj1.equals(c))) { Object obj3 = d; if (obj2 == obj3 || obj2.equals(obj3)) { return true; } } } } return false; } public final Object getKey() { return c; } public final Object getValue() { return d; } public final int hashCode() { return c.hashCode() ^ d.hashCode(); } public final Object setValue(Object obj) { throw new UnsupportedOperationException(); } public final String toString() { return (new StringBuilder()).append(c).append("=").append(d).toString(); } }
[ "josh.lieberman92@gmail.com" ]
josh.lieberman92@gmail.com
8806796abb680d7d59d801374e8a705193d15532
8f2a2c1cbabe2c465061b3d2c3234cf736fe0ab9
/EPD05/ej2/src/main/java/com/mycompany/ej2/MyUI.java
ce85cafe6cdfc8732633f1371f2d980936f1608f
[]
no_license
mridpin/TAD_Group_03
fa3a1b7b64893a8570e85bd283d6bf861aefb6dc
397ed6db4f56316a90585ed2ca48ba3bb845f86a
refs/heads/master
2021-04-28T05:58:28.756079
2018-10-16T20:23:55
2018-10-16T20:23:55
122,190,111
0
0
null
null
null
null
UTF-8
Java
false
false
3,820
java
package com.mycompany.ej2; import javax.servlet.annotation.WebServlet; import com.vaadin.annotations.Theme; import com.vaadin.annotations.VaadinServletConfiguration; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinServlet; import com.vaadin.ui.Button; import com.vaadin.ui.Label; import com.vaadin.ui.TextField; import com.vaadin.ui.*; import com.vaadin.ui.VerticalLayout; /** * This UI is the application entry point. A UI may either represent a browser * window (or tab) or some part of a html page where a Vaadin application is * embedded. * <p> * The UI is initialized using {@link #init(VaadinRequest)}. This method is * intended to be overridden to add component to the user interface and * initialize non-component functionality. */ @Theme("mytheme") public class MyUI extends UI { @Override protected void init(VaadinRequest vaadinRequest) { VerticalSplitPanel verticalSplit = new VerticalSplitPanel(); VerticalSplitPanel subVerticalSplit = new VerticalSplitPanel(); HorizontalSplitPanel horizontalSplit = new HorizontalSplitPanel(); VerticalLayout leftLayout = new VerticalLayout(); HorizontalLayout topLayout = new HorizontalLayout(); HorizontalLayout subTopLayout = new HorizontalLayout(); HorizontalLayout subBottomLayout = new HorizontalLayout(); Tree tree = new Tree("The Planets and Major Moons"); final Object[][] planets = new Object[][]{ new Object[]{"Mercury"}, new Object[]{"Venus"}, new Object[]{"Earth", "The Moon"}, new Object[]{"Mars", "Phobos", "Deimos"}, new Object[]{"Jupiter", "Io", "Europa", "Ganymedes", "Callisto"}, new Object[]{"Saturn", "Titan", "Tethys", "Dione", "Rhea", "Iapetus"}, new Object[]{"Uranus", "Miranda", "Ariel", "Umbriel", "Titania", "Oberon"}, new Object[]{"Neptune", "Triton", "Proteus", "Nereid", "Larissa"} }; setContent(verticalSplit); for (int i = 0; i < planets.length; i++) { String planet = (String) (planets[i][0]); tree.addItem(planet); if (planets[i].length == 1) { tree.setChildrenAllowed(planet, false); } else { for (int j = 1; j < planets[i].length; j++) { String moon = (String) planets[i][j]; tree.addItem(moon); tree.setParent(moon, planet); tree.setChildrenAllowed(moon, false); } tree.expandItemsRecursively(planet); } } topLayout.addComponent(new Label("The Ultimate Cat Finder")); leftLayout.addComponent(tree); subTopLayout.addComponent(new Label("Details")); subBottomLayout.addComponent(new Label("Where is the cat?")); subBottomLayout.addComponent(new Label("I don't know!")); verticalSplit.setFirstComponent(topLayout); verticalSplit.setSecondComponent(horizontalSplit); verticalSplit.setSplitPosition(30, Unit.PERCENTAGE); horizontalSplit.setFirstComponent(leftLayout); horizontalSplit.setSecondComponent(subVerticalSplit); horizontalSplit.setSplitPosition(30, Unit.PERCENTAGE); subVerticalSplit.setFirstComponent(subTopLayout); subVerticalSplit.setSecondComponent(subBottomLayout); subVerticalSplit.setSplitPosition(30, Unit.PERCENTAGE); } @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) @VaadinServletConfiguration(ui = MyUI.class, productionMode = false) public static class MyUIServlet extends VaadinServlet { } }
[ "antoniojherrera@localhost" ]
antoniojherrera@localhost
8fd2f9027f92060ced2c2b797c88ca0e59624537
11ccac719d0fafe87ea3484d357ede2214393fbf
/plugin/src/test/resources/expected_output/basic/akka/rk/buh/is/it/EWMA.java
a2c5fede5c3f8e769b9ad0e2381fa0ee4bebce53
[ "Apache-2.0" ]
permissive
baol/genjavadoc
3bb684b18e0f7a4fe6568c41d0b638ba7ed91693
ae00d18e5c769fe28dc83d591f724cab48278f2a
refs/heads/master
2021-01-19T16:37:35.670368
2016-12-19T10:15:21
2016-12-19T10:15:21
88,277,835
1
0
null
2017-04-14T15:11:11
2017-04-14T15:11:11
null
UTF-8
Java
false
false
2,981
java
package akka.rk.buh.is.it; /** * The exponentially weighted moving average (EWMA) approach captures short-term * movements in volatility for a conditional volatility forecasting model. By virtue * of its alpha, or decay factor, this provides a statistical streaming data model * that is exponentially biased towards newer entries. * <p> * http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average * <p> * An EWMA only needs the most recent forecast value to be kept, as opposed to a standard * moving average model. * <p> * param: alpha decay factor, sets how quickly the exponential weighting decays for past data compared to new data, * see http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average * <p> * param: value the current exponentially weighted moving average, e.g. Y(n - 1), or, * the sampled value resulting from the previous smoothing iteration. * This value is always used as the previous EWMA to calculate the new EWMA. * <p> */ public final class EWMA implements scala.Product, scala.Serializable { /** * math.log(2) * @return (undocumented) */ static private double LogOf2 () { throw new RuntimeException(); } // not preceding static public akka.rk.buh.is.it.EWMA apply (double value, double alpha) { throw new RuntimeException(); } static public scala.Option<scala.Tuple2<java.lang.Object, java.lang.Object>> unapply (akka.rk.buh.is.it.EWMA x$0) { throw new RuntimeException(); } static private java.lang.Object readResolve () { throw new RuntimeException(); } public double value () { throw new RuntimeException(); } public double alpha () { throw new RuntimeException(); } // not preceding public EWMA (double value, double alpha) { throw new RuntimeException(); } /** * Calculates the exponentially weighted moving average for a given monitored data set. * <p> * @param xn the new data point * @return a new EWMA with the updated value */ public akka.rk.buh.is.it.EWMA $colon$plus (double xn) { throw new RuntimeException(); } // not preceding public akka.rk.buh.is.it.EWMA copy (double value, double alpha) { throw new RuntimeException(); } // not preceding public double copy$default$1 () { throw new RuntimeException(); } public double copy$default$2 () { throw new RuntimeException(); } // not preceding public java.lang.String productPrefix () { throw new RuntimeException(); } public int productArity () { throw new RuntimeException(); } public Object productElement (int x$1) { throw new RuntimeException(); } public scala.collection.Iterator<java.lang.Object> productIterator () { throw new RuntimeException(); } public boolean canEqual (Object x$1) { throw new RuntimeException(); } public int hashCode () { throw new RuntimeException(); } public java.lang.String toString () { throw new RuntimeException(); } public boolean equals (Object x$1) { throw new RuntimeException(); } }
[ "rk@rkuhn.info" ]
rk@rkuhn.info
8aafeda1db3a54bbf45c89f2703f38365ca0ab8c
1b7c0afaa88978171266acf3b2a53615111784c0
/src/main/java/daily/template/headfirst/ch01/MuteQuack.java
9b089cf2053c129a10e9bf7212fdd9a2c63eb3d3
[]
no_license
huyuxiang/niostudy
0b483b4f80242da1c9037844bf176b6cd043e015
70468366684e01c7f4104bf8b979ff2909f06c83
refs/heads/master
2020-04-13T21:40:50.445467
2016-10-10T03:38:21
2016-10-10T03:38:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
159
java
package daily.template.headfirst.ch01; public class MuteQuack implements QuackBehavior { public void quack() { System.out.println("<< Silence >>"); } }
[ "1678907570@qq.com" ]
1678907570@qq.com
df7f8b5eac242a29dc19beef95d637490b361fcd
c5f618074dfed35a88d349f21689e4c207ccb129
/src/test/java/com/assignment/service/UserServiceImplTest.java
d318318f5f8ccb275a030b4e1ebffb06d4be50c8
[]
no_license
UmeshCEcho/accounting-app
824ee526ae13d374c9dd20589764882a2891c910
bb68df09fab06d2a3ef6d8290e2888fbc22f91cc
refs/heads/master
2020-06-13T23:15:53.378263
2019-07-02T08:04:03
2019-07-02T08:04:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,443
java
package com.assignment.service; import com.assignment.data.managers.UserManager; import com.assignment.enums.Status; import com.assignment.exception.InvalidUserIdException; import com.assignment.model.User; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.Collections; import static com.assignment.factory.UserFactory.getDummyActiveUsers; import static com.assignment.factory.UserFactory.getDummyUsers; import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.*; import static org.mockito.Matchers.*; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) public class UserServiceImplTest { @Mock private UserManager userManager; @Captor private ArgumentCaptor<User> userArgumentCaptor; @InjectMocks private UserService userService = new UserServiceImpl(userManager); @Test public void test_getAllUsers_Returns_EmptyList() { when(userManager.getAllUsers()).thenReturn(emptyList()); assertThat(userService.getAllUsers()).isEmpty(); verify(userManager).getAllUsers(); } @Test public void test_getAllUsers_Returns_1_Inactive_User() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); User user = getDummyUsers(timestamp, timestamp).get(0); user.setStatus(Status.INACTIVE); when(userManager.getAllUsers()).thenReturn(Collections.singletonList(user)); assertThat(userService.getAllUsers()).isEmpty(); verify(userManager).getAllUsers(); } @Test public void test_getAllUsers() { Timestamp createdOn = Timestamp.valueOf(LocalDateTime.now().minusWeeks(1)); Timestamp modifiedOn = new Timestamp(System.currentTimeMillis()); when(userManager.getAllUsers()).thenReturn(getDummyUsers(createdOn, modifiedOn)); assertThat(userService.getAllUsers()).hasSize(4).isEqualTo(getDummyActiveUsers(createdOn, modifiedOn)); verify(userManager).getAllUsers(); } @Test public void test_getUserById_Throws_InvalidUserIdException_when_not_found() { when(userManager.getUserById(anyLong())).thenReturn(null); Throwable throwable = catchThrowable(() -> userService.getUserById(1L)); assertThat(throwable).isInstanceOf(InvalidUserIdException.class) .hasFieldOrPropertyWithValue("statusCode", 404) .hasMessage("Invalid User Id 1"); verify(userManager).getUserById(1L); } @Test public void test_getUserById_Throws_InvalidUserIdException_when_inactive() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); User user = getDummyUsers(timestamp, timestamp).get(0); user.setStatus(Status.INACTIVE); when(userManager.getUserById(anyLong())).thenReturn(user); Throwable throwable = catchThrowable(() -> userService.getUserById(1L)); assertThat(throwable).isInstanceOf(InvalidUserIdException.class) .hasFieldOrPropertyWithValue("statusCode", 400) .hasMessage("Invalid User Id 1"); verify(userManager).getUserById(1L); } @Test public void test_getUserById() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); User user = getDummyUsers(timestamp, timestamp).get(0); when(userManager.getUserById(anyLong())).thenReturn(user); assertThat(userService.getUserById(1L)).isEqualTo(user); verify(userManager).getUserById(1L); } @Test public void test_createUser() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); User user = getDummyUsers(timestamp, timestamp).get(0); when(userManager.createUser(any(User.class))).thenReturn(user); assertThat(userService.createUser(user)).isEqualTo(user); verify(userManager).createUser(userArgumentCaptor.capture()); assertThat(userArgumentCaptor.getValue()).isEqualTo(user); } @Test public void test_updateUser_Throws_InvalidUserIdException() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); User user = getDummyUsers(timestamp, timestamp).get(0); when(userManager.updateUser(anyLong(), any(User.class))).thenReturn(0); Throwable throwable = catchThrowable(() -> userService.updateUser(2L, user)); assertThat(throwable).isInstanceOf(InvalidUserIdException.class) .hasFieldOrPropertyWithValue("statusCode", 404) .hasMessage("Invalid User Id 2"); verify(userManager).updateUser(eq(2L), userArgumentCaptor.capture()); assertThat(userArgumentCaptor.getValue()).isEqualTo(user); } @Test public void test_updateUser() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); User user = getDummyUsers(timestamp, timestamp).get(0); when(userManager.updateUser(anyLong(), any(User.class))).thenReturn(1); userService.updateUser(2, user); verify(userManager).updateUser(eq(2l), userArgumentCaptor.capture()); assertThat(userArgumentCaptor.getValue()).isEqualTo(user); } @Test public void test_deleteUser_Throws_InvalidUserIdException() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); User user = getDummyUsers(timestamp, timestamp).get(0); user.setStatus(Status.INACTIVE); when(userManager.deleteUser(anyLong())).thenReturn(0); Throwable throwable = catchThrowable(() -> userService.deleteUser(1L)); assertThat(throwable).isInstanceOf(InvalidUserIdException.class) .hasFieldOrPropertyWithValue("statusCode", 404) .hasMessage("Invalid User Id 1"); verify(userManager).deleteUser(1L); } @Test public void test_deleteUser() { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); User user = getDummyUsers(timestamp, timestamp).get(0); when(userManager.deleteUser(anyLong())).thenReturn(1); userService.deleteUser(1L); verify(userManager).deleteUser(1L); } }
[ "sharmashashank342@gmail.com" ]
sharmashashank342@gmail.com
0578ac540a383b771d645b548bd424fa825bc98d
0a6773e906928f83969cf609a49e55bb472f4e21
/ext/integration/src/main/java/com/netfinworks/site/ext/integration/member/ICertValidateService.java
d9252ce9186688994aab1414ffbbe28c82641965
[]
no_license
tasfe/site-platform-root
ec078effb6509e5d2d2b2cd9722f986dd0d939dd
c366916d96289beb624b633283880b8bb94452b4
refs/heads/master
2021-01-15T08:19:19.176225
2017-02-28T05:37:11
2017-02-28T05:37:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
744
java
package com.netfinworks.site.ext.integration.member; import com.netfinworks.cert.service.request.CertValidateRequest; import com.netfinworks.cert.service.response.CertValidateResponse; import com.netfinworks.common.domain.OperationEnvironment; import com.netfinworks.site.domain.exception.BizException; /** * <p>国政通实名认证</p> * * @author tangL * @date 2014年12月26日 * @since 1.6 */ public interface ICertValidateService { /** * 调用远程验证公共方法 * @param environment * @param certValidateRequest * @return CertValidateResponse * @throws BizException */ public CertValidateResponse validate(OperationEnvironment environment, CertValidateRequest certValidateRequest) throws BizException; }
[ "zhangweijieit@sina.com" ]
zhangweijieit@sina.com
fe914dbf6a78b60b689eca512cf67871b326c6bd
e9a79ecdca1cf614d39d3a181dab2b4578d9cc9f
/src/main/java/Abstract/Hello.java
b48616332f3f2a3856b2bd6e3cafa640c4302284
[]
no_license
c-machado/ExamplesCoreSimpliLearn
e4e26bb812b074c4077bc18dc6d9a61d967c6339
56d4bc49e22f58e4f07f1549970c3d29f2aba7de
refs/heads/master
2021-07-04T11:58:23.257514
2019-06-20T01:54:33
2019-06-20T01:54:33
187,959,080
0
0
null
null
null
null
UTF-8
Java
false
false
155
java
package Abstract; public class Hello { public static void main (String[] args) { Shape shape = new Rectangle(); shape.draw(); } }
[ "cmachado@H5767.ad.hugeinc.com" ]
cmachado@H5767.ad.hugeinc.com
3b0aa43fa6d08922d7279ee92d7ddfa56cd72d93
ca4efd7dee9b459d7d3f83de3971ee4a4a78eefc
/kyj/project2/src/com/kh/exam6/Prac1.java
98ed574649075598ccf58f3c7ebf1ccfa307afea
[]
no_license
kimyoungjun2/workspace
c33895d407b27cca4976e585e11bbf0cd8063f2d
f862522b0ed97df79423d56408cede5986916480
refs/heads/main
2023-07-28T12:08:35.591711
2021-09-10T15:33:18
2021-09-10T15:33:18
405,079,623
0
0
null
null
null
null
UTF-8
Java
false
false
1,411
java
package com.kh.exam6; import java.util.Arrays; class MyData { public int num; public String name; } public class Prac1 { public void method1() { System.out.println("매개변수 없는 매서드 동작!"); } public void method1(boolean b) { System.out.println("매개변수가 있는 메서드 동작 -> " + b); } public void method1(int i) { System.out.println("매개변수가 있는 메서드 동작 -> " + i); } public void method1(double d) { System.out.println("매개변수가 있는 메서드 동작 -> " + d); } public void method1(String s) { System.out.println("매개변수가 있는 메서드 동작 -> " + s); } public void method1(int x, int y, int z) { System.out.println("매개변수가 있는 메서드 동작 -> " + x + ", " + y + ", " + z); } public void method1(int[] arr) { System.out.println("매개변수가 있는 메서드 동작 -> " + arr); System.out.println("매개변수가 있는 메서드 동작 -> " + Arrays.toString(arr)); for(int i = 0; i < arr.length; i++) { arr[i] = arr[i] + 5; } } public void method1(double ... arr) { System.out.println("매개변수가 있는 메서드 동작 -> " + arr); System.out.println("매개변수가 있는 메서드 동작 -> " + Arrays.toString(arr)); } public void method1(MyData data) { System.out.println(data.num + " | " + data.name); data.num = data.num + 10; } }
[ "jun_fx@nate.com" ]
jun_fx@nate.com
ba4d8017d6d6091245edcc7da0375d54f4eb20f1
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes11.dex_source_from_JADX/com/facebook/pages/browser/fragment/PagesBrowserListFragment.java
df8a11ec77e79d2a50e94a98af4a2da6879c6607
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
11,385
java
package com.facebook.pages.browser.fragment; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.facebook.common.errorreporting.AbstractFbErrorReporter; import com.facebook.common.errorreporting.FbErrorReporterImpl; import com.facebook.common.util.StringUtil; import com.facebook.content.event.FbEvent; import com.facebook.content.event.FbEventSubscriberListManager; import com.facebook.fbservice.ops.OperationResultFutureCallback; import com.facebook.fbservice.service.OperationResult; import com.facebook.fbservice.service.ServiceException; import com.facebook.flatbuffers.helpers.FlatBufferModelHelper; import com.facebook.inject.FbInjector; import com.facebook.inject.InjectorLike; import com.facebook.loom.logger.LogEntry.EntryType; import com.facebook.loom.logger.Logger; import com.facebook.pages.browser.analytics.PagesBrowserAnalytics; import com.facebook.pages.browser.data.adapters.PagesBrowserSectionAdapter; import com.facebook.pages.browser.data.adapters.PagesBrowserSectionAdapter.Section; import com.facebook.pages.browser.data.graphql.RecommendedPagesModels.RecommendedPageFieldsModel; import com.facebook.pages.browser.data.graphql.RecommendedPagesModels.RecommendedPagesInCategoryModel; import com.facebook.pages.browser.data.graphql.RecommendedPagesModels.RecommendedPagesInCategoryModel.PageBrowserCategoriesModel.NodesModel; import com.facebook.pages.browser.data.methods.FetchRecommendedPagesInCategory.Params; import com.facebook.pages.browser.event.PagesBrowserEventBus; import com.facebook.pages.browser.event.PagesBrowserEvents.PageLikedEvent; import com.facebook.pages.browser.event.PagesBrowserEvents.PageLikedEventSubscriber; import com.facebook.tools.dextr.runtime.LogUtils; import com.facebook.tools.dextr.runtime.detour.AdapterDetour; import com.facebook.ui.titlebar.Fb4aTitleBarSupplier; import com.facebook.widget.listview.BetterListView; import com.facebook.widget.titlebar.FbTitleBar; import com.facebook.widget.titlebar.FbTitleBarSupplier; import com.facebook.widget.titlebar.HasTitleBar; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import java.util.concurrent.Callable; /* compiled from: story_gallery_survey_feed_unit_taken */ public class PagesBrowserListFragment extends BasePagesBrowserFragment { public ListenableFuture<OperationResult> al; public String am; public PagesBrowserSectionAdapter an; public FbTitleBarSupplier ao; public FbTitleBar ap; public RecommendedPagesInCategoryModel aq; private View f1310e; private BetterListView f1311f; public PagesBrowserEventBus f1312g; private FbEventSubscriberListManager f1313h; public AbstractFbErrorReporter f1314i; /* compiled from: story_gallery_survey_feed_unit_taken */ class C01751 extends PageLikedEventSubscriber { final /* synthetic */ PagesBrowserListFragment f1307a; C01751(PagesBrowserListFragment pagesBrowserListFragment) { this.f1307a = pagesBrowserListFragment; } public final void m1961b(FbEvent fbEvent) { PageLikedEvent pageLikedEvent = (PageLikedEvent) fbEvent; PagesBrowserAnalytics pagesBrowserAnalytics; long parseLong; if (pageLikedEvent.f1291b) { pagesBrowserAnalytics = this.f1307a.f1298d; parseLong = Long.parseLong(pageLikedEvent.f1290a); pagesBrowserAnalytics.f1219a.c(PagesBrowserAnalytics.m1790d("tapped_like_page_in_category").a("page_id", parseLong).b("page_id", this.f1307a.am)); } else { pagesBrowserAnalytics = this.f1307a.f1298d; parseLong = Long.parseLong(pageLikedEvent.f1290a); pagesBrowserAnalytics.f1219a.c(PagesBrowserAnalytics.m1790d("tapped_unlike_page_in_category").a("page_id", parseLong).b("page_id", this.f1307a.am)); } this.f1307a.m1944a(pageLikedEvent.f1290a, pageLikedEvent.f1291b); this.f1307a.m1946b(pageLikedEvent.f1290a, pageLikedEvent.f1291b); AdapterDetour.a(this.f1307a.an, 1461192819); } } /* compiled from: story_gallery_survey_feed_unit_taken */ class C01762 implements Callable<ListenableFuture<OperationResult>> { final /* synthetic */ PagesBrowserListFragment f1308a; C01762(PagesBrowserListFragment pagesBrowserListFragment) { this.f1308a = pagesBrowserListFragment; } public Object call() { return this.f1308a.al; } } /* compiled from: story_gallery_survey_feed_unit_taken */ class C01773 extends OperationResultFutureCallback { final /* synthetic */ PagesBrowserListFragment f1309a; C01773(PagesBrowserListFragment pagesBrowserListFragment) { this.f1309a = pagesBrowserListFragment; } public final void m1963a(Object obj) { OperationResult operationResult = (OperationResult) obj; int i = 0; this.f1309a.f1298d.f1219a.c(PagesBrowserAnalytics.m1790d("pages_browser_category_page_load_successful").b("page_id", this.f1309a.am)); this.f1309a.aq = (RecommendedPagesInCategoryModel) operationResult.k(); if (!(this.f1309a.aq == null || this.f1309a.aq.m1900a() == null || this.f1309a.aq.m1900a().m1896a().isEmpty())) { ImmutableList a = ((NodesModel) this.f1309a.aq.m1900a().m1896a().get(0)).m1892k().m1887a(); int size = a.size(); while (i < size) { RecommendedPageFieldsModel recommendedPageFieldsModel = (RecommendedPageFieldsModel) a.get(i); if (recommendedPageFieldsModel.m1872b()) { this.f1309a.f1297c.m1989a(recommendedPageFieldsModel.m1873c()); } i++; } } PagesBrowserListFragment.m1965e(this.f1309a); } protected final void m1962a(ServiceException serviceException) { this.f1309a.f1298d.f1219a.c(PagesBrowserAnalytics.m1790d("pages_browser_category_page_load_error").b("page_id", this.f1309a.am)); this.f1309a.f1314i.a("page_identity_category_data_fetch_fail", serviceException); } } public static void m1964a(Object obj, Context context) { InjectorLike injectorLike = FbInjector.get(context); PagesBrowserListFragment pagesBrowserListFragment = (PagesBrowserListFragment) obj; PagesBrowserEventBus a = PagesBrowserEventBus.m1936a(injectorLike); FbTitleBarSupplier fbTitleBarSupplier = (FbTitleBarSupplier) Fb4aTitleBarSupplier.a(injectorLike); AbstractFbErrorReporter abstractFbErrorReporter = (AbstractFbErrorReporter) FbErrorReporterImpl.a(injectorLike); PagesBrowserSectionAdapter b = PagesBrowserSectionAdapter.m1800b(injectorLike); pagesBrowserListFragment.f1312g = a; pagesBrowserListFragment.ao = fbTitleBarSupplier; pagesBrowserListFragment.f1314i = abstractFbErrorReporter; pagesBrowserListFragment.an = b; } public final void mo27c(Bundle bundle) { super.mo27c(bundle); Class cls = PagesBrowserListFragment.class; m1964a(this, getContext()); this.am = this.s.getString("category"); Preconditions.checkArgument(!StringUtil.a(this.am), "Empty category"); this.f1313h = new FbEventSubscriberListManager(); this.f1313h.a(new C01751(this)); if (this.ao != null) { this.ap = (FbTitleBar) this.ao.get(); } } public final View m1968a(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { int a = Logger.a(2, EntryType.LIFECYCLE_FRAGMENT_START, 1290220222); this.f1310e = layoutInflater.inflate(2130903522, viewGroup, false); this.f1311f = (BetterListView) this.f1310e.findViewById(2131560265); this.f1311f.setEmptyView(this.f1310e.findViewById(16908292)); this.f1311f.c(); this.f1311f.setAdapter(this.an); if (bundle == null || !bundle.containsKey("pages_browser_list_data")) { aq(); } else { this.aq = (RecommendedPagesInCategoryModel) FlatBufferModelHelper.a(bundle, "pages_browser_list_data"); m1965e(this); } View view = this.f1310e; LogUtils.f(54389238, a); return view; } public final void mi_() { int a = Logger.a(2, EntryType.LIFECYCLE_FRAGMENT_START, 162245872); super.mi_(); HasTitleBar hasTitleBar = (HasTitleBar) a(HasTitleBar.class); if (hasTitleBar != null) { hasTitleBar.y_(2131242277); } else if (this.ap != null) { this.ap.setTitle(2131242277); } LogUtils.f(341692128, a); } public final void m1967H() { int a = Logger.a(2, EntryType.LIFECYCLE_FRAGMENT_START, 130353339); super.H(); if (this.f1296b != null) { this.f1296b.c(); } if (this.f1313h != null) { this.f1313h.b(this.f1312g); } Logger.a(2, EntryType.LIFECYCLE_FRAGMENT_END, -2070267820, a); } public final void m1966G() { int a = Logger.a(2, EntryType.LIFECYCLE_FRAGMENT_START, -171337402); super.G(); if (this.al != null && this.al.isCancelled()) { aq(); } if (this.f1313h != null) { this.f1313h.a(this.f1312g); } Logger.a(2, EntryType.LIFECYCLE_FRAGMENT_END, 86356438, a); } public final void m1971e(Bundle bundle) { super.e(bundle); if (this.aq != null) { FlatBufferModelHelper.a(bundle, "pages_browser_list_data", this.aq); } } public static void m1965e(PagesBrowserListFragment pagesBrowserListFragment) { if (!(pagesBrowserListFragment.aq == null || pagesBrowserListFragment.aq.m1900a() == null || pagesBrowserListFragment.aq.m1900a().m1896a().isEmpty())) { NodesModel nodesModel = (NodesModel) pagesBrowserListFragment.aq.m1900a().m1896a().get(0); String j = ((NodesModel) pagesBrowserListFragment.aq.m1900a().m1896a().get(0)).m1891j(); HasTitleBar hasTitleBar = (HasTitleBar) pagesBrowserListFragment.a(HasTitleBar.class); if (hasTitleBar != null) { hasTitleBar.a_(j); } else if (pagesBrowserListFragment.ap != null) { pagesBrowserListFragment.ap.setTitle(j); } PagesBrowserSectionAdapter pagesBrowserSectionAdapter = pagesBrowserListFragment.an; Section section = new Section(nodesModel.m1891j(), nodesModel.m1890a()); section.f1235c = nodesModel.m1892k().m1887a(); section.f1236d = false; section.f1237e = false; pagesBrowserSectionAdapter.f1240e.add(section); } AdapterDetour.a(pagesBrowserListFragment.an, -1315282393); } private void aq() { this.al = this.f1295a.m1817a(new Params(this.am)); this.f1296b.a("fetch_recommended_pages_in_category", new C01762(this), new C01773(this)); } protected final void mo26b() { AdapterDetour.a(this.an, 1553203306); } }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
1c08387f1365aa3d8de24870d5b400e0c6674db1
3a9866befd36d8acc21ce0704f98deae68f39f4b
/src/main/java/com/github/kiro/ExpiringCounter.java
aea6b09f7a5291622d1b7f0bc3d76fa7fdd9b45f
[]
no_license
kiro/geo-index
e2a57826addedf6a2f3a70ff7b9ded1dd1db4916
845c17b2cb05f80abf33c9360a75a0c5ea656c62
refs/heads/master
2020-04-13T03:21:57.892051
2013-10-07T18:34:45
2013-10-07T18:34:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
229
java
package com.github.kiro; /** * Expiring counter. */ public class ExpiringCounter { private ClusterCount clusterCount = new ClusterCount(); public void add(Point p) { } public void remove(Point p) { } }
[ "kiril.minkov@gmail.com" ]
kiril.minkov@gmail.com
ffc796c1c41b0c63180f64ccc2aa1fc510716b1f
ea4b23cc7f9caf309b63d45ca47734192826e0f5
/src/main/java/com/example/facebookbackend/FacebookBackendApplication.java
e9a396109f88eeee25bd01365c68cd114b678ae8
[]
no_license
kms-thoai-tran/facebook-backends
e99b32e0b428ea4326f2ad3701e4a0230053f4c6
ccd66f5915589df57967c0a46a4d3e0d8d34eb2a
refs/heads/master
2023-06-21T10:06:18.106649
2020-04-09T02:43:08
2020-04-09T02:43:08
241,300,923
0
0
null
2023-06-20T18:31:52
2020-02-18T07:41:42
Java
UTF-8
Java
false
false
1,138
java
package com.example.facebookbackend; import com.example.facebookbackend.service.IDynamoDbService; import com.example.facebookbackend.service.s3.IAmazonS3Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class FacebookBackendApplication implements CommandLineRunner { @Autowired IDynamoDbService dynamoDbService; @Autowired IAmazonS3Service amazonS3Service; public static void main(String[] args) { // BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); // System.out.println(encoder.encode("my-secret")); // System.out.println(encoder.matches("my-secret", "$2a$10$1B3CLhTWseUyOLvvUTgtOuiiwbb8uEMTkWc44uETl.4YhzgViHczu")); SpringApplication.run(FacebookBackendApplication.class, args); } @Override public void run(String... args) throws Exception { // dynamoDbService.deleteTable("facebook"); // dynamoDbService.createTable(); } }
[ "thoaitran@kms-technology.com" ]
thoaitran@kms-technology.com
94b3bebab60141b2dbbdb385db7d6d10b180c8af
97006a67284d017062f973d559e5ed9339ae454f
/src/hust/soict/hedspi/garbage/ConcatenationInLoops.java
d052f0659a856f209daa44f19a75a4e1bd3ae6e2
[]
no_license
Cress1004/AimsProject
fe9c4695df874d6ab1bf8c872749097d3404b4d2
9ca400a18b647fb9a9ecbb58417d19ee16939c35
refs/heads/master
2022-07-30T14:36:10.696912
2020-05-24T08:26:27
2020-05-24T08:26:27
266,498,698
0
0
null
null
null
null
UTF-8
Java
false
false
747
java
package hust.soict.hedspi.garbage; import java.util.Random; public class ConcatenationInLoops { public static void main(String[] args) { // Random r = new Random(123); // long start = System.currentTimeMillis(); // String s = ""; // for(int i=0; i<65536; i++) { // s+= r.nextInt(2); // } // System.out.println(System.currentTimeMillis() - start); // this prints roughly 4500 // r = new Random(123); // start = System.currentTimeMillis(); // StringBuilder sb = new StringBuilder(); // for(int i = 0; i<65536; i++) { // sb.append(r.nextInt(2)); // } // s = sb.toString(); // System.out.println(System.currentTimeMillis() - start); System.out.println(GarbageCreator.Readfile()); System.out.println(NoGarbage.Readfile()); } }
[ "nuhoangchenhac@gmail.com" ]
nuhoangchenhac@gmail.com
28a44f66bad42e6e9382f117be092747a172dffe
4386bdb06a569e308404cd710c7d55823919cc55
/src/main/java/com/prior/bootCamp/BootCampApplication.java
e401df2c81fe6d7d9b0e68bdf48ada9e9d20c4ce
[]
no_license
Pphuwanai/FileStrorageExample
aca9e0efab66eeeaf95824beb26e5512cce61242
df32d46439f9c37f9fb9506ff3d0dc595be2c530
refs/heads/master
2022-12-19T23:27:06.303186
2020-09-28T08:19:21
2020-09-28T08:19:21
299,238,151
0
0
null
null
null
null
UTF-8
Java
false
false
315
java
package com.prior.bootCamp; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class BootCampApplication { public static void main(String[] args) { SpringApplication.run(BootCampApplication.class, args); } }
[ "Pphuwanai619@gmail.com" ]
Pphuwanai619@gmail.com
dffb032354dd8dece0eac0de0011a7f43cdeab12
16be4a0a5b5f805fbeac2d38f1ab59e30b82dd59
/http-server-undertow/src/main/java/io/micronaut/servlet/undertow/UndertowServer.java
3983e18d168c07531eb5f69ad7441516926fe54c
[ "Apache-2.0" ]
permissive
tobiasschaefer/micronaut-servlet
d00d11575af13743c34ce72beeec1afbf543c8a7
06a4b1ccb07f093c85f6ec5f5193038761e3c1e3
refs/heads/master
2021-07-17T13:10:21.800799
2020-03-03T13:55:26
2020-03-03T13:55:26
245,429,110
0
0
Apache-2.0
2020-03-06T13:38:36
2020-03-06T13:38:36
null
UTF-8
Java
false
false
3,116
java
package io.micronaut.servlet.undertow; import io.micronaut.context.ApplicationContext; import io.micronaut.http.server.exceptions.InternalServerException; import io.micronaut.runtime.ApplicationConfiguration; import io.micronaut.servlet.engine.server.AbstractServletServer; import io.undertow.Undertow; import javax.inject.Singleton; import java.net.*; import java.util.Map; import java.util.stream.Collectors; /** * Implementation of {@link AbstractServletServer} for Undertow. * * @author graemerocher * @since 1.0.0 */ @Singleton public class UndertowServer extends AbstractServletServer<Undertow> { private Map<String, Undertow.ListenerInfo> listenersByProtocol; /** * Default constructor. * @param applicationContext The app context * @param applicationConfiguration The app config * @param undertow The undertow instance */ public UndertowServer( ApplicationContext applicationContext, ApplicationConfiguration applicationConfiguration, Undertow undertow) { super(applicationContext, applicationConfiguration, undertow); } @Override protected void startServer() throws Exception { Undertow server = getServer(); server.start(); this.listenersByProtocol = server.getListenerInfo().stream().collect(Collectors.toMap( Undertow.ListenerInfo::getProtcol, (listenerInfo -> listenerInfo) )); } @Override protected void stopServer() throws Exception { getServer().stop(); } @Override public int getPort() { Undertow.ListenerInfo https = listenersByProtocol.get("https"); if (https != null) { return ((InetSocketAddress) https.getAddress()).getPort(); } Undertow.ListenerInfo http = listenersByProtocol.get("http"); if (http != null) { return ((InetSocketAddress) http.getAddress()).getPort(); } return -1; } @Override public String getHost() { Undertow.ListenerInfo https = listenersByProtocol.get("https"); if (https != null) { return ((InetSocketAddress) https.getAddress()).getHostName(); } Undertow.ListenerInfo http = listenersByProtocol.get("http"); if (http != null) { return ((InetSocketAddress) http.getAddress()).getHostName(); } return "localhost"; } @Override public String getScheme() { Undertow.ListenerInfo https = listenersByProtocol.get("https"); if (https != null) { return https.getProtcol(); } return "http"; } @Override public URL getURL() { try { return getURI().toURL(); } catch (MalformedURLException e) { throw new InternalServerException(e.getMessage(), e); } } @Override public URI getURI() { return URI.create(getScheme() + "://" + getHost() + ":" + getPort()); } @Override public boolean isRunning() { return getApplicationContext().isRunning(); } }
[ "graeme.rocher@gmail.com" ]
graeme.rocher@gmail.com
59da7b155a09512acfb44f3aca6546b2306cc65c
8baffb4b6678557fdfd065807bafd7cc618de03f
/src/test/java/AutomationPractice/StepDefinitions/CheckoutSteps.java
a5a4005cd555b31bd7655f86d541449501f2bb67
[]
no_license
maclyn02/QAMastersJenkinsProject
de85de5ad0fe1b516f9f8dd9af0373c24b044000
31ab895a73d68d1ddf67dfdbebc11e707c20077b
refs/heads/master
2021-07-08T05:40:46.866393
2019-07-24T09:20:07
2019-07-24T09:20:07
196,085,647
0
0
null
null
null
null
UTF-8
Java
false
false
4,383
java
package AutomationPractice.StepDefinitions; import AutomationPractice.Pages.*; import AutomationPractice.Utils.Utils; import cucumber.api.java.en.And; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import org.junit.Assert; public class CheckoutSteps { HomePage homepage = new HomePage(); ProductPage productPage = new ProductPage(); LoginPage loginpage = new LoginPage(); OrderSummaryPage osp = new OrderSummaryPage(); AuthenticationPage authpage = new AuthenticationPage(); AddressPage ap = new AddressPage(); ShippingPage sp = new ShippingPage(); PaymentPage pp = new PaymentPage(); CompleteOrderPage cop = new CompleteOrderPage(); @Given("^User opens the home page$") public void isUserOnHomePage(){ Assert.assertTrue(homepage.isUserOnHomePage()); } @When("^User hovers over cart icon and clicks checkout button$") public void clickCheckoutBtn() { Utils.scrollTo(0,-600); Utils.wait(10); productPage.hoverCartClickCheckout(); } @When("^User clicks proceed to checkout button on order summary page$") public void clickProceedBtnOrderSummaryStep(){ osp.clickProceedBtn(); } @When("^User enters email \"([^\"]*)\" and password \"([^\"]*)\"$") public void enterCredentials(String email,String passwd){ authpage.enterCredentials(email,passwd); } @When("^User verifies delivery address$") public void verifyAddress() { } @When("^User ticks checkbox for terms and conditions$") public void tickMarkTermsAndConditions(){ sp.acceptTermsnConditions(); } @When("^User clicks on Pay by Bank Wire link$") public void clickBankWireOption() { pp.selectBankwirePayment(); } @When("^User clicks on Pay by Cheque link$") public void clickChequeOption() { pp.selectChequePayment(); } @When("^User clicks I confirm my order button$") public void confirmOrder() { cop.clickConfirmBtn(); } @Then("^User should see order page$") public void verifyOrderSummaryDisplayed(){ Assert.assertTrue(osp.getTitle().equalsIgnoreCase("Order - My Store")); osp.isOrderPageOpen(); } @Then("^User should see authentication page$") public void verifyAuthenticationPageDisplayed(){ authpage.isAuthenticationPageOpen(); } @Then("^User should see delivery address options$") public void verifyAddressPageDisplayed(){ ap.isAddressPageOpen(); } @Then("^User should see shipping information$") public void verifyShippingPageDisplayed(){ sp.isShippingPageOpen(); } @Then("^User should be payment options$") public void verifyPaymentPageDisplayed(){ pp.isPaymentPageOpen(); } @Then("^User should see bank wire payment details$") public void verifyBankwireDetailsDisplayed() { pp.isBankwirePaymentModeSelected(); } @Then("^User should see cheque payment details$") public void verifyChequeDetailsDisplayed() { pp.isChequePaymentModeSelected(); } @Then("^User should see order confirmation$") public void verifyOrderConfirmationDisplayed(){ cop.isOrderConfirmationDisplayed(); } @And("^User is logged in with email as \"([^\"]*)\" and password as \"([^\"]*)\" and prepared to checkout$") public void loginAndPrepare(String email, String passwd) { homepage.clickLoginBtn(); Assert.assertTrue(loginpage.isUserOnLoginPage()); Assert.assertTrue(loginpage.isLoginFormDisplayed()); loginpage.enterCredentials(email,passwd); loginpage.clickLoginBtn(); homepage.isUserLoggedIn(); productPage.addToCart("DRESSES","CASUAL DRESSES"); } @And("^User is prepared to checkout$") public void prepare(){ productPage.addToCart("DRESSES","CASUAL DRESSES"); } @And("^User clicks on sign-in button$") public void clickSignInBtn(){ authpage.clickSignInBtn(); } @And("^User clicks proceed to checkout button on address page$") public void clickProceedBtnAddressStep() { ap.clickProceedBtn(); } @And("^User clicks proceed to checkout button on shipping page$") public void clickProceedBtnShippingStep(){ sp.clickProceedBtn(); } }
[ "mac.afonso@yahoo.com" ]
mac.afonso@yahoo.com
f2d6d93dbe89394f89e45ee4efb8214d510fe75d
841c5cf088a0985daf191a3316945daeceef6828
/Host.java
dc0779b59318f09ba9597774d9846f9c5bff09bb
[ "Apache-2.0" ]
permissive
masoudkarimif/multiagent-number-guessing-game
427e4aaf39b2ed35ea3df1c914a4cc71e636c6a5
34ad27320d442b70923274035e3cea87941c8217
refs/heads/master
2021-11-05T01:56:47.248451
2021-11-01T00:27:16
2021-11-01T00:27:16
244,250,549
1
0
null
null
null
null
UTF-8
Java
false
false
4,335
java
package mkf.jade.guessinggame; import java.util.Random; import java.util.Set; import java.util.HashSet; import jade.lang.acl.ACLMessage; import jade.lang.acl.MessageTemplate; import jade.core.behaviours.SimpleBehaviour; import jade.core.behaviours.TickerBehaviour; import jade.core.Agent; import jade.core.AID; public class Host extends EnhancedAgent { private int period = Constants.PERIOD; public Set<AID> players = new HashSet<>(); protected void setup() { System.out.println("My name is " + getLocalName()); register("Host"); addBehaviour(new TickerBehaviour (this, period) { protected void onTick() { players = searchForService(Constants.PLAYER_SERVICE_NAME); System.out.printf("Number of players so far: %d%n", players.size()); if (players.size() >= 2) { stop(); restOfTheBehaviours(); } } }); } private void restOfTheBehaviours() { System.out.printf("We're good to go with %d players%n", players.size()); addBehaviour(new HostBehaviour(this)); } } class HostBehaviour extends SimpleBehaviour { private boolean done = false; private int goal; private Random rand; private short actionCounter = 0; private Host myAgent; private Set<AID> respondingPlayers = new HashSet<>(); public HostBehaviour(Agent agent) { super(agent); myAgent = (Host) agent; rand = new Random(); } private void sendMsg(String content, String conversationId, int type, Set<AID> receivers) { ACLMessage msg = new ACLMessage(type); msg.setContent(content); msg.setConversationId(conversationId); //add receivers for (AID agent: receivers) { msg.addReceiver(agent); } myAgent.send(msg); } private void generateRandomNumber() { goal = rand.nextInt(Constants.MAX_VALUE); } public void action() { ACLMessage msg; MessageTemplate template; switch(actionCounter) { case 0: sendMsg("Wanna Play?", Constants.PLAY_REQ, ACLMessage.REQUEST, myAgent.players); actionCounter++; break; case 1: //listening for replies System.out.println("Waiting for response ..."); template = MessageTemplate.and( MessageTemplate.MatchPerformative(ACLMessage.ACCEPT_PROPOSAL), MessageTemplate.MatchConversationId(Constants.PLAY_REQ)); msg = myAgent.blockingReceive(template); if(msg != null) { //just received an accept respondingPlayers.add(msg.getSender()); System.out.printf("Agent %s just accepted the proposal%n", msg.getSender().getLocalName()); if(respondingPlayers.size() == myAgent.players.size()) { //everybody has accepted //we can play actionCounter = 2; } } break; case 2: System.out.println("Everybody has agreed to play. Let's go!"); generateRandomNumber(); sendMsg("Guess", Constants.GUESS, ACLMessage.REQUEST, myAgent.players); actionCounter = 3; break; case 3: template = MessageTemplate.and( MessageTemplate.MatchPerformative(ACLMessage.QUERY_IF), MessageTemplate.MatchConversationId(Constants.GUESS)); msg = myAgent.blockingReceive(template); if(msg != null) { //we just received a guess System.out.printf("Agent %s guessed number %s%n", msg.getSender().getLocalName(), msg.getContent()); if(goal == Integer.parseInt(msg.getContent())) { System.out.println("=============================================================="); System.out.printf("Agent %s guessed correctly and the goal was %d! Game is over!%n%n", msg.getSender().getLocalName(), goal); sendMsg("Game's over", Constants.OVER, ACLMessage.INFORM, myAgent.players); done = true; myAgent.doDelete(); } else { //guess is incorrect ACLMessage reply = msg.createReply(); reply.setPerformative(ACLMessage.REQUEST); reply.setContent("Guess"); reply.setConversationId(Constants.GUESS); myAgent.send(reply); } } break; } } public boolean done() { return done; } }
[ "karimif.masoud@gmail.com" ]
karimif.masoud@gmail.com
cfd679f56dd507cbb0c9bf368a58746be2831550
c9dbc106c60475f201b8dbc536048b4f4fd006f7
/SelaromMaguca/src/java/hibernate/FabricaDAOCargo.java
489c852a4fca6797b03df78e16b1ffc7a16e9da4
[]
no_license
juliocell/selarommagu
381d626ad65c363e92dbc2e9350c3356aac11e1d
67c70a8c9149a8bee0492d82cb220bc98835ecc3
refs/heads/master
2016-09-06T14:51:52.725505
2010-06-27T06:27:20
2010-06-27T06:27:20
39,841,064
0
0
null
null
null
null
UTF-8
Java
false
false
281
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package hibernate; /** * * @author isak */ public class FabricaDAOCargo extends FabricaDAO{ public ICargoDao getCargoDAO() { return new CargoDaoImpl(); } }
[ "mcdsx10@2fe2b151-1866-4bc7-5276-41e8786ae583" ]
mcdsx10@2fe2b151-1866-4bc7-5276-41e8786ae583
ebeb4774c9e5e299e932e1aefac31cd27bc4b525
233f8ded4a90b1c9ebfa930f1c67abcea375088a
/src/csc4380jchackofinalproject/controllerFinalPersonalInformation.java
8f181abb4302ffa2be376e2bf5dd8d998a93b627
[]
no_license
jchacko1/PersonalInformation
939cec74c7d792b401a20623c0aa274698301b00
3a04dec8765ed51aa599cc86a7bb572ffa3095bd
refs/heads/master
2020-12-30T14:13:10.773442
2017-05-15T05:01:01
2017-05-15T05:01:01
91,293,256
0
0
null
null
null
null
UTF-8
Java
false
false
9,878
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 csc4380jchackofinalproject; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /** * * @author admin */ public class controllerFinalPersonalInformation { private viewFinalPersonalInformation viewPI; private modelFinalPersonalInformation modelPI; public controllerFinalPersonalInformation(viewFinalPersonalInformation viewPI, modelFinalPersonalInformation modelPI) { this.viewPI = viewPI; this.modelPI = modelPI; //modelPI.DefaultResults(); //loads default values in gui/database and adds listeners loadDefault(); } public void loadDefault(){ modelPI.objResults = modelPI.DefaultResults(); //sets default values in gui viewPI.setIdResults(modelPI.objResults.intFindId); viewPI.setNameResults(modelPI.objResults.strFindName); viewPI.setGenderResults(modelPI.objResults.strFindGender); viewPI.setAgeResults(modelPI.objResults.intFindAge); viewPI.setAddressResults(modelPI.objResults.strFindAddress); viewPI.setFatherResults(modelPI.objResults.strFindFatherName); viewPI.setMotherResults(modelPI.objResults.strFindMotherName); viewPI.setSiblingResults(modelPI.objResults.intFindSiblingNumber); viewPI.setPartnerResults(modelPI.objResults.strFindPartnerName); viewPI.setChildrenResults(modelPI.objResults.intFindChildrenNumber); //adds listeners to the buttons this.viewPI.addUpdateNameListener(new btnNameListener()); this.viewPI.addUpdateGenderListener(new btnGenderListener()); this.viewPI.addUpdateAgeListener(new btnAgeListener()); this.viewPI.addUpdateAddressListener(new btnAddressListener()); this.viewPI.addUpdateFatherListener(new btnFatherListener()); this.viewPI.addUpdateMotherListener(new btnMotherListener()); this.viewPI.addUpdateSiblingListener(new btnSiblingListener()); this.viewPI.addUpdatePartnerListener(new btnPartnerListener()); this.viewPI.addUpdateChildrenListener(new btnChildrenListener()); this.viewPI.addNewPersonListener(new btnAddPersonListener()); this.viewPI.addSearchListener(new btnSearchListener()); this.viewPI.addDefaultLayoutListener(new btnDefaultListener()); this.viewPI.addLineLayoutListener(new btnLineListener()); this.viewPI.addBackwardsLayoutListener(new btnBackwardsListener()); this.viewPI.addExperimentLayoutListener(new btnExperimentListener()); } /************* Action Listeners ******************/ //gets the values from gui and updates them in gui and in the database class btnNameListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.strFindName = viewPI.getUpdateName(); modelPI.UpdateName(modelPI.objResults); } } class btnGenderListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.strFindGender = viewPI.getUpdateGender(); modelPI.UpdateGender(modelPI.objResults); } } class btnAgeListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.intFindAge= viewPI.getUpdateAge(); modelPI.UpdateAge(modelPI.objResults); } } class btnAddressListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.strFindAddress = viewPI.getUpdateAddress(); modelPI.UpdateAddress(modelPI.objResults); } } class btnFatherListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.strFindFatherName = viewPI.getUpdateFather(); modelPI.UpdateFather(modelPI.objResults); } } class btnMotherListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.strFindMotherName = viewPI.getUpdateMother(); modelPI.UpdateMother(modelPI.objResults); } } class btnSiblingListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.intFindSiblingNumber = viewPI.getUpdateSibling(); modelPI.UpdateSibling(modelPI.objResults); } } class btnPartnerListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.strFindPartnerName = viewPI.getUpdatePartner(); modelPI.UpdatePartner(modelPI.objResults); } } class btnChildrenListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); modelPI.objResults.intFindChildrenNumber = viewPI.getUpdateChildren(); modelPI.UpdateChildren(modelPI.objResults); } } class btnAddPersonListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //viewPI.setName(modelPI.objResults.strFindName); //modelPI.objResults.strFindName = viewPI.getUpdateName(); //modelPI.UpdateName(modelPI.objResults); //adds id and gets it back modelPI.objResults.intFindId = modelPI.AddPerson(); //sends id to be searched modelPI.objResults = modelPI.Search(modelPI.objResults.intFindId); //Shows the newest Id values in gui viewPI.setIdResults(modelPI.objResults.intFindId); viewPI.setNameResults(modelPI.objResults.strFindName); viewPI.setGenderResults(modelPI.objResults.strFindGender); viewPI.setAgeResults(modelPI.objResults.intFindAge); viewPI.setAddressResults(modelPI.objResults.strFindAddress); viewPI.setFatherResults(modelPI.objResults.strFindFatherName); viewPI.setMotherResults(modelPI.objResults.strFindMotherName); viewPI.setSiblingResults(modelPI.objResults.intFindSiblingNumber); viewPI.setPartnerResults(modelPI.objResults.strFindPartnerName); viewPI.setChildrenResults(modelPI.objResults.intFindChildrenNumber); //Shows a person has been successfully added viewPI.setAddSuccess("Person Successfully Added"); //viewPI.setIdResults(); } } class btnSearchListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ //gets id from textfield modelPI.objResults.intFindId = viewPI.getUpdateId(); //sends id to be searched modelPI.objResults = modelPI.Search(modelPI.objResults.intFindId); //Shows new values in gui viewPI.setIdResults(modelPI.objResults.intFindId); viewPI.setNameResults(modelPI.objResults.strFindName); viewPI.setGenderResults(modelPI.objResults.strFindGender); viewPI.setAgeResults(modelPI.objResults.intFindAge); viewPI.setAddressResults(modelPI.objResults.strFindAddress); viewPI.setFatherResults(modelPI.objResults.strFindFatherName); viewPI.setMotherResults(modelPI.objResults.strFindMotherName); viewPI.setSiblingResults(modelPI.objResults.intFindSiblingNumber); viewPI.setPartnerResults(modelPI.objResults.strFindPartnerName); viewPI.setChildrenResults(modelPI.objResults.intFindChildrenNumber); //When person is switched after being added the AddSuccess label is cleared viewPI.setAddSuccess(""); viewPI.setNotFound(modelPI.objResults.boolSearchError); } } /********Layout Button Actions****/ class btnDefaultListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ viewPI.setDefaultLayout(); } } class btnLineListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ viewPI.setLineLayout(); } } class btnBackwardsListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ viewPI.setBackwardsLayout(); } } class btnExperimentListener implements ActionListener{ public void actionPerformed(ActionEvent evt){ viewPI.setExperimentLayout(); } } //String strUpdateName; }
[ "admin@admin-PC" ]
admin@admin-PC
3c7281cfc5bddb306414751a5c5d8360a0cc528f
dbf5adca095d04d7d069ecaa916e883bc1e5c73d
/x_processplatform_assemble_bam/src/main/java/com/x/processplatform/assemble/bam/jaxrs/period/ActionListCountExpiredWorkByApplication.java
4635d69e4df53e6a741446262f1822368d647386
[ "BSD-3-Clause" ]
permissive
fancylou/o2oa
713529a9d383de5d322d1b99073453dac79a9353
e7ec39fc586fab3d38b62415ed06448e6a9d6e26
refs/heads/master
2020-03-25T00:07:41.775230
2018-08-02T01:40:40
2018-08-02T01:40:40
143,169,936
0
0
BSD-3-Clause
2018-08-01T14:49:45
2018-08-01T14:49:44
null
UTF-8
Java
false
false
1,952
java
package com.x.processplatform.assemble.bam.jaxrs.period; import java.util.ArrayList; import java.util.List; import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.container.factory.EntityManagerContainerFactory; import com.x.base.core.http.ActionResult; import com.x.base.core.http.WrapOutMap; import com.x.base.core.project.jaxrs.StandardJaxrsAction; import com.x.base.core.utils.DateRange; import com.x.base.core.utils.DateTools; import com.x.processplatform.assemble.bam.Business; import com.x.processplatform.assemble.bam.ThisApplication; import com.x.processplatform.assemble.bam.stub.ApplicationStub; class ActionListCountExpiredWorkByApplication extends ActionListCountExpiredWork { ActionResult<WrapOutMap> execute(String companyName, String departmentName, String personName) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<WrapOutMap> result = new ActionResult<>(); Business business = new Business(emc); WrapOutMap wrap = new WrapOutMap(); List<DateRange> os = this.listDateRange(); for (DateRange o : os) { String str = DateTools.format(o.getStart(), DateTools.format_yyyyMM); List<WrapOutMap> list = new ArrayList<>(); wrap.put(str, list); for (ApplicationStub stub : this.listStub()) { WrapOutMap p = new WrapOutMap(); p.put("category", stub.getCategory()); p.put("name", stub.getName()); p.put("value", stub.getValue()); p.put("count", this.count(business, o, stub.getValue(), StandardJaxrsAction.EMPTY_SYMBOL, companyName, departmentName, personName)); list.add(p); } } result.setData(wrap); return result; } } private List<ApplicationStub> listStub() throws Exception { List<ApplicationStub> list = new ArrayList<>(); for (ApplicationStub o : ThisApplication.period.getExpiredWorkApplicationStubs()) { list.add(o); } return list; } }
[ "caixiangyi2004@126.com" ]
caixiangyi2004@126.com
3c7479146b9abd2818a01aab09410bd949a450c9
c8688db388a2c5ac494447bac90d44b34fa4132c
/sources/com/google/android/gms/internal/ads/se0.java
587d7650ce5562eb91a24aa36aa10e79d6b4500b
[]
no_license
mred312/apk-source
98dacfda41848e508a0c9db2c395fec1ae33afa1
d3ca7c46cb8bf701703468ddc88f25ba4fb9d975
refs/heads/master
2023-03-06T05:53:50.863721
2021-02-23T13:34:20
2021-02-23T13:34:20
341,481,669
0
0
null
null
null
null
UTF-8
Java
false
false
2,589
java
package com.google.android.gms.internal.ads; import android.support.p000v4.media.session.PlaybackStateCompat; /* compiled from: com.google.android.gms:play-services-ads@@19.5.0 */ final class se0 { /* renamed from: a */ private final zzpn f11078a = new zzpn(8); /* renamed from: b */ private int f11079b; /* renamed from: b */ private final long m6968b(zzjz zzjz) { int i = 0; zzjz.zza(this.f11078a.data, 0, 1); byte b = this.f11078a.data[0] & 255; if (b == 0) { return Long.MIN_VALUE; } int i2 = 128; int i3 = 0; while ((b & i2) == 0) { i2 >>= 1; i3++; } int i4 = b & (i2 ^ -1); zzjz.zza(this.f11078a.data, 1, i3); while (i < i3) { i++; i4 = (this.f11078a.data[i] & 255) + (i4 << 8); } this.f11079b += i3 + 1; return (long) i4; } /* renamed from: a */ public final boolean mo14795a(zzjz zzjz) { zzjz zzjz2 = zzjz; long length = zzjz.getLength(); long j = PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID; if (length != -1 && length <= PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) { j = length; } int i = (int) j; zzjz2.zza(this.f11078a.data, 0, 4); this.f11079b = 4; for (long zzjc = this.f11078a.zzjc(); zzjc != 440786851; zzjc = ((zzjc << 8) & -256) | ((long) (this.f11078a.data[0] & 255))) { int i2 = this.f11079b + 1; this.f11079b = i2; if (i2 == i) { return false; } zzjz2.zza(this.f11078a.data, 0, 1); } long b = m6968b(zzjz); long j2 = (long) this.f11079b; if (b != Long.MIN_VALUE && (length == -1 || j2 + b < length)) { while (true) { int i3 = this.f11079b; long j3 = j2 + b; if (((long) i3) < j3) { if (m6968b(zzjz) == Long.MIN_VALUE) { return false; } long b2 = m6968b(zzjz); if (b2 < 0 || b2 > 2147483647L) { return false; } if (b2 != 0) { zzjz2.zzah((int) b2); this.f11079b = (int) (((long) this.f11079b) + b2); } } else if (((long) i3) == j3) { return true; } } } return false; } }
[ "mred312@gmail.com" ]
mred312@gmail.com
61677f591ed142233d4cc5b0754b3737ffea9a93
b6b9cb8325b589292a14c85a6bfd32c61316ffbf
/app/src/main/java/com/mojokarma/mojokarma/Edit_profile.java
92de90651295e5567d015134e4f4fb108f2edc68
[]
no_license
SrinathShree/MojokarmaMerged
8129b7f3ae2111d82e83be29ec05682cb502d9ca
e50126df58b6e59c572c776f0bd87fea8d2b3c62
refs/heads/master
2021-01-10T20:26:19.539554
2015-06-30T12:14:57
2015-06-30T12:14:57
38,307,350
0
0
null
null
null
null
UTF-8
Java
false
false
6,268
java
package com.mojokarma.mojokarma; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.RectF; import android.support.v4.app.NavUtils; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.ImageView; import android.widget.LinearLayout; import org.achartengine.ChartFactory; import org.achartengine.GraphicalView; import org.achartengine.chart.BarChart; import org.achartengine.model.XYMultipleSeriesDataset; import org.achartengine.model.XYSeries; import org.achartengine.renderer.XYMultipleSeriesRenderer; import org.achartengine.renderer.XYSeriesRenderer; public class Edit_profile extends ActionBarActivity { private GraphicalView mChart; private XYSeries series,series1 ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_profile); Toolbar toolbar=(Toolbar)findViewById(R.id.app_bar); setSupportActionBar(toolbar); getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.gomez); Bitmap resizedBitmap = Bitmap.createScaledBitmap(bm, 200,200, false); Bitmap conv_bm=getCircleBitmap1(resizedBitmap,100); // set circle bitmap ImageView mImage = (ImageView) findViewById(R.id.profile_image); mImage.setImageBitmap(conv_bm); getSupportActionBar().setDisplayHomeAsUpEnabled(true); drawBarChart(); } private Bitmap getCircleBitmap1(Bitmap bitmap , int pixels) { final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); final Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(),bitmap.getHeight()); final RectF rectF = new RectF(rect); paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(color); canvas.drawCircle(100, 100, 86, paint); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); bitmap.recycle(); return output; } private void drawBarChart(){ // X-axis data double years=12; // Y-axis data arrays double Maxpoints[]={1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000}; double Pointsrec[]={200,300,200,400,0,100,500,600,800,600,400,700}; // Create XY series for the first data array series = new XYSeries(" Max Points "); for(int i=0;i<years;i++){ series.add(i, Maxpoints[i]); } // Create XYSeries for the second data array series1 = new XYSeries("Received Points"); for(int i=0;i<years;i++){ series1.add(i, Pointsrec[i]); } // Create XY Series list and add the series to the list XYMultipleSeriesDataset SeriesDataset =new XYMultipleSeriesDataset(); SeriesDataset.addSeries(series); SeriesDataset.addSeries(series1); // Create renderer for the series XYSeriesRenderer renderer = new XYSeriesRenderer(); // Set bar color renderer.setColor(Color.parseColor("#1BCFB3")); renderer.setFillPoints(true); renderer.setLineWidth(2); // Create render for the series1 XYSeriesRenderer renderer1 = new XYSeriesRenderer(); // Set bar color renderer1.setColor(Color.parseColor("#FF740A")); renderer1.setFillPoints(true); renderer1.setLineWidth(2); // Create renderer list and add renderers to the list XYMultipleSeriesRenderer mRenderer=new XYMultipleSeriesRenderer(); mRenderer.setXAxisMin(0); mRenderer.setXAxisMax(12); mRenderer.setYAxisMin(0); mRenderer.setYAxisMax(1000); mRenderer.setXLabels(0); mRenderer.setYLabels(0); mRenderer.setBarSpacing(1); mRenderer.setShowGridY(false); mRenderer.setChartTitle("Applauds in 2014"); mRenderer.setLabelsColor(Color.parseColor("#1BCFB3")); mRenderer.addSeriesRenderer(renderer); mRenderer.addSeriesRenderer(renderer1); // Set chart background color mRenderer.setApplyBackgroundColor(true); mRenderer.setBackgroundColor(Color.WHITE); mRenderer.setMarginsColor(Color.WHITE); // Get stacked bar chart view // Types of bar chart: DEFAULT and STACKED mChart = ChartFactory.getBarChartView(this, SeriesDataset, mRenderer, BarChart.Type.STACKED); // Add the bar chart view to the layout to show LinearLayout chartlayout=(LinearLayout)findViewById(R.id.barchart); chartlayout.addView(mChart); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_edit_profile, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } if(id==R.id.tick){ startActivity(new Intent(this,UserProfile.class)); } if(id == android.R.id.home){ NavUtils.navigateUpFromSameTask(this); } return super.onOptionsItemSelected(item); } }
[ "shree.nani369@gmail.com" ]
shree.nani369@gmail.com
a7fa1aac41224c1b46c35e38ada71f222d199a75
15b84775522e149e77b916aea637bf7fe5d4059a
/src/domain/RazaSelector.java
1d93fbc47535cb677b96f709d247ec4991322d3c
[]
no_license
MarcoPRdz/addtul
651a3c72d66d99ffc9aa35346f90ae1e9940b3cc
3a3b08543eafab44729b6ae755b24dd6f6fb55c1
refs/heads/master
2020-04-10T20:35:04.067658
2016-01-28T06:57:31
2016-01-28T06:57:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
833
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 domain; import abstractt.ComboBox; //import domain.Animal. /** * * @author Developer GAGS */ public class RazaSelector extends ComboBox{ public RazaSelector(){ } public void cargarTodas(){ addArray(domain.Raza.cargarRazasTodas()); } public void cargarSeleccionar(){ addArray(domain.Raza.cargarRazasSeleccionar()); } public Raza razaSeleccionada(){ Raza raza; raza = new Raza(); raza.cargarPorDescripcion(this.getSelectedItem().toString()); return raza; } }
[ "Home@MASTER_PC.hitronhub.home" ]
Home@MASTER_PC.hitronhub.home
3b74cef3cf2b069b8d712dae1d32b42776962e2b
ac5d10268098375911996b8f131f9f534e5b324a
/app/src/main/java/com/priya/fragmentlistexample/fragments/ListFragment.java
d3cb49dbe6e8a60836522a230d6872ff98ff912c
[]
no_license
SpsPriya20/fragment_list_example
31bcf9b3be6c615adff7293ef36939869510800e
b42d7fcb53b054d7bd65c5a810c5f98b049bc98d
refs/heads/master
2020-03-24T21:25:56.123851
2018-07-31T15:19:57
2018-07-31T15:19:57
143,032,025
0
0
null
null
null
null
UTF-8
Java
false
false
1,233
java
package com.priya.fragmentlistexample.fragments; import android.app.Activity; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ListView; import com.priya.fragmentlistexample.R; import com.priya.fragmentlistexample.adapter.ChatAdapter; public class ListFragment extends Fragment { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view= inflater.inflate(R.layout.fragment_list,container,false); ListView listView= view.findViewById(R.id.chat_List); String[] nameList = {"Priya","Riya","Sriya","Simran","Radha","Sweta","Rohit", "Mohit","Raj","Rahul","Aman","Rajesj","Mahesh","Sweety","Humpty","Dhoni","Virat", "Aradya","Aradhna","Pinky","rocky","Vicky"}; ChatAdapter chatAdapter = new ChatAdapter(nameList,getActivity()); listView.setAdapter(chatAdapter); return view; } }
[ "swarnapriyasahu@gmail.com" ]
swarnapriyasahu@gmail.com
d560d29f87baf4035fce200f74e4e82385bb2e1d
e1e6527fbbb6502c2aad05d5017d428d34dd8f48
/service/service_management/src/main/java/com/lwx/management/entity/Entry.java
ac54c49065d45448718869ffb957ec2301dbd921
[]
no_license
xuan-gdmu/SHR
a9253a5157839e6291567b27ec3d8b56ac6bf6e7
4582756c2ee1ef9c4435a419f2924aace49adc4c
refs/heads/master
2023-05-31T07:31:44.784661
2021-06-18T14:06:11
2021-06-18T14:06:11
353,564,114
0
0
null
null
null
null
UTF-8
Java
false
false
1,402
java
package com.lwx.management.entity; import com.baomidou.mybatisplus.annotation.*; import java.util.Date; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * * </p> * * @author testjava * @since 2021-03-30 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @ApiModel(value="Entry对象", description="") public class Entry implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.ID_WORKER_STR) private String id; private String name; private String employeeId; private String phonenum; private String identitynum; private Date expectedtime; private String entrydept; private String entrypost; private String email; private String entryregister; private String apprmsg; private String operator; @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") @TableLogic private Boolean isDelete; @ApiModelProperty(value = "创建时间") @TableField(fill = FieldFill.INSERT) private Date gmtCreate; @ApiModelProperty(value = "更新时间") @TableField(fill = FieldFill.INSERT_UPDATE) private Date gmtModified; }
[ "1040152310@qq.com" ]
1040152310@qq.com
f53983100afa3e8ab6d18f72ff61311776bec7d1
1d0f1928da4769ae283828e286447114d9ac79dc
/src/main/java/com/daniel/cursomc/services/UserService.java
36afe28f3089001793245abf09a862dcbea80645
[]
no_license
danspiegel/compras-spring-boot
5b73af12d1ecc24c653d2375176b9f46a38161a7
3528b1f1e25c9963471e81d96d502b2f58a15dd6
refs/heads/master
2023-05-04T01:59:16.545105
2021-05-29T21:59:58
2021-05-29T21:59:58
277,992,818
0
0
null
null
null
null
UTF-8
Java
false
false
375
java
package com.daniel.cursomc.services; import org.springframework.security.core.context.SecurityContextHolder; import com.daniel.cursomc.security.UserSS; public class UserService { public static UserSS authenticated() { try { return (UserSS) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); } catch (Exception e) { return null; } } }
[ "danispiegel@gmail.com" ]
danispiegel@gmail.com
47cb88389933e72c2e53b9e08a11b85521c892d8
152fdd010578a833d937b8d10f167d9f3aa5bc26
/src/earth/server/Monitor.java
55055eca997281cc898cc75867b8dd3e5471c92a
[ "BSD-3-Clause" ]
permissive
lugt/leiluolocal
4f5f04441eada2fb77c8a36be0f7672d277f0a69
193523dfadebc2194f632dfe7c46df271b2bc397
refs/heads/master
2021-09-15T07:32:29.583185
2018-05-28T16:12:42
2018-05-28T16:12:42
108,003,503
0
0
null
null
null
null
UTF-8
Java
false
false
1,121
java
package earth.server; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Created by Frapo on 2017/1/23. */ public class Monitor { static { } private static Log log = LogFactory.getLog(Monitor.class); public static void logger(int i) { // 记录数值 log.info(i); } public static void alert(String msg) { log.warn(msg); // Alert; } public static void debug(String s) { log.info(s); } public static void logger(String s) { log.info(s); } public static void access(String s) { log.trace("{" + s + "}"); } public static void response(String res) { log.trace("[" + res + "]"); } public static void exp(Exception e, Class s) { Log logs = LogFactory.getLog(s); logs.info(e); } public static void error(String s) { log.error(s); } public static void logger(String tag, String s) { log.info(tag + s); } public static void feedback(String s) { System.out.println("::" + s); } }
[ "lu.gt@163.com" ]
lu.gt@163.com
9a102aa72a6daf9e777385c09fa36f79c210ad83
de6146d8b5f5a10c6ae3c6f8fdd6825ffa966b8f
/MyPenelopF/src/MySQLAccess.java
7492574d092beafd9fd3c84a49b9ad465d7c5ce7
[]
no_license
keitsu/MyPenelopeF
dbcafd304400397d842153891e40811e37528453
b21bf7aad78aef343de6a0b2fc8a3fd04c591460
refs/heads/master
2020-12-02T08:13:12.573822
2017-07-10T15:08:58
2017-07-10T15:08:58
96,788,468
0
0
null
null
null
null
UTF-8
Java
false
false
864
java
import java.sql.*; class MySQLAccess{ public static void main(String args[]){ try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/peneloppeDB?autoReconnect=true&useSSL=false","admin","admin"); //here sonoo is database name, root is username and password Statement stmt=con.createStatement(); Statement stmt1=con.createStatement(); stmt.executeUpdate("INSERT INTO squad(Name , idProject) VALUES ('Compta', 1)"); ResultSet rs=stmt1.executeQuery("select * from squad"); while(rs.next()) System.out.println(rs.getInt(1)+" "+rs.getString(2)+" "+rs.getString(3)); con.close(); }catch(Exception e){ System.out.println(e);} } }
[ "samuel@MacBook-Pro-de-samuel.local" ]
samuel@MacBook-Pro-de-samuel.local
3e6de58bffc46f6e1a927ccd2c5ba80052e33ec0
bef166ddbfe0a8812146bbda8be35554ab9f1617
/src/main/java/com/ef/golf/callable/RedPackageCheckTask.java
4573a45b0652aa19f1e35c8d5899e4e566ca7546
[]
no_license
jinxing000/test
774d1d4f80e00f9ce02653dc14cf0a18241a0abe
3b750064ffd6baa0defc2b478a7586f82a3697e1
refs/heads/master
2020-11-25T17:28:07.942458
2018-11-29T08:52:27
2018-11-29T08:52:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,827
java
package com.ef.golf.callable; import com.ef.golf.pojo.RedPackage; import com.ef.golf.pojo.SmallRedPackage; import com.ef.golf.service.RedPackageService; import com.ef.golf.service.UserService; import com.ef.golf.util.AmountUtils; import com.ef.golf.util.RedisBaseDao; import com.ef.golf.util.RedisLoginVerifyUtil; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.io.Serializable; import java.util.*; import java.util.concurrent.Callable; /** * Created by Administrator on 2018/5/10. */ @Component @Scope("prototype") public class RedPackageCheckTask implements Callable<Map<String,Object>>, Serializable { @Resource RedisBaseDao redisBaseDao; @Resource private RedPackageService redPackageService; @Resource private UserService userService; @Resource private RedisLoginVerifyUtil redisLoginVerifyUtil; //红包id private String redPackageId; private String uid; private String sid; @Override public Map<String, Object> call() throws Exception { Map<String, Object> map = new HashMap<>(); Integer userId = redisLoginVerifyUtil.longinVerifty(sid,uid); try { //红包过期判断 /*Boolean bl = redisBaseDao.exist("bigRedPackageList");*/ Boolean bl = redisBaseDao.exist(redPackageId); if (bl) { //根据红包id 查询红包是否已经抢完? List<Integer>list = redisBaseDao.getList(redPackageId); if(null!=list&&list.contains(userId)){ map.put("status",3); map.put("message","已经抢过"); }else{ Integer smallRedPakcge = redPackageService.smallRedPackageCount(redPackageId); //获得未抢列表 List<SmallRedPackage> smallRedPackageList = redisBaseDao.getList("smallRedPackageList"+redPackageId); redisBaseDao.setList("smallRedPackageList"+redPackageId, smallRedPackageList); if(/*redisBaseDao.getList("smallRedPackageList").size()==smallRedPakcge||*/smallRedPackageList.size() == 0){ System.out.println("=================红包已抢完======================"); map.put("status",2); map.put("message","红包已抢完"); }else{ map.put("status",0); } } map.put("qiangRedPackageList",redPackageService.selectQiangRedPackageList(redPackageId)); RedPackage redPackage = redPackageService.selectBigByPrimaryKey(redPackageId); /*int money = (int)redPackage.getMoneyAmount().doubleValue(); redPackage.setMoneyAmount(Double.valueOf(AmountUtils.changeF2Y(money+"")));*/ map.put("bigRedDetails",redPackage); map.put("mineinfo",userService.getInfo(redPackage.getUserId())); }else{ map.put("status",1); map.put("message","红包过期"); } }catch(Exception e){ e.printStackTrace(); } return map; } public String getRedPackageId() { return redPackageId; } public void setRedPackageId(String redPackageId) { this.redPackageId = redPackageId; } public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getSid() { return sid; } public void setSid(String sid) { this.sid = sid; } }
[ "15620532538@163.com" ]
15620532538@163.com
fe67eead83d10371419ec6bcde1c27ad094cc5b5
3393c7601f6551027177d0acbbffb13c6e0afa86
/FINAL IP/HelloSriLanka/APP2/src/main/java/com/example/travelplannerapp/guide_and_drivers_southern.java
8335f449042e59baa1fe1fa52b85aa194e9dcdd5
[]
no_license
dhan0007/HELLO-SRI-LANKA
a428acbf63d3940ab5d5df207a961b2037247fef
2b0396e890bc77ca66c5ff390d0f49af12ffed09
refs/heads/main
2023-03-29T06:17:37.284673
2021-04-02T10:43:09
2021-04-02T10:43:09
353,981,113
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package com.example.travelplannerapp; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; public class guide_and_drivers_southern extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_guide_and_drivers_southern); } }
[ "67438506+dhan0007@users.noreply.github.com" ]
67438506+dhan0007@users.noreply.github.com
0c2639188cd6aee864b7d47a6b0dbd75bc9b8833
5a1e954bff26865a1276e058a79014240c4ca59a
/src/main/java/com/wtz/kafka/controller/UserProducerController.java
daf2247eabc55015cb0189d36afae054b0201662
[]
no_license
qq377751971/bigdata
e158e1486e04d5c7d1994b6cf2402c84680404e0
5fd7f7ffa420c119f59a67c576664d564a3b1145
refs/heads/main
2023-06-08T07:40:17.814587
2021-06-30T09:33:44
2021-06-30T09:33:44
380,109,314
0
0
null
null
null
null
UTF-8
Java
false
false
863
java
package com.wtz.kafka.controller; import com.wtz.avro.User; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * 发送消息 * * @author wangtianzeng */ @RestController @RequestMapping("/kafka/producer") public class UserProducerController { @Resource private KafkaTemplate<String,User> kafkaTemplate; @GetMapping("/send") public void push(){ User user = new User(); user.setName("test"); user.setFavoriteNumber(1); user.setFavoriteColor("red"); //发送消息 kafkaTemplate.send("kafka-test", user); System.out.println("user TOPIC 发送成功"); } }
[ "tianzeng.wang@tongdun.net" ]
tianzeng.wang@tongdun.net
a8960ab7a44250e41e4ba8799a09cfeec41f0f38
6f9d5cd2addf8645c78aad024f3ffb2f6c432f9a
/app/src/test/java/com/egga/layouting3/ExampleUnitTest.java
efa9b7a727749bd7d4e31ea59af2e62057a21094
[]
no_license
eggadsyam/Latihan3
0b4aedfbe5e452f18aaf63fa4d4aae80bb29d7f0
28c5f7eb37b1a1a1a9f32809176f83fa69a5e51d
refs/heads/master
2020-05-19T12:40:43.808777
2019-05-05T11:05:24
2019-05-05T11:05:24
185,019,974
0
0
null
null
null
null
UTF-8
Java
false
false
380
java
package com.egga.layouting3; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "gayenstaey@gmail.com" ]
gayenstaey@gmail.com
f56c5b96fa860ce6aa47211dddddcfb2d6c58012
d1b17a25ba26729a7170d33fc6de7ebcd23d7246
/src/OCA/DimArr8.java
97fa51cff8604ad4b5460cf829d7bb48a6b35556
[]
no_license
FatmanaK/OCA_Ladies
b55a0a0b07578d5c6eb5970a2d5372bd74e4561a
96a1faff76427bed4e9cde174e42314522848a66
refs/heads/master
2022-12-12T14:09:26.938008
2020-09-10T22:06:25
2020-09-10T22:06:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
473
java
package OCA; public class DimArr8 { public static void main(String[] args) { String[][] arr={{"A","B","C"},{"D","E"}}; for(int i=0;i<arr.length;i++){ for (int j=0;j<arr[i].length;j++){ System.out.println(arr [i][j]+"" ); if (arr [i][j].equals("B")){ // break; continue; } } break; // continue;//ABCDE } } }
[ "arzuozen2601@gmail.com" ]
arzuozen2601@gmail.com
0aec334251668fb330fd9d7c2f7339dd62a0d103
77a259b58ac84fa0eccaafa7a1b08b7dd109e1c7
/android/app/src/main/java/com/skillexr/MainApplication.java
a9765dcae7d869f1c5da34b873e809b0199270dd
[]
no_license
EdisonDevadoss/skillexr
576bda0bd5077a19e500d175d2dfa80910750a1f
59a4e249c7ddac05dda5cd93254c5409e591b4fe
refs/heads/master
2023-03-11T23:42:43.169174
2018-01-24T14:51:36
2018-01-24T14:51:36
104,148,565
0
0
null
null
null
null
UTF-8
Java
false
false
1,540
java
package com.skillexr; import android.app.Application; import com.facebook.react.ReactApplication; import com.facebook.reactnative.androidsdk.FBSDKPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import com.facebook.CallbackManager; import com.facebook.FacebookSdk; import com.facebook.reactnative.androidsdk.FBSDKPackage; import com.facebook.appevents.AppEventsLogger; import java.util.Arrays; import java.util.List; public class MainApplication extends Application implements ReactApplication { private static CallbackManager mCallbackManager = CallbackManager.Factory.create(); protected static CallbackManager getCallbackManager() { return mCallbackManager; } private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new FBSDKPackage(mCallbackManager) ); } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); AppEventsLogger.activateApp(this); SoLoader.init(this, /* native exopackage */ false); } }
[ "edisonj1996@gmail.com" ]
edisonj1996@gmail.com
7ea3c5e194adae025f9d5d9ddc0a8add2b4cd7b4
354d595aec5a8ae7ca618d62df79da46f5be9fbe
/src/com/company/LeetCode_2.java
842190dd46181dc137da5fba85115a1ba2eb873d
[]
no_license
incredelous/LeetCode-training
64e21a81a636f85b07735e4a928c347fc3b18f17
c7c04ca641cd3e068af133a1e524c8cd9cd953e0
refs/heads/master
2023-08-29T08:02:36.748315
2021-11-10T14:01:38
2021-11-10T14:01:38
318,980,923
0
0
null
null
null
null
UTF-8
Java
false
false
2,571
java
package com.company; public class LeetCode_2 { //两数相加 public ListNode addTwoNumbers(ListNode l1, ListNode l2) { int carry = 0; int pointer1; int pointer2; if(l1 == null) { return l2; } else if(l2 == null) { return l1; } else { ListNode result = new ListNode(0); ListNode head = result; do { pointer1 = l1.val; pointer2 = l2.val; result.val = (pointer1 + pointer2 + carry) % 10; if(pointer1 + pointer2 + carry >= 10) { carry = 1; } else { carry = 0; } l1 = l1.next; l2 = l2.next; if(l1 == null || l2 == null) { break; } result.next = new ListNode(0); result = result.next; } while(true); if(l1 == null && l2 == null) { if(carry == 1) { result.next = new ListNode(1); } return head; } else if(l1 == null) { ListNode l2_head = l2; int pointer; do { pointer = l2.val; l2.val = (pointer + carry) % 10; if(pointer + carry >= 10) { carry = 1; } else { carry = 0; } if(l2.next == null && carry == 1) { l2.next = new ListNode(0); } l2 = l2.next; } while(l2 != null); if(carry == 1) { l2.next = new ListNode(1); } result.next = l2_head; return head; } else { ListNode l1_head = l1; int pointer; do { pointer = l1.val; l1.val = (pointer + carry) % 10; if(pointer + carry >= 10) { carry = 1; } else { carry = 0; } if(l1.next == null && carry == 1) { l1.next = new ListNode(0); } l1 = l1.next; } while(l1 != null); result.next = l1_head; return head; } } } }
[ "wyf931124@163.com" ]
wyf931124@163.com
008dfb0968f41890552812008ec79fb55d300298
4376ac2bf8805d7b0846887155a0aa96440ba21f
/src-test/src/org/openbravo/test/costing/TestCostingNoSourceAdjustments.java
febbbc4835250a77abd6c346827afc572dbc2aa0
[]
no_license
rarc88/innovativa
eebb82f4137a70210be5fdd94384c482f3065019
77ab7b4ebda8be9bd02066e5c40b34c854cc49c7
refs/heads/master
2022-08-22T10:58:22.619152
2020-05-22T21:43:22
2020-05-22T21:43:22
266,206,020
0
1
null
null
null
null
UTF-8
Java
false
false
99,910
java
/* ************************************************************************* * The contents of this file are subject to the Openbravo Public License * Version 1.1 (the "License"), being the Mozilla Public License * Version 1.1 with a permitted attribution clause; you may not use this * file except in compliance with the License. You may obtain a copy of * the License at http://www.openbravo.com/legal/license.html * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU * All portions are Copyright (C) 2018 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ */ package org.openbravo.test.costing; import static org.junit.Assert.assertEquals; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import org.openbravo.base.exception.OBException; import org.openbravo.dal.core.OBContext; import org.openbravo.dal.service.OBDal; import org.openbravo.model.common.order.Order; import org.openbravo.model.common.plm.Product; import org.openbravo.model.materialmgmt.cost.CostAdjustment; import org.openbravo.model.materialmgmt.transaction.InternalConsumption; import org.openbravo.model.materialmgmt.transaction.InternalMovement; import org.openbravo.model.materialmgmt.transaction.MaterialTransaction; import org.openbravo.model.materialmgmt.transaction.ProductionTransaction; import org.openbravo.model.materialmgmt.transaction.ShipmentInOut; import org.openbravo.test.costing.assertclass.CostAdjustmentAssert; import org.openbravo.test.costing.assertclass.DocumentPostAssert; import org.openbravo.test.costing.assertclass.ProductCostingAssert; import org.openbravo.test.costing.assertclass.ProductTransactionAssert; import org.openbravo.test.costing.utils.TestCostingConstants; import org.openbravo.test.costing.utils.TestCostingUtils; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestCostingNoSourceAdjustments extends TestCostingBase { @Test public void testCostingGM11() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final int day4 = 20; final BigDecimal price1 = new BigDecimal("11.00"); final BigDecimal price2 = new BigDecimal("10.00"); final BigDecimal price3 = new BigDecimal("15.00"); final BigDecimal price4 = new BigDecimal("19.7619"); final BigDecimal price5 = new BigDecimal("11.9524"); final BigDecimal quantity1 = new BigDecimal("820"); final BigDecimal quantity2 = new BigDecimal("400"); final BigDecimal quantity3 = new BigDecimal("420"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingGM11", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods movement, run costing background, post it and assert it InternalMovement goodsMovement = TestCostingUtils .createGoodsMovement(product, price1, quantity2, TestCostingConstants.LOCATOR_L01_ID, TestCostingConstants.LOCATOR_M01_ID, day3); // Update transaction total cost amount TestCostingUtils.manualCostAdjustment(TestCostingUtils .getProductTransactions(product.getId()).get(1), quantity2.multiply(price2), false, day4); // Create purchase invoice, post it and assert it TestCostingUtils.createPurchaseInvoice(goodsReceipt, price3, quantity1, day2); // Run price correction background TestCostingUtils.runPriceBackground(); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalMovement.class, goodsMovement.getId()) .getMaterialMgmtInternalMovementLineList().get(0), price1, price2, true)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalMovement.class, goodsMovement.getId()) .getMaterialMgmtInternalMovementLineList().get(0), price1, price2)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), TestCostingConstants.SPAIN_WAREHOUSE_ID, price3, price1, price3, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(1), TestCostingConstants.SPAIN_WAREHOUSE_ID, price2, price5, price4, quantity3)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(2), TestCostingConstants.SPAIN_EAST_WAREHOUSE_ID, price2, price1, price2, quantity2)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(1), "MCC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, true, true)); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(2), "MCC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, false, true)); costAdjustmentAssertList.add(costAdjustmentAssertLineList1); List<CostAdjustmentAssert> costAdjustmentAssertLineList2 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(0), "PDC", quantity1.multiply(price3).add(quantity1.multiply(price1).negate()), day2, true)); costAdjustmentAssertList.add(costAdjustmentAssertLineList2); TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList1 = new ArrayList<DocumentPostAssert>(); documentPostAssertList1.add(new DocumentPostAssert("35000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("61000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); CostAdjustment costAdjustment1 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils .assertDocumentPost(costAdjustment1, product.getId(), documentPostAssertList1); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(1)); List<DocumentPostAssert> documentPostAssertList2 = new ArrayList<DocumentPostAssert>(); documentPostAssertList2.add(new DocumentPostAssert("99904", BigDecimal.ZERO, quantity1 .multiply(price3).add(quantity1.multiply(price1).negate()), null)); documentPostAssertList2.add(new DocumentPostAssert("35000", quantity1.multiply(price3).add( quantity1.multiply(price1).negate()), BigDecimal.ZERO, null)); CostAdjustment costAdjustment2 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(1).getId()); TestCostingUtils .assertDocumentPost(costAdjustment2, product.getId(), documentPostAssertList2); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingGM12() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final int day4 = 20; final BigDecimal price1 = new BigDecimal("11.00"); final BigDecimal price2 = new BigDecimal("10.00"); final BigDecimal price3 = new BigDecimal("15.00"); final BigDecimal price4 = new BigDecimal("14.00"); final BigDecimal price5 = new BigDecimal("15.9524"); final BigDecimal price6 = new BigDecimal("11.9524"); final BigDecimal quantity1 = new BigDecimal("820"); final BigDecimal quantity2 = new BigDecimal("400"); final BigDecimal quantity3 = new BigDecimal("420"); final BigDecimal amount1 = new BigDecimal("-400"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingGM12", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods movement, run costing background, post it and assert it InternalMovement goodsMovement = TestCostingUtils .createGoodsMovement(product, price1, quantity2, TestCostingConstants.LOCATOR_L01_ID, TestCostingConstants.LOCATOR_M01_ID, day3); // Update transaction total cost amount TestCostingUtils.manualCostAdjustment(TestCostingUtils .getProductTransactions(product.getId()).get(1), amount1, true, false, day4); // Create purchase invoice, post it and assert it TestCostingUtils.createPurchaseInvoice(goodsReceipt, price3, quantity1, day2); // Run price correction background TestCostingUtils.runPriceBackground(); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalMovement.class, goodsMovement.getId()) .getMaterialMgmtInternalMovementLineList().get(0), price1, price4, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalMovement.class, goodsMovement.getId()) .getMaterialMgmtInternalMovementLineList().get(0), price1, price4)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), TestCostingConstants.SPAIN_WAREHOUSE_ID, price3, price1, price3, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(1), TestCostingConstants.SPAIN_WAREHOUSE_ID, price4, price6, price5, quantity3)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(2), TestCostingConstants.SPAIN_EAST_WAREHOUSE_ID, price4, price1, price4, quantity2)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(1), "MCC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, true, false)); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(2), "MCC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, false, true)); costAdjustmentAssertList.add(costAdjustmentAssertLineList1); List<CostAdjustmentAssert> costAdjustmentAssertLineList2 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(0), "PDC", quantity1.multiply(price3).add(quantity1.multiply(price1).negate()), day2, true)); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(1), "PDC", quantity2.multiply(price3).add(quantity2.multiply(price1).negate()), day3, false)); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(2), "PDC", quantity2.multiply(price3).add(quantity2.multiply(price1).negate()), day3, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList2); TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList1 = new ArrayList<DocumentPostAssert>(); documentPostAssertList1.add(new DocumentPostAssert("35000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("61000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); CostAdjustment costAdjustment1 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils .assertDocumentPost(costAdjustment1, product.getId(), documentPostAssertList1); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(1)); List<DocumentPostAssert> documentPostAssertList2 = new ArrayList<DocumentPostAssert>(); documentPostAssertList2.add(new DocumentPostAssert("99904", BigDecimal.ZERO, quantity1 .multiply(price3).add(quantity1.multiply(price1).negate()), null)); documentPostAssertList2.add(new DocumentPostAssert("35000", quantity1.multiply(price3).add( quantity1.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList2.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price3).add(quantity2.multiply(price1).negate()), null)); documentPostAssertList2.add(new DocumentPostAssert("61000", quantity2.multiply(price3).add( quantity2.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList2.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity2 .multiply(price3).add(quantity2.multiply(price1).negate()), null)); documentPostAssertList2.add(new DocumentPostAssert("35000", quantity2.multiply(price3).add( quantity2.multiply(price1).negate()), BigDecimal.ZERO, null)); CostAdjustment costAdjustment2 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(1).getId()); TestCostingUtils .assertDocumentPost(costAdjustment2, product.getId(), documentPostAssertList2); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingGM13() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final int day4 = 20; final BigDecimal price1 = new BigDecimal("11.00"); final BigDecimal price2 = new BigDecimal("10.00"); final BigDecimal price3 = new BigDecimal("15.00"); final BigDecimal price4 = new BigDecimal("11.9524"); final BigDecimal quantity1 = new BigDecimal("820"); final BigDecimal quantity2 = new BigDecimal("400"); final BigDecimal quantity3 = new BigDecimal("420"); final BigDecimal amount1 = new BigDecimal("-400"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingGM13", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods movement, run costing background, post it and assert it InternalMovement goodsMovement = TestCostingUtils .createGoodsMovement(product, price1, quantity2, TestCostingConstants.LOCATOR_L01_ID, TestCostingConstants.LOCATOR_M01_ID, day3); // Update transaction total cost amount TestCostingUtils.manualCostAdjustment(TestCostingUtils .getProductTransactions(product.getId()).get(1), amount1, true, true, day4); // Create purchase invoice, post it and assert it TestCostingUtils.createPurchaseInvoice(goodsReceipt, price3, quantity1, day2); // Run price correction background TestCostingUtils.runPriceBackground(); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalMovement.class, goodsMovement.getId()) .getMaterialMgmtInternalMovementLineList().get(0), price1, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalMovement.class, goodsMovement.getId()) .getMaterialMgmtInternalMovementLineList().get(0), price1, price3)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), TestCostingConstants.SPAIN_WAREHOUSE_ID, price3, price1, price3, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(1), TestCostingConstants.SPAIN_WAREHOUSE_ID, price3, price4, price3, quantity3)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(2), TestCostingConstants.SPAIN_EAST_WAREHOUSE_ID, price3, price1, price3, quantity2)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(1), "MCC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, true, true)); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(2), "MCC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, false, true)); costAdjustmentAssertList.add(costAdjustmentAssertLineList1); List<CostAdjustmentAssert> costAdjustmentAssertLineList2 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(0), "PDC", quantity1.multiply(price3).add(quantity1.multiply(price1).negate()), day2, true)); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(1), "PDC", quantity2.multiply(price3).add(quantity2.multiply(price2).negate()), day3, false)); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(2), "PDC", quantity2.multiply(price3).add(quantity2.multiply(price2).negate()), day3, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList2); TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList1 = new ArrayList<DocumentPostAssert>(); documentPostAssertList1.add(new DocumentPostAssert("35000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("61000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); CostAdjustment costAdjustment1 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils .assertDocumentPost(costAdjustment1, product.getId(), documentPostAssertList1); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(1)); List<DocumentPostAssert> documentPostAssertList2 = new ArrayList<DocumentPostAssert>(); documentPostAssertList2.add(new DocumentPostAssert("99904", BigDecimal.ZERO, quantity1 .multiply(price3).add(quantity1.multiply(price1).negate()), null)); documentPostAssertList2.add(new DocumentPostAssert("35000", quantity1.multiply(price3).add( quantity1.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList2.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price3).add(quantity2.multiply(price2).negate()), null)); documentPostAssertList2.add(new DocumentPostAssert("61000", quantity2.multiply(price3).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList2.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity2 .multiply(price3).add(quantity2.multiply(price2).negate()), null)); documentPostAssertList2.add(new DocumentPostAssert("35000", quantity2.multiply(price3).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); CostAdjustment costAdjustment2 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(1).getId()); TestCostingUtils .assertDocumentPost(costAdjustment2, product.getId(), documentPostAssertList2); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingGM5() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final int day4 = 20; final int day5 = 25; final int day6 = 30; final int day7 = 35; final int day8 = 40; final int day9 = 45; final BigDecimal price1 = new BigDecimal("120.00"); final BigDecimal price2 = new BigDecimal("150.00"); final BigDecimal price3 = new BigDecimal("100.00"); final BigDecimal price4 = new BigDecimal("95.00"); final BigDecimal price5 = new BigDecimal("5.00"); final BigDecimal price6 = new BigDecimal("95.6897"); final BigDecimal price7 = new BigDecimal("88.4921"); final BigDecimal price8 = new BigDecimal("96.0317"); final BigDecimal price9 = new BigDecimal("337.50"); final BigDecimal quantity1 = new BigDecimal("100"); final BigDecimal quantity2 = new BigDecimal("20"); final BigDecimal quantity3 = new BigDecimal("30"); final BigDecimal quantity4 = new BigDecimal("500"); final BigDecimal quantity5 = new BigDecimal("50"); final BigDecimal quantity6 = new BigDecimal("580"); final BigDecimal quantity7 = new BigDecimal("630"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingGM5", price1); // Create purchase order and book it Order purchaseOrder1 = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create purchase order and book it Order purchaseOrder2 = TestCostingUtils.createPurchaseOrder(product, price2, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt1 = TestCostingUtils.createGoodsReceipt(purchaseOrder1, price1, quantity1, TestCostingConstants.LOCATOR_L01_ID, day1); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt2 = TestCostingUtils.createGoodsReceipt(purchaseOrder2, price2, quantity1, TestCostingConstants.LOCATOR_M01_ID, day2); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment1 = TestCostingUtils.createGoodsShipment(product, price1, quantity2, TestCostingConstants.LOCATOR_L01_ID, day3); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment2 = TestCostingUtils.createGoodsShipment(product, price2, quantity3, TestCostingConstants.LOCATOR_M01_ID, day4); // Create purchase invoice, post it and assert it List<ShipmentInOut> goodsReceiptList = new ArrayList<ShipmentInOut>(); goodsReceiptList.add(goodsReceipt1); goodsReceiptList.add(goodsReceipt2); List<BigDecimal> priceList = new ArrayList<BigDecimal>(); priceList.add(price3); priceList.add(price3); TestCostingUtils.createPurchaseInvoice(goodsReceiptList, priceList, quantity1.add(quantity1), day5); // Run price correction background TestCostingUtils.runPriceBackground(); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt3 = TestCostingUtils.createGoodsReceipt(product, price3, quantity4, TestCostingConstants.LOCATOR_L01_ID, day6); // Create purchase invoice, post it and assert it TestCostingUtils.createPurchaseInvoice(goodsReceipt3, price4, quantity4, day7); // Run price correction background TestCostingUtils.runPriceBackground(); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods movement, run costing background, post it and assert it InternalMovement goodsMovement = TestCostingUtils .createGoodsMovement(product, price3, quantity5, TestCostingConstants.LOCATOR_M01_ID, TestCostingConstants.LOCATOR_L01_ID, day8); // Update transaction total cost amount TestCostingUtils.manualCostAdjustment(TestCostingUtils .getProductTransactions(product.getId()).get(5), quantity5.multiply(price5), false, day9); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt1.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt2.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price2, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment1.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment2.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price2, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt3.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price3, price4)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalMovement.class, goodsMovement.getId()) .getMaterialMgmtInternalMovementLineList().get(0), price3, price5, true)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalMovement.class, goodsMovement.getId()) .getMaterialMgmtInternalMovementLineList().get(0), price3, price5)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), TestCostingConstants.SPAIN_WAREHOUSE_ID, price3, price1, price3, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(4), TestCostingConstants.SPAIN_WAREHOUSE_ID, price4, price3, price6, quantity6)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(6), TestCostingConstants.SPAIN_WAREHOUSE_ID, price5, price8, price7, quantity7)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(1), TestCostingConstants.SPAIN_EAST_WAREHOUSE_ID, price3, price2, price3, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(5), TestCostingConstants.SPAIN_EAST_WAREHOUSE_ID, price5, null, price9, quantity2)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(0), "PDC", quantity1.multiply(price3).add(quantity1.multiply(price1).negate()), day5, true)); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(1), "PDC", quantity1.multiply(price3).add(quantity1.multiply(price2).negate()), day5, true)); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(2), "PDC", quantity2.multiply(price3).add(quantity2.multiply(price1).negate()), day5, false)); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(3), "PDC", quantity3.multiply(price3).add(quantity3.multiply(price2).negate()), day5, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList1); List<CostAdjustmentAssert> costAdjustmentAssertLineList2 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(4), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price3).negate()), day7, true)); costAdjustmentAssertList.add(costAdjustmentAssertLineList2); List<CostAdjustmentAssert> costAdjustmentAssertLineList3 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList3.add(new CostAdjustmentAssert(transactionList.get(5), "MCC", quantity5.multiply(price5).add(quantity5.multiply(price3).negate()), day9, true)); costAdjustmentAssertLineList3.add(new CostAdjustmentAssert(transactionList.get(6), "MCC", quantity5.multiply(price5).add(quantity5.multiply(price3).negate()), day9, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList3); TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList1 = new ArrayList<DocumentPostAssert>(); documentPostAssertList1.add(new DocumentPostAssert("99904", quantity1.multiply(price1).add( quantity1.multiply(price3).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity1 .multiply(price1).add(quantity1.multiply(price3).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("99904", quantity1.multiply(price2).add( quantity1.multiply(price3).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity1 .multiply(price2).add(quantity1.multiply(price3).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("99900", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price3).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("35000", quantity2.multiply(price1).add( quantity2.multiply(price3).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("99900", BigDecimal.ZERO, quantity3 .multiply(price2).add(quantity3.multiply(price3).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("35000", quantity3.multiply(price2).add( quantity3.multiply(price3).negate()), BigDecimal.ZERO, null)); CostAdjustment costAdjustment1 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils .assertDocumentPost(costAdjustment1, product.getId(), documentPostAssertList1); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(1)); List<DocumentPostAssert> documentPostAssertList2 = new ArrayList<DocumentPostAssert>(); documentPostAssertList2.add(new DocumentPostAssert("99904", quantity4.multiply(price3).add( quantity4.multiply(price4).negate()), BigDecimal.ZERO, null)); documentPostAssertList2.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity4 .multiply(price3).add(quantity4.multiply(price4).negate()), null)); CostAdjustment costAdjustment2 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(1).getId()); TestCostingUtils .assertDocumentPost(costAdjustment2, product.getId(), documentPostAssertList2); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(2)); List<DocumentPostAssert> documentPostAssertList3 = new ArrayList<DocumentPostAssert>(); documentPostAssertList3.add(new DocumentPostAssert("35000", quantity5.multiply(price3).add( quantity5.multiply(price5).negate()), BigDecimal.ZERO, null)); documentPostAssertList3.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity5 .multiply(price3).add(quantity5.multiply(price5).negate()), null)); documentPostAssertList3.add(new DocumentPostAssert("61000", quantity5.multiply(price3).add( quantity5.multiply(price5).negate()), BigDecimal.ZERO, null)); documentPostAssertList3.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity5 .multiply(price3).add(quantity5.multiply(price5).negate()), null)); CostAdjustment costAdjustment3 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(2).getId()); TestCostingUtils .assertDocumentPost(costAdjustment3, product.getId(), documentPostAssertList3); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingIC4() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final int day4 = 20; final BigDecimal price1 = new BigDecimal("35.00"); final BigDecimal price2 = new BigDecimal("9.00"); final BigDecimal price3 = new BigDecimal("5.00"); final BigDecimal price4 = new BigDecimal("40.00"); final BigDecimal quantity1 = new BigDecimal("1000"); final BigDecimal quantity2 = new BigDecimal("250"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingIC4", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Create internal consumption, run costing background, post it and assert // it InternalConsumption internalConsumtpion = TestCostingUtils.createInternalConsumption(product, price1, quantity2, day4); // Update transaction total cost amount TestCostingUtils.manualCostAdjustment(TestCostingUtils .getProductTransactions(product.getId()).get(0), quantity1.multiply(price2), false, day2); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList1 = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList1.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price2, true)); productTransactionAssertList1.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalConsumption.class, internalConsumtpion.getId()) .getMaterialMgmtInternalConsumptionLineList().get(0), price1, price2)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList1); // Assert product costing List<ProductCostingAssert> productCostingAssertList1 = new ArrayList<ProductCostingAssert>(); List<MaterialTransaction> transactionList1 = TestCostingUtils.getProductTransactions(product .getId()); productCostingAssertList1.add(new ProductCostingAssert(transactionList1.get(0), price2, price1, price2, quantity1)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList1); // Assert cost adjustment List<CostAdjustment> costAdjustmentList1 = TestCostingUtils .getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList1 = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList1.get(0), "MCC", quantity1.multiply(price2).add(quantity1.multiply(price1).negate()), day2, true)); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList1.get(1), "MCC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, false)); costAdjustmentAssertList1.add(costAdjustmentAssertLineList1); TestCostingUtils.assertCostAdjustment(costAdjustmentList1, costAdjustmentAssertList1); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList1.get(0)); List<DocumentPostAssert> documentPostAssertList1 = new ArrayList<DocumentPostAssert>(); documentPostAssertList1.add(new DocumentPostAssert("61000", quantity1.multiply(price1).add( quantity1.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity1 .multiply(price1).add(quantity1.multiply(price2).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("35000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); CostAdjustment costAdjustment = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList1.get(0).getId()); TestCostingUtils.assertDocumentPost(costAdjustment, product.getId(), documentPostAssertList1); // Cancel Cost Adjustment TestCostingUtils.cancelCostAdjustment(costAdjustment); // Update transaction total cost amount TestCostingUtils.manualCostAdjustment(TestCostingUtils .getProductTransactions(product.getId()).get(0), quantity1.multiply(price3), true, false, day3); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList2 = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList2.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price4, price1)); productTransactionAssertList2.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalConsumption.class, internalConsumtpion.getId()) .getMaterialMgmtInternalConsumptionLineList().get(0), price1, price4)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList2); // Assert product costing List<MaterialTransaction> transactionList2 = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList2 = new ArrayList<ProductCostingAssert>(); productCostingAssertList2.add(new ProductCostingAssert(transactionList2.get(0), price4, price1, price4, quantity1)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList2); // Assert cost adjustment List<CostAdjustment> costAdjustmentList2 = TestCostingUtils .getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList2 = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList21 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList21.add(new CostAdjustmentAssert(transactionList2.get(0), "MCC", quantity1.multiply(price2).add(quantity1.multiply(price1).negate()), day2, true, "VO")); costAdjustmentAssertLineList21.add(new CostAdjustmentAssert(transactionList2.get(1), "MCC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, false, "VO")); costAdjustmentAssertList2.add(costAdjustmentAssertLineList21); List<CostAdjustmentAssert> costAdjustmentAssertLineList22 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList22.add(new CostAdjustmentAssert(transactionList2.get(0), "MCC", quantity1.multiply(price1).add(quantity1.multiply(price2).negate()), day2, true, "VO")); costAdjustmentAssertLineList22.add(new CostAdjustmentAssert(transactionList2.get(1), "MCC", quantity2.multiply(price1).add(quantity2.multiply(price2).negate()), day4, false, "VO")); costAdjustmentAssertList2.add(costAdjustmentAssertLineList22); List<CostAdjustmentAssert> costAdjustmentAssertLineList3 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList3.add(new CostAdjustmentAssert(transactionList2.get(0), "MCC", quantity1.multiply(price4).add(quantity1.multiply(price1).negate()), day3, true, false)); costAdjustmentAssertLineList3.add(new CostAdjustmentAssert(transactionList2.get(1), "MCC", quantity2.multiply(price4).add(quantity2.multiply(price1).negate()), day4, false)); costAdjustmentAssertList2.add(costAdjustmentAssertLineList3); TestCostingUtils.assertCostAdjustment(costAdjustmentList2, costAdjustmentAssertList2); // Post cost adjustment 1 and assert it TestCostingUtils.postDocument(costAdjustmentList2.get(0)); List<DocumentPostAssert> documentPostAssertList21 = new ArrayList<DocumentPostAssert>(); documentPostAssertList21.add(new DocumentPostAssert("61000", quantity1.multiply(price1).add( quantity1.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList21.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity1 .multiply(price1).add(quantity1.multiply(price2).negate()), null)); documentPostAssertList21.add(new DocumentPostAssert("35000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList21.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); CostAdjustment costAdjustment21 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList2.get(0).getId()); TestCostingUtils.assertDocumentPost(costAdjustment21, product.getId(), documentPostAssertList21); // Post cost adjustment 2 and assert it TestCostingUtils.postDocument(costAdjustmentList2.get(1)); List<DocumentPostAssert> documentPostAssertList22 = new ArrayList<DocumentPostAssert>(); documentPostAssertList22.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity1 .multiply(price1).add(quantity1.multiply(price2).negate()), null)); documentPostAssertList22.add(new DocumentPostAssert("35000", quantity1.multiply(price1).add( quantity1.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList22.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price2).negate()), null)); documentPostAssertList22.add(new DocumentPostAssert("61000", quantity2.multiply(price1).add( quantity2.multiply(price2).negate()), BigDecimal.ZERO, null)); CostAdjustment costAdjustment22 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList2.get(1).getId()); TestCostingUtils.assertDocumentPost(costAdjustment22, product.getId(), documentPostAssertList22); // Post cost adjustment 3 and assert it TestCostingUtils.postDocument(costAdjustmentList2.get(2)); List<DocumentPostAssert> documentPostAssertList3 = new ArrayList<DocumentPostAssert>(); documentPostAssertList3.add(new DocumentPostAssert("61000", BigDecimal.ZERO, quantity1 .multiply(price4).add(quantity1.multiply(price1).negate()), null)); documentPostAssertList3.add(new DocumentPostAssert("35000", quantity1.multiply(price4).add( quantity1.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList3.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price4).add(quantity2.multiply(price1).negate()), null)); documentPostAssertList3.add(new DocumentPostAssert("61000", quantity2.multiply(price4).add( quantity2.multiply(price1).negate()), BigDecimal.ZERO, null)); CostAdjustment costAdjustment3 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList2.get(2).getId()); TestCostingUtils .assertDocumentPost(costAdjustment3, product.getId(), documentPostAssertList3); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingR10() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final int day4 = 20; final int day5 = 25; final BigDecimal price1 = new BigDecimal("15.00"); final BigDecimal price2 = new BigDecimal("40.00"); final BigDecimal price3 = new BigDecimal("9.00"); final BigDecimal quantity1 = new BigDecimal("180"); final BigDecimal quantity2 = new BigDecimal("80"); final BigDecimal quantity3 = new BigDecimal("40"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingR10", price1, price2); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Create purchase order and book it Order saleseOrder = TestCostingUtils.createSalesOrder(product, price2, quantity2, day2); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment = TestCostingUtils.createGoodsShipment(saleseOrder, price1, quantity2, day3); // Update purchase order line product price TestCostingUtils.updatePurchaseOrder(purchaseOrder, price3); // Run price correction background TestCostingUtils.runPriceBackground(); // Create purchase invoice, post it and assert it TestCostingUtils.createPurchaseInvoice(goodsReceipt, price3, quantity1, day5); // Run price correction background TestCostingUtils.runPriceBackground(); // Create return from customer, run costing background, post it and assert // it Order returnFromCustomer = TestCostingUtils.createReturnFromCustomer(goodsShipment, price2, quantity3, day3); // Create return material receipt, run costing background, post it and // assert it ShipmentInOut returnMaterialReceipt = TestCostingUtils.createReturnMaterialReceipt( returnFromCustomer, price3, quantity3, day4); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, returnMaterialReceipt.getId()) .getMaterialMgmtShipmentInOutLineList().get(0), price3, price3)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), price3, price1, price3, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(2), price3, null, price3, quantity1.add(quantity2.negate()).add(quantity3))); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(0), "PDC", quantity1.multiply(price3).add(quantity1.multiply(price1).negate()), day1, true)); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(1), "PDC", quantity2.multiply(price3).add(quantity2.multiply(price1).negate()), day3, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList1); ; TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList1 = new ArrayList<DocumentPostAssert>(); documentPostAssertList1.add(new DocumentPostAssert("99904", quantity1.multiply(price1).add( quantity1.multiply(price3).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity1 .multiply(price1).add(quantity1.multiply(price3).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("99900", BigDecimal.ZERO, quantity2 .multiply(price1).add(quantity2.multiply(price3).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert("35000", quantity2.multiply(price1).add( quantity2.multiply(price3).negate()), BigDecimal.ZERO, null)); CostAdjustment costAdjustment1 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils .assertDocumentPost(costAdjustment1, product.getId(), documentPostAssertList1); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingR2() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final BigDecimal price1 = new BigDecimal("15.00"); final BigDecimal price2 = new BigDecimal("30.00"); final BigDecimal quantity1 = new BigDecimal("180"); final BigDecimal quantity2 = new BigDecimal("80"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingR2", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment1 = TestCostingUtils.createGoodsShipment(product, price1, quantity2, day2); // Update purchase order line product price TestCostingUtils.updatePurchaseOrder(purchaseOrder, price2); // Run price correction background TestCostingUtils.runPriceBackground(); // Cancel goods shipment ShipmentInOut goodsShipment2 = TestCostingUtils.cancelGoodsShipment(goodsShipment1, price2); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price2)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment1.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price2, true)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment2.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price2, price2, true)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), price2, price1, price2, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(2), price2, null, price2, quantity1)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList.add(new CostAdjustmentAssert(transactionList.get(0), "PDC", quantity1.multiply(price2).add(quantity1.multiply(price1).negate()), day1, true)); costAdjustmentAssertLineList.add(new CostAdjustmentAssert(transactionList.get(1), "PDC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day2, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList); TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment 1 and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList = new ArrayList<DocumentPostAssert>(); documentPostAssertList.add(new DocumentPostAssert("99904", BigDecimal.ZERO, quantity1 .multiply(price2).add(quantity1.multiply(price1).negate()), null)); documentPostAssertList.add(new DocumentPostAssert("35000", quantity1.multiply(price2).add( quantity1.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList.add(new DocumentPostAssert("99900", quantity2.multiply(price2).add( quantity2.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price2).add(quantity2.multiply(price1).negate()), null)); CostAdjustment costAdjustment = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils.assertDocumentPost(costAdjustment, product.getId(), documentPostAssertList); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingR22() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final BigDecimal price1 = new BigDecimal("25.00"); final BigDecimal price2 = new BigDecimal("20.00"); final BigDecimal quantity1 = new BigDecimal("330"); final BigDecimal quantity2 = new BigDecimal("170"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingR22", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment1 = TestCostingUtils.createGoodsShipment(product, price1, quantity2, day3); // Add sleep to avoid assert errors Thread.sleep(1000); // Cancel goods shipment ShipmentInOut goodsShipment2 = TestCostingUtils.cancelGoodsShipment(goodsShipment1, price1); // Create purchase invoice, post it and assert it TestCostingUtils.createPurchaseInvoice(goodsReceipt, price2, quantity1, day2); // Run price correction background TestCostingUtils.runPriceBackground(); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price2)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment1.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price1, true)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment2.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price1, true)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), price2, price1, price2, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(2), price1, price1, price2, quantity1)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList.add(new CostAdjustmentAssert(transactionList.get(0), "PDC", quantity1.multiply(price2).add(quantity1.multiply(price1).negate()), day2, true)); costAdjustmentAssertList.add(costAdjustmentAssertLineList); TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment 1 and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList = new ArrayList<DocumentPostAssert>(); documentPostAssertList.add(new DocumentPostAssert("99904", quantity1.multiply(price1).add( quantity1.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity1 .multiply(price1).add(quantity1.multiply(price2).negate()), null)); CostAdjustment costAdjustment = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils.assertDocumentPost(costAdjustment, product.getId(), documentPostAssertList); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingR3() throws Exception { final int day0 = 0; final int day1 = 5; final BigDecimal price1 = new BigDecimal("15.00"); final BigDecimal price2 = new BigDecimal("7.50"); final BigDecimal quantity1 = new BigDecimal("180"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingR3", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt1 = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Update purchase order line product price TestCostingUtils.updatePurchaseOrder(purchaseOrder, price2); // Run price correction background TestCostingUtils.runPriceBackground(); // Cancel goods receipt ShipmentInOut goodsReceipt2 = TestCostingUtils.cancelGoodsReceipt(goodsReceipt1, price2); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt2.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price2, price2, true)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt1.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price2, true)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(1), price2, price1, price2, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), price2, null, price2, BigDecimal.ZERO)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList.add(new CostAdjustmentAssert(transactionList.get(1), "PDC", quantity1.multiply(price2).add(quantity1.multiply(price1).negate()), day1, true)); costAdjustmentAssertList.add(costAdjustmentAssertLineList); TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment 1 and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList = new ArrayList<DocumentPostAssert>(); documentPostAssertList.add(new DocumentPostAssert("99904", quantity1.multiply(price1).add( quantity1.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity1 .multiply(price1).add(quantity1.multiply(price2).negate()), null)); CostAdjustment costAdjustment = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils.assertDocumentPost(costAdjustment, product.getId(), documentPostAssertList); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingIC3() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final BigDecimal price1 = new BigDecimal("35.00"); final BigDecimal quantity1 = new BigDecimal("1000"); final BigDecimal quantity2 = new BigDecimal("250"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingIC3", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day1); // Create internal consumption, run costing background, post it and assert // it InternalConsumption internalConsumtpion = TestCostingUtils.createInternalConsumption(product, price1, quantity2, day2); // Cancel Cost Adjustment TestCostingUtils.cancelInternalConsumption(internalConsumtpion); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price1, false)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalConsumption.class, internalConsumtpion.getId()) .getMaterialMgmtInternalConsumptionLineList().get(0), price1, price1, true)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(InternalConsumption.class, internalConsumtpion.getId()) .getMaterialMgmtInternalConsumptionLineList().get(0) .getMaterialMgmtInternalConsumptionLineVoidedInternalConsumptionLineList().get(0), price1, price1, true)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), price1, null, price1, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(2), price1, null, price1, quantity1)); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment assertEquals(TestCostingUtils.getCostAdjustment(product.getId()), null); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingMCC1() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final int day4 = 20; final int day5 = 25; final BigDecimal price1 = new BigDecimal("11.50"); final BigDecimal price2 = new BigDecimal("15.00"); final BigDecimal price3 = new BigDecimal("15.0714"); final BigDecimal price4 = new BigDecimal("14.9375"); final BigDecimal price5 = new BigDecimal("11.4375"); final BigDecimal quantity1 = new BigDecimal("15"); final BigDecimal quantity2 = new BigDecimal("7"); final BigDecimal quantity3 = new BigDecimal("3"); final BigDecimal amount1 = new BigDecimal("0.50"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product = TestCostingUtils.createProduct("testCostingMCC1", price1); // Create purchase order and book it Order purchaseOrder = TestCostingUtils.createPurchaseOrder(product, price1, quantity1, day1); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt = TestCostingUtils.createGoodsReceipt(purchaseOrder, price1, quantity1, day0); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment1 = TestCostingUtils.createGoodsShipment(product, price1, quantity2, day2); // Update transaction total cost amount TestCostingUtils.manualCostAdjustment(TestCostingUtils .getProductTransactions(product.getId()).get(1), amount1, true, false, day3); // Create purchase invoice, post it and assert it TestCostingUtils.createPurchaseInvoice(goodsReceipt, price2, quantity1, day4); // Run price correction background TestCostingUtils.runPriceBackground(); // Add sleep to avoid assert errors Thread.sleep(1000); // Create goods shipment, run costing background, post it and assert it ShipmentInOut goodsShipment2 = TestCostingUtils.createGoodsShipment(product, price4, quantity3, day5); // Assert product transactions List<ProductTransactionAssert> productTransactionAssertList = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price2)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment1.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3, price2)); productTransactionAssertList.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsShipment2.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price4, price4)); TestCostingUtils.assertProductTransaction(product.getId(), productTransactionAssertList); // Assert product costing List<MaterialTransaction> transactionList = TestCostingUtils.getProductTransactions(product .getId()); List<ProductCostingAssert> productCostingAssertList = new ArrayList<ProductCostingAssert>(); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(0), price2, price1, price2, quantity1)); productCostingAssertList.add(new ProductCostingAssert(transactionList.get(1), price3, price5, price4, quantity1.add(quantity2.negate()))); TestCostingUtils.assertProductCosting(product.getId(), productCostingAssertList); // Assert cost adjustment List<CostAdjustment> costAdjustmentList = TestCostingUtils.getCostAdjustment(product.getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList1 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList1.add(new CostAdjustmentAssert(transactionList.get(1), "MCC", amount1, day3, true, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList1); List<CostAdjustmentAssert> costAdjustmentAssertLineList2 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(0), "PDC", quantity1.multiply(price2).add(quantity1.multiply(price1).negate()), day4, true)); costAdjustmentAssertLineList2.add(new CostAdjustmentAssert(transactionList.get(1), "PDC", quantity2.multiply(price2).add(quantity2.multiply(price1).negate()), day4, false)); costAdjustmentAssertList.add(costAdjustmentAssertLineList2); TestCostingUtils.assertCostAdjustment(costAdjustmentList, costAdjustmentAssertList); // Post cost adjustment 1 and assert it TestCostingUtils.postDocument(costAdjustmentList.get(0)); List<DocumentPostAssert> documentPostAssertList1 = new ArrayList<DocumentPostAssert>(); documentPostAssertList1.add(new DocumentPostAssert("99900", amount1, BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert("35000", BigDecimal.ZERO, amount1, null)); CostAdjustment costAdjustment1 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(0).getId()); TestCostingUtils .assertDocumentPost(costAdjustment1, product.getId(), documentPostAssertList1); // Post cost adjustment 1 and assert it TestCostingUtils.postDocument(costAdjustmentList.get(1)); List<DocumentPostAssert> documentPostAssertList2 = new ArrayList<DocumentPostAssert>(); documentPostAssertList2.add(new DocumentPostAssert("99904", BigDecimal.ZERO, quantity1 .multiply(price2).add(quantity1.multiply(price1).negate()), null)); documentPostAssertList2.add(new DocumentPostAssert("35000", quantity1.multiply(price2).add( quantity1.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList2.add(new DocumentPostAssert("99900", quantity2.multiply(price2).add( quantity2.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList2.add(new DocumentPostAssert("35000", BigDecimal.ZERO, quantity2 .multiply(price2).add(quantity2.multiply(price1).negate()), null)); CostAdjustment costAdjustment2 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList.get(1).getId()); TestCostingUtils .assertDocumentPost(costAdjustment2, product.getId(), documentPostAssertList2); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } @Test public void testCostingBOM() throws Exception { final int day0 = 0; final int day1 = 5; final int day2 = 10; final int day3 = 15; final int day4 = 20; final BigDecimal price1 = new BigDecimal("15.00"); final BigDecimal price2 = new BigDecimal("25.00"); final BigDecimal price3 = new BigDecimal("17.50"); final BigDecimal price4 = new BigDecimal("31.50"); final BigDecimal price5 = new BigDecimal("95.00"); final BigDecimal price6 = new BigDecimal("115.50"); final BigDecimal quantity1 = new BigDecimal("3"); final BigDecimal quantity2 = new BigDecimal("2"); final BigDecimal quantity3 = new BigDecimal("30"); final BigDecimal quantity4 = new BigDecimal("20"); final BigDecimal quantity5 = new BigDecimal("10"); try { OBContext.setOBContext(TestCostingConstants.OPENBRAVO_USER_ID, TestCostingConstants.QATESTING_ROLE_ID, TestCostingConstants.QATESTING_CLIENT_ID, TestCostingConstants.SPAIN_ORGANIZATION_ID); OBContext.setAdminMode(true); // Create a new product for the test Product product1 = TestCostingUtils.createProduct("testCostingBOMA", price1); // Create a new product for the test Product product2 = TestCostingUtils.createProduct("testCostingBOMB", price2); // Create a new product for the test List<Product> productList = new ArrayList<Product>(); productList.add(product1); productList.add(product2); List<BigDecimal> quantityList = new ArrayList<BigDecimal>(); quantityList.add(quantity1); quantityList.add(quantity2); Product product3 = TestCostingUtils.createProduct("testCostingBOMC", productList, quantityList); // Create purchase order and book it Order purchaseOrder1 = TestCostingUtils .createPurchaseOrder(product1, price1, quantity3, day0); // Create purchase order and book it Order purchaseOrder2 = TestCostingUtils .createPurchaseOrder(product2, price2, quantity4, day0); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt1 = TestCostingUtils.createGoodsReceipt(purchaseOrder1, price1, quantity3, TestCostingConstants.LOCATOR_M01_ID, day1); // Create goods receipt, run costing background, post it and assert it ShipmentInOut goodsReceipt2 = TestCostingUtils.createGoodsReceipt(purchaseOrder2, price2, quantity4, TestCostingConstants.LOCATOR_M01_ID, day2); // Create bill of materials production, run costing background, post it and // assert it ProductionTransaction billOfMaterialsProduction = TestCostingUtils .createBillOfMaterialsProduction(product3, quantity5, TestCostingConstants.LOCATOR_L01_ID, day3); // Create purchase invoice, post it and assert it List<ShipmentInOut> goodsReceiptList = new ArrayList<ShipmentInOut>(); goodsReceiptList.add(goodsReceipt1); goodsReceiptList.add(goodsReceipt2); List<BigDecimal> priceList = new ArrayList<BigDecimal>(); priceList.add(price3); priceList.add(price4); TestCostingUtils.createPurchaseInvoice(goodsReceiptList, priceList, quantity3.add(quantity4), day4); // Run price correction background TestCostingUtils.runPriceBackground(); // Assert product transactions 1 List<ProductTransactionAssert> productTransactionAssertList1 = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList1.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt1.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price1, price3)); productTransactionAssertList1.add(new ProductTransactionAssert(TestCostingUtils .getProductionLines(billOfMaterialsProduction.getId()).get(0), price1, price3)); TestCostingUtils.assertProductTransaction(product1.getId(), productTransactionAssertList1); // Assert product transactions 2 List<ProductTransactionAssert> productTransactionAssertList2 = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList2.add(new ProductTransactionAssert(OBDal.getInstance() .get(ShipmentInOut.class, goodsReceipt2.getId()).getMaterialMgmtShipmentInOutLineList() .get(0), price2, price4)); productTransactionAssertList2.add(new ProductTransactionAssert(TestCostingUtils .getProductionLines(billOfMaterialsProduction.getId()).get(1), price2, price4)); TestCostingUtils.assertProductTransaction(product2.getId(), productTransactionAssertList2); // Assert product transactions 3 List<ProductTransactionAssert> productTransactionAssertList3 = new ArrayList<ProductTransactionAssert>(); productTransactionAssertList3.add(new ProductTransactionAssert(TestCostingUtils .getProductionLines(billOfMaterialsProduction.getId()).get(2), price5, price6)); TestCostingUtils.assertProductTransaction(product3.getId(), productTransactionAssertList3); // Assert product costing 1 List<MaterialTransaction> transactionList1 = TestCostingUtils.getProductTransactions(product1 .getId()); List<ProductCostingAssert> productCostingAssertList1 = new ArrayList<ProductCostingAssert>(); productCostingAssertList1.add(new ProductCostingAssert(transactionList1.get(0), TestCostingConstants.SPAIN_EAST_WAREHOUSE_ID, price3, price1, price3, quantity3)); TestCostingUtils.assertProductCosting(product1.getId(), productCostingAssertList1); // Assert product costing 2 List<MaterialTransaction> transactionList2 = TestCostingUtils.getProductTransactions(product2 .getId()); List<ProductCostingAssert> productCostingAssertList2 = new ArrayList<ProductCostingAssert>(); productCostingAssertList2.add(new ProductCostingAssert(transactionList2.get(0), TestCostingConstants.SPAIN_EAST_WAREHOUSE_ID, price4, price2, price4, quantity4)); TestCostingUtils.assertProductCosting(product2.getId(), productCostingAssertList2); // Assert product costing 3 List<MaterialTransaction> transactionList3 = TestCostingUtils.getProductTransactions(product3 .getId()); List<ProductCostingAssert> productCostingAssertList3 = new ArrayList<ProductCostingAssert>(); productCostingAssertList3.add(new ProductCostingAssert(transactionList3.get(0), TestCostingConstants.SPAIN_WAREHOUSE_ID, price6, price5, price6, quantity5)); TestCostingUtils.assertProductCosting(product3.getId(), productCostingAssertList3); // Assert cost adjustment 1 List<CostAdjustment> costAdjustmentList1 = TestCostingUtils.getCostAdjustment(product1 .getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList1 = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList11 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList11.add(new CostAdjustmentAssert(transactionList1.get(0), "PDC", quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), day4, true)); costAdjustmentAssertLineList11.add(new CostAdjustmentAssert(transactionList2.get(0), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), day4, true)); costAdjustmentAssertLineList11.add(new CostAdjustmentAssert(transactionList1.get(1), "PDC", quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), day4, false)); BigDecimal previousAdjustmentAmount1 = quantity3.multiply(price3).add( quantity3.multiply(price1).negate()); costAdjustmentAssertLineList11.add(new CostAdjustmentAssert(transactionList3.get(0), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()) .add(previousAdjustmentAmount1), day4, false)); costAdjustmentAssertLineList11.add(new CostAdjustmentAssert(transactionList2.get(1), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), day4, false)); costAdjustmentAssertList1.add(costAdjustmentAssertLineList11); TestCostingUtils.assertCostAdjustment(costAdjustmentList1, costAdjustmentAssertList1); // Assert cost adjustment 2 List<CostAdjustment> costAdjustmentList2 = TestCostingUtils.getCostAdjustment(product2 .getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList2 = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList21 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList21.add(new CostAdjustmentAssert(transactionList1.get(0), "PDC", quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), day4, true)); costAdjustmentAssertLineList21.add(new CostAdjustmentAssert(transactionList2.get(0), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), day4, true)); costAdjustmentAssertLineList21.add(new CostAdjustmentAssert(transactionList1.get(1), "PDC", quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), day4, false)); BigDecimal previousAdjustmentAmount2 = quantity3.multiply(price3).add( quantity3.multiply(price1).negate()); costAdjustmentAssertLineList21.add(new CostAdjustmentAssert(transactionList3.get(0), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()) .add(previousAdjustmentAmount2), day4, false)); costAdjustmentAssertLineList21.add(new CostAdjustmentAssert(transactionList2.get(1), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), day4, false)); // costAdjustmentAssertLineList21.add(new CostAdjustmentAssert(transactionList3.get(0), "PDC", // quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), day4, false)); costAdjustmentAssertList2.add(costAdjustmentAssertLineList21); TestCostingUtils.assertCostAdjustment(costAdjustmentList2, costAdjustmentAssertList2); // Assert cost adjustment 3 List<CostAdjustment> costAdjustmentList3 = TestCostingUtils.getCostAdjustment(product3 .getId()); List<List<CostAdjustmentAssert>> costAdjustmentAssertList3 = new ArrayList<List<CostAdjustmentAssert>>(); List<CostAdjustmentAssert> costAdjustmentAssertLineList31 = new ArrayList<CostAdjustmentAssert>(); costAdjustmentAssertLineList31.add(new CostAdjustmentAssert(transactionList1.get(0), "PDC", quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), day4, true)); costAdjustmentAssertLineList31.add(new CostAdjustmentAssert(transactionList2.get(0), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), day4, true)); costAdjustmentAssertLineList31.add(new CostAdjustmentAssert(transactionList1.get(1), "PDC", quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), day4, false)); BigDecimal previousAdjustmentAmount3 = quantity3.multiply(price3).add( quantity3.multiply(price1).negate()); costAdjustmentAssertLineList31.add(new CostAdjustmentAssert(transactionList3.get(0), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()) .add(previousAdjustmentAmount3), day4, false)); costAdjustmentAssertLineList31.add(new CostAdjustmentAssert(transactionList2.get(1), "PDC", quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), day4, false)); // costAdjustmentAssertLineList31.add(new CostAdjustmentAssert(transactionList3.get(0), "PDC", // quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), day4, false)); costAdjustmentAssertList3.add(costAdjustmentAssertLineList31); TestCostingUtils.assertCostAdjustment(costAdjustmentList3, costAdjustmentAssertList3); // Post cost adjustment 1 and assert it TestCostingUtils.postDocument(costAdjustmentList1.get(0)); List<DocumentPostAssert> documentPostAssertList1 = new ArrayList<DocumentPostAssert>(); documentPostAssertList1.add(new DocumentPostAssert(product1.getId(), "99904", BigDecimal.ZERO, quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert(product1.getId(), "35000", quantity3 .multiply(price3).add(quantity3.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert(product2.getId(), "99904", BigDecimal.ZERO, quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), null)); documentPostAssertList1.add(new DocumentPostAssert(product2.getId(), "35000", quantity4 .multiply(price4).add(quantity4.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert(product1.getId(), "61000", quantity3 .multiply(price3).add(quantity3.multiply(price1).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert(product1.getId(), "35000", BigDecimal.ZERO, quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), null)); // documentPostAssertList1.add(new DocumentPostAssert(product3.getId(), "61000", // BigDecimal.ZERO, quantity3.multiply(price3).add(quantity3.multiply(price1).negate()), // null)); // documentPostAssertList1.add(new DocumentPostAssert(product3.getId(), "35000", quantity3 // .multiply(price3).add(quantity3.multiply(price1).negate()), BigDecimal.ZERO, null)); BigDecimal previouslyAdjustedAmountPost = quantity3.multiply(price3).add( quantity3.multiply(price1).negate()); documentPostAssertList1.add(new DocumentPostAssert(product3.getId(), "61000", BigDecimal.ZERO, quantity4.multiply(price4).add(quantity4.multiply(price2).negate()) .add(previouslyAdjustedAmountPost), null)); documentPostAssertList1.add(new DocumentPostAssert(product3.getId(), "35000", quantity4 .multiply(price4).add(quantity4.multiply(price2).negate()) .add(previouslyAdjustedAmountPost), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert(product2.getId(), "61000", quantity4 .multiply(price4).add(quantity4.multiply(price2).negate()), BigDecimal.ZERO, null)); documentPostAssertList1.add(new DocumentPostAssert(product2.getId(), "35000", BigDecimal.ZERO, quantity4.multiply(price4).add(quantity4.multiply(price2).negate()), null)); // BigDecimal previouslyAdjustedAmountPost = quantity4.multiply(price4).add( // quantity4.multiply(price2).negate()); // documentPostAssertList1.add(new DocumentPostAssert(product3.getId(), "61000", // BigDecimal.ZERO, quantity4.multiply(price4).add( // quantity4.multiply(price2).negate().add(previouslyAdjustedAmountPost)), null)); // documentPostAssertList1.add(new DocumentPostAssert(product3.getId(), "35000", quantity4 // .multiply(price4).add( // quantity4.multiply(price2).negate().add(previouslyAdjustedAmountPost)), // BigDecimal.ZERO, null)); CostAdjustment costAdjustment1 = OBDal.getInstance().get(CostAdjustment.class, costAdjustmentList1.get(0).getId()); TestCostingUtils.assertDocumentPost(costAdjustment1, null, documentPostAssertList1); OBDal.getInstance().commitAndClose(); } catch (Exception e) { System.out.println(e.getMessage()); throw new OBException(e); } finally { OBContext.restorePreviousMode(); } } }
[ "rarc88@gmail.com" ]
rarc88@gmail.com
902d02ea5417213c341983d0ebed43448a96bb70
15b27439782c0e3f475ff7add51a2141c9de3c39
/tfg/src/main/java/com/franperu/tfg/login/Rol.java
50d82d88ed45d68fcf382951f02f6c06cc7897ab
[]
no_license
franperu/backend
92e93b465acc0bc99cf1628f1e05641f85deadee
625c7688b9627c62ea8719dfbfc2643137647b59
refs/heads/master
2023-08-10T12:36:19.114636
2020-10-13T09:51:11
2020-10-13T09:51:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
package com.franperu.tfg.login; import com.franperu.tfg.enums.RolNombre; import javax.persistence.*; import javax.validation.constraints.NotNull; @Entity public class Rol { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Enumerated(EnumType.STRING) @NotNull private RolNombre rolNombre; public Rol() { } public Rol(@NotNull RolNombre rolNombre) { this.rolNombre = rolNombre; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public RolNombre getRolNombre() { return rolNombre; } public void setRolNombre(RolNombre rolNombre) { this.rolNombre = rolNombre; } }
[ "55334114+franperu@users.noreply.github.com" ]
55334114+franperu@users.noreply.github.com
b59810e2829ee916efc80a96f5cc553768491487
5e1d79d4f6fc1aa4f3ef8f364c546bfe134ff68c
/app/src/main/java/com/example/dev/workshopapp/Treehouse.java
f1d5f5a4297bc0edc8b8deb1a849cc0d75321d5f
[]
no_license
mouthematician/WorkshopApp
08bd9fea7a459900d7fa878f2ce1f1c5d3e9abf6
e115b6c01a1b69fc96ea9b40f0336ce308bdefef
refs/heads/master
2020-04-15T14:11:42.469248
2014-08-27T18:13:57
2014-08-27T18:13:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
103
java
package com.example.dev.workshopapp; /** * Created by dev on 8/17/14. */ public class Treehouse { }
[ "mouthematician@gmail.com" ]
mouthematician@gmail.com
96e1f0edeb4afd3bbcb19d7977632124821af7fa
9b75d8540ff2e55f9ff66918cc5676ae19c3bbe3
/cab.snapp.passenger.play_184.apk-decompiled/sources/io/reactivex/internal/operators/flowable/eh.java
08a93e8998a2aa582dd1aefeec6678c93338a8b3
[]
no_license
BaseMax/PopularAndroidSource
a395ccac5c0a7334d90c2594db8273aca39550ed
bcae15340907797a91d39f89b9d7266e0292a184
refs/heads/master
2020-08-05T08:19:34.146858
2019-10-06T20:06:31
2019-10-06T20:06:31
212,433,298
2
0
null
null
null
null
UTF-8
Java
false
false
2,260
java
package io.reactivex.internal.operators.flowable; import io.reactivex.c.b; import io.reactivex.e.q; import io.reactivex.internal.subscriptions.SubscriptionHelper; import io.reactivex.j; import io.reactivex.o; import org.b.c; import org.b.d; public final class eh<T> extends a<T, T> { final q<? super T> c; static final class a<T> implements o<T>, d { /* renamed from: a reason: collision with root package name */ final c<? super T> f8248a; /* renamed from: b reason: collision with root package name */ final q<? super T> f8249b; d c; boolean d; a(c<? super T> cVar, q<? super T> qVar) { this.f8248a = cVar; this.f8249b = qVar; } public final void onSubscribe(d dVar) { if (SubscriptionHelper.validate(this.c, dVar)) { this.c = dVar; this.f8248a.onSubscribe(this); } } public final void onNext(T t) { if (!this.d) { this.f8248a.onNext(t); try { if (this.f8249b.test(t)) { this.d = true; this.c.cancel(); this.f8248a.onComplete(); } } catch (Throwable th) { b.throwIfFatal(th); this.c.cancel(); onError(th); } } } public final void onError(Throwable th) { if (!this.d) { this.d = true; this.f8248a.onError(th); return; } io.reactivex.g.a.onError(th); } public final void onComplete() { if (!this.d) { this.d = true; this.f8248a.onComplete(); } } public final void request(long j) { this.c.request(j); } public final void cancel() { this.c.cancel(); } } public eh(j<T> jVar, q<? super T> qVar) { super(jVar); this.c = qVar; } public final void subscribeActual(c<? super T> cVar) { this.f7923b.subscribe(new a(cVar, this.c)); } }
[ "MaxBaseCode@gmail.com" ]
MaxBaseCode@gmail.com
0b19c985beb51ad0d14eaeb23c8b7a68c953e610
fc06d3fa68b0077e49c8637db994813701038a32
/business-center/device-center/src/main/java/com/open/device/model/JobParam.java
1431390a08ec6ae094e9594c361aa30f26817de0
[ "Apache-2.0" ]
permissive
jecinfo2016/open-capacity-platform-backend
d194f237b98cd6f1198b704fab2b650e23544b9d
bfcb2cee2e8b47a40555a7ec7749b8e23a66a2ad
refs/heads/master
2023-02-16T20:09:17.246856
2021-01-18T02:29:25
2021-01-18T02:29:25
330,533,472
1
2
null
null
null
null
UTF-8
Java
false
false
311
java
package com.open.device.model; import lombok.Data; /** * 任务执行参数实体类 * @author DUJIN */ @Data public class JobParam { private RequestModel requestModel; /** * 任务ID */ private Integer taskId; /** * 统计字段 */ private String equipmentTag; }
[ "duj@jec.com.cn" ]
duj@jec.com.cn
b0577ac38cef0823830d0cceeb96ba623379a687
c074091771e0762adb47d728f51e403a064a38ba
/src/main/java/pages/GooglePage.java
bc1119574f5d9dd6814d777a3305b9dfe3fa7e6a
[]
no_license
celheste39/primerPOM
09f0f8e7d19c202299e0e2fe821ba3f547be858f
9b7d96aa059e95610949e1da433a89a9da441330
refs/heads/master
2023-05-24T08:18:30.241821
2021-06-03T12:14:30
2021-06-03T12:14:30
373,495,750
0
0
null
null
null
null
UTF-8
Java
false
false
554
java
package pages; import org.openqa.selenium.By; public class GooglePage { static By txtGoogleSearch = By.xpath("//input[@jsaction='paste:puy29d;']"); static By btnGoogleSearch = By.xpath("//input[@value='Buscar con Google']"); static By resultTeam = By.xpath("//span[contains(text(),'Manchester')]"); public static By getTxtGoogleSearch() { return txtGoogleSearch; } public static By getBtnGoogleSearch() { return btnGoogleSearch; } public static By getResultTeam() { return resultTeam; } }
[ "mateo0595@gmail.com" ]
mateo0595@gmail.com
db0ea346d060edd82d4836acd5feb0bf8e4479dc
f626baba52ac2d1f1beede1465d077fa3ce0f17b
/core/src/test/java/com/gentics/mesh/core/data/root/NodeRootTest.java
9d214375546f3338417767de65c9c74667380d6e
[ "Apache-2.0" ]
permissive
lukehuang/mesh
e204631be9c146fa6cf04db8d36fde995983adcf
5eda45362cff70e791dc0fa289a38964ffcccfde
refs/heads/master
2020-06-01T02:29:35.091562
2019-06-06T14:14:46
2019-06-06T14:14:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
953
java
package com.gentics.mesh.core.data.root; import static com.gentics.mesh.test.TestSize.PROJECT_AND_NODE; import static org.junit.Assert.assertEquals; import org.junit.Test; import com.syncleus.ferma.tx.Tx; import com.gentics.mesh.core.data.node.impl.NodeImpl; import com.gentics.mesh.test.context.AbstractMeshTest; import com.gentics.mesh.test.context.MeshTestSetting; import com.syncleus.ferma.FramedGraph; @MeshTestSetting(testSize = PROJECT_AND_NODE, startServer = false) public class NodeRootTest extends AbstractMeshTest { @Test public void testAddNode() { try (Tx tx = tx()) { FramedGraph graph = tx.getGraph(); NodeImpl node = graph.addFramedVertex(NodeImpl.class); long start = boot().nodeRoot().computeCount(); boot().nodeRoot().addItem(node); boot().nodeRoot().addItem(node); boot().nodeRoot().addItem(node); boot().nodeRoot().addItem(node); assertEquals(start + 1, boot().nodeRoot().computeCount()); } } }
[ "j.schueth@gentics.com" ]
j.schueth@gentics.com
c54f4a0276293dfe9f05208080d4e20197e9836c
1df953898aa3b2eab261d929ef28137f67f55de7
/src/main/java/com/aa/entities/opshubresponse/Replies.java
811c3a911926095ebff86aab11c1fda87098dc33
[]
no_license
955989/LastLiveLeg_OnPremise
906dbfd714c66f9e78bb583a42c649dbfdc27a42
98865666d0b0e7d436658a73e6d49ce6cc6a6401
refs/heads/main
2023-07-24T03:31:35.601677
2021-09-02T06:29:15
2021-09-02T06:29:15
402,294,706
0
0
null
null
null
null
UTF-8
Java
false
false
1,311
java
/** *@author sivan *POJO to get opshub details from OpsHub Service */ package com.aa.entities.opshubresponse; import java.util.List; public class Replies { private Open open; private List<Add> add; private List<Delete> delete; private Close close; private EndTransaction endTransaction; private Object exception; public Open getOpen() { return open; } public void setOpen(Open open) { this.open = open; } public List<Add> getAdd() { return add; } public void setAdd(List<Add> add) { this.add = add; } public List<Delete> getDelete() { return delete; } public void setDelete(List<Delete> delete) { this.delete = delete; } public Close getClose() { return close; } public void setClose(Close close) { this.close = close; } public EndTransaction getEndTransaction() { return endTransaction; } public void setEndTransaction(EndTransaction endTransaction) { this.endTransaction = endTransaction; } public Object getException() { return exception; } public void setException(Object exception) { this.exception = exception; } @Override public String toString() { return "Replies [open=" + open + ", add=" + add + ", delete=" + delete + ", close=" + close + ", endTransaction=" + endTransaction + ", exception=" + exception + "]"; } }
[ "umadevi.goudar@dxc.com" ]
umadevi.goudar@dxc.com
12744c4f947a3f733d8069ad5abb1589301b3483
6c5d60b32218e9d84cb881df6edf4fe383862921
/src/main/java/com/vncdigital/vpulse/pharmacist/helper/RefProcurementIds.java
3b7df7f68f9f32e6743f831ce0b82e4779a0821b
[]
no_license
kumarisk/devops
e332479b9a6d85f9adf6d8c9a778e77533a09c91
29cde1da39350359f5155be8ef4717d23beded43
refs/heads/master
2020-05-05T03:07:31.691988
2019-04-05T10:32:17
2019-04-05T10:32:17
179,661,828
0
0
null
null
null
null
UTF-8
Java
false
false
339
java
package com.vncdigital.vpulse.pharmacist.helper; import org.springframework.stereotype.Component; @Component public class RefProcurementIds { String procurementId; public String getProcurementId() { return procurementId; } public void setProcurementId(String procurementId) { this.procurementId = procurementId; } }
[ "0abcdef098@gmail.com" ]
0abcdef098@gmail.com
8b037f6c50f8189d2c38b8d517b28a07ae1fa018
92df4b0929421cb787d404f6cfe17d00d0599d9b
/ShapeTest.java
2392fff1b9c96a50d41c657547ebe8ee1a05276a
[]
no_license
kimyungki/6th-Assignment
49eaf3c8a703f93c05016330e07ca3e6cc57cfd5
163dfd599dc3afd4e3bb1abd70c282153e6e3d71
refs/heads/master
2021-07-02T17:57:49.781408
2017-09-24T13:40:23
2017-09-24T13:40:23
104,646,623
0
0
null
null
null
null
UTF-8
Java
false
false
538
java
package test; public class ShapeTest { private static Shape arrayOfShapes[]; public static void main(String[] args) { init(); drawAll(); } public static void init(){ arrayOfShapes = new Shape[4]; arrayOfShapes[0] = new Rectangle(1,1); arrayOfShapes[1] = new Triangle(3,3); arrayOfShapes[2] = new Circle(5,5); arrayOfShapes[3] = new Cylinder(7,7); } public static void drawAll(){ for(int i=0; i<arrayOfShapes.length;i++){ arrayOfShapes[i].draw(); } } }
[ "noreply@github.com" ]
kimyungki.noreply@github.com
1c443ecd4a00699d0f3f7d5ec90e0c226502a4d2
14a708bf5629a18a9ae380bc166efbc94d4c60c5
/migratebird-core/src/main/java/com/migratebird/structure/clean/DBCleaner.java
e6913bdb46662066393066cf885f523e40c209c7
[ "Apache-2.0" ]
permissive
migratebird/migratebird
29051b6cfef2040a13d2f8899fdd8f7955123405
a01e5b1f01686621d569631f9920655c4d223b4c
refs/heads/master
2021-01-19T22:29:31.444498
2014-05-22T22:31:16
2014-05-22T22:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,028
java
/** * Copyright 2014 www.migratebird.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.migratebird.structure.clean; /** * Defines the contract for implementations that delete data from the database, that could cause problems when performing * updates to the database, such as adding not null columns or foreign key constraints. * */ public interface DBCleaner { /** * Delete all data from all database tables. */ void cleanDatabase(); }
[ "turgaykivrak@gmail.com" ]
turgaykivrak@gmail.com
f6d0772caf1992597cea7253230334915623ceae
a7a286825c3308d83016e1356b8de06d949cd42c
/src/D3A3_E.java
f326f89f0d7624e6b442347c2fe86c743e30eba6
[]
no_license
FiglW/Java_day03_Figl_Edwin
6be7791eb9bc41898c2faf53c1d71c2517543bde
4cf2b1df493c6903718a895e9b3f2b4438184a6d
refs/heads/master
2020-09-13T19:55:39.027774
2019-11-20T14:39:53
2019-11-20T14:39:53
222,888,141
0
0
null
null
null
null
UTF-8
Java
false
false
1,393
java
public class D3A3_E { public static void main(String[] args) { // A3: Create examples that demonstrates the usage of following String methods: // indexOf(), startsWith(), compareTo(), trim(), replace(), replaceAll() and split() // indexOf() int index = "This is a teststring".indexOf("test"); System.out.println(index); // startsWith() String testString = "Marry had a little lamb"; System.out.println(testString.startsWith("M")); System.out.println(testString.startsWith("h")); System.out.println(testString.endsWith("lamb")); // end with System.out.println("abc".compareTo("1")); System.out.println(" This is a trimmed text . ".trim()); String s1="As the robot entered the room, all people jumped under their seats."; String replaceString=s1.replace('e','ä'); //replaces all occurrences of 'e' to 'ä' System.out.println(replaceString); String s2="My name is Khan. My name is Bob. My name is Sonoo."; String replaced=s2.replaceAll("is","was");//replaces all occurrences of "is" to "was" System.out.println(replaced); String Splitline = "arg1, arg2, arg3, arg4"; String[] Splitted = Splitline.split(","); for(int i=0; i<Splitted.length; i++) System.out.println(Splitted[i].trim()); } }
[ "pixelpunk9000@outlook.com" ]
pixelpunk9000@outlook.com
1c777882f3003276d97b640b79be81b03e18c8de
cbdb7891230c83b61be509bc0c8cd02ff5f420d8
/jcst/jcst_bean/src/main/java/com/kaiwait/bean/jczh/io/JobListInput.java
71d85cf1281db77e3bed25a423050a3c280c6bae
[]
no_license
zhanglixye/jcyclic
87e26d1412131e441279240b4468993cb9b08bc3
8a311f8b1e6a81fb40f093d725b5182763d6624e
refs/heads/master
2023-01-04T11:23:22.001517
2020-11-02T05:20:08
2020-11-02T05:20:08
309,265,334
0
0
null
null
null
null
UTF-8
Java
false
false
9,651
java
package com.kaiwait.bean.jczh.io; import java.util.List; import com.kaiwait.bean.jczh.entity.JobList; import com.kaiwait.common.vo.json.server.BaseInputBean; @SuppressWarnings("serial") public class JobListInput extends BaseInputBean{ private JobList JobList; private String job_cd; private String sale_cd;// 売上種目 private String cldiv_cd;// 得意先 private String g_company;//相手先g会社 private String g_company_name;//相手先g会社名 private String payer_cd; //請求先 private String dlvday; //計上日(予定) from to private String job_name; // 件名 private String label_text; //ラベル(标签) private String selfusercd ; private String account_flg; private String jobend_flg; private String sale_no; private String dlvfalg;//计上ステータス private String assign_flg;//割当ステータス private String invpd ;//請求・発票ステータス的判断条件 private String cost_finish_flg; // 原価完了ステータス private String rjpd; // 入金ステータス private String itemcd;//初始化时,检索commont表中下拉框数据用 private String mstname;//初始化时,检索commont表中下拉框数据用 private String itmname;//初始化时,检索commont表中下拉框数据用 private String itemname_hk;//初始化时,检索commont表中下拉框数据用 private String itemname_en;//初始化时,检索commont表中下拉框数据用 private String itemname_jp;//初始化时,检索commont表中下拉框数据用 private String jspd;//计上状态的判断 private String cldiv_name;//得意先名 private String payer_name;//請求先名 private String ddcd;//担当这id private String ddflag;//担当falg private String ddname;//担当者名 private String dlvmon_end;//计上月结束时间 private String dlvmon_sta;//计上月开始时间 private String keyword;//模糊查询关键字 private String saleadddate;//壳上登录 private String sale_admit_date;//壳上承认日 private String jobendmonth;//job的终了月 private String jobenddate;//job登陆日 private String all;//job登陆日 private String dyqx;//得意先扭付權限 private String ddqx;//担当权限 private String gdqx;//格挡权限 private String ddqxcd;//权限中的usercd private String sale_cancel_date; private String cost_finish_date; private List<JobList> joblistinput; private String del_flg; private String searchFlg; private String userid;// private String timesheet;// private String departcd;// private String topFlg; private String lockflg; private String mdcd; public String getMdcd() { return mdcd; } public void setMdcd(String mdcd) { this.mdcd = mdcd; } public String getLockflg() { return lockflg; } public void setLockflg(String lockflg) { this.lockflg = lockflg; } public String getTopFlg() { return topFlg; } public void setTopFlg(String topFlg) { this.topFlg = topFlg; } public String getDepartcd() { return departcd; } public void setDepartcd(String departcd) { this.departcd = departcd; } public String getTimesheet() { return timesheet; } public void setTimesheet(String timesheet) { this.timesheet = timesheet; } public String getUserid() { return userid; } public void setUserid(String userid) { this.userid = userid; } public String getSearchFlg() { return searchFlg; } public void setSearchFlg(String searchFlg) { this.searchFlg = searchFlg; } public String getDel_flg() { return del_flg; } public void setDel_flg(String del_flg) { this.del_flg = del_flg; } public List<JobList> getJoblistinput() { return joblistinput; } public void setJoblistinput(List<JobList> joblistinput) { this.joblistinput = joblistinput; } public String getCost_finish_date() { return cost_finish_date; } public void setCost_finish_date(String cost_finish_date) { this.cost_finish_date = cost_finish_date; } public String getSale_cancel_date() { return sale_cancel_date; } public void setSale_cancel_date(String sale_cancel_date) { this.sale_cancel_date = sale_cancel_date; } public String getDdqxcd() { return ddqxcd; } public void setDdqxcd(String ddqxcd) { this.ddqxcd = ddqxcd; } public String getAll() { return all; } public void setAll(String all) { this.all = all; } public String getDyqx() { return dyqx; } public void setDyqx(String dyqx) { this.dyqx = dyqx; } public String getDdqx() { return ddqx; } public void setDdqx(String ddqx) { this.ddqx = ddqx; } public String getGdqx() { return gdqx; } public void setGdqx(String gdqx) { this.gdqx = gdqx; } public JobList getJobList() { return JobList; } public void setJobList(JobList jobList) { JobList = jobList; } public String getJob_cd() { return job_cd; } public void setJob_cd(String job_cd) { this.job_cd = job_cd; } public String getSale_cd() { return sale_cd; } public void setSale_cd(String sale_cd) { this.sale_cd = sale_cd; } public String getCldiv_cd() { return cldiv_cd; } public void setCldiv_cd(String cldiv_cd) { this.cldiv_cd = cldiv_cd; } public String getG_company() { return g_company; } public void setG_company(String g_company) { this.g_company = g_company; } public String getPayer_cd() { return payer_cd; } public void setPayer_cd(String payer_cd) { this.payer_cd = payer_cd; } public String getDlvday() { return dlvday; } public void setDlvday(String dlvday) { this.dlvday = dlvday; } public String getJob_name() { return job_name; } public void setJob_name(String job_name) { this.job_name = job_name; } public String getLabel_text() { return label_text; } public void setLabel_text(String label_text) { this.label_text = label_text; } public String getSelfusercd() { return selfusercd; } public void setSelfusercd(String selfusercd) { this.selfusercd = selfusercd; } public String getAccount_flg() { return account_flg; } public void setAccount_flg(String account_flg) { this.account_flg = account_flg; } public String getJobend_flg() { return jobend_flg; } public void setJobend_flg(String jobend_flg) { this.jobend_flg = jobend_flg; } public String getSale_no() { return sale_no; } public void setSale_no(String sale_no) { this.sale_no = sale_no; } public String getAssign_flg() { return assign_flg; } public void setAssign_flg(String assign_flg) { this.assign_flg = assign_flg; } public String getInvpd() { return invpd; } public void setInvpd(String invpd) { this.invpd = invpd; } public String getCost_finish_flg() { return cost_finish_flg; } public void setCost_finish_flg(String cost_finish_flg) { this.cost_finish_flg = cost_finish_flg; } public String getRjpd() { return rjpd; } public void setRjpd(String rjpd) { this.rjpd = rjpd; } public String getItemcd() { return itemcd; } public void setItemcd(String itemcd) { this.itemcd = itemcd; } public String getMstname() { return mstname; } public void setMstname(String mstname) { this.mstname = mstname; } public String getItmname() { return itmname; } public void setItmname(String itmname) { this.itmname = itmname; } public String getItemname_hk() { return itemname_hk; } public void setItemname_hk(String itemname_hk) { this.itemname_hk = itemname_hk; } public String getItemname_en() { return itemname_en; } public void setItemname_en(String itemname_en) { this.itemname_en = itemname_en; } public String getItemname_jp() { return itemname_jp; } public void setItemname_jp(String itemname_jp) { this.itemname_jp = itemname_jp; } public String getJspd() { return jspd; } public void setJspd(String jspd) { this.jspd = jspd; } public String getG_company_name() { return g_company_name; } public void setG_company_name(String g_company_name) { this.g_company_name = g_company_name; } public String getDlvfalg() { return dlvfalg; } public void setDlvfalg(String dlvfalg) { this.dlvfalg = dlvfalg; } public String getCldiv_name() { return cldiv_name; } public void setCldiv_name(String cldiv_name) { this.cldiv_name = cldiv_name; } public String getPayer_name() { return payer_name; } public void setPayer_name(String payer_name) { this.payer_name = payer_name; } public String getDdcd() { return ddcd; } public void setDdcd(String ddcd) { this.ddcd = ddcd; } public String getDdflag() { return ddflag; } public void setDdflag(String ddflag) { this.ddflag = ddflag; } public String getDdname() { return ddname; } public void setDdname(String ddname) { this.ddname = ddname; } public String getDlvmon_end() { return dlvmon_end; } public void setDlvmon_end(String dlvmon_end) { this.dlvmon_end = dlvmon_end; } public String getDlvmon_sta() { return dlvmon_sta; } public void setDlvmon_sta(String dlvmon_sta) { this.dlvmon_sta = dlvmon_sta; } public String getKeyword() { return keyword; } public void setKeyword(String keyword) { this.keyword = keyword; } public String getSaleadddate() { return saleadddate; } public void setSaleadddate(String saleadddate) { this.saleadddate = saleadddate; } public String getSale_admit_date() { return sale_admit_date; } public void setSale_admit_date(String sale_admit_date) { this.sale_admit_date = sale_admit_date; } public String getJobendmonth() { return jobendmonth; } public void setJobendmonth(String jobendmonth) { this.jobendmonth = jobendmonth; } public String getJobenddate() { return jobenddate; } public void setJobenddate(String jobenddate) { this.jobenddate = jobenddate; } }
[ "1364969970@qq.com" ]
1364969970@qq.com
903a9719fd3c08b2322eea62d3215551ff0dc2a3
155f65e3a7974708f42596a4b0b6a71003d8c426
/src/com/tss/ocean/util/UserAuthenticationProvider.java
5a20c61c98594b08f8305093f78ee5cce80adbb8
[]
no_license
salahoukoud/InventoryMgt
be05fa69336e2006fa9ed5c3f3ca4dda99fb015d
b9f66a15569d3f0738609a0c84b2c5932d9a4225
refs/heads/master
2020-03-23T13:02:09.935094
2014-10-18T20:19:14
2014-10-18T20:19:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,193
java
/* 1: */ package com.tss.ocean.util; /* 2: */ /* 3: */ import java.util.ArrayList; /* 4: */ import java.util.Collection; /* 5: */ import java.util.HashSet; /* 6: */ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; /* 7: */ import org.springframework.security.authentication.AuthenticationProvider; /* 8: */ import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; /* 9: */ import org.springframework.security.core.Authentication; /* 10: */ import org.springframework.security.core.AuthenticationException; /* 11: */ import org.springframework.security.core.authority.SimpleGrantedAuthority; import com.tss.ocean.pojo.Users; import com.tss.ocean.service.IUserservice; /* 12: */ /* 13: */ public class UserAuthenticationProvider /* 14: */ implements AuthenticationProvider /* 15: */ { @Autowired IUserservice userService; /* 16: */ private static final String ROLE_PREFIX = "ROLE_"; /* 17: */ /* 18: */ public Authentication authenticate(Authentication authentication) /* 19: */ throws AuthenticationException /* 20: */ { /* 21:28 */ Users u=userService.getRecordByKeyandValue("name", authentication.getName()); System.out.println("Authenticating............"+authentication.getName()+"_______"+ authentication.getCredentials().toString()); if (u!=null){ if(u.getPassword().equals(authentication.getCredentials().toString())) { Collection authorities = new ArrayList(buildRolesFromUser(authentication.getName())); authorities.addAll(getActivatedModulesAsRoles()); return new UsernamePasswordAuthenticationToken(u.getName(), u.getPassword(), authorities); } else { Collection authorities = new ArrayList(buildRolesFromUser(authentication.getName())); List activatedModules = new ArrayList(); activatedModules.add(new SimpleGrantedAuthority("ROLE_ANONIMOUS")); authorities.addAll(activatedModules); return new UsernamePasswordAuthenticationToken(u.getName(), u.getPassword(), authorities); } } else { return new UsernamePasswordAuthenticationToken(null, null, null); } /* 24: */ } /* 25: */ /* 26: */ private Collection getActivatedModulesAsRoles() /* 27: */ { /* 28:37 */ List activatedModules = new ArrayList(); /* 29:38 */ activatedModules.add(new SimpleGrantedAuthority("ROLE_USER")); /* 30:39 */ return activatedModules; /* 31: */ } /* 32: */ /* 33: */ private Collection buildRolesFromUser(String username) /* 34: */ { /* 35:43 */ Collection authorities = new HashSet(); /* 36:44 */ return authorities; /* 37: */ } /* 38: */ /* 39: */ public boolean supports(Class authentication) /* 40: */ { /* 41:49 */ return UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication); /* 42: */ } /* 43: */ } /* Location: C:\Users\Raz\Desktop\InvMgmt\WEB-INF\classes\ * Qualified Name: com.tss.ocean.util.UserAuthenticationProvider * JD-Core Version: 0.7.1 */
[ "raaz19.tripathi@gmail.com" ]
raaz19.tripathi@gmail.com
053447da0563b7984feb9741f554f478a3ba718e
f8c2642bf8d5402c0680aa9bf577fd661881bfdb
/study_info_summary/java/spring/personal/spring_demo/swagger-demo/springboot-common/src/main/java/com/example/springboot/common/exception/BasicException.java
f555d2623b593ca9db48e0a9b45e6b0a1f6e6b2e
[]
no_license
fangyuxiang/learngit
afe6739c978e78fd8ac4e6cfcbec2479c16ddd97
6a996f8989011b1ee33b31675734c4d80b4f3dbc
refs/heads/master
2021-01-13T15:35:51.147231
2018-08-05T01:49:32
2018-08-05T01:49:32
81,315,002
0
0
null
null
null
null
UTF-8
Java
false
false
419
java
package com.example.springboot.common.exception; /** * @program: swagger-demo * @description: 通用基础exception * @author: yuxiang.fang * @create: 2018-07-08 18:07 **/ public abstract class BasicException extends RuntimeException { private int code; BasicException(int code, String msg) { super(msg); this.code = code; } public int getCode() { return code; } }
[ "yuxiang.fang@geely.com" ]
yuxiang.fang@geely.com
65ac149f727a69ab38efa2a1f9a12a7aca95c1d5
4bc67115ad265570489255c2e44d6098e35e55ad
/simple-db-music/src/fingerprint/AnchorExtractor.java
bbb50fe2f41a7e34a3203d0f58283a1f4c36ec4d
[]
no_license
simple-db-music/simple-db-music
88ef96900fb01d6b3891ffd440d8c845f38f9331
fe21cf6206d934f4fcbd9a79bd74ee6addcffeb8
refs/heads/master
2021-01-10T03:18:32.911655
2015-12-07T19:33:57
2015-12-07T19:33:57
46,461,879
0
0
null
null
null
null
UTF-8
Java
false
false
10,159
java
package fingerprint; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.NoSuchElementException; import java.util.Random; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import simpledb.BTreeFile; import simpledb.DbException; import simpledb.TransactionAbortedException; import simpledb.TransactionId; public class AnchorExtractor extends Extractor { private static final int TARGET_ZONE_SIZE = 5; private static final int TARGET_ZONE_MIN_LOOKAHEAD = 5; private static final int TARGET_ZONE_MAX_LOOKAHEAD = 50; private static final int TARGET_ZONE_DIFF = 39; private static final int RAND_SAMPLE_SIZE = 250; private final boolean useParallelMatching; private final int numThreads; private final int earlyReturnThreshold; private final int competitorRatio; public AnchorExtractor(int earlyReturnThreshold, int competitorRatio, boolean useParallelMatching, int numThreads) { this.useParallelMatching = useParallelMatching; this.numThreads = numThreads; this.earlyReturnThreshold = earlyReturnThreshold; this.competitorRatio = competitorRatio; } @Override public Map<Integer, Double> matchPoints(Set<DataPoint> samplePoints, BTreeFile btree, TransactionId tid) throws NoSuchElementException, DbException, TransactionAbortedException { Map<Integer, Map<Integer, Integer>> songToOffsetVotes = new HashMap<Integer, Map<Integer, Integer>>(); List<DataPoint> sampleList = new ArrayList<DataPoint>(samplePoints); Collections.sort(sampleList, (p1, p2) -> p1.getHash() - p2.getHash()); if (useParallelMatching) { AtomicInteger maxVotes = new AtomicInteger(-1); AtomicInteger maxSong = new AtomicInteger(-1); AtomicInteger maxVotes2 = new AtomicInteger(-1); ConcurrentHashMap<Integer, Double> early = new ConcurrentHashMap<>(); Iterator<DataPoint> it = randomSample(sampleList).iterator(); Runnable match = new Runnable () { @Override public void run () { while (true) { DataPoint dp; synchronized (it) { if (!it.hasNext()) { return; } dp = it.next(); } int curHash = dp.getHash(); Set<DataPoint> knownPoints; try { knownPoints = getPointsMatchingHash(curHash, btree, tid); if ((maxVotes.get() > 20 && maxVotes2.get() <= maxVotes.get()/2)) { return; } for (DataPoint knownPoint : knownPoints) { Map<Integer, Integer> songVotes = songToOffsetVotes.get(knownPoint.getTrackId()); if (songVotes == null) { songVotes = new HashMap<Integer, Integer>(); songToOffsetVotes.put(knownPoint.getTrackId(), songVotes); } Integer curDiff = knownPoint.getTimeOffset() - dp.getTimeOffset(); Integer curVotes = songVotes.get(curDiff); if (curVotes == null) { curVotes = 0; } curVotes += 1; songVotes.put(curDiff, curVotes); if (curVotes > maxVotes.get()) { if (maxSong.get() != knownPoint.getTrackId()) { maxVotes2.set(maxVotes.get()); } maxVotes.set(curVotes); maxSong.set(knownPoint.getTrackId()); //System.out.println("maxVotes: "+curVotes); if (maxVotes.get() > earlyReturnThreshold && maxVotes2.get() <= maxVotes.get()/competitorRatio) { //System.out.println("trying to end early!"); early.put(knownPoint.getTrackId(), -1.0); return; } } } } catch (Exception e) { e.printStackTrace(); } } } }; ExecutorService executor = Executors.newFixedThreadPool(numThreads); Future<?> future = executor.submit(match); while (!future.isDone()) { if (early.keySet().size() > 0) { executor.shutdownNow(); return early; } } } else { int maxVotes = -1; int maxSong = -1; int maxVotes2 = -1; for (DataPoint dp : randomSample(sampleList)) { int curHash = dp.getHash(); Set<DataPoint> knownPoints; try { knownPoints = getPointsMatchingHash(curHash, btree, tid); for (DataPoint knownPoint : knownPoints) { Map<Integer, Integer> songVotes = songToOffsetVotes.get(knownPoint.getTrackId()); if (songVotes == null) { songVotes = new HashMap<Integer, Integer>(); songToOffsetVotes.put(knownPoint.getTrackId(), songVotes); } Integer curDiff = knownPoint.getTimeOffset() - dp.getTimeOffset(); Integer curVotes = songVotes.get(curDiff); if (curVotes == null) { curVotes = 0; } curVotes += 1; songVotes.put(curDiff, curVotes); if (curVotes > maxVotes) { if (maxSong != knownPoint.getTrackId()) { maxVotes2 = maxVotes; } maxVotes = curVotes; maxSong = knownPoint.getTrackId(); if (maxVotes > earlyReturnThreshold && maxVotes2 <= maxVotes/competitorRatio) { Map<Integer, Double> early = new HashMap<>(); early.put(knownPoint.getTrackId(), -1.0); return early; } } } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } Map<Integer, Double> songToScore = new HashMap<Integer, Double>(); for (Integer songId : songToOffsetVotes.keySet()) { Map<Integer, Integer> votes = songToOffsetVotes.get(songId); int max = -1; for (Entry<Integer, Integer> e: votes.entrySet()) { if (max < e.getValue()) { max = e.getValue(); } } songToScore.put(songId, (double) max); } return songToScore; } @Override public Set<DataPoint> extractDataPoints(double[][] spectrogram, int trackId) { int[] keyPoints = extractKeyPoints(spectrogram); Set<DataPoint> dataPoints = new HashSet<DataPoint>(); int upperBound; int curPointsInTargetZone; FrequencyPair curPair; for (int i = 0; i < keyPoints.length; i++) { upperBound = Math.min(i+TARGET_ZONE_MAX_LOOKAHEAD, keyPoints.length); curPointsInTargetZone = 0; for (int j = i+TARGET_ZONE_MIN_LOOKAHEAD; j < upperBound; j++) { if (Math.abs(keyPoints[i]-keyPoints[j]) > TARGET_ZONE_DIFF) { continue; } curPointsInTargetZone++; curPair = new FrequencyPair(keyPoints[i], keyPoints[j], j-i); dataPoints.add(new DataPoint(curPair.hashCode(), i, trackId)); if (curPointsInTargetZone == TARGET_ZONE_SIZE) { break; } } } return dataPoints; } private int[] extractKeyPoints(double[][] spectrogram) { int[] keyPoints = new int[spectrogram.length]; double maxAmplitude; int maxFrequency; double[] curLine; for (int i = 0; i < spectrogram.length; i++) { maxAmplitude = Integer.MIN_VALUE; maxFrequency = -1; curLine = spectrogram[i]; for (int j = 0; j < curLine.length; j++) { if (curLine[j] > maxAmplitude) { maxAmplitude = curLine[j]; maxFrequency = j; } } keyPoints[i] = maxFrequency; } return keyPoints; } private List<DataPoint> randomSample(List<DataPoint> points) { Random r = new Random(); for (int i = 0; i < RAND_SAMPLE_SIZE; i++) { int pos = i + r.nextInt(points.size() - i); DataPoint temp = points.get(pos); points.set(pos, points.get(i)); points.set(i, temp); } return points.subList(0, RAND_SAMPLE_SIZE); } }
[ "2016bmw@csail.mit.edu" ]
2016bmw@csail.mit.edu
e8048d3094a64b27fdbaf19d4e146e7b1ad85f19
ff22bff94133a8bd80f62060eb9ad22424a69f72
/19_04_17_RentCompanyServerRelease/src/telran/cars/configuration/SecurityConfiguration.java
d351324104dd926cb3d249a352e0d69e9060005c
[]
no_license
geoart81/mySql
9999112701a2db6c818200c7401f5cb1efc70ee7
6ae572b41977a9f73fb1518c4ea0e81ee1955118
refs/heads/master
2020-03-21T18:05:58.939135
2019-04-23T08:25:47
2019-04-23T08:25:47
138,872,531
0
0
null
null
null
null
UTF-8
Java
false
false
997
java
package telran.cars.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import telran.accounting.interfaces.IAccountingManagement; import telran.accounting.management.configuration.Authenticator; import telran.accounting.management.service.AccountingManagementService; @Configuration @EnableMongoRepositories("telran.accounting.management.domain.repo") public class SecurityConfiguration { @Bean Authenticator getAuthenticator() { return new Authenticator(); } @Bean PasswordEncoder getPasswordEncoder() { return new BCryptPasswordEncoder(); } @Bean IAccountingManagement getAccountingManagement() { return new AccountingManagementService(); } }
[ "geoart81@icloud.com" ]
geoart81@icloud.com
fcdefd4f907446725b64806803c84fb69546297a
624ba905cb884a9119d25825ffb0fdc2aa1ce9fe
/src/main/java/job2/MapReduce/topTenVotes/TopTenMapper.java
c75338263b416bbaad5f4c9625681e729c5dc528
[]
no_license
davidedm07/Progetto1BigData
b17fbf871ea568e0c226aabb64c7885e50e0ec7e
6acf277ede42e17d88b2d3b79c896e37e987d002
refs/heads/master
2021-06-18T07:45:58.594421
2017-05-15T15:37:09
2017-05-15T15:37:09
91,081,183
0
1
null
null
null
null
UTF-8
Java
false
false
915
java
package job2.MapReduce.topTenVotes; import java.io.IOException; import java.util.StringTokenizer; import org.apache.hadoop.io.DoubleWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Mapper.Context; public class TopTenMapper extends Mapper<LongWritable, Text,Text, ProductWritable> { private Text userId; private ProductWritable product; public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { String line = value.toString(); if (!line.equals("") || line != null) { String[] splittedLine = line.split("\t"); this.userId = new Text(splittedLine[2]); this.product = new ProductWritable(new Text(splittedLine[1]), new DoubleWritable(Double.parseDouble(splittedLine[6]))); context.write(userId, product); } } }
[ "antoniomartinelli@MBP-di-Antonio.lan" ]
antoniomartinelli@MBP-di-Antonio.lan
63e4dfb28218fdef82d07dc01d9932a7d5f46674
2ef552c2058b2c27002e497b6206f89aa6d5c40d
/app/src/main/java/polytech/vladislava/sudoku/RecordsActivity.java
a060e2dd229d1f3adb45d9696f68bd20d47d079e
[]
no_license
oxovu/AndroidProject
d24583b0f094c44682d42a4c975c61ad2c6625f7
6a9a90b19c2ed286e295433f6e572159cd6fd669
refs/heads/master
2020-04-13T06:04:31.921654
2018-12-28T09:20:59
2018-12-28T09:20:59
163,010,901
0
0
null
2018-12-24T17:16:19
2018-12-24T17:16:19
null
UTF-8
Java
false
false
1,006
java
package polytech.vladislava.sudoku; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ListView; import java.util.Collections; import java.util.List; public class RecordsActivity extends AppCompatActivity { private DBConnector connector; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_records); connector = new DBConnector(getApplicationContext()); List<Record> records = connector.getAllRecords(); if (records != null) Collections.sort(records); if (records != null){ RecordAdapter adapter = new RecordAdapter(this, records); ListView lvMain = findViewById(R.id.a_recs_listView); lvMain.setAdapter(adapter); } } @Override protected void onDestroy() { connector.close(); super.onDestroy(); } }
[ "vlada318@live.com" ]
vlada318@live.com
436584b7fad5af812b1465300910134fe7a94b13
96316916d2f8fc2566bb77a44d8ef5a18a9fc1bf
/src/main/java/pl/uek/krakow/pp5/App.java
afe0f70be336c4004b44245c95b9bdf4de7c3282
[]
no_license
jkanclerz/pp5-creditcard
26b1fc66056595edc1feec8cd8e1769eb4d79f1c
9c0473cc2349df81399ac65e7fd9d3182544bd29
refs/heads/master
2020-09-09T08:32:59.823184
2019-11-06T07:41:59
2019-11-06T07:41:59
217,028,893
0
0
null
null
null
null
UTF-8
Java
false
false
141
java
package pl.uek.krakow.pp5; public class App { public static void main (String[] Args){ System.out.println("lol :)"); } }
[ "joannawojtowicz@MacBook-Air-Joanna-2.local" ]
joannawojtowicz@MacBook-Air-Joanna-2.local
e8015b886b4ecf0bf9953bcd0f30813db3b372c3
c7b94c91cf9834ff1ffcd5405360771505c7a9a8
/IPAddress/src/inet/ipaddr/format/IPAddressStringDivisionGrouping.java
01f6075b5f58b1015c221a11746e72b92d419bcd
[ "Apache-2.0" ]
permissive
yab/IPAddress
673445a8609f1b168750be7cc0ce00769cfcf488
475b148e82b816c488510b9b5b03e70223d93b34
refs/heads/master
2021-09-05T17:14:18.973850
2018-01-29T22:31:59
2018-01-29T22:31:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,389
java
/* * Copyright 2017 Sean C Foley * * 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 * or at * https://github.com/seancfoley/IPAddress/blob/master/LICENSE * * 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 inet.ipaddr.format; import inet.ipaddr.IPAddressNetwork; public class IPAddressStringDivisionGrouping extends AddressStringDivisionGrouping implements IPAddressStringDivisionSeries { private static final long serialVersionUID = 4L; private IPAddressNetwork<?, ?, ?, ?, ?> network; private final Integer prefixLength; public IPAddressStringDivisionGrouping(IPAddressStringDivision divisions[], IPAddressNetwork<?, ?, ?, ?, ?> network, Integer prefixLength) { super(divisions); this.prefixLength = prefixLength; this.network = network; } @Override public IPAddressNetwork<?, ?, ?, ?, ?> getNetwork() { return network; } @Override public IPAddressStringDivision getDivision(int index) { return (IPAddressStringDivision) divisions[index]; } @Override public boolean isPrefixed() { return prefixLength != null; } @Override public Integer getPrefixLength() { return prefixLength; } @Override public boolean isPrefixBlock() { Integer networkPrefixLength = getPrefixLength(); if(networkPrefixLength == null) { return false; } if(network.getPrefixConfiguration().allPrefixedAddressesAreSubnets()) { return true; } int divCount = getDivisionCount(); for(int i = 0; i < divCount; i++) { IPAddressStringDivision div = getDivision(i); Integer segmentPrefixLength = div.getDivisionPrefixLength(); if(segmentPrefixLength != null) { if(!div.isPrefixBlock(segmentPrefixLength)) { return false; } for(++i; i < divCount; i++) { div = getDivision(i); if(!div.isFullRange()) { return false; } } } } return true; } }
[ "seancfoley@gmail.com" ]
seancfoley@gmail.com
4be34b35ec346d27f69788bb6d294c908f61fccf
4535e15af7ad12271571b1af37bf2484ff7158c9
/app/src/main/java/com/example/sns/follow/model/FollowListItem.java
1f6ce4c13635866f796ac806c895d676186fd778
[]
no_license
anstn1993/android_sns2.0
14d410b61bbe236521deb5864edfdf2bfd36b27f
b65c933a850acac91cbe623a044a5b88e9969108
refs/heads/master
2021-07-10T22:37:33.539351
2020-11-13T04:22:12
2020-11-13T04:22:12
215,761,493
0
0
null
null
null
null
UTF-8
Java
false
false
986
java
package com.example.sns.follow.model; public class FollowListItem { private String account, profile, nickname; private int id; private boolean isFollowing; public String getAccount() { return account; } public void setAccount(String account) { this.account = account; } public String getProfile() { return profile; } public void setProfile(String profile) { this.profile = profile; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public int getId() { return id; } public void setId(int listId) { this.id = listId; } public boolean isFollowing() { return isFollowing; } public boolean getIsFollowing() { return isFollowing; } public void setIsFollowing(boolean isFollowing) { this.isFollowing = isFollowing; } }
[ "anstn1993@gmail.com" ]
anstn1993@gmail.com
331811f1919535b808061ac128832befb9b05433
433c893543d55eb85e64346d16ccb6c133acf857
/src/main/java/com/sugarcrm/sugar/WsRest.java
09ca473b04e15c34e98673775baf851ad53fed44
[]
no_license
mavis1001/IBMVoodooGrimoire
338d3c29b178071cd3a96250a42e00cae1f14b0f
97ca609034b2ae0022e4aff95ed61867574873c5
refs/heads/master
2021-01-19T15:34:13.778833
2014-01-17T12:11:01
2014-01-17T12:11:01
16,132,489
0
1
null
null
null
null
UTF-8
Java
false
false
12,975
java
package com.sugarcrm.sugar; import com.sugarcrm.candybean.configuration.Configuration; import com.sugarcrm.candybean.webservices.WS; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.logging.Logger; import java.security.MessageDigest; import java.io.File; import java.math.BigInteger; import org.json.simple.JSONObject; /** * WsRest encapsulates REST calls for Sugar CRUD functions. * * @author Soon Han */ public class WsRest { private String url; private String username; private String password; private String sessionId; private Logger logger; private Map<String, String> payload = new LinkedHashMap<String, String>(); public WsRest() { this.logger = getLogger(); try { init(); } catch (Exception e) { e.printStackTrace(); } } private void init() { loadBasicParams(); this.sessionId = getSessionId(this.username, this.password); } private Logger getLogger() { try { this.logger = Logger.getLogger(WsRest.class.getName()); } catch (Exception e1) { e1.printStackTrace(); } return logger; } /** * Load basic parameters such as the Sugar url, username, password, sugar REST entry point, etc. * * @param None * @return void */ private void loadBasicParams() { final String currentWorkingPath = System.getProperty("user.dir"); final String relativeResourcesPath = File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator; String grimoirePropsPath = currentWorkingPath + relativeResourcesPath + "grimoire.properties"; Configuration grimoireConfig = new Configuration(); try { grimoireConfig.load(new File(grimoirePropsPath)); String baseUrl = grimoireConfig.getValue("env.base_url", "http://localhost/sugar"); String restEntryPoint = grimoireConfig.getValue("rest_entry_point", "service/v4_1/rest.php"); this.url = baseUrl + "/" + restEntryPoint; this.username = grimoireConfig.getValue("sugar_user", "admin"); this.password = grimoireConfig.getValue("sugar_pass", "asdf"); } catch (Exception e) { e.printStackTrace(); } } /** * Compute and return the MD5 value of the Sugar password * * @param password, an unencoded password * @return MD5 encoded password */ private static String getMD5(String password) { // Eg. "f78spx" gives md5="0b54f7d8c5926903d31576da3518a167" String pwMD5 = ""; try { MessageDigest m = MessageDigest.getInstance("MD5"); m.update(password.getBytes(), 0, password.length()); pwMD5 = new BigInteger(1, m.digest()).toString(16); while (pwMD5.length() < 32) { pwMD5 = "0" + pwMD5; } } catch (Exception e) { e.printStackTrace(); } return pwMD5; } private Map<String, String> getPayload() { return payload; } /** * Create module records * * @param module name * @param listOfMaps as Map<String, Object> * @return result as Map<String, Object> */ public Map<String, Object> create(String module, ArrayList<HashMap<String, String>> listOfMaps) { initPayload("set_entries"); addCreatePayload(module, listOfMaps); Map<String, Object> mapParse = postRequest(); return mapParse; } /** * Delete module records * * @param module name * @param recordIds as List<String> * @return deleted record in the form of Map<String, Object> */ public Map<String, Object> delete(String module, List<String> recordIds) { initPayload("set_entries"); addDeletePayload(module, recordIds); Map<String, Object> mapParse = postRequest(); return mapParse; } /** * Delete all the module records * * @param module name * @return deleted record in the form of Map<String, Object> */ public Map<String, Object> deleteAll(String module) { ArrayList<Map<String, Object>> acctIds = getEntryListAttribValues( module, "id"); long totalCnt = acctIds.size(); List<String> arrList = new ArrayList<String>(); for (int i = 0; i < totalCnt; i++) { String id = (String) acctIds.get(i).get("id"); arrList.add(id); } Map<String, Object> acctsDeleted = delete(module, arrList); return acctsDeleted; } /** * Get entry_list attribute values * * @param module name as String * @param attrib as String * @return results in ArrayList<Map<String, Object>> */ public ArrayList<Map<String, Object>> getEntryListAttribValues( String module, String attrib) { ArrayList<Map<String, Object>> entryList = (ArrayList<Map<String, Object>>) getEntryList(module); ; ArrayList<Map<String, Object>> listOfMaps = new ArrayList<Map<String, Object>>(); for (Map<String, Object> entry : entryList) { for (Map.Entry<String, Object> item : entry.entrySet()) { String key = item.getKey(); Object value = item.getValue(); if (key.equals(attrib)) { Map<String, Object> keyVal = new HashMap<String, Object>(); keyVal.put(key, value); listOfMaps.add(keyVal); } } } return listOfMaps; } /** * Get name_value_list attribute values * * @param module name as String * @param attrib as String * @return results in ArrayList<Map<String, Object>> */ public ArrayList<Map<String, Object>> getNameValueListAttribValues( String module, String attrib) { ArrayList<Map<String, Object>> entryList = (ArrayList<Map<String, Object>>) getEntryList(module); ; ArrayList<Map<String, Object>> listOfMaps = new ArrayList<Map<String, Object>>(); for (Map<String, Object> entry : entryList) { @SuppressWarnings("unchecked") Map<String, Map<String, String>> name_value = (Map<String, Map<String, String>>) entry .get("name_value_list"); String value = name_value.get(attrib).get("value"); Map<String, Object> keyVal = new HashMap<String, Object>(); keyVal.put(attrib, value); listOfMaps.add(keyVal); } printListOfMaps(module, listOfMaps); return listOfMaps; } /** * Read module info * * @param module name * @return module info in Map<String, Object> */ public Map<String, Object> readModuleInfo(String module) { initPayload("get_entry_list"); addModuleInfoPayload(module); Map<String, Object> mapParse = postRequest(); return mapParse; } /** * Get the entry_list * * @param method name * @return entry_list in ArrayList<Map<String, Object>> */ public ArrayList<Map<String, Object>> getEntryList(String module) { Map<String, Object> mapParse = readModuleInfo(module); @SuppressWarnings("unchecked") ArrayList<Map<String, Object>> arrList = (ArrayList<Map<String, Object>>) mapParse .get("entry_list"); return arrList; } /** * Get total_count of records in module * * @param method name * @return total_count in String */ public String getTotalCount(String module) throws Exception { Map<String, Object> mapParse = readModuleInfo(module); String resultCount = String.valueOf(mapParse.get("result_count")); return resultCount; } /** * Set payload with method name. Also set input and output types as JSON * * @param method name * @return the payload which is a Map<String, String> */ private Map<String, String> initPayload(String method) { Map<String, String> pl = getPayload(); pl.put("method", method); pl.put("input_type", "JSON"); pl.put("response_type", "JSON"); return pl; } /** * Add create module records parameters to payload * * @param method name * @param listOfMaps as ArrayList<HashMap<String, String>> * @return the payload which is a Map<String, String> */ private Map<String, String> addCreatePayload(String module, ArrayList<HashMap<String, String>> listOfMaps) { Map<String, String> pl = getPayload(); Map<String, Object> restData = new LinkedHashMap<String, Object>(); restData.put("session", sessionId); restData.put("module", module); restData.put("name_value_lists", listOfMaps); String restDataJs = JSONObject.toJSONString(restData); pl.put("rest_data", restDataJs); return pl; } /** * Add delete module records parameters to payload * * @param method name * @param recordIds as List<String> * @return the payload which is a Map<String, String> */ private Map<String, String> addDeletePayload(String module, List<String> recordIds) { Map<String, Object> restData = new LinkedHashMap<String, Object>(); restData.put("session", sessionId); restData.put("module", module); ArrayList<HashMap<String, String>> deleteInfo = new ArrayList<HashMap<String, String>>(); for (String id : recordIds) { HashMap<String, String> hashMap = new HashMap<String, String>(); hashMap.put("id", id); hashMap.put("deleted", "1"); deleteInfo.add(hashMap); } restData.put("name_value_list", deleteInfo); String restDataJs = JSONObject.toJSONString(restData); Map<String, String> pl = getPayload(); pl.put("rest_data", restDataJs); return pl; } /** * Post the request * * @param None * @return results in Map<String, Object> */ private Map<String, Object> postRequest() { Map<String, Object> mapParse = null; try { mapParse = WS.request(WS.OP.POST, url, getPayload(), null); } catch (Exception e) { e.printStackTrace(); } return mapParse; } /** * Print module info for debugging only * * @param method name * @param listOfMaps as ArrayList<HashMap<String, String>> * @return void */ private void printListOfMaps(String module, ArrayList<Map<String, Object>> listOfMaps) { for (Map<String, Object> map : listOfMaps) { for (Map.Entry<String, Object> item : map.entrySet()) { String key = item.getKey(); Object value = item.getValue(); System.out.println("getEntryListAttribValues(): " + module + " " + key + " = " + value); } } } /** * Print entry_list for debugging only * * @param entryList as ArrayList<Map<String, Object>> * @param listOfMaps as ArrayList<HashMap<String, String>> * @return void */ @SuppressWarnings("unused") private void printEntryList(ArrayList<Map<String, Object>> entryList) { for (Map<String, Object> entry : entryList) { for (Map.Entry<String, Object> item : entry.entrySet()) { String key = item.getKey(); Object value = item.getValue(); System.out.println("printEntryList(): key = " + key + " value = " + value); } } } /** * Get the sessionId * * @param username as String * @param password (unencoded) as String * @return sessionId as String */ private String getSessionId(String username, String password) { initPayload("login"); addSessionIdPayload(); Map<String, Object> mapParse = postRequest(); this.sessionId = (String) mapParse.get("id"); return this.sessionId; } /** * Add sessionId to payload * * @param None * @return payload in Map<String, String> */ private Map<String, String> addSessionIdPayload() { Map<String, String> userCredentials = new LinkedHashMap<String, String>(); userCredentials.put("user_name", username); userCredentials.put("password", getMD5(this.password)); // The order matters, use an ordered map Map<String, Object> request = new LinkedHashMap<String, Object>(); // user_auth must be first. Otherwise null sessionId returned request.put("user_auth", userCredentials); request.put("application_name", "RestClient"); // optional String restData = JSONObject.toJSONString(request); Map<String, String> pl = getPayload(); pl.put("rest_data", restData); return pl; } /** * Add parameters to payload for requesting module info * * @param module name * @return payload in Map<String, String> */ private Map<String, String> addModuleInfoPayload(String module) { Map<String, Object> restData = new LinkedHashMap<String, Object>(); restData.put("session", this.sessionId); restData.put("module", module); restData.put("query", ""); restData.put("order_by", ""); restData.put("offset", "0"); // Must be arrayList, not String[]. Otherwise parse result is null ArrayList<String> arrList = new ArrayList<String>(); arrList.add("id"); arrList.add("name"); restData.put("select_fields", arrList); ArrayList<String> linkNameToFieldsArrayList = new ArrayList<String>(); restData.put("link_name_to_fields_array", linkNameToFieldsArrayList); restData.put("max_results", "100000"); // a large number to retrieve all // the elements restData.put("Favorites", false); String restDataJs = JSONObject.toJSONString(restData); Map<String, String> pl = getPayload(); pl.put("rest_data", restDataJs); return pl; } }
[ "afrantsuzov@sugarcrm.com" ]
afrantsuzov@sugarcrm.com
92b13e000d55ab701efbdfa634165d408f2c8ee8
7b5b60b4b0786272644a8c5d3441ec9c29f12c8c
/src/main/java/pl/coderslab/filters/SuperAdminFilter.java
6a8be49e89924855101a8b39f5e6189e4193e610
[]
no_license
tomaszkerg/scrumlabMyCopy
c62e4046e181a4cda5d4c5c71c23c7ffa734fa7a
536f2f84717b7f2e68ac5390a38e2c25cb420b6e
refs/heads/master
2023-01-19T03:47:39.635080
2020-11-22T14:19:17
2020-11-22T14:19:17
315,054,381
0
0
null
null
null
null
UTF-8
Java
false
false
1,017
java
package pl.coderslab.filters; import pl.coderslab.model.Admin; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpFilter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; @WebFilter("/app/users-list") public class SuperAdminFilter extends HttpFilter { @Override protected void doFilter(HttpServletRequest req, HttpServletResponse res, FilterChain chain) throws IOException, ServletException { HttpSession session = req.getSession(); Admin admin = (Admin)session.getAttribute("username"); if(session.getAttribute("username")==null){ res.sendRedirect("/login"); }else{ if(admin.getSuperAdmin()==0){ res.sendRedirect("/app/dashboard"); }else { chain.doFilter(req, res); } } } }
[ "tomasz.kerg@gmail.com" ]
tomasz.kerg@gmail.com
abbc081a11b8c24bb8f60dd32342a94651387fa6
20330fa0df126ca6725ed790482bba1fd7041a39
/app/src/main/java/com/crazyt/health/WalkandStep/adapters/TrainingOverviewAdapter.java
445d1018e382c631f5b8ec493cd9cf6e73418cbe
[]
no_license
alokakb/HealthcareApp2
f3290f701d18f1dec2e1a55df5f22d93b436e599
800ba02d6659f2927b1bf9f166e82bde11fb00e4
refs/heads/master
2023-08-24T14:52:30.628949
2021-10-21T02:11:58
2021-10-21T02:11:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
17,656
java
package com.crazyt.health.WalkandStep.adapters; import android.content.Context; import android.os.Build; //import androidx.cardview.widget.CardView; //import android.support.v7.widget.PopupMenu; //import androidx.recyclerview.widget.RecyclerView; import android.transition.TransitionManager; import android.view.LayoutInflater; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.RatingBar; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.appcompat.widget.PopupMenu; import androidx.cardview.widget.CardView; import androidx.recyclerview.widget.RecyclerView; import com.crazyt.health.R; import com.crazyt.health.WalkandStep.models.Training; import com.crazyt.health.WalkandStep.utils.UnitHelper; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.List; public class TrainingOverviewAdapter extends RecyclerView.Adapter<TrainingOverviewAdapter.ViewHolder> { public static final int VIEW_TYPE_TRAINING_SESSION = 0; public static final int VIEW_TYPE_MONTH_HEADLINE = 1; public static final int VIEW_TYPE_SUMMARY = 2; private List<Training> mItems; private OnItemClickListener mItemClickListener; private int mExpandedPosition = -1; private RecyclerView recyclerView; public TrainingOverviewAdapter(List<Training> items) { mItems = items; } // Create new views (invoked by the layout manager) @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v; ViewHolder vh = null; switch (viewType) { case VIEW_TYPE_SUMMARY: v = LayoutInflater.from(parent.getContext()) .inflate(R.layout.card_training_summary, parent, false); vh = new TrainingSummaryViewHolder(v); break; case VIEW_TYPE_TRAINING_SESSION: v = LayoutInflater.from(parent.getContext()) .inflate(R.layout.card_training_session, parent, false); vh = new TrainingSessionViewHolder(v); break; case VIEW_TYPE_MONTH_HEADLINE: v = LayoutInflater.from(parent.getContext()) .inflate(R.layout.card_training_month_headline, parent, false); vh = new MonthHeadlineViewHolder(v); break; } return vh; } @Override public int getItemViewType(int position) { Training training = this.mItems.get(position); return training.getViewType(); } // Replace the contents of a view (invoked by the layout manager) @Override public void onBindViewHolder(final ViewHolder holder, final int position) { Training item = mItems.get(position); UnitHelper.FormattedUnitPair distance; UnitHelper.FormattedUnitPair calories; switch (getItemViewType(position)) { case VIEW_TYPE_SUMMARY: TrainingSummaryViewHolder trainingSummaryViewHolder = (TrainingSummaryViewHolder) holder; distance = UnitHelper.formatKilometers(UnitHelper.metersToKilometers(item.getDistance()), trainingSummaryViewHolder.itemView.getContext()); calories = UnitHelper.formatCalories(item.getCalories(), trainingSummaryViewHolder.itemView.getContext()); if (trainingSummaryViewHolder.mTextViewSteps != null) { trainingSummaryViewHolder.mTextViewSteps.setText(String.valueOf((int) item.getSteps())); } if (trainingSummaryViewHolder.mTextViewDistance != null) { trainingSummaryViewHolder.mTextViewDistance.setText(distance.getValue()); } if (trainingSummaryViewHolder.mTextViewCalories != null) { trainingSummaryViewHolder.mTextViewCalories.setText(calories.getValue()); } if (trainingSummaryViewHolder.mTextViewDuration != null) { String durationText = String.format(trainingSummaryViewHolder.itemView.getResources().getConfiguration().locale, "%02d:%02d", ((item.getDuration() / 3600)), ((item.getDuration() - (item.getDuration() / 3600) * 3600) / 60)); trainingSummaryViewHolder.mTextViewDuration.setText(durationText); } if (trainingSummaryViewHolder.mTextViewDistanceTitle != null) { trainingSummaryViewHolder.mTextViewDistanceTitle.setText(distance.getUnit()); } if (trainingSummaryViewHolder.mTextViewCaloriesTitle != null) { trainingSummaryViewHolder.mTextViewCaloriesTitle.setText(calories.getUnit()); } if(trainingSummaryViewHolder.mTextViewSince != null){ DateFormat df = new SimpleDateFormat("MMMM yyyy", trainingSummaryViewHolder.itemView.getResources().getConfiguration().locale); Calendar cal = Calendar.getInstance(); if(item.getStart() != 0) { cal.setTimeInMillis(item.getStart()); } trainingSummaryViewHolder.mTextViewSince.setText(df.format(cal.getTime())); } break; case VIEW_TYPE_MONTH_HEADLINE: MonthHeadlineViewHolder monthHeadlineViewHolder = (MonthHeadlineViewHolder) holder; if (monthHeadlineViewHolder.mTextViewName != null) { monthHeadlineViewHolder.mTextViewName.setText(item.getName()); } break; case VIEW_TYPE_TRAINING_SESSION: final TrainingSessionViewHolder trainingSessionViewHolder = (TrainingSessionViewHolder) holder; distance = UnitHelper.formatKilometers(UnitHelper.metersToKilometers(item.getDistance()), trainingSessionViewHolder.itemView.getContext()); calories = UnitHelper.formatCalories(item.getCalories(), trainingSessionViewHolder.itemView.getContext()); String durationText = String.format(trainingSessionViewHolder.itemView.getResources().getConfiguration().locale, "%02d:%02d", ((item.getDuration() / 3600)), ((item.getDuration() - (item.getDuration() / 3600) * 3600) / 60)); if (trainingSessionViewHolder.mTextViewName != null) { trainingSessionViewHolder.mTextViewName.setText(item.getName()); } if (trainingSessionViewHolder.mTextViewDescription != null) { trainingSessionViewHolder.mTextViewDescription.setText(item.getDescription()); } if (trainingSessionViewHolder.mTextViewSteps != null) { trainingSessionViewHolder.mTextViewSteps.setText(String.valueOf((int) item.getSteps())); } if (trainingSessionViewHolder.mTextViewDistance != null) { trainingSessionViewHolder.mTextViewDistance.setText(distance.getValue()); } if (trainingSessionViewHolder.mTextViewCalories != null) { trainingSessionViewHolder.mTextViewCalories.setText(calories.getValue()); } if (trainingSessionViewHolder.mTextViewDuration != null) { trainingSessionViewHolder.mTextViewDuration.setText(durationText); } if (trainingSessionViewHolder.mRatingBarFeeling != null) { trainingSessionViewHolder.mRatingBarFeeling.setRating(item.getFeeling()); } if (trainingSessionViewHolder.mTextViewSmallSteps != null) { trainingSessionViewHolder.mTextViewSmallSteps.setText(String.valueOf((int) item.getSteps())); } if (trainingSessionViewHolder.mTextViewSmallDuration != null) { trainingSessionViewHolder.mTextViewSmallDuration.setText(durationText); } if (trainingSessionViewHolder.mTextViewSmallDistance != null) { trainingSessionViewHolder.mTextViewSmallDistance.setText(distance.getValue()); } if (trainingSessionViewHolder.mTextViewSmallName != null) { trainingSessionViewHolder.mTextViewSmallName.setText(item.getName()); } if (trainingSessionViewHolder.mTextViewDistanceTitle != null) { trainingSessionViewHolder.mTextViewDistanceTitle.setText(distance.getUnit()); } if (trainingSessionViewHolder.mTextViewSmallDistanceTitle != null) { trainingSessionViewHolder.mTextViewSmallDistanceTitle.setText(distance.getUnit()); } if (trainingSessionViewHolder.mTextViewCaloriesTitle != null) { trainingSessionViewHolder.mTextViewCaloriesTitle.setText(calories.getUnit()); } if (trainingSessionViewHolder.mRatingBarFeeling != null) { final boolean isExpanded = position == mExpandedPosition; trainingSessionViewHolder.mExpandedLayout.setVisibility(isExpanded ? View.VISIBLE : View.GONE); trainingSessionViewHolder.mSmallLayout.setVisibility(isExpanded ? View.GONE : View.VISIBLE); LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) trainingSessionViewHolder.mCardViewLayout.getLayoutParams(); layoutParams.setMargins((isExpanded ? 0 : 8), (isExpanded ? 8 : 0), (isExpanded ? 0 : 8), (isExpanded ? 8 : 0)); trainingSessionViewHolder.view.setLayoutParams(layoutParams); trainingSessionViewHolder.mCardViewLayout.setRadius((isExpanded) ? 4 : 0); trainingSessionViewHolder.view.setActivated(isExpanded); trainingSessionViewHolder.view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mExpandedPosition = isExpanded ? -1 : trainingSessionViewHolder.getAdapterPosition(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { TransitionManager.beginDelayedTransition(recyclerView); } notifyDataSetChanged(); } }); } break; } } // Return the size of your data set (invoked by the layout manager) @Override public int getItemCount() { return (mItems != null) ? mItems.size() : 0; } public void setItems(List<Training> items) { this.mItems = items; this.notifyDataSetChanged(); } public void removeItem(int position) { this.mItems.remove(position); } public void setOnItemClickListener(final OnItemClickListener mItemClickListener) { this.mItemClickListener = mItemClickListener; } public void setRecyclerView(RecyclerView recyclerView) { this.recyclerView = recyclerView; } public interface OnItemClickListener { void onItemClick(View view, int position); void onEditClick(View view, int position); void onRemoveClick(View view, int position); } public abstract class ViewHolder extends RecyclerView.ViewHolder { public ViewHolder(View itemView) { super(itemView); } } // Provide a reference to the views for each data item // Complex data items may need more than one view per item, and // you provide access to all the views for a data item in a view holder public class TrainingSessionViewHolder extends ViewHolder implements View.OnClickListener, PopupMenu.OnMenuItemClickListener { public TextView mTextViewName; public TextView mTextViewDescription; public TextView mTextViewSteps; public TextView mTextViewDistance; public TextView mTextViewCalories; public TextView mTextViewDuration; public ImageButton mImageButton; public RatingBar mRatingBarFeeling; public TextView mTextViewSmallSteps; public TextView mTextViewSmallDuration; public TextView mTextViewSmallDistance; public TextView mTextViewSmallName; public TextView mTextViewDistanceTitle; public TextView mTextViewSmallDistanceTitle; public TextView mTextViewCaloriesTitle; public RelativeLayout mSmallLayout; public LinearLayout mExpandedLayout; public View view; public CardView mCardViewLayout; public TrainingSessionViewHolder(View v) { super(v); view = v; mCardViewLayout = (CardView) v.findViewById(R.id.card_training_session); mSmallLayout = (RelativeLayout) v.findViewById(R.id.card_training_session_small); mExpandedLayout = (LinearLayout) v.findViewById(R.id.card_training_session_expanded); mTextViewName = (TextView) v.findViewById(R.id.training_card_title); mTextViewDescription = (TextView) v.findViewById(R.id.training_card_description); mTextViewSteps = (TextView) v.findViewById(R.id.training_card_steps); mTextViewDistance = (TextView) v.findViewById(R.id.training_card_distance); mTextViewCalories = (TextView) v.findViewById(R.id.training_card_calories); mTextViewDuration = (TextView) v.findViewById(R.id.training_card_duration); mTextViewSmallSteps = (TextView) v.findViewById(R.id.training_small_card_steps); mTextViewSmallDuration = (TextView) v.findViewById(R.id.training_small_card_duration); mTextViewSmallDistance = (TextView) v.findViewById(R.id.training_small_card_distance); mTextViewSmallName = (TextView) v.findViewById(R.id.training_small_card_name); mTextViewDistanceTitle = (TextView) v.findViewById(R.id.distanceTitle); mTextViewSmallDistanceTitle = (TextView) v.findViewById(R.id.distance_title_small); mTextViewCaloriesTitle = (TextView) v.findViewById(R.id.calorieTitle); mRatingBarFeeling = (RatingBar) v.findViewById(R.id.training_card_feeling); mImageButton = (ImageButton) v.findViewById(R.id.training_card_menu); mImageButton.setOnClickListener(this); view.setOnClickListener(this); } public void showPopup(View v, Context c) { PopupMenu popup = new PopupMenu(c, v); MenuInflater inflater = popup.getMenuInflater(); inflater.inflate(R.menu.menu_card_training_session, popup.getMenu()); popup.setOnMenuItemClickListener(this); popup.show(); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.card_training_session: if (mItemClickListener != null) { mItemClickListener.onItemClick(view, getLayoutPosition()); } break; case R.id.training_card_menu: showPopup(view, view.getContext()); break; } } @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.menu_edit: if (mItemClickListener != null) { mItemClickListener.onEditClick(view, getLayoutPosition()); return true; } break; case R.id.menu_remove: if (mItemClickListener != null) { mItemClickListener.onRemoveClick(view, getLayoutPosition()); return true; } break; } return false; } } public class MonthHeadlineViewHolder extends ViewHolder { public TextView mTextViewName; public MonthHeadlineViewHolder(View v) { super(v); mTextViewName = (TextView) v.findViewById(R.id.training_month_headline); } } public class TrainingSummaryViewHolder extends ViewHolder{ public TextView mTextViewSteps; public TextView mTextViewDistance; public TextView mTextViewCalories; public TextView mTextViewDuration; public TextView mTextViewDistanceTitle; public TextView mTextViewCaloriesTitle; public TextView mTextViewSince; public TrainingSummaryViewHolder(View v) { super(v); mTextViewSteps = (TextView) v.findViewById(R.id.training_card_steps); mTextViewDistance = (TextView) v.findViewById(R.id.training_card_distance); mTextViewCalories = (TextView) v.findViewById(R.id.training_card_calories); mTextViewDuration = (TextView) v.findViewById(R.id.training_card_duration); mTextViewDistanceTitle = (TextView) v.findViewById(R.id.training_distance_title); mTextViewCaloriesTitle = (TextView) v.findViewById(R.id.calorieTitle); mTextViewSince = (TextView) v.findViewById(R.id.training_card_since); } } }
[ "alok.alokbharti.bharti8@gmail.com" ]
alok.alokbharti.bharti8@gmail.com
88722286877a90e6a4c5b24dc99ef56c3596b2e9
4b066a37195364f2b05297a4aa00925acd6b301c
/jpa05/src/main/java/mapping/entity/Mapping.java
9cf267bd1feb930bdbd0a489acd1ebec0e46a59a
[]
no_license
hunchulchoi/jpa-demo
70091ccf2feac3d4f81acae9fb5b4907506b5678
a21e0f5a672a7273cffb432e263961beee4bcc85
refs/heads/master
2023-07-02T16:14:44.944967
2021-08-04T04:19:03
2021-08-04T04:19:03
392,172,565
0
0
null
null
null
null
UTF-8
Java
false
false
1,729
java
package mapping.entity; import lombok.extern.slf4j.Slf4j; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import java.util.List; import java.util.stream.Collectors; @Slf4j public class Mapping { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpabook05"); EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begin(); findMembersByTeam(em, 4L); findMembersByTeam(em, 5L); tx.commit(); log.info("tx commit end"); } private static void findByName(EntityManager em, String teamName){ String jpql = "select m from Member m join m.team t where t.name=:teamName"; List<Member> resultList = em.createQuery(jpql).setParameter("teamName", teamName).getResultList(); log.info("tameName:{}, resultList:{}", teamName, resultList); } private static void addTeam(EntityManager em){ Team team2 = em.find(Team.class, 5L); Member member3 = em.find(Member.class, 6L); member3.setName("member3"); member3.setTeam(team2); Member member4 = em.find(Member.class, 7L); member4.setName("member4"); member4.setTeam(null); } private static void findMembersByTeam(EntityManager em, Long teamId){ log.info("teamId:{}", teamId); List<Member> members = em.find(Team.class, teamId).getMembers(); members.stream().forEach(m->log.info("\t id:{}, name:{}, team:{}", m.getId(), m.getName(), m.getTeam().getName())); } }
[ "hc.choi@q-sol.co.kr" ]
hc.choi@q-sol.co.kr
bf6cdc27f810994efb44660b342668c18b15b1f6
b533b394b8fa665b7270830a128adc57931cb6af
/editor/cn/StringCompressionIi_1531.java
fcad157e643751b5112bed0b19af87f2e2387ac3
[]
no_license
pengzhetech/leetcode
f2ac111cf41cca23c2e52edd9a072aae8782e382
4cda15b0021010b9d8450102a48391e91ce69a7b
refs/heads/master
2023-06-08T16:19:50.310281
2021-07-02T14:59:47
2021-07-02T14:59:47
275,697,540
0
0
null
null
null
null
UTF-8
Java
false
false
1,914
java
//行程长度编码 是一种常用的字符串压缩方法,它将连续的相同字符(重复 2 次或更多次)替换为字符和表示字符计数的数字(行程长度)。例如,用此方法压缩字符串 " //aabccc" ,将 "aa" 替换为 "a2" ,"ccc" 替换为` "c3" 。因此压缩后的字符串变为 "a2bc3" 。 // // 注意,本问题中,压缩时没有在单个字符后附加计数 '1' 。 // // 给你一个字符串 s 和一个整数 k 。你需要从字符串 s 中删除最多 k 个字符,以使 s 的行程长度编码长度最小。 // // 请你返回删除最多 k 个字符后,s 行程长度编码的最小长度 。 // // // // 示例 1: // // 输入:s = "aaabcccd", k = 2 //输出:4 //解释:在不删除任何内容的情况下,压缩后的字符串是 "a3bc3d" ,长度为 6 。最优的方案是删除 'b' 和 'd',这样一来,压缩后的字符串为 "a3 //c3" ,长度是 4 。 // // 示例 2: // // 输入:s = "aabbaa", k = 2 //输出:2 //解释:如果删去两个 'b' 字符,那么压缩后的字符串是长度为 2 的 "a4" 。 // // // 示例 3: // // 输入:s = "aaaaaaaaaaa", k = 0 //输出:3 //解释:由于 k 等于 0 ,不能删去任何字符。压缩后的字符串是 "a11" ,长度为 3 。 // // // // // 提示: // // // 1 <= s.length <= 100 // 0 <= k <= s.length // s 仅包含小写英文字母 // // Related Topics 字符串 动态规划 // 👍 46 👎 0 public class StringCompressionIi_1531 { public static void main(String[] args) { Solution solution = new StringCompressionIi_1531().new Solution(); } //leetcode submit region begin(Prohibit modification and deletion) class Solution { public int getLengthOfOptimalCompression(String s, int k) { return 0; } } //leetcode submit region end(Prohibit modification and deletion) }
[ "pengzhepost@sina.com" ]
pengzhepost@sina.com
4458b372cc037bbfd8e40d42515c4850a93a9927
f2cf2d4acf1788c0c4403c67c0ed848dfd270193
/app/src/androidTest/java/kr/co/bravecompany/modoogong/android/stdapp/ExampleInstrumentedTest.java
e3c2b22a41d0216d4fe89f03e22c58edc49e24db
[]
no_license
Taylor004/ModooGong_MT_v3
beb08452e45e1f65c15abf2ac3f32c7d08eece18
4fa4b7ebbc1727d2184a6a22c8815f125423a2b0
refs/heads/master
2020-09-25T13:54:37.018315
2019-12-05T04:42:49
2019-12-05T04:42:49
226,017,469
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package kr.co.bravecompany.modoogong.android.stdapp; import android.content.Context; import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("kr.co.bravecompany.bravespk.android.stdapp", appContext.getPackageName()); } }
[ "taylor@bravecompany.net" ]
taylor@bravecompany.net
882bd6b7a858fe526422b5d317045aff1e9bab2a
7fd939fd1d90431d79eba22e1c9cc6675953df51
/src/main/java/com/walle/leetcode/normal/AWS.java
b5eb5f0a76a5414a1c330e2fb4890c15bf81c638
[]
no_license
bbpatience/study
faa288f9b1d229990b859feab7d340891eb95664
88fc4e29d89cab4211f863f07fa0d504011fe036
refs/heads/master
2020-04-10T03:20:58.274731
2020-04-07T02:38:32
2020-04-07T02:38:46
160,767,477
3
0
null
2019-10-11T19:13:12
2018-12-07T03:46:08
Java
UTF-8
Java
false
false
1,150
java
package com.walle.leetcode.normal; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; public class AWS { public List<Integer> search(int[] entryTime, int[] leaveTime) { //calculate int max = 0; int idx = 0; Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < entryTime.length; ++i) { for (int j = entryTime[i]; j <= leaveTime[i]; j++) { map.put(j, map.getOrDefault(j, 0) + 1); if (map.get(j) > max) { max = map.get(j); idx = j; } } } // output // // for (int i : map.keySet()) { // if (map.get(i) > max) { // max = map.get(i); // idx = i; // } // } return Arrays.asList(max, idx); } public static void main(String[] args) { int[] entryTime = {1, 2, 10, 5, 5}; int[] leaveTime = {4, 5, 12, 9, 12}; AWS aws = new AWS(); aws.search(entryTime, leaveTime).forEach(item -> System.out.println(item)); } }
[ "baibing@rongcloud.cn" ]
baibing@rongcloud.cn
3d9b498fdae76d093f8236cb6240b16893b1fa67
27926c6c630dc97ef744ec33869a9f3fefcb3adc
/Courses/Spring-Hibernate-for-Beginners-includes-Spring-Boot/spring-hibernate-source-code-v26/14-spring-boot-thymeleaf/38-thymeleafdemo-employees-validation/src/main/java/com/luv2code/springboot/thymeleafdemo/entity/Employee.java
54e6b46b21d92add547d51fbaaa989bfdcde28a8
[ "Apache-2.0" ]
permissive
SergiOn/java
3e09cf1c82ba6b90a6a498bbda9791b7505ba2e8
723483bec0ec8d9d6a1604d0bb29dc64e4383429
refs/heads/main
2021-06-08T04:44:51.967211
2020-04-18T19:14:01
2020-04-18T19:14:01
129,922,956
3
1
null
null
null
null
UTF-8
Java
false
false
1,818
java
package com.luv2code.springboot.thymeleafdemo.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.validation.constraints.NotBlank; @Entity @Table(name="employee") public class Employee { // define fields @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private int id; @NotBlank(message="is required") @Column(name="first_name") private String firstName; @NotBlank(message="is required") @Column(name="last_name") private String lastName; @NotBlank(message="is required") @Column(name="email") private String email; // define constructors public Employee() { } public Employee(int id, String firstName, String lastName, String email) { this.id = id; this.firstName = firstName; this.lastName = lastName; this.email = email; } public Employee(String firstName, String lastName, String email) { this.firstName = firstName; this.lastName = lastName; this.email = email; } // define getter/setter public int getId() { return id; } public void setId(int id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } // define tostring @Override public String toString() { return "Employee [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", email=" + email + "]"; } }
[ "onishhenko@gmail.com" ]
onishhenko@gmail.com
3c515612453f16d2a889415e2abce446e044275d
17c30fed606a8b1c8f07f3befbef6ccc78288299
/Mate10_8_1_0/src/main/java/com/leisen/wallet/sdk/tsm/ITSMOperator.java
1752ed4a7256dc841308d58f09e3437e17849769
[]
no_license
EggUncle/HwFrameWorkSource
4e67f1b832a2f68f5eaae065c90215777b8633a7
162e751d0952ca13548f700aad987852b969a4ad
refs/heads/master
2020-04-06T14:29:22.781911
2018-11-09T05:05:03
2018-11-09T05:05:03
157,543,151
1
0
null
2018-11-14T12:08:01
2018-11-14T12:08:01
null
UTF-8
Java
false
false
1,403
java
package com.leisen.wallet.sdk.tsm; import com.leisen.wallet.sdk.bean.CommonRequestParams; import com.leisen.wallet.sdk.bean.OperAppletReqParams; public interface ITSMOperator { int activateApplet(CommonRequestParams commonRequestParams, String str); int addGPAC(CommonRequestParams commonRequestParams, String str); int commonExecute(CommonRequestParams commonRequestParams); int createSSD(CommonRequestParams commonRequestParams, String str); int deleteApplet(CommonRequestParams commonRequestParams, OperAppletReqParams operAppletReqParams); int deleteGPAC(CommonRequestParams commonRequestParams, String str); int deleteSSD(CommonRequestParams commonRequestParams, String str); void getCIN(String str); void getCPLC(String str); void getIIN(String str); int installApplet(CommonRequestParams commonRequestParams, OperAppletReqParams operAppletReqParams); int lockApplet(CommonRequestParams commonRequestParams, OperAppletReqParams operAppletReqParams); int lockSSD(CommonRequestParams commonRequestParams, String str); int notifyEseInfoSync(CommonRequestParams commonRequestParams); int notifyInfoInit(CommonRequestParams commonRequestParams); int unlockApplet(CommonRequestParams commonRequestParams, OperAppletReqParams operAppletReqParams); int unlockSSD(CommonRequestParams commonRequestParams, String str); }
[ "lygforbs0@mail.com" ]
lygforbs0@mail.com
4210d44d83939d12f1f54067ddc7b0da6bbd21ca
791b03a690bdb69646f3ac33a0bc806fb906f175
/app/src/androidTest/java/com/hathy/onboardingtutorial/ApplicationTest.java
8c489710a1bf3e5f35b3b83295904dd3ad9723d3
[ "BSD-2-Clause" ]
permissive
tutsplus/Android-Onboarding
45977548d80a130d7b8e6fd8bf0d11b4e6262cc6
3b50415ff2dbbf0932205550a4f004a0fc19ba59
refs/heads/master
2020-12-26T04:05:08.137123
2015-07-27T04:44:47
2015-07-27T04:44:47
39,755,260
22
7
null
null
null
null
UTF-8
Java
false
false
359
java
package com.hathy.onboardingtutorial; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "mlrdae@gmail.com" ]
mlrdae@gmail.com
3c2d1340e710c13a3fb4c51a94a500e4ae2d168b
fe6803462a9149a1eda8adbda9639caa009f0018
/org/pjsip/pjsua2/AccountConfig.java
d0958599293a2000443635f4b0d518451812deba
[]
no_license
RealFictionFactory/pjsip-android-binaries
3434206a1890379eee956ea7722c65ce52f7970f
a346ed8afb71168400e6a855d8f12b5768acad37
refs/heads/master
2021-04-28T06:36:05.513813
2018-02-20T14:20:12
2018-02-20T14:20:12
122,205,838
2
0
null
null
null
null
UTF-8
Java
false
false
5,025
java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package org.pjsip.pjsua2; public class AccountConfig extends PersistentObject { private transient long swigCPtr; protected AccountConfig(long cPtr, boolean cMemoryOwn) { super(pjsua2JNI.AccountConfig_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } protected static long getCPtr(AccountConfig obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; pjsua2JNI.delete_AccountConfig(swigCPtr); } swigCPtr = 0; } super.delete(); } public void setPriority(int value) { pjsua2JNI.AccountConfig_priority_set(swigCPtr, this, value); } public int getPriority() { return pjsua2JNI.AccountConfig_priority_get(swigCPtr, this); } public void setIdUri(String value) { pjsua2JNI.AccountConfig_idUri_set(swigCPtr, this, value); } public String getIdUri() { return pjsua2JNI.AccountConfig_idUri_get(swigCPtr, this); } public void setRegConfig(AccountRegConfig value) { pjsua2JNI.AccountConfig_regConfig_set(swigCPtr, this, AccountRegConfig.getCPtr(value), value); } public AccountRegConfig getRegConfig() { long cPtr = pjsua2JNI.AccountConfig_regConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountRegConfig(cPtr, false); } public void setSipConfig(AccountSipConfig value) { pjsua2JNI.AccountConfig_sipConfig_set(swigCPtr, this, AccountSipConfig.getCPtr(value), value); } public AccountSipConfig getSipConfig() { long cPtr = pjsua2JNI.AccountConfig_sipConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountSipConfig(cPtr, false); } public void setCallConfig(AccountCallConfig value) { pjsua2JNI.AccountConfig_callConfig_set(swigCPtr, this, AccountCallConfig.getCPtr(value), value); } public AccountCallConfig getCallConfig() { long cPtr = pjsua2JNI.AccountConfig_callConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountCallConfig(cPtr, false); } public void setPresConfig(AccountPresConfig value) { pjsua2JNI.AccountConfig_presConfig_set(swigCPtr, this, AccountPresConfig.getCPtr(value), value); } public AccountPresConfig getPresConfig() { long cPtr = pjsua2JNI.AccountConfig_presConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountPresConfig(cPtr, false); } public void setMwiConfig(AccountMwiConfig value) { pjsua2JNI.AccountConfig_mwiConfig_set(swigCPtr, this, AccountMwiConfig.getCPtr(value), value); } public AccountMwiConfig getMwiConfig() { long cPtr = pjsua2JNI.AccountConfig_mwiConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountMwiConfig(cPtr, false); } public void setNatConfig(AccountNatConfig value) { pjsua2JNI.AccountConfig_natConfig_set(swigCPtr, this, AccountNatConfig.getCPtr(value), value); } public AccountNatConfig getNatConfig() { long cPtr = pjsua2JNI.AccountConfig_natConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountNatConfig(cPtr, false); } public void setMediaConfig(AccountMediaConfig value) { pjsua2JNI.AccountConfig_mediaConfig_set(swigCPtr, this, AccountMediaConfig.getCPtr(value), value); } public AccountMediaConfig getMediaConfig() { long cPtr = pjsua2JNI.AccountConfig_mediaConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountMediaConfig(cPtr, false); } public void setVideoConfig(AccountVideoConfig value) { pjsua2JNI.AccountConfig_videoConfig_set(swigCPtr, this, AccountVideoConfig.getCPtr(value), value); } public AccountVideoConfig getVideoConfig() { long cPtr = pjsua2JNI.AccountConfig_videoConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountVideoConfig(cPtr, false); } public void setIpChangeConfig(AccountIpChangeConfig value) { pjsua2JNI.AccountConfig_ipChangeConfig_set(swigCPtr, this, AccountIpChangeConfig.getCPtr(value), value); } public AccountIpChangeConfig getIpChangeConfig() { long cPtr = pjsua2JNI.AccountConfig_ipChangeConfig_get(swigCPtr, this); return (cPtr == 0) ? null : new AccountIpChangeConfig(cPtr, false); } public AccountConfig() { this(pjsua2JNI.new_AccountConfig(), true); } public void readObject(ContainerNode node) throws java.lang.Exception { pjsua2JNI.AccountConfig_readObject(swigCPtr, this, ContainerNode.getCPtr(node), node); } public void writeObject(ContainerNode node) throws java.lang.Exception { pjsua2JNI.AccountConfig_writeObject(swigCPtr, this, ContainerNode.getCPtr(node), node); } }
[ "adebicki@pgs-soft.com" ]
adebicki@pgs-soft.com
1d7a9cbc9ea8d7d471baa18dfcd01567e3ae3da5
2b569fd327cc6f38b3d660cc1be747b7cd88cc42
/src/main/java/com/arrkgroup/poc/web/rest/package-info.java
545acc1318deb5cd8d52694fc999d135dbe7a798
[]
no_license
moazzam3641/testRepo
63f2b1f2d060708cf563bc56408c23bff8f1262b
e26c10db6d2dc3f64f4081b182301c2e6367515e
refs/heads/master
2021-04-09T17:54:03.383139
2018-02-27T11:05:10
2018-02-27T11:05:10
125,853,991
0
1
null
2020-09-18T10:02:16
2018-03-19T12:28:04
Java
UTF-8
Java
false
false
76
java
/** * Spring MVC REST controllers. */ package com.arrkgroup.poc.web.rest;
[ "sonal.verma@arrkgroup.com" ]
sonal.verma@arrkgroup.com
7d6f8dbc22820a9bab48bac7ded2bb92111bb1c6
b118a9cb23ae903bc5c7646b262012fb79cca2f2
/src/com/estrongs/android/pop/app/dj.java
54e29305f22daeeb749ea8ff842e515642cdd599
[]
no_license
secpersu/com.estrongs.android.pop
22186c2ea9616b1a7169c18f34687479ddfbb6f7
53f99eb4c5b099d7ed22d70486ebe179e58f47e0
refs/heads/master
2020-07-10T09:16:59.232715
2015-07-05T03:24:29
2015-07-05T03:24:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,720
java
package com.estrongs.android.pop.app; import android.content.Intent; import android.content.res.Resources; import android.graphics.Bitmap; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout.LayoutParams; import android.widget.TextView; import com.estrongs.android.pop.ad; import com.estrongs.android.pop.app.imageviewer.gallery.c; import com.estrongs.android.pop.spfs.SPFileInfo; import com.estrongs.android.util.as; import com.estrongs.android.util.m; import com.estrongs.fs.d; import java.util.Date; import java.util.LinkedList; class dj extends BaseAdapter { private Bitmap b; private as c = new as(ad.a(a).E(), ImageCommentActivity.l(a)); dj(ImageCommentActivity paramImageCommentActivity) {} private int a() { return a.getResources().getDisplayMetrics().widthPixels - com.estrongs.android.ui.d.a.a(a, 15.0F); } private void a(View paramView, Bitmap paramBitmap) { if (paramBitmap != null) { paramView.findViewById(2131362426).setVisibility(8); int i = Math.min(paramBitmap.getWidth(), a()); paramView = (ImageView)paramView.findViewById(2131362092); paramView.setLayoutParams(new LinearLayout.LayoutParams(i, i)); paramView.setImageBitmap(paramBitmap); paramView.setVisibility(0); paramView.setOnClickListener(new do(this)); } } public int getCount() { return ImageCommentActivity.g(a).size(); } public Object getItem(int paramInt) { return ImageCommentActivity.g(a).get(paramInt); } public long getItemId(int paramInt) { return paramInt; } public View getView(int paramInt, View paramView, ViewGroup paramViewGroup) { paramView = null; TextView localTextView1; TextView localTextView2; TextView localTextView3; if (paramInt == 0) { paramViewGroup = ImageCommentActivity.m(a).inflate(2130903217, null); if (a.getIntent().getBooleanExtra("is_dir", false)) { ((ImageView)paramViewGroup.findViewById(2131362092)).setBackgroundResource(2130837543); } localTextView1 = (TextView)paramViewGroup.findViewById(2131361825); localTextView2 = (TextView)paramViewGroup.findViewById(2131362607); localTextView3 = (TextView)paramViewGroup.findViewById(2131362625); if (((b == null) || (b.isRecycled())) && (ImageCommentActivity.n(a) == null) && (com.estrongs.a.b.a.a(10).indexOf("makeAndAddView") >= 0)) { paramView = new c(null, d.a(a), ImageCommentActivity.c(a)); ImageCommentActivity.c(a, new dk(this, "PicComment-ImageLoader", localTextView1, localTextView2, localTextView3, paramView, paramViewGroup)); ImageCommentActivity.n(a).start(); paramView = paramViewGroup; if (a.a != null) { localTextView1.setText(a.a.name); if (a.a.lastModifiedTime <= 0L) { break label358; } long l = a.a.lastModifiedTime; if (l > 0L) { localTextView2.setText(c.a(new Date(l))); } label264: ((TextView)a.findViewById(2131362518)).setText(a.a.ownerUsername); if ((a.a.description == null) || ("".equals(a.a.description))) { break label367; } localTextView3.setVisibility(0); localTextView3.setText(a.a.description); paramView = paramViewGroup; } } } label358: label367: do { return paramView; a(paramViewGroup, b); break; localTextView2.setText(null); break label264; localTextView3.setVisibility(8); return paramViewGroup; paramViewGroup = ImageCommentActivity.g(a).get(paramInt); if ((paramViewGroup instanceof com.gmail.yuyang226.flickr.a.a.a)) { paramView = (com.gmail.yuyang226.flickr.a.a.a)paramViewGroup; paramViewGroup = ImageCommentActivity.m(a).inflate(2130903214, null); localTextView1 = (TextView)paramViewGroup.findViewById(2131362606); localTextView2 = (TextView)paramViewGroup.findViewById(2131362607); localTextView3 = (TextView)paramViewGroup.findViewById(2131362608); localTextView1.setText(paramView.a()); localTextView2.setText(c.a(paramView.b())); localTextView3.setText(paramView.c()); return paramViewGroup; } } while (paramViewGroup != ImageCommentActivity.j(a)); return (View)paramViewGroup; } } /* Location: * Qualified Name: com.estrongs.android.pop.app.dj * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
4cd2ea106aeb2ccc4ec9674e19f9593a15e0f8c0
11e6c7959731ad7eda490a9cee3a79b4b2addc9a
/app/src/main/java/org/aisen/weibo/sina/support/biz/GithubResourceDownloadHttpUtility.java
c67400c909a3a8a17d2da3d14c635c4d35ca3f8b
[]
no_license
wms1993/AisenWeiBo
2233ef326fac54e9c795a785b839ebfd9614b79f
b253bfa4a2d64a60cdb137b8e10cd224f7586af4
refs/heads/master
2021-01-10T02:17:38.908790
2017-05-24T09:51:27
2017-05-24T09:51:27
55,762,994
1
1
null
null
null
null
UTF-8
Java
false
false
3,603
java
package org.aisen.weibo.sina.support.biz; import android.net.Proxy; import org.aisen.android.common.context.GlobalContext; import org.aisen.android.common.setting.Setting; import org.aisen.android.common.setting.SettingUtility; import org.aisen.android.common.utils.FileUtils; import org.aisen.android.common.utils.Logger; import org.aisen.android.network.http.HttpConfig; import org.aisen.android.network.http.IHttpUtility; import org.aisen.android.network.http.Params; import org.aisen.android.network.task.TaskException; import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.conn.params.ConnRouteParams; import org.apache.http.impl.client.DefaultHttpClient; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; /** * Github资源下载器 * * @author Jeff.Wang * * @date 2014年10月24日 */ public class GithubResourceDownloadHttpUtility implements IHttpUtility { public static final String TAG = "GithubResDownload"; @Override public <T> T doGet(HttpConfig config, Setting action, Params params, Class<T> responseCls) throws TaskException { String url = config.baseUrl + action.getValue(); String dir = params.getParameter("dir"); String fileName = params.getParameter("fileName"); Logger.d(TAG, String.format("下载地址 = %s, fileName = %s, 保存路径 dir = %s", url, fileName, dir)); String dataPath = GlobalContext.getInstance().getAppPath() + "temp"; File tempFile = new File(dataPath + File.separator + fileName); if (!tempFile.getParentFile().exists()) tempFile.getParentFile().mkdirs(); File targetFile = new File(dir + File.separator + fileName); if (targetFile.exists()) targetFile.delete(); else if (!targetFile.getParentFile().exists()) targetFile.getParentFile().mkdirs(); DefaultHttpClient httpClient = new DefaultHttpClient(); String host = Proxy.getDefaultHost(); if (host != null) { httpClient.getParams().setParameter(ConnRouteParams.DEFAULT_PROXY, new HttpHost(host, Proxy.getDefaultPort())); } try { HttpResponse response = httpClient.execute(new HttpGet(url + fileName)); if (200 == response.getStatusLine().getStatusCode()) { HttpEntity entity = response.getEntity(); // 获取输入流 InputStream in = entity.getContent(); File tmpFile = tempFile; FileOutputStream out = new FileOutputStream(tmpFile); int i; byte bs[] = new byte[1024 * 8]; while ((i = in.read(bs)) > 0) { out.write(bs, 0, i); } out.flush(); out.close(); in.close(); FileUtils.copyFile(tempFile, targetFile); boolean result = targetFile.exists(); Logger.d(TAG, "下载 result = " + result); return (T) new Boolean(result); } } catch (Exception e) { e.printStackTrace(); } return (T) new Boolean(false); } @Override public <T> T doPost(HttpConfig config, Setting action, Params params, Class<T> responseCls, Object requestObj) throws TaskException { return null; } @Override public <T> T uploadFile(HttpConfig config, Setting action, Params params, File file, Params headers, Class<T> responseClass) throws TaskException { return null; } }
[ "1482824390@qq.com" ]
1482824390@qq.com
95c24c123a1d9854a00fa2773097753a929a0050
4185ac382130d8bb4c6ef4d2eb3071f5a87505c7
/src/com/sail/Main.java
4e6127ad8a5fa0d911f905110270bb4075db0769
[]
no_license
ios-yifan/factory
d8ce3b5c2ecc980a9ae9acea7361ccfa597794d8
382f8926560117324f1510dd2ce2dc81302ecf94
refs/heads/master
2023-02-17T02:35:05.681254
2021-01-20T03:18:45
2021-01-20T03:18:45
331,179,143
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package com.sail; public class Main { public static void main(String[] args) { // write your code here Operation operation = OperationFactory.creatOperation(OperationType.OPERATION_DIVIDE); operation.setNumberA(1); operation.setNumberB(0); double result = operation.getResult(); System.out.println(result); } }
[ "zhangyifan@rongcloud.cn" ]
zhangyifan@rongcloud.cn
e128859162a7a344f9b23bf8c8ea3102e108d4d3
4998cc523e28baac8a23ca33d9f993843a2e12fe
/src/by/it/zhuk/lesson04/TaskC1.java
b67cb813878dd3da7f4e999850288ef968ba2cfe
[]
no_license
zhuk1985/cs2018-09-03
51500735dad3b4b4986a9550cf698b3bbce948b4
5c34083e3cf22a5fe1abaa525bdf55c80a695673
refs/heads/master
2020-03-28T01:12:59.272924
2018-09-14T17:27:40
2018-09-14T17:27:40
147,487,284
0
0
null
2018-09-05T08:43:40
2018-09-05T08:43:41
null
UTF-8
Java
false
false
4,544
java
package by.it.zhuk.lesson04; import java.util.Scanner; /* Напишите программу которая спрашивает у пользователя: Какую вы хотите зарплату в $$$? После ввода суммы, программа анализирует полученное значение и если введенная цифра меньше 300 или больше 3000 программа выводит на экран: Мы вам перезвоним! Иначе выводит в цикле по переменной int month от 0 до 14 рассчитанную зарплату. В летние месяцы - выводится введенная сумма с названием месяца. В несуществующие месяцы 0, 13 и 14 выводится сумма в $0.0 в остальные месяцы выводится указанная сумма с премией в 50%. Сделайте так, чтобы в тот месяц, когда получилась зарплата в $666 цикл после вывода прерывался. Пример работы программы (у вас должно быть так же, до символа): Какую вы хотите зарплату в $$$? 2000 За месяц 0 начислено $0.0 За январь начислено $3000.0 За февраль начислено $3000.0 За март начислено $3000.0 За апрель начислено $3000.0 За май начислено $3000.0 За июнь начислено $2000.0 За июль начислено $2000.0 За август начислено $2000.0 За сентябрь начислено $3000.0 За октябрь начислено $3000.0 За ноябрь начислено $3000.0 За декабрь начислено $3000.0 За месяц 13 начислено $0.0 За месяц 14 начислено $0.0 */ public class TaskC1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); if ((num < 300) || (num > 3000)) System.out.println("Мы вам перезвоним!\n"); else for (int x = 0; x <= 14; x++) { double pay = num * 1.5; if (x < 1 || x > 12) pay = 0; if (x >= 6 && x <= 8) pay = x; switch (x) { case 1: System.out.println("За январь начислено $" + pay); break; case 2: System.out.println("За февраль начислено $" + pay); break; case 3: System.out.println("За март начислено $" + pay); break; case 4: System.out.println("За апрель начислено $" + pay); break; case 5: System.out.println("За май начислено $" + pay); break; case 6: System.out.println("За июнь начислено $" + pay); break; case 7: System.out.println("За июль начислено $" + pay); break; case 8: System.out.println("За август начислено $" + pay); break; case 9: System.out.println("За сентябрь начислено $" + pay); break; case 10: System.out.println("За октябрь начислено $" + pay); break; case 11: System.out.println("За ноябрь начислено $" + pay); break; case 12: System.out.println("За декабрь начислено $" + pay); break; default: System.out.println("За месяц " + x + "январь начислено $" + pay); break; } if (pay == 666.0) break; } } }
[ "gukolka@inbox.ru" ]
gukolka@inbox.ru
939f40c026ae3348afcfa792dcb033b0cb8012c2
df742ee89d5fa19b6139087726c269f05cca7df1
/account-core/src/main/java/com/zbjdl/account/service/impl/SystemInfoServiceImpl.java
b4d6c2a53cfb792194872f3c51c638495b57a015
[]
no_license
zhengyi89/zbjdl-account
a3dca9af16709e6f4689fbe0b1b3aa9bda5fb8fb
b07d18aa7d112fd4eaa50235fe795dcddfe71c4c
refs/heads/master
2020-04-15T11:17:38.407382
2019-02-14T08:14:04
2019-02-14T08:14:04
164,623,668
1
1
null
null
null
null
UTF-8
Java
false
false
2,292
java
/* * Powered By zbjdl-code-generator * Web Site: http://www.zbjdl.com * Since 2018 - 2022 */ package com.zbjdl.account.service.impl; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.zbjdl.common.utils.BeanUtils; import com.zbjdl.account.manager.SystemInfoManager; import com.zbjdl.account.service.SystemInfoService; import com.zbjdl.account.model.SystemInfo; import com.zbjdl.account.dto.SystemInfoDto; @Service("systemInfoService") public class SystemInfoServiceImpl implements SystemInfoService { @Autowired private SystemInfoManager systemInfoManager; @Override public Integer saveOrUpdate(SystemInfoDto systemInfoDto) { if (systemInfoDto.getId()!=null) { SystemInfo systemInfo = systemInfoManager.selectById(systemInfoDto.getId()); BeanUtils.copyProperties(systemInfoDto, systemInfo); return systemInfoManager.update(systemInfo); }else { SystemInfo systemInfo = new SystemInfo(); BeanUtils.copyProperties(systemInfoDto, systemInfo); return systemInfoManager.save(systemInfo); } } @Override public SystemInfoDto selectById(Long id) { SystemInfo systemInfo = systemInfoManager.selectById(id); SystemInfoDto systemInfoDto = new SystemInfoDto(); BeanUtils.copyProperties(systemInfo, systemInfoDto); return systemInfoDto; } @Override public SystemInfoDto selectByCompanyId(Long companyId) { SystemInfo systemInfo = new SystemInfo(); systemInfo.setCompanyId(companyId); systemInfo = systemInfoManager.findList(systemInfo).get(0); SystemInfoDto systemInfoDto = new SystemInfoDto(); BeanUtils.copyProperties(systemInfo, systemInfoDto); return systemInfoDto; } @Override public List<SystemInfoDto> findList(SystemInfoDto systemInfoDto) { SystemInfo systemInfo = new SystemInfo(); BeanUtils.copyProperties(systemInfoDto, systemInfo); List<SystemInfo> systemInfoList = systemInfoManager.findList(systemInfo); List<SystemInfoDto> systemInfoDtoList = new ArrayList<SystemInfoDto>(); for(SystemInfo dto : systemInfoList){ SystemInfoDto respDto = new SystemInfoDto(); BeanUtils.copyProperties(dto, respDto); systemInfoDtoList.add(respDto); } return systemInfoDtoList; } }
[ "zhengyi@fishcredit.net" ]
zhengyi@fishcredit.net
7424063c99d3fcd8eb6f33f7302a602d12655431
09891aaff36ef0db918828a1382041cce1e136e3
/src/main/java/ofx/AdditionalStateTaxWithheldAggregate.java
8e75f9c288028cb01b89244206755939cda21d59
[]
no_license
proyleg/InvestiaGenOFX2_mv
7f01555282b094581ae773421b23b3cae8656723
4d5524717067f66c1bec2d0702fbb8e448588611
refs/heads/master
2021-01-20T03:21:46.991208
2018-12-18T14:48:04
2018-12-18T14:48:04
89,526,447
0
0
null
null
null
null
UTF-8
Java
false
false
3,924
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // 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: 2013.12.12 at 04:58:05 PM EST // package ofx; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * * The OFX element "ADDLSTTAXWHAGG" is of type "AdditionalStateTaxWithheldAggregate" * * * <p>Java class for AdditionalStateTaxWithheldAggregate complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AdditionalStateTaxWithheldAggregate"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="STTAXWH" type="{http://ofx.net/types/2003/04}AmountType"/> * &lt;element name="PAYERSTATE" type="{http://ofx.net/types/2003/04}StateCodeType"/> * &lt;element name="PAYERSTID" type="{http://ofx.net/types/2003/04}IdType" minOccurs="0"/> * &lt;element name="STINCOME" type="{http://ofx.net/types/2003/04}AmountType" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AdditionalStateTaxWithheldAggregate", propOrder = { "sttaxwh", "payerstate", "payerstid", "stincome" }) public class AdditionalStateTaxWithheldAggregate { @XmlElement(name = "STTAXWH", required = true) protected String sttaxwh; @XmlElement(name = "PAYERSTATE", required = true) protected String payerstate; @XmlElement(name = "PAYERSTID") protected String payerstid; @XmlElement(name = "STINCOME") protected String stincome; /** * Gets the value of the sttaxwh property. * * @return * possible object is * {@link String } * */ public String getSTTAXWH() { return sttaxwh; } /** * Sets the value of the sttaxwh property. * * @param value * allowed object is * {@link String } * */ public void setSTTAXWH(String value) { this.sttaxwh = value; } /** * Gets the value of the payerstate property. * * @return * possible object is * {@link String } * */ public String getPAYERSTATE() { return payerstate; } /** * Sets the value of the payerstate property. * * @param value * allowed object is * {@link String } * */ public void setPAYERSTATE(String value) { this.payerstate = value; } /** * Gets the value of the payerstid property. * * @return * possible object is * {@link String } * */ public String getPAYERSTID() { return payerstid; } /** * Sets the value of the payerstid property. * * @param value * allowed object is * {@link String } * */ public void setPAYERSTID(String value) { this.payerstid = value; } /** * Gets the value of the stincome property. * * @return * possible object is * {@link String } * */ public String getSTINCOME() { return stincome; } /** * Sets the value of the stincome property. * * @param value * allowed object is * {@link String } * */ public void setSTINCOME(String value) { this.stincome = value; } }
[ "proy_leg@hotmail.com" ]
proy_leg@hotmail.com
eb9c79623e915e5252c8fa3b32f7e0886e2deee8
84c293e21e0e703d838d9dbe9df42d0d9408c8d8
/app/src/main/java/com/applicationtest/vbr/designtest4/com/vbr/LeaderBoard/LeaderboardData.java
65a59d8f801fb3c5864b5e4fb34707f329b18bac
[]
no_license
vbreddy007/DesignTest4_1
b99db24dfd43c8f7e55cab0703b9c69c567f1c50
17e18d750550c5ba129b176e366ecbc67231ff2f
refs/heads/master
2021-01-23T10:23:11.645193
2017-06-02T07:44:16
2017-06-02T07:44:16
93,058,903
0
0
null
null
null
null
UTF-8
Java
false
false
144
java
package com.applicationtest.vbr.designtest4.com.vbr.LeaderBoard; /** * Created by C5245675 on 4/19/2017. */ public class LeaderboardData { }
[ "vijaya.reddy@sap.com" ]
vijaya.reddy@sap.com
0e672871682af7f91331eedc04e38da6110a5ef2
7db6c08953395ecfbe073cfcf2faf99546f6e048
/java/PrimeChecker.java
e09782234f911732fdf770e3a246bcbced4b3cf8
[]
no_license
hill-giant/HackerRank-Submissions
77f5989db97d7aa86c1fd2c54b89090ff2b9d30f
7b70b954738d65fd0a4994ee2a03245df165afd4
refs/heads/master
2022-12-15T22:48:48.358496
2020-08-30T17:36:13
2020-08-30T17:36:13
105,159,476
0
0
null
null
null
null
UTF-8
Java
false
false
723
java
import static java.lang.System.in; class Prime { public void checkPrime(int... arguments) { for (int i : arguments) { if (i <= 1) continue; else if (i <= 3) System.out.print(i + " "); else if (i % 2 == 0 || i % 3 == 0) continue; int j = 5; boolean provedFalse = false; while (j * j <= i && !provedFalse) { if (i % j == 0 || i % (j + 2) == 0) provedFalse = true; j += 6; } if (!provedFalse && i > 3) System.out.print(i + " "); } System.out.println(); } }
[ "nclowes@beyondtrust.com" ]
nclowes@beyondtrust.com
af06462a432ba1c0008870946646a62266c1dfed
750851c281d23872b9dcbda02b995698f4df1585
/src/main/java/com/cuijing/sundial_dream/web/support/PathVariableNotNullChecker.java
656f6038d10f06321a1db830bfaed6741448774b
[]
no_license
Christina-cui/sundial_dream
9eeb5e08a4d14f3e3d405ae0155d96b251436b6a
095d49728ddbcef7b8d01ffa491fa4fa685e73d6
refs/heads/master
2022-07-13T21:05:56.587155
2020-05-20T10:11:11
2020-05-20T10:11:11
249,300,372
2
0
null
2022-06-17T03:02:56
2020-03-23T00:35:20
JavaScript
UTF-8
Java
false
false
3,734
java
package com.cuijing.sundial_dream.web.support; import com.cuijing.sundial_dream.common.error.Errors; import com.google.common.collect.ImmutableList; import com.google.common.primitives.Shorts; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.data.domain.Persistable; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; import java.lang.reflect.Method; import java.lang.reflect.Parameter; import java.util.Optional; @Slf4j public class PathVariableNotNullChecker implements RestControllerParameterChecker { private final short[] pos; PathVariableNotNullChecker(short[] pos) { this.pos = pos; } @Override public void accept(JoinPoint joinPoint) { for (short i : pos) { if (joinPoint.getArgs()[i] == null) { handlerNullArgs(i, joinPoint); } } } private void handlerNullArgs(short i, JoinPoint jp) { Method method = ((MethodSignature) jp.getSignature()).getMethod(); Parameter parameter = method.getParameters()[i]; if (parameter.isAnnotationPresent(PathVariable.class)) { log.warn( "PathVariable({}) {} {} should not null in {}", parameter.getAnnotation(PathVariable.class).value(), parameter.getType().getSimpleName(), parameter.getName(), method); } else if (parameter.isAnnotationPresent(RequestParam.class)) { log.warn( "RequestParam({}) {} {} should not null in {}", parameter.getAnnotation(RequestParam.class).value(), parameter.getType().getSimpleName(), parameter.getName(), method); } else { log.warn( "Something {} {} should not null in {}", parameter.getType().getSimpleName(), parameter.getName(), method); } throw Errors.notFound().asException(); } @Order(Ordered.HIGHEST_PRECEDENCE) // 判断 null 需要最先处理 public static class Factory implements RestControllerParameterChecker.Factory { public Optional<RestControllerParameterChecker> create(Method method) { // 生成需要检测的位置 ImmutableList.Builder<Short> builder = ImmutableList.builder(); Parameter[] parameters = method.getParameters(); for (int i = 0; i < parameters.length; i++) { Parameter parameter = parameters[i]; if (Persistable.class.isAssignableFrom(parameter.getType())) { if (parameter.isAnnotationPresent(PathVariable.class)) { builder.add((short) i); } else if ( // 如果 RequestParam 为必选, 则也要检查, 否则可能会出现一些不必要的 NPE Optional.ofNullable(parameter.getAnnotation(RequestParam.class)) .map(RequestParam::required) .orElse(false)) { builder.add((short) i); } } } short[] array = Shorts.toArray(builder.build()); if (array.length == 0) { return Optional.empty(); } return Optional.of(new PathVariableNotNullChecker(array)); } } }
[ "cuijing@yikaiye.com" ]
cuijing@yikaiye.com
70b705be1ec30f3c0a0f5d1b050c3aac212b999e
dde804bed2655d40ce4cf4fb65701e652415b7d1
/ebaysdkcore/src/main/java/com/ebay/soap/eBLBaseComponents/MaximumUnpaidItemStrikesDurationDetailsType.java
26e64fab6fbae7bd5b662314bb2416f34b913a40
[]
no_license
mamthal/getItemJava
ceccf4a8bab67bab5e9e8a37d60af095f847de44
d7a1bcc8c7a1f72728973c799973e86c435a6047
refs/heads/master
2016-09-05T23:39:46.495096
2014-04-21T18:19:21
2014-04-21T18:19:21
19,001,704
0
1
null
null
null
null
UTF-8
Java
false
false
4,195
java
package com.ebay.soap.eBLBaseComponents; 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.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; /** * * [Selling] Defined time period for maximum unpaid items. * * * <p>Java class for MaximumUnpaidItemStrikesDurationDetailsType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="MaximumUnpaidItemStrikesDurationDetailsType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Period" type="{urn:ebay:apis:eBLBaseComponents}PeriodCodeType" minOccurs="0"/> * &lt;element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;any/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "MaximumUnpaidItemStrikesDurationDetailsType", propOrder = { "period", "description", "any" }) public class MaximumUnpaidItemStrikesDurationDetailsType implements Serializable { private final static long serialVersionUID = 12343L; @XmlElement(name = "Period") protected PeriodCodeType period; @XmlElement(name = "Description") protected String description; @XmlAnyElement(lax = true) protected List<Object> any; /** * Gets the value of the period property. * * @return * possible object is * {@link PeriodCodeType } * */ public PeriodCodeType getPeriod() { return period; } /** * Sets the value of the period property. * * @param value * allowed object is * {@link PeriodCodeType } * */ public void setPeriod(PeriodCodeType value) { this.period = value; } /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * * * @return * array of * {@link Element } * {@link Object } * */ public Object[] getAny() { if (this.any == null) { return new Object[ 0 ] ; } return ((Object[]) this.any.toArray(new Object[this.any.size()] )); } /** * * * @return * one of * {@link Element } * {@link Object } * */ public Object getAny(int idx) { if (this.any == null) { throw new IndexOutOfBoundsException(); } return this.any.get(idx); } public int getAnyLength() { if (this.any == null) { return 0; } return this.any.size(); } /** * * * @param values * allowed objects are * {@link Element } * {@link Object } * */ public void setAny(Object[] values) { this._getAny().clear(); int len = values.length; for (int i = 0; (i<len); i ++) { this.any.add(values[i]); } } protected List<Object> _getAny() { if (any == null) { any = new ArrayList<Object>(); } return any; } /** * * * @param value * allowed object is * {@link Element } * {@link Object } * */ public Object setAny(int idx, Object value) { return this.any.set(idx, value); } }
[ "mamtha@mamtha-Dell.(none)" ]
mamtha@mamtha-Dell.(none)
570b2098aa11994cf71f3faed5c66dffec51484b
1b26c0e8a7edd769e67ddb5de94e32bd55c15868
/legacy/src/main/java/com/redhat/gps/pathfinder/web/api/security/JwtAuthorizationTokenFilter.java
b30602d3c0e26982dcd1233d889cc8851064b671
[ "Apache-2.0", "CC-BY-SA-4.0" ]
permissive
noelo/pathfinder
23a37ccacf114c8c53bea58cb7963f9e4c2ecf1c
6638050cb0766ee0bc4a02e5970a9c7ff61e15f3
refs/heads/master
2022-07-25T06:38:27.861871
2020-01-20T15:46:12
2020-01-20T15:46:12
116,313,483
0
3
Apache-2.0
2022-05-25T06:53:53
2018-01-04T22:23:03
JavaScript
UTF-8
Java
false
false
6,447
java
package com.redhat.gps.pathfinder.web.api.security; /*- * #%L * Pathfinder * $Id:$ * $HeadURL:$ * %% * Copyright (C) 2018 RedHat * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import java.io.IOException; import java.util.Enumeration; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import io.jsonwebtoken.ExpiredJwtException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; @Component public class JwtAuthorizationTokenFilter extends OncePerRequestFilter { private final Logger logger = LoggerFactory.getLogger(this.getClass()); private final UserDetailsService userDetailsService; private final JwtTokenUtil jwtTokenUtil; private final String tokenHeader; public JwtAuthorizationTokenFilter(UserDetailsService userDetailsService, JwtTokenUtil jwtTokenUtil, /*@Value("${jwt.header}")*/ @Value("Authorization") String tokenHeader) { this.userDetailsService = userDetailsService; this.jwtTokenUtil = jwtTokenUtil; this.tokenHeader = tokenHeader; } @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { logger.debug("processing authentication for '{}'", request.getRequestURL()); // String requestHeader = request.getHeader(tokenHeader); String username = null; String authToken=null; if (authToken==null) authToken = request.getHeader("Authorization"); // if (authToken==null) authToken = request.getHeader("Access-Control-Request-Headers"); if (authToken==null) authToken = request.getParameter("_t"); if (authToken!=null && authToken.startsWith("Bearer ")) authToken=authToken.substring(7); logger.debug("Discovered token: {}", authToken); // if (authToken==null || "".equals(authToken)) // throw new AccessDeniedException("Access is denied"); if (authToken!=null && !"".equals(authToken)){ try { username = jwtTokenUtil.getUsernameFromToken(authToken); } catch (IllegalArgumentException e) { logger.error("an error occured during getting username from token", e); } catch (ExpiredJwtException e) { logger.warn("the token is expired and not valid anymore", e); } }else{ logger.warn("couldn't find bearer string, will ignore the header"); } // if (requestHeader != null && requestHeader.startsWith("Bearer ")) { // authToken = requestHeader.substring(7); // try { // username = jwtTokenUtil.getUsernameFromToken(authToken); // } catch (IllegalArgumentException e) { // logger.error("an error occured during getting username from token", e); // } catch (ExpiredJwtException e) { // logger.warn("the token is expired and not valid anymore", e); // } // } else { // logger.warn("couldn't find bearer string, will ignore the header"); // } logger.debug("checking authentication for user '{}'", username); // logger.debug("XXXXXXXXXXXXXXXX "+SecurityContextHolder.getContext().getAuthentication().getName()); // if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) { boolean wasNull=SecurityContextHolder.getContext().getAuthentication() == null; boolean wasAnon=!wasNull?SecurityContextHolder.getContext().getAuthentication().getName().equals("anonymousUser"):false; if (username != null && (wasNull || wasAnon)) { logger.debug("security context was "+(wasNull?"null":"anonymous")+", so authorizing user"); // logger.debug("XXXXXXXX userdetailsservice="+this.userDetailsService); // It is not compelling necessary to load the use details from the database. You could also store the information // in the token and read it from it. It's up to you ;) UserDetails userDetails = this.userDetailsService.loadUserByUsername(username); logger.debug("userdetails found for "+username+" = "+userDetails); // For simple validation it is completely sufficient to just check the token integrity. You don't have to call // the database compellingly. Again it's up to you ;) if (jwtTokenUtil.validateToken(authToken, userDetails)) { UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities()); authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); logger.info("authorized user '{}', setting security context", username); SecurityContextHolder.getContext().setAuthentication(authentication); }else{ logger.debug("XXXXXXXX jwt token was NOT valid"); } } chain.doFilter(request, response); } }
[ "mallen@redhat.com" ]
mallen@redhat.com
20bf2b02c77e56048551b0ac3c30d3ed7226855c
2776e1e5b618d0c340bf839af61e8577eed9d8c5
/practice/app/build/generated/source/buildConfig/androidTest/debug/com/example/practice/test/BuildConfig.java
91780e9fbd105a46d2380fb404d7a91329a34d94
[]
no_license
Njeri1/quiz2
6d702f5f2f9116eac5d0102df46edc34af08e0a5
f27bfd4d0ac0ff0a7ae50cc5b19e0efed1df98ea
refs/heads/master
2022-07-30T10:46:34.661695
2020-05-24T10:16:35
2020-05-24T10:16:35
266,515,472
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
/** * Automatically generated file. DO NOT MODIFY */ package com.example.practice.test; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.example.practice.test"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
[ "noreply@github.com" ]
Njeri1.noreply@github.com
0acd4365192ee7285133dc726cd179e1c02d0e89
b279411b813073465f93ac5ddda027282be6add0
/PopupWindow/app/src/test/java/com/example/cheruixi/popupwindow/ExampleUnitTest.java
c69b0f53d6bb9289581b54c58802f26809f6d082
[]
no_license
jessechen0319/android_study
b9dc6f32ea1102556d05bf3737720c745ac44536
6b48fd766c55de96eec7452be6d1f6235a8a98f6
refs/heads/master
2018-12-19T16:14:24.448229
2018-09-22T12:15:58
2018-09-22T12:15:58
118,436,750
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package com.example.cheruixi.popupwindow; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "xiang19890319@gmail.com" ]
xiang19890319@gmail.com
e354d29421a2f55756bd8b702935390c0c07f7be
20da1db09d18d156ae9edbd90e5e81e9d725b495
/src/main/java/com/sjm/domain/BlogSetting.java
89256d26e3f754817d332dce3e4cda6c26bc9c9f
[]
no_license
sonkabin/umi
fb13bc64c8c497297e8d3c48cecf99780b5568b5
38b7139bac5be4d753b497e0a885e8abf4240c95
refs/heads/master
2020-03-18T19:34:50.869565
2018-05-29T08:41:13
2018-05-29T08:41:13
131,977,650
0
0
null
null
null
null
UTF-8
Java
false
false
832
java
package com.sjm.domain; public class BlogSetting { private Integer id; private String title; private String description; private String notice; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title == null ? null : title.trim(); } public String getDescription() { return description; } public void setDescription(String description) { this.description = description == null ? null : description.trim(); } public String getNotice() { return notice; } public void setNotice(String notice) { this.notice = notice == null ? null : notice.trim(); } }
[ "1014066814@qq.com" ]
1014066814@qq.com
edd2f759acb9eea5b97320f30ba39e1d4b8afb59
dd34da5374ef0079d458aa63f15c591d8ed3a052
/src/com/qkj/manage/domain/Active.java
866cd63df4bf596562760a2ed74af7c464ea315d
[]
no_license
kreocn/qkjebiz
0fd53600c99d4d054747f873e21f5fe8262f6d3a
749d4d118cd31860568ff2db872ed79099007875
refs/heads/master
2021-01-17T01:15:36.173750
2014-07-14T09:02:00
2014-07-14T09:02:00
21,596,226
1
0
null
2016-05-30T06:06:34
2014-07-08T02:56:02
JavaScript
UTF-8
Java
false
false
12,239
java
package com.qkj.manage.domain; import java.util.Date; public class Active { private String uuid;// (varchar)申请编号 private String apply_dept;// (varchar)申请部门 private String apply_user;// (varchar)申请人 private String theme;// (varchar)主题 private String purpose;// (varchar)目的 private Date plan_start;// (date)计划开始时间 private Date plan_end;// (date)计划结束时间 private String address;// (varchar)活动地点 private String person;// (varchar)执行人 private Double it_price;// 公司合计费用 private Double mt_price;// 经销商合计费用 private String note;// (text)方案说明 private String expect;// (varchar)活动预期 private Integer status;// (int)申请单状态 0:新申请 1:申请审批中 2:申请通过 3:开始结案 4:结案审批中 // 5:结案通过 // (int)销售部-审核状态 0:初始状态 5:审核退回 10:待审核 20:办事处经理审核通过 30:大区经理审核通过 40:运营总监审核通过 // 50:业务副总审核通过 60:总经理审核通过 private Integer sd_status; private Date sd_time;// (datetime)销售部审核状态最后操作时间 private Integer smd_status;// (int)销售管理部-审核状态 0:未签收 5:审核退回 10:已签收 20:主管已审 // 30:经理已审 40:销管部经理已审 50:副总已审 private Date smd_time;// (datetime)销售管理部审核状态最后操作时间 private String add_user;// (varchar)添加人 private Date add_time;// (datetime)添加时间 private String lm_user;// (varchar)修改人 private Date lm_time;// (timestamp)修改时间 private Date close_start;// 开始结案日期 private String close_note;// 活动概况 private Integer close_sd_status;// 销售部-审核状态 0:不能审核 1:审核不通过 2:审核通过 private Date close_sd_time;// 销售部审核状态最后操作时间 private Integer close_smd_status;// 销售管理部-审核状态 0:不能审核 1:审核不通过 2:审核通过 private Date close_smd_time;// 销售管理部审核状态最后操作时间 private Double close_it_price;// 公司合计费用 private Double close_mt_price;// 经销商合计费用 private String remark; // 备注 private String sd_user;// 最后销售部审核人 private String smd_user;// 最后销管部审核人 private String close_sd_user;// 最后销售部审核人 private String close_smd_user;// 最后销管部审核人 private Date pass_time; // 申请通过时间 private Date close_pass_time; // 结案通过时间 private Integer ship_status;// 发货状态 private Integer ship_ware;// 发货仓库 private Date ship_date;// 发货时间 private String ship_no;// 运单号码 private String ship_type;// 物流名称 private String ship_phone;// 物流单号 // 非数据库字段 private String apply_dept_name; private String apply_user_name; private String sd_user_name; private String smd_user_name; private String close_sd_user_name; private String close_smd_user_name; private String sd_user_sign; private String smd_user_sign; private String close_sd_user_sign; private String close_smd_user_sign; // 查询使用字段 private String is_sub_dept; private Date plan_start_begin; private Date plan_start_end; private Date pass_time_start; private Date pass_time_end; private Date close_pass_time_start; private Date close_pass_time_end; public String getShip_type() { return ship_type; } public void setShip_type(String ship_type) { this.ship_type = ship_type; } public Integer getShip_status() { return ship_status; } public void setShip_status(Integer ship_status) { this.ship_status = ship_status; } public Integer getShip_ware() { return ship_ware; } public void setShip_ware(Integer ship_ware) { this.ship_ware = ship_ware; } public Date getShip_date() { return ship_date; } public void setShip_date(Date ship_date) { this.ship_date = ship_date; } public String getShip_no() { return ship_no; } public void setShip_no(String ship_no) { this.ship_no = ship_no; } public String getShip_phone() { return ship_phone; } public void setShip_phone(String ship_phone) { this.ship_phone = ship_phone; } public String getIs_sub_dept() { return is_sub_dept; } public void setIs_sub_dept(String is_sub_dept) { this.is_sub_dept = is_sub_dept; } public Date getPass_time_start() { return pass_time_start; } public void setPass_time_start(Date pass_time_start) { this.pass_time_start = pass_time_start; } public Date getPass_time_end() { return pass_time_end; } public void setPass_time_end(Date pass_time_end) { this.pass_time_end = pass_time_end; } public Date getClose_pass_time_start() { return close_pass_time_start; } public void setClose_pass_time_start(Date close_pass_time_start) { this.close_pass_time_start = close_pass_time_start; } public Date getClose_pass_time_end() { return close_pass_time_end; } public void setClose_pass_time_end(Date close_pass_time_end) { this.close_pass_time_end = close_pass_time_end; } public Date getPass_time() { return pass_time; } public void setPass_time(Date pass_time) { this.pass_time = pass_time; } public Date getClose_pass_time() { return close_pass_time; } public void setClose_pass_time(Date close_pass_time) { this.close_pass_time = close_pass_time; } public String getClose_sd_user_sign() { return close_sd_user_sign; } public void setClose_sd_user_sign(String close_sd_user_sign) { this.close_sd_user_sign = close_sd_user_sign; } public String getClose_smd_user_sign() { return close_smd_user_sign; } public void setClose_smd_user_sign(String close_smd_user_sign) { this.close_smd_user_sign = close_smd_user_sign; } public String getSd_user_sign() { return sd_user_sign; } public void setSd_user_sign(String sd_user_sign) { this.sd_user_sign = sd_user_sign; } public String getSmd_user_sign() { return smd_user_sign; } public void setSmd_user_sign(String smd_user_sign) { this.smd_user_sign = smd_user_sign; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public String getApply_dept() { return apply_dept; } public void setApply_dept(String apply_dept) { this.apply_dept = apply_dept; } public String getApply_user() { return apply_user; } public void setApply_user(String apply_user) { this.apply_user = apply_user; } public String getTheme() { return theme; } public void setTheme(String theme) { this.theme = theme; } public String getPurpose() { return purpose; } public void setPurpose(String purpose) { this.purpose = purpose; } public Date getPlan_start() { return plan_start; } public void setPlan_start(Date plan_start) { this.plan_start = plan_start; } public Date getPlan_end() { return plan_end; } public void setPlan_end(Date plan_end) { this.plan_end = plan_end; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getPerson() { return person; } public void setPerson(String person) { this.person = person; } public Double getIt_price() { return it_price; } public void setIt_price(Double it_price) { this.it_price = it_price; } public Double getMt_price() { return mt_price; } public void setMt_price(Double mt_price) { this.mt_price = mt_price; } public String getNote() { return note; } public void setNote(String note) { this.note = note; } public String getExpect() { return expect; } public void setExpect(String expect) { this.expect = expect; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Integer getSd_status() { return sd_status; } public void setSd_status(Integer sd_status) { this.sd_status = sd_status; } public Date getSd_time() { return sd_time; } public void setSd_time(Date sd_time) { this.sd_time = sd_time; } public Integer getSmd_status() { return smd_status; } public void setSmd_status(Integer smd_status) { this.smd_status = smd_status; } public Date getSmd_time() { return smd_time; } public void setSmd_time(Date smd_time) { this.smd_time = smd_time; } public String getAdd_user() { return add_user; } public void setAdd_user(String add_user) { this.add_user = add_user; } public Date getAdd_time() { return add_time; } public void setAdd_time(Date add_time) { this.add_time = add_time; } public String getLm_user() { return lm_user; } public void setLm_user(String lm_user) { this.lm_user = lm_user; } public Date getLm_time() { return lm_time; } public void setLm_time(Date lm_time) { this.lm_time = lm_time; } public Date getClose_start() { return close_start; } public void setClose_start(Date close_start) { this.close_start = close_start; } public String getClose_note() { return close_note; } public void setClose_note(String close_note) { this.close_note = close_note; } public Integer getClose_sd_status() { return close_sd_status; } public void setClose_sd_status(Integer close_sd_status) { this.close_sd_status = close_sd_status; } public Date getClose_sd_time() { return close_sd_time; } public void setClose_sd_time(Date close_sd_time) { this.close_sd_time = close_sd_time; } public Integer getClose_smd_status() { return close_smd_status; } public void setClose_smd_status(Integer close_smd_status) { this.close_smd_status = close_smd_status; } public Date getClose_smd_time() { return close_smd_time; } public void setClose_smd_time(Date close_smd_time) { this.close_smd_time = close_smd_time; } public Double getClose_it_price() { return close_it_price; } public void setClose_it_price(Double close_it_price) { this.close_it_price = close_it_price; } public Double getClose_mt_price() { return close_mt_price; } public void setClose_mt_price(Double close_mt_price) { this.close_mt_price = close_mt_price; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getSd_user() { return sd_user; } public void setSd_user(String sd_user) { this.sd_user = sd_user; } public String getSmd_user() { return smd_user; } public void setSmd_user(String smd_user) { this.smd_user = smd_user; } public String getClose_sd_user() { return close_sd_user; } public void setClose_sd_user(String close_sd_user) { this.close_sd_user = close_sd_user; } public String getClose_smd_user() { return close_smd_user; } public void setClose_smd_user(String close_smd_user) { this.close_smd_user = close_smd_user; } public String getApply_dept_name() { return apply_dept_name; } public void setApply_dept_name(String apply_dept_name) { this.apply_dept_name = apply_dept_name; } public String getApply_user_name() { return apply_user_name; } public void setApply_user_name(String apply_user_name) { this.apply_user_name = apply_user_name; } public String getSd_user_name() { return sd_user_name; } public void setSd_user_name(String sd_user_name) { this.sd_user_name = sd_user_name; } public String getSmd_user_name() { return smd_user_name; } public void setSmd_user_name(String smd_user_name) { this.smd_user_name = smd_user_name; } public String getClose_sd_user_name() { return close_sd_user_name; } public void setClose_sd_user_name(String close_sd_user_name) { this.close_sd_user_name = close_sd_user_name; } public String getClose_smd_user_name() { return close_smd_user_name; } public void setClose_smd_user_name(String close_smd_user_name) { this.close_smd_user_name = close_smd_user_name; } public Date getPlan_start_begin() { return plan_start_begin; } public void setPlan_start_begin(Date plan_start_begin) { this.plan_start_begin = plan_start_begin; } public Date getPlan_start_end() { return plan_start_end; } public void setPlan_start_end(Date plan_start_end) { this.plan_start_end = plan_start_end; } }
[ "kreo@qq.com" ]
kreo@qq.com
0bb3bffecfc4ef6aeea6e82a8821bcf4638deed2
39bef83f3a903f49344b907870feb10a3302e6e4
/Android Studio Projects/bf.io.openshop/src/bf/io/openshop/ux/fragments/OrderCreateFragment$6.java
2108ef4fd5384c2dc7530f908291a98141cda037
[]
no_license
Killaker/Android
456acf38bc79030aff7610f5b7f5c1334a49f334
52a1a709a80778ec11b42dfe9dc1a4e755593812
refs/heads/master
2021-08-19T06:20:26.551947
2017-11-24T22:27:19
2017-11-24T22:27:19
111,960,738
0
0
null
null
null
null
UTF-8
Java
false
false
846
java
package bf.io.openshop.ux.fragments; import com.android.volley.*; import timber.log.*; import bf.io.openshop.utils.*; import android.app.*; import bf.io.openshop.ux.*; class OrderCreateFragment$6 implements ErrorListener { @Override public void onErrorResponse(final VolleyError volleyError) { if (OrderCreateFragment.access$1800(OrderCreateFragment.this) != null) { OrderCreateFragment.access$1800(OrderCreateFragment.this).cancel(); } Timber.e("Get request cart error: " + volleyError.getMessage(), new Object[0]); MsgUtils.logAndShowErrorMessage(OrderCreateFragment.this.getActivity(), volleyError); if (OrderCreateFragment.this.getActivity() instanceof MainActivity) { ((MainActivity)OrderCreateFragment.this.getActivity()).onDrawerBannersSelected(); } } }
[ "ema1986ct@gmail.com" ]
ema1986ct@gmail.com
ce38033452f89e3183e10b565ca7d8436113481a
36527153721d9549ac7ab77d5c92b1f7a9ecc7da
/app/src/main/java/com/example/player/adapters/HomeAdapter.java
eeb702f5d311b26f7f102a819aa46c3d099a16fb
[]
no_license
davidking892/videoPlayer
5094e75c825aee1204d7a67a11e46b7790c7fdbf
3e6033dad3251a1752370709fd1002e441b768e0
refs/heads/master
2023-03-20T16:08:41.706687
2021-03-13T05:14:28
2021-03-13T05:14:28
347,255,685
0
0
null
null
null
null
UTF-8
Java
false
false
1,387
java
package com.example.player.adapters; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentPagerAdapter; import com.example.player.R; import com.example.player.fragments.AlbumFragment; import com.example.player.fragments.ArtistFragment; import com.example.player.fragments.SongFragment; public class HomeAdapter extends FragmentPagerAdapter { private String tabTitle[] ={"Songs","Album","Artist"}; public HomeAdapter(FragmentManager fragmentManager) { super(fragmentManager); } @NonNull @Override public Fragment getItem(int position) { Fragment fragment=null; switch (position){ case 0: return new SongFragment(); case 1: return new AlbumFragment(); case 2: return new ArtistFragment(); default: return new SongFragment(); } } @Override public int getCount() { return tabTitle.length; } @Nullable @Override public CharSequence getPageTitle(int position) { return tabTitle[position]; } }
[ "krpawan0330@gmail.com" ]
krpawan0330@gmail.com
fd5a8055987b224fbdb199c48d6583c48248fb9c
ef92c886230431081e77b67510fe697f284e1142
/SCAR-JAVA/src/FileSplitter.java
e411b7ee7b5d16c4e9de8603b2a32de3beb7d31a
[]
no_license
guh6/SCAR-ANDROID
63cd1ca4cf4e6c9714ec0a45721b0c830884035b
6ed77bd16e52fc9df50f75a43f6882869d3d865a
refs/heads/master
2021-01-10T20:04:15.924886
2014-04-18T04:50:58
2014-04-18T04:50:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,373
java
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.Scanner; import org.jlinalg.IRingElement; import org.jlinalg.IRingElementFactory; import org.jlinalg.Matrix; import org.jlinalg.RingElement; import org.jlinalg.Vector; import org.jlinalg.complex.Complex; import org.jlinalg.field_p.FieldP; import org.jlinalg.field_p.FieldPFactoryMap; public class FileSplitter { String file_name; int k, f; FileSplitter(String file_name, int k, int f) { this.file_name = file_name; this.k = k; this.f = f; } public void fileToByteArray() throws IOException { File file; byte [] byte_arr = null; long step, padding; long file_size = 0; FileInputStream fstream; InputStream inputStream = null; try { //take file name for reading file = new File(this.file_name); file_size = file.length(); fstream = new FileInputStream(this.file_name); inputStream = fstream; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } //System.out.println(file_size); step = file_size/k; step = step + 1; byte[] buffer = new byte[(int) (step*k)]; int read = inputStream.read(buffer, 0, (int) file_size); if(read <= 0) { System.out.println("ERROR READ"); System.exit(0); } padding = (step * k) - file_size; for(int i = 0; i < padding; i++) { buffer[i] = 0; } //send byte array to create Data Matrix FiniteFilledMatrix(buffer, this.k); } @SuppressWarnings({ "rawtypes", "unchecked" }) private void FiniteFilledMatrix(byte[] byte_arr, int num_rows) { //get byte buffer and turn it into Finite Filled matrix IRingElement[] theEntries = new IRingElement[byte_arr.length]; IRingElementFactory elements = FieldPFactoryMap.getFactory(new Long(257)); for(int i = 0; i < byte_arr.length; i++) { theEntries[i] = elements.get((int)byte_arr[i]); } //System.out.println(theEntries.toString()); //System.out.println("byte arr entry = " + byte_arr[0]); //System.out.println("entry arr = " +theEntries[0]); Matrix data_Matrix = new Matrix(theEntries, num_rows); Matrix encoding_Matrix = makeEncodingMatrix(this.k, this.f); Matrix final_Matrix = encoding_Matrix.multiply(data_Matrix); System.out.println(final_Matrix.toString()); //store this matrix StoreData(final_Matrix, this.f); } @SuppressWarnings("unchecked") private Matrix makeEncodingMatrix(int k, int f) { //this function makes the encoding matrix Vector[] a = new Vector[(f-k)]; IRingElementFactory elements = FieldPFactoryMap.getFactory(new Long(257)); for(int i = 0; i < f-k; i++) { IRingElement[] theEntries = new IRingElement[k]; for(int j = 0; j < k; j++) { theEntries[j] = this.power(this.power(elements.get(2), elements.get(f).subtract(elements.get(k)).add(elements.get(i))), elements.get(j)); } a[i] = new Vector(theEntries); //System.out.println(a.toString()); } Vector [] b = new Vector[k]; for ( int i = 0; i < k; i++) { IRingElement[] theEntries = new IRingElement[k]; for ( int j = 0; j < k; j++) { if( (i == 0) && (j == 0) ) { theEntries[j] = elements.get(1); } else if ( i == 0 ) { theEntries[j] = elements.get(0); } else { theEntries[j] = this.power(this.power(elements.get(2), elements.get(i).subtract(elements.get(1))), elements.get(j)); } } b[i] = new Vector(theEntries); } Matrix A_Matrix = new Matrix(a); Matrix B_Matrix = new Matrix(b); Matrix C_Matrix = A_Matrix.multiply(B_Matrix.inverse()); Vector[] d = new Vector[f]; for(int i = 0; i < k; i++) { IRingElement[] theEntries = new IRingElement[k]; for( int j = 0; j < k; j++) { if(i == j) { theEntries[j] = elements.get(1); } else { theEntries[j] = elements.get(0); } } d[i] = new Vector(theEntries); } for(int i = k; i < f; i++) { IRingElement[] theEntries = new IRingElement[k]; for(int j = 0; j < k; j++) { theEntries[j] = C_Matrix.get((i-k)+1, (j + 1)); } d[i] = new Vector(theEntries); } Matrix D_Matrix = new Matrix(d); //D matrix is the encoded matrix return D_Matrix; } @SuppressWarnings("unchecked") private IRingElement power(IRingElement x, IRingElement n) { IRingElementFactory elements = FieldPFactoryMap.getFactory(new Long(257)); IRingElement return_elem = x; if(n.compareTo(elements.get(0)) == 0) { return elements.get(1); } for(int i = 1; n.compareTo(elements.get(i)) > 0; i++) { return_elem = return_elem.multiply(x); } return return_elem; } /** * @description takes in a matrix that is stored into the server using f splits * @param final_Matrix * @param f */ private void StoreData( Matrix final_Matrix, int f){ System.out.println("===== In StoreData ====="); System.out.println("storing data with rows: "+final_Matrix.getRows()); /* * Establishing server connection */ JedisDriver jstore = new JedisDriver("ra.cs.pitt.edu",8084, "username", "password"); System.out.println(jstore); // Checking if connection is good. String _KEY = "KEY-"; String _DATA = ""; /* * Storing data into server with _KEY, _DATA */ System.out.println("\n=============== Storage ==============="); System.out.println("How many rows in matrix? " +final_Matrix.getRows()); for(int i = 0; i < f ; i++ ){ _DATA = final_Matrix.getRow(i+1).toString(); storeRow(_KEY + (i+1) +"", _DATA , jstore ); // parameters - key, value, server } System.out.println("\n=============== Retrieval ==============="); /* * Retrieving the data from server */ String _DATABACK; Vector[] _VECTORS = new Vector[f]; for(int i = 0; i < f ; i++ ){ _DATABACK = (getRow(_KEY + (i+1) +"",jstore)); // Raw data back from the server. Now I want to convert the String into a matrix? //System.out.println(_DATABACK); _VECTORS[i] = toVector(_DATABACK); //System.out.println("Constructed vector: "+toVector(_DATABACK)); } /* * Now Constructing the Matrix from the Vector[] */ Matrix<?> serverMatrix = new Matrix(_VECTORS); System.out.println("server Matrix: " +serverMatrix); } /** * @description stores the key and value into the server. This is String, String based. Can be byte[] , byte[]. * @param key * @param value * @param server */ private void storeRow(String key, String value, JedisDriver server){ System.out.println("==== in storeRow ===="); try { server.store(key, value ); } catch (Exception e) { e.printStackTrace(); } } /** * @description returns the data as a string with key and server params * @param key * @param server * @return */ private String getRow(String key, JedisDriver server){ System.out.println("==== in getRow ===="); String _DATABACK=""; try{ _DATABACK =server.getValue(key); }catch(Exception e){ } return _DATABACK; } private Vector toVector(String _CONTENT){ System.out.println("==== in toVector ===="); /* * Doing string splits because of the data is returned as a string */ if(_CONTENT == null){ //No result is found from the server! return null; } else{ _CONTENT = _CONTENT.replaceAll("\\(" , "").replaceAll("\\(", ""); // Getting rid of parenthesis String[] _CONTENT_SPLITS = _CONTENT.split(", "); // Splitting the data with commas //System.out.println(_CONTENT_SPLITS.length); int[] vectorData = new int[_CONTENT_SPLITS.length]; // This contains the data for the vector for(int i = 0; i < _CONTENT_SPLITS.length; i++){ String[] _M_SPLITS = _CONTENT_SPLITS[i].split("m"); // Splitting between xxmxx int _VALUE = Integer.parseInt(_M_SPLITS[0]); vectorData[i] = _VALUE; // adding the value into vectorData } /* for( int num : vectorData) System.out.print(num +" "); */ /* * Now doing the Vector conversion */ IRingElement[] theEntries = new IRingElement[vectorData.length]; IRingElementFactory elements = FieldPFactoryMap.getFactory(new Long(257)); for(int i = 0; i < vectorData.length; i++) { theEntries[i] = elements.get((int)vectorData[i]); } Vector <?> vector = new Vector(theEntries); return vector; } } }
[ "hashmapset@gmail.com" ]
hashmapset@gmail.com
019771fd93f848e1fe11f5c5d2198f8637154dd4
5a83e59c61e5289fad245f37fd1e544be6cc7fc5
/BoardVer1/src/main/java/test/Tlist.java
e4bcaa460e3b41a1125dd53cd88bbb5bcf2533e3
[]
no_license
jincheol2578/board
da9d9ab750c3f9b4e9fe24cbb91be1cbe4e7453f
cccbff1143dc55d7b4ae77d6c9fd5f260c561d60
refs/heads/master
2023-05-09T06:11:32.864556
2021-05-28T07:05:30
2021-05-28T07:05:30
362,734,350
0
0
null
null
null
null
UTF-8
Java
false
false
761
java
package test; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/Tlist") public class Tlist extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String url = "WEB-INF/jsp/Tlist.jsp"; request.getRequestDispatcher(url).forward(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
[ "jincheol2578@gmail.com" ]
jincheol2578@gmail.com
9f2d406a37e254e0223c7b082f8ae3b344cb29b0
d9dbf047509fc894a729e8f691ba794e8cf45253
/highlightTextInTimeLibrary/build/generated/source/buildConfig/androidTest/debug/github/com/highlitetextintime/test/BuildConfig.java
eb9eaf041c27a2414639ab6ceeadaf6f38fbeddd
[]
no_license
mlevytskiy/HighlightTextInTime
64bbc6dc8b0211ae39491696198612b987880f8f
ff293968ff0648ea4c070dfd5bc4ccbb5453c211
refs/heads/master
2021-01-10T06:06:53.298804
2015-10-19T10:28:22
2015-10-19T10:28:22
44,527,381
0
0
null
null
null
null
UTF-8
Java
false
false
475
java
/** * Automatically generated file. DO NOT MODIFY */ package github.com.highlitetextintime.test; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "github.com.highlitetextintime.test"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
[ "m.levytskiy@gmail.com" ]
m.levytskiy@gmail.com
42abd2b2aac35207591bcef6aea62373624c9031
456a1f09f154418ee3b01a22bf12cfaaa71ee9d3
/sinekarta-ds-patched-repo/src/main/java/org/sinekartads/exception/InvalidPinException.java
0b14dfae59b816041321dd95374e03a5966001ea
[]
no_license
p4535992/sinekarta
61809173b2401d798c84f974b1c243c25f6ca0fd
3c609d3f755284ef7587f13da4a2360b2e467e9b
refs/heads/master
2021-07-14T06:38:31.369837
2020-05-07T08:22:43
2020-05-07T08:22:43
131,575,109
0
0
null
2018-04-30T09:01:39
2018-04-30T09:01:38
null
UTF-8
Java
false
false
1,149
java
/* * Copyright (C) 2014 - 2015 Jenia Software. * * This file is part of Sinekarta-ds * * Sinekarta-ds is Open SOurce Software: you can redistribute it and/or modify * it 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.sinekartads.exception; public class InvalidPinException extends SmartCardAccessException { private static final long serialVersionUID = 1L; public InvalidPinException() { } public InvalidPinException(String message, Throwable cause) { super(message, cause); } public InvalidPinException(String message) { super(message); } public InvalidPinException(Throwable cause) { super(cause); } }
[ "tentimarco0@gmail.com" ]
tentimarco0@gmail.com