blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M โ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
47614a597372fcb5daa234f939a686c7a77e7630 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module1662/src/java/module1662/a/IFoo2.java | 22f1b5fc6d00be04af7587b0b8e296aef2712fc4 | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 853 | java | package module1662.a;
import javax.net.ssl.*;
import javax.rmi.ssl.*;
import java.awt.datatransfer.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see javax.management.Attribute
* @see javax.naming.directory.DirContext
* @see javax.net.ssl.ExtendedSSLSession
*/
@SuppressWarnings("all")
public interface IFoo2<K> extends module1662.a.IFoo0<K> {
javax.rmi.ssl.SslRMIClientSocketFactory f0 = null;
java.awt.datatransfer.DataFlavor f1 = null;
java.beans.beancontext.BeanContext f2 = null;
String getName();
void setName(String s);
K get();
void set(K e);
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
77e6690002c243026369399c8b28ec25e7378d3d | 102dfa93471425080cee5fcf179fb67591a3e6e1 | /submissions/lab9/tizikally_89966_2114386_Stat.java | 980c9919f29a4d6676dda23ce39027e2139c39c8 | [] | no_license | Walter-Shaffer/1061-TA-F17 | 53646db8836b8051d876de2ca0a268f242c0905a | dc1ff702af73f4feba004de539a36b145560913b | refs/heads/master | 2021-08-28T20:32:14.175756 | 2017-12-13T04:17:36 | 2017-12-13T04:17:36 | 103,681,473 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,637 | java | /* Stat.Java
* Author: Allison Tizik
* Submission Date: 10/26/17
* Purpose: The program recieves the data. After getting the
* data as an array it converts it to a string. In string format
* it prints it in a more readable format. It then runs it through
* the average, min, max, and mode methods and reports those. Finally
* it runs it through the equals method and returns true or false
* depending on if the arrays are equal to each other.
*
* Statement of Academic Honesty:
*
* The following code represents my own work. I have neither
* received nor given inappropriate assistance. I have not copied
* or modified code from any source other than the course webpage
* or the course textbook. I recognize that any unauthorized
* assistance or plagiarism will be handled in accordance
* with the policies at Clemson University and the
* policies of this course. I recognize that my work is based
* on an assignment created by the School of Computing
* at Clemson University. Any publishing or posting
* of source code for this project is strictly prohibited
* unless you have written consent from the instructor.
*/
public class Stat {
private double [] data;
// default constructor
public Stat(){
double [] dataArray = {0.0};
this.data = dataArray;
}
// constructs stat object holding the d values in a array
public Stat(double[] d){
double [] data = new double [d.length];
data = d;
this.data = data;
}
//accessor to the data
public double[] getData(){
return data;
}
//mutator to set data to different variable
public void setData(double[] d){
d = data;
}
//if the stat object and the past stat object have the same values returns true
public boolean equals(Stat s) {
boolean isFalse = false;
boolean isEqual = false;
if(this.data.length == s.data.length){
for(int i = 0; i < data.length; i++){
if(this.data[i] != s.data[i]){
isFalse = true;;
}
}
if(isFalse != true){
isEqual = true;
}
}
return isEqual;
}
// string representation of the data
public String toString(){
String dataString = null;
for(int i =0; i<this.data.length; i++){
if (i==0){
dataString = "[";
}
if (i != 0){
dataString += ", ";
}
dataString += this.data[i];
}
dataString += "]";
return(dataString);
}
//returns the min number from the array
public double min(){
double result = data [0];
for (int i = 0; i<data.length; i++){
if (data[i]< result)
result = data[i];
}
return result;
}
//returns the max number from the array
public double max(){
double result = data [0];
for (int i = 0; i<data.length; i++){
if (data[i]>result)
result = data[i];
}
return result;
}
// returns the average of the array
public double average(){
double average;
double sum = 0;
for (int i = 0; i<data.length; i++){
sum+= data[i];
}
average = sum/data.length;
return average;
}
//returns the mode of the number that shows up the most
public double mode(){
double maxValue = 0;
double maxCount = data.length;
for (int i = 0; i < data.length; ++i) {
int count = 0;
for (int j = 0; j < data.length; ++j) {
if (data[j] == data[i]) ++count;
}
if (count > maxValue) {
maxCount = count;
maxValue = this.data[i];
}else if ((count == maxCount) && (maxValue != data[i])){
maxValue = Double.NaN;
}
}
return maxValue;
}
}
| [
"lorenzo.barberis.canonico@gmail.com"
] | lorenzo.barberis.canonico@gmail.com |
add81f871ae52ead0a0e019dc9f3b28f0b694366 | 5733e1bd0ec3fda8ca53ceda00e22dbc96bb32a0 | /homeWork36/src/main/java/it/step/example/Department.java | 5c0867abb2c41bd6156b758718ec9fb95ee3452a | [] | no_license | fogg-ai/javahw | 178be792bbfc48ffd651fffe8796eb64fab97c9d | 30b38e993e81ba95a1c432298fb25c1a80050c92 | refs/heads/master | 2022-12-27T05:50:12.547736 | 2019-11-19T14:37:04 | 2019-11-19T14:37:04 | 211,465,580 | 0 | 0 | null | 2020-10-13T17:34:29 | 2019-09-28T07:59:52 | HTML | UTF-8 | Java | false | false | 716 | java | package it.step.example;
// ะัะพััะพะน ะพัะดะตะป, ะบะพัะพััะน ะฝะต ะผะพะถะตั ะฒะบะปััะฐัั ะดััะณะธะต ะฟะพะดัะฐะทะดะตะปะตะฝะธะต
public class Department extends Unit {
public Department(String name) {
super(name);
}
@Override
public String report() {
return String.format("ะััะตั ะดะปั ะพัะดะตะปะฐ: %s\n", getName());
}
@Override
public void add(Unit unit) {
throw new RuntimeException("ะัะดะตะป ะฝะต ะผะพะถะตั ะฒะบะปััะฐัั ะฟะพะดัะฐะทะดะตะปะตะฝะธั!");
}
@Override
public Unit getUnit(String name) {
throw new RuntimeException("ะัะดะตะป ะฝะต ะผะพะถะตั ะฒะบะปััะฐัั ะฟะพะดัะฐะทะดะตะปะตะฝะธั!");
}
} | [
"maxshaptala@gmail.com"
] | maxshaptala@gmail.com |
6acbb702018891410fd1ae82d935556f20f5d885 | 3a72909001b57b37adfe6ea56781cff4bc6b41d0 | /video-app/src/main/java/org/lilacseeking/video/videoapp/Utils/HttpClientPoolManager.java | c81f2c84e684ab37d6a67eeda5cacf506517fe57 | [] | no_license | lilacseeking/Qian-WebResource | a52c1220d8b3472c5d4eeb962c77cffb13fc185c | 51d4a160d425821cd75139934e6e593a67e16b69 | refs/heads/master | 2021-06-03T00:04:06.871166 | 2020-04-03T09:07:30 | 2020-04-03T09:07:30 | 167,934,294 | 5 | 1 | null | 2019-05-07T14:20:08 | 2019-01-28T09:25:59 | Java | UTF-8 | Java | false | false | 2,954 | java | package org.lilacseeking.video.videoapp.Utils;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContextBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.SSLContext;
public class HttpClientPoolManager {
private static final Logger logger = LoggerFactory.getLogger(HttpClientPoolManager.class);
public static PoolingHttpClientConnectionManager clientConnectionManager = null;
public static SSLConnectionSocketFactory sslsf = null;
private static int defaultMaxTotal = 200;
private static int defaultMaxPerRoute = 25;
public synchronized static void getInstance(int maxTotal, int maxPerRoute) {
try {
//ไฟกไปปๆๆssl
SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, (xcs, string) -> true).build();
sslsf = new SSLConnectionSocketFactory(sslContext);
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.INSTANCE)
.register("https", sslsf)
.build();
clientConnectionManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
if (maxTotal > 0) {
clientConnectionManager.setMaxTotal(maxTotal);
} else {
clientConnectionManager.setMaxTotal(defaultMaxTotal);
}
if (maxPerRoute > 0) {
clientConnectionManager.setDefaultMaxPerRoute(maxPerRoute);
} else {
clientConnectionManager.setDefaultMaxPerRoute(defaultMaxPerRoute);
}
} catch (Exception ex) {
ex.printStackTrace();
logger.error("ๅๅงๅHttpClientConnectionManagerๅคฑ่ดฅ๏ผ", ex);
}
}
public static CloseableHttpClient getHttpClient(int maxTotal, int maxPerRoute) {
if (clientConnectionManager == null) {
getInstance(maxTotal, maxPerRoute);
}
return HttpClients.custom().setConnectionManager(clientConnectionManager).setConnectionManagerShared(true).build();
}
public static CloseableHttpClient getHttpsClient(int maxTotal, int maxPerRoute) {
if (clientConnectionManager == null) {
getInstance(maxTotal, maxPerRoute);
}
return HttpClients.custom().setSSLSocketFactory(sslsf).setConnectionManager(clientConnectionManager).setConnectionManagerShared(true).build();
}
}
| [
"lvming@keking.cn"
] | lvming@keking.cn |
d1e821ba7608688a7f45d027ea74a4e5405d3a29 | 5fbe5af34b46dda18d5a51a5a252cd613c862848 | /youxipeiwan/youxipeiwan/app/src/main/java/com/ml/doctor/call2/NimCallActivity.java | b69baa1807527e187dbb73b3420ac5a0929174ef | [] | no_license | dythebs/innovation-2021 | 24d4c9174d2c219a359464367c76160058af4aef | 70e022635ae16438b68336c8d157c0ad06f90b72 | refs/heads/main | 2023-08-24T22:24:52.180711 | 2021-10-25T13:27:41 | 2021-10-25T13:27:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 28,236 | java | package com.ml.doctor.call2;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.StringRes;
import android.support.constraint.ConstraintLayout;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.ml.doctor.R;
import com.ml.doctor.utils.Handlers;
import com.ml.doctor.utils.T;
import com.ml.doctor.utils.Utils;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer;
import com.netease.nimlib.sdk.StatusCode;
import com.netease.nimlib.sdk.auth.AuthServiceObserver;
import com.netease.nimlib.sdk.auth.ClientType;
import com.netease.nimlib.sdk.avchat.AVChatCallback;
import com.netease.nimlib.sdk.avchat.AVChatManager;
import com.netease.nimlib.sdk.avchat.AVChatStateObserver;
import com.netease.nimlib.sdk.avchat.constant.AVChatControlCommand;
import com.netease.nimlib.sdk.avchat.constant.AVChatEventType;
import com.netease.nimlib.sdk.avchat.constant.AVChatType;
import com.netease.nimlib.sdk.avchat.constant.AVChatVideoScalingType;
import com.netease.nimlib.sdk.avchat.model.AVChatAudioFrame;
import com.netease.nimlib.sdk.avchat.model.AVChatCalleeAckEvent;
import com.netease.nimlib.sdk.avchat.model.AVChatCameraCapturer;
import com.netease.nimlib.sdk.avchat.model.AVChatCommonEvent;
import com.netease.nimlib.sdk.avchat.model.AVChatControlEvent;
import com.netease.nimlib.sdk.avchat.model.AVChatData;
import com.netease.nimlib.sdk.avchat.model.AVChatNetworkStats;
import com.netease.nimlib.sdk.avchat.model.AVChatOnlineAckEvent;
import com.netease.nimlib.sdk.avchat.model.AVChatSessionStats;
import com.netease.nimlib.sdk.avchat.model.AVChatSurfaceViewRenderer;
import com.netease.nimlib.sdk.avchat.model.AVChatVideoFrame;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
public class NimCallActivity extends AppCompatActivity {
private static final String TAG = "NimCallActivity";
public static final String EXTRA_INCOMING_CALL = "extra_incoming_call";
public static final String EXTRA_SOURCE = "extra_source";
public static final String EXTRA_PEER_ACCOUNT = "extra_peer_account";
public static final String EXTRA_CALL_CONFIG = "extra_call_config";
public static final String EXTRA_CALL_TYPE = "extra_call_type";
public static final int SOURCE_UNKNOWN = -1;
public static final int SOURCE_BROADCAST = 0;
public static final int SOURCE_INTERNAL = 1;
public static void launch(Context context, String account) {
launch(context, account, AVChatType.VIDEO.getValue(), SOURCE_INTERNAL);
}
public static void launch(Context context, String account, int callType, int source) {
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClass(context, NimCallActivity.class);
intent.putExtra(EXTRA_PEER_ACCOUNT, account);
intent.putExtra(EXTRA_INCOMING_CALL, false);
intent.putExtra(EXTRA_CALL_TYPE, callType);
intent.putExtra(EXTRA_SOURCE, source);
context.startActivity(intent);
}
public static void launch(Context context, AVChatData config, int source) {
Intent intent = new Intent();
intent.setClass(context, NimCallActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRA_CALL_CONFIG, config);
intent.putExtra(EXTRA_INCOMING_CALL, true);
intent.putExtra(EXTRA_SOURCE, source);
context.startActivity(intent);
}
@BindView(R.id.iv_call_small_cover)
ImageView ivSmallCover;
@BindView(R.id.fl_call_small_container)
FrameLayout flSmallContainer;
@BindView(R.id.fl_call_large_container)
FrameLayout flLargeContainer;
@BindView(R.id.tv_call_time)
TextView tvCallTime;
@BindView(R.id.iv_call_peer_avatar)
ImageView ivPeerAvatar;
@BindView(R.id.tv_call_nickname)
TextView tvNickname;
@BindView(R.id.tv_call_status)
TextView tvStatus;
@BindView(R.id.ic_call_switch_camera)
ImageView ivSwitchCamera;
@BindView(R.id.iv_call_toggle_camera)
ImageView ivToggleCamera;
@BindView(R.id.iv_call_toggle_mute)
ImageView ivToggleMute;
@BindView(R.id.iv_call_hang_up)
ImageView ivHangUp;
@BindView(R.id.tv_call_receive)
TextView tvReceive;
@BindView(R.id.tv_call_refuse)
TextView tvRefuse;
@BindView(R.id.cl_call_root)
ConstraintLayout clRoot;
private boolean mIsIncomingCall;
public AVChatData mCallData;
public int mCallType;
public String mPeerAccount;
public Unbinder mUnbinder;
public AVChatSurfaceViewRenderer mSmallRenderer;
public AVChatSurfaceViewRenderer mLargeRenderer;
private boolean shouldEnableToggle = false;
public NimCallHelper.OnCallStateChangeListener mCallListener = new NimCallHelper.OnCallStateChangeListener() {
@Override
public void onCallStateChanged(CallState state) {
if (clRoot == null) {
return;
}
if (CallState.isVideoMode(state))
switch (state) {
case OUTGOING_VIDEO_CALLING:
showProfile(true);
showStatus(R.string.avchat_wait_recieve);
showTime(false);
showRefuseReceive(false);
shouldEnableToggle = true;
enableCameraToggle();
showBottomPanel(true);
break;
case INCOMING_VIDEO_CALLING:
showProfile(true);
showStatus(R.string.avchat_video_call_request);
showTime(false);
showRefuseReceive(true);
showBottomPanel(false);
break;
case VIDEO_CONNECTING:
showStatus(R.string.avchat_connecting);
shouldEnableToggle = true;
break;
case VIDEO:
canSwitchCamera = true;
showProfile(false);
hideStatus();
showTime(true);
showRefuseReceive(false);
showBottomPanel(true);
break;
case OUTGOING_AUDIO_TO_VIDEO:
break;
default:
break;
}
}
};
public String mLargeAccount;
public String mSmallAccount;
private boolean isClosedCamera;
private boolean isLocalVideoOff;
private boolean localPreviewInSmallSize;
private boolean canSwitchCamera;
private boolean isPeerVideoOff;
private void showStatus(@StringRes int res) {
tvStatus.setVisibility(View.VISIBLE);
tvStatus.setText(res);
}
private void hideStatus() {
tvStatus.setVisibility(View.GONE);
}
private void showBottomPanel(boolean show) {
ivSwitchCamera.setVisibility(show ? View.VISIBLE : View.GONE);
ivToggleCamera.setVisibility(show ? View.VISIBLE : View.GONE);
ivToggleMute.setVisibility(show ? View.VISIBLE : View.GONE);
ivHangUp.setVisibility(show ? View.VISIBLE : View.GONE);
}
private void showTime(boolean show) {
tvCallTime.setVisibility(show ? View.VISIBLE : View.GONE);
}
private void enableCameraToggle() {
if (shouldEnableToggle) {
if (canSwitchCamera && AVChatCameraCapturer.hasMultipleCameras())
ivSwitchCamera.setEnabled(true);
}
}
private void showRefuseReceive(boolean show) {
tvRefuse.setVisibility(show ? View.VISIBLE : View.GONE);
tvReceive.setVisibility(show ? View.VISIBLE : View.GONE);
}
private void showProfile(boolean show) {
//show avatar
ivPeerAvatar.setVisibility(show ? View.VISIBLE : View.GONE);
tvNickname.setVisibility(show ? View.VISIBLE : View.GONE);
String peerAccount = NimCallHelper.getInstance().getPeerAccount();
tvNickname.setText(peerAccount);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!validSource()) {
finish();
return;
}
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
);
setContentView(R.layout.activity_nim_call);
mUnbinder = ButterKnife.bind(this);
mIsIncomingCall = getIntent().getBooleanExtra(EXTRA_INCOMING_CALL, false);
NimCallHelper.getInstance().initCallParams();
NimCallHelper.getInstance().setChatting(true);
//init
mSmallRenderer = new AVChatSurfaceViewRenderer(this);
mLargeRenderer = new AVChatSurfaceViewRenderer(this);
NimCallHelper.getInstance().addOnCallStateChangeListener(mCallListener);
registerNimCallObserver(true);
if (mIsIncomingCall) {
incomingCalling();
} else {
outgoingCalling();
}
isCallEstablished = false;
NimCallHelper.getInstance().setOnCloseSessionListener(new NimCallHelper.OnCloseSessionListener() {
@Override
public void onCloseSession() {
closeSession();
}
});
NIMClient.getService(AuthServiceObserver.class).observeOnlineStatus(userStatusObserver, true);
}
private void outgoingCalling() {
final AVChatType chatType = mCallType == AVChatType.VIDEO.getValue() ? AVChatType.VIDEO : AVChatType.AUDIO;
final String account = NimAccountHelper.getInstance().getAccount();
NimCallHelper.getInstance().call2(mPeerAccount, chatType, new AVChatCallback<AVChatData>() {
@Override
public void onSuccess(AVChatData avChatData) {
if (chatType == AVChatType.VIDEO) {
initLargeSurfaceView(account);
canSwitchCamera = true;
}
}
@Override
public void onFailed(int code) {
}
@Override
public void onException(Throwable exception) {
}
});
}
private void initSmallSurfaceView(String account) {
mSmallAccount = account;
if (account.equals(NimAccountHelper.getInstance().getAccount())) {
AVChatManager.getInstance().setupLocalVideoRender(mSmallRenderer, false, AVChatVideoScalingType.SCALE_ASPECT_BALANCED);
} else {
AVChatManager.getInstance().setupRemoteVideoRender(account, mSmallRenderer, false, AVChatVideoScalingType.SCALE_ASPECT_BALANCED);
}
ViewParent parent = mSmallRenderer.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(mSmallRenderer);
}
flSmallContainer.addView(mSmallRenderer, 0);
mSmallRenderer.setZOrderMediaOverlay(true);
}
private void initLargeSurfaceView(String account) {
mLargeAccount = account;
if (account.equals(NimAccountHelper.getInstance().getAccount())) {
AVChatManager.getInstance().setupLocalVideoRender(
mLargeRenderer, false, AVChatVideoScalingType.SCALE_ASPECT_BALANCED);
} else {
AVChatManager.getInstance().setupRemoteVideoRender(
account, mLargeRenderer, false, AVChatVideoScalingType.SCALE_ASPECT_BALANCED);
}
ViewParent parent = mLargeRenderer.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(mLargeRenderer);
}
flLargeContainer.addView(mLargeRenderer, 0);
mLargeRenderer.setZOrderMediaOverlay(false);
}
private void incomingCalling() {
NimCallHelper.getInstance().inComingCalling(mCallData);
}
/**
* ๅคๆญๆฅ็ต่ฟๆฏๅป็ต
*
* @return
*/
private boolean validSource() {
Intent intent = getIntent();
int source = intent.getIntExtra(EXTRA_SOURCE, SOURCE_UNKNOWN);
switch (source) {
case SOURCE_BROADCAST: // incoming call
mCallData = (AVChatData) intent.getSerializableExtra(EXTRA_CALL_CONFIG);
mCallType = mCallData.getChatType().getValue();
return true;
case SOURCE_INTERNAL: // outgoing call
mPeerAccount = intent.getStringExtra(EXTRA_PEER_ACCOUNT);
mCallType = intent.getIntExtra(EXTRA_CALL_TYPE, -1);
return mCallType == AVChatType.VIDEO.getValue()
|| mCallType == AVChatType.AUDIO.getValue();
default:
return false;
}
}
@Override
protected void onDestroy() {
if (mUnbinder != null) {
mUnbinder.unbind();
}
NIMClient.getService(AuthServiceObserver.class).observeOnlineStatus(userStatusObserver, false);
NimCallHelper.getInstance().setChatting(false);
registerNimCallObserver(false);
NimCallHelper.getInstance().destroy();
stopTimer();
super.onDestroy();
}
@Override
protected void onResume() {
super.onResume();
NimCallHelper.getInstance().resumeVideo();
}
@Override
protected void onPause() {
NimCallHelper.getInstance().pauseVideo();
super.onPause();
}
@Override
public void onBackPressed() {
//no back pressed
}
private void registerNimCallObserver(boolean register) {
AVChatManager.getInstance().observeAVChatState(callStateObserver, register);
AVChatManager.getInstance().observeCalleeAckNotification(callAckObserver, register);
AVChatManager.getInstance().observeControlNotification(callControlObserver, register);
AVChatManager.getInstance().observeHangUpNotification(callHangupObserver, register);
AVChatManager.getInstance().observeOnlineAckNotification(onlineAckObserver, register);
CallTimeoutObserver.getInstance().observeTimeoutNotification(timeoutObserver, register, mIsIncomingCall);
PhoneStateObserver.getInstance().observeAutoHangUpForLocalPhone(autoHangUpForLocalPhoneObserver, register);
}
private boolean isCallEstablished;
private AVChatStateObserver callStateObserver = new AVChatStateObserver() {
@Override
public void onTakeSnapshotResult(String account, boolean success, String file) {
}
@Override
public void onAVRecordingCompletion(String account, String filePath) {
}
@Override
public void onAudioRecordingCompletion(String filePath) {
}
@Override
public void onLowStorageSpaceWarning(long availableSize) {
}
@Override
public void onAudioMixingEvent(int event) {
}
@Override
public void onJoinedChannel(int code, String audioFile, String videoFile, int elapsed) {
Log.i(TAG, "result code->" + code);
if (code == 200) {
Log.d(TAG, "onConnectServer success");
} else if (code == 101) { // ่ฟๆฅ่ถ
ๆถ
NimCallHelper.getInstance().closeSessions(CallExitCode.PEER_NO_RESPONSE);
} else if (code == 401) { // ้ช่ฏๅคฑ่ดฅ
NimCallHelper.getInstance().closeSessions(CallExitCode.CONFIG_ERROR);
} else if (code == 417) { // ๆ ๆ็channelId
NimCallHelper.getInstance().closeSessions(CallExitCode.INVALIDE_CHANNELID);
} else { // ่ฟๆฅๆๅกๅจ้่ฏฏ๏ผ็ดๆฅ้ๅบ
NimCallHelper.getInstance().closeSessions(CallExitCode.CONFIG_ERROR);
}
}
@Override
public void onUserJoined(String account) {
Log.d(TAG, "onUserJoined -> " + account);
NimCallHelper.getInstance().setPeerAccount(account);
initLargeSurfaceView(NimCallHelper.getInstance().getPeerAccount());
}
@Override
public void onUserLeave(String account, int event) {
Log.d(TAG, "onUserLeave -> " + account);
onIvHangUpClicked();
NimCallHelper.getInstance().closeSessions(CallExitCode.HANGUP);
}
@Override
public void onLeaveChannel() {
}
@Override
public void onProtocolIncompatible(int status) {
}
@Override
public void onDisconnectServer() {
}
@Override
public void onNetworkQuality(String user, int quality, AVChatNetworkStats stats) {
}
@Override
public void onCallEstablished() {
CallTimeoutObserver.getInstance().observeTimeoutNotification(
timeoutObserver, false, mIsIncomingCall);
startTimer();
if (mCallType == AVChatType.VIDEO.getValue()) {
NimCallHelper.getInstance().notifyCallStateChanged(CallState.VIDEO);
initSmallSurfaceView(NimAccountHelper.getInstance().getAccount());
} else {
NimCallHelper.getInstance().notifyCallStateChanged(CallState.AUDIO);
}
isCallEstablished = true;
}
@Override
public void onDeviceEvent(int code, String desc) {
}
@Override
public void onConnectionTypeChanged(int netType) {
}
@Override
public void onFirstVideoFrameAvailable(String account) {
}
@Override
public void onFirstVideoFrameRendered(String user) {
}
@Override
public void onVideoFrameResolutionChanged(String user, int width, int height, int rotate) {
}
@Override
public void onVideoFpsReported(String account, int fps) {
}
@Override
public boolean onVideoFrameFilter(AVChatVideoFrame frame, boolean maybeDualInput) {
return false;
}
@Override
public boolean onAudioFrameFilter(AVChatAudioFrame frame) {
return true;
}
@Override
public void onAudioDeviceChanged(int device) {
}
@Override
public void onReportSpeaker(Map<String, Integer> speakers, int mixedEnergy) {
}
@Override
public void onSessionStats(AVChatSessionStats sessionStats) {
}
@Override
public void onLiveEvent(int event) {
}
};
/**
* ๆณจๅ/ๆณจ้็ฝ็ป้่ฏ่ขซๅซๆน็ๅๅบ๏ผๆฅๅฌใๆ็ปใๅฟ๏ผ
*/
Observer<AVChatCalleeAckEvent> callAckObserver = new Observer<AVChatCalleeAckEvent>() {
@Override
public void onEvent(AVChatCalleeAckEvent ackInfo) {
AVChatData info = NimCallHelper.getInstance().getAvChatData();
if (info != null && info.getChatId() == ackInfo.getChatId()) {
CallSoundPlayer.instance().stop();
if (ackInfo.getEvent() == AVChatEventType.CALLEE_ACK_BUSY) {
CallSoundPlayer.instance().play(CallSoundPlayer.RingerType.PEER_BUSY);
NimCallHelper.getInstance().closeSessions(CallExitCode.PEER_BUSY);
} else if (ackInfo.getEvent() == AVChatEventType.CALLEE_ACK_REJECT) {
NimCallHelper.getInstance().closeRtc();
NimCallHelper.getInstance().closeSessions(CallExitCode.REJECT);
} else if (ackInfo.getEvent() == AVChatEventType.CALLEE_ACK_AGREE) {
NimCallHelper.getInstance().setCallEstablished(true);
canSwitchCamera = true;
}
}
}
};
/**
* ๆณจๅ/ๆณจ้็ฝ็ป้่ฏๆงๅถๆถๆฏ๏ผ้ณ่ง้ขๆจกๅผๅๆข้็ฅ๏ผ
*/
Observer<AVChatControlEvent> callControlObserver = new Observer<AVChatControlEvent>() {
@Override
public void onEvent(AVChatControlEvent notification) {
if (AVChatManager.getInstance().getCurrentChatId() != notification.getChatId()) {
return;
}
switch (notification.getControlCommand()) {
// case AVChatControlCommand.SWITCH_AUDIO_TO_VIDEO:
// avChatUI.incomingAudioToVideo();
// break;
// case AVChatControlCommand.SWITCH_AUDIO_TO_VIDEO_AGREE:
// onAudioToVideo();
// break;
// case AVChatControlCommand.SWITCH_AUDIO_TO_VIDEO_REJECT:
// avChatUI.onCallStateChange(CallStateEnum.AUDIO);
// Toast.makeText(AVChatActivity.this, R.string.avchat_switch_video_reject, Toast.LENGTH_SHORT).show();
// break;
// case AVChatControlCommand.SWITCH_VIDEO_TO_AUDIO:
// onVideoToAudio();
// break;
case AVChatControlCommand.NOTIFY_VIDEO_OFF:
isPeerVideoOff = true;
if (!localPreviewInSmallSize) {
ivSmallCover.setVisibility(View.VISIBLE);
}
break;
case AVChatControlCommand.NOTIFY_VIDEO_ON:
isPeerVideoOff = false;
if (!localPreviewInSmallSize) {
ivSmallCover.setVisibility(View.GONE);
}
break;
default:
Log.i(TAG, "ๅฏนๆนๅๆฅๆไปคๅผ๏ผ" + notification.getControlCommand());
break;
}
}
};
/**
* ๆณจๅ/ๆณจ้็ฝ็ป้่ฏๅฏนๆนๆๆญ็้็ฅ
*/
Observer<AVChatCommonEvent> callHangupObserver = new Observer<AVChatCommonEvent>() {
@Override
public void onEvent(AVChatCommonEvent avChatHangUpInfo) {
AVChatData info = NimCallHelper.getInstance().getAvChatData();
if (info != null && info.getChatId() == avChatHangUpInfo.getChatId()) {
CallSoundPlayer.instance().stop();
NimCallHelper.getInstance().closeRtc();
NimCallHelper.getInstance().closeSessions(CallExitCode.HANGUP);
}
}
};
/**
* ๆณจๅ/ๆณจ้ๅๆถๅจ็บฟ็ๅ
ถไป็ซฏๅฏนไธปๅซๆน็ๅๅบ
*/
Observer<AVChatOnlineAckEvent> onlineAckObserver = new Observer<AVChatOnlineAckEvent>() {
@Override
public void onEvent(AVChatOnlineAckEvent ackInfo) {
AVChatData info = NimCallHelper.getInstance().getAvChatData();
if (info != null && info.getChatId() == ackInfo.getChatId()) {
CallSoundPlayer.instance().stop();
String client = null;
switch (ackInfo.getClientType()) {
case ClientType.Web:
client = "Web";
break;
case ClientType.Windows:
client = "Windows";
break;
case ClientType.Android:
client = "Android";
break;
case ClientType.iOS:
client = "iOS";
break;
case ClientType.MAC:
client = "Mac";
break;
default:
break;
}
if (client != null) {
String option = ackInfo.getEvent() == AVChatEventType.CALLEE_ONLINE_CLIENT_ACK_AGREE ? "ๆฅๅฌ๏ผ" : "ๆ็ป๏ผ";
T.show("้่ฏๅทฒๅจ" + client + "็ซฏ่ขซ" + option);
}
NimCallHelper.getInstance().closeSessions(-1);
}
}
};
Observer<Integer> timeoutObserver = new Observer<Integer>() {
@Override
public void onEvent(Integer integer) {
NimCallHelper.getInstance().hangUp();
CallSoundPlayer.instance().stop();
}
};
Observer<Integer> autoHangUpForLocalPhoneObserver = new Observer<Integer>() {
@Override
public void onEvent(Integer integer) {
CallSoundPlayer.instance().stop();
NimCallHelper.getInstance().closeSessions(CallExitCode.PEER_BUSY);
}
};
Observer<StatusCode> userStatusObserver = new Observer<StatusCode>() {
@Override
public void onEvent(StatusCode code) {
if (code.wontAutoLogin()) {
CallSoundPlayer.instance().stop();
finish();
}
}
};
private int mSeconds = 0;
private void startTimer() {
mSeconds = 0;
Handlers.runOnUiThread(refreshCallTime);
}
private void stopTimer() {
Handlers.ui().removeCallbacks(refreshCallTime);
// if (mSeconds > 0) {
// final int minutes = mSeconds / 60;
// if (minutes + 1 >= 0) {
//
// }
// }
}
private final Runnable refreshCallTime = new Runnable() {
@Override
public void run() {
Handlers.ui().postDelayed(refreshCallTime, 1000);
if (!tvCallTime.isShown()) {
tvCallTime.setVisibility(View.VISIBLE);
}
tvCallTime.setText(Utils.formatCallTime(mSeconds));
mSeconds++;
}
};
@OnClick(R.id.ic_call_switch_camera)
public void onIvSwitchCameraClicked() {
NimCallHelper.getInstance().switchCamera();
}
@OnClick(R.id.iv_call_toggle_camera)
public void onIvToggleCameraClicked() {
boolean selected = ivToggleCamera.isSelected();
AVChatManager.getInstance().muteLocalVideo(!selected);
ivToggleCamera.setSelected(!selected);
ivSmallCover.setVisibility(!selected ? View.GONE : View.VISIBLE);
}
@OnClick(R.id.iv_call_toggle_mute)
public void onIvToggleMuteClicked() {
boolean established = NimCallHelper.getInstance().isCallEstablished();
if (established) { // ่ฟๆฅๅทฒ็ปๅปบ็ซ
boolean muted = AVChatManager.getInstance().isLocalAudioMuted();
AVChatManager.getInstance().muteLocalAudio(!muted);
ivToggleMute.setSelected(!muted);
}
}
@OnClick(R.id.iv_call_hang_up)
public void onIvHangUpClicked() {
NimCallHelper.getInstance().hangUp();
}
@OnClick(R.id.tv_call_receive)
public void onTvReceiveClicked() {
NimCallHelper.getInstance().receive();
}
@OnClick(R.id.tv_call_refuse)
public void onTvRefuseClicked() {
NimCallHelper.getInstance().refuse();
}
public void closeSession() {
if (ivSwitchCamera != null) {
ivSwitchCamera.setEnabled(false);
}
if (ivToggleCamera != null) {
ivToggleCamera.setEnabled(false);
}
if (ivToggleMute != null) {
ivToggleMute.setEnabled(false);
}
if (tvRefuse != null) {
tvRefuse.setEnabled(false);
}
if (tvReceive != null) {
tvReceive.setEnabled(false);
}
if (ivHangUp != null) {
ivHangUp.setEnabled(false);
}
if (mLargeRenderer != null && mLargeRenderer.getParent() != null) {
((ViewGroup) mLargeRenderer.getParent()).removeView(mLargeRenderer);
}
if (mSmallRenderer != null && mSmallRenderer.getParent() != null) {
((ViewGroup) mSmallRenderer.getParent()).removeView(mSmallRenderer);
}
mLargeRenderer = null;
mSmallRenderer = null;
finish();
}
} | [
"244271172@qq.com"
] | 244271172@qq.com |
fa31cfff11ba33afba9da3a940e1274143fc0e05 | 343c79e2c638fe5b4ef14de39d885bc5e1e6aca5 | /OppoLauncher/app/src/main/java/com/oppo/unreaderloader/OPPOUnreadLoader.java | 3c2113995c20698f457f5f6656b280da4bf0d676 | [] | no_license | Leonilobayang/AndroidDemos | 05a76647b8e27582fa56e2e15d4195c2ff9b9c32 | 6ac06c3752dfa9cebe81f7c796525a17df620663 | refs/heads/master | 2022-04-17T06:56:52.912639 | 2016-07-01T07:48:50 | 2016-07-01T07:48:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 67,651 | java | package com.oppo.unreaderloader;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.CursorIndexOutOfBoundsException;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.provider.CallLog.Calls;
import android.provider.Settings.System;
import android.text.SpannableStringBuilder;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.SuperscriptSpan;
import android.util.Log;
import com.android.BadgeProvider.BadgeItems;
import com.android.internal.util.XmlUtils;
import com.oppo.launcher.ApplicationInfo;
import com.oppo.launcher.LauncherUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
public class OPPOUnreadLoader
{
private static final String BADGE_USER = "badge_user";
private static final String BROWSER_READER_APPNAME = "BrowserReader";
private static final boolean DEBUG_NORMAL = false;
private static final boolean DEBUG_PERFORMANCE = false;
private static final boolean DEBUG_UNREAD = LauncherUtil.LAUNCHER_QE_ASSERT_DEBUG;
private static final String DOCUMENT_UNREADSHORTCUTS = "unreadshortcuts";
private static final String EMAIL_APPNAME = "email";
private static final String MARKET_APPNAME = "market";
private static final String MMS_APPNAME = "mms";
private static final String NOTIFICATION_USER = "notification_user";
private static final String OPPO_COMMUNITY_APPNAME = "OppoCommunity";
private static final String OPPO_MISSED_CALL_SETTING = "oppo.missed.calls.number";
private static final String OPPO_MISSED_SMS_SETTING = "oppo.unread.mms.number";
private static final String OPPO_READER_APPNAME = "OppoReader";
private static final String PACKAGE_NAME = "pkg";
private static final String PHONE_APPNAME = "phone";
private static final Uri POWERS_URI;
private static final String SECURESAFE_APPNAME = "securesafe";
private static final String SETTINGS_APPNAME = "SettingsApplication";
private static final int SWITCH_ON = 1;
private static final String TAG = "OPPOUnreadLoader";
private static final String TAG_UNREADSHORTCUTS = "shortcut";
private static final String TAG_UNREADSHORTCUTS_APPNAME = "appName";
private static final String TAG_UNREADSHORTCUTS_CLASSNAME = "unreadClassName";
private static final String TAG_UNREADSHORTCUTS_NOTIFYFORDESCENDENTS = "notifyForDescendents";
private static final String TAG_UNREADSHORTCUTS_PACKAGENAME = "unreadPackageName";
private static final String TAG_UNREADSHORTCUTS_URI = "uri";
private static final int TYPE_INCOMING_REJECTED = 10;
private static final String UBEAUTY_APPNAME = "Ubeauty";
private static final String USER_CENTER_APPNAME = "UserCenter";
private static final String WPS_EMAIL_APPNAME = "WPSEmail";
private static OPPOUnreadLoader mInstance;
private static final Object mLogLock;
private static final SpannableStringBuilder sExceedString = new SpannableStringBuilder("99+");
private static final ArrayList<UnreadSupportShortcut> sUnreadSupportShortcuts = new ArrayList();
private final String VERSION_CODE = "00006";
private Object mBadgeProviderObject = new Object();
private BaseContentObserver mBadgeProviderObserver;
private Object mBadgeSwitchUpdateObject = new Object();
private WeakReference<UnreadCallbacks> mCallbacks;
private ContentResolver mContentResolver;
private Context mContext;
private final ContentObserver mUnReadAppSwitchObserver = new ContentObserver(new Handler())
{
public boolean deliverSelfNotifications()
{
return true;
}
public void onChange(boolean paramAnonymousBoolean)
{
if (OPPOUnreadLoader.this.sWorker == null)
return;
OPPOUnreadLoader.this.sWorker.removeCallbacksAndMessages(OPPOUnreadLoader.this.mBadgeSwitchUpdateObject);
Message localMessage = Message.obtain(OPPOUnreadLoader.this.sWorker, new Runnable()
{
public void run()
{
OPPOUnreadLoader.this.updateUnreadNumberSwitch(true);
}
});
localMessage.obj = OPPOUnreadLoader.this.mBadgeSwitchUpdateObject;
OPPOUnreadLoader.this.sWorker.sendMessageDelayed(localMessage, 800L);
}
};
private Handler sWorker = null;
private HandlerThread sWorkerThread;
static
{
mLogLock = new Object();
POWERS_URI = Uri.parse("content://com.oppo.notification_center/powers");
mInstance = null;
sExceedString.setSpan(new SuperscriptSpan(), 2, 3, 33);
sExceedString.setSpan(new AbsoluteSizeSpan(10), 2, 3, 33);
}
private OPPOUnreadLoader(Context paramContext)
{
this.mContext = paramContext;
this.sWorkerThread = new HandlerThread("launcher-unreader-loader");
this.sWorkerThread.start();
this.sWorker = new Handler(this.sWorkerThread.getLooper());
this.mContentResolver = this.mContext.getContentResolver();
if (DEBUG_UNREAD)
Log.i("OPPOUnreadLoader", "version code : 00006");
}
public static void clearUnreadNumForApplicationInfo(Context paramContext, ArrayList<ApplicationInfo> paramArrayList)
{
if ((paramArrayList == null) || (paramContext == null))
label8: return;
else
paramArrayList = paramArrayList.iterator();
while (true)
{
if (!paramArrayList.hasNext())
break label8;
Object localObject = ((ApplicationInfo)paramArrayList.next()).packageName;
if (localObject == null)
break;
localObject = getAllSupportUnreadComponentsForPackage((String)localObject).iterator();
while (((Iterator)localObject).hasNext())
clearUnreadNumForComponentName(paramContext, (ComponentName)((Iterator)localObject).next());
}
}
public static void clearUnreadNumForComponentName(Context paramContext, ComponentName paramComponentName)
{
Object localObject1 = sUnreadSupportShortcuts.iterator();
UnreadSupportShortcut localUnreadSupportShortcut;
while (((Iterator)localObject1).hasNext())
{
localUnreadSupportShortcut = (UnreadSupportShortcut)((Iterator)localObject1).next();
if ((localUnreadSupportShortcut.mComponent != null) && (localUnreadSupportShortcut.mComponent.equals(paramComponentName)))
localUnreadSupportShortcut.mUnreadNum = 0;
}
if (paramContext == null);
while (true)
{
return;
localUnreadSupportShortcut = null;
Object localObject2 = null;
Object localObject3 = null;
String str1 = paramComponentName.getPackageName();
localObject1 = localUnreadSupportShortcut;
paramComponentName = localObject2;
try
{
String str2 = paramContext.getDatabasePath("badge.db").getPath();
paramContext = localObject3;
if (str2 != null)
{
localObject1 = localUnreadSupportShortcut;
paramComponentName = localObject2;
paramContext = SQLiteDatabase.openDatabase(str2, null, 0);
localObject1 = paramContext;
paramComponentName = paramContext;
paramContext.beginTransaction();
localObject1 = paramContext;
paramComponentName = paramContext;
paramContext.delete("badge", "app_package_name = ?", new String[] { str1 });
localObject1 = paramContext;
paramComponentName = paramContext;
paramContext.setTransactionSuccessful();
}
return;
}
catch (Exception paramContext)
{
paramComponentName = (ComponentName)localObject1;
Log.e("OPPOUnreadLoader", "clearUnreadNumForComponentName --- e = " + paramContext);
if (localObject1 != null)
{
((SQLiteDatabase)localObject1).endTransaction();
((SQLiteDatabase)localObject1).close();
return;
}
}
finally
{
if (paramComponentName != null)
{
paramComponentName.endTransaction();
paramComponentName.close();
}
}
}
throw paramContext;
}
private void closeCursor(Cursor paramCursor)
{
if (paramCursor != null);
try
{
paramCursor.close();
return;
}
catch (IllegalStateException paramCursor)
{
}
catch (Exception paramCursor)
{
}
}
private void closeInputStream(InputStream paramInputStream)
{
if (paramInputStream != null);
try
{
paramInputStream.close();
return;
}
catch (Exception paramInputStream)
{
}
}
public static ArrayList<ComponentName> getAllSupportUnreadComponentsForPackage(String paramString)
{
ArrayList localArrayList = new ArrayList();
Iterator localIterator = sUnreadSupportShortcuts.iterator();
while (localIterator.hasNext())
{
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)localIterator.next();
if ((localUnreadSupportShortcut.mComponent != null) && (localUnreadSupportShortcut.mComponent.getPackageName().equals(paramString)))
localArrayList.add(localUnreadSupportShortcut.mComponent);
}
return localArrayList;
}
// ERROR //
private int getBadgeUnreadCount(String paramString)
{
// Byte code:
// 0: aload_0
// 1: monitorenter
// 2: aload_0
// 3: getfield 216 com/oppo/unreaderloader/OPPOUnreadLoader:mContext Landroid/content/Context;
// 6: astore_2
// 7: aload_2
// 8: ifnonnull +11 -> 19
// 11: iconst_0
// 12: istore 6
// 14: aload_0
// 15: monitorexit
// 16: iload 6
// 18: ireturn
// 19: iconst_0
// 20: istore 8
// 22: iconst_0
// 23: istore 7
// 25: aconst_null
// 26: astore 4
// 28: aconst_null
// 29: astore_2
// 30: aconst_null
// 31: astore_3
// 32: aload_0
// 33: getfield 216 com/oppo/unreaderloader/OPPOUnreadLoader:mContext Landroid/content/Context;
// 36: invokevirtual 241 android/content/Context:getContentResolver ()Landroid/content/ContentResolver;
// 39: getstatic 429 com/android/BadgeProvider$BadgeItems:CONTENT_URI Landroid/net/Uri;
// 42: iconst_1
// 43: anewarray 370 java/lang/String
// 46: dup
// 47: iconst_0
// 48: ldc_w 431
// 51: aastore
// 52: ldc_w 368
// 55: iconst_1
// 56: anewarray 370 java/lang/String
// 59: dup
// 60: iconst_0
// 61: aload_1
// 62: aastore
// 63: aconst_null
// 64: invokevirtual 437 android/content/ContentResolver:query (Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
// 67: astore_1
// 68: iload 8
// 70: istore 6
// 72: aload_1
// 73: ifnull +113 -> 186
// 76: iload 8
// 78: istore 6
// 80: aload_1
// 81: astore_3
// 82: aload_1
// 83: astore 4
// 85: aload_1
// 86: astore_2
// 87: aload_1
// 88: invokeinterface 441 1 0
// 93: ifle +93 -> 186
// 96: aload_1
// 97: astore_3
// 98: aload_1
// 99: astore 4
// 101: aload_1
// 102: astore_2
// 103: aload_0
// 104: getfield 255 com/oppo/unreaderloader/OPPOUnreadLoader:mCallbacks Ljava/lang/ref/WeakReference;
// 107: invokevirtual 446 java/lang/ref/WeakReference:get ()Ljava/lang/Object;
// 110: checkcast 17 com/oppo/unreaderloader/OPPOUnreadLoader$UnreadCallbacks
// 113: astore 5
// 115: aload 5
// 117: ifnonnull +14 -> 131
// 120: aload_0
// 121: aload_1
// 122: invokespecial 448 com/oppo/unreaderloader/OPPOUnreadLoader:closeCursor (Landroid/database/Cursor;)V
// 125: iconst_0
// 126: istore 6
// 128: goto -114 -> 14
// 131: aload_1
// 132: astore_3
// 133: aload_1
// 134: astore 4
// 136: aload_1
// 137: astore_2
// 138: aload_1
// 139: ldc_w 431
// 142: invokeinterface 451 2 0
// 147: istore 9
// 149: iload 8
// 151: istore 6
// 153: aload_1
// 154: astore_3
// 155: aload_1
// 156: astore 4
// 158: aload_1
// 159: astore_2
// 160: aload_1
// 161: invokeinterface 454 1 0
// 166: ifeq +20 -> 186
// 169: aload_1
// 170: astore_3
// 171: aload_1
// 172: astore 4
// 174: aload_1
// 175: astore_2
// 176: aload_1
// 177: iload 9
// 179: invokeinterface 458 2 0
// 184: istore 6
// 186: aload_0
// 187: aload_1
// 188: invokespecial 448 com/oppo/unreaderloader/OPPOUnreadLoader:closeCursor (Landroid/database/Cursor;)V
// 191: goto -177 -> 14
// 194: astore_1
// 195: aload_0
// 196: monitorexit
// 197: aload_1
// 198: athrow
// 199: astore_1
// 200: aload_3
// 201: astore_2
// 202: ldc 86
// 204: ldc_w 460
// 207: invokestatic 463 android/util/Log:w (Ljava/lang/String;Ljava/lang/String;)I
// 210: pop
// 211: aload_0
// 212: aload_3
// 213: invokespecial 448 com/oppo/unreaderloader/OPPOUnreadLoader:closeCursor (Landroid/database/Cursor;)V
// 216: iload 7
// 218: istore 6
// 220: goto -206 -> 14
// 223: astore_1
// 224: aload 4
// 226: astore_2
// 227: ldc 86
// 229: new 385 java/lang/StringBuilder
// 232: dup
// 233: invokespecial 386 java/lang/StringBuilder:<init> ()V
// 236: ldc_w 465
// 239: invokevirtual 392 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
// 242: aload_1
// 243: invokevirtual 395 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
// 246: invokevirtual 398 java/lang/StringBuilder:toString ()Ljava/lang/String;
// 249: invokestatic 401 android/util/Log:e (Ljava/lang/String;Ljava/lang/String;)I
// 252: pop
// 253: aload_0
// 254: aload 4
// 256: invokespecial 448 com/oppo/unreaderloader/OPPOUnreadLoader:closeCursor (Landroid/database/Cursor;)V
// 259: iload 7
// 261: istore 6
// 263: goto -249 -> 14
// 266: astore_1
// 267: aload_0
// 268: aload_2
// 269: invokespecial 448 com/oppo/unreaderloader/OPPOUnreadLoader:closeCursor (Landroid/database/Cursor;)V
// 272: aload_1
// 273: athrow
//
// Exception table:
// from to target type
// 2 7 194 finally
// 120 125 194 finally
// 186 191 194 finally
// 211 216 194 finally
// 253 259 194 finally
// 267 274 194 finally
// 32 68 199 android/database/CursorIndexOutOfBoundsException
// 87 96 199 android/database/CursorIndexOutOfBoundsException
// 103 115 199 android/database/CursorIndexOutOfBoundsException
// 138 149 199 android/database/CursorIndexOutOfBoundsException
// 160 169 199 android/database/CursorIndexOutOfBoundsException
// 176 186 199 android/database/CursorIndexOutOfBoundsException
// 32 68 223 java/lang/SecurityException
// 87 96 223 java/lang/SecurityException
// 103 115 223 java/lang/SecurityException
// 138 149 223 java/lang/SecurityException
// 160 169 223 java/lang/SecurityException
// 176 186 223 java/lang/SecurityException
// 32 68 266 finally
// 87 96 266 finally
// 103 115 266 finally
// 138 149 266 finally
// 160 169 266 finally
// 176 186 266 finally
// 202 211 266 finally
// 227 253 266 finally
}
private int getBrowserReaderUpdateCount()
{
int i = 0;
Object localObject3 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://com.oppo.browser.book/t_book_newest"), null, null, null, null);
if (localCursor != null)
{
localObject1 = localCursor;
localObject3 = localCursor;
i = localCursor.getCount();
}
return i;
}
catch (Exception localException)
{
localObject3 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getBrowserReaderUpdateCount, e = " + localException);
return 0;
}
finally
{
closeCursor(localObject3);
}
}
public static CharSequence getExceedText()
{
return sExceedString;
}
public static OPPOUnreadLoader getInstance(Context paramContext)
{
try
{
if (mInstance == null)
mInstance = new OPPOUnreadLoader(paramContext);
paramContext = mInstance;
return paramContext;
}
finally
{
}
throw paramContext;
}
public static Object getMessageObj(ComponentName paramComponentName)
{
if (paramComponentName == null)
return null;
int i = 0;
int j = sUnreadSupportShortcuts.size();
while (i < j)
{
if (((UnreadSupportShortcut)sUnreadSupportShortcuts.get(i)).mComponent.equals(paramComponentName))
return ((UnreadSupportShortcut)sUnreadSupportShortcuts.get(i)).mObject;
i += 1;
}
return null;
}
private int getUbeautyUnreadCount()
{
int j = 0;
Object localObject3 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://com.oppo.ubeauty.provider.data/beauty_new_message"), null, null, null, null);
int i = j;
if (localCursor != null)
{
i = j;
localObject1 = localCursor;
localObject3 = localCursor;
if (localCursor.moveToFirst())
{
localObject1 = localCursor;
localObject3 = localCursor;
i = localCursor.getInt(localCursor.getColumnIndexOrThrow("message_count"));
}
}
return i;
}
catch (Exception localException)
{
localObject3 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getUbeautyUnreadCount, e = " + localException);
return 0;
}
finally
{
closeCursor(localObject3);
}
}
private int getUnreadNum(UnreadSupportShortcut paramUnreadSupportShortcut)
{
int i;
if (paramUnreadSupportShortcut == null)
{
Log.w("OPPOUnreadLoader", "getUnreadNum shortcut == null ");
i = 0;
}
int j;
do
{
do
{
do
{
do
{
do
{
do
{
do
{
do
{
do
{
do
{
do
{
do
{
do
{
do
{
int k;
do
{
return i;
k = 0;
j = 0;
if (!paramUnreadSupportShortcut.mHasBadgeProviderUri)
break;
i = j;
}
while (paramUnreadSupportShortcut.mComponent == null);
paramUnreadSupportShortcut = paramUnreadSupportShortcut.mComponent.getPackageName();
j = k;
if (paramUnreadSupportShortcut != null)
j = getBadgeUnreadCount(paramUnreadSupportShortcut);
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum packageName = " + paramUnreadSupportShortcut + ", count = " + j);
return j;
i = j;
}
while (paramUnreadSupportShortcut.mAppName == null);
if (!paramUnreadSupportShortcut.mAppName.equals("mms"))
break;
j = getNewSmsCount() + getNewMmsCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum MMScount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("phone"))
break;
j = getMissedCallCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum misscallcount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("email"))
break;
j = getNewEmailCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum newemailcount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("market"))
break;
j = getNewUpdateCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum updatecount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("OppoCommunity"))
break;
j = getOppoCommunityCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum OppoCommunitycount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("OppoReader"))
break;
j = getUpdateBookCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum OppoReaderCount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("SettingsApplication"))
break;
j = getOTACount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum getOTACount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("BrowserReader"))
break;
j = getBrowserReaderUpdateCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum getBrowserReaderUpdateCount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("WPSEmail"))
break;
j = getNewWPSEmailCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum getNewWPSEmailCount = " + j);
return j;
if (!paramUnreadSupportShortcut.mAppName.equals("UserCenter"))
break;
j = getUserCenterUnreadCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum getUserCenterUnreadCount = " + j);
return j;
i = j;
}
while (!paramUnreadSupportShortcut.mAppName.equals("Ubeauty"));
j = getUbeautyUnreadCount();
i = j;
}
while (!DEBUG_UNREAD);
Log.d("OPPOUnreadLoader", "getUnreadNum getUbeautyUnreadCount = " + j);
return j;
}
public static int getUnreadNumberAt(int paramInt)
{
if (paramInt >= 0);
try
{
int i = sUnreadSupportShortcuts.size();
if (paramInt >= i);
for (paramInt = 0; ; paramInt = ((UnreadSupportShortcut)sUnreadSupportShortcuts.get(paramInt)).mUnreadNum)
{
return paramInt;
if (DEBUG_UNREAD)
Log.d("OPPOUnreadLoader", "getUnreadNumberAt: index = " + paramInt + getUnreadSupportShortcutInfo());
}
}
finally
{
}
}
public static int getUnreadNumberOfComponent(ComponentName paramComponentName)
{
return getUnreadNumberAt(supportUnreadFeature(paramComponentName));
}
private static UnreadSupportShortcut getUnreadSupportShortcut(ComponentName paramComponentName)
{
Object localObject;
if (paramComponentName == null)
{
localObject = null;
return localObject;
}
int i = 0;
int j = sUnreadSupportShortcuts.size();
while (true)
{
if (i >= j)
break label59;
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)sUnreadSupportShortcuts.get(i);
if (localUnreadSupportShortcut != null)
{
localObject = localUnreadSupportShortcut;
if (paramComponentName.equals(localUnreadSupportShortcut.mComponent))
break;
}
i += 1;
}
label59: return null;
}
private static UnreadSupportShortcut getUnreadSupportShortcut(String paramString)
{
Object localObject;
if ((sUnreadSupportShortcuts == null) || (paramString == null))
{
localObject = null;
return localObject;
}
int i = 0;
int j = sUnreadSupportShortcuts.size();
while (true)
{
if (i >= j)
break label75;
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)sUnreadSupportShortcuts.get(i);
if ((localUnreadSupportShortcut != null) && (localUnreadSupportShortcut.mComponent != null))
{
localObject = localUnreadSupportShortcut;
if (paramString.equals(localUnreadSupportShortcut.mComponent.getPackageName()))
break;
}
i += 1;
}
label75: return null;
}
private static String getUnreadSupportShortcutInfo()
{
synchronized (mLogLock)
{
String str = " Unread support shortcuts are " + sUnreadSupportShortcuts.toString();
return str;
}
}
private int getUserCenterUnreadCount()
{
int i3 = 0;
int n = 0;
int i1 = 0;
int i2 = 0;
Object localObject3 = null;
Object localObject1 = null;
int m = i1;
int j = i3;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://com.oppo.usercenter.provider.open/DBRemindEntity"), null, null, null, null);
i = i2;
int k = n;
if (localCursor != null)
{
i = i2;
k = n;
m = i1;
localObject1 = localCursor;
j = i3;
localObject3 = localCursor;
if (localCursor.moveToFirst())
{
m = i1;
localObject1 = localCursor;
j = i3;
localObject3 = localCursor;
n = localCursor.getInt(localCursor.getColumnIndexOrThrow("showLauncherRemind"));
m = i1;
localObject1 = localCursor;
j = n;
localObject3 = localCursor;
i1 = localCursor.getInt(localCursor.getColumnIndexOrThrow("remindCount"));
i = i1;
k = n;
m = i1;
localObject1 = localCursor;
j = n;
localObject3 = localCursor;
if (DEBUG_UNREAD)
{
m = i1;
localObject1 = localCursor;
j = n;
localObject3 = localCursor;
Log.v("OPPOUnreadLoader", "getUserCenterUnreadCount --- switchValue = " + n + ", countValue = " + i1);
k = n;
i = i1;
}
}
}
closeCursor(localCursor);
j = k;
if (j == 0)
i = 0;
return i;
}
catch (Exception localException)
{
while (true)
{
localObject3 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getUserCenterUnreadCount, e = " + localException);
closeCursor(localObject1);
int i = m;
}
}
finally
{
closeCursor(localObject3);
}
}
private void initUnreadNumberContentObserver()
{
if ((this.mContext == null) || (this.mContentResolver == null))
{
Log.w("OPPOUnreadLoader", "initUnreadNumberContentObserver mContext = " + this.mContext);
Log.w("OPPOUnreadLoader", "initUnreadNumberContentObserver mContentResolver = " + this.mContentResolver);
}
do
{
return;
int i = 0;
int j = sUnreadSupportShortcuts.size();
while (i < j)
{
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)sUnreadSupportShortcuts.get(i);
if ((localUnreadSupportShortcut != null) && (localUnreadSupportShortcut.mUnreadNumSwitch))
localUnreadSupportShortcut.registerObserver(this.mContext, this.mContentResolver);
i += 1;
}
this.mContentResolver.registerContentObserver(POWERS_URI, true, this.mUnReadAppSwitchObserver);
}
while (!isBadgeProviderShortcutExistAndSwitchOpen());
this.mBadgeProviderObserver = new BaseContentObserver(null, new Handler(this.mContext.getMainLooper()), true);
this.mContentResolver.registerContentObserver(BadgeProvider.BadgeItems.CONTENT_URI, true, this.mBadgeProviderObserver);
}
private boolean isBadgeProviderShortcutExistAndSwitchOpen()
{
int i = 0;
int j = sUnreadSupportShortcuts.size();
while (i < j)
{
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)sUnreadSupportShortcuts.get(i);
if ((localUnreadSupportShortcut != null) && (localUnreadSupportShortcut.mHasBadgeProviderUri) && (localUnreadSupportShortcut.mUnreadNumSwitch))
return true;
i += 1;
}
return false;
}
private void loadUnreadSupportShortcuts(String paramString)
{
System.currentTimeMillis();
if (DEBUG_UNREAD)
Log.d("OPPOUnreadLoader", "loadUnreadSupportShortcuts fileName = " + paramString);
Object localObject6 = null;
Object localObject7 = null;
Object localObject8 = null;
String str2 = null;
String str1 = str2;
Object localObject2 = localObject6;
Object localObject3 = localObject7;
Object localObject1 = localObject8;
while (true)
{
int i;
Object localObject9;
String str3;
boolean bool3;
boolean bool4;
try
{
localXmlPullParser = XmlPullParserFactory.newInstance().newPullParser();
str1 = str2;
localObject2 = localObject6;
localObject3 = localObject7;
localObject1 = localObject8;
paramString = this.mContext.getResources().getAssets().open(paramString);
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localXmlPullParser.setInput(paramString, "UTF-8");
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
XmlUtils.beginDocument(localXmlPullParser, "unreadshortcuts");
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
int j = localXmlPullParser.getDepth();
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
i = localXmlPullParser.next();
if (i == 3)
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
if (localXmlPullParser.getDepth() <= j);
}
else if (i != 1)
{
if (i != 2)
continue;
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
if (!"shortcut".equals(localXmlPullParser.getName()))
continue;
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
int k = localXmlPullParser.getAttributeCount();
localObject7 = "";
localObject6 = "";
str2 = "";
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localArrayList = new ArrayList();
bool2 = false;
bool1 = false;
i = 0;
if (i < k)
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
str4 = localXmlPullParser.getAttributeName(i);
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
if (str4.equals("appName"))
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localObject8 = localXmlPullParser.getAttributeValue(i);
localObject9 = localObject6;
str3 = str2;
bool3 = bool2;
bool4 = bool1;
}
else
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
if (str4.equals("unreadPackageName"))
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localObject9 = localXmlPullParser.getAttributeValue(i);
localObject8 = localObject7;
str3 = str2;
bool3 = bool2;
bool4 = bool1;
}
else
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
if (str4.equals("unreadClassName"))
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
str3 = localXmlPullParser.getAttributeValue(i);
localObject8 = localObject7;
localObject9 = localObject6;
bool3 = bool2;
bool4 = bool1;
}
else
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
if (str4.startsWith("uri"))
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localObject8 = localXmlPullParser.getAttributeValue(i);
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
if (BadgeProvider.BadgeItems.CONTENT_URI.toString().equals(localObject8))
bool1 = true;
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localArrayList.add(new UriObserverEntry((String)localObject8, null));
localObject8 = localObject7;
localObject9 = localObject6;
str3 = str2;
bool3 = bool2;
bool4 = bool1;
}
}
}
}
}
}
}
catch (XmlPullParserException paramString)
{
XmlPullParser localXmlPullParser;
ArrayList localArrayList;
String str4;
localObject1 = str1;
Log.w("OPPOUnreadLoader", "Got XmlPullParserException while parsing unread shortcuts.");
closeInputStream(str1);
return;
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localObject8 = localObject7;
localObject9 = localObject6;
str3 = str2;
bool3 = bool2;
bool4 = bool1;
if (str4.startsWith("notifyForDescendents"))
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localObject8 = localObject7;
localObject9 = localObject6;
str3 = str2;
bool3 = bool2;
bool4 = bool1;
if (localXmlPullParser.getAttributeValue(i).equals("true"))
{
bool3 = true;
localObject8 = localObject7;
localObject9 = localObject6;
str3 = str2;
bool4 = bool1;
break label889;
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
localObject8 = mLogLock;
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
try
{
sUnreadSupportShortcuts.add(new UnreadSupportShortcut((String)localObject7, (String)localObject6, str2, localArrayList, bool2, bool1));
continue;
}
finally
{
str1 = paramString;
localObject2 = paramString;
localObject3 = paramString;
localObject1 = paramString;
}
}
}
}
catch (IOException paramString)
{
localObject1 = localObject2;
Log.w("OPPOUnreadLoader", "Got IOException while parsing unread shortcuts.");
return;
closeInputStream(paramString);
return;
}
catch (RuntimeException paramString)
{
localObject1 = localObject3;
Log.w("OPPOUnreadLoader", "Got RuntimeException while parsing unread shortcuts.");
return;
}
finally
{
closeInputStream((InputStream)localObject1);
}
label889: i += 1;
localObject7 = localObject8;
localObject6 = localObject9;
Object localObject5 = str3;
boolean bool2 = bool3;
boolean bool1 = bool4;
}
}
public static void setUnreadNumberAt(int paramInt1, int paramInt2)
{
if (paramInt1 >= 0);
try
{
if (paramInt1 < sUnreadSupportShortcuts.size())
{
if (DEBUG_UNREAD)
Log.d("OPPOUnreadLoader", "setUnreadNumberAt: index = " + paramInt1 + ",unreadNum = " + paramInt2 + getUnreadSupportShortcutInfo());
if (!((UnreadSupportShortcut)sUnreadSupportShortcuts.get(paramInt1)).mUnreadNumSwitch)
break label99;
}
label99: for (((UnreadSupportShortcut)sUnreadSupportShortcuts.get(paramInt1)).mUnreadNum = paramInt2; ; ((UnreadSupportShortcut)sUnreadSupportShortcuts.get(paramInt1)).mUnreadNum = 0)
return;
}
finally
{
}
}
private static int supportUnreadFeature(ComponentName paramComponentName)
{
int j;
if (paramComponentName == null)
{
j = -1;
return j;
}
int i = 0;
int k = sUnreadSupportShortcuts.size();
while (true)
{
if (i >= k)
break label51;
j = i;
if (((UnreadSupportShortcut)sUnreadSupportShortcuts.get(i)).mComponent.equals(paramComponentName))
break;
i += 1;
}
label51: return -1;
}
private void updateUnreadShortcut(ComponentName paramComponentName)
{
if (paramComponentName == null);
int m;
do
{
return;
m = supportUnreadFeature(paramComponentName);
paramComponentName = getUnreadSupportShortcut(paramComponentName);
}
while (paramComponentName == null);
int j;
if (((UnreadSupportShortcut)sUnreadSupportShortcuts.get(m)).mUnreadNumSwitch)
{
j = getUnreadNum(paramComponentName);
i = j;
if (j <= 100);
}
for (int i = 100; ; i = 0)
{
int k = getUnreadNumberAt(m);
j = k;
if (k > 100)
j = 100;
if (j == i)
break;
setUnreadNumberAt(m, i);
paramComponentName = (UnreadCallbacks)this.mCallbacks.get();
if (paramComponentName == null)
break;
paramComponentName.bindComponentUnreadChanged(((UnreadSupportShortcut)sUnreadSupportShortcuts.get(m)).mComponent, i);
return;
}
}
public int getMissedCallCount()
{
return Settings.System.getInt(this.mContext.getContentResolver(), "oppo.missed.calls.number", 0);
}
public int getNewEmailCount()
{
int n = 0;
int m = 0;
int i1 = 0;
int i = 0;
Object localObject5 = null;
Object localObject1 = null;
Object localObject3 = null;
int j = n;
int k = i1;
try
{
localCursor = this.mContext.getContentResolver().query(Uri.parse("content://com.android.email.provider/mailbox"), new String[] { "unreadCount" }, "type = 0", null, null);
if (localCursor != null)
{
localObject3 = localCursor;
j = n;
localObject5 = localCursor;
k = i1;
localObject1 = localCursor;
localCursor.moveToFirst();
while (true)
{
localObject3 = localCursor;
j = i;
m = i;
localObject5 = localCursor;
k = i;
localObject1 = localCursor;
if (localCursor.isAfterLast())
break;
localObject3 = localCursor;
j = i;
localObject5 = localCursor;
k = i;
localObject1 = localCursor;
i += localCursor.getInt(0);
localObject3 = localCursor;
j = i;
localObject5 = localCursor;
k = i;
localObject1 = localCursor;
localCursor.moveToNext();
}
}
}
catch (CursorIndexOutOfBoundsException localCursorIndexOutOfBoundsException)
{
Cursor localCursor;
localObject2 = localObject3;
Log.w("OPPOUnreadLoader", "Got CursorIndexOutOfBoundsException while getNewEmailCount.");
return j;
return m;
}
catch (SecurityException localSecurityException)
{
localObject2 = localObject5;
Log.e("OPPOUnreadLoader", "getNewEmailCount --- e = " + localSecurityException);
return k;
}
finally
{
Object localObject2;
closeCursor(localObject2);
}
}
public int getNewMmsCount()
{
return 0;
}
public int getNewSmsCount()
{
return Settings.System.getInt(this.mContext.getContentResolver(), "oppo.unread.mms.number", 0);
}
public int getNewUpdateCount()
{
int i = 0;
Object localObject3 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://com.oppo.market/upgrade"), null, null, null, null);
if (localCursor != null)
{
localObject1 = localCursor;
localObject3 = localCursor;
i = localCursor.getCount();
}
return i;
}
catch (Exception localException)
{
localObject4 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getNewUpdateCount.");
return 0;
}
finally
{
Object localObject4;
closeCursor(localObject4);
}
}
public int getNewWPSEmailCount()
{
int i = 0;
Object localObject3 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://com.android.email.provider/uifolder/1152921504606846976"), null, "_id = ?", new String[] { "1152921504606846976" + "" }, null);
if (localCursor != null)
{
localObject1 = localCursor;
localObject3 = localCursor;
localCursor.moveToFirst();
localObject1 = localCursor;
localObject3 = localCursor;
i = localCursor.getInt(localCursor.getColumnIndex("unreadCount"));
}
return i;
}
catch (Exception localException)
{
localObject4 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getNewWPSEmailCount.");
return 0;
}
finally
{
Object localObject4;
closeCursor(localObject4);
}
}
public int getOTACount()
{
int j = 0;
int i = 0;
Object localObject3 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://com.oppo.ota/patch"), null, null, null, null);
if (localCursor != null)
{
localObject1 = localCursor;
localObject3 = localCursor;
i = localCursor.getCount();
}
closeCursor(localCursor);
if (i > 0)
return 1;
}
catch (Exception localException)
{
while (true)
{
localObject4 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getOTACount.");
closeCursor(localObject1);
i = j;
}
}
finally
{
Object localObject4;
closeCursor(localObject4);
}
return 0;
}
public int getOppoCommunityCount()
{
int j = 0;
Object localObject3 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://com.oppo.community.provider.forum2/last_user_signin"), null, "show_notices = 1", null, null);
int i = j;
if (localCursor != null)
{
i = j;
localObject1 = localCursor;
localObject3 = localCursor;
if (localCursor.moveToFirst())
{
localObject1 = localCursor;
localObject3 = localCursor;
i = localCursor.getInt(localCursor.getColumnIndex("new_notices"));
}
}
return i;
}
catch (Exception localException)
{
localObject4 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getOppoCommunityCount.");
return 0;
}
finally
{
Object localObject4;
closeCursor(localObject4);
}
}
public int getPricacyNewSmsCount()
{
int i = 0;
Object localObject3 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://sms"), null, "type = 1 and read = 0 and thread_id in (select _id from threads where is_secret = 1)", null, null);
if (localCursor != null)
{
localObject1 = localCursor;
localObject3 = localCursor;
i = localCursor.getCount();
}
return i;
}
catch (Exception localException)
{
localObject4 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getPricacyNewSmsCount.");
return 0;
}
finally
{
Object localObject4;
closeCursor(localObject4);
}
}
public int getPrivacyMissedCallCount()
{
int i = 0;
int j = 0;
Object localObject = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(CallLog.Calls.CONTENT_URI, new String[] { "number", "type", "new" }, "private_type=?", new String[] { "1" }, "date DESC");
localObject = localCursor;
if (localObject != null)
{
i = j;
while (localObject.moveToNext())
switch (localObject.getInt(localObject.getColumnIndex("type")))
{
default:
break;
case 3:
if (localObject.getInt(localObject.getColumnIndex("new")) == 1)
i += 1;
break;
}
}
}
catch (Exception localException)
{
while (true)
Log.e("OPPOUnreadLoader", "getPrivacyMissedCallCount --- e = " + localException);
closeCursor(localObject);
}
return i;
}
public int getPrivacyNewMmsCount()
{
int i = 0;
Object localObject3 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(Uri.parse("content://mms/inbox"), null, "read = 0 AND (m_type=132 or m_type=130) and thread_id in (select _id from threads where is_secret = 1)", null, null);
if (localCursor != null)
{
localObject1 = localCursor;
localObject3 = localCursor;
i = localCursor.getCount();
}
return i;
}
catch (Exception localException)
{
localObject4 = localObject1;
Log.w("OPPOUnreadLoader", "Got Exception while getPrivacyNewMmsCount.");
return 0;
}
finally
{
Object localObject4;
closeCursor(localObject4);
}
}
public int getUpdateBookCount()
{
try
{
int i = this.mContext.getContentResolver().call(Uri.parse("content://com.zhangyue.iReader.provider.bookcount/"), "getnewchapter", null, null).getInt("bookscounthasnewchapter");
return i;
}
catch (Exception localException)
{
Log.w("OPPOUnreadLoader", "Got Exception while getUpdateBookCount.");
}
return 0;
}
public void initialize(UnreadCallbacks paramUnreadCallbacks)
{
this.mCallbacks = new WeakReference(paramUnreadCallbacks);
if (DEBUG_UNREAD)
Log.d("OPPOUnreadLoader", "initialize: callbacks = " + paramUnreadCallbacks + ",mCallbacks = " + this.mCallbacks);
}
public void loadAndInitUnreadShortcuts(String paramString)
{
loadUnreadSupportShortcuts(paramString);
updateUnreadNumberSwitch(false);
initUnreadNumberContentObserver();
updateAllUnreadShortcuts();
}
public void openAllAppsSwitch()
{
if (this.sWorker == null)
return;
this.sWorker.removeCallbacksAndMessages(this.mBadgeSwitchUpdateObject);
Message localMessage = Message.obtain(this.sWorker, new Runnable()
{
public void run()
{
int i = 0;
int j = OPPOUnreadLoader.sUnreadSupportShortcuts.size();
while (i < j)
{
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)OPPOUnreadLoader.sUnreadSupportShortcuts.get(i);
if ((localUnreadSupportShortcut != null) && (!localUnreadSupportShortcut.mUnreadNumSwitch))
{
localUnreadSupportShortcut.registerObserver(OPPOUnreadLoader.this.mContext, OPPOUnreadLoader.this.mContentResolver);
localUnreadSupportShortcut.mUnreadNumSwitch = true;
localUnreadSupportShortcut.mUnreadNum = OPPOUnreadLoader.this.getUnreadNum(localUnreadSupportShortcut);
OPPOUnreadLoader.this.postBindComponentUnreadChanged(localUnreadSupportShortcut);
}
i += 1;
}
if ((OPPOUnreadLoader.this.isBadgeProviderShortcutExistAndSwitchOpen()) && (OPPOUnreadLoader.this.mBadgeProviderObserver == null))
{
OPPOUnreadLoader.access$602(OPPOUnreadLoader.this, new BaseContentObserver(OPPOUnreadLoader.this, null, new Handler(OPPOUnreadLoader.this.mContext.getMainLooper()), true));
OPPOUnreadLoader.this.mContentResolver.registerContentObserver(BadgeProvider.BadgeItems.CONTENT_URI, true, OPPOUnreadLoader.this.mBadgeProviderObserver);
}
}
});
localMessage.obj = this.mBadgeSwitchUpdateObject;
this.sWorker.sendMessageDelayed(localMessage, 800L);
}
public void postBindComponentUnreadChanged(final UnreadSupportShortcut paramUnreadSupportShortcut)
{
if ((paramUnreadSupportShortcut == null) || (this.sWorker == null))
return;
this.sWorker.post(new Runnable()
{
public void run()
{
if (OPPOUnreadLoader.this.mCallbacks != null)
{
UnreadCallbacks localUnreadCallbacks = (UnreadCallbacks)OPPOUnreadLoader.this.mCallbacks.get();
if (localUnreadCallbacks != null)
localUnreadCallbacks.bindComponentUnreadChanged(paramUnreadSupportShortcut.mComponent, paramUnreadSupportShortcut.mUnreadNum);
}
}
});
}
public void recycle()
{
if (this.sWorkerThread != null)
{
this.sWorkerThread.quitSafely();
this.sWorker = null;
}
mInstance = null;
}
public void unRegisterUnreadNumberContentObserver()
{
if (this.mContentResolver == null)
Log.w("OPPOUnreadLoader", "unRegisterUnreadNumberContentObserver mContentResolver == null");
do
{
return;
int i = 0;
int j = sUnreadSupportShortcuts.size();
while (i < j)
{
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)sUnreadSupportShortcuts.get(i);
if ((localUnreadSupportShortcut != null) && (localUnreadSupportShortcut.mUnreadNumSwitch))
localUnreadSupportShortcut.unRegisterObserver(this.mContentResolver);
i += 1;
}
this.mContentResolver.unregisterContentObserver(this.mUnReadAppSwitchObserver);
}
while (this.mBadgeProviderObserver == null);
this.mContentResolver.unregisterContentObserver(this.mBadgeProviderObserver);
this.mBadgeProviderObserver = null;
}
public void updateAllUnreadShortcuts()
{
int i = 0;
int j = sUnreadSupportShortcuts.size();
if (i < j)
{
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)sUnreadSupportShortcuts.get(i);
if (localUnreadSupportShortcut.mUnreadNumSwitch);
for (localUnreadSupportShortcut.mUnreadNum = getUnreadNum(localUnreadSupportShortcut); ; localUnreadSupportShortcut.mUnreadNum = 0)
{
postBindComponentUnreadChanged(localUnreadSupportShortcut);
i += 1;
break;
}
}
}
public void updateUnreadNumberSwitch(boolean paramBoolean)
{
label516: label654:
while (true)
{
Object localObject6;
try
{
if ((this.mContext == null) || (this.mContentResolver == null))
{
Log.w("OPPOUnreadLoader", "updateUnreadNumberSwitch mContext = " + this.mContext);
Log.w("OPPOUnreadLoader", "updateUnreadNumberSwitch mContentResolver = " + this.mContentResolver);
return;
}
localObject5 = null;
Object localObject1 = null;
try
{
Cursor localCursor = this.mContext.getContentResolver().query(POWERS_URI, new String[] { "pkg", "notification_user", "badge_user" }, null, null, null);
if (localCursor == null)
break label597;
localObject1 = localCursor;
localObject5 = localCursor;
if (localCursor.getCount() <= 0)
break label597;
localObject1 = localCursor;
localObject5 = localCursor;
int i = localCursor.getColumnIndexOrThrow("pkg");
localObject1 = localCursor;
localObject5 = localCursor;
int j = localCursor.getColumnIndexOrThrow("notification_user");
localObject1 = localCursor;
localObject5 = localCursor;
int k = localCursor.getColumnIndexOrThrow("badge_user");
localObject1 = localCursor;
localObject5 = localCursor;
if (!localCursor.moveToNext())
break label516;
localObject1 = localCursor;
localObject5 = localCursor;
localObject6 = localCursor.getString(i);
if (localObject6 == null)
continue;
localObject1 = localCursor;
localObject5 = localCursor;
localObject6 = getUnreadSupportShortcut((String)localObject6);
if (localObject6 == null)
continue;
localObject1 = localCursor;
localObject5 = localCursor;
boolean bool = ((UnreadSupportShortcut)localObject6).mUnreadNumSwitch;
localObject1 = localCursor;
localObject5 = localCursor;
if (localCursor.getInt(j) == 1)
{
localObject1 = localCursor;
localObject5 = localCursor;
if (localCursor.getInt(k) != 1)
{
localObject1 = localCursor;
localObject5 = localCursor;
((UnreadSupportShortcut)localObject6).mUnreadNumSwitch = false;
if (!paramBoolean)
continue;
localObject1 = localCursor;
localObject5 = localCursor;
if (bool == ((UnreadSupportShortcut)localObject6).mUnreadNumSwitch)
continue;
localObject1 = localCursor;
localObject5 = localCursor;
if (!((UnreadSupportShortcut)localObject6).mUnreadNumSwitch)
break label486;
localObject1 = localCursor;
localObject5 = localCursor;
((UnreadSupportShortcut)localObject6).registerObserver(this.mContext, this.mContentResolver);
localObject1 = localCursor;
localObject5 = localCursor;
((UnreadSupportShortcut)localObject6).mUnreadNum = getUnreadNum((UnreadSupportShortcut)localObject6);
localObject1 = localCursor;
localObject5 = localCursor;
postBindComponentUnreadChanged((UnreadSupportShortcut)localObject6);
continue;
}
}
}
catch (Exception localException)
{
localObject5 = localObject1;
Log.e("OPPOUnreadLoader", "updateUnreadNumberSwitch fail e = " + localException);
if (localObject1 == null)
continue;
localObject1.close();
continue;
localObject1 = localException;
localObject5 = localException;
((UnreadSupportShortcut)localObject6).mUnreadNumSwitch = true;
continue;
}
finally
{
if (localObject5 != null)
localObject5.close();
}
}
finally
{
}
Object localObject4 = localException;
Object localObject5 = localException;
((UnreadSupportShortcut)localObject6).mUnreadNumSwitch = false;
continue;
label486: localObject4 = localException;
localObject5 = localException;
((UnreadSupportShortcut)localObject6).unRegisterObserver(this.mContentResolver);
localObject4 = localException;
localObject5 = localException;
((UnreadSupportShortcut)localObject6).mUnreadNum = 0;
continue;
localObject4 = localException;
localObject5 = localException;
if (isBadgeProviderShortcutExistAndSwitchOpen())
{
localObject4 = localException;
localObject5 = localException;
if (this.mBadgeProviderObserver == null)
{
localObject4 = localException;
localObject5 = localException;
this.mBadgeProviderObserver = new BaseContentObserver(null, new Handler(this.mContext.getMainLooper()), true);
localObject4 = localException;
localObject5 = localException;
this.mContentResolver.registerContentObserver(BadgeProvider.BadgeItems.CONTENT_URI, true, this.mBadgeProviderObserver);
}
}
while (true)
{
label597: if (localException == null)
break label654;
localException.close();
break;
localObject4 = localException;
localObject5 = localException;
if (this.mBadgeProviderObserver != null)
{
localObject4 = localException;
localObject5 = localException;
this.mContentResolver.unregisterContentObserver(this.mBadgeProviderObserver);
localObject4 = localException;
localObject5 = localException;
this.mBadgeProviderObserver = null;
}
}
}
}
class BaseContentObserver extends ContentObserver
{
ComponentName mComponentName;
boolean mIsBadgeProviderObserver = false;
public BaseContentObserver(ComponentName paramHandler, Handler paramBoolean, boolean arg4)
{
super();
this.mComponentName = paramHandler;
boolean bool;
this.mIsBadgeProviderObserver = bool;
}
public void onChange(boolean paramBoolean, Uri paramUri)
{
Object localObject2 = null;
Object localObject1 = null;
Object localObject4 = null;
if (this.mIsBadgeProviderObserver)
{
Object localObject3 = localObject2;
localObject1 = localObject4;
if (paramUri != null)
{
String str = paramUri.getQueryParameter("packageName");
localObject3 = localObject2;
localObject1 = localObject4;
if (str != null)
{
localObject4 = OPPOUnreadLoader.getUnreadSupportShortcut(str);
localObject3 = localObject2;
localObject1 = localObject4;
if (localObject4 != null)
{
localObject3 = OPPOUnreadLoader.getMessageObj(((UnreadSupportShortcut)localObject4).mComponent);
localObject1 = localObject4;
}
}
}
localObject2 = localObject3;
localObject4 = localObject1;
if (localObject3 == null)
localObject2 = OPPOUnreadLoader.this.mBadgeProviderObject;
}
for (localObject4 = localObject1; localObject2 == null; localObject4 = localObject1)
{
Log.w("OPPOUnreadLoader", "onChange obj == null, uri = " + paramUri);
return;
localObject2 = OPPOUnreadLoader.getMessageObj(this.mComponentName);
}
OPPOUnreadLoader.this.sWorker.removeCallbacksAndMessages(localObject2);
if (this.mIsBadgeProviderObserver)
if (localObject4 != null)
paramUri = Message.obtain(OPPOUnreadLoader.this.sWorker, new WorkRunnable(OPPOUnreadLoader.this, ((UnreadSupportShortcut)localObject4).mComponent, false));
while (true)
{
paramUri.obj = localObject2;
OPPOUnreadLoader.this.sWorker.sendMessageDelayed(paramUri, 800L);
return;
paramUri = Message.obtain(OPPOUnreadLoader.this.sWorker, new WorkRunnable(OPPOUnreadLoader.this, null, true));
continue;
paramUri = Message.obtain(OPPOUnreadLoader.this.sWorker, new WorkRunnable(OPPOUnreadLoader.this, this.mComponentName, false));
}
}
}
public static abstract interface UnreadCallbacks
{
public abstract void bindComponentUnreadChanged(ComponentName paramComponentName, int paramInt);
}
class UnreadSupportShortcut
{
String mAppName;
ComponentName mComponent;
boolean mHasBadgeProviderUri;
boolean mNotifyForDescendents;
Object mObject;
int mUnreadNum;
boolean mUnreadNumSwitch;
ArrayList<UriObserverEntry> mUriObserverEntryList = new ArrayList();
public UnreadSupportShortcut(String paramString1, String paramArrayList, ArrayList<UriObserverEntry> paramBoolean1, boolean paramBoolean2, boolean arg6)
{
this.mAppName = paramString1;
this.mComponent = new ComponentName(paramArrayList, paramBoolean1);
this.mUnreadNum = 0;
this.mUnreadNumSwitch = true;
this.mUriObserverEntryList = paramBoolean2;
boolean bool1;
this.mNotifyForDescendents = bool1;
boolean bool2;
this.mHasBadgeProviderUri = bool2;
this.mObject = new Object();
}
public void registerObserver(Context paramContext, ContentResolver paramContentResolver)
{
if ((this.mUriObserverEntryList == null) || (paramContentResolver == null) || (paramContext == null));
while (true)
{
return;
int i = 0;
while (i < this.mUriObserverEntryList.size())
{
UriObserverEntry localUriObserverEntry = (UriObserverEntry)this.mUriObserverEntryList.get(i);
if ((localUriObserverEntry != null) && (localUriObserverEntry.mObserver == null) && (localUriObserverEntry.mUriString != null) && (!BadgeProvider.BadgeItems.CONTENT_URI.toString().equals(localUriObserverEntry.mUriString)))
{
localUriObserverEntry.mObserver = new BaseContentObserver(OPPOUnreadLoader.this, this.mComponent, new Handler(paramContext.getMainLooper()), false);
paramContentResolver.registerContentObserver(Uri.parse(localUriObserverEntry.mUriString), this.mNotifyForDescendents, localUriObserverEntry.mObserver);
}
i += 1;
}
}
}
public String toString()
{
return "{UnreadSupportShortcut[" + this.mComponent + "] " + ",mUnreadNum = " + this.mUnreadNum + ",mUnreadNumSwitch = " + this.mUnreadNumSwitch + "}";
}
public void unRegisterObserver(ContentResolver paramContentResolver)
{
if ((this.mUriObserverEntryList == null) || (paramContentResolver == null));
while (true)
{
return;
int i = 0;
while (i < this.mUriObserverEntryList.size())
{
UriObserverEntry localUriObserverEntry = (UriObserverEntry)this.mUriObserverEntryList.get(i);
if ((localUriObserverEntry != null) && (localUriObserverEntry.mObserver != null))
{
paramContentResolver.unregisterContentObserver(localUriObserverEntry.mObserver);
localUriObserverEntry.mObserver = null;
}
i += 1;
}
}
}
}
class UriObserverEntry
{
public BaseContentObserver mObserver;
public String mUriString;
public UriObserverEntry(String paramBaseContentObserver, BaseContentObserver arg3)
{
this.mUriString = paramBaseContentObserver;
Object localObject;
this.mObserver = localObject;
}
}
class WorkRunnable
implements Runnable
{
ComponentName mComponentName;
boolean mIsUpdateAllBadgeProviderShortcut = false;
public WorkRunnable(ComponentName paramBoolean, boolean arg3)
{
this.mComponentName = paramBoolean;
boolean bool;
this.mIsUpdateAllBadgeProviderShortcut = bool;
}
public void run()
{
if (this.mIsUpdateAllBadgeProviderShortcut)
{
int i = 0;
int j = OPPOUnreadLoader.sUnreadSupportShortcuts.size();
while (i < j)
{
UnreadSupportShortcut localUnreadSupportShortcut = (UnreadSupportShortcut)OPPOUnreadLoader.sUnreadSupportShortcuts.get(i);
if ((localUnreadSupportShortcut != null) && (localUnreadSupportShortcut.mHasBadgeProviderUri))
OPPOUnreadLoader.this.updateUnreadShortcut(localUnreadSupportShortcut.mComponent);
i += 1;
}
}
OPPOUnreadLoader.this.updateUnreadShortcut(this.mComponentName);
}
}
}
/* Location: OppoLauncher-dex2jar.jar
* Qualified Name: com.oppo.unreaderloader.OPPOUnreadLoader
* JD-Core Version: 0.6.2
*/ | [
"1004410930@qq.com"
] | 1004410930@qq.com |
5a0381992181306559087a27654564f771b9479a | 2dbc1ae6fdf14269144a3d734dfde1e6abb045d2 | /src/ua/nure/strebkov/SummaryTask3/entity/Transport.java | 96d34c2e2bf94e0636bc9b712e76242720968af1 | [] | no_license | esustreba/Practice7 | a2f45a3b9375fff5a6d31b148d8f600a91d089e3 | 6252f0d9bd38372dada2b8b2110f2a94d42681f9 | refs/heads/master | 2020-03-15T18:10:51.859324 | 2018-05-29T21:15:40 | 2018-05-29T21:15:40 | 132,278,161 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 287 | java | package ua.nure.strebkov.SummaryTask3.entity;
public enum Transport {
RAIL("RAIL"), PLAIN("PLAIN"), AUTO("AUTO"), SHIP("SHIP");
private String value;
Transport(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
| [
"strebkov@td-esat.com.ua"
] | strebkov@td-esat.com.ua |
2ceb28552c72961bbe3ff4968289c1b1a9a29ae3 | 1da056f7cb8647b144744ea6aed8be30fa7443cb | /Excersizes/pp.07local/pp.07.03-MavenFindWords/src/main/java/io/dama/ffi/actor/Main.java | a2f16928d612f318d13ae594000f48beda48f651 | [] | no_license | 1ckov/PP_Leucheter_2020-2021 | 93b87b678b867eb5a4deb4ed4c6d966cea878d80 | 089d8576154b258453e126504596a0edfd7a68e1 | refs/heads/main | 2023-02-27T04:53:09.818905 | 2021-02-08T14:19:17 | 2021-02-08T14:19:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 547 | java | package io.dama.ffi.actor;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import io.dama.ffi.messages.FindMsg;
public class Main {
public static void main(final String... args) {
var system = ActorSystem.create();
var master = system.actorOf(Props.create(MasterActor.class), "master");
String[] files = { "test1.txt", "test2.txt", "test3.txt", "test4.txt" };
var msg = new FindMsg(files, "Erlang");
master.tell(msg, ActorRef.noSender());
}
}
| [
"sa6o.hristov96@gmail.com"
] | sa6o.hristov96@gmail.com |
598dfaafa77009897881f7a669f11d5a2caca151 | 0c8b1a5ab2ca2a838c694d0e363108c9e04ea3f1 | /DVAApp/src/jb/dvacommon/ui/DVATextVerifyListener.java | fd61c6df78191920a7b639c4f5b5b75b50ab5802 | [] | no_license | jaboles/DVA5 | 572f72ffc02e4ea17995dcceccf997b0633d1daa | 14f6e577c0d2852039ae060805ce08ad07922aaa | refs/heads/master | 2023-04-30T15:04:23.310152 | 2023-04-22T20:55:41 | 2023-04-22T20:55:41 | 67,503,577 | 29 | 4 | null | 2022-11-26T15:50:29 | 2016-09-06T11:53:09 | Java | UTF-8 | Java | false | false | 185 | java | package jb.dvacommon.ui;
import java.net.URL;
import java.util.List;
public interface DVATextVerifyListener
{
void OnVerified(List<URL> verifiedSoundUrls);
void OnFailed();
}
| [
"jaboles@fastmail.fm"
] | jaboles@fastmail.fm |
e329be3d65aa359154b00f03b96532e3f6d08bb3 | e346778ea429d57910b2a8e107aadfcd5f76d7f7 | /src/main/java/br/com/s2it/incubadora/repository/ContribuinteRepository.java | 1c0a095a57be97b59196c4e0705f0625d9d83560 | [] | no_license | EwerthonSilva/avaliacao-pratica | 0c77d64136ec93ca41b80b71e63bf477f6916e02 | 7451fe20f1d5d05c32cb8090432ec1bca1435fec | refs/heads/master | 2020-06-03T19:19:59.240723 | 2015-08-26T20:53:17 | 2015-08-26T20:53:17 | 41,436,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 684 | java | package br.com.s2it.incubadora.repository;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import br.com.s2it.incubadora.model.Contribuinte;
@Repository
public class ContribuinteRepository extends AbstractRepository {
@SuppressWarnings("unchecked")
public List<Contribuinte> listAll() {
Criteria criteria = getSession().createCriteria(Contribuinte.class);
return criteria.list();
}
public Object findById(int id) {
Criteria criteria = getSession().createCriteria(Contribuinte.class);
criteria.add(Restrictions.eq("id", id));
return criteria.uniqueResult();
}
}
| [
"ewerthon.silva@s2it.colm.br"
] | ewerthon.silva@s2it.colm.br |
023b767f5fdbfe0a809275049a7501175ed474a4 | d7462ec35d59ed68f306b291bd8e505ff1d65946 | /common/asm/src/test/java/com/alibaba/citrus/asm/test/cases/Annotation.java | cc4eccaf78c9f482fa10ecd0e8a362870a815969 | [] | no_license | ixijiass/citrus | e6d10761697392fa51c8a14d4c9f133f0a013265 | 53426f1d73cc86c44457d43fb8cbe354ecb001fd | refs/heads/master | 2023-05-23T13:06:12.253428 | 2021-06-15T13:05:59 | 2021-06-15T13:05:59 | 368,477,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,915 | java | /*
* Copyright 2010 Alibaba Group Holding Limited.
* 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.
*
*/
/***
* ASM tests
* Copyright (c) 2002-2005 France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.alibaba.citrus.asm.test.cases;
import java.io.IOException;
import com.alibaba.citrus.asm.AnnotationVisitor;
import com.alibaba.citrus.asm.ClassWriter;
import com.alibaba.citrus.asm.FieldVisitor;
import com.alibaba.citrus.asm.MethodVisitor;
import com.alibaba.citrus.asm.Type;
/**
* Generates an annotation class with values of all types and a class using it.
*
* @author Eric Bruneton
*/
public class Annotation extends Generator {
final static int M = ACC_PUBLIC + ACC_ABSTRACT;
final static String STRING = "Ljava/lang/String;";
final static String CLASS = "Ljava/lang/Class;";
final static String DOC = "Ljava/lang/annotation/Documented;";
final static String DEPRECATED = "Ljava/lang/Deprecated;";
public void generate(final String dir) throws IOException {
generate(dir, "pkg/Annotation.class", dumpAnnotation());
generate(dir, "pkg/Annotated.class", dumpAnnotated());
}
public byte[] dumpAnnotation() {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
MethodVisitor mv;
AnnotationVisitor av0, av1;
cw.visit(V1_5, ACC_PUBLIC + ACC_ANNOTATION + ACC_ABSTRACT + ACC_INTERFACE, "pkg/Annotation", null,
"java/lang/Object", new String[] { "java/lang/annotation/Annotation" });
mv = cw.visitMethod(M, "byteValue", "()B", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new Byte((byte) 1));
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "charValue", "()C", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new Character((char) 1));
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "booleanValue", "()Z", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, Boolean.TRUE);
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "intValue", "()I", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new Integer(1));
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "shortValue", "()S", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new Short((short) 1));
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "longValue", "()J", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new Long(1L));
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "floatValue", "()F", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new Float("1.0"));
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "doubleValue", "()D", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new Double("1.0"));
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "stringValue", "()" + STRING, null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, "1");
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "classValue", "()" + CLASS, null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, Type.getType("Lpkg/Annotation;"));
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "enumValue", "()Lpkg/Enum;", null, null);
av0 = mv.visitAnnotationDefault();
av0.visitEnum(null, "Lpkg/Enum;", "V1");
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "annotationValue", "()" + DOC, null, null);
av0 = mv.visitAnnotationDefault();
av1 = av0.visitAnnotation(null, DOC);
av1.visitEnd();
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "byteArrayValue", "()[B", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new byte[] { 0, 1 });
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "charArrayValue", "()[C", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new char[] { '0', '1' });
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "booleanArrayValue", "()[Z", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new boolean[] { false, true });
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "intArrayValue", "()[I", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new int[] { 0, 1 });
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "shortArrayValue", "()[S", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new short[] { (short) 0, (short) 1 });
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "longArrayValue", "()[J", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new long[] { 0L, 1L });
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "floatArrayValue", "()[F", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new float[] { 0.0f, 1.0f });
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "doubleArrayValue", "()[D", null, null);
av0 = mv.visitAnnotationDefault();
av0.visit(null, new double[] { 0.0d, 1.0d });
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "stringArrayValue", "()" + STRING, null, null);
av0 = mv.visitAnnotationDefault();
av1 = av0.visitArray(null);
av1.visit(null, "0");
av1.visit(null, "1");
av1.visitEnd();
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "classArrayValue", "()[" + CLASS, null, null);
av0 = mv.visitAnnotationDefault();
av1 = av0.visitArray(null);
av1.visit(null, Type.getType("Lpkg/Annotation;"));
av1.visit(null, Type.getType("Lpkg/Annotation;"));
av1.visitEnd();
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "enumArrayValue", "()[Lpkg/Enum;", null, null);
av0 = mv.visitAnnotationDefault();
av1 = av0.visitArray(null);
av1.visitEnum(null, "Lpkg/Enum;", "V0");
av1.visitEnum(null, "Lpkg/Enum;", "V1");
av1.visitEnd();
av0.visitEnd();
mv.visitEnd();
mv = cw.visitMethod(M, "annotationArrayValue", "()[" + DOC, null, null);
av0 = mv.visitAnnotationDefault();
av1 = av0.visitArray(null);
av1.visitAnnotation(null, DOC).visitEnd();
av1.visitAnnotation(null, DOC).visitEnd();
av1.visitEnd();
av0.visitEnd();
mv.visitEnd();
cw.visitEnd();
return cw.toByteArray();
}
public byte[] dumpAnnotated() {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
FieldVisitor fv;
MethodVisitor mv;
AnnotationVisitor av0, av1;
cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, "pkg/Annotated", null, "java/lang/Object", null);
// visible class annotation
cw.visitAnnotation(DEPRECATED, true).visitEnd();
// invisible class annotation, with values of all types
av0 = cw.visitAnnotation("Lpkg/Annotation;", false);
av0.visit("byteValue", new Byte((byte) 0));
av0.visit("charValue", new Character((char) 48));
av0.visit("booleanValue", Boolean.FALSE);
av0.visit("intValue", new Integer(0));
av0.visit("shortValue", new Short((short) 0));
av0.visit("longValue", new Long(0L));
av0.visit("floatValue", new Float("0.0"));
av0.visit("doubleValue", new Double("0.0"));
av0.visit("stringValue", "0");
av0.visitEnum("enumValue", "Lpkg/Enum;", "V0");
av0.visitAnnotation("annotationValue", DOC).visitEnd();
av0.visit("classValue", Type.getType("Lpkg/Annotation;"));
av0.visit("byteArrayValue", new byte[] { 1, 0 });
av0.visit("charArrayValue", new char[] { '1', '0' });
av0.visit("booleanArrayValue", new boolean[] { true, false });
av0.visit("intArrayValue", new int[] { 1, 0 });
av0.visit("shortArrayValue", new short[] { (short) 1, (short) 0 });
av0.visit("longArrayValue", new long[] { 1L, 0L });
av0.visit("floatArrayValue", new float[] { 1.0f, 0.0f });
av0.visit("doubleArrayValue", new double[] { 1.0d, 0.0d });
av1 = av0.visitArray("stringArrayValue");
av1.visit(null, "1");
av1.visit(null, "0");
av1.visitEnd();
av0.visitArray("classArrayValue").visitEnd();
av1 = av0.visitArray("enumArrayValue");
av1.visitEnum(null, "Lpkg/Enum;", "V1");
av1.visitEnum(null, "Lpkg/Enum;", "V2");
av1.visitEnd();
av0.visitArray("annotationArrayValue").visitEnd();
av0.visitEnd();
fv = cw.visitField(ACC_PUBLIC, "f", "I", null, null);
// visible field annotation
fv.visitAnnotation(DEPRECATED, true).visitEnd();
// invisible field annotation
av0 = fv.visitAnnotation("Lpkg/Annotation;", false);
av0.visitEnum("enumValue", "Lpkg/Enum;", "V0");
av0.visitEnd();
fv.visitEnd();
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "(IIIIIIIIII)V", null, null);
// visible method annotation
mv.visitAnnotation(DEPRECATED, true).visitEnd();
// invisible method annotation
av0 = mv.visitAnnotation("Lpkg/Annotation;", false);
av0.visitAnnotation("annotationValue", DOC).visitEnd();
av0.visitEnd();
// synthetic parameter annotation
mv.visitParameterAnnotation(0, "Ljava/lang/Synthetic;", false);
// visible parameter annotation
mv.visitParameterAnnotation(8, DEPRECATED, true).visitEnd();
// invisible parameter annotation
av0 = mv.visitParameterAnnotation(8, "Lpkg/Annotation;", false);
av0.visitArray("stringArrayValue").visitEnd();
av0.visitEnd();
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
return cw.toByteArray();
}
}
| [
"isheng19982qrr@126.com"
] | isheng19982qrr@126.com |
e8d8e969f1e2748051078cf6e46f7da6a0ed12df | 2947858817e4acd49eb407cc920e39060b9a8d7a | /src/main/java/com/jmx/designPattern/singleton/EnumSingleton.java | d2328db27d2536044812af674442989e68f0aae4 | [] | no_license | bydzjmx/MyRereview | 0ccbff82e8feb6b0afe7a923e10f677838d39c80 | 7a605fdb319e86421d64a70c37803ad03ac3ab68 | refs/heads/master | 2022-02-17T01:09:21.704169 | 2019-08-28T01:03:19 | 2019-08-28T01:03:19 | 197,864,483 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 185 | java | package com.jmx.designPattern.singleton;
public enum EnumSingleton {
//ๆฌ่บซๅฐฑๆฏๅไพ
INSTANCE;
//ๆทปๅ ่ชๅทฑ็ๆไฝ
public void singletonOperation(){
}
}
| [
"mrjiangmx@163.com"
] | mrjiangmx@163.com |
22eced31448064f1d99315fe894a69bf039268b3 | 6ba18eb9315bad994896558b9bd9fb285432d6b4 | /android/src/main/java/com/tencent/game/native_image_view/NativeImageViewPlugin.java | 4c0ed2a660e046ac6e93e1acec4a1ef615b77f84 | [
"MIT"
] | permissive | zhangfeixiang/native_image_view | 77ecfd31d04102278f7bdc35565a114db4ecd0bc | 28e798948302c833517e0591fbe9146ec2e45af1 | refs/heads/main | 2023-04-04T18:31:03.835727 | 2021-04-17T06:24:52 | 2021-04-17T06:24:52 | 358,603,892 | 0 | 0 | NOASSERTION | 2021-04-16T13:12:26 | 2021-04-16T13:12:25 | null | UTF-8 | Java | false | false | 4,790 | java | package com.tencent.game.native_image_view;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.cache.ExternalCacheDiskCacheFactory;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.HashMap;
/** NativeImageViewPlugin */
/// The MethodChannel that will the communication between Flutter and native Android
///
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
/// when the Flutter Engine is detached from the Activity
public class NativeImageViewPlugin implements FlutterPlugin, MethodCallHandler {
private MethodChannel channel;
private Context context;
void setContext(Context ctx){
this.context = ctx;
}
//ๆฐ็็ปไปถๆณจๅๆฅๅฃ
@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
channel = new MethodChannel(flutterPluginBinding.getFlutterEngine().getDartExecutor(), "com.tencent.game/native_image_view");
channel.setMethodCallHandler(this);
setContext(flutterPluginBinding.getApplicationContext());
}
@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
channel.setMethodCallHandler(null);
}
// Flutter-1.12ไนๅ็็ปไปถๆณจๅๆฅๅฃ๏ผๅ่ฝไธonAttachedToEngineไธๆ ท
public static void registerWith(Registrar registrar) {
NativeImageViewPlugin plugin = new NativeImageViewPlugin();
plugin.setContext(registrar.context());
final MethodChannel channel = new MethodChannel(registrar.messenger(), "com.tencent.game/native_image_view");
channel.setMethodCallHandler(plugin);
}
@Override
public void onMethodCall(@NonNull final MethodCall call, @NonNull final Result result) {
if (call.method.equals("getImage")) {
getImageHandler(call,result);
} else {
result.notImplemented();
}
}
public void getImageHandler(@NonNull final MethodCall call, @NonNull final Result result){
HashMap map = (HashMap) call.arguments;
String urlStr = map.get("url").toString();
Uri uri = Uri.parse(urlStr);
if("localImage".equals(uri.getScheme())){
String imageName = uri.getHost();
int lastIndex = imageName.lastIndexOf(".");
if(lastIndex > 0){
imageName = imageName.substring(0,lastIndex);
}
String imageUri = "@drawable/"+imageName;
int imageResource = context.getResources().getIdentifier(imageUri, null, context.getPackageName());
if(imageResource > 0){
Bitmap bmp = BitmapFactory.decodeResource(context.getResources(),imageResource);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
result.success(byteArray);
}else{
result.error("NOT_FOUND","file not found",call.arguments);
}
}else {
Glide.with(context).download(urlStr).into(new CustomTarget<File>() {
@Override
public void onResourceReady(@NonNull File resource, @Nullable Transition<? super File> transition) {
byte[] bytesArray = new byte[(int) resource.length()];
try {
FileInputStream fis = new FileInputStream(resource);
fis.read(bytesArray);
fis.close();
result.success(bytesArray);
} catch (IOException e) {
e.printStackTrace();
result.error("READ_FAIL",e.toString(),call.arguments);
}
}
@Override
public void onLoadFailed(@Nullable Drawable errorDrawable) {
super.onLoadFailed(errorDrawable);
result.error("LOAD_FAIL","image download fail",call.arguments);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
result.error("LOAD_CLEARED","image load clear",call.arguments);
}
});
}
}
}
| [
"allenzzzhao@tencent.com"
] | allenzzzhao@tencent.com |
e26746762650dbeeaa10f661937dbfae0e6bdfc4 | ee68d1b06ed323be3feafe040954dabb08ffd142 | /src/com/designPatterns/strategyPattern/Plane.java | ab2bf33523148dbe04e87c8f3fb4dfffe0650c21 | [] | no_license | tskpcp/DesignPatterns | b45d03b64605e78c2cce83466069c811a3d72f74 | ae471ab401ee37d9884fdd25ab647b5fe1b07559 | refs/heads/master | 2021-01-01T16:08:41.014999 | 2017-12-20T06:48:43 | 2017-12-20T06:48:43 | 92,353,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 249 | java | package com.designPatterns.strategyPattern;
/**
* Created by gongtuo on 2017/5/27.
*/
public class Plane implements Vehicle {
@Override
public void go(String address) {
System.out.println("I `ll go"+address+"by Plane.");
}
}
| [
"tskpcp@126.com"
] | tskpcp@126.com |
c20665635d5f024143c8f3465f5091ab45000cff | 3472ebdcb88c859b928852e3c2d8c1a0b35be42c | /src/flyweight/example/after/Main.java | aa4c8fd778fbfd843eec4c539f625f4a678ea145 | [
"BSD-3-Clause"
] | permissive | markKL1/flyweight | 723738dfccb4a0da1f00ba0c49a6ab80bcc0fe99 | 07b1022b0f07f07e9d003f972e1aa5bacc83e29a | refs/heads/master | 2021-04-15T15:03:01.774202 | 2018-04-02T19:24:18 | 2018-04-02T19:24:18 | 126,378,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package flyweight.example.after;
import java.awt.*;
import flyweight.example.misc.Price;
import flyweight.example.misc.Weight;
public class Main {
public static void main(String[] args) {
Fruit.make("Banana", Color.YELLOW, new Weight(250), new Price(0,19));
Fruit.make("Apple", Color.RED, new Weight(520), new Price(0,59));
Fruit.make("Apple", Color.RED, new Weight(610), new Price(0,99));
Fruit.make("Apple", Color.RED, new Weight(450), new Price(0,49));
Fruit.make("Apple", Color.RED, new Weight(300), new Price(0,15));
Fruit.make("Banana", Color.YELLOW, new Weight(190), new Price(0,15));
Fruit.make("Banana", Color.YELLOW, new Weight(260), new Price(0,21));
}
}
| [
"mark@elsa"
] | mark@elsa |
7e37906d5232f6b3680260622cf1ca5441b4cd6d | 14a42848410c1517767c35833affb121ab92a1a1 | /MobileApp/app/src/main/java/com/bignerdranch/android/hackhealth/SignUpPage.java | 60936d6bbabcd2abd87dfe6f10e44bc9f309e7a2 | [] | no_license | HHealth16/HHealth | 6b8cffe2a904366af2ebbb78be8444626deb4c6c | 57d57362603990980b6d17966b55f85549adbbdd | refs/heads/master | 2020-04-19T11:06:38.785877 | 2016-09-10T23:33:58 | 2016-09-10T23:33:58 | 67,880,026 | 1 | 0 | null | 2016-09-10T17:54:39 | 2016-09-10T15:52:17 | null | UTF-8 | Java | false | false | 6,534 | java | package com.bignerdranch.android.hackhealth;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class SignUpPage extends AppCompatActivity implements View.OnClickListener {
private static final String TAG = "SignupPage";
// [START declare_auth]
private FirebaseAuth mAuth;
// [END declare_auth]
// [START declare_auth_listener]
private FirebaseAuth.AuthStateListener mAuthListener;
// [END declare_auth_listener]
private DatabaseReference mDatabase;
private EditText mName;
private EditText mEmail;
private EditText mPassword;
private EditText mAge;
private CheckBox mMale;
private CheckBox mFemale;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup_page);
setTitle("Health Pal");
mName = (EditText) findViewById(R.id.etName);
mEmail = (EditText) findViewById(R.id.etEmail);
mPassword = (EditText) findViewById(R.id.etPassword);
mAge = (EditText) findViewById(R.id.etAge);
mMale = (CheckBox) findViewById(R.id.checkBoxMale);
mFemale = (CheckBox) findViewById(R.id.checkBoxFemale);
findViewById(R.id.signup_button).setOnClickListener(this);
mMale.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
mFemale.setChecked(false);
mMale.setChecked(b);
}
});
mFemale.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
mMale.setChecked(false);
mFemale.setChecked(b);
}
});
// [START initialize_auth]
mAuth = FirebaseAuth.getInstance();
// [END initialize_auth]
// [START auth_state_listener]
mAuthListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user != null) {
// User is signed in
Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid());
} else {
// User is signed out
Log.d(TAG, "onAuthStateChanged:signed_out");
}
}
};
// [END auth_state_listener]
mDatabase = FirebaseDatabase.getInstance().getReference();
}
@Override
public void onStart() {
super.onStart();
mAuth.addAuthStateListener(mAuthListener);
}
@Override
public void onStop() {
super.onStop();
if (mAuthListener != null) {
mAuth.removeAuthStateListener(mAuthListener);
}
}
private void createAccount(String email, String password) {
Log.d(TAG, "createAccount:" + email);
if (!validateForm()) {
return;
}
// [START create_user_with_email]
mAuth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Log.d(TAG, "createUserWithEmail:onComplete:" + task.isSuccessful());
// If sign in fails, display a message to the user. If sign in succeeds
// the auth state listener will be notified and logic to handle the
// signed in user can be handled in the listener.
if (!task.isSuccessful()) {
Toast.makeText(SignUpPage.this, "Sign Up Failed. Try Again",
Toast.LENGTH_SHORT).show();
} else {
onAuthSuccess(task.getResult().getUser());
}
}
});
// [END create_user_with_email]
}
private void onAuthSuccess(FirebaseUser user) {
// Write new user
writeNewUser(user.getUid(), user.getEmail(), mName.getText().toString(), mAge.getText().toString());
// Go to MainActivity
startActivity(new Intent(SignUpPage.this, UserMainActivity.class));
finish();
}
private void writeNewUser(String userId, String email, String name, String age) {
User user = new User(email, name, age);
mDatabase.child("users").child(userId).setValue(user);
}
private boolean validateForm() {
boolean valid = true;
String email = mEmail.getText().toString();
if (TextUtils.isEmpty(email)) {
mEmail.setError("Required.");
valid = false;
} else {
mEmail.setError(null);
}
String password = mPassword.getText().toString();
if (TextUtils.isEmpty(password)) {
mPassword.setError("Required.");
valid = false;
} else {
mPassword.setError(null);
}
if (password.length() < 6) {
mPassword.setError("Minimum length of 6 characters.");
valid = false;
} else {
mPassword.setError(null);
}
return valid;
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.signup_button:
createAccount(
mEmail.getText().toString(),
mPassword.getText().toString());
break;
}
}
}
| [
"edmundliang@Edmunds-MacBook-Pro.local"
] | edmundliang@Edmunds-MacBook-Pro.local |
a0c88bbe3a0804901422570055096943b60f4942 | 7de59a4faaed1fc698e58e83ea3090a7e6b28464 | /src/test/java/com/example/UnitTest.java | f2aefefc459bd5dcb79b445a5233cb4804c705a1 | [] | no_license | Ravisankar-Challa/JavaEE6_Jacoco | 8b6b044f9e631259346a909cfcbd6111bea58d2d | f190057d0870238871a41d773831101422ee162b | refs/heads/master | 2020-04-14T19:31:33.826804 | 2015-09-11T23:44:32 | 2015-09-11T23:44:32 | 41,555,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 393 | java | package com.example;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import com.example.control.UnitTestExample;
public class UnitTest {
private UnitTestExample unitTestExample;
@Before
public void setup() {
unitTestExample = new UnitTestExample();
}
@Test
public void testAdd() {
assertEquals(6, unitTestExample.add(4, 2));
}
}
| [
"sankar_ravi_c@yahoo.co.in"
] | sankar_ravi_c@yahoo.co.in |
1b12dcb6c617b103f2f184c0aceda461fc5efb52 | 3eed7f5d4e469760be2381aea3172bfeb20ead64 | /5_communication_between_microservice/Rest-Template/Movie-Catalague/src/main/java/com/lockdown/MovieCatalague/models/movieInfoService/Movie.java | 2abe0da18a3a97a6ea7c7875fa32d3d7f449ae32 | [] | no_license | tavisca-vreddy/lockdown | 998f5e2cb91864fd313e2e824d782e051427301b | 684585229c77443a215c1b92228bc4d7b3925042 | refs/heads/master | 2022-12-27T16:22:05.660014 | 2020-10-13T12:54:48 | 2020-10-13T12:54:48 | 302,025,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java | package com.lockdown.MovieCatalague.models.movieInfoService;
public class Movie {
private int id;
private String name;
private String description;
public int getId() {
return id;
}
public Movie()
{
}
public Movie(int id, String name, String description) {
this.id = id;
this.name = name;
this.description = description;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
| [
"51921004+tavisca-vreddy@users.noreply.github.com"
] | 51921004+tavisca-vreddy@users.noreply.github.com |
d783993ec2e130162d958eb2a668af0d4c91dcf5 | 0a4464334ee2c6c131430020740ca77d80d992e0 | /src/BienesMuebles/recursos/clases/ItemAvion.java | d4801d522b5ac2e693153529de3119b1ff65cc30 | [] | no_license | Esauceda/PII_2021_1_P2_PROYECTO2 | 7afe3b6118e4faac6ddf81582996bb7af15bd208 | 386c495c7d52f4ef34b4e3bcf5924142aa9ec2ef | refs/heads/master | 2023-03-27T13:24:34.635632 | 2021-03-27T23:31:01 | 2021-03-27T23:31:01 | 352,006,505 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package BienesMuebles.recursos.clases;
public class ItemAvion {
private String NombrePropietario;
private int Id;
public ItemAvion(String nombrePropietario, int id){
this.NombrePropietario = nombrePropietario;
this.Id = id;
}
public int getId(){
return Id;
}
public void setId(int id){
this.Id = id;
}
public String getNombrePropietario(){
return NombrePropietario;
}
public void setNombrePropietario(String nombrePropietario){
this.NombrePropietario = nombrePropietario;
}
@Override
public String toString(){
return NombrePropietario;
}
//------------------------------------------------------------------------------------------------------------------
}
| [
"saucedaedu15@gmail.com"
] | saucedaedu15@gmail.com |
8d40202eb3001db7b89bdeef7925f3e80a106bdb | 98415fdfd2e96b9b2dd6be376c1bd0e8584e7cb6 | /app/src/main/java/com/universalstudios/orlandoresort/frommergeneedsrefactor/upr_android_406/IBMData/Account/request/DeleteGuestAddressRequest.java | da5c6b2eac3b11bec070e6c72ebc3061a9a0031d | [] | no_license | SumanthAndroid/UO | 202371c7ebdcb5c635bae88606b4a4e0d004862c | f201c043eae70eecac9972f2e439be6a03a61df6 | refs/heads/master | 2021-01-19T13:41:20.592334 | 2017-02-28T08:04:42 | 2017-02-28T08:04:42 | 82,409,297 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,129 | java | package com.universalstudios.orlandoresort.frommergeneedsrefactor.upr_android_406.IBMData.Account.request;
import android.util.Log;
import com.universalstudios.orlandoresort.BuildConfig;
import com.universalstudios.orlandoresort.controller.userinterface.network.NetworkRequestSender;
import com.universalstudios.orlandoresort.frommergeneedsrefactor.upr_android_406.IBMData.Account.responses.DeleteGuestAddressResponse;
import com.universalstudios.orlandoresort.frommergeneedsrefactor.upr_android_406.IBMServices.IBMOrlandoServices;
import com.universalstudios.orlandoresort.frommergeneedsrefactor.upr_android_406.IBMServices.IBMOrlandoServicesRequest;
import com.universalstudios.orlandoresort.model.network.request.BaseNetworkRequestBuilder;
import com.universalstudios.orlandoresort.model.network.request.NetworkParams;
import com.universalstudios.orlandoresort.model.state.account.AccountStateManager;
import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;
/**
* Retrofit request to delete an address in a guest's profile by guest Id and address Id.
* <p/>
* @author tjudkins
* @since 10/23/16
*/
public class DeleteGuestAddressRequest extends IBMOrlandoServicesRequest implements Callback<DeleteGuestAddressResponse> {
// Logging Tag
private static final String TAG = DeleteGuestAddressRequest.class.getSimpleName();
protected DeleteGuestAddressRequest(String senderTag, Priority priority, ConcurrencyType concurrencyType, NetworkParams networkParams) {
super(senderTag, priority, concurrencyType, networkParams);
}
/**
* Private internal Network Parameter class used by the {@link Builder}.
*/
private static class DeleteGuestAddressParams extends NetworkParams {
private String addressId;
public DeleteGuestAddressParams() {
super();
}
}
/**
* A Builder class for building a new {@link DeleteGuestAddressRequest}.
*/
public static class Builder extends BaseNetworkRequestBuilder<Builder> {
private final DeleteGuestAddressParams deleteGuestAddressParams;
public Builder(NetworkRequestSender sender) {
super(sender);
this.deleteGuestAddressParams = new DeleteGuestAddressParams();
}
/**
* Method required by {@link BaseNetworkRequestBuilder} to allow the proper builder pattern
* with child classes.
*
* @return the {@link Builder}
*/
@Override
protected Builder getThis() {
return this;
}
/**
* [REQUIRED] Sets the guest's Id for adding a new address.
*
* @param addressId
* the String of the guest's Id
*
* @return the {@link Builder}
*/
public Builder setAddressId(String addressId) {
this.deleteGuestAddressParams.addressId = addressId;
return getThis();
}
public DeleteGuestAddressRequest build() {
return new DeleteGuestAddressRequest(senderTag, priority, concurrencyType, deleteGuestAddressParams);
}
}
@Override
public void makeNetworkRequest(RestAdapter restAdapter) {
super.makeNetworkRequest(restAdapter);
if (BuildConfig.DEBUG) {
Log.d(TAG, "makeNetworkRequest");
}
// Set the params when the request is sent
DeleteGuestAddressParams params = (DeleteGuestAddressParams) getNetworkParams();
IBMOrlandoServices services = restAdapter.create(IBMOrlandoServices.class);
String guestId = AccountStateManager.getGuestId();
String authString = AccountStateManager.getBasicAuthString();
switch (getConcurrencyType()) {
case SYNCHRONOUS:
try {
DeleteGuestAddressResponse response = services.deleteGuestAddress(
authString,
guestId,
params.addressId);
success(response, null);
}
catch (RetrofitError retrofitError) {
failure(retrofitError);
}
break;
case ASYNCHRONOUS:
services.deleteGuestAddress(
authString,
guestId,
params.addressId,
this);
break;
default:
throw new IllegalArgumentException("Invalid concurrencyType set on NetworkRequest");
}
}
@Override
public void success(DeleteGuestAddressResponse deleteGuestAddressResponse, Response response) {
DeleteGuestAddressResponse dgaResponse = deleteGuestAddressResponse;
if (null == dgaResponse) dgaResponse = new DeleteGuestAddressResponse();
super.handleSuccess(deleteGuestAddressResponse, response);
}
@Override
public void failure(RetrofitError error) {
super.handleFailure(new DeleteGuestAddressResponse(), error);
}
} | [
"kartheek222@gmail.com"
] | kartheek222@gmail.com |
6f71a1d40c76289cf49c4b7c50185f3d36ede64c | 3d9c111c03d4eadf504f34bb7628c5e78825bab4 | /src/f_ingjava/TaskCallback.java | 16ef6be24ef568642db1fbac4e55013a465d3449 | [] | no_license | nardi/F-ingJava | 7a6eb186612acc1c8cda72e8e714c229f3629c1f | 4c0d83619633b42e330a78b2fac3adad074c58c2 | refs/heads/master | 2020-12-24T14:01:21.814203 | 2013-06-12T19:45:47 | 2013-06-12T19:45:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 115 | java | package f_ingjava;
public abstract class TaskCallback extends SafeTaskCallback implements Callback<Void>
{
}
| [
"me@nardilam.nl"
] | me@nardilam.nl |
70c16922219819612c8936b75e575a085a1ca1e4 | 830aa55804625b259ed7c17661426f7d7f45a249 | /src/main/java/com/example/model/ServiceRequest.java | cafc7c20dc2d7130f12c54fa1be2d499e1745d9a | [
"Apache-2.0"
] | permissive | markito/geode311demo | 18a6c86dc6998ddcf2e06e99fd88de1cdf1f22ce | 6e25dbfcbdff336cebbd47a906fe489744f19eb6 | refs/heads/master | 2021-01-18T23:50:12.954628 | 2017-01-24T03:50:33 | 2017-01-24T03:50:33 | 72,783,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,180 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.model;
import javax.xml.bind.annotation.XmlRootElement;
//TODO: DataSerializable, PDX...
@XmlRootElement(name = "ServiceRequest")
public class ServiceRequest {
public ServiceRequest setUniqueKey(final long uniqueKey) {
this.uniqueKey = uniqueKey;
return this;
}
public ServiceRequest setCreatedDate(final long createdDate) {
this.createdDate = createdDate;
return this;
}
public ServiceRequest setClosedDate(final long closedDate) {
this.closedDate = closedDate;
return this;
}
public ServiceRequest setAgency(final String agency) {
this.agency = agency;
return this;
}
public ServiceRequest setAgencyName(final String agencyName) {
this.agencyName = agencyName;
return this;
}
public ServiceRequest setComplaintType(final String complaintType) {
this.complaintType = complaintType;
return this;
}
public ServiceRequest setDescriptor(final String descriptor) {
this.descriptor = descriptor;
return this;
}
public ServiceRequest setLocationType(final String locationType) {
this.locationType = locationType;
return this;
}
public ServiceRequest setIncidentZip(final String incidentZip) {
this.incidentZip = incidentZip;
return this;
}
public ServiceRequest setIncidentAddress(final String incidentAddress) {
this.incidentAddress = incidentAddress;
return this;
}
public ServiceRequest setStreetName(final String streetName) {
this.streetName = streetName;
return this;
}
public ServiceRequest setCrossStreet_1(final String crossStreet_1) {
this.crossStreet_1 = crossStreet_1;
return this;
}
public ServiceRequest setCrossStreet_2(final String crossStreet_2) {
this.crossStreet_2 = crossStreet_2;
return this;
}
public ServiceRequest setIntersectionStreet_1(final String intersectionStreet_1) {
this.intersectionStreet_1 = intersectionStreet_1;
return this;
}
public ServiceRequest setIntersectionStreet_2(final String intersectionStreet_2) {
this.intersectionStreet_2 = intersectionStreet_2;
return this;
}
public ServiceRequest setAddressType(final String addressType) {
this.addressType = addressType;
return this;
}
public ServiceRequest setCity(final String city) {
this.city = city;
return this;
}
public ServiceRequest setLandmark(final String landmark) {
this.landmark = landmark;
return this;
}
public ServiceRequest setFacilityType(final String facilityType) {
this.facilityType = facilityType;
return this;
}
public ServiceRequest setStatus(final String status) {
this.status = status;
return this;
}
public ServiceRequest setDueDate(final long dueDate) {
this.dueDate = dueDate;
return this;
}
public ServiceRequest setResolutionDescription(final String resolutionDescription) {
this.resolutionDescription = resolutionDescription;
return this;
}
public ServiceRequest setResolutionActionUpdateDate(final long resolutionActionUpdateDate) {
this.resolutionActionUpdateDate = resolutionActionUpdateDate;
return this;
}
public ServiceRequest setCommunityBoard(final String communityBoard) {
this.communityBoard = communityBoard;
return this;
}
public ServiceRequest setBorough(final String borough) {
this.borough = borough;
return this;
}
public ServiceRequest setX_coordinate(final float x_coordinate) {
this.x_coordinate = x_coordinate;
return this;
}
public ServiceRequest setY_coordinate(final float y_coordinate) {
this.y_coordinate = y_coordinate;
return this;
}
public ServiceRequest setParkFacilityName(final String parkFacilityName) {
this.parkFacilityName = parkFacilityName;
return this;
}
public ServiceRequest setParkBorough(final String parkBorough) {
this.parkBorough = parkBorough;
return this;
}
public ServiceRequest setSchoolName(final String schoolName) {
this.schoolName = schoolName;
return this;
}
public ServiceRequest setSchoolNumber(final String schoolNumber) {
this.schoolNumber = schoolNumber;
return this;
}
public ServiceRequest setSchoolRegion(final String schoolRegion) {
this.schoolRegion = schoolRegion;
return this;
}
public ServiceRequest setSchoolCode(final String schoolCode) {
this.schoolCode = schoolCode;
return this;
}
public ServiceRequest setSchoolPhoneNumber(final String schoolPhoneNumber) {
this.schoolPhoneNumber = schoolPhoneNumber;
return this;
}
public ServiceRequest setSchoolAddress(final String schoolAddress) {
this.schoolAddress = schoolAddress;
return this;
}
public ServiceRequest setSchoolCity(final String schoolCity) {
this.schoolCity = schoolCity;
return this;
}
public ServiceRequest setSchoolState(final String schoolState) {
this.schoolState = schoolState;
return this;
}
public ServiceRequest setSchoolZip(final String schoolZip) {
this.schoolZip = schoolZip;
return this;
}
public ServiceRequest setSchoolNotFound(final String schoolNotFound) {
this.schoolNotFound = schoolNotFound;
return this;
}
public ServiceRequest setSchoolOrCityWideComplaint(final String schoolOrCityWideComplaint) {
this.schoolOrCityWideComplaint = schoolOrCityWideComplaint;
return this;
}
public ServiceRequest setVehicleType(final String vehicleType) {
this.vehicleType = vehicleType;
return this;
}
public ServiceRequest setTaxiCompanyBorough(final String taxiCompanyBorough) {
this.taxiCompanyBorough = taxiCompanyBorough;
return this;
}
public ServiceRequest setTaxiPickUpLocation(final String taxiPickUpLocation) {
this.taxiPickUpLocation = taxiPickUpLocation;
return this;
}
public ServiceRequest setBridgeHighwayName(final String bridgeHighwayName) {
this.bridgeHighwayName = bridgeHighwayName;
return this;
}
public ServiceRequest setBridgeHighwayDirection(final String bridgeHighwayDirection) {
this.bridgeHighwayDirection = bridgeHighwayDirection;
return this;
}
public ServiceRequest setRoadRamp(final String roadRamp) {
this.roadRamp = roadRamp;
return this;
}
public ServiceRequest setBridgeHighwaySegment(final String bridgeHighwaySegment) {
this.bridgeHighwaySegment = bridgeHighwaySegment;
return this;
}
public ServiceRequest setGarageLotName(final String garageLotName) {
this.garageLotName = garageLotName;
return this;
}
public ServiceRequest setFerryDirection(final String ferryDirection) {
this.ferryDirection = ferryDirection;
return this;
}
public ServiceRequest setFerryTerminalName(final String ferryTerminalName) {
this.ferryTerminalName = ferryTerminalName;
return this;
}
public ServiceRequest setLatitude(final float latitude) {
this.latitude = latitude;
return this;
}
public ServiceRequest setLongitude(final float longitude) {
this.longitude = longitude;
return this;
}
public ServiceRequest setLocation(final String location) {
this.location = location;
return this;
}
private long uniqueKey;
private long createdDate;
private long closedDate;
private String agency,
agencyName,
complaintType,
descriptor,
locationType;
private String incidentZip;
private String incidentAddress,
streetName,
crossStreet_1,
crossStreet_2,
intersectionStreet_1,
intersectionStreet_2,
addressType,
city,
landmark,
facilityType,
status;
private long dueDate;
private String resolutionDescription;
private long resolutionActionUpdateDate;
private String communityBoard,
borough;
private float x_coordinate, y_coordinate;
private String parkFacilityName,
parkBorough,
schoolName,
schoolNumber,
schoolRegion,
schoolCode,
schoolPhoneNumber,
schoolAddress,
schoolCity,
schoolState,
schoolZip,
schoolNotFound,
schoolOrCityWideComplaint,
vehicleType,
taxiCompanyBorough,
taxiPickUpLocation,
bridgeHighwayName,
bridgeHighwayDirection,
roadRamp,
bridgeHighwaySegment,
garageLotName,
ferryDirection,
ferryTerminalName;
private float latitude, longitude;
private String location;
public long getUniqueKey() {
return uniqueKey;
}
public long getCreatedDate() {
return createdDate;
}
public long getClosedDate() {
return closedDate;
}
public String getAgency() {
return agency;
}
public String getAgencyName() {
return agencyName;
}
public String getComplaintType() {
return complaintType;
}
public String getDescriptor() {
return descriptor;
}
public String getLocationType() {
return locationType;
}
public String getIncidentZip() {
return incidentZip;
}
public String getIncidentAddress() {
return incidentAddress;
}
public String getStreetName() {
return streetName;
}
public String getCrossStreet_1() {
return crossStreet_1;
}
public String getCrossStreet_2() {
return crossStreet_2;
}
public String getIntersectionStreet_1() {
return intersectionStreet_1;
}
public String getIntersectionStreet_2() {
return intersectionStreet_2;
}
public String getAddressType() {
return addressType;
}
public String getCity() {
return city;
}
public String getLandmark() {
return landmark;
}
public String getFacilityType() {
return facilityType;
}
public String getStatus() {
return status;
}
public long getDueDate() {
return dueDate;
}
public String getResolutionDescription() {
return resolutionDescription;
}
public long getResolutionActionUpdateDate() {
return resolutionActionUpdateDate;
}
public String getCommunityBoard() {
return communityBoard;
}
public String getBorough() {
return borough;
}
public float getX_coordinate() {
return x_coordinate;
}
public float getY_coordinate() {
return y_coordinate;
}
public String getParkFacilityName() {
return parkFacilityName;
}
public String getParkBorough() {
return parkBorough;
}
public String getSchoolName() {
return schoolName;
}
public String getSchoolNumber() {
return schoolNumber;
}
public String getSchoolRegion() {
return schoolRegion;
}
public String getSchoolCode() {
return schoolCode;
}
public String getSchoolPhoneNumber() {
return schoolPhoneNumber;
}
public String getSchoolAddress() {
return schoolAddress;
}
public String getSchoolCity() {
return schoolCity;
}
public String getSchoolState() {
return schoolState;
}
public String getSchoolZip() {
return schoolZip;
}
public String getSchoolNotFound() {
return schoolNotFound;
}
public String getSchoolOrCityWideComplaint() {
return schoolOrCityWideComplaint;
}
public String getVehicleType() {
return vehicleType;
}
public String getTaxiCompanyBorough() {
return taxiCompanyBorough;
}
public String getTaxiPickUpLocation() {
return taxiPickUpLocation;
}
public String getBridgeHighwayName() {
return bridgeHighwayName;
}
public String getBridgeHighwayDirection() {
return bridgeHighwayDirection;
}
public String getRoadRamp() {
return roadRamp;
}
public String getBridgeHighwaySegment() {
return bridgeHighwaySegment;
}
public String getGarageLotName() {
return garageLotName;
}
public String getFerryDirection() {
return ferryDirection;
}
public String getFerryTerminalName() {
return ferryTerminalName;
}
public float getLatitude() {
return latitude;
}
public float getLongitude() {
return longitude;
}
public String getLocation() {
return location;
}
@Override
public String toString() {
return "ServiceRequest{" + "uniqueKey=" + uniqueKey + ", createdDate=" + createdDate + ", closedDate=" + closedDate + ", agency='" + agency + '\'' + ", agencyName='" + agencyName + '\'' + ", complaintType='" + complaintType + '\'' + ", descriptor='" + descriptor + '\'' + ", locationType='" + locationType + '\'' + ", incidentZip='" + incidentZip + '\'' + ", incidentAddress='" + incidentAddress + '\'' + ", streetName='" + streetName + '\'' + ", crossStreet_1='" + crossStreet_1 + '\'' + ", crossStreet_2='" + crossStreet_2 + '\'' + ", intersectionStreet_1='" + intersectionStreet_1 + '\'' + ", intersectionStreet_2='" + intersectionStreet_2 + '\'' + ", addressType='" + addressType + '\'' + ", city='" + city + '\'' + ", landmark='" + landmark + '\'' + ", facilityType='" + facilityType + '\'' + ", status='" + status + '\'' + ", dueDate=" + dueDate + ", resolutionDescription='" + resolutionDescription + '\'' + ", resolutionActionUpdateDate=" + resolutionActionUpdateDate + ", communityBoard='" + communityBoard + '\'' + ", borough='" + borough + '\'' + ", x_coordinate=" + x_coordinate + ", y_coordinate=" + y_coordinate + ", parkFacilityName='" + parkFacilityName + '\'' + ", parkBorough='" + parkBorough + '\'' + ", schoolName='" + schoolName + '\'' + ", schoolNumber='" + schoolNumber + '\'' + ", schoolRegion='" + schoolRegion + '\'' + ", schoolCode='" + schoolCode + '\'' + ", schoolPhoneNumber='" + schoolPhoneNumber + '\'' + ", schoolAddress='" + schoolAddress + '\'' + ", schoolCity='" + schoolCity + '\'' + ", schoolState='" + schoolState + '\'' + ", schoolZip='" + schoolZip + '\'' + ", schoolNotFound='" + schoolNotFound + '\'' + ", schoolOrCityWideComplaint='" + schoolOrCityWideComplaint + '\'' + ", vehicleType='" + vehicleType + '\'' + ", taxiCompanyBorough='" + taxiCompanyBorough + '\'' + ", taxiPickUpLocation='" + taxiPickUpLocation + '\'' + ", bridgeHighwayName='" + bridgeHighwayName + '\'' + ", bridgeHighwayDirection='" + bridgeHighwayDirection + '\'' + ", roadRamp='" + roadRamp + '\'' + ", bridgeHighwaySegment='" + bridgeHighwaySegment + '\'' + ", garageLotName='" + garageLotName + '\'' + ", ferryDirection='" + ferryDirection + '\'' + ", ferryTerminalName='" + ferryTerminalName + '\'' + ", latitude=" + latitude + ", longitude=" + longitude + ", location='" + location + '\'' + '}';
}
public ServiceRequest() {};
public ServiceRequest(final long uniqueKey,
final long createdDate,
final long closedDate,
final String agency,
final String agencyName,
final String complaintType,
final String descriptor,
final String locationType,
final String incidentZip,
final String incidentAddress,
final String streetName,
final String crossStreet_1,
final String crossStreet_2,
final String intersectionStreet_1,
final String intersectionStreet_2,
final String addressType,
final String city,
final String landmark,
final String facilityType,
final String status,
final long dueDate,
final String resolutionDescription,
final long resolutionActionUpdateDate,
final String communityBoard,
final String borough,
final float x_coordinate,
final float y_coordinate,
final String parkFacilityName,
final String parkBorough,
final String schoolName,
final String schoolNumber,
final String schoolRegion,
final String schoolCode,
final String schoolPhoneNumber,
final String schoolAddress,
final String schoolCity,
final String schoolState,
final String schoolZip,
final String schoolNotFound,
final String schoolOrCityWideComplaint,
final String vehicleType,
final String taxiCompanyBorough,
final String taxiPickUpLocation,
final String bridgeHighwayName,
final String bridgeHighwayDirection,
final String roadRamp,
final String bridgeHighwaySegment,
final String garageLotName,
final String ferryDirection,
final String ferryTerminalName,
final float latitude,
final float longitude,
final String location) {
this.uniqueKey = uniqueKey;
this.createdDate = createdDate;
this.closedDate = closedDate;
this.agency = agency;
this.agencyName = agencyName;
this.complaintType = complaintType;
this.descriptor = descriptor;
this.locationType = locationType;
this.incidentZip = incidentZip;
this.incidentAddress = incidentAddress;
this.streetName = streetName;
this.crossStreet_1 = crossStreet_1;
this.crossStreet_2 = crossStreet_2;
this.intersectionStreet_1 = intersectionStreet_1;
this.intersectionStreet_2 = intersectionStreet_2;
this.addressType = addressType;
this.city = city;
this.landmark = landmark;
this.facilityType = facilityType;
this.status = status;
this.dueDate = dueDate;
this.resolutionDescription = resolutionDescription;
this.resolutionActionUpdateDate = resolutionActionUpdateDate;
this.communityBoard = communityBoard;
this.borough = borough;
this.x_coordinate = x_coordinate;
this.y_coordinate = y_coordinate;
this.parkFacilityName = parkFacilityName;
this.parkBorough = parkBorough;
this.schoolName = schoolName;
this.schoolNumber = schoolNumber;
this.schoolRegion = schoolRegion;
this.schoolCode = schoolCode;
this.schoolPhoneNumber = schoolPhoneNumber;
this.schoolAddress = schoolAddress;
this.schoolCity = schoolCity;
this.schoolState = schoolState;
this.schoolZip = schoolZip;
this.schoolNotFound = schoolNotFound;
this.schoolOrCityWideComplaint = schoolOrCityWideComplaint;
this.vehicleType = vehicleType;
this.taxiCompanyBorough = taxiCompanyBorough;
this.taxiPickUpLocation = taxiPickUpLocation;
this.bridgeHighwayName = bridgeHighwayName;
this.bridgeHighwayDirection = bridgeHighwayDirection;
this.roadRamp = roadRamp;
this.bridgeHighwaySegment = bridgeHighwaySegment;
this.garageLotName = garageLotName;
this.ferryDirection = ferryDirection;
this.ferryTerminalName = ferryTerminalName;
this.latitude = latitude;
this.longitude = longitude;
this.location = location;
}
}
| [
"wmarkito@pivotal.io"
] | wmarkito@pivotal.io |
e7b0ac867e31270892cd9681ba4cd2f44a94c6f9 | a35fadfafbc85e7e374faa8478f6d4ade5119ffa | /src/main/java/by/mogilev/service/CourseService.java | 61f1032fbe868cc8977e0327fbf18e866ba177b6 | [] | no_license | AlinaKisialiova/TestProject | 04c7dd28c644ad0a4664219ed02d70a6fab9fc9b | 6b286e89954b274783f656c53898bc568472bb6e | HEAD | 2016-09-05T20:28:57.763892 | 2015-05-20T14:12:22 | 2015-05-20T14:12:22 | 31,411,098 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,673 | java | package by.mogilev.service;
import by.mogilev.exception.IsNotOwnerException;
import by.mogilev.exception.NotFoundCourseException;
import by.mogilev.exception.NotFoundUserException;
import by.mogilev.model.Course;
import by.mogilev.model.User;
import com.itextpdf.text.DocumentException;
import javax.mail.internet.AddressException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* Created by ะะดะผะธะฝะธัััะฐัะพั on 21.03.2015.
*/
public interface CourseService {
/**
* Method validate who create this course
* @param idCourse
* @param UserName
* @return
*/
public boolean isOwner(int idCourse, String UserName) throws NotFoundUserException, NotFoundCourseException;
/**
* Method set mark to course and initialize send email
* @param id
* @param user
* @param grade
* @throws AddressException
* @throws NotFoundCourseException
* @throws NotFoundUserException
*/
public void remidEv(int id, User user, int grade) throws AddressException, NotFoundCourseException, NotFoundUserException;
/**
*Method return map with course category
* @return
*/
Map<String, String> getCategotyMap();
/**
*
* Method out in pdf-file list of courses
*
*/
public void outInPdfAllCourse(HttpServletResponse response, List<Course> courses) throws IOException, DocumentException;
/**
*
* Method out in Excel list of courses
*
*/
public void outInExcelAllCourse(HttpServletResponse response, List<Course> courses) throws IOException;
/**
* Method return all course that registration in center
* @return
*/
public List<Course> getAllCourse();
/**
* delete course
* @param id
* @param userName
* @throws AddressException
* @throws NotFoundCourseException
* @throws NotFoundUserException
* @throws IsNotOwnerException
*/
public void deleteCourse(int id, String userName) throws AddressException, NotFoundCourseException, NotFoundUserException, IsNotOwnerException;
/**
* get course for id
* @param id
* @return
* @throws NotFoundCourseException
*/
public Course getCourse(int id) throws NotFoundCourseException;
/**
* register new course
* @param course
* @param nameLector
* @throws AddressException
* @throws NotFoundUserException
*/
public void registerCourse(Course course, String nameLector) throws AddressException, NotFoundUserException, NotFoundCourseException;
/**
* update course
* @param updCourse
* @throws AddressException
* @throws NotFoundCourseException
*/
public void updateCourse(Course updCourse) throws AddressException, NotFoundCourseException, NotFoundUserException;
/**
* return course for approve department manager
* @return
*/
public List<Course> getCourseForDepartmentManager();
/**
* return course for approve knowledge manager
* @return
*/
public List<Course> getCourseForKnowledgeManagerManager();
/**
* get list attenders for this course
* @param courseSubscr
* @return
* @throws NotFoundUserException
*/
public List<Course> getListForAttendee(List<Course> courseSubscr) throws NotFoundUserException;
/***
* select course on category
* @param courseAtt
* @param category
* @return
* @throws NotFoundUserException
*/
public List<Course> getSortList(List<Course> courseAtt, String category) throws NotFoundUserException;
}
| [
"aflamma@yandex.ru"
] | aflamma@yandex.ru |
3c8b7229ebf9abc1537f6793e887884754906ca0 | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-datasync/src/main/java/com/amazonaws/services/datasync/model/DeleteTaskResult.java | 3c056d7604a36657894f505ede377c9a8fbd9b24 | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 2,303 | java | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.datasync.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DeleteTask" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteTaskResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeleteTaskResult == false)
return false;
DeleteTaskResult other = (DeleteTaskResult) obj;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
return hashCode;
}
@Override
public DeleteTaskResult clone() {
try {
return (DeleteTaskResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
fa93947797f38917e02a59f6a6b5f40387360706 | ea8013860ed0b905c64f449c8bce9e0c34a23f7b | /SystemUIGoogle/sources/com/android/systemui/plugins/qs/QSIconView.java | bd98c797aa6d8ddb5909be17da1c69c4dbca5874 | [] | no_license | TheScarastic/redfin_b5 | 5efe0dc0d40b09a1a102dfb98bcde09bac4956db | 6d85efe92477576c4901cce62e1202e31c30cbd2 | refs/heads/master | 2023-08-13T22:05:30.321241 | 2021-09-28T12:33:20 | 2021-09-28T12:33:20 | 411,210,644 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | package com.android.systemui.plugins.qs;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import com.android.systemui.plugins.annotations.ProvidesInterface;
import com.android.systemui.plugins.qs.QSTile;
@ProvidesInterface(version = 1)
/* loaded from: classes.dex */
public abstract class QSIconView extends ViewGroup {
public static final int VERSION = 1;
public abstract void disableAnimation();
public abstract View getIconView();
public abstract void setIcon(QSTile.State state, boolean z);
public QSIconView(Context context) {
super(context);
}
}
| [
"warabhishek@gmail.com"
] | warabhishek@gmail.com |
b2d5b873cd96e5c3ae08ae37f5cd220460e74d46 | 09c5dd1732095c79d7ccba231d5d8fa82cb2c999 | /src/bank/internettoegang/IBankiersessie.java | 26387764ec18058be9db70f37f573dc11414ff1e | [] | no_license | erterer/GSO---Internetbankieren | 7ab5e3e5d5e38c411fb44dc64d7a49b1fbe1972b | 49d88ca5a8e0d62422d6de6fc50415a6075cedc5 | refs/heads/master | 2021-03-16T06:53:00.508188 | 2016-06-20T20:08:19 | 2016-06-20T20:08:19 | 59,549,450 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,129 | java | package bank.internettoegang;
import java.rmi.RemoteException;
import bank.bankieren.IRekening;
import bank.bankieren.Money;
import fontys.observer.RemotePublisher;
import fontys.util.InvalidSessionException;
import fontys.util.NumberDoesntExistException;
public interface IBankiersessie extends RemotePublisher
{
long GELDIGHEIDSDUUR = 600000;
/**
* @returns true als de laatste aanroep van getRekening of maakOver voor deze
* sessie minder dan GELDIGHEIDSDUUR geleden is
* en er geen communicatiestoornis in de tussentijd is opgetreden,
* anders false
*/
boolean isGeldig() throws RemoteException;
/**
* er wordt bedrag overgemaakt van de bankrekening met het nummer bron naar
* de bankrekening met nummer bestemming
*
* @param bron
* @param bestemming
* is ongelijk aan rekeningnummer van deze bankiersessie
* @param bedrag
* is groter dan 0
* @return <b>true</b> als de overmaking is gelukt, anders <b>false</b>
* @throws NumberDoesntExistException
* als bestemming onbekend is
* @throws InvalidSessionException
* als sessie niet meer geldig is
*/
boolean maakOver(int bestemming, Money bedrag) throws NumberDoesntExistException,
InvalidSessionException, RemoteException;
/**
* sessie wordt beeindigd
*/
void logUit() throws RemoteException;
/**
* @return de rekeninggegevens die horen bij deze sessie
* @throws InvalidSessionException
* als de sessieId niet geldig of verlopen is
* @throws RemoteException
*/
IRekening getRekening() throws InvalidSessionException, RemoteException;
/**
* Update het saldo van de bijbehorende Rekening van de Bankiersessir
* @throws RemoteException
*/
void update() throws RemoteException;
/**
* Get het bijbehorende rekekeningnummer van de Bankiersessie
* @return Return het rekeningnummer
* @throws RemoteException
*/
int getReknr() throws RemoteException;
}
| [
"sven.nottelman@live.nl"
] | sven.nottelman@live.nl |
087480246dac006f159e0fbe8ca6e610161d9d9d | 52695f2bf5c4dc26d14c8fa9146189e7153a8f38 | /tuikit/src/main/java/com/tencent/qcloud/tim/uikit/modules/conversation/holder/ConversationCustomHolder.java | 9a140ceca960f808dcf4a90bedffbdb1221f9c9f | [] | no_license | zxyUncle/zxyTIM | c3a932d92772f4baa74d30b2454141b603092f0e | e74ed8ea7f10cdb8cabbec1c514b8cf7425cf42e | refs/heads/master | 2020-12-07T19:32:44.641370 | 2020-01-14T09:14:10 | 2020-01-14T09:14:10 | 232,783,066 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package com.tencent.qcloud.tim.uikit.modules.conversation.holder;
import android.graphics.Color;
import android.net.Uri;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tencent.qcloud.tim.uikit.R;
import com.tencent.qcloud.tim.uikit.component.picture.imageEngine.impl.GlideEngine;
import com.tencent.qcloud.tim.uikit.modules.conversation.base.ConversationIconView;
import com.tencent.qcloud.tim.uikit.modules.conversation.base.ConversationInfo;
/**
* ่ชๅฎไนไผ่ฏHolder
*/
public class ConversationCustomHolder extends ConversationBaseHolder {
protected LinearLayout leftItemLayout;
protected TextView titleText;
protected TextView messageText;
protected TextView timelineText;
protected TextView unreadText;
protected ConversationIconView conversationIconView;
public ConversationCustomHolder(View itemView) {
super(itemView);
leftItemLayout = rootView.findViewById(R.id.item_left);
conversationIconView = rootView.findViewById(R.id.conversation_icon);
titleText = rootView.findViewById(R.id.conversation_title);
messageText = rootView.findViewById(R.id.conversation_last_msg);
timelineText = rootView.findViewById(R.id.conversation_time);
unreadText = rootView.findViewById(R.id.conversation_unread);
}
@Override
public void layoutViews(ConversationInfo conversation, int position) {
if (conversation.isTop()) {
leftItemLayout.setBackgroundColor(rootView.getResources().getColor(R.color.conversation_top_color));
} else {
leftItemLayout.setBackgroundColor(Color.WHITE);
}
conversationIconView.setConversation(conversation);
titleText.setText(conversation.getTitle());
messageText.setText("");
timelineText.setText("");
if (conversation.getUnRead() > 0) {
unreadText.setVisibility(View.VISIBLE);
if (conversation.getUnRead() > 99) {
unreadText.setText("99+");
} else {
unreadText.setText("" + conversation.getUnRead());
}
} else {
unreadText.setVisibility(View.GONE);
}
if (mAdapter.mDateTextSize != 0) {
timelineText.setTextSize(mAdapter.mDateTextSize);
}
if (mAdapter.mBottomTextSize != 0) {
messageText.setTextSize(mAdapter.mBottomTextSize);
}
if (mAdapter.mTopTextSize != 0) {
titleText.setTextSize(mAdapter.mTopTextSize);
}
}
}
| [
"659966631@qq.com"
] | 659966631@qq.com |
7fe37e616dd346c9300726254edb3a2e9b6f1d59 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Maven/Maven1098.java | 05db63c69c30066d94508e15b43e217d80833382 | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | public void testMojoDescriptorRetrieval()
throws Exception
{
MavenSession session = createMavenSession( null );
String goal = "it";
Plugin plugin = new Plugin();
plugin.setGroupId( "org.apache.maven.its.plugins" );
plugin.setArtifactId( "maven-it-plugin" );
plugin.setVersion( "0.1" );
MojoDescriptor mojoDescriptor =
pluginManager.getMojoDescriptor( plugin, goal, session.getCurrentProject().getRemotePluginRepositories(),
session.getRepositorySession() );
assertNotNull( mojoDescriptor );
assertEquals( goal, mojoDescriptor.getGoal() );
// igorf: plugin realm comes later
// assertNotNull( mojoDescriptor.getRealm() );
PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor();
assertNotNull( pluginDescriptor );
assertEquals( "org.apache.maven.its.plugins", pluginDescriptor.getGroupId() );
assertEquals( "maven-it-plugin", pluginDescriptor.getArtifactId() );
assertEquals( "0.1", pluginDescriptor.getVersion() );
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
8e3632fe41e3e8c32e1af80ddb5bd7c42bab7b74 | 722a0d7a2a422c72a47b79c2650004459b0d8034 | /spring-step01/src/com/bit/spring/controller/IndexController.java | 8a7a431fcc40d50ca1064208680a85d940bf16e4 | [] | no_license | emptyDrawing/spring_test | 9846e5f733a4f48190c7af3608b821ef6239a6e0 | fab25a7f6a074d4bd69459fd82add75d45994184 | refs/heads/master | 2020-03-20T21:16:36.741772 | 2018-08-09T10:23:58 | 2018-08-09T10:23:58 | 137,732,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 501 | java | package com.bit.spring.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class IndexController implements Controller{
@Override
public ModelAndView handleRequest(HttpServletRequest req,
HttpServletResponse resp) throws Exception {
ModelAndView mav = new ModelAndView();
mav.setViewName("main");
return mav;
}
}
| [
"amor061750@gmail.com"
] | amor061750@gmail.com |
44b7404a060b4df87bfebe67dd40201c66bfd680 | 4cff6428fd804ca0c5bf00d609b578963a1c9a87 | /Cvac/src/main/java/cn/misection/cvac/ast/expr/AbstractExpression.java | b833a0ebc2fe0c630c6a4656d0650bb43ac728f0 | [] | no_license | huCow/Cva | 1c32f5cba4b536099bae4da9c9a203e94c760cd1 | 70e32a52097ca8bca52876d09dff412f9a9a949f | refs/heads/master | 2023-03-06T13:53:38.379030 | 2021-02-21T07:25:47 | 2021-02-21T07:25:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 578 | java | package cn.misection.cvac.ast.expr;
import cn.misection.cvac.ast.type.basic.EnumCvaType;
/**
* @author Military Intelligence 6 root
* @version 1.0.0
* @ClassName CvaExpr
* @Description TODO
* @CreateTime 2021ๅนด02ๆ14ๆฅ 17:53:00
*/
public abstract class AbstractExpression implements IExpression
{
protected int lineNum;
protected AbstractExpression(int lineNum)
{
this.lineNum = lineNum;
}
public int getLineNum()
{
return lineNum;
}
public void setLineNum(int lineNum)
{
this.lineNum = lineNum;
}
}
| [
"hlrongzun@qq.com"
] | hlrongzun@qq.com |
64887ea114f904c369beefaa71f9291f7403819b | b527db90227927baef4edf2fb784b87cac117915 | /modules/web/src/com/company/ceae/web/customer/CustomerEdit.java | 1caca08675311bc9095eb172bca699834c2e1226 | [] | no_license | mariodavid/cuba-example-application-events | 5265d78a757ce77ea091d35dbff0e4bb65f0a6ab | 0b383cac24ce15ad36f6a1d04b42f0ef48745b64 | refs/heads/master | 2021-01-12T12:58:28.955122 | 2017-04-09T08:15:34 | 2017-04-09T08:15:34 | 69,763,562 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 200 | java | package com.company.ceae.web.customer;
import com.haulmont.cuba.gui.components.AbstractEditor;
import com.company.ceae.entity.Customer;
public class CustomerEdit extends AbstractEditor<Customer> {
} | [
"mariodavid@arcor.de"
] | mariodavid@arcor.de |
c6c3b57a8824c8103bded2729c2a2556ef42b47c | f4b13bd41b207487a2acd18cb805ec182a19d173 | /seed-server/src/main/java/com/jadyer/seed/server/MainApp.java | 8ad4da71bd3d545a0c3bce3e2c4ff83fab32a775 | [
"Apache-2.0"
] | permissive | asdevip/seed | 72cfe9beeb1fcfcc6321a0f8a913fa8faf3a7b92 | 1456876ca7b06022b57fc341a334ba2152264284 | refs/heads/master | 2020-03-26T22:48:15.630275 | 2018-08-20T09:42:26 | 2018-08-20T09:42:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package com.jadyer.seed.server;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* ็็ๆๅกๅจๅฏๅจ็ฑป
* Created by ็็<http://jadyer.cn/> on 2013/9/3 20:14.
*/
public class MainApp {
public static void main(String[] args) {
new ClassPathXmlApplicationContext("applicationContext.xml");
}
} | [
"jadyer@yeah.net"
] | jadyer@yeah.net |
930162bcfc1be1af883cb935da9a2276506a77fb | 0590ffa1c430715b4c94c4c4ee96812597cc1b0d | /src/objectSample/fileSample/ReadSample2.java | 88f7cb988ddea4d363ce1df0b4a875ecd8c294b1 | [] | no_license | nakamotoageha/basic-1 | d4a7a313dac84ff993555b8dd5a03a3adb0abf14 | 99193bd93e7693a0876c75ff87a6739a76600fae | refs/heads/master | 2023-05-10T03:03:12.885548 | 2021-05-26T05:58:13 | 2021-05-26T05:58:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 887 | java | package objectSample.fileSample;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
//ใใญในใใใกใคใซใฎ่ชญใฟ่พผใฟใใฎ๏ผ
class ReadSample2 {
public static void main(String[] args) {
Path path = Paths.get("src","objectSample","fileSample","input.csv");
//https://docs.oracle.com/javase/jp/11/docs/api/java.base/java/nio/file/Files.html#newBufferedReader(java.nio.file.Path)
try(BufferedReader br = Files.newBufferedReader(path, StandardCharsets.UTF_8)) {
String line = br.readLine();
while (line != null) {
System.out.println(line);
line = br.readLine();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"moritaka@wdc-kd.com"
] | moritaka@wdc-kd.com |
7834175588999a81040635dc50094b066f32bc51 | 3c7421c6944d1c18ec03e56abb125d0e8f5bf5e1 | /app/src/main/java/ariefsaferman/jwork_android/ui/gallery/GalleryViewModel.java | b3927b3f3927df73d8c1a6040dd537e7859b0b8a | [] | no_license | ariefsaferman/jwork-android | 875681e147bd992f17f7be332efeb473bfb0bdb0 | 9beb311f0fb3374550a52b0162ba4939895bc176 | refs/heads/master | 2023-05-31T23:44:16.662987 | 2021-06-20T04:35:01 | 2021-06-20T04:35:01 | 370,963,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 462 | java | package ariefsaferman.jwork_android.ui.gallery;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class GalleryViewModel extends ViewModel {
private MutableLiveData<String> mText;
public GalleryViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is gallery fragment");
}
public LiveData<String> getText() {
return mText;
}
} | [
"arief.saferman@ui.ac.id"
] | arief.saferman@ui.ac.id |
19bfa0ed2503cb5c11187f9790569eba9339eb69 | bb31abd2a7f8b0f58a117d68bb9595f18d0ab620 | /MyJavaWorkShop6/src/com/test/Sample05.java | e2b0e2f86aee32c7f1a2c9ef89a8f0410d20a99b | [] | no_license | doyongsung/Java | d17fda36e9c3b45d25cdfd43ac13db2d9be3f418 | 22efff99b4d40d056767662c7d47eed158a02248 | refs/heads/master | 2023-05-07T15:05:57.230557 | 2021-05-21T10:47:58 | 2021-05-21T10:47:58 | 366,378,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 288 | java | package com.test;
class A{
void aMethod() {
System.out.println("aMethod in A Class");
}
}
class B extends A {
void aMethod() {
System.out.println("aMethod in B class");
}
}
public class Sample05 {
public static void main(String[] args) {
B b = new B();
b.aMethod();
}
}
| [
"ppelpp@naver.com"
] | ppelpp@naver.com |
bdab06fae5e1ff89904f39b9d58b30ac6e0e11ef | 7833e6ee5b9e1b2e6416adb70771e2b02c3edd3d | /app/src/test/java/com/example/vic/squashandstretch/ExampleUnitTest.java | 75b02d00516c0cdaab0d53e9c70f6f7b9df084f7 | [] | no_license | vicsham/SquashAndStretch | 2eadfccb43a5ba018bc985c2db88a518f2acbb27 | c5bc279b668680396084c0e55d6b4cd90ce6f299 | refs/heads/master | 2020-09-28T07:36:44.854163 | 2016-08-29T05:31:22 | 2016-08-29T05:31:22 | 66,814,111 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 325 | java | package com.example.vic.squashandstretch;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"vicentsham@gmail.com"
] | vicentsham@gmail.com |
859c1272e84b77b1f566b5c7c19cbd5ede22b812 | 2421c3a33bccf752b50587976907536945f4d810 | /GSUOCM/src/main/java/activities/Checkapply_Activity.java | c701253aec5d34a5c8992c611c5b2c80f4e50f70 | [] | no_license | zaijianwutian/WHU_IBMS1 | 1671a88c24383478898ff46b4b54b367abf13025 | 19c4fe797fadb5ead4fef0eed1a4aea286a22a1b | refs/heads/master | 2021-01-20T19:26:53.682938 | 2016-08-09T06:24:15 | 2016-08-09T06:25:23 | 60,827,530 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,746 | java | package activities;
import java.util.ArrayList;
import java.util.Map;
import org.ksoap2.serialization.SoapObject;
import views.AppManager;
import com.suntrans.whu.R;
import WebServices.jiexi;
import WebServices.soap;
import activities.All_Activity.MainThread;
import activities.All_Activity.Thread1;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
public class Checkapply_Activity extends Activity {
private ImageView back; //่ฟๅ้ฎ
private ListView list; //็ณ่ฏทๅ
ๅฎนๅ่กจ
private String UserID; //็ฎก็ๅ่ดฆๅท
private String Role; //็ฎก็ๅ่ง่ฒๅท
private LinearLayout layout_loading,layout_failure; //ๅ ่ฝฝไธญใใ๏ผๅ ่ฝฝๅคฑ่ดฅใ
private ArrayList<Map<String,String>> datalist_application=new ArrayList<Map<String,String>>(); //็ณ่ฏทๅ่กจๅ
ๅฎน
private ArrayList<Map<String,String>> datalist_userinfo=new ArrayList<Map<String,String>>(); //็จๆทไฟกๆฏ
private Handler handler1=new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
if(msg.what==1) //ไปฃ่กจ่ฏทๆฑๆฐๆฎๆๅ
{
ListInit(); //ๅๅงๅๅ่กจ
layout_loading.setVisibility(View.GONE);
layout_failure.setVisibility(View.GONE);
}
else if(msg.what==-1)
{
new Thread1().start();
}
else if(msg.what==0) //ไปฃ่กจ่ฏทๆฑๆฐๆฎๅคฑ่ดฅ
{
layout_loading.setVisibility(View.GONE);
layout_failure.setVisibility(View.VISIBLE);
//Toast.makeText(getActivity(), msg.obj.toString(), Toast.LENGTH_SHORT).show();
}
else if(msg.what==2) //ไปฃ่กจๅผๅง่ฏทๆฑ
{
layout_loading.setVisibility(View.VISIBLE);
layout_failure.setVisibility(View.GONE);
}
}};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.apply_check); //่ฎพ็ฝฎๅธๅฑๆไปถ
Intent intent=getIntent();
UserID=intent.getStringExtra("UserID"); //่ทๅ็ฎก็ๅ่ดฆๅท
Role=intent.getStringExtra("Role"); //่ทๅ็ฎก็ๅ่ง่ฒ
AppManager.getAppManager().addActivity(this);
list=(ListView)findViewById(R.id.list);
back=(ImageView)findViewById(R.id.back);
layout_loading=(LinearLayout)findViewById(R.id.layout_loading); //ๅ ่ฝฝไธญใใ
layout_failure=(LinearLayout)findViewById(R.id.layout_failure); //ๅ ่ฝฝๅคฑ่ดฅ
back.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
finish();
}
});
//็นๅปๅ ่ฝฝๅคฑ่ดฅ๏ผ้ๆฐๅ ่ฝฝๆฐๆฎ
layout_failure.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
layout_loading.setVisibility(View.VISIBLE);
layout_failure.setVisibility(View.GONE);
new MainThread().start(); //ๅผๅงๆฐ็ๅทๆฐ็บฟ็จ
}});
}
public class MainThread extends Thread{
public void run(){
SoapObject result=new SoapObject();
try
{
if(Role.equals("5")) //ๅฆๆๆฏๆฅผ้ฟ๏ผๅๅชๆฅ่ฏขๅ
ถๆ็ฎก็็ๆฅผๆ ๏ผๅ
ๆฅ่ฏขๆฅผ้ฟไฟกๆฏ
{
result=soap.Inquiry_UserInfo(UserID);
datalist_userinfo=jiexi.inquiry_staffinfo(result);
}
else if(Role.equals("6")) //ๅฆๆๆฏๅฎฟ็ฎก๏ผๅๅชๆฅ่ฏขๅ
ถๆ็ฎก็็ๆฅผๆ ๏ผๅ
ๆฅ่ฏขๅฎฟ็ฎกไฟกๆฏ
{
result=soap.Inquiry_UserInfo(UserID);
datalist_userinfo=jiexi.inquiry_boomerinfo(result);
}
Message msg=new Message();
msg.what=-1; //ไปฃ่กจๆๅ๏ผไฝๆฏๆฒกๆ่ทๅๆฟ้ดๅผๅ
ณ็ถๆ๏ผๆไปฅไธ่ฟ่กListInit
handler1.sendMessage(msg);
}
catch(Exception e)
{
Message msg=new Message();
msg.what=0; //ไปฃ่กจๅคฑ่ดฅ
msg.obj=e.toString();
handler1.sendMessage(msg);
}
}
}
public class Thread1 extends Thread{
public void run(){
SoapObject result=new SoapObject();
try
{
if(Role.equals("5")) //ๅฆๆๆฏๆฅผ้ฟ๏ผ่ทๅ่ฟไธชๆฅผๆ ็ๅญฆ็็ณ่ฏท
{
result=soap.Inquiry_Application("50", datalist_userinfo.get(0).get("Area"), datalist_userinfo.get(0).get("Building"), "");
datalist_application=jiexi.inquiry_application(result);
}
else if(Role.equals("6")) //ๅฆๆๆฏๅฎฟ็ฎก๏ผ่ทๅ่ฟไธชๅๅ
๏ผๆฅผๆ ๏ผ็ๅญฆ็็ณ่ฏท
{
result=soap.Inquiry_Application("50", datalist_userinfo.get(0).get("Area"), datalist_userinfo.get(0).get("Building"), datalist_userinfo.get(0).get("Unit").replace("anyType{}", ""));
datalist_application=jiexi.inquiry_application(result);
}
else
{
result=soap.Inquiry_Application("50", "", "", ""); //่ทๅๅ
จ้จๅญฆ็็็ณ่ฏท
datalist_application=jiexi.inquiry_application(result);
}
Message msg=new Message();
msg.what=1; //ไปฃ่กจๆๅ๏ผไฝๆฏๆฒกๆ่ทๅๆฟ้ดๅผๅ
ณ็ถๆ๏ผๆไปฅไธ่ฟ่กListInit
handler1.sendMessage(msg);
}
catch(Exception e)
{
Message msg=new Message();
msg.what=0; //ไปฃ่กจๅคฑ่ดฅ
msg.obj=e.toString();
handler1.sendMessage(msg);
}
}
}
public void ListInit(){
}
}
| [
"fendou shi"
] | fendou shi |
6a36bcd028632ac2a34e4ae86f743800a84267b7 | 79943487f9311a0886a2cc2e5f1732f32c1b04ff | /engine/src/main/java/com/agiletec/aps/system/common/entity/helper/IEntityFilterBean.java | 5a45269962e113307b98e1db324570c0a45d026e | [] | no_license | Denix80/entando-core | f3b8827f9fe0789169f6e6cc160fbc2c6f322d45 | c861199d39d28edb2d593203450d43a8ecaad7b4 | refs/heads/master | 2021-01-17T21:28:57.188088 | 2015-09-21T10:56:40 | 2015-09-21T10:56:40 | 42,932,167 | 0 | 0 | null | 2015-09-22T12:26:06 | 2015-09-22T12:26:06 | null | UTF-8 | Java | false | false | 1,049 | java | /*
* Copyright 2013-Present Entando Corporation (http://www.entando.com) All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.agiletec.aps.system.common.entity.helper;
/**
* @author E.Santoboni
*/
public interface IEntityFilterBean {
public String getKey();
public boolean isAttributeFilter();
public boolean getLikeOption();
public String getLikeOptionType();
public String getValue();
public String getStart();
public String getEnd();
public String getOrder();
}
| [
"eugenio.santoboni@gmail.com"
] | eugenio.santoboni@gmail.com |
8b2e5c9747914a582d6cd4c7b99b5287177ee988 | 9f06dfec8e591692bcd9a23290f9196a5da774e0 | /ChatRoom/src/JoinRoom.java | 735b245a5ff6392245591ccef242addf30e70a24 | [] | no_license | Rashvi/ChatRoom | 0c8b1586b0cc2788e0112ad9881ec9384c97b4cb | 5c01a8d461d7ce654d035f185738d9a17c91f636 | refs/heads/master | 2022-11-16T16:01:42.925753 | 2020-07-16T23:34:30 | 2020-07-16T23:34:30 | 279,300,044 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29,179 | java |
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import java.awt.Adjustable;
import java.awt.Color;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Toolkit;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.Date;
import java.util.StringTokenizer;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.filechooser.FileNameExtensionFilter;
public class JoinRoom extends javax.swing.JFrame {
int rid;
File file, file2;
String emojipics[] = new String[]{"src/emoji/1.jpg", "src/emoji/2.png", "src/emoji/3.jpg", "src/emoji/4.jpg", "src/emoji/5.jpg", "src/emoji/6.jpg", "src/emoji/7.jpg", "src/emoji/8.jpg", "src/emoji/9.jpg", "src/emoji/10.png"};
String emojiSymbole[] = new String[]{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"};
Timer timer;
int w, h;
public JoinRoom(int rid) {
initComponents();
this.rid = rid;
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
this.w = d.width;
this.h = d.height;
setSize(d);
setVisible(true);
timer = new Timer();
getroomdetails(rid);
checkroomjoined(rid);
GetRoomMemeber(rid);
setemojis();
Thread t1 = new Thread(new MyClass());
t1.start();
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
new Thread(new MyClass()).start();
}
}, 5000, 5000);
getContentPane().setBackground(Color.PINK);
}
// JoinRoom(String roomid) {
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
// }
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
btaddmsg = new javax.swing.JButton();
lbPhoto = new javax.swing.JLabel();
lbCategory = new javax.swing.JLabel();
lbRoomName = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
showmessage = new javax.swing.JEditorPane();
tfMsg = new javax.swing.JTextField();
btaddimage = new javax.swing.JButton();
btaddfile = new javax.swing.JButton();
joinbt = new javax.swing.JButton();
mainpanel = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
btaddmsg.setText("Add");
btaddmsg.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btaddmsgActionPerformed(evt);
}
});
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setLayout(null);
lbPhoto.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
getContentPane().add(lbPhoto);
lbPhoto.setBounds(20, 30, 280, 140);
lbCategory.setFont(new java.awt.Font("Tahoma", 1, 20)); // NOI18N
getContentPane().add(lbCategory);
lbCategory.setBounds(30, 260, 280, 40);
lbRoomName.setFont(new java.awt.Font("Tahoma", 1, 20)); // NOI18N
getContentPane().add(lbRoomName);
lbRoomName.setBounds(20, 190, 280, 40);
jScrollPane1.setViewportView(showmessage);
getContentPane().add(jScrollPane1);
jScrollPane1.setBounds(320, 30, 1240, 460);
tfMsg.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tfMsgActionPerformed(evt);
}
});
getContentPane().add(tfMsg);
tfMsg.setBounds(320, 510, 730, 50);
btaddimage.setText("Select Image");
btaddimage.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btaddimageActionPerformed(evt);
}
});
getContentPane().add(btaddimage);
btaddimage.setBounds(1220, 520, 130, 40);
btaddfile.setText("Select File");
btaddfile.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btaddfileActionPerformed(evt);
}
});
getContentPane().add(btaddfile);
btaddfile.setBounds(1360, 520, 140, 40);
joinbt.setText("Join Room");
joinbt.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
joinbtActionPerformed(evt);
}
});
getContentPane().add(joinbt);
joinbt.setBounds(30, 320, 220, 40);
mainpanel.setBackground(new java.awt.Color(204, 255, 255));
getContentPane().add(mainpanel);
mainpanel.setBounds(330, 590, 1170, 90);
jButton1.setText("ADD");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1);
jButton1.setBounds(1070, 520, 140, 40);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jTextArea1.setText("\n");
jScrollPane2.setViewportView(jTextArea1);
getContentPane().add(jScrollPane2);
jScrollPane2.setBounds(30, 360, 220, 400);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btaddmsgActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btaddmsgActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_btaddmsgActionPerformed
private void btaddfileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btaddfileActionPerformed
// TODO add your handling code here:
JFileChooser jfc2 = new JFileChooser("C:\\");
FileNameExtensionFilter filter = new FileNameExtensionFilter("PDF Files", "pdf", "epub", "txt", "docx", "doc");// to seclect only specific formate file
jfc2.setFileFilter(filter);
jfc2.setAcceptAllFileFilterUsed(false); //tp set enable to other filter
int returnVal = jfc2.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
try {
file2 = jfc2.getSelectedFile();
HttpResponse<String> response = Unirest.post(GlobalData.hostname + "/AddFileMsg")
.queryString("Rid", rid)
.queryString("UserName", GlobalData.nameofuser)
.queryString("MsgType", "file")
.field("Msg", file2)
.asString();
String ans = "";
ans = response.getBody();
JOptionPane.showMessageDialog(this, ans);
} catch (UnirestException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}
}//GEN-LAST:event_btaddfileActionPerformed
private void tfMsgActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfMsgActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_tfMsgActionPerformed
private void btaddimageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btaddimageActionPerformed
// TODO add your handling code here:
JFileChooser jfc = new JFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter("Image Files", "jpeg", "jpg", "bmp", "png");// to seclect only specific formate file
jfc.setFileFilter(filter);
jfc.setAcceptAllFileFilterUsed(false); //tp set enable to other filter
int returnVal = jfc.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
try {
file = jfc.getSelectedFile();
HttpResponse<String> response = Unirest.post(GlobalData.hostname + "/AddFileMsg")
.queryString("Rid", rid)
.queryString("UserName", GlobalData.nameofuser)
.queryString("MsgType", "photo")
.field("Msg", file)
.asString();
JOptionPane.showMessageDialog(this, response.getBody());
} catch (UnirestException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
} else {
System.out.println("File access cancelled by user.");
}
}//GEN-LAST:event_btaddimageActionPerformed
private void joinbtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_joinbtActionPerformed
// TODO add your handling code here:
String UserName = GlobalData.nameofuser;
try {
String ans = "";
HttpResponse<String> response = Unirest.get(GlobalData.hostname + "/JoinRoom")
.queryString("UserName", UserName)
.queryString("Rid", rid)
.asString();
ans = response.getBody();
System.out.println("RESPONSE OF JOINROOM BUTTON" + ans);
if (ans.equals("yes")) {
joinbt.setEnabled(false);
joinbt.setText("Joined");
showmessage.setVisible(true);
tfMsg.setVisible(true);
btaddfile.setVisible(true);
btaddimage.setVisible(true);
btaddmsg.setVisible(true);
jButton1.setVisible(true);
jTextArea1.setVisible(true);
mainpanel.setVisible(true);
}
} catch (UnirestException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_joinbtActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
String Msg = tfMsg.getText();
String username = GlobalData.nameofuser;
try {
HttpResponse<String> response = Unirest.get(GlobalData.hostname + "/AddMsg")
.queryString("Msg", Msg)
.queryString("MsgType", "text")
.queryString("username", username)
.queryString("rid", rid)
.asString();
JOptionPane.showMessageDialog(this, response.getBody());
} catch (UnirestException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton1ActionPerformed
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(JoinRoom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(JoinRoom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(JoinRoom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(JoinRoom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
// new JoinRoom().setVisible(true);
}
});
}
private void getroomdetails(int rid) {
try {
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
HttpResponse<String> response = Unirest.get(GlobalData.hostname + "/GetRoomDetails")
.queryString("rid", rid)
.asString();
String ans = response.getBody();
System.out.println(ans);
StringTokenizer st = new StringTokenizer(ans, "~~");
while (st.hasMoreTokens()) {
String RoomName = st.nextToken();
String Category = st.nextToken();
String Photo = st.nextToken();
lbRoomName.setText("Room Name:" + RoomName);
lbCategory.setText("Category:" + Category);
BufferedImage bufferedImage, newimage;
Icon icon;
URL url;
try {
url = new URL(GlobalData.hostname + "/GetResource/" + Photo);
System.out.println("url : " + url);
bufferedImage = ImageIO.read(url);
newimage = resizephoto(bufferedImage, lbPhoto.getWidth(), lbPhoto.getHeight());
icon = new ImageIcon(newimage);
lbPhoto.setIcon(icon);
} catch (Exception ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}
} catch (UnirestException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btaddfile;
private javax.swing.JButton btaddimage;
private javax.swing.JButton btaddmsg;
private javax.swing.JButton jButton1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JButton joinbt;
private javax.swing.JLabel lbCategory;
private javax.swing.JLabel lbPhoto;
private javax.swing.JLabel lbRoomName;
private javax.swing.JPanel mainpanel;
private javax.swing.JEditorPane showmessage;
private javax.swing.JTextField tfMsg;
// End of variables declaration//GEN-END:variables
BufferedImage resizephoto(BufferedImage image, int width, int height) {
BufferedImage bi = new BufferedImage(width, height, BufferedImage.TRANSLUCENT);
Graphics2D g2d = (Graphics2D) bi.createGraphics();
g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY));
g2d.drawImage(image, 0, 0, width, height, null);
g2d.dispose();
return bi;
}
private void checkroomjoined(int rid) {
System.out.println("chkroomjoined called");
try {
String username = GlobalData.nameofuser;
HttpResponse<String> response = Unirest.get(GlobalData.hostname + "/CheckJoin")
.queryString("Rid", rid)
.queryString("UserName", username)
.asString();
String ans = response.getBody();
System.out.println("RESPONSE OF CHECK ROOM JOINED" + ans);
if (ans.equals("yes")) {
joinbt.setEnabled(false);
joinbt.setText("Joined");
showmessage.setVisible(true);
tfMsg.setVisible(true);
btaddfile.setVisible(true);
btaddimage.setVisible(true);
btaddmsg.setVisible(true);
jButton1.setVisible(true);
jTextArea1.setVisible(true);
} else {
showmessage.setVisible(false);
tfMsg.setVisible(false);
btaddfile.setVisible(false);
btaddimage.setVisible(false);
btaddmsg.setVisible(false);
mainpanel.setVisible(false);
jButton1.setVisible(false);
jTextArea1.setVisible(false);
}
} catch (UnirestException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}
private void setemojis() {
JLabel lb[] = new JLabel[emojiSymbole.length];
for (int i = 0; i < emojiSymbole.length; i++) {
final int j = i;
try {
lb[i] = new JLabel();
BufferedImage img = ImageIO.read(new File(emojipics[i]));
//Image newimg = img.getScaledInstance(lbpreview.getWidth(), lbpreview.getHeight(), Image.SCALE_SMOOTH);
BufferedImage newimg = resizephoto(img, 50, 50);
//lbfilename.setText(file.getName());
lb[i].setIcon(new ImageIcon(newimg));
String sm = emojiSymbole[i];
mainpanel.add(lb[i]);
lb[i].addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
String username = GlobalData.nameofuser;
try {
HttpResponse<String> response = Unirest.get(GlobalData.hostname + "/AddMsg")
.queryString("Msg", sm)
.queryString("MsgType", "emoji")
.queryString("username", username)
.queryString("rid", rid)
.asString();
JOptionPane.showMessageDialog(rootPane, response.getBody());
} catch (UnirestException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
} catch (IOException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
private void scrollToBottom(JScrollPane scrollPane) {
JScrollBar verticalBar = scrollPane.getVerticalScrollBar();
AdjustmentListener downScroller = new AdjustmentListener() {
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
Adjustable adjustable = e.getAdjustable();
adjustable.setValue(adjustable.getMaximum());
verticalBar.removeAdjustmentListener(this);
}
};
verticalBar.addAdjustmentListener(downScroller);
}
private void GetRoomMemeber(int rid) {
try {
HttpResponse<String> response = Unirest.get(GlobalData.hostname + "/GetRoomMember")
.queryString("roomid", rid)
.asString();
String row = "";
String ans = response.getBody();
StringTokenizer st = new StringTokenizer(ans, "~~");
while (st.hasMoreTokens()) {
row = row + st.nextToken() + "\n";
}
jTextArea1.setText(row);
} catch (UnirestException ex) {
Logger.getLogger(JoinRoom.class.getName()).log(Level.SEVERE, null, ex);
}
}
public class MyClass implements Runnable {
@Override
public void run() {
try {
HttpResponse<String> response = Unirest.get(GlobalData.hostname + "/fetchmessages")
.queryString("roomid", rid)
.asString();
if (response.getStatus() == 200) {
String ans = response.getBody();
System.out.println("ans::" + ans);
StringTokenizer st = new StringTokenizer(ans, ";;");
String msg = "";
showmessage.setContentType("text/html");
while (st.hasMoreTokens()) {
String row = st.nextToken();
StringTokenizer col = new StringTokenizer(row, "~~");
String message = col.nextToken();
String postedby = col.nextToken();
String datetime = col.nextToken();
String dispname = col.nextToken();
String msgtype = col.nextToken();
// imgsrc = new File("passport.jpg").toURL().toExternalForm();
if (msgtype.equals("text")) {
if (postedby.equals(GlobalData.nameofuser)) {
msg += "<div style='text-align: right;background-color: #FFC0CB;margin-left:200px;margin-bottom: 10px;border: #000 solid medium'><h3><b>" + message + "</b></h3>";
msg += "<p>" + dispname + " " + datetime + "</p></div>";
} else {
msg += "<div style='text-align: left;background-color: #4FFFCE4;margin-right:200px;margin-bottom: 10px;border: #000 solid medium'><h3><b>" + message + "</b></h3>";
msg += "<p>" + dispname + " " + datetime + "</p></div>";
}
} else if (msgtype.equals("photo")) {
if (postedby.equals(GlobalData.nameofuser)) {
msg += "<div style='text-align: right;background-color: #FFC0CB;margin-left:200px;margin-bottom: 10px;border: #000 solid medium'><img src='file:" + message + "' width='200' height='200' />";
msg += "<p>" + dispname + " " + datetime + "</p></div>";
} else {
msg += "<div style='text-align: left;background-color: #4FFFCE4;margin-bottom: 10px;margin-right:200px;border: #000 solid medium'><img src='file:" + message + "' width='200' height='200' />";
msg += "<p>" + dispname + " " + datetime + "</p></div>";
}
} else if (msgtype.equals("emoji")) {
for (int i = 0; i < emojiSymbole.length; i++) {
if (message.equals(emojiSymbole[i])) {
if (postedby.equals(GlobalData.nameofuser)) {
msg += "<div style='text-align: right;background-color: #FFC0CB;margin-bottom: 10px;margin-left:200px;border: #000 solid medium'><img src='file:" + emojipics[i] + "' width='50' height='50' />";
msg += "<p>" + dispname + " " + datetime + "</p></div>";
} else {
msg += "<div style='text-align: left;background-color: #4FFFCE4;margin-bottom: 10px;margin-right:200px;border: #000 solid medium'><img src='file:" + emojipics[i] + "' width='50' height='50' />";
msg += "<p>" + dispname + " " + datetime + "</p></div>";
}
}
}
} else if (msgtype.equals("file")) {
if (postedby.equals(GlobalData.nameofuser)) {
msg += "<div style='text-align: right;background-color: #FFC0CB;margin-bottom: 10px;margin-left:200px;border: #000 solid medium'><a href=http://'" + message + "'> <img src='file:src/emojis/doc.jfif' width='70' height='70' /></a>";
msg += "<p>" + dispname + " " + datetime + "</p></div>";
} else {
msg += "<div style='text-align: left;background-color: #4FFFCE4;margin-bottom: 10px;margin-right:200px;border: #000 solid medium'><a href=http://'" + message + "'><img src='file:src/emojis/doc.jfif' width='70' height='70' /></a>";
msg += "<p>" + dispname + " " + datetime + "</p></div>";
}
}
}
showmessage.setText(msg);
showmessage.setEditable(false);
scrollToBottom(jScrollPane1);
showmessage.addHyperlinkListener(new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent he) {
if (he.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
URL value = he.getURL();
String val = value.toString();
String extension = val.substring(val.indexOf("."));
String path = val.substring(val.indexOf("/") + 2);
System.out.println("Actual URL" + he.getURL());
int ans = JOptionPane.showConfirmDialog(rootPane, "do you want to download the file??");
if (ans == JOptionPane.YES_OPTION) {
try {
HttpResponse<InputStream> response = Unirest.get(GlobalData.hostname + "/GetResource/" + path)
.asBinary();
InputStream is = response.getBody();
FileOutputStream fos;
System.out.println("responsebody is" + is);
String fname = new Date().getTime() + "" + extension;
fos = new FileOutputStream(System.getProperty("user.home") + "/Downloads/" + fname);
long contentlength = Integer.parseInt(response.getHeaders().getFirst("Content-Length"));
byte b[] = new byte[10000];
int r;
long count = 0;
while (true) {
r = is.read(b, 0, 10000);
fos.write(b, 0, r);
count = count + r;
System.out.println(count * 100 / contentlength + " %");
if (count == contentlength) {
break;
}
}
fos.close();
System.out.println("fikle downloaded");
System.out.println("File Downloaded....");
File f = new File(System.getProperty("user.home") + "\\Downloads\\" + fname);
URI u = f.toURI();
Desktop d = Desktop.getDesktop();
d.browse(u);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
}
}
);
}
} catch (UnirestException ex) {
ex.printStackTrace();
}
}
}
}
| [
"Rashvikumari78@gmail.com"
] | Rashvikumari78@gmail.com |
ce2de93be97ea82a0a76192fb3f096349c319f67 | 634d4b84728338dac165e9064a1d0ed25e95090f | /src/main/java/com/demos/design/chain/AbstractHandler.java | f72cd72609ca544f3eed343e43051a908ce63ad8 | [] | no_license | fumenyaolang/DemoUtil | ee53f971c8ffc15603970c5a2c55cf63756f1628 | 257908905f2c26491124f5b4ce8dbde045564309 | refs/heads/master | 2021-07-17T03:40:06.526801 | 2021-07-09T07:15:15 | 2021-07-09T07:15:15 | 48,013,247 | 0 | 0 | null | 2020-10-13T18:45:32 | 2015-12-15T01:58:53 | Java | UTF-8 | Java | false | false | 304 | java | package com.demos.design.chain;
/**
* Created by fumenyaolang on 2016-01-20.
*/
public abstract class AbstractHandler {
private Handler handler;
public Handler getHandler() {
return handler;
}
public void setHandler(Handler handler) {
this.handler = handler;
}
}
| [
"fuzq1919@hotmail.com"
] | fuzq1919@hotmail.com |
40b71aa62703486caae029fd2fa7a66dfb5956a6 | ee39edbde20dca63b432cd4a2954f9f7341a7726 | /src/main/java/zhawmessenger/messagesystem/api/message/Message.java | 0315e7654fef24907c3f08f4047c520e8604fafe | [] | no_license | jajadinimueter/zhawmessenger | aca9cb5cce637386bec4dd6833313132897d8fc4 | 27bbccc0bdf9dcaa88669d1f916c791e9c4cd5f7 | refs/heads/master | 2020-05-30T16:52:05.236245 | 2013-06-13T19:28:49 | 2013-06-13T19:28:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 890 | java | package zhawmessenger.messagesystem.api.message;
import zhawmessenger.messagesystem.api.contact.Contact;
import zhawmessenger.messagesystem.api.contact.ContactProvider;
import zhawmessenger.messagesystem.api.contact.DisplayableContactProvider;
import zhawmessenger.messagesystem.api.persistance.IdObject;
import java.util.Date;
import java.util.List;
/**
*/
public interface Message<R extends Contact> extends IdObject {
/**
* Returns an ID with uniqually identifies
* this message
*
* @return an ID
*/
Date getSendDate();
void setSendDate(Date date);
String getText();
void setText(String text);
void validate();
boolean isValid();
void clearContactProviders();
void addContactProvider(DisplayableContactProvider provider);
List<DisplayableContactProvider> getContactProviders();
List<R> getReceivers();
}
| [
"[email]"
] | [email] |
bc83ee63229031eae91dd1203f36a8125dc8b538 | 6923f79f1eaaba0ab28b25337ba6cb56be97d32d | /hadoop_in_practice/src/main/java/com/manning/hip/common/StreamToHdfs.java | 6696b692ccb630ea4c50365c7a6ebf9f7a4aa7b2 | [
"Apache-2.0"
] | permissive | burakbayramli/books | 9fe7ba0cabf06e113eb125d62fe16d4946f4a4f0 | 5e9a0e03aa7ddf5e5ddf89943ccc68d94b539e95 | refs/heads/master | 2023-08-17T05:31:08.885134 | 2023-08-14T10:05:37 | 2023-08-14T10:05:37 | 72,460,321 | 223 | 174 | null | 2022-10-24T12:15:06 | 2016-10-31T17:24:00 | Jupyter Notebook | UTF-8 | Java | false | false | 548 | java | package com.manning.hip.common;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
import java.io.OutputStream;
public class StreamToHdfs {
public static void main(String... args) throws Exception {
Configuration config = new Configuration();
FileSystem hdfs = FileSystem.get(config);
OutputStream os = hdfs.create(new Path(args[0]));
IOUtils.copyBytes(System.in, os, config, true);
IOUtils.closeStream(os);
}
}
| [
"bb@b.om"
] | bb@b.om |
7b21ed8095d96b948c8a84ec558c9d1572fa558a | ed5ca7a19fdfa9bb5b73ef3374c4a5f65aedd908 | /src/codegen/bytecode/stm/Ificmplt.java | 29fed001dcd606cfd2fab8a546e3b2683c07202b | [] | no_license | xudifsd/tiger | c298d37cfbb6500768b12acf30b4e5e7d853a70f | 232c464c93a541707d7436f1f4d8dd06c65b37b5 | refs/heads/master | 2021-01-15T17:07:13.922915 | 2013-12-26T13:35:50 | 2013-12-26T13:35:50 | 12,841,304 | 3 | 3 | null | 2020-01-19T07:49:26 | 2013-09-15T05:57:44 | Java | UTF-8 | Java | false | false | 248 | java | package codegen.bytecode.stm;
import util.Label;
import codegen.bytecode.Visitor;
public class Ificmplt extends T {
public Label l;
public Ificmplt(Label l) {
this.l = l;
}
@Override
public void accept(Visitor v) {
v.visit(this);
}
}
| [
"xudifsd@gmail.com"
] | xudifsd@gmail.com |
734c8a2480434a0db8c1c78e58e3714043db9462 | 54af6be07f98b6b5ca93c2a6a99c3f5c15c9e848 | /src/main/java/com/bertram/java_learn/single/SingleTest.java | c7d22560136d339e26b83e6bb27c66780a92edad | [] | no_license | liwang123/java_learn | bafc9ed8732f2fbdcce6f1a101881ee8f296f3c7 | 475f742e06315f76b3ad7357dd17091ea4d19477 | refs/heads/master | 2022-06-20T17:29:30.425426 | 2020-09-14T14:58:51 | 2020-09-14T14:58:51 | 198,855,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 779 | java | package com.bertram.java_learn.single;
/**
* @author wang
* @date 2020/8/6 16:26
*/
public class SingleTest {
public static void main(final String[] args) {
final HungerSingle hungerSingle = HungerSingle.getHungerSingle();
final HungerSingle hungerSingle1 = HungerSingle.getHungerSingle();
System.out.println(hungerSingle);
System.out.println(hungerSingle1);
final LazySingle lazy = LazySingle.getLazy();
final LazySingle lazy1 = LazySingle.getLazy();
System.out.println(lazy);
System.out.println(lazy1);
final EnumSingle instance = EnumSingle.INSTANCE;
final EnumSingle instance1 = EnumSingle.INSTANCE;
System.out.println(instance);
System.out.println(instance1);
}
}
| [
"wang.li@huangjinqianbao.com"
] | wang.li@huangjinqianbao.com |
be39b68edd7db459c655c1b25221aa25e03cbd7a | af10e12655b40560645e9b45c3ccf1c8e2d97d0c | /Creational/src/pattern/SimpleFactory/demo/Fruit.java | c913ba6455d039180eeee7f64b38637dcab15ebe | [] | no_license | liuchenwei2000/DesignPattern | 1bf28432e522873ea200453d88fe19bc20527902 | d984238a21ab27f4bdebcce8e11829eb2161b188 | refs/heads/master | 2021-01-10T08:13:22.867469 | 2017-04-27T07:51:40 | 2017-04-27T07:51:40 | 48,793,059 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 292 | java | /**
*
*/
package pattern.SimpleFactory.demo;
/**
* ๆฐดๆๆฅๅฃ
*
* @author ๅๆจไผ
*
* ๅๅปบๆฅๆ๏ผ2010-2-3
*/
public interface Fruit {
/**
* ็งๆค
*/
public void plant();
/**
* ็้ฟ
*/
public void grow();
/**
* ๆถ่ท
*/
public void harvest();
}
| [
"liuchenwei2000@163.com"
] | liuchenwei2000@163.com |
8c85bb3b354db1629b825393cac3161671af2331 | 0eb0a0836779a72b33ba0d00d3ca804bd2341884 | /src/main/java/com/desafio/model/User.java | 74eac786f086e3f82864829bc182296b4b0dbd74 | [] | no_license | sflorencio/ApiRestFull | e10a1b11ec44a298385b35dfdfdea75c96efb332 | d9b7bb10a5c803c9644b33553bb871ce2ba1409b | refs/heads/master | 2022-12-25T11:50:03.255417 | 2020-10-06T15:52:21 | 2020-10-06T15:52:21 | 301,742,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,579 | java | package com.desafio.model;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.CreationTimestamp;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(name = "firstName")
private String firstName;
@Column(name = "lastName")
private String lastName;
@Column(name = "email")
private String email;
@Column(name = "birthday")
private Date birthday;
@Column(name = "login")
private String login;
@Column(name = "password")
private String password;
@Column(name = "phone")
private String phone;
@CreationTimestamp
private Date createdAt;
@CreationTimestamp
private Date lastLogin;
@JsonIgnoreProperties("user")
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<Car> cars;
public long getId() {
return id;
}
public void setId(long 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;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhone() {
return phone;
}
public List<Car> getCars() {
return cars;
}
public void setCars(List<Car> cars) {
this.cars = cars;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getLastLogin() {
return lastLogin;
}
public void setLastLogin(Date lastLogin) {
this.lastLogin = lastLogin;
}
}
| [
"Smokoveck.florencio@gmail.com"
] | Smokoveck.florencio@gmail.com |
7d348d1fd94d97ef78aeb8f0564eedaec07d4b5c | 6aa23a549fdc6b57dbd8393b1ef7b00a07b9cb7c | /servoy_mobile/src/main/java/com/servoy/mobile/client/ui/ISupportsPlaceholderComponent.java | 7481934f4f03985c6c6f14c5cfa796c09239a9d4 | [] | no_license | Servoy/servoy-mobile | 4ea658c1b99fe3cd39930c9ed729b993c2e7d1f8 | 4c66dad79d17cf56600091f6206df538a537da55 | refs/heads/master | 2023-07-20T05:14:53.579296 | 2023-07-19T09:47:22 | 2023-07-19T09:47:22 | 21,307,549 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,049 | java | /*
This file belongs to the Servoy development and deployment environment, Copyright (C) 1997-2013 Servoy BV
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along
with this program; if not, see http://www.gnu.org/licenses or write to the Free
Software Foundation,Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
*/
package com.servoy.mobile.client.ui;
/**
* @author lvostinar
*
*/
public interface ISupportsPlaceholderComponent
{
void setPlaceholderText(String placeholder);
}
| [
"lvostinar@servoy.com"
] | lvostinar@servoy.com |
5b4827bac497b034c5fb562bc7f62332c037de37 | 42bc9be7af5801e219f5583ab50f52abf250d5ad | /src/ThinkingInJava/Concurrent/Test2.java | 5673a62ab513f998bf5b407e9d9eaea299eb4398 | [] | no_license | BrkingYan/Learning | 798b762626011f67dde5adf7e324aa4c723f0b96 | a51861b159f48b76908ab7ab6bcabb1a0b1983ac | refs/heads/master | 2020-04-28T22:27:53.551362 | 2020-03-08T08:05:21 | 2020-03-08T08:05:21 | 175,618,634 | 0 | 0 | null | 2020-03-08T08:05:23 | 2019-03-14T12:35:04 | Java | UTF-8 | Java | false | false | 778 | java | package ThinkingInJava.Concurrent;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
class Test2 {
public static void main(String[] args) throws InterruptedException {
ExecutorService exec = Executors.newCachedThreadPool();
exec.execute(new Runnable(){
@Override
public void run() {
synchronized (this){
try {
System.out.println("thread is wait()");
wait();
} catch (InterruptedException e) {
System.out.println("interrupted when wait()");
}
}
}
});
Thread.sleep(2000);
exec.shutdownNow();
}
}
| [
"yybreaking123"
] | yybreaking123 |
9ec4f49a18037450dc67e39fed371ac5e564a51c | 6720292793dd46d611d7194529c06ec2cc7f6266 | /adapter-pattern/src/main/java/delegate/V1ApiImpl.java | 901f612c7d770b25174a72f12006e3a06e71c9a8 | [] | no_license | nxzh/design-pattern | 9454ee13e3519fe54acfd0acd186a66fc4ce3506 | f75208673d9cb9057b5655cd02fd45ef5d87a17a | refs/heads/master | 2021-09-29T01:01:04.237197 | 2018-11-22T03:18:08 | 2018-11-22T03:18:08 | 155,141,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package delegate;
public class V1ApiImpl implements V1Api {
public void open() {
System.out.println("opening...");
}
public void initialize() {
System.out.println("initializing...");
}
public void deInitializate() {
System.out.println("deinitializing...");
}
public void close() {
System.out.println("closing...");
}
}
| [
"sid.a.zhang@capgemini.com"
] | sid.a.zhang@capgemini.com |
183adb528fe7c7efa43ff7a23cc2e599d1837728 | 66df9daa925d53adf9e2fa1f88e7c3b25e67604b | /5. Simple web app with jsp/src/main/java/ru/itis/repositories/UsersRepository.java | 54eb8cd710c17c57b72a00b1224b3d4196a198ad | [] | no_license | oleg-romanov/Homeworks | 494da342e197c4136fb759148a0c019520012c18 | 11ae554b598dbdab700522630e03e32aef1882db | refs/heads/master | 2023-02-14T01:14:18.955023 | 2021-01-09T13:08:35 | 2021-01-09T13:08:35 | 294,513,674 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java | package ru.itis.repositories;
import ru.itis.models.User;
public interface UsersRepository extends CrudRepository<User> {
}
| [
"55031494+oleg-romanov@users.noreply.github.com"
] | 55031494+oleg-romanov@users.noreply.github.com |
1fb0a9ec2ee5401874fef75df8bbd50aae3c621e | 024397c283650937107589ad0bcf21ac2e10b314 | /src/mobi/square/slots/tools/AtlasLoader.java | 0fa7786afcb1a25a4a883d9b810ef6dfe17273e5 | [] | no_license | Avatarchik/SlotsGdxAndroidOffline | 4558b8c6cc9ccf96dacfd23b408ac389f5a24b69 | 863b0ad402190895a5ba3513ad681b3d83c23af3 | refs/heads/master | 2021-01-15T11:07:31.156039 | 2015-05-08T02:25:18 | 2015-05-08T02:25:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,796 | java | package mobi.square.slots.tools;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
public class AtlasLoader {
private static final Map<String, TextureAtlas> atlas;
private static final Set<String> dispose_queue;
static {
atlas = new HashMap<String, TextureAtlas>();
dispose_queue = new HashSet<String>();
}
public static TextureAtlas get(String internal_pack_name) {
synchronized (dispose_queue) {
dispose_queue.remove(internal_pack_name);
}
TextureAtlas result;
synchronized (atlas) {
result = atlas.get(internal_pack_name);
if (result == null) {
result = new TextureAtlas(internal_pack_name);
atlas.put(internal_pack_name, result);
}
}
return result;
}
public static void prepareDispose(String internal_pack_name) {
synchronized (dispose_queue) {
dispose_queue.add(internal_pack_name);
}
}
public static void disposePrepared() {
synchronized (dispose_queue) {
for (String name : dispose_queue) {
TextureAtlas object = atlas.get(name);
if (object != null) {
atlas.remove(name);
object.dispose();
}
}
dispose_queue.clear();
}
}
public static void dispose(String internal_pack_name) {
synchronized (dispose_queue) {
TextureAtlas object = atlas.get(internal_pack_name);
if (object != null) {
atlas.remove(internal_pack_name);
object.dispose();
}
}
}
public static void disposeAll() {
synchronized (dispose_queue) {
dispose_queue.clear();
}
synchronized (atlas) {
Set<String> keys = atlas.keySet();
for (String key : keys) {
atlas.get(key).dispose();
}
atlas.clear();
}
}
}
| [
"joca220@hotmail.com"
] | joca220@hotmail.com |
5cb145067b164c783de04cd2a26b285b4634fc1a | 601db7dc4254d9eadb8bd3d01f4964a79daf2736 | /BoardTest/src/main/java/com/icia/board/dto/CommentDTO.java | 719faf6e7d2d250b4a8f0ec48a60a1e16f43bebd | [] | no_license | HoonCha999/Spring | 017550efe40874729902c0f889b66ae2f5dce1bc | dbb86a6824893a73cad8bf8c0f816546bb380f33 | refs/heads/master | 2022-12-13T09:52:06.491361 | 2020-08-25T07:37:39 | 2020-08-25T07:37:39 | 290,146,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 272 | java | package com.icia.board.dto;
import lombok.Data;
@Data
public class CommentDTO {
private int cnum; // ๋๊ธ ๋ฒํธ(PK)
private int cbnum; // ๊ฒ์๊ธ ๋ฒํธ(FK)
private String cwriter; // ์์ฑ์
private String ccontents; // ๋๊ธ ๋ด์ฉ
}
| [
"noreply@github.com"
] | noreply@github.com |
9049d2f2baba41ea5cf308414ba38b8a19fdd2bd | c8552ad3f27e91fb6096f096e214247622278b0e | /exercise/src/main/java/Leetcode283_MoveZeros.java | 288d420601e0c8a4849599d444442b1918961cd9 | [] | no_license | Castiel-Chou/DataStructureAndAlgorithm | 10b2e635b9b248b1c6e54ef6eb4610e694068b44 | 470743f69762c80acc0dc03c39cee14bdf679415 | refs/heads/master | 2021-01-03T05:15:37.229232 | 2020-07-01T07:51:41 | 2020-07-01T07:51:41 | 239,936,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,360 | java | /**
* @ClassName: Leetcode283_MoveZeros
* @Description:
*
* ็ปๅฎไธไธชๆฐ็ป nums๏ผ็ผๅไธไธชๅฝๆฐๅฐๆๆ 0 ็งปๅจๅฐๆฐ็ป็ๆซๅฐพ๏ผๅๆถไฟๆ้้ถๅ
็ด ็็ธๅฏน้กบๅบใ
*
* ็คบไพ:
*
* ่พๅ
ฅ: [0,1,0,3,12]
* ่พๅบ: [1,3,12,0,0]
* ่ฏดๆ:
*
* ๅฟ
้กปๅจๅๆฐ็ปไธๆไฝ๏ผไธ่ฝๆท่ด้ขๅค็ๆฐ็ปใ
* ๅฐฝ้ๅๅฐๆไฝๆฌกๆฐใ
*
* ๆฅๆบ๏ผๅๆฃ๏ผLeetCode๏ผ
* ้พๆฅ๏ผhttps://leetcode-cn.com/problems/move-zeroes
* ่ไฝๆๅฝ้ขๆฃ็ฝ็ปๆๆใๅไธ่ฝฌ่ฝฝ่ฏท่็ณปๅฎๆนๆๆ๏ผ้ๅไธ่ฝฌ่ฝฝ่ฏทๆณจๆๅบๅคใ
*
* @Author: Jokey Zhou
* @Date: 2020/5/17
* @่ตๅไธ็ๅนถไธๆฏ่พฝ้็่้๏ผๆฐๆฎไนไธๅ
จๆฏๅฐๅท็่ฎฐๅฝ๏ผๅฎๆฏไบฒไบบ็็ฌ้ฅ๏ผๅฎๆฏๆไปฌ็่ฎฐๅฟใ
*/
public class Leetcode283_MoveZeros {
/**
* ่ฟ้้ข็ๆ่ทฏไธบ๏ผ
* 1. ้ฆๅ
ๅฐๆๆ้้ถ็ๆฐๆๆฌกๅบไปๆฐ็ปindexไธบ0ๅผๅงๅกซๅ
* 2. ๅฐๆฐ็ปๅฉไธไฝ็ฝฎๅ
จ้จๅกซๅ
0ๅณๅฏ
* 3. ๆถ้ดๅคๆๅบฆO(n)๏ผ็ฉบ้ดๅคๆๅบฆO(1)
*
* @param nums
*/
public static void moveZeros(int[] nums) {
int count = 0;
for (int i=0; i<nums.length; i++) {
if (nums[i] != 0) {
nums[count] = nums[i];
count ++;
}
}
for(int j=count; j<nums.length; j++) {
nums[j] = 0;
}
}
}
| [
"1024232950@qq.com"
] | 1024232950@qq.com |
bc867aadd3bdc4dab989b4f0009fe040278be914 | 165526f2774e86eaffcfcaa7b07cc6083c2a6a96 | /src/com/basictwitter/apps/basictwitter/adapters/ImageArrayAdapter.java | c10f061f6749fe5d4bf0ccf8f66798e11cc17228 | [] | no_license | tinawen/SimpleTwitterClient | 9a37de2e1fdaa1ff22de08d0390a8be6283e6363 | 4623813cdcc2d7fae99aa40384425ea9135c571c | refs/heads/master | 2016-09-05T12:02:34.556156 | 2014-06-26T07:20:56 | 2014-06-26T07:20:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,462 | java | package com.basictwitter.apps.basictwitter.adapters;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import com.codepath.apps.basictwitter.R;
import com.basictwitter.apps.basictwitter.activities.ImageDisplayActivity;
import com.nostra13.universalimageloader.core.ImageLoader;
import java.util.List;
/**
* Created by tina on 6/21/14.
*/
public class ImageArrayAdapter extends ArrayAdapter<String> {
// View lookup cache
private static class ViewHolder {
String url;
ImageView imageView;
}
public ImageArrayAdapter(Context context, List<String> imageUrls) {
super(context, R.layout.image_item, imageUrls);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final String newUrl = this.getItem(position);
ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder();
LayoutInflater inflater = LayoutInflater.from(getContext());
convertView = inflater.inflate(R.layout.image_item, parent, false);
convertView.setTag(viewHolder);
viewHolder.url = newUrl;
viewHolder.imageView = (ImageView) convertView.findViewById(R.id.image);
viewHolder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getContext(), ImageDisplayActivity.class);
intent.putExtra("url", newUrl);
getContext().startActivity(intent);
}
});
} else {
viewHolder = (ViewHolder) convertView.getTag();
// only erase image bitmap if we want to display a different image
if (!viewHolder.url.equals(newUrl)) {
viewHolder.imageView.setImageBitmap(null);
viewHolder.url = newUrl;
}
}
viewHolder.imageView.setImageResource(Color.TRANSPARENT);
ImageLoader imageLoader = ImageLoader.getInstance();
// load with small thumbnails. "thumb" type is too small
imageLoader.displayImage(newUrl + ":small", viewHolder.imageView);
return convertView;
}
}
| [
"tdubs@tinawen.com"
] | tdubs@tinawen.com |
d14df76726751aab61abbb79fc704925b6c787d5 | 898e8ad05a91f18e989527ec4ad889eb7481d61e | /src/main/java/com/springbootexceptionhandlingwithaspect/app/aop/OrderItemServiceAspect.java | c560d854cc913e69d1dcba37c1d7f12ff14d6f09 | [] | no_license | owenJiao/SpringBootExceptionHandlingAspect | cc4748b6c2b1bb6a0a964942b0bad09a84315f23 | ec006e0e68fba374ef14fc93bb5f2dfcedd62991 | refs/heads/master | 2023-08-15T23:52:01.682674 | 2021-10-10T19:04:49 | 2021-10-10T19:04:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,205 | java | package com.springbootexceptionhandlingwithaspect.app.aop;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class OrderItemServiceAspect {
@Before(value="execution(* com.springbootexceptionhandlingwithaspect.app.service.OrderItemService.*(..))")
public void beforeAdvice(JoinPoint joinPoint){
System.out.println("OrderItemServiceAspect | Before OrderItemService method got called");
}
@After(value="execution(* com.springbootexceptionhandlingwithaspect.app.service.OrderItemService.*(..))")
public void afterAdvice(JoinPoint joinPoint){
System.out.println("OrderItemServiceAspect | After OrderItemService method got called");
}
@AfterReturning(value="execution(* com.springbootexceptionhandlingwithaspect.app.service.OrderItemService.*(..))")
public void afterReturningAdvice(JoinPoint joinPoint){
System.out.println("OrderItemServiceAspect | AfterReturning OrderItemService method got called");
}
}
| [
"sngermiyanoglu@hotmail.com"
] | sngermiyanoglu@hotmail.com |
e79043fa20947c54d14f626093a41d8decc4a713 | 60ed825a78fdaa3af2f01e27c7eb55de5201f026 | /src/main/java/com/mongodb2/client/model/UpdateOptions.java | b4acfb33c64f19970ccc097559c585e3dae1bbda | [] | no_license | newthis/enc-mongodb | f2638ca1905f028ca4386d47fb6ffa99143f55c7 | 1e87ec6e7c4eced8bf0f9bf7689a7978f18be6ed | refs/heads/master | 2021-07-12T07:17:34.216032 | 2019-06-15T01:52:23 | 2019-06-15T01:52:23 | 155,966,484 | 2 | 0 | null | 2020-06-15T19:41:59 | 2018-11-03T08:58:32 | Java | UTF-8 | Java | false | false | 3,050 | java | /*
* Copyright (c) 2008-2014 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mongodb2.client.model;
/**
* The options to apply when updating documents.
*
* @since 3.0
* @mongodb.driver.manual tutorial/modify-documents/ Updates
* @mongodb.driver.manual reference/operator/update/ Update Operators
* @mongodb.driver.manual reference/command/update/ Update Command
*/
public class UpdateOptions {
private boolean upsert;
private Boolean bypassDocumentValidation;
private Collation collation;
/**
* Returns true if a new document should be inserted if there are no matches to the query filter. The default is false.
*
* @return true if a new document should be inserted if there are no matches to the query filter
*/
public boolean isUpsert() {
return upsert;
}
/**
* Set to true if a new document should be inserted if there are no matches to the query filter.
*
* @param upsert true if a new document should be inserted if there are no matches to the query filter
* @return this
*/
public UpdateOptions upsert(final boolean upsert) {
this.upsert = upsert;
return this;
}
/**
* Gets the the bypass document level validation flag
*
* @return the bypass document level validation flag
* @since 3.2
* @mongodb.server.release 3.2
*/
public Boolean getBypassDocumentValidation() {
return bypassDocumentValidation;
}
/**
* Sets the bypass document level validation flag.
*
* @param bypassDocumentValidation If true, allows the write to opt-out of document level validation.
* @return this
* @since 3.2
* @mongodb.server.release 3.2
*/
public UpdateOptions bypassDocumentValidation(final Boolean bypassDocumentValidation) {
this.bypassDocumentValidation = bypassDocumentValidation;
return this;
}
/**
* Returns the collation options
*
* @return the collation options
* @since 3.4
* @mongodb.server.release 3.4
*/
public Collation getCollation() {
return collation;
}
/**
* Sets the collation options
*
* <p>A null value represents the server default.</p>
* @param collation the collation options to use
* @return this
* @since 3.4
* @mongodb.server.release 3.4
*/
public UpdateOptions collation(final Collation collation) {
this.collation = collation;
return this;
}
}
| [
"test@123.com"
] | test@123.com |
f1658ef55c6c42537d92d0758dffe0994c3db7c9 | 8cb9c805da0fd85f4f0ed9b9fe10ebcf1fc2b058 | /app/src/main/java/com/example/vimlendra/automobile/Model/User.java | 41c9280e1ddb15efd9cf476997761427f10484d1 | [] | no_license | vimi30/Automobile | 02aba030611f7790e8c9dd90290df179e694f73b | deb29d1afa0b66ea1b2a3555c8e8c1b21844e806 | refs/heads/master | 2022-12-21T19:49:19.360883 | 2020-09-30T05:40:55 | 2020-09-30T05:40:55 | 266,698,228 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,138 | java | package com.example.vimlendra.automobile.Model;
public class User {
private String Name,Password,phoneNumber,image, gender;
private User(){
}
public User(String name, String password, String phoneNumber, String image, String gender) {
Name = name;
Password = password;
this.phoneNumber = phoneNumber;
this.image = image;
this.gender = gender;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public String getPassword() {
return Password;
}
public void setPassword(String password) {
Password = password;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
}
| [
"bouddh.vimlendra@gamil.com"
] | bouddh.vimlendra@gamil.com |
607475ddc167bdfbe1a40bf826b1345809a0463e | 83d6f8d1ea6e78e59ae30e979dd26ccbbdf11215 | /app/src/main/java/com/juxin/predestinate/module/local/statistics/AudioVedioSource.java | aa28f0503737a87701d6a3e47f29aa092ae4217c | [] | no_license | muyouwoshi/JFHHGL | b6c232e4fc781184019501d3add2f3c353ebbfd3 | c1a5aa19772ccb698f20982aed08c41a0a7f2ec9 | refs/heads/master | 2021-05-11T22:54:27.083425 | 2018-01-15T05:42:45 | 2018-01-15T05:42:45 | 117,501,517 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,690 | java | package com.juxin.predestinate.module.local.statistics;
import java.util.ArrayList;
import java.util.List;
/**
* ็ฑปๆ่ฟฐ๏ผ
* ๅๅปบๆถ้ด๏ผ2017/9/16 13:37
* ไฟฎๆนๆถ้ด๏ผ2017/9/16 13:37
* Created by Administrator on 2017/9/16
* ไฟฎๆนๅคๆณจ๏ผ
*/
public class AudioVedioSource extends CommonSource<CommonSource.CommonSourceContainer> {
final static List<String> sources = new ArrayList<String>(50);
static {
sources.add("faxian_yuliao_listitem_video");
sources.add("faxian_yuliao_listitem_voice");
sources.add("faxian_tuijian_userinfo_lookta");
sources.add("faxian_tuijian_userinfo_sendvoice");
sources.add("faxian_tuijian_userinfo_chatframe_toolplus_video");
sources.add("faxian_tuijian_userinfo_chatframe_toolplus_voice");
sources.add("xiaoxi_listitem_video_huibo");
sources.add("xiaoxi_listitem_video_jieting");
sources.add("xiaoxi_listitem_voice_huibo");
sources.add("xiaoxi_listitem_voice_jieting");
sources.add("xiaoxi_chatframe_toolplus_video");
sources.add("xiaoxi_chatframe_toolplus_voice");
sources.add("xiaoxi_chatframe_content_video_huibo");
sources.add("xiaoxi_chatframe_content_video_accept");
sources.add("xiaoxi_chatframe_content_voice_huibo");
sources.add("xiaoxi_chatframe_content_voice_accept");
sources.add("xiaoxi_chatframe_lookta");
sources.add("xiaoxi_chatframe_more_video");
sources.add("xiaoxi_chatframe_more_voice");
sources.add("xiaoxi_chatframe_userinfo_lookta");
sources.add("xiaoxi_chatframe_userinfo_sendvoice");
sources.add("tip_video_accept");
sources.add("faxian_yuliao_other");
sources.add("faxian_tuijian_other");
sources.add("xiaoxi_other");
sources.add("tip_other");
sources.add("haoyou_chatframe_videotask_go");
//็ดๆญๆฐๅข
sources.add("zhibo_userinfo_lookta");
sources.add("zhibo_userinfo_sendvoice");
sources.add("zhibo_userinfo_chatframe_toolplus_video");
sources.add("zhibo_userinfo_chatframe_toolplus_voice");
sources.add("me_myy"); // ้ฒๆญขๆฆๆช
sources.add("me_myvip");
sources.add("me_mygem_pay");
}
@Override
public String getSource(CommonSourceContainer container) {
if(!contain(container)) return findOther(container);
return container.getSource();
}
@Override
public boolean containSource(CommonSourceContainer container) {
return sources.contains(container.getSource());
}
public static boolean contain(String source){
return sources.contains(source);
}
}
| [
"zhoujie@megvii.com"
] | zhoujie@megvii.com |
cb0c024eacf571879fcfbea1fca534a7deae6849 | a3b5646b7630942ab811069b39b2de64e9a71136 | /cei/CeiPhone/src/com/hyrt/ceiphone/common/Announcement.java | 381980e3a2389ea7ad1de204502c61cb1e40b7c7 | [] | no_license | zhongshuiyuan/hyrtproject | 06f8743faf5f454313a10e8664ca3018e9f23437 | 9b1ef04de5f61ff186d85b64c52defb6d4ebea7a | refs/heads/master | 2020-04-06T06:53:04.480449 | 2013-12-23T12:15:01 | 2013-12-23T12:15:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,978 | java | package com.hyrt.ceiphone.common;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import com.hyrt.cei.adapter.AnnouncementListAdapter;
import com.hyrt.cei.application.CeiApplication;
import com.hyrt.cei.ui.personcenter.PersonCenter;
import com.hyrt.cei.ui.witsea.WitSeaActivity;
import com.hyrt.cei.util.XmlUtil;
import com.hyrt.cei.vo.AnnouncementNews;
import com.hyrt.cei.vo.ColumnEntry;
import com.hyrt.cei.webservice.service.Service;
import com.hyrt.ceiphone.ContainerActivity;
import com.hyrt.ceiphone.R;
/**
* ้็ฅๅ
ฌๅ
*
* @author Administrator
*
*/
public class Announcement extends ContainerActivity implements OnClickListener {
private ExecutorService executorService = Executors.newFixedThreadPool(1);
private ListView list;
private List<AnnouncementNews> announcementNews;
private Intent intent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.announcement);
overridePendingTransition(R.anim.push_in, R.anim.push_out);
init();
SharedPreferences settings = getSharedPreferences(
"announcementCount", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = settings.edit();
editor.putInt("old", settings.getInt("new", 0));
editor.commit();
}
public void init() {
LinearLayout bottomsLl = (LinearLayout) findViewById(R.id.bottoms_Ll);
for (int i = 0; i < bottomsLl.getChildCount(); i++) {
((RelativeLayout) (bottomsLl.getChildAt(i))).getChildAt(0)
.setOnClickListener(this);
}
list = (ListView) findViewById(R.id.tzgg_list);
refreshListData();
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int position, long arg3) {
intent = new Intent();
intent.putExtra("extra", announcementNews.get(position).getId());
intent.setClass(Announcement.this, AnnouncementRead.class);
Announcement.this.startActivity(intent);
}
});
}
Handler newsHandler = new Handler() {
public void handleMessage(Message msg) {
AnnouncementListAdapter adapter = new AnnouncementListAdapter(
Announcement.this, R.layout.tzgg_list_item,
announcementNews);
list.setAdapter(adapter);
}
};
private void refreshListData() {
executorService.submit(new Runnable() {
@Override
public void run() {
announcementNews = new ArrayList<AnnouncementNews>();
String rs = "";
ColumnEntry columnEntry = ((CeiApplication) getApplication()).columnEntry;
rs = Service.queryNotice(columnEntry.getUserId());
try {
announcementNews = XmlUtil.getAnnouncement(rs);
} catch (Exception e) {
e.printStackTrace();
}
Message msg = newsHandler.obtainMessage();
newsHandler.sendMessage(msg);
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.main_rl:
intent = new Intent(this, HomePageDZB.class);
startActivity(intent);
break;
case R.id.notice_rl:
intent = new Intent(this, Announcement.class);
startActivity(intent);
break;
case R.id.collect_rl:
intent = new Intent(this, WitSeaActivity.class);
startActivity(intent);
break;
case R.id.psc_rl:
intent = new Intent(this, PersonCenter.class);
startActivity(intent);
break;
}
}
}
| [
"13718868826@163.com"
] | 13718868826@163.com |
6e9f91ba0121612c2f9128f9245e1a818bbd7b5f | e0a37d192327c44ffca31fc2f50b34046470e61c | /SchroedingerProgrammiertJavaSelberErstellt/src/de/galileocomputing/schroedinger/java/kapitel06/Vererbung/Musikgruppe/Proberaum.java | 13a1cbd3901d254caa4b912763ca18f945e3910e | [] | no_license | StephanD92/WS1920SE | 0e22731f18ead36bd39f919aad4591fb8c1fe820 | 37023fa1b72b2f2349b3601352da55d3db5bd814 | refs/heads/master | 2020-09-22T05:06:53.086378 | 2019-11-30T19:13:08 | 2019-11-30T19:13:08 | 225,058,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package de.galileocomputing.schroedinger.java.kapitel06.Vererbung.Musikgruppe;
public class Proberaum {
public static void main(String[] args) {
Musiker saenger = new Saenger("uschi","peters",26,"deepVoice1");
Musiker saenger2 = new Saenger("peter","hage",34,"hardvoidce2");
Gitarrist gitarrist = new Gitarrist("Jochen","Peters",22,"drownking");
// // Bassist bassist = new Bassist(); man kann am Anfang Bassist oder Allgemeinere Klasse (Musiker) schreiben
Musiker bassist = new Bassist("Udo","juergends",44,"bassKing");
Trompeter trompeter = new Trompeter("Hand","imgluck",55,"trompeter4Life");
BackgroundSaengerin backgroundsaengerin = new BackgroundSaengerin("hanna","krone",55,"kronkesingtbackground");
machtMusik(saenger,saenger2,gitarrist,bassist,trompeter,backgroundsaengerin);
// saenger.musizieren();
// System.out.println();
// saenger2.musizieren();
// bassist.musizieren();
// backgroundsaengerin.musizieren();
// trompeter.musizieren(); diese 4 zeilen lassen die leute einzeln musizieren
}
public static void machtMusik(Musiker...gruppe) {
for(Musiker musiker : gruppe) {
musiker.musizieren();
}
}
}
| [
"stephan.dueck@fh-bielefeld.de"
] | stephan.dueck@fh-bielefeld.de |
dd98549661da18276129a8934b7847abe5a06267 | eb529b668d5a8c52b7632e5b914afa08c432f980 | /design-pattern/src/main/java/org/brilliance/design/observer/EventArgs.java | 94b06df90f8be7a419130de404c484f60afe15d8 | [] | no_license | haperkelu/design-pattern | 77a2c312ca887086b0a0d574336689a31745f1f3 | 85a404ad956f42433bae0b77a26f1c99e9684c31 | refs/heads/master | 2020-05-02T17:42:27.270404 | 2014-05-24T07:18:26 | 2014-05-24T07:18:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 841 | java | /**
* @Title: EventArgs.java
* @Package org.brilliance.design.observer.jdk
* @Description: TODO
* @author PAI LI
* @date 2014-5-22 ไธๅ1:07:34
* @version V1.0
*/
package org.brilliance.design.observer;
/**
* @author PAI LI
*
*/
public class EventArgs {
public EventArgs(EventCodeGroup eventCodeGroup) {
this.eventCodeGroup = eventCodeGroup;
}
private EventCodeGroup eventCodeGroup;
/**
* @return the eventCode
*/
public EventCodeGroup getEventCodeGroup() {
return eventCodeGroup;
}
private Object passingArguments;
/**
* @return the passingArguments
*/
public Object getPassingArguments() {
return passingArguments;
}
/**
* @param passingArguments the passingArguments to set
*/
public void setPassingArguments(Object passingArguments) {
this.passingArguments = passingArguments;
}
}
| [
"haperkelu@gmail.com"
] | haperkelu@gmail.com |
36283e13c743281e12fce2cdfbd83f77c44875f7 | 7f0e3ad0e8caef6f48829db33b9c60f057e95ad9 | /Calisma/src/GenelKonular/OOP6/Student.java | 8543b88fa38e95db2250b537ecf42aba74bba870 | [] | no_license | T-Tufan/Java-Work-Files | 7a112e1d82190b6e6895bc362070e318ece92d27 | 9ef3ad62d922305abd4ef8db6b4321e47c59c7e6 | refs/heads/master | 2023-03-13T12:19:54.023179 | 2021-03-06T14:32:55 | 2021-03-06T14:32:55 | 345,094,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 947 | java | package GenelKonular.OOP6;
import java.util.ArrayList;
public class Student {
public String name;
public int number;
public int point;
private static int counter;
Student(String name,int number,int point){
this.name = name;
this.number = number;
this.point = point;
Student.counter++;
}
public String print(){
return "รฤrenci ismi : "+name
+"\nรฤrenci numaras : "+number
+"\nรฤrenci puanฤฑ : "+point
+"\nรฤrenci sฤฑrasฤฑ : "+counter;
}
public void exit(){
Student.counter--;
}
public static int howMuchStudent(){
return Student.counter;
}
public static double classAverage(ArrayList<Integer> points){
double sumPoint =0 ;
for (int i=0 ; i<points.size();i++){
sumPoint = points.get(i)+sumPoint;
}
return sumPoint/points.size();
}
}
| [
"ttugay1997@gmail.com"
] | ttugay1997@gmail.com |
3338cd42de23e9c34c6216a3c59c337fec2fc7ac | 43416b306b4fd1f838a6a12b15d9c1efd7014988 | /java/com/mobipesa/nilipieapp/helpers/DiskIOThreadExecutor.java | c1405d93050211d374d2728e78c337f737d6f06f | [] | no_license | reubie/nilipie_app | 18bd0ed68ca042f0cc46b0483128086d5e8a72d8 | e0b4dcbcfc4658da31f14cfbd5f39fa1ff615813 | refs/heads/master | 2020-06-20T21:33:02.454300 | 2019-07-16T19:55:05 | 2019-07-16T19:55:05 | 197,257,364 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | package com.mobipesa.nilipieapp.helpers;
import android.support.annotation.NonNull;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
/**
* Executor that runs a task on a new background thread.
*/
public class DiskIOThreadExecutor implements Executor {
private final Executor mDiskIO;
public DiskIOThreadExecutor() {
mDiskIO = Executors.newSingleThreadExecutor();
}
@Override
public void execute(@NonNull Runnable command) {
mDiskIO.execute(command);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
c3460614cd09a77f12fa1ce8efbaa8dd8322682f | 86df8981da3849f3678cacb05d061e317035bae6 | /trunk/defiles/debao-defiles-biz-service/src/main/java/com/debao/defiles/services/file/impl/DriftServiceImpl.java | 1922813fc23956549a73c0af8561df4b6bb36554 | [] | no_license | qinpeng2/debao-defiles | c7d5e04314f4f61b4b5492d2b3e71ccdd252fa3c | cd0fc638c1dad7b01e76b539083e705900b6ee3c | refs/heads/master | 2021-01-10T21:26:38.544646 | 2016-11-13T14:53:40 | 2016-11-13T14:53:40 | 30,493,514 | 0 | 0 | null | 2015-02-08T16:26:43 | 2015-02-08T14:30:20 | null | UTF-8 | Java | false | false | 9,438 | java | package com.debao.defiles.services.file.impl;
import com.debao.defiles.common.util.StringUtil;
import com.debao.defiles.constant.FileOperations;
import com.debao.defiles.dao.DriftDAO;
import com.debao.defiles.dao.DriftLogDAO;
import com.debao.defiles.services.file.DriftService;
import com.debao.defiles.vo.DriftLogVO;
import com.debao.defiles.vo.DriftVO;
import com.debao.defiles.vo.UserVO;
import com.debao.defiles.vo.query.DriftQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import java.util.Calendar;
import java.util.List;
public class DriftServiceImpl extends CommonFileService implements DriftService {
@Autowired
private TransactionTemplate transactionTemplate;
@Autowired
private DriftDAO driftDAO;
@Autowired
private DriftLogDAO driftLogDAO;
@Override
public DriftVO findByID(Integer driftid) {
return driftDAO.findByID(driftid);
}
@Override
public boolean insert(final DriftVO driftVO, final UserVO userVO) {
Boolean result = transactionTemplate.execute(new TransactionCallback<Boolean>() {
@Override
public Boolean doInTransaction(TransactionStatus status) {
// insert drift first
if (!driftDAO.insert(driftVO)) {
return false;
}
driftVO.setFileid(driftDAO.insertedID());
// insert drift log then
DriftLogVO driftLogVO = new DriftLogVO();
driftLogVO.setFileid(driftVO.getFileid());
driftLogVO.setFileoptid(FileOperations.ADD.ordinal());
driftLogVO.setChangedesc(prepareChangeDesc(driftVO, userVO, FileOperations.ADD));
driftLogVO.setUserid(userVO.getUserid());
driftLogVO.setDatestamp(Calendar.getInstance().getTime());
if (!driftLogDAO.insert(driftLogVO)) {
return false;
}
return true;
}
});
return result;
}
@Override
public boolean update(final DriftVO driftVO, final UserVO userVO) {
return transactionTemplate.execute(new TransactionCallback<Boolean>() {
@Override
public Boolean doInTransaction(TransactionStatus status) {
// 1. Find the original drift first
DriftVO orgDriftVO = driftDAO.findByID(driftVO.getFileid());
// 2. update drift then
if (!driftDAO.update(driftVO)) {
return false;
}
// 3. insert drift log then
DriftLogVO driftLogVO = new DriftLogVO();
driftLogVO.setFileid(driftVO.getFileid());
driftLogVO.setFileoptid(FileOperations.EDIT.ordinal());
driftLogVO.setChangedesc(prepareChangeDesc(driftVO, orgDriftVO, userVO, FileOperations.EDIT));
driftLogVO.setUserid(userVO.getUserid());
driftLogVO.setDatestamp(Calendar.getInstance().getTime());
if (!driftLogDAO.insert(driftLogVO)) {
return false;
}
return true;
}
});
}
@Override
public boolean delete(final Integer driftid, final UserVO userVO) {
return transactionTemplate.execute(new TransactionCallback<Boolean>() {
@Override
public Boolean doInTransaction(TransactionStatus status) {
DriftVO driftVO = driftDAO.findByID(driftid);
// 1. mark drift as delete
if (!driftDAO.delete(driftid)) {
return false;
}
DriftLogVO driftLogVO = new DriftLogVO();
driftLogVO.setFileid(driftVO.getFileid());
driftLogVO.setFileoptid(FileOperations.DELETE.ordinal());
driftLogVO.setChangedesc(prepareChangeDesc(driftVO, userVO, FileOperations.DELETE));
driftLogVO.setUserid(userVO.getUserid());
driftLogVO.setDatestamp(Calendar.getInstance().getTime());
// 2. record the log then
if (!driftLogDAO.insert(driftLogVO)) {
return false;
}
return true;
}
});
}
@Override
public List<DriftVO> fuzzyFind(DriftQueryVO filter) {
return driftDAO.fuzzyFind(filter);
}
@Override
public int totalFuzzyFind(DriftQueryVO filter) {
return driftDAO.totalFuzzyFind(filter);
}
@Override
public List<DriftVO> find(DriftQueryVO filter) {
return driftDAO.find(filter);
}
@Override
public int totalFind(DriftQueryVO filter) {
return driftDAO.totalFind(filter);
}
/******************************Utilities*******************************************/
/**
* ่ทๅๆไปถๆฅๅฟๆ่ฟฐ
*
* @param driftVO
* @param userVO
* @param opt
* @return
*/
public String prepareChangeDesc(DriftVO driftVO, UserVO userVO, FileOperations opt) {
return prepareChangeDesc(driftVO, null, userVO, opt);
}
/**
* ่ทๅๆไปถๆฅๅฟๆ่ฟฐ (ๅคๆไปถ)
*
* @param newDriftVO
* @param orgDriftVO
* @param userVO
* @param opt
* @return
*/
public String prepareChangeDesc(DriftVO newDriftVO, DriftVO orgDriftVO, UserVO userVO, FileOperations opt) {
String str = opt.getDescription();
String userName = userVO.getUsername();
Integer driftID = newDriftVO.getFileid();
if (opt == FileOperations.ADD) {
// ๆฐๅขๆไปถๆฅๅฟๆ่ฟฐ
return StringUtil.format(str, userName, driftID, descAdd(newDriftVO));
} else if (opt == FileOperations.EDIT) {
// ็ผ่พๆไปถๆฅๅฟๆ่ฟฐ
String descEdit = descEdit(orgDriftVO, newDriftVO);
if (descEdit == null || !descEdit.isEmpty()) {
return StringUtil.format(str, userName, driftID, descEdit);
}
} else if (opt == FileOperations.DELETE) {
// ๅ ้คๆไปถๆฅๅฟๆ่ฟฐ
return StringUtil.format(str, userName, driftID);
} else if (opt == FileOperations.VIEW) {
// ๆต่งๆไปถๆฅๅฟๆ่ฟฐ
return StringUtil.format(str, userName, driftID);
}
return null;
}
/**
* ๆฐๅขๆไปถๆฅๅฟๆ่ฟฐ
*
* @param driftVO
* @return
*/
private String descAdd(DriftVO driftVO) {
StringBuilder desc = new StringBuilder();
String driftName = driftVO.getFilename();
driftName = driftName == null || driftName.isEmpty() ? "" : driftName;
descSingleAdd(desc, "ๆไปถๅ็งฐ", driftName);
String driftNumber = driftVO.getFilenumber();
driftNumber = driftNumber == null || driftNumber.isEmpty() ? "" : driftNumber;
descSingleAdd(desc, "ๆไปถ็ผๅท", driftNumber);
String closed = driftVO.getClosed() ? "ๆฏ" : "ๅฆ";
descSingleAdd(desc, "ๆฏๅฆ้ญ็ฏ", closed);
String driftLabel = driftVO.getFilelabel();
driftLabel = driftLabel == null || driftLabel.isEmpty() ? "" : driftLabel;
descSingleAdd(desc, "ๆไปถๆ ็ญพ", driftLabel);
String driftDesc = driftVO.getFiledesc();
driftDesc = driftDesc == null || driftDesc.isEmpty() ? "" : driftDesc;
descSingleAdd(desc, "ๆไปถๆ่ฟฐ", driftDesc);
return desc.toString();
}
/**
* ไฟฎๆนๆไปถๆฅๅฟๆ่ฟฐ
*
* @param origDriftVO
* @param newDriftVO
* @return
*/
private String descEdit(DriftVO origDriftVO, DriftVO newDriftVO) {
// only compare drifts with the same ID
if (origDriftVO.getFileid() != newDriftVO.getFileid()) {
return "";
}
StringBuilder desc = new StringBuilder();
// drift name change
if (!origDriftVO.getFilename().trim().equalsIgnoreCase(newDriftVO.getFilename().trim())) {
descSingleEdit(desc, "ๆไปถๅ็งฐ", origDriftVO.getFilename(), newDriftVO.getFilename());
}
// drift number change
if (!origDriftVO.getFilenumber().trim().equalsIgnoreCase(newDriftVO.getFilenumber().trim())) {
descSingleEdit(desc, "ๆไปถ็ผๅท", origDriftVO.getFilenumber(), newDriftVO.getFilenumber());
}
if (origDriftVO.getClosed() != newDriftVO.getClosed()) {
descSingleEdit(desc, "ๆฏๅฆ้ญ็ฏ", origDriftVO.getClosed(), newDriftVO.getClosed());
}
// drift label change
String orgDriftLabel = origDriftVO.getFilelabel() == null ? "" : origDriftVO.getFilelabel().trim();
String newDriftLabel = newDriftVO.getFilelabel() == null ? "" : newDriftVO.getFilelabel().trim();
if (!orgDriftLabel.trim().equalsIgnoreCase(newDriftLabel.trim())) {
descSingleEdit(desc, "ๆไปถๆ ็ญพ", orgDriftLabel, newDriftLabel);
}
// drift description change
String orgDriftDesc = origDriftVO.getFiledesc() == null ? "" : origDriftVO.getFiledesc().trim();
String newDriftDesc = newDriftVO.getFiledesc() == null ? "" : newDriftVO.getFiledesc().trim();
if (!orgDriftDesc.equalsIgnoreCase(newDriftDesc)) {
descSingleEdit(desc, "ๆไปถๆ่ฟฐ", orgDriftDesc, newDriftDesc);
}
// drift upload change
if (!origDriftVO.getLocation().equalsIgnoreCase(newDriftVO.getLocation())) {
desc.append("ๆไปถ่ขซ้ๆฐไธไผ ;");
}
return desc.toString();
}
/******************************Getter & Setter*******************************************/
public DriftDAO getDriftDAO() {
return driftDAO;
}
public void setDriftDAO(DriftDAO driftDAO) {
this.driftDAO = driftDAO;
}
public DriftLogDAO getDriftLogDAO() {
return driftLogDAO;
}
public void setDriftLogDAO(DriftLogDAO driftLogDAO) {
this.driftLogDAO = driftLogDAO;
}
public TransactionTemplate getTransactionTemplate() {
return transactionTemplate;
}
public void setTransactionTemplate(TransactionTemplate transactionTemplate) {
this.transactionTemplate = transactionTemplate;
}
}
| [
"allen.qin@ndpmedia.com"
] | allen.qin@ndpmedia.com |
2363d87eb2f709a9fcfce27ec892d4c62ddd8c4a | b162956df616b70d3adb53293b751e757e6b6202 | /src/main/java/Amazon/TwoSumUniquePairs/Solution.java | eaf4e1ba54e6123c8b7b40506e178348d3d134c2 | [] | no_license | bijiaha0/leetcode-practice | a200418e341a24e40853bd6ec521a69191b03221 | 3d72dfaff05ef64cf555a2df5259903aecdd1b69 | refs/heads/master | 2020-12-10T04:12:19.715015 | 2020-01-13T03:08:36 | 2020-01-13T03:08:36 | 233,496,869 | 1 | 0 | null | 2020-10-13T18:48:41 | 2020-01-13T02:42:35 | Java | UTF-8 | Java | false | false | 1,169 | java | package Amazon.TwoSumUniquePairs;
import java.util.Arrays;
/**
* https://www.jiuzhang.com/solutions/two-sum-unique-pairs/
* ็ปไธๆดๆฐๆฐ็ป, ๆพๅฐๆฐ็ปไธญๆๅคๅฐ็ป ไธๅ็ๅ
็ด ๅฏน ๆ็ธๅ็ๅ,
* ไธๅไธบ็ปๅบ็ target ๅผ, ่ฟๅๅฏนๆฐ.
*/
public class Solution {
/**
* @param nums an array of integer
* @param target an integer
* @return an integer
*/
public int twoSum6(int[] nums, int target) {
if (nums == null || nums.length < 2)
return 0;
Arrays.sort(nums);
int cnt = 0;
int left = 0, right = nums.length - 1;
while (left < right) {
int v = nums[left] + nums[right];
if (v == target) {
cnt ++;
left ++;
right --;
while (left < right && nums[right] == nums[right + 1])//็ปๅ้ฎ้ข
right --;
while (left < right && nums[left] == nums[left - 1])
left ++;
} else if (v > target) {
right --;
} else {
left ++;
}
}
return cnt;
}
}
| [
"jiahao.bee@gmail.com"
] | jiahao.bee@gmail.com |
f5da44e6ae72e7eb324889b996ea16bbca1c0f27 | f796932002adefb63e101cd0840f77084489d0e9 | /src/course/controller/FileController.java | 57db6f93509cfd6005f5da6d0eefedad11aa8b24 | [] | no_license | garwer/student | af39b8972842b87432607862584191ac2093174b | 9d01756ce0e4ac12b5994245676b62c4837d49a8 | refs/heads/master | 2021-07-24T05:02:49.826088 | 2017-11-05T18:05:33 | 2017-11-05T18:14:45 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,112 | java | package course.controller;
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import course.service.FileService;
@Controller
@RequestMapping("/uploadFile.do")
public class FileController {
@Autowired
private FileService fileService;
@ResponseBody
@RequestMapping(params="method=uploadFile")
public String uploadFile(HttpServletRequest request,HttpServletResponse response) throws IOException, FileUploadException {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
String name = request.getParameter("username");
String aaa = request.getParameter("namea");
System.out.println(name);
System.out.println(aaa);
//1ใๅๅปบไธไธชDiskFileItemFactoryๅทฅๅ
DiskFileItemFactory factory = new DiskFileItemFactory();
//2ใๅๅปบไธไธชๆไปถไธไผ ่งฃๆๅจ
ServletFileUpload upload = new ServletFileUpload(factory);
//่งฃๅณไธไผ ๆไปถๅ็ไธญๆไนฑ็
upload.setHeaderEncoding("utf-8");
factory.setSizeThreshold(1024 * 500);//่ฎพ็ฝฎๅ
ๅญ็ไธด็ๅผไธบ500K
File linshi = new File("E:\\up");//ๅฝ่ถ
่ฟ500K็ๆถๅ๏ผๅญๅฐไธไธชไธดๆถๆไปถๅคนไธญ
factory.setRepository(linshi);
System.out.print("ๅๅๅๅๅๅๅ");
@SuppressWarnings("unchecked")
List<FileItem> /*FileItem */items = upload.parseRequest(request);
String flag = fileService.upload(upload,items);
name = request.getParameter("descwhat");
System.out.println("flag็ๅผไธบ" + flag);
return flag;
}
}
| [
"linjw@ffcs.cn"
] | linjw@ffcs.cn |
a571705097e4825e0d8f9f0e3439a0259a7a2b8f | e6e843cb9f885233c3160663fc9eede8f7b2d656 | /src/com/xiaomi/servletstudy/SiteHitCounter.java | 4a95edfbd961a4bc6cddfc51733759385b34bee9 | [] | no_license | zhanghu1/ServletStudy | af8d077268d553dc1321ec67e37038ccaf77de5f | 48828a75a9a2365db3e78296698dad59b16b654d | refs/heads/master | 2016-09-05T12:18:55.117570 | 2015-09-19T14:43:57 | 2015-09-19T14:43:57 | 42,776,375 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 798 | java | package com.xiaomi.servletstudy;
import javax.servlet.*;
import java.io.IOException;
/**
* Created by zhanghu on 2015/8/2.
*/
public class SiteHitCounter implements Filter {
private int hitCount;
@Override
public void init(FilterConfig filterConfig) throws ServletException {
hitCount = 0;
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
hitCount++;
System.out.println("็ฝ็ซๆป็นๅป้๏ผ" + hitCount);
filterChain.doFilter(servletRequest, servletResponse);
}
@Override
public void destroy() {
// ่ฟไธๆญฅๆฏๅฏ้็๏ผไฝๆฏๅฆๆ้่ฆ๏ผๆจๅฏไปฅๆ hitCount ็ๅผๅๅ
ฅๅฐๆฐๆฎๅบ
}
}
| [
"zhanghu1@xiaomi.com"
] | zhanghu1@xiaomi.com |
cf88bb87ec52c02ce3db6b38abbb2bfe960bc404 | d9f49ef1ea20bdc5a5a64174dd810fbebe1bb0ce | /gen/com/example/androidfragmentdemo/BuildConfig.java | 31ad1f6792da4631a5c0fede93d99ca085ec306a | [] | no_license | sandeeplondhe/AndroidFragmentDemo | c8fb5f1e859b33c244513a6bba59fb1ed1b4fe65 | cd39905297b20e7cac28b894455eb28ccc00ca19 | refs/heads/master | 2021-01-13T01:57:43.711838 | 2014-09-20T12:25:00 | 2014-09-20T12:25:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 173 | java | /** Automatically generated file. DO NOT MODIFY */
package com.example.androidfragmentdemo;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"sandeeplondhe54@gmail.com"
] | sandeeplondhe54@gmail.com |
9c705e8a80773bf1b150502320eebb43d8f06915 | 436b05eac3a7e8510bd55bc835abd2d12dd49275 | /src/main/java/leecode/Convert.java | e7d11fcced909bda01cb22b8baf6d3bcb337e52d | [] | no_license | xiaowubangbangbang/leecode | 3c84a40dcfcee62b19bdc9731e373525b224fd41 | 0e7e7f0a738d6655b63251c102be6b72bc87bd67 | refs/heads/main | 2023-06-18T16:02:54.050883 | 2021-07-14T02:14:22 | 2021-07-14T02:14:22 | 344,679,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 720 | java | package leecode;
import java.util.ArrayList;
import java.util.List;
public class Convert {
public static void main(String[] args) {
}
public static String convert(String s, int numRows) {
if (numRows < 2) return s;
List<StringBuilder> rows = new ArrayList<StringBuilder>();
for (int i = 0; i < numRows; i++) rows.add(new StringBuilder());
int i = 0, flag = -1;
for (char c : s.toCharArray()) {
rows.get(i).append(c);
if (i == 0 || i == numRows - 1) flag = -flag;
i += flag;
}
StringBuilder res = new StringBuilder();
for (StringBuilder row : rows) res.append(row);
return res.toString();
}
}
| [
"wupengfei1@longshine.com"
] | wupengfei1@longshine.com |
ba61a1399ed494420a26313a64abe5b7c19f659e | 10b854c11779bb21bdafb323ce488b67c3171892 | /src/main/java/kr/co/our/controller/CodeDetailController.java | 06f8f452350da0614057e592a0a52de39e1b8d47 | [] | no_license | wwwalohacampus/ourProject_01 | dc3b4a7c72621bfa2052d58dbce91186d9c5a226 | 910f44ada3c174a36e71bf40092e2dae1d4d280f | refs/heads/master | 2020-12-02T02:28:51.881076 | 2020-03-15T16:46:04 | 2020-03-15T16:46:04 | 229,943,772 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,643 | java | package kr.co.our.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import kr.co.our.common.domain.CodeLabelValue;
import kr.co.our.domain.CodeDetail;
import kr.co.our.service.CodeDetailService;
import kr.co.our.service.CodeService;
@Controller
@RequestMapping("/codedetail")
// ๊ด๋ฆฌ์ ๊ถํ์ ๊ฐ์ง ์ฌ์ฉ์๋ง ์ ๊ทผ์ด ๊ฐ๋ฅํ๋ค.
//@PreAuthorize("hasRole('ROLE_ADMIN')")
public class CodeDetailController {
@Autowired
private CodeDetailService codeDetailService;
@Autowired
private CodeService codeService;
@RequestMapping(value = "/register", method = RequestMethod.GET)
public void registerForm(Model model) throws Exception {
CodeDetail codeDetail = new CodeDetail();
model.addAttribute(codeDetail);
List<CodeLabelValue> classCodeList = codeService.getCodeClassList();
model.addAttribute("classCodeList", classCodeList);
}
@RequestMapping(value = "/register", method = RequestMethod.POST)
public String register(@Validated CodeDetail codeDetail, BindingResult result, Model model, RedirectAttributes rttr) throws Exception {
if(result.hasErrors()) {
List<CodeLabelValue> classCodeList = codeService.getCodeClassList();
model.addAttribute("classCodeList", classCodeList);
return "codedetail/register";
}
codeDetailService.register(codeDetail);
rttr.addFlashAttribute("msg", "SUCCESS");
return "redirect:/codedetail/list";
}
@RequestMapping(value = "/list", method = RequestMethod.GET)
public void list(Model model) throws Exception {
model.addAttribute("list", codeDetailService.list());
}
@RequestMapping(value = "/read", method = RequestMethod.GET)
public void read(CodeDetail codeDetail, Model model) throws Exception {
model.addAttribute(codeDetailService.read(codeDetail));
List<CodeLabelValue> classCodeList = codeService.getCodeClassList();
model.addAttribute("classCodeList", classCodeList);
}
@RequestMapping(value = "/remove", method = RequestMethod.POST)
public String remove(CodeDetail codeDetail, RedirectAttributes rttr) throws Exception {
codeDetailService.remove(codeDetail);
rttr.addFlashAttribute("msg", "SUCCESS");
return "redirect:/codedetail/list";
}
@RequestMapping(value = "/modify", method = RequestMethod.GET)
public void modifyForm(CodeDetail codeDetail, Model model) throws Exception {
model.addAttribute(codeDetailService.read(codeDetail));
List<CodeLabelValue> classCodeList = codeService.getCodeClassList();
model.addAttribute("classCodeList", classCodeList);
}
@RequestMapping(value = "/modify", method = RequestMethod.POST)
public String modify(@Validated CodeDetail codeDetail, BindingResult result, Model model, RedirectAttributes rttr) throws Exception {
if(result.hasErrors()) {
List<CodeLabelValue> classCodeList = codeService.getCodeClassList();
model.addAttribute("classCodeList", classCodeList);
return "codedetail/modify";
}
codeDetailService.modify(codeDetail);
rttr.addFlashAttribute("msg", "SUCCESS");
return "redirect:/codedetail/list";
}
}
| [
"ALOHA@DESKTOP-FBBK53F"
] | ALOHA@DESKTOP-FBBK53F |
9905c98cb4f4f17fd8cc94cdc221957b0708e1d6 | a638c267d345cdb6079618e6238a58cba8136987 | /app/src/androidTest/java/com/anayyar/chattapp/ApplicationTest.java | 6bc27e68687327a6e65bb45a50b15b1c3fc00251 | [] | no_license | ashishna/chatt | b5cfaa814616065ebaf640489431b1ab6c33a8c3 | cddef564a529d2c236705227161f355f62f5b44c | refs/heads/master | 2020-05-20T19:25:36.864883 | 2015-11-04T10:48:44 | 2015-11-04T10:48:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 351 | java | package com.anayyar.chattapp;
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);
}
} | [
"ash316@github.com"
] | ash316@github.com |
0e914bacbf1ad3f6969fef6c7d15ef9c4cc115e8 | be1d23acdc09251c28a177bd0a8f77bdd3c81376 | /src/main/java/com/ef/util/HibernateUtil.java | dd76f8dc3ec32b382ee21e616298a11462d3d07a | [] | no_license | Palash-it/Log-Parser-Java-Program | 8d9697dea4e639b649f41e10aee9798a666e282a | 636db2563e5e08bf97654297699d4f3a4540ac02 | refs/heads/master | 2022-07-03T04:59:15.188752 | 2019-07-13T15:30:40 | 2019-07-13T15:30:40 | 196,737,101 | 0 | 0 | null | 2022-06-21T01:29:48 | 2019-07-13T15:30:01 | Java | UTF-8 | Java | false | false | 618 | java | package com.ef.util;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
private static SessionFactory sessionFactory = buildSessionFactory();
private static SessionFactory buildSessionFactory() {
try {
Configuration config = new Configuration();
config.configure();
sessionFactory = config.buildSessionFactory();
} catch (Exception e) {
e.printStackTrace();
}
return sessionFactory;
}
public static SessionFactory getSessionFactory() {
if(sessionFactory == null) {
return buildSessionFactory();
}
return sessionFactory;
}
}
| [
"palash.debnath5@gmail.com"
] | palash.debnath5@gmail.com |
00054e6efd9c288f475b964506c5b59ff599a69f | afbad81c1bb02e6c723bce9daee9727b463dd69a | /app/src/test/java/com/example/android/acitivity_lifecycle/ExampleUnitTest.java | 3029f04813ef110238cacb18db869fc529817ff2 | [] | no_license | nguyenbahung94/Acitivity-lifecycle | 0bbb5ae20cf1e7b796ae8240e0c3a37facff712d | 21742affe5945ec212e9a2a2dbe724822ec5b4fe | refs/heads/master | 2021-01-19T04:06:13.044809 | 2016-08-09T09:44:25 | 2016-08-09T09:44:25 | 55,659,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package com.example.android.acitivity_lifecycle;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"mr.hungcity@gmail.com"
] | mr.hungcity@gmail.com |
b636b509e1d46e6d6116e375473fbadd7f5fac9d | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MOCKITO-9b-4-22-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/mockito/internal/handler/MockHandlerImpl_ESTest_scaffolding.java | b26b79d228630fee183a288283394874edac5e15 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 448 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Apr 06 10:22:21 UTC 2020
*/
package org.mockito.internal.handler;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class MockHandlerImpl_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
f552ea95928dd897162448141af19c0b362f4c4d | 130fc6d0095bbacad30d120339aa38737c332b09 | /QuadraticOOPTest.java | e201f4dd2d5f3e67536435be40335919385554c2 | [] | no_license | thapab1/CSC260_Object-Oriented-I_Assignment | a40f41e1bf2cdb087c57d8bedfb132cf434b1c7f | 7d8e12b3152f9dd2a3c1550ec1a3aacc7682c9c6 | refs/heads/master | 2021-05-21T22:06:27.978839 | 2020-04-03T19:42:47 | 2020-04-03T19:42:47 | 252,821,919 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 947 | java | import java.util.Scanner;
class QuadraticOOP {
private double a, b, c;
private double discriminant;
private double r1, r2;
public QuadraticOOP(double a, double b, double c) {
this.a = a;
this.b = b;
this.c = c;
}
public double getDiscriminant() {
return this.discriminant = b*b - 4*a*c;
}
public double getSolution1() {
return (-b + Math.sqrt(discriminant)) / 2 * a;
}
public double getSolution2() {
return (-b - Math.sqrt(discriminant)) / 2 * a;
}
}
public class QuadraticOOPTest {
public static void main(String[] args) {
QuadraticOOP q = new QuadraticOOP(1, 3, 1);
System.out.println(q.getDiscriminant());
System.out.println(q.getSolution1());
System.out.println(q.getSolution2());
}
}
/**
* Copy output here
* 5.0
* -0.3819660112501051
* -2.618033988749895
*/
| [
"noreply@github.com"
] | noreply@github.com |
6d83a72c5f4297d817927932118e10e1a1f9e811 | 2db20eabdc6ac272a48e0f0685f67111b463ce70 | /INTRODUCTION_BLACKLISTSEARCH/INTRODUCTION_BLACKLISTSEARCH/src/main/java/edu/eci/arsw/blacklistvalidator/Threads.java | 9c171659e4a44215e898830be95fdac38ac79564 | [] | no_license | karenMora/Black-Snake | 9b1505bde73d938ce3eb9cd7340feb08dd6f7412 | 0e57e91fac969dcf5c0ffc2271f09c34e8059fbc | refs/heads/master | 2020-04-20T00:25:00.053359 | 2019-02-07T02:58:29 | 2019-02-07T02:58:29 | 168,520,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,497 | 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 edu.eci.arsw.blacklistvalidator;
import edu.eci.arsw.spamkeywordsdatasource.HostBlacklistsDataSourceFacade;
import static edu.eci.arsw.blacklistvalidator.HostBlackListsValidator.BLACK_LIST_ALARM_COUNT;
import java.util.LinkedList;
import java.util.List;
/**
*
* @author 2092692
*/
public class Threads extends Thread{
String ip;
LinkedList<Integer> blackListOcurrences=new LinkedList<>();
public Threads(){
}
Threads(String a) {
ip=a;
}
/**
* preguntar a las instancias (los hilos) cuรกntas
* ocurrencias de servidores maliciosos ha encontrado
*
* @return el numero de servidores maliciosos
*/
public int getInstanciasMalas(){
return 0;
}
/**
* busca un segmento del grupo de servidores disponibles.
*/
public void run(){
HostBlacklistsDataSourceFacade skds=HostBlacklistsDataSourceFacade.getInstance();
int checkedListsCount=0;
int ocurrencesCount=0;
for (int i=0;i<skds.getRegisteredServersCount() && ocurrencesCount<BLACK_LIST_ALARM_COUNT;i++){
checkedListsCount++;
if (skds.isInBlackListServer(i, ip)){
blackListOcurrences.add(i);
ocurrencesCount++;
}
}
}
}
| [
"karen.mora@mail.escuelaing.edu.co"
] | karen.mora@mail.escuelaing.edu.co |
964f99cb44a86c1a43f2759a12b9b70c142938cf | db80367d9f1852d2921f0e0f4045fa415bbf0013 | /src/main/java/net/seliba/rankbot/Rankbot.java | 718c6ad9f42eb2be576e6ba66ed08b3cb6199065 | [] | no_license | codacy-badger/Rankbot | de191434257d020ae3d9fb8c89d09a273bcd3029 | b272078ada9e5ba8e3884d2bfcecc1032eefe113 | refs/heads/master | 2020-05-06T20:01:54.544979 | 2019-04-08T18:58:36 | 2019-04-08T18:58:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,862 | java | package net.seliba.rankbot;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
import javax.security.auth.login.LoginException;
import net.dv8tion.jda.api.AccountType;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
import net.seliba.rankbot.files.LevelDao;
import net.seliba.rankbot.files.TomlData;
import net.seliba.rankbot.files.VotesDao;
import net.seliba.rankbot.listener.ChatListener;
import net.seliba.rankbot.runnables.NewVideoRunnable;
import net.seliba.rankbot.runnables.VoteUpdateRunnable;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
public class Rankbot {
private static final Logger LOGGER = LogManager.getLogger(Rankbot.class.getName());
private static JDA jda;
private static TomlData levelData, votingResults, votingList;
private static LevelDao levelDao;
private static VotesDao votesDao;
private static String latestVideoId;
private static File videoFile;
private static File expertVotingFile;
public static void main(String[] args) throws IOException {
LOGGER.info("Der Bot wurde gestartet");
try {
LOGGER.info("Login wird ausgefuehrt...");
jda = new JDABuilder(AccountType.BOT)
.setToken(getToken())
.build();
} catch (LoginException ex) {
LOGGER.error(ex, ex);
System.exit(-1);
} finally {
LOGGER.info("Login erfolgreich");
}
levelData = new TomlData("levels");
votingList = new TomlData("voted");
votingResults = new TomlData("results");
levelDao = new LevelDao(levelData);
votesDao = new VotesDao(jda, votingResults, votingList);
LOGGER.info("Registriere Events...");
jda.addEventListener(new ChatListener(jda, levelDao, votesDao));
videoFile = new File("latest.txt");
expertVotingFile = new File("voting-data.txt");
latestVideoId = new Scanner(videoFile).nextLine();
Thread newVideoFetcherThread = new Thread(new NewVideoRunnable(jda, videoFile, latestVideoId));
Thread voteUpdateScheduler = new Thread(new VoteUpdateRunnable(jda, votesDao, getExpertVotingStatus()));
newVideoFetcherThread.start();
voteUpdateScheduler.start();
}
private static String getToken() {
File tokenFile = new File("token.txt");
String token = null;
try {
Scanner scanner = new Scanner(tokenFile);
token = scanner.nextLine();
} catch (IOException exception) {
LOGGER.error(exception, exception);
System.exit(-1);
}
return token;
}
private static boolean getExpertVotingStatus() {
Boolean votingStatus = false;
try {
Scanner scanner = new Scanner(expertVotingFile);
votingStatus = Boolean.valueOf(scanner.nextLine());
} catch (IOException exception) {
LOGGER.error(exception, exception);
System.exit(-1);
}
return votingStatus;
}
}
| [
"munita.gavai@gmail.com"
] | munita.gavai@gmail.com |
2716263ccddf2421b24b8dd369ed208bef53c868 | 3e8cdb3b2efb8d26cd711fba8621c9bc2fc3634e | /UT5-Clases/src/EjerciciosIniciales/Conversores/Finanzas.java | 4c6b6fb3f2e36c1f26d17f9155c0425e3e603147 | [] | no_license | stefantapu/PROGRAMACION | 6182374135b8a57360b072444b9ec5a70755885f | 19ad2eb249e9eb1d50403bf42fe3e3833f6aa80e | refs/heads/master | 2023-03-17T07:46:16.869066 | 2014-06-01T20:30:19 | 2014-06-01T20:30:19 | null | 0 | 0 | null | null | null | null | ISO-8859-2 | Java | false | false | 1,058 | java | package EjerciciosIniciales.Conversores;
/*
Ejercicio 3. Realiza una clase Finanzas que convierta dรณlares a euros y viceversa.
Codifica los mรฉtodos dolaresToEuros y eurosToDolares. Prueba que dicha clase funciona
correctamente haciendo conversiones entre euros y dรณlares. La clase tiene que tener:
Un constructor finanzas que establecerรก el cambio Dรณlar-Euro en 1.36.
Un constructor finanzas(double), el cual permitirรก configurar el cambio Dรณlar-Euro.
*/
public class Finanzas {
private double ValorDolarEuro;
public Finanzas(){
ValorDolarEuro = 1.36;
}
public Finanzas(double cambioValor){
this.ValorDolarEuro=cambioValor;
}
public double getValorDolarEuro() {
return ValorDolarEuro;
}
public double dolaresToEuros(double dolares){
double euros=0;
euros= Math.rint((dolares/ValorDolarEuro)*100)/100;
return euros;
}
public double eurosToDolares(double euros){
double dolares=0;
dolares=Math.rint((euros*ValorDolarEuro)*100)/100;
return dolares;
}
}
| [
"Windows 7@Windows7-PC"
] | Windows 7@Windows7-PC |
3106f2f613f377f6111c8600dc2b55f162961853 | d0b413377f8ceb8b76ba1b61ff927bd9d10ee5bb | /gulimallproduct/src/main/java/com/atguigu/gulimall/pms/service/impl/CategoryServiceImpl.java | c70dff75291b1473779f7558e7bfbc30782669a6 | [
"Apache-2.0"
] | permissive | ll1063889783/gulilmall | f1a1e4397df71e712f40c42bcd71873b9c5377f3 | b6965f184a81a4725c693962ad4c996aeb01b751 | refs/heads/master | 2023-04-14T22:46:57.262991 | 2021-04-24T02:58:34 | 2021-04-24T02:58:34 | 285,986,309 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,134 | java | package com.atguigu.gulimall.pms.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.atguigu.gulimall.pms.service.CategoryBrandRelationService;
import com.atguigu.gulimall.pms.vo.Catelog2Vo;
import com.atguigu.gulimall.pms.vo.Catelog3Vo;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.common.utils.Query;
import com.atguigu.gulimall.pms.dao.CategoryDao;
import com.atguigu.gulimall.pms.entity.CategoryEntity;
import com.atguigu.gulimall.pms.service.CategoryService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
/***
* Spring-Cache็ไธ่ถณ
* 1๏ผ่ฏปๆจกๅผ
* ็ผๅญ็ฉฟ้๏ผๆฅ่ฏขไธไธชnullๆฐๆฎใ่งฃๅณๆนๆก๏ผ็ผๅญ็ฉบๆฐๆฎ
* #ๆฏๅฆ็ผๅญ็ฉบๅผ๏ผ้ฒๆญข็ผๅญ็ฉฟ้็้ฎ้ข
spring.cache.redis.cache-null-values=true
็ผๅญๅป็ฉฟ๏ผๅคง้ๅนถๅๅๆถๆฅ่ฏขไธไธชๆญฃๅฅฝ่ฟๆ็ๆฐๆฎใ่งฃๅณๆนๆก๏ผๅ ้
้ป่ฎคๆฏๆ ๅ ้็๏ผๅจ@Cacheable้้ขๅ ๅ
ฅsync=true๏ผๅ ้่งฃๅณๅป็ฉฟ้ฎ้ข๏ผ
็ผๅญ้ชๅดฉ๏ผๅคง้็keyๅๆถ่ฟๆใ่งฃๅณๆนๆก๏ผ ๅ ้ๆบๆถ้ด๏ผๅ ไธ่ฟๆๆถ้ด
spring.cache.redis.time-to-live=3600000
2๏ผๅๆจกๅผ(็ผๅญไธๆฐๆฎๅบไธ่ด)
1๏ผ่ฏปๅๅ ้
2๏ผๅผๅ
ฅCanal๏ผๆ็ฅๅฐmysql็ๆดๆฐๅปๆดๆฐๆฐๆฎๅบ
3๏ผ่ฏปๅคๅๅค็๏ผ็ดๆฅๅปๆฐๆฎๅบๆฅ่ฏขๅฐฑ่ก
ๆป็ป๏ผๅธธ่งๆฐๆฎ๏ผ่ฏปๅคๅๅฐ๏ผๅณๆถๆง๏ผไธ่ดๆง่ฆๆฑไธ้ซ็ๆฐๆฎ๏ผๅฎๅ
จๅฏไปฅไฝฟ็จ
Spring-Cache:ๅๆจกๅผ ๅช่ฆ็ผๅญ็ๆฐๆฎๆ่ฟๆๆถ้ดๅฐฑ่ถณๅคไบใ
*/
@Service("categoryService")
public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity> implements CategoryService {
@Autowired
private RedissonClient redisson;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Autowired
private CategoryBrandRelationService categoryBrandRelationService;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<CategoryEntity> page = this.page(
new Query<CategoryEntity>().getPage(params),
new QueryWrapper<CategoryEntity>()
);
return new PageUtils(page);
}
@Override
public List<CategoryEntity> listWithTree() {
//ๆฅๅบๆๆๅ็ฑป
List<CategoryEntity> categoryEntities = baseMapper.selectList(null);
//ๆพๅฐๆๆไธ็บงๅ็ฑป
List<CategoryEntity> rootList = categoryEntities.stream().filter((categoryEntity) -> {
return categoryEntity.getParentCid() == 0;
}).map((menu) -> {
menu.setChildren(getChildren(menu, categoryEntities));
return menu;
}).sorted((menu1, menu2) -> {
return (menu1.getSort() == null ? 0 : menu1.getSort()) - (menu2.getSort() == null ? 0 : menu2.getSort());
}).collect(Collectors.toList());
return rootList;
}
//่งฆๅๅฐๆฐๆฎไป็ผๅญๅ ้ค็ๆไฝ ,ๅคฑๆๆจกๅผ(ๆง่กๆนๆณ็ๆถๅไผๅ ้ค็ผๅญไธญๆๅฎ็key),ๆๅฎ็ผๅญๅบ๏ผcategory๏ผ็ๅๅญ๏ผๆๅฎไป็ผๅญๅบไธญๅ ้คๆๅฎ็key๏ผๆฅ่ฏขๆนๆณ็ๅๅญไฝไธบkey๏ผๅญ็ฌฆไธฒๅๅธธ้่ฆๅ ๅๅผๅท๏ผ
/**
* 1,ๅๆถ่ฟ่กๅค็ง็ผๅญๆไฝ @Caching
* 2,ๆๅฎๅ ้คๆไธชๅๅบไธ็ๆๆๆฐๆฎ,ๆๅฎallEntries = true
*
* @CacheEvict(value={"category"},allEntries = true)
* 3,ๅญๅจๅไธ็ฑปๅ็ๆฐๆฎ๏ผ้ฝๅฏไปฅๆๅฎไธบๅไธๅๅบ๏ผๅๅบๅ้ป่ฎคๅฐฑๆฏ็ผๅญ็ๅ็ผ
* ๅฐฑๆฏไธบ็ผๅญๅบๅๅญ::key็ๅๅญไฝไธบkey
*/
@Caching(evict = {
@CacheEvict(value = {"category"}, key = "'getLevel1Categorys'"),
@CacheEvict(value = {"category"}, key = "'getCatalogJson'")
})
@Transactional
@Override
public void updateCascade(CategoryEntity category) {
this.updateById(category);
categoryBrandRelationService.updateCategory(category.getCatId(), category.getName());
}
/***
* ๆฏไธไธช้่ฆ็ผๅญ็ๆฐๆฎๆไปฌ้ฝๆฅๆๅฎ่ฆๆพๅฐๅชไธชๅๅญ็็ผๅญใใ็ผๅญ็ๅๅบ(ๆ็
งไธๅก็ฑปๅ)ใ
* ไปฃ่กจๅฝๅๆนๆณ็็ปๆ้่ฆ็ผๅญ๏ผๅฆๆ็ผๅญไธญๆ๏ผๆนๆณไธ็จ่ฐ็จใ
* ๅฆๆ็ผๅญไธญๆฒกๆ๏ผไผ่ฐ็จๆนๆณ๏ผๆๅๅฐๆนๆณ็็ปๆๆพๅ
ฅ็ผๅญใ
* key้ป่ฎคไธบcategory::SimpleKey[](่ชไธป็ๆ) ็ผๅญ็ๅๅญ::SimpleKey[]
* ็ผๅญ็value็ๅผไธบ๏ผ้ป่ฎคไฝฟ็จjavaๅบๅๅๆบๅถ๏ผๅฐๅบๅๅๅ็ๆฐๆฎๅญๅฐredis
* ้ป่ฎคๆถ้ดไธบTTL=-1,่กจ็คบๆฐธไธ่ฟๆใ
* ่ชๅฎไน็ๆไฝใ
* 1,ๆๅฎ็ๆ็็ผๅญไฝฟ็จ็key๏ผkeyๅฑๆงๆๅฎ๏ผๆฅๅไธไธชSpEl่กจ่พพๅผ
* #rootๅผๅคดๆฅๅๅผ,#root.method.name็จๅฝๅๆนๆณ็ๆนๆณๅๅไธบkey็ๅๅญ
* 2,ๆๅฎ็ผๅญ็ๆฐๆฎ็ๅญๆดปๆถ้ด,application.propertiesไธญไฟฎๆนttlๆถ้ด
* ็ผๅญ็ๅญๆดปๆถ้ดๆฏซ็งไธบๅไฝ(1ๅฐๆถ)๏ผ็ธๅฝไธบ็ผๅญ็่ฟๆๆถ้ดTTL
spring.cache.redis.time-to-live=3600000
* 3๏ผๅฐๆฐๆฎไฟๅญไธบjsonๆ ผๅผ
* CacheAutoConfiguration ๅฏผๅ
ฅ
* RedisCacheConfiguration ่ชๅจ้
็ฝฎไบ
* RedisCacheManager ๅๅงๅๆๆ็็ผๅญ
* ๆฏไธช็ผๅญๅณๅฎไฝฟ็จไปไน้
็ฝฎ
* ๅฆๆredisCacheConfigurationๆๅฐฑ็จๅทฒๆ็๏ผๆฒกๆๅฐฑ็จ้ป่ฎค้
็ฝฎ
* ๆณๆน็ผๅญ็้
็ฝฎ๏ผๅช้่ฆ็ปๅฎนๅจไธญๆพไธไธชRedisCacheConfiguration
* ๅฐฑไผๅบ็จๅฐๅฝๅRedisCacheManager็ฎก็็ๆๆ็ผๅญๅๅบไธญ
* */
@Cacheable(value = {"category"}, key = "#root.method.name", sync = true)
@Override
public List<CategoryEntity> getLevel1Categorys() {
List<CategoryEntity> categoryEntities = this.baseMapper.selectList(new QueryWrapper<CategoryEntity>().eq("parent_cid", 0));
return categoryEntities;
}
@Cacheable(value = "category", key = "#root.methodName")
@Override
public Map<String, List<Catelog2Vo>> getCatalogJson() {
System.out.println("ๆฅ่ฏขไบๆฐๆฎๅบใใใใใ");
//1,ๅฐๆฐๆฎๅบ้้ข็ๅคๆฌกๆฅ่ฏขๅๆไธๆฌก
List<CategoryEntity> selectList = baseMapper.selectList(null);
List<CategoryEntity> level1Categorys = getParent_cid(selectList, 0L);
//ๅฐ่ฃ
ๆฐๆฎ
Map<String, List<Catelog2Vo>> map = level1Categorys.stream().collect(Collectors.toMap(Level1 -> Level1.getCatId().toString(), Level1v -> {
//ๆฏไธไธชไธ็บงๅ็ฑป๏ผๆฅๅฐ่ฟไธชไธ็บงๅ็ฑป็ไบ็บงๅ็ฑป
List<CategoryEntity> categoryEntities = getParent_cid(selectList, Level1v.getCatId());
List<Catelog2Vo> catelog2VoList = null;
if (categoryEntities != null) {
//ๆฏไธไธชไบ็บงๅ็ฑป๏ผๆฅๅฐ่ฟไธชไบ็บงๅ็ฑป็ไธ็บงๅ็ฑป
catelog2VoList = categoryEntities.stream().map(Level2 -> {
Catelog2Vo catelog2Vo = new Catelog2Vo(Level1v.getCatId().toString(), null, Level2.getCatId().toString(), Level2.getName());
List<CategoryEntity> level3CatelogList = getParent_cid(selectList, Level2.getCatId());
if (level3CatelogList != null) {
List<Catelog3Vo> catelog3VoList = level3CatelogList.stream().map(Level3 -> {
Catelog3Vo catelog3Vo = new Catelog3Vo(Level2.getCatId().toString(), Level3.getCatId().toString(), Level3.getName());
return catelog3Vo;
}).collect(Collectors.toList());
catelog2Vo.setCatelog3List(catelog3VoList);
}
return catelog2Vo;
}).collect(Collectors.toList());
}
return catelog2VoList;
}));
return map;
}
public Map<String, List<Catelog2Vo>> getCatalogJson2() {
//็ป็ผๅญไธญๆพjsonๅญ็ฌฆไธฒ๏ผๆฟๅบ็jsonๅญ็ฌฆไธฒ๏ผ่ฟ็จ้่ฝฌไธบ่ฝ็จ็ๅฏน่ฑก็ฑปๅใ
/**
* 1,็ฉบ็ปๆ็ผๅญ๏ผ่งฃๅณ็ผๅญ็ฉฟ้
* 2๏ผ่ฎพ็ฝฎ่ฟๆๆถ้ด๏ผๅ ้ๆบๅผ๏ผ๏ผ่งฃๅณ็ผๅญ้ชๅดฉ
* 3๏ผๅ ้๏ผ่งฃๅณ็ผๅญๅป็ฉฟ
*/
//1,ๅ ๅ
ฅ็ผๅญ้ป่พ๏ผ็ผๅญไธญ็ๆฐๆฎๆฏjsonๅญ็ฌฆไธฒ
//json่ทจ่ฏญ่จ๏ผ่ทจๅนณๅฐๅ
ผๅฎน
String catalogJson = (String) redisTemplate.opsForValue().get("catalogJson");
if (StringUtils.isEmpty(catalogJson)) {
//2,็ผๅญไธญๆฒกๆ๏ผๆฅ่ฏขๆฐๆฎๅบ
Map<String, List<Catelog2Vo>> catalogJsonFromDb = getCatalogJsonFromDbWithRedisLock();
return catalogJsonFromDb;
}
Map<String, List<Catelog2Vo>> stringListMap = JSON.parseObject(catalogJson, new TypeReference<Map<String, List<Catelog2Vo>>>() {
});
return stringListMap;
}
/**
* ไฝฟ็จRedissonๅๅธๅผ้ๆฅ่งฃๅณ้ซๅนถๅ็้ฎ้ข
* ็ผๅญ้้ข็ๆฐๆฎๅฆไฝๅๆฐๆฎๅบไฟๆไธ่ด
* 1๏ผๅๅๆจกๅผ๏ผๆนๆฐๆฎๅบ็ๅๆถๆ็ผๅญไนๆดๆฐ๏ผไผไบง็่ๆฐๆฎ๏ผ้ซๅนถๅไธๅบ็ฐๆฐๆฎ้ฎ้ข๏ผ
* ็ป็ผๅญ็keyๅ ่ฟๆๆถ้ด
* 2๏ผๅคฑๆๆจกๅผ๏ผไฟฎๆนๆฐๆฎๅบ็ๅๆถๆ็ผๅญ็ปๅ ไบ๏ผไนไผไบง็่ๆฐๆฎ
* ไธค่
้ฝไผๅฎ็ฐ็ผๅญ็ๆ็ปไธ่ดๆงใ *
* @return
*/
public Map<String, List<Catelog2Vo>> getCatalogJsonFromDbWithRedissonLock() {
//1,้็ๅๅญ๏ผ้็็ฒๅบฆ๏ผ่ถ็ป่ถๅฅฝใ
//้็็ฒๅบฆ๏ผๅ
ทไฝ็ผๅญ็ๆฏๆไธชๆฐๆฎใ11ๅทๅๅ๏ผproduct-11-lock,product-12-lock
RLock lock = redisson.getLock("catalogJson-lock");
//ๅ ้
lock.lock();
Map<String, List<Catelog2Vo>> dataFromDb;
try {
dataFromDb = getDataFromDb();
} finally {
//ๅฟ
้กป็ญๅพ
ไธ้ข็้ป่พๆง่กๅฎๆๆ่งฃ้ใ
lock.unlock();
}
return dataFromDb;
}
/**
* ไฝฟ็จredisๅๅธๅผ้ๆฅ่งฃๅณ้ซๅนถๅ็้ฎ้ข
*
* @return
*/
public Map<String, List<Catelog2Vo>> getCatalogJsonFromDbWithRedisLock() {
String uuid = UUID.randomUUID().toString();
//1,ๅ ๅๅธๅผ้๏ผๅปredisๅ ๅ setIfAbsent็ธๅฝไบsetNxๅฝไปคๆไฝ setnxๅฝไปคๆฏๅฆๆๆฒกๆ่ฏฅkeyๅๅฏไปฅๆง่กใ
Boolean lock = redisTemplate.opsForValue().setIfAbsent("lock", uuid, 300, TimeUnit.SECONDS);
if (lock) {
System.out.println("่ทๅๅๅธๅผ้ๆๅใใใใ");
//ๅ ้ๆๅ๏ผๆง่กไธๅก
//่ฎพ็ฝฎ่ฟๆๆถ้ด
//redisTemplate.expire("lock",30,TimeUnit.SECONDS);
Map<String, List<Catelog2Vo>> dataFromDb;
try {
dataFromDb = getDataFromDb();
} finally {
//่ทๅๅผๅฏนๆฏ๏ผๅฏนๆฏๆๅๅ ้ค=ๅๅญๆไฝ lua่ๆฌๅ ้ค
String script = "if redis.call('get',KEY[1]) == ARGV[1] then return redis.call('del',KEY[1]) else return 0 end";
Long lock1 = redisTemplate.execute(new DefaultRedisScript<Long>(script, Long.class), Arrays.asList("lock"), uuid);
}
/* String lockValue = (String) redisTemplate.opsForValue().get("lock");
if(uuid.equals(lockValue)){
//ๅ ้คredis้้ข็key๏ผๅ
ถไป็บฟ็จๅฏไปฅๅๆฌก่ทๅ้ใ
redisTemplate.delete("lock");
}*/
return dataFromDb;
} else {
//ๅ ้ๅคฑ่ดฅ๏ผ่ฆ้่ฏ synchronized
//ไผ็ 100msไนๅ้่ฏ
return getCatalogJsonFromDbWithRedisLock();
}
}
private Map<String, List<Catelog2Vo>> getDataFromDb() {
String catalogJson = (String) redisTemplate.opsForValue().get("catalogJson");
if (!StringUtils.isEmpty(catalogJson)) {
//ๅฆๆ็ผๅญไธญไธไธบnull
Map<String, List<Catelog2Vo>> stringListMap = JSON.parseObject(catalogJson, new TypeReference<Map<String, List<Catelog2Vo>>>() {
});
return stringListMap;
}
System.out.println("ๆฅ่ฏขไบๆฐๆฎๅบใใใใใ");
//1,ๅฐๆฐๆฎๅบ้้ข็ๅคๆฌกๆฅ่ฏขๅๆไธๆฌก
List<CategoryEntity> selectList = baseMapper.selectList(null);
List<CategoryEntity> level1Categorys = getParent_cid(selectList, 0L);
//ๅฐ่ฃ
ๆฐๆฎ
Map<String, List<Catelog2Vo>> map = level1Categorys.stream().collect(Collectors.toMap(Level1 -> Level1.getCatId().toString(), Level1v -> {
//ๆฏไธไธชไธ็บงๅ็ฑป๏ผๆฅๅฐ่ฟไธชไธ็บงๅ็ฑป็ไบ็บงๅ็ฑป
List<CategoryEntity> categoryEntities = getParent_cid(selectList, Level1v.getCatId());
List<Catelog2Vo> catelog2VoList = null;
if (categoryEntities != null) {
//ๆฏไธไธชไบ็บงๅ็ฑป๏ผๆฅๅฐ่ฟไธชไบ็บงๅ็ฑป็ไธ็บงๅ็ฑป
catelog2VoList = categoryEntities.stream().map(Level2 -> {
Catelog2Vo catelog2Vo = new Catelog2Vo(Level1v.getCatId().toString(), null, Level2.getCatId().toString(), Level2.getName());
List<CategoryEntity> level3CatelogList = getParent_cid(selectList, Level2.getCatId());
if (level3CatelogList != null) {
List<Catelog3Vo> catelog3VoList = level3CatelogList.stream().map(Level3 -> {
Catelog3Vo catelog3Vo = new Catelog3Vo(Level2.getCatId().toString(), Level3.getCatId().toString(), Level3.getName());
return catelog3Vo;
}).collect(Collectors.toList());
catelog2Vo.setCatelog3List(catelog3VoList);
}
return catelog2Vo;
}).collect(Collectors.toList());
}
return catelog2VoList;
}));
//3,ๆฅๅฐ็ๆฐๆฎๅๆพๅ
ฅ็ผๅญ๏ผๅฐๅฏน่ฑก่ฝฌๆขๆjsonๆพๅจ็ผๅญไธญ
String s = JSON.toJSONString(map);
redisTemplate.opsForValue().set("catalogJson", s, 1, TimeUnit.DAYS);
return map;
}
/**
* ไฝฟ็จๆฌๅฐ้่งฃๅณ้ซๅนถๅ่ฎฟ้ฎ็้ฎ้ข
*
* @return
*/
public Map<String, List<Catelog2Vo>> getCatalogJsonFromDbWithLocalLock() {
//1,ๅ ้๏ผๅๆญฅไปฃ็ ๅ๏ผๅช่ฆๆฏๅไธๆ้ๅฐฑ่ฝ้ไฝ่ฟไธช้็ๆๆ็บฟ็จ
//synchronized(this),springbootๆๆ็็ปไปถๅจๅฎนๅจไธญ้ฝๆฏๅไพ็ใ
//Todo ๆฌๅฐ้๏ผsynchronized๏ผjuc๏ผLock๏ผๅจๅๅธๅผๆ
ๅตไธ๏ผๆณ่ฆ้ไฝๆๆๅฟ
้กป่ฆๅๅธๅผ้ใ
synchronized (this) {
//ๅพๅฐ้ไนๅ๏ผๆไปฌๅบ่ฏฅๅๅป็ผๅญไธญ็กฎๅฎไธๆฌก๏ผๅฆๆๆฒกๆๆ้่ฆ็ปง็ปญๆฅ่ฏข
return getDataFromDb();
}
}
private List<CategoryEntity> getParent_cid(List<CategoryEntity> selectList, Long parent_cid) {
//return this.baseMapper.selectList(new QueryWrapper<CategoryEntity>().eq("parent_cid", Level1v.getCatId().toString()));
List<CategoryEntity> collect = selectList.stream().filter((item) -> {
return item.getParentCid() == parent_cid;
}).collect(Collectors.toList());
return collect;
}
/*private List<CategoryEntity> getChildren(List<CategoryEntity> rootList,List<CategoryEntity> all){
List<CategoryEntity> childrenList = null;
for(CategoryEntity categoryEntity : rootList){
childrenList = new ArrayList<>();
for (CategoryEntity categoryEntity1 : all){
if(categoryEntity.getCatId() == categoryEntity1.getParentCid()){
childrenList.add(categoryEntity1);
categoryEntity.setChildren(childrenList);
}
}
getChildren(childrenList,all);
}
return rootList;
}*/
/**
* ้ๅฝๆฅๆพๆๆ่ๅ็ๅญ่ๅ
*
* @param categoryEntity
* @param all
* @return
*/
private List<CategoryEntity> getChildren(CategoryEntity categoryEntity, List<CategoryEntity> all) {
List<CategoryEntity> children = all.stream().filter(category -> {
return category.getParentCid() == categoryEntity.getCatId();
}).map(category -> {
//ๆพๅฐๅญ่ๅ
category.setChildren(getChildren(category, all));
return category;
}).sorted((menu1, menu2) -> {
//่ๅๆๅบ
return (menu1.getSort() == null ? 0 : menu1.getSort()) - (menu2.getSort() == null ? 0 : menu2.getSort());
}).collect(Collectors.toList());
return children;
}
} | [
"1063889783@qq.com"
] | 1063889783@qq.com |
3fc361cc03aafc36acdce62d0b66454f7585adef | 016c44a08ac61f7446209d49871cb4b7ebcf752a | /src/user/HolidayDAO.java | 8cfdc02b7caf13751dc9b5f4da93350266172d8c | [] | no_license | juyeon522/DBProject | fd459895c64cc2dc2a29712fb3b15dc9bc58579a | ff5ffd4e191ff0dc08efd9d92c68fef876f89c9d | refs/heads/master | 2023-01-24T02:40:51.443949 | 2020-12-15T11:40:08 | 2020-12-15T11:40:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,226 | java | package user;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
public class HolidayDAO {
private int REQNO;
private String DNAME;
private int EMPNO;
private int MANNO;
private String HTYPE;
private String START_TIME;
private String END_TIME;
private String STATUS;
public String getDNAME() {
return DNAME;
}
public void setDNAME(String dNAME) {
DNAME = dNAME;
}
public int getREQNO() {
return REQNO;
}
public void setREQNO(int rEQNO) {
REQNO = rEQNO;
}
public int getEMPNO() {
return EMPNO;
}
public void setEMPNO(int eMPNO) {
EMPNO = eMPNO;
}
public int getMANNO() {
return MANNO;
}
public void setMANNO(int mANNO) {
MANNO = mANNO;
}
public String getHTYPE() {
return HTYPE;
}
public void setHTYPE(String hTYPE) {
HTYPE = hTYPE;
}
public String getSTART_TIME() {
return START_TIME;
}
public void setSTART_TIME(String sTART_TIME) {
START_TIME = sTART_TIME;
}
public String getEND_TIME() {
return END_TIME;
}
public void setEND_TIME(String eND_TIME) {
END_TIME = eND_TIME;
}
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String sTATUS) {
STATUS = sTATUS;
}
private Connection con;
private ResultSet rs;
public HolidayDAO() {
try {
String dbURL = "jdbc:mysql://127.0.0.1:3306/dbproject?characterEncoding=UTF-8&serverTimezone=UTC";
String dbID = "root";
String dbPassword = "1234";
Class.forName("com.mysql.cj.jdbc.Driver");
con = DriverManager.getConnection(dbURL, dbID, dbPassword);
} catch (Exception e) {
e.printStackTrace();
}
}
public int request(HolidayDAO holidayDAO) {
String SQL = "INSERT INTO hrequest(EMPNO, DNAME, HTYPE, START_TIME, END_TIME) VALUES(?, ?, ?, ?, ?)";
try {
PreparedStatement pstmt = con.prepareStatement(SQL);
pstmt.setInt(1, getEMPNO());
pstmt.setString(2, getDNAME());
pstmt.setString(3, getHTYPE());
pstmt.setString(4, getSTART_TIME());
pstmt.setString(5, getEND_TIME());
return pstmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
}
return -1; //๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝอบ๏ฟฝ๏ฟฝฬฝ๏ฟฝ ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ
}
}
| [
"leenomt@naver.com"
] | leenomt@naver.com |
4a6172643d05422a931bb77d2c70f432e2a40dbc | 56099c1e632e11470ed91896e58a7a5ef1e80511 | /saf-core/src/main/java/com/safframework/saf/view/RecycleImageView.java | 8b42f26c453efef22524dd22644bc4d0c994d457 | [
"Apache-2.0"
] | permissive | CNHTT/SAF | 1b168efa42ee9fc456693d8cd7a2a1d081245b1c | e74bda4f022ef9face16d506d566818ddba0f373 | refs/heads/master | 2021-01-21T00:22:36.680610 | 2017-02-20T05:14:27 | 2017-02-20T05:14:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package com.safframework.saf.view;
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by Tony Shen on 16/5/28.
*/
public class RecycleImageView extends ImageView {
public RecycleImageView(Context context) {
super(context);
}
public RecycleImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public RecycleImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
setImageDrawable(null);
}
@Override
protected void onDraw(Canvas canvas) {
try {
super.onDraw(canvas);
}catch (Exception e){
e.printStackTrace();
}
}
}
| [
"fengzhizi715@126.com"
] | fengzhizi715@126.com |
20a919b112763e1bc1cd1b9db65a875cd14e950d | fe420b385372b4ceab375997bf42b741a5e21ffa | /gmall-api/src/main/java/com/atguigu/gmall/pms/service/SkuStockService.java | eb1256fc9962ab6eaedf695912cffb73b8d6e952 | [] | no_license | zhu-a/gmall-1111 | bf80a0a669b902bfa92c0fe2fe69993799d84ee9 | b4405a3f594cfb1872a6796a9a8e259e43df0a9f | refs/heads/master | 2020-11-27T15:19:14.381430 | 2019-12-22T02:53:55 | 2019-12-22T02:53:55 | 229,508,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 300 | java | package com.atguigu.gmall.pms.service;
import com.atguigu.gmall.pms.entity.SkuStock;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* sku็ๅบๅญ ๆๅก็ฑป
* </p>
*
* @author ZXC
* @since 2019-12-21
*/
public interface SkuStockService extends IService<SkuStock> {
}
| [
"853753191@qq.com"
] | 853753191@qq.com |
4cb0eabcd2ec172f1676660b2b6ca53f41cb3c53 | 3182b9a4c62e3045236081add5f244e5c9dcfe4f | /src/main/java/com/guimcarneiro/osworks/api/model/ComentarioInput.java | 348108c7b87ed14f2ad693dfb8f5b94945714206 | [] | no_license | guimcarneiro/osworks-api | 4991bf6196fc420013638a251b7aa5721dbd61cd | 72d607e2313973fc2b15788ba6784a0d04223ae6 | refs/heads/master | 2022-12-03T16:15:14.286926 | 2020-08-21T01:34:07 | 2020-08-21T01:34:07 | 288,266,505 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package com.guimcarneiro.osworks.api.model;
import javax.validation.constraints.NotBlank;
public class ComentarioInput {
@NotBlank
private String descricao;
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
}
| [
"guilherme.carneiro@ccc.ufcg.edu.br"
] | guilherme.carneiro@ccc.ufcg.edu.br |
fd42d98c07b17329703fe89aba7fd02983a3f6f0 | c249253238512d81a76dbe90127e5973d3ba9156 | /plus-f/src/main/java/com/socialthingy/plusf/z80/operations/OpLd8RegIndexedIndirect.java | 8a729acb489ffc0ec4216a85c3b9ff1de6aaae9c | [
"MIT"
] | permissive | alangibson27/plus-f | a268c6737dd9b7a3b2b154aa7289b6443b1a33fe | e31d5894bed0bb8397ee4915deb9b3672057a730 | refs/heads/master | 2020-04-05T01:39:03.376344 | 2019-03-13T23:08:29 | 2019-03-13T23:08:29 | 52,693,839 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,523 | java | package com.socialthingy.plusf.z80.operations;
import com.socialthingy.plusf.z80.*;
public class OpLd8RegIndexedIndirect extends Operation {
private final Processor processor;
private final Memory memory;
private final Register dest;
private final IndexRegister indexRegister;
public OpLd8RegIndexedIndirect(final Processor processor, final Memory memory, final Register dest, final Register indexRegister) {
this.processor = processor;
this.memory = memory;
this.dest = dest;
this.indexRegister = IndexRegister.class.cast(indexRegister);
}
@Override
public void execute(ContentionModel contentionModel, int initialPcValue, int irValue) {
final int addr = indexRegister.withOffset(processor.fetchNextByte());
contentionModel.applyContention(initialPcValue, 4);
contentionModel.applyContention(initialPcValue + 1, 4);
contentionModel.applyContention(initialPcValue + 2, 3);
contentionModel.applyContention(initialPcValue + 2, 1);
contentionModel.applyContention(initialPcValue + 2, 1);
contentionModel.applyContention(initialPcValue + 2, 1);
contentionModel.applyContention(initialPcValue + 2, 1);
contentionModel.applyContention(initialPcValue + 2, 1);
contentionModel.applyContention(addr, 3);
dest.set(memory.get(addr));
}
@Override
public String toString() {
return String.format("ld %s, (%s + n)", dest.name(), indexRegister.name());
}
}
| [
"alangibson27@gmail.com"
] | alangibson27@gmail.com |
55c34f205bf8736eae51bb9cc93571c864ae22f2 | 1374237fa0c18f6896c81fb331bcc96a558c37f4 | /java/com/winnertel/ems/epon/iad/bbs4000/gui/r200/TCAConfigPanel.java | c1fc4ad43967819311a35afddb6bde466c9d2858 | [] | no_license | fangniude/lct | 0ae5bc550820676f05d03f19f7570dc2f442313e | adb490fb8d0c379a8b991c1a22684e910b950796 | refs/heads/master | 2020-12-02T16:37:32.690589 | 2017-12-25T01:56:32 | 2017-12-25T01:56:32 | 96,560,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,729 | java | package com.winnertel.ems.epon.iad.bbs4000.gui.r200;
import com.winnertel.ems.epon.iad.bbs4000.mib.r200.TCAConfig;
import com.winnertel.em.framework.IApplication;
import com.winnertel.em.framework.gui.action.BaseAction;
import com.winnertel.em.framework.gui.swing.UPanel;
import com.winnertel.em.standard.snmp.gui.SnmpApplyButton;
import com.winnertel.em.standard.snmp.gui.SnmpRefreshButton;
import com.winnertel.em.standard.util.BeanService;
import com.winnertel.em.standard.util.gui.input.IntegerTextField;
import com.winnertel.em.standard.util.gui.layout.HSpacer;
import com.winnertel.em.standard.util.gui.layout.NTLayout;
import com.winnertel.em.standard.util.gui.layout.VSpacer;
import javax.swing.*;
import java.awt.*;
public class TCAConfigPanel extends UPanel{
private IntegerTextField tfUtsBBSSysCpuUtilityAlarmThresholdTotal = new IntegerTextField();
private IntegerTextField tfUtsBBSSysCpuUtilityAlarmThresholdPerTask = new IntegerTextField();
private IntegerTextField tfUtsBBSSysMemoryUtilityAlarmThreshold = new IntegerTextField();
private final String utsBBSSysCpuUtilityAlarmThresholdTotal = fStringMap.getString("utsBBSSysCpuUtilityAlarmThresholdTotal") + " : ";
private final String utsBBSSysCpuUtilityAlarmThresholdPerTask = fStringMap.getString("utsBBSSysCpuUtilityAlarmThresholdPerTask") + " : ";
private final String utsBBSSysMemoryUtilityAlarmThreshold = fStringMap.getString("utsBBSSysMemoryUtilityAlarmThreshold") + " : ";
private SnmpApplyButton btApply;
private SnmpRefreshButton btRefresh;
public TCAConfigPanel(IApplication app) {
super(app);
setModel(new TCAConfig(app.getSnmpProxy()));
init();
}
public void initGui() {
btApply = new SnmpApplyButton(fApplication, this);
btApply.getAction().putValue(BaseAction.ID, "Modify_TCAConfig");
btRefresh = new SnmpRefreshButton(fApplication, this);
JPanel buttonsPanel = new JPanel();
buttonsPanel.add(btApply);
buttonsPanel.add(btRefresh);
JPanel baseInfoPanel = new JPanel();
NTLayout layout = new NTLayout(3, 3, NTLayout.FILL, NTLayout.CENTER,
5, 5);
layout.setMargins(6, 10, 6, 10);
baseInfoPanel.setLayout(layout);
baseInfoPanel.setBorder(BorderFactory.createEtchedBorder());
baseInfoPanel.add(new JLabel(utsBBSSysCpuUtilityAlarmThresholdTotal));
tfUtsBBSSysCpuUtilityAlarmThresholdTotal.setName(fStringMap.getString("utsBBSSysCpuUtilityAlarmThresholdTotal"));
baseInfoPanel.add(tfUtsBBSSysCpuUtilityAlarmThresholdTotal);
baseInfoPanel.add(new HSpacer());
baseInfoPanel.add(new JLabel(utsBBSSysCpuUtilityAlarmThresholdPerTask));
tfUtsBBSSysCpuUtilityAlarmThresholdPerTask.setName(fStringMap.getString("utsBBSSysCpuUtilityAlarmThresholdPerTask"));
baseInfoPanel.add(tfUtsBBSSysCpuUtilityAlarmThresholdPerTask);
baseInfoPanel.add(new HSpacer());
baseInfoPanel.add(new JLabel(utsBBSSysMemoryUtilityAlarmThreshold));
tfUtsBBSSysMemoryUtilityAlarmThreshold.setName(fStringMap.getString("utsBBSSysMemoryUtilityAlarmThreshold"));
baseInfoPanel.add(tfUtsBBSSysMemoryUtilityAlarmThreshold);
baseInfoPanel.add(new HSpacer());
JPanel allPanel = new JPanel();
layout = new NTLayout(2, 1, NTLayout.FILL, NTLayout.CENTER, 5, 3);
layout.setMargins(6, 10, 6, 10);
allPanel.setLayout(layout);
allPanel.add(baseInfoPanel);
allPanel.add(new VSpacer());
setLayout(new BorderLayout());
add(allPanel, BorderLayout.CENTER);
add(buttonsPanel, BorderLayout.SOUTH);
}
protected void initForm() {
tfUtsBBSSysCpuUtilityAlarmThresholdTotal.setValueScope(0, 100);
tfUtsBBSSysCpuUtilityAlarmThresholdPerTask.setValueScope(0, 100);
tfUtsBBSSysMemoryUtilityAlarmThreshold.setValueScope(0, 1000);
}
@Override
public void refresh() {
TCAConfig mbean = (TCAConfig) getModel();
BeanService.refreshBean(fApplication, mbean);
tfUtsBBSSysCpuUtilityAlarmThresholdTotal.setValue(mbean.getUtsBBSSysCpuUtilityAlarmThresholdTotal().intValue());
tfUtsBBSSysCpuUtilityAlarmThresholdPerTask.setValue(mbean.getUtsBBSSysCpuUtilityAlarmThresholdPerTask().intValue());
tfUtsBBSSysMemoryUtilityAlarmThreshold.setValue(mbean.getUtsBBSSysMemoryUtilityAlarmThreshold().intValue());
}
public void updateModel() {
TCAConfig mbean = (TCAConfig) getModel();
mbean.setUtsBBSSysCpuUtilityAlarmThresholdTotal(new Integer(tfUtsBBSSysCpuUtilityAlarmThresholdTotal.getValue()));
mbean.setUtsBBSSysCpuUtilityAlarmThresholdPerTask(new Integer(tfUtsBBSSysCpuUtilityAlarmThresholdPerTask.getValue()));
mbean.setUtsBBSSysMemoryUtilityAlarmThreshold(new Integer(tfUtsBBSSysMemoryUtilityAlarmThreshold.getValue()));
}
}
| [
"fangniude@gmail.com"
] | fangniude@gmail.com |
ed775c7e33fa510fa7027cf44357e96db310f621 | add174fe9fd05214c6d17b5e6042c522a5413644 | /src/test/java/seedu/room/logic/commands/RemoveTagCommandTest.java | ddeb1e14851de89e75a69367ef636fd2ffbe7e1b | [
"MIT"
] | permissive | CS2103AUG2017-F09-B1/main | 9411d00154dc06861c305289207db400a2b9a83f | 5f83dc2e151c8aac93d1e3f9b40bbba350428305 | refs/heads/master | 2021-08-16T07:01:24.548634 | 2017-11-19T07:07:16 | 2017-11-19T07:07:16 | 105,493,218 | 0 | 6 | null | 2017-11-19T07:07:17 | 2017-10-02T03:04:27 | Java | UTF-8 | Java | false | false | 2,013 | java | package seedu.room.logic.commands;
import static seedu.room.logic.commands.CommandTestUtil.INVALID_TAG;
import static seedu.room.logic.commands.CommandTestUtil.VALID_TAG_FRIEND;
import static seedu.room.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.room.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.room.testutil.TypicalPersons.getTypicalResidentBook;
import org.junit.Test;
import seedu.room.logic.CommandHistory;
import seedu.room.logic.UndoRedoStack;
import seedu.room.model.Model;
import seedu.room.model.ModelManager;
import seedu.room.model.UserPrefs;
import seedu.room.model.tag.Tag;
//@@author blackroxs
/**
* Contains integration tests (interaction with the Model) and unit tests for RemoveTagCommand.
*/
public class RemoveTagCommandTest {
private Model model = new ModelManager(getTypicalResidentBook(), new UserPrefs());
@Test
public void execute_tagNameValid_success() throws Exception {
RemoveTagCommand removeTagCommand = prepareCommand(VALID_TAG_FRIEND);
String expectedMessage = RemoveTagCommand.MESSAGE_REMOVE_TAG_SUCCESS;
ModelManager expectedModel = new ModelManager(model.getResidentBook(), new UserPrefs());
expectedModel.removeTag(new Tag(VALID_TAG_FRIEND));
assertCommandSuccess(removeTagCommand, model, expectedMessage, expectedModel);
}
@Test
public void execute_tagNameInvalid() throws Exception {
RemoveTagCommand removeTagCommand = prepareCommand(INVALID_TAG);
String expectedMessage = RemoveTagCommand.MESSAGE_REMOVE_TAG_NOT_EXIST;
assertCommandFailure(removeTagCommand, model, expectedMessage);
}
/**
* Returns an {@code RemoveTagCommand} with parameters {@code tagName}
*/
private RemoveTagCommand prepareCommand(String tagName) {
RemoveTagCommand command = new RemoveTagCommand(tagName);
command.setData(model, new CommandHistory(), new UndoRedoStack());
return command;
}
}
| [
"glenicetan@hotmail.com"
] | glenicetan@hotmail.com |
fcb273e05aac9393ba88a647fad4ccd2819143bf | b30abfabcd18e2a07d00427ef9e6555443292ba5 | /app/src/main/java/se/nielstrom/dice/app/Die.java | 61572702a3cd4562abc4e79ccb6d52e183e67805 | [] | no_license | dnjstrom/Dice | 24728f54eacb4b4089574935c3e10ad921435e5d | 2bbbbf9bb8b9e13ab78390cecb1f9ca28c3f3719 | refs/heads/master | 2018-12-31T09:47:19.823958 | 2014-04-18T21:36:13 | 2014-04-18T21:36:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,300 | java | package se.nielstrom.dice.app;
import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import java.util.Random;
/**
* Created by Daniel on 2014-04-17.
*/
public class Die {
private LayoutInflater inflater;
private int color,
nrOfSides,
currentSide;
public Die() {
this(6);
}
public Die(int nrOfSides) {
this(nrOfSides, Color.WHITE);
}
public Die(int nrOfSides, int color) {
this.nrOfSides = nrOfSides;
this.color = color;
currentSide = 1;
}
public int getColor() {
return color;
}
public Die setColor(int color) {
this.color = color;
return this;
}
public int getNrOfSides() {
return nrOfSides;
}
public Die setNrOfSides(int nrOfSides) {
this.nrOfSides = nrOfSides;
return this;
}
public int getCurrentSide() {
return currentSide;
}
public Die setCurrentSide(int currentSide) {
this.currentSide = currentSide;
return this;
}
public int roll() {
currentSide = new Random().nextInt(nrOfSides) + 1;
return currentSide;
}
}
| [
"D@nielstrom.se"
] | D@nielstrom.se |
aaaefdc06a2aa8a7262b5357e23f5a14b72ca8a4 | a6b96a61435dae97b3f9070e1b808ea3de1c492c | /android/app/src/main/java/com/minhastarefas/MainApplication.java | 0fea2e3236c7c9f4f1d2d60fa26d7d1587f39a77 | [] | no_license | rafapetraca/MinhasTarefas | 1004c20b2e6b7d7a109909af5a803318dac3c8eb | 75e3a16ada0e74d3f7af2e73799abc2ee8700e94 | refs/heads/master | 2023-02-08T08:01:13.130320 | 2020-12-29T23:50:32 | 2020-12-29T23:50:32 | 325,411,271 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,609 | java | package com.minhastarefas;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.minhastarefas.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"rafaelpetraca1999@gmail.com"
] | rafaelpetraca1999@gmail.com |
5799519e802087a0788322b024c02a7e9ac9a520 | 2190463edcd64772d734a056a0642ea22af66846 | /centrologistico/src/main/java/domain/model/interfaces/IEntregaService.java | 8c5b312b4e2a594a471f58d33afddd31aa9b6543 | [] | no_license | snaplucas/Sistema-CentroLogistico | 08ede9bce8c7649a02f4ee64654fc2774cef7876 | 8c540fac44a0c5f827bfc62bb81d413c02328af7 | refs/heads/master | 2021-01-01T16:44:20.608189 | 2017-12-05T22:58:58 | 2017-12-05T22:58:58 | 97,907,886 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 193 | java | package domain.model.interfaces;
import domain.model.entities.Entrega;
public interface IEntregaService {
void adicionarEntrega(Entrega entrega);
Entrega obterEntrega(String id);
}
| [
"lucas.chapola@gmail.com"
] | lucas.chapola@gmail.com |
9db80137cd7d4ad10885cebe9a5a21c337b3fe7f | 11c07ed23d5dcae59477c72f37a97cb52822077d | /app/src/main/java/com/example/usingstrings/MainActivity.java | 8c17cf5fd512a7700fa1846c93f45289192758f6 | [] | no_license | Thisara634/IT19132488 | 42933ccadc2cbc88b70e0bc805f0114d9b725d00 | f8cd964f40ce3460225b9dd218dcd223bc9781ae | refs/heads/master | 2022-11-27T20:33:34.330395 | 2020-08-08T16:29:24 | 2020-08-08T16:29:24 | 286,079,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,027 | java | public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView txtvmsg2 = findViewById(R.id.tvmsg2);
txtvmsg2.setText(R.string.Msg2);
Log.i("Lifecycle" , "onCreate called....");
}
@Override
protected void onStart() {
super.onStart();
Log.i("Lifecycle" , "onStart called...." );
}
@Override
protected void onResume() {
super.onResume();
Log.i("Lifecycle" , "onResume called...." );
}
@Override
protected void onPause() {
super.onPause();
Log.i("Lifecycle" , "onPause called...." );
}
@Override
protected void onStop() {
super.onStop();
Log.i("Lifecycle" , "onStop called...." );
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.i("Lifecycle" , "onDestroy called...." );
}
} | [
"thisarawinchester1999@gmail.com"
] | thisarawinchester1999@gmail.com |
b408e78c66e4213ee3490e40043bbd0f019feb46 | 434a5f8727acee996eb8b6e43482ab009b489db9 | /Server.java | aee7dd82d8d8ed6d4582e5429792b295e1bd3b09 | [] | no_license | Jet-Chen1026/tcp-udp | 634846f21730aa86378c0c19b86079ad7ccc5b2c | 9ec31dce984c17f11ee5bd9ecc6818e418948d87 | refs/heads/master | 2022-06-20T04:16:19.877233 | 2020-05-09T13:35:09 | 2020-05-09T13:35:09 | 262,541,936 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | package OS_experiment;
import sun.jvm.hotspot.debugger.ThreadAccess;
import java.io.IOException;
import java.net.Socket;
public class Server {
public static void main(String[] args) throws IOException {
End server_tcp = new End(10002, "tcp");
End server_udp = new End(8888, "udp");
Socket socket = server_tcp.waitConnect();
server_tcp.receive_tcp(socket);
server_udp.receive_udp();
}
} | [
"noreply@github.com"
] | noreply@github.com |
d11ca4278c6c929c511fc4b7cf45f02b526f2a8d | b59b132033af0b482c2d9154dfcaedce450c2574 | /src/test/resources/GeneratorTest/all/after/src/main/java/org/tomitribe/github/model/Subkeys.java | c852bbab2ece584835edbd3f443c4c1e2c358e1b | [
"Apache-2.0"
] | permissive | Deng678/github-api-java | 89078dde67e0fadda0dc81e0e4b156eae1e2d24b | 0c060b9625c4b054bb0810c75782ee06c76be94f | refs/heads/master | 2023-03-16T04:30:01.903330 | 2020-12-03T11:34:56 | 2020-12-03T11:34:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,951 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.tomitribe.github.model;
import java.util.List;
import javax.json.bind.annotation.JsonbProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Subkeys {
@JsonbProperty("can_certify")
private Boolean canCertify;
@JsonbProperty("can_encrypt_comms")
private Boolean canEncryptComms;
@JsonbProperty("can_encrypt_storage")
private Boolean canEncryptStorage;
@JsonbProperty("can_sign")
private Boolean canSign;
@JsonbProperty("created_at")
private String createdAt;
@JsonbProperty("emails")
private List<Emails> emails;
@JsonbProperty("expires_at")
private String expiresAt;
@JsonbProperty("id")
private Integer id;
@JsonbProperty("key_id")
private String keyId;
@JsonbProperty("primary_key_id")
private Integer primaryKeyId;
@JsonbProperty("public_key")
private String publicKey;
@JsonbProperty("raw_key")
private String rawKey;
@JsonbProperty("subkeys")
private List<Subkeys> subkeys;
}
| [
"david.blevins@gmail.com"
] | david.blevins@gmail.com |
2784a3f6c959d8e4580b48a3eca5565968ffaf82 | 7c79c9d51c7de74c7eeda80f9c0090323e9005ee | /180101066_AssignI/180101066_PLL_Assign1/PI_Computation.java | 886717f025de0a26be1f5115ebb7d88272f34d19 | [] | no_license | Mandloi7/Programming-Languages-Lab | db027461bd349c2b717898ec3a0b4bfff953c9a8 | cef5b982eabdd3b63d0a20bc8d24cdbb1e426f68 | refs/heads/master | 2023-06-19T22:44:39.832883 | 2021-07-18T17:00:46 | 2021-07-18T17:00:46 | 387,225,796 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,204 | java |
/*
Name: Ritik Mandloi
Roll No. : 180101066
Instructions for Execution :
javac PI_Computation.java
java PI_Computation <No_of_Threads>
Eg: javac PI_Computation.java
java PI_Computation 4
*/
import java.util.*;
import java.util.Random;
public class PI_Computation{
//Number of Threads
private static int nThreads=1;
//Number of points inside the square
private static int nSquarePoints = 0;
//Number of points inside the circle
private static int nCirclePoints = 0;
//lock for synchronization
private static final Object lock = new Object();
//Extended thread class
class NewThread extends Thread{
int points; //points allotted to each thread
int threadId; //Id of each thread
//Constructor
public NewThread(int points, int threadId){
this.points = points;
this.threadId = threadId;
}
//Run function
public void run(){
Random rand = new Random();
//System.out.print("Currently Running Thread : "+threadId+"\n");
for( int i=0 ; i < points ; ++i){
//lock for synchronization in updating the shared variables 'nCirclePoints' & 'nSquarePoints'
synchronized(lock){
double x = rand.nextDouble(); //random x coordinate
double y = rand.nextDouble(); //random y coordinate
if( (x*x + y*y) <= 1){
nCirclePoints++; //incrementing circlepoints if inside the circle
}
nSquarePoints++; //incrementing squarepoints
}
}
//System.out.print("Currently CirclePoints : "+nCirclePoints+", SquarePoints : "+nSquarePoints+"\n");
}
}
public void RunThreads(int pointsPerThread, int pointsForLastThread, int nThreads )
throws InterruptedException{
NewThread[] THREAD = new NewThread[nThreads]; //Creating <nThread> number of threads
for(int i=0;i<nThreads-1;i++){
THREAD[i] = new NewThread(pointsPerThread, i+1); //Initializing the values of the fields
}
THREAD[nThreads-1] = new NewThread(pointsForLastThread, nThreads); //Initializing values for the last thread
for(int i=0;i<nThreads;i++){ //starting all the threads for execution
THREAD[i].start();
}
for(int i=0;i<nThreads;i++){ //join() used for synchronization
THREAD[i].join();
}
}
public static void main(String []args)throws InterruptedException{
int nArgs=args.length;
if(nArgs==1){ //if number of arguments is 1
nThreads = Integer.parseInt(args[0]);
if(nThreads<4 || nThreads>16){ //if value not between 4 and 16
System.out.print("Invalid usage!\nNo. of threads should be in the range 4 to 16\n");
return ;
}
}
else{
System.out.print("Invalid usage!\nTry the command:: java PI_Computation <nThreads>\nExample :: java PI_Computation 4\n");
return;
}
//Calculating the number of points to be alloted to each thread
int pointsPerThread=1000000/nThreads;
//If not exactly divisible, give the remainder number of points to last thread
int pointsForLastThread=1000000-(nThreads-1)*pointsPerThread;
PI_Computation PI_Comp = new PI_Computation();
PI_Comp.RunThreads(pointsPerThread, pointsForLastThread, nThreads); //performing multithreading
System.out.println("Number of points inside the circle = "+nCirclePoints);
System.out.println("Number of points inside the square = "+nSquarePoints);
System.out.println("PI = "+(4*(double)nCirclePoints/(double)nSquarePoints));
//Done
}
}
| [
"ritik.mandloi.2000@gmail.com"
] | ritik.mandloi.2000@gmail.com |
b1493c8f5a4c6695aa42a507c80380ff1c51cb0f | 1bbcb91f73336cacf84be37ec59739808403eb2a | /Java/Sorting/CombSort/CombSort.java | b25e2916032b1e00a894d412ff5b2a930f4598dd | [] | no_license | SiddhantArya/Algorithms | 6dc62efc24461dd4836971288965f05287728434 | 504974af0e686ca0862275adce317ed380d912d6 | refs/heads/master | 2021-07-15T15:51:31.318567 | 2018-11-03T07:29:59 | 2018-11-03T07:29:59 | 105,644,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,671 | java | // CombSort is an improvement of the Bubble Sort algorithm.
// The gap starts with a large value and shrinks by a factor of 1.3 in every
// iteration until it reaches the value 1.
// @author Siddhant Arya
// @email siddhant.arya18@gmail.com
// Comb Sort uses a gap based approach to reduce the number of inversion counts
// Inversion counts determine how far the array is to being sorted
// It is said to exist if an element to right is smaller i < j and a[i] > a[j]
// Time Complexity = Worst/Average Case: O(n^2), on average faster than Bubble
// Best Case: O(n)
// Space Complexity = O(1)
// In-Place: Yes
// Stable: No
import java.util.Arrays;
public class CombSort
{
public int nextGap(int gap)
{
gap = (int) gap * 10 / 13;
if (gap<1)
gap = 1;
return gap;
}
public void swap(int[] arr, int i, int j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
public void sort(int[] arr)
{
if (arr.length < 0)
{
System.out.println("Invalid Arguments specified");
return;
}
int gap = arr.length;
boolean swapped = false;
while (gap !=1 || swapped==true)
{
gap = nextGap(gap);
swapped = false;
for (int i=0; i+gap<arr.length; i++)
{
if (arr[i] > arr[i+gap])
{
swapped = true;
swap(arr, i, i+gap);
}
}
}
}
public static void main(String[] args)
{
int arr[] = {1, 4, 1, 2, 7, 5, 2};
System.out.println("Given Array: " + Arrays.toString(arr));
CombSort obj = new CombSort();
obj.sort(arr);
System.out.println("Sorted Array: " + Arrays.toString(arr));
}
}
| [
"siddhant.arya18@gmail.com"
] | siddhant.arya18@gmail.com |
8c5a67c190ff76a81d37b63feb1655e41bd7ecc5 | 9dd043d872fdede4bf7be7166f1fb0ddeaeae070 | /Test/src/DefaultNamespace/HelloWorld.java | 1d90935eb6ce7d41118f8d91419a185a3295b211 | [] | no_license | hpj1992/EclipseWorkspace | e563f8dfb36fee594d8c9534a966e0a318848a5f | 03823bd7401a3eff93455686e766c030489b1948 | refs/heads/master | 2021-05-01T04:48:19.384688 | 2016-06-18T19:42:09 | 2016-06-18T19:42:09 | 42,273,531 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | /**
* HelloWorld.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package DefaultNamespace;
public interface HelloWorld extends java.rmi.Remote {
public java.lang.String getGreetings(java.lang.String name) throws java.rmi.RemoteException;
}
| [
"hpj1992@gmail.com"
] | hpj1992@gmail.com |
392e1096c728698966dfebb75caf22b07781486a | d8949023f220fae029cd59bcdf6b88ffdbb85cc1 | /src/main/java/javaexp_svn/src/main/java/javaexp/a11_io/A19_FileWriterMultiLIne.java | bd3c2bf89cb839949f0573b556da51d90f715e08 | [] | no_license | jg665/PC-to-Notebook | 17bf24e200950e3556a53ba8749e37514fa405a0 | 17805120ff74648dbeaa683def6cacd37d534665 | refs/heads/master | 2023-07-13T19:10:27.710344 | 2021-08-09T12:07:58 | 2021-08-09T12:07:58 | 379,281,823 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,427 | java | package javaexp.a11_io;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class A19_FileWriterMultiLIne {
public static void main(String[] args) {
// TODO Auto-generated method stub
// ex) a11_io\z03_fileExp\newFile.txt
// ์ ์
๋ ฅํ ์ฌ๋ฌ ํ์ ๋ฌธ์์ด์ ํ๋ฒ์ ์ ์ฅ์ฒ๋ฆฌ
// ํ์ธ์.
BufferedReader buffer = new BufferedReader(
new InputStreamReader(System.in));
System.out.println("ํ์ผ์ ์
๋ ฅํ ๋ด์ฉ:");
PrintWriter out=null;
try {
String path="C:\\javaexp\\workspace\\javaexp\\src\\main\\java\\javaexp\\a11_io\\z03_fileExp";
String fname="newFile.txt";
out = new PrintWriter(
new FileWriter( new File(path,fname)));
StringBuffer sbf = new StringBuffer();
while(true) {
String data = buffer.readLine();
if(data.equals("!Q")) {
break;
}
// StringBuffer ์ค๋ฐ๊ฟ๊ณผ ํจ๊ป ๋์ ์ฒ๋ฆฌ
sbf.append(data+"\n");
}
// ์ต์ข
์ ์ผ๋ก ์ถ๋ ฅ์ฒ๋ฆฌ..
out.print(sbf.toString());
System.out.println("์ถ๋ ฅ ์ข
๋ฃ!!");
} catch (IOException e) {
e.printStackTrace();
}finally {
try {
buffer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
out.close();
}
}
}
| [
"LDJ@DESKTOP-PBU4M1N"
] | LDJ@DESKTOP-PBU4M1N |
623e7a88d88889ef82d14ce645848f2302b13734 | 1f6280eb9d4b448e46bdf0b456e41dcbf52edfb8 | /wrqfunction/HexToDecimal.java | da375e37d3cd675c34abfa8d8d8dcc53ec533ce2 | [] | no_license | wangrq07/TEAM5 | 5b972e3583c556ab609bfc0e167e42186a6dd79b | e538d7671dc7b10224f66b8e6f4d0d225b86e674 | refs/heads/master | 2021-08-06T14:47:53.710249 | 2017-11-06T07:41:01 | 2017-11-06T07:41:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java |
public class HexToDecimal {
String hexString;
public HexToDecimal(String hexString){
this.hexString=hexString;
}
public int hex2Decimal(){
return Integer.parseInt(hexString,16);
}
}
| [
"wangrq07@163.com"
] | wangrq07@163.com |
482dc64e79a2864002d9f70f44bdd120b3b22b2e | b811a0884aa7c0bc06d252acbc2c3f3f3a5af76e | /app/src/main/java/com/quesan/app/InboxFragment.java | 6598bbc8b61aca2b104dc7149229ca1254dc6c6e | [] | no_license | imdineshsingh/QuesAn | 85f14d8a2b35b8ffb08687069d539e78eafc366b | 38cb851194127f17d3adf29b7caaf715152b3efe | refs/heads/master | 2021-07-07T09:38:54.191845 | 2017-10-01T17:29:15 | 2017-10-01T17:29:15 | 105,460,301 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,958 | java | package com.quesan.app;
import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.quesan.app.adapters.MessageAdapter;
import com.quesan.app.model.Message;
import java.util.ArrayList;
/**
* A simple {@link Fragment} subclass.
*/
public class InboxFragment extends Fragment
{
private MessageAdapter adapter;
private ListView listView;
private ArrayList<Message> list;
private String title;
public InboxFragment()
{
list=new ArrayList<>();
this.title=title;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
// Inflate the layout for this fragment
View view= inflater.inflate(R.layout.fragment_inbox, container, false);
adapter=new MessageAdapter(getActivity(),list);
listView= (ListView) view.findViewById(R.id.message_list);
Bundle b=getArguments();
getActivity().setTitle(b.getString("title"));
final String title=getActivity().getTitle().toString();
if(title!=null)
{
getActivity().setTitle(title);
}
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TextView userid= (TextView) view.findViewById(R.id.tv_sender);
String receiver=userid.getText().toString();
String sender =FirebaseAuth.getInstance().getCurrentUser().getUid();
Fragment messageFragment=new MessageFragment();
Bundle b=new Bundle();
b.putString("sender",sender);
b.putString("receiver",receiver);
messageFragment.setArguments(b);
getFragmentManager().beginTransaction().replace(R.id.placeholder,messageFragment).commit();
}
});
DatabaseReference reference= FirebaseDatabase.getInstance().getReference("Messages");
reference.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s)
{
Message message=dataSnapshot.getValue(Message.class);
if(title.equals("Inbox")) {
if (FirebaseAuth.getInstance().getCurrentUser().getUid().equals(message.getReceiver())) {
list.add(message);
adapter.notifyDataSetChanged();
}
}
else
{
if(FirebaseAuth.getInstance().getCurrentUser().getUid().equals(message.getSender()))
{
list.add(message);
adapter.notifyDataSetChanged();
}
}
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
listView.setAdapter(adapter);
return view;
}
}
| [
"dineshs723@gmail.com"
] | dineshs723@gmail.com |
57fce1eabea5520a014941fd65cc1c64ac66cbfa | 908d647310f12843c147e1ae6a864a8138c29b0a | /Bedrock/src/main/java/de/marcely/pocketcraft/bedrock/network/packet/action/Action.java | 70e0fc641ce384cec19469a7c64d55fb045e3689 | [] | no_license | MrEAlderson/PocketCraft | ff5088fba74742fe1a90ba038855d7c9ea80761b | 6541327c63fa876d90069e563a2433b9b8ae60b0 | refs/heads/master | 2023-02-02T06:40:20.237462 | 2020-12-21T17:45:59 | 2020-12-21T17:45:59 | 211,562,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 177 | java | package de.marcely.pocketcraft.bedrock.network.packet.action;
public abstract class Action {
public abstract ActionType getType();
public abstract int getHotbarSlot();
}
| [
"Mylogan99@web.de"
] | Mylogan99@web.de |
f8c7f7d6b08ed16e379cff1eb395579ad4f2228d | e75be673baeeddee986ece49ef6e1c718a8e7a5d | /submissions/blizzard/Corpus/eclipse.jdt.ui/9671.java | a12290817af774703c221df1db09e835fe5877ff | [
"MIT"
] | permissive | zhendong2050/fse18 | edbea132be9122b57e272a20c20fae2bb949e63e | f0f016140489961c9e3c2e837577f698c2d4cf44 | refs/heads/master | 2020-12-21T11:31:53.800358 | 2018-07-23T10:10:57 | 2018-07-23T10:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,494 | java | /*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.ui.typehierarchy;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.ui.ITypeHierarchyViewPart;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog;
/**
* Refocuses the type hierarchy on a type selection from a all types dialog.
*/
public class FocusOnTypeAction extends Action {
private ITypeHierarchyViewPart fViewPart;
public FocusOnTypeAction(ITypeHierarchyViewPart part) {
super(TypeHierarchyMessages.FocusOnTypeAction_label);
setDescription(TypeHierarchyMessages.FocusOnTypeAction_description);
setToolTipText(TypeHierarchyMessages.FocusOnTypeAction_tooltip);
fViewPart = part;
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.FOCUS_ON_TYPE_ACTION);
}
/*
* @see Action#run
*/
@Override
public void run() {
Shell parent = fViewPart.getSite().getShell();
FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(parent, false, PlatformUI.getWorkbench().getProgressService(), SearchEngine.createWorkspaceScope(), IJavaSearchConstants.TYPE);
dialog.setTitle(TypeHierarchyMessages.FocusOnTypeAction_dialog_title);
dialog.setMessage(TypeHierarchyMessages.FocusOnTypeAction_dialog_message);
if (dialog.open() != IDialogConstants.OK_ID) {
return;
}
Object[] types = dialog.getResult();
if (types != null && types.length > 0) {
IType type = (IType) types[0];
fViewPart.setInputElement(type);
}
}
}
| [
"tim.menzies@gmail.com"
] | tim.menzies@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.