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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e1e36f100b66d2ad869bbd6762e95e3ef632986a | 6eac73bca37908a541875edd11206d4dcf16abf6 | /EchoServer/src/main/java/bioServer/ClientHandler.java | f5fa5891c36abd67e057d1e59c6e078902402f5a | [] | no_license | yejunyu/nettyLearning | f29d0c0e75296cc88ccee5a78e40decac5389c29 | adadc7ef42e88229dbd31d0715e1de1a8c4973d0 | refs/heads/master | 2022-05-31T08:07:27.942733 | 2022-05-26T10:56:15 | 2022-05-26T10:56:15 | 158,526,303 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,114 | java | package bioServer;
import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
/**
* @author : YeJunyu
* @description :
* @email : [email protected]
* @date : 2020/10/15
*/
public class ClientHandler {
public static final int MAX_DATA_LEN = 1024;
private final Socket socket;
public ClientHandler(Socket socket) {
this.socket = socket;
}
public void start() {
System.out.println("新客户端接入");
new Thread(() -> doStart()).start();
}
public void doStart() {
try {
InputStream inputStream = socket.getInputStream();
while (true) {
byte[] data = new byte[MAX_DATA_LEN];
int len;
while ((len = inputStream.read(data)) != -1) {
String message = new String(data, 0, len);
System.out.println("客户端发来的消息: " + message);
socket.getOutputStream().write(data);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
3846f99d7050c119e7039e6daec61556cc1d15d0 | 7dbb933bb289537021b8d6d40b26fa4d0e97c23f | /leetcodeJava/src/review/No_85_H_Maximal_Rectangle.java | 446f6dce2cbcc368923cf95ad925e10f2c3663cf | [] | no_license | BigMy/BMLeetCode | a0e5071e11da1479109bbd839d4d10b33fbc138f | 46caf65a0b65f039c073b08820a5f1689203a5da | refs/heads/master | 2021-09-10T23:44:57.191117 | 2018-04-04T08:35:59 | 2018-04-04T08:35:59 | 104,159,986 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package review;
import java.util.Stack;
public class No_85_H_Maximal_Rectangle {
public int maximalRectangle(char[][] matrix) {
if (matrix.length == 0 || matrix[0].length == 0)
return 0;
int rows = matrix.length;
// 转换成 no 84的直方图数组
int[] heights = new int[rows];
int maxArea = 0;
// 每一行
for (int i = 0; i < matrix.length; i ++) {
for (int j = 0; j < matrix[i].length; j ++) {
if (matrix[i][j] == '1')
heights[i] ++;
else
heights[i] = 0;
}
maxArea = Math.max(maxArea, maxHistogramArea(heights));
}
return maxArea;
}
private int maxHistogramArea(int[] h) {
int n = h.length, i = 0, max = 0;
Stack<Integer> stack = new Stack<>();
return max;
}
public static void main(String[] args) {
char[][] matrix = new char[][]{{'1','0','1','0','0'},{'1','0','1','1','1'},{'1','1','1','1','1'},{'1','0','0','1','0'}};
System.out.println(new No_85_H_Maximal_Rectangle().maximalRectangle(matrix));
}
}
| [
"[email protected]"
] | |
2a5e1b3ea2381ef442bc3ba66d88f4339bced33c | cee48a7707ff7e686db14515d0d106978b6015c6 | /api-produtos/src/test/java/com/example/springboot/HelloControllerIT.java | d3c7c3699dff9b2aae2bea94a2bfb067235d1999 | [] | no_license | DemianUlisses/aws-pucminas | 24afdff400046f10a24cb6f94d7b093c874f73b3 | 8f919e0321cfee8bfaaaf44c14558796002580e6 | refs/heads/main | 2023-01-09T08:58:18.332625 | 2020-11-04T22:11:21 | 2020-11-04T22:11:21 | 310,131,593 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,098 | java | package com.example.springboot;
import static org.assertj.core.api.Assertions.*;
import java.net.URL;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.ResponseEntity;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class HelloControllerIT {
@LocalServerPort
private int port;
private URL base;
@Autowired
private TestRestTemplate template;
@BeforeEach
public void setUp() throws Exception {
this.base = new URL("http://localhost:" + port + "/");
}
/*
@Test
public void getHello() throws Exception {
ResponseEntity<String> response = template.getForEntity(base.toString(),
String.class);
assertThat(response.getBody()).isEqualTo("Greetings from Spring Boot!");
}
*/
}
| [
"[email protected]"
] | |
0c01c46111bd6c8d716cfa1981923818754a8dfb | 78696f350faf7362505055f616e530dc0a4735b9 | /statusbar_utils/src/main/java/com/yyp/statusbar/utils/OSUtils.java | 8dc77046149fe06b5a4aa98868868518ecd2beae | [] | no_license | yeaper/StatusBarUtils | b0c850909232eb4c1cb3d22d9af53da18b2dc211 | a07c83683379e6f22c99bed43d22baba9ee85a40 | refs/heads/master | 2020-04-22T03:15:03.374493 | 2019-02-11T09:14:14 | 2019-02-11T09:14:14 | 170,079,658 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,913 | java | package com.yyp.statusbar.utils;
import android.os.Build;
import android.text.TextUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* 系统判定工具
*
* Created by yyp on 2019.02.11
*/
public class OSUtils {
/**
* 手机ROM类型
*/
public static final String ROM_MIUI = "MIUI";
public static final String ROM_EMUI = "EMUI";
public static final String ROM_FLYME = "FLYME";
public static final String ROM_OPPO = "OPPO";
public static final String ROM_SMARTISAN = "SMARTISAN";
public static final String ROM_VIVO = "VIVO";
public static final String ROM_QIKU = "QIKU";
/**
* 手机版本key
*/
private static final String KEY_VERSION_MIUI = "ro.miui.ui.version.name";
private static final String KEY_VERSION_EMUI = "ro.build.version.emui";
private static final String KEY_VERSION_OPPO = "ro.build.version.opporom";
private static final String KEY_VERSION_SMARTISAN = "ro.smartisan.version";
private static final String KEY_VERSION_VIVO = "ro.vivo.os.version";
private static String sName;
private static String sVersion;
public static boolean isEmui() {
return check(ROM_EMUI);
}
public static boolean isMiui() {
return check(ROM_MIUI);
}
public static boolean isVivo() {
return check(ROM_VIVO);
}
public static boolean isOppo() {
return check(ROM_OPPO);
}
public static boolean isFlyme() {
return check(ROM_FLYME);
}
public static boolean is360() {
return check(ROM_QIKU) || check("360");
}
public static boolean isSmartisan() {
return check(ROM_SMARTISAN);
}
public static String getName() {
if (sName == null) {
check("");
}
return sName;
}
public static String getVersion() {
if (sVersion == null) {
check("");
}
return sVersion;
}
/**
* 根据version获取系统rom名进行对比
*
* @param rom rom名
* @return 是否对应系统rom
*/
public static boolean check(String rom) {
if (sName != null) {
return sName.equals(rom);
}
if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
sName = ROM_MIUI;
} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
sName = ROM_EMUI;
} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
sName = ROM_OPPO;
} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
sName = ROM_VIVO;
} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
sName = ROM_SMARTISAN;
} else {
sVersion = Build.DISPLAY;
if (sVersion.toUpperCase().contains(ROM_FLYME)) {
sName = ROM_FLYME;
} else {
sVersion = Build.UNKNOWN;
sName = Build.MANUFACTURER.toUpperCase();
}
}
return sName.equals(rom);
}
/**
* 通过命令获取对应属性
*
* @param name 属性名
* @return
*/
public static String getProp(String name) {
String line;
BufferedReader input = null;
try {
Process p = Runtime.getRuntime().exec("getprop " + name);
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
line = input.readLine();
input.close();
} catch (IOException ex) {
return null;
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return line;
}
} | [
"[email protected]"
] | |
f82c6220c34146de092013623c471ec375c4e0d4 | 53f5a941261609775dc3eedf0cb487956b734ab0 | /com.samsung.accessory.atticmgr/sources/com/samsung/accessory/hearablemgr/module/notification/NotificationListAdapter.java | 151a6a52243d1d9ee886f3da58604895412358bf | [] | no_license | ThePBone/BudsProAnalysis | 4a3ede6ba6611cc65598d346b5a81ea9c33265c0 | 5b04abcae98d1ec8d35335d587b628890383bb44 | refs/heads/master | 2023-02-18T14:24:57.731752 | 2021-01-17T12:44:58 | 2021-01-17T12:44:58 | 322,783,234 | 16 | 1 | null | null | null | null | UTF-8 | Java | false | false | 16,710 | java | package com.samsung.accessory.hearablemgr.module.notification;
import android.app.Activity;
import android.content.Context;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.widget.SwitchCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.samsung.accessory.atticmgr.R;
import com.samsung.accessory.hearablemgr.common.preference.PreferenceKey;
import com.samsung.accessory.hearablemgr.common.preference.Preferences;
import com.samsung.accessory.hearablemgr.common.ui.OnSingleClickListener;
import com.samsung.accessory.hearablemgr.common.util.Util;
import com.samsung.accessory.hearablemgr.core.bigdata.SamsungAnalyticsUtil;
import com.samsung.accessory.hearablemgr.core.notification.NotificationAppData;
import com.samsung.accessory.hearablemgr.core.notification.NotificationConstants;
import com.samsung.accessory.hearablemgr.core.notification.NotificationManager;
import com.samsung.accessory.hearablemgr.core.notification.NotificationUtil;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import seccompat.android.util.Log;
public class NotificationListAdapter extends RecyclerView.Adapter<RecyclerViewHolder> implements Filterable {
private static final String TAG = "Attic_NotificationListAdapter";
private boolean enable = true;
private Activity mActivity;
private ArrayList<NotificationAppData> mAppList;
private Context mContext;
private ICheckedNotificationApp mListener;
private String mSearchText;
private ArrayList<NotificationAppData> originalAppList;
public interface ICheckedNotificationApp {
void onChangeSearchList(int i);
void onClickAppSettingDetail(NotificationAppData notificationAppData);
void setCheckedApp(int i);
}
public NotificationListAdapter(Context context, ArrayList<NotificationAppData> arrayList, ICheckedNotificationApp iCheckedNotificationApp) {
this.mActivity = (Activity) context;
this.mAppList = arrayList;
this.mListener = iCheckedNotificationApp;
this.mContext = context;
}
public ArrayList<NotificationAppData> getList() {
return this.mAppList;
}
public void setList(ArrayList<NotificationAppData> arrayList) {
this.mAppList = arrayList;
this.originalAppList = arrayList;
}
public void setEnable(boolean z) {
this.enable = z;
notifyDataSetChanged();
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public RecyclerViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
return new RecyclerViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_notification_list, viewGroup, false));
}
public void onBindViewHolder(RecyclerViewHolder recyclerViewHolder, int i) {
recyclerViewHolder.appDescription.setVisibility(0);
recyclerViewHolder.appDescription2.setVisibility(0);
recyclerViewHolder.switccDivider.setVisibility(0);
recyclerViewHolder.switchlayout.setVisibility(0);
if (!(getCount() == 0 || this.mAppList.get(i) == null)) {
recyclerViewHolder.appIcon.setImageDrawable(NotificationManager.getImageIcon(this.mContext, this.mAppList.get(i).getPackageName(), this.mAppList.get(i).isDual(), this.mAppList.get(i).getuId()));
recyclerViewHolder.appName.setText(getSearchKeywordColorSpan(this.mAppList.get(i).getAppName(), this.mSearchText));
recyclerViewHolder.selectApp.setContentDescription(this.mAppList.get(i).getAppName());
setSubtext(i, recyclerViewHolder);
recyclerViewHolder.appDescription.setVisibility(8);
String packageName = this.mAppList.get(i).getPackageName();
boolean isAppNotificationEnabled = NotificationUtil.isAppNotificationEnabled(packageName);
recyclerViewHolder.selectApp.setChecked(isAppNotificationEnabled);
this.mAppList.get(i).setEnable(isAppNotificationEnabled);
if (Util.isTalkBackEnabled()) {
recyclerViewHolder.selectApp.setFocusable(false);
recyclerViewHolder.selectApp.setClickable(false);
} else {
recyclerViewHolder.selectApp.setFocusable(true);
recyclerViewHolder.selectApp.setClickable(true);
}
Log.d(TAG, "getView() : mAppList :: position =" + i + " packageName = " + packageName + " isAppNotificationEnabled() = " + isAppNotificationEnabled + " Desc. Setting = " + recyclerViewHolder.appDescription.getText().toString() + "/" + recyclerViewHolder.appDescription2.getText().toString());
}
if (i == getCount() - 1) {
recyclerViewHolder.divider.setVisibility(8);
} else {
recyclerViewHolder.divider.setVisibility(0);
}
setEnableView(recyclerViewHolder, this.enable, false);
if (!NotificationUtil.semAreNotificationsEnabledForPackage(this.mAppList.get(i).getPackageName(), this.mAppList.get(i).isDual(), this.mAppList.get(i).getuId())) {
if (this.enable) {
setEnableView(recyclerViewHolder, false, true);
}
recyclerViewHolder.appDescription2.setText(R.string.blocked_on_phone);
}
}
private void setEnableView(RecyclerViewHolder recyclerViewHolder, boolean z, boolean z2) {
recyclerViewHolder.listlayout.setEnabled(z);
if (z2) {
recyclerViewHolder.switchlayout.setVisibility(z ? 0 : 8);
} else {
recyclerViewHolder.switchlayout.setEnabled(z);
}
recyclerViewHolder.selectApp.setEnabled(z);
recyclerViewHolder.appName.setEnabled(z);
recyclerViewHolder.appDescription.setEnabled(z);
recyclerViewHolder.appDescription2.setEnabled(z);
ColorMatrix colorMatrix = new ColorMatrix();
colorMatrix.setSaturation(z ? 1.0f : 0.0f);
recyclerViewHolder.appIcon.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public long getItemId(int i) {
return (long) this.mAppList.get(i).getAppName().hashCode();
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public int getItemCount() {
ArrayList<NotificationAppData> arrayList = this.mAppList;
if (arrayList != null) {
return arrayList.size();
}
return 0;
}
public int getCount() {
ArrayList<NotificationAppData> arrayList = this.mAppList;
if (arrayList != null) {
return arrayList.size();
}
return 0;
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private int calcMaxWidthForAppName() {
return this.mActivity.getApplicationContext().getResources().getDisplayMetrics().widthPixels - convertDipToPixels(114.0f);
}
private int convertDipToPixels(float f) {
return (int) ((f * this.mActivity.getResources().getDisplayMetrics().density) + 0.5f);
}
public int getCheckedCount() {
Log.d(TAG, "getCheckedCount()");
int i = 0;
for (int i2 = 0; i2 < getCount(); i2++) {
if (this.mAppList.get(i2).isEnable()) {
i++;
}
}
return i;
}
public Filter getFilter() {
return new Filter() {
/* class com.samsung.accessory.hearablemgr.module.notification.NotificationListAdapter.AnonymousClass1 */
/* access modifiers changed from: protected */
public Filter.FilterResults performFiltering(CharSequence charSequence) {
ArrayList arrayList = new ArrayList();
if (TextUtils.isEmpty(charSequence.toString())) {
arrayList = NotificationListAdapter.this.originalAppList;
} else {
Iterator it = NotificationListAdapter.this.originalAppList.iterator();
while (it.hasNext()) {
NotificationAppData notificationAppData = (NotificationAppData) it.next();
if (notificationAppData.getAppName().toLowerCase().contains(charSequence.toString().toLowerCase())) {
arrayList.add(notificationAppData);
}
}
}
Filter.FilterResults filterResults = new Filter.FilterResults();
filterResults.values = arrayList;
filterResults.count = arrayList.size();
return filterResults;
}
/* access modifiers changed from: protected */
public void publishResults(CharSequence charSequence, Filter.FilterResults filterResults) {
NotificationListAdapter.this.mAppList = (ArrayList) filterResults.values;
NotificationListAdapter.this.mSearchText = charSequence.toString();
NotificationListAdapter.this.notifyDataSetChanged();
NotificationListAdapter.this.mListener.onChangeSearchList(NotificationListAdapter.this.mAppList.size());
}
};
}
public class RecyclerViewHolder extends RecyclerView.ViewHolder {
public TextView appDescription;
public TextView appDescription2;
public ImageView appIcon;
public TextView appName;
public View divider;
public View listlayout;
public SwitchCompat selectApp;
public View switccDivider;
public View switchlayout;
public RecyclerViewHolder viewHolder = this;
public RecyclerViewHolder(View view) {
super(view);
this.listlayout = (LinearLayout) view.findViewById(R.id.notifiation_list);
this.switchlayout = (LinearLayout) view.findViewById(R.id.switch_layout);
this.switccDivider = view.findViewById(R.id.switch_divider);
this.selectApp = (SwitchCompat) view.findViewById(R.id.noti_listview_cb);
this.appIcon = (ImageView) view.findViewById(R.id.listview_iconimg);
this.appName = (TextView) view.findViewById(R.id.textview1);
this.appName.setSelected(true);
this.appDescription = (TextView) view.findViewById(R.id.textview2_second);
this.appDescription.setSelected(true);
this.appDescription2 = (TextView) view.findViewById(R.id.textview3);
this.appDescription2.setSelected(true);
this.appName.setMaxWidth(NotificationListAdapter.this.calcMaxWidthForAppName());
this.divider = view.findViewById(R.id.divider);
this.listlayout.setOnClickListener(new OnSingleClickListener(NotificationListAdapter.this) {
/* class com.samsung.accessory.hearablemgr.module.notification.NotificationListAdapter.RecyclerViewHolder.AnonymousClass1 */
@Override // com.samsung.accessory.hearablemgr.common.ui.OnSingleClickListener
public void onSingleClick(View view) {
NotificationListAdapter.this.mListener.onClickAppSettingDetail((NotificationAppData) NotificationListAdapter.this.mAppList.get(RecyclerViewHolder.this.getAdapterPosition()));
}
});
this.switchlayout.setOnClickListener(new View.OnClickListener(NotificationListAdapter.this) {
/* class com.samsung.accessory.hearablemgr.module.notification.NotificationListAdapter.RecyclerViewHolder.AnonymousClass2 */
public void onClick(View view) {
RecyclerViewHolder.this.selectApp.setChecked(!RecyclerViewHolder.this.selectApp.isChecked());
}
});
this.selectApp.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(NotificationListAdapter.this) {
/* class com.samsung.accessory.hearablemgr.module.notification.NotificationListAdapter.RecyclerViewHolder.AnonymousClass3 */
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
int adapterPosition = RecyclerViewHolder.this.getAdapterPosition();
Log.d(NotificationListAdapter.TAG, "list clicked." + adapterPosition);
try {
NotificationAppData notificationAppData = (NotificationAppData) NotificationListAdapter.this.mAppList.get(adapterPosition);
notificationAppData.setEnable(z);
if (NotificationListAdapter.this.mListener != null) {
NotificationListAdapter.this.mListener.setCheckedApp(adapterPosition);
}
NotificationListAdapter.this.setSubtext(adapterPosition, RecyclerViewHolder.this.viewHolder);
StringBuilder sb = new StringBuilder();
sb.append(z ? "1" : "0");
sb.append(" ");
sb.append(notificationAppData.getPackageName());
SamsungAnalyticsUtil.setStatusString("6672", sb.toString());
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
});
}
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
private void setSubtext(int i, RecyclerViewHolder recyclerViewHolder) {
String str;
String str2;
boolean equals = this.mAppList.get(i).getPackageName().equals(NotificationConstants.INCOMING_CALL_PACKAGENAME);
int i2 = R.string.voice_notification_details01;
if (equals) {
if (NotificationUtil.getAppNotificationDetails(this.mAppList.get(i).getPackageName()).equals(NotificationConstants.NOTIFICATION_TYPE_SUMMARY)) {
str = "" + this.mContext.getString(R.string.voice_notification_details01) + ", ";
} else {
str = "" + this.mContext.getString(R.string.voice_notification_details02) + ", ";
}
if (Preferences.getBoolean(PreferenceKey.NOTIFICATION_CALL_REPEAT, true)) {
str2 = str + this.mContext.getString(R.string.repeat_once);
} else {
str2 = str + this.mContext.getString(R.string.do_not_repeat);
}
if (this.mAppList.get(i).isEnable()) {
recyclerViewHolder.appDescription2.setText(str2);
} else {
recyclerViewHolder.appDescription2.setText(R.string.menu_not_read_aloud);
}
if (NotificationUtil.isSupportSpeakCallerName()) {
recyclerViewHolder.appDescription2.setVisibility(8);
recyclerViewHolder.switccDivider.setVisibility(4);
}
} else if (this.mAppList.get(i).isEnable()) {
TextView textView = recyclerViewHolder.appDescription2;
if (!NotificationUtil.getAppNotificationDetails(this.mAppList.get(i).getPackageName()).equals(NotificationConstants.NOTIFICATION_TYPE_SUMMARY)) {
i2 = R.string.voice_notification_details02;
}
textView.setText(i2);
} else {
recyclerViewHolder.appDescription2.setText(R.string.menu_not_read_aloud);
}
}
private SpannableString getSearchKeywordColorSpan(String str, String str2) {
SpannableString spannableString = new SpannableString(str);
if (!TextUtils.isEmpty(str2)) {
Matcher matcher = Pattern.compile(str2.toLowerCase()).matcher(str.toLowerCase());
while (matcher.find()) {
spannableString.setSpan(new ForegroundColorSpan(this.mContext.getResources().getColor(R.color.colorPrimary)), matcher.start(), matcher.end(), 33);
}
}
return spannableString;
}
}
| [
"[email protected]"
] | |
d254d3d3e813ef2401477c5c067d4fe17cf69d72 | 44e7adc9a1c5c0a1116097ac99c2a51692d4c986 | /aws-java-sdk-chime/src/main/java/com/amazonaws/services/chime/model/transform/DeleteSipRuleResultJsonUnmarshaller.java | 1aa8bced16cea94832377fe57109b764c00f1351 | [
"Apache-2.0"
] | permissive | QiAnXinCodeSafe/aws-sdk-java | f93bc97c289984e41527ae5bba97bebd6554ddbe | 8251e0a3d910da4f63f1b102b171a3abf212099e | refs/heads/master | 2023-01-28T14:28:05.239019 | 2020-12-03T22:09:01 | 2020-12-03T22:09:01 | 318,460,751 | 1 | 0 | Apache-2.0 | 2020-12-04T10:06:51 | 2020-12-04T09:05:03 | null | UTF-8 | Java | false | false | 1,597 | java | /*
* Copyright 2015-2020 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.chime.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.chime.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* DeleteSipRuleResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteSipRuleResultJsonUnmarshaller implements Unmarshaller<DeleteSipRuleResult, JsonUnmarshallerContext> {
public DeleteSipRuleResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DeleteSipRuleResult deleteSipRuleResult = new DeleteSipRuleResult();
return deleteSipRuleResult;
}
private static DeleteSipRuleResultJsonUnmarshaller instance;
public static DeleteSipRuleResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new DeleteSipRuleResultJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
05771e269bf7b32b8a5b69c134f67226044ff431 | c642a1ef93e2c482adad9e98e757a910d17ff817 | /ASU CST200 Core Data Structures 46120/Chapter 2 Programs/GasMileage.java | 31045d312f31ee0aba2bb6f53c0e4548a6657163 | [] | no_license | unfit-raven/yolo-octo | e31a7d9799437ea1c7a04213cafa454e4cd929d4 | 92ce16e9ac9c052e2904254f2609037da1320c18 | refs/heads/master | 2016-09-05T18:41:05.329493 | 2015-07-14T10:11:37 | 2015-07-14T10:11:37 | 32,855,415 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | // GasMileage.java Java Foundations
//
// Demonstrates the use of the Scanner class to read numeric data
import java.util.Scanner;
public class GasMileage
{
// Calculates fuel efficiency based on values entered by
// the user
public static void main(String [] args)
{
int miles;
float gallons, mpg;
Scanner scan = new Scanner(System.in);
System.out.print("Enter the number of miles: ");
miles = scan.nextInt();
System.out.print("Enter the gallons of fuel used: ");
gallons = scan.nextFloat();
mpg = miles / gallons;
System.out.println("Miles Per Gallon: " + mpg);
}
} | [
"[email protected]"
] | |
5d9b97f391d9c546a6183522c8b6545b1cfb4132 | deecddd8d88d0fd630d17806e0713917d3534aac | /src/View/Main.java | 581374c984643954f0be2d253e025fe2c2219a43 | [] | no_license | miguelRivera130/ParcialUno | 333704a663095ab346ad9ab1fe2b32b4422b6951 | 89e8e94fc78f641dc069ce93a312157b9ad1ca60 | refs/heads/master | 2021-05-21T23:03:31.531335 | 2020-04-03T21:41:06 | 2020-04-03T21:41:06 | 252,847,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 510 | java | package View;
import Controller.ControllerMain;
import processing.core.PApplet;
public class Main extends PApplet {
private ControllerMain controllerMain;
public static void main(String[] args) {
PApplet.main(Main.class.getName());
}
public void settings() {
size(800, 600);
}
public void setup() {
controllerMain = new ControllerMain(this);
}
public void draw() {
background(0);
controllerMain.pintar();
}
public void keyPressed() {
controllerMain.sortList(key);
}
} | [
"[email protected]"
] | |
306817446ba0d5504ef5894bb52ae9badd33e4ee | 3c54417d67baadd4ec44ab102fb87f0660895083 | /src/lesson30_1501/MyLovelyPalindrome.java | 56e2990738de144433bbf826fcf5875819d08e2c | [] | no_license | SaidaBuewendt/javaM1-16 | 2e20b4d94ab665bedea4a5ff6124aeea3c91d8fc | 229e4c7ebac8a26296c0cd1ba44ede3146776650 | refs/heads/main | 2023-02-21T10:12:42.708108 | 2021-01-24T09:23:34 | 2021-01-24T09:23:34 | 327,370,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,535 | java | package lesson30_1501;
public class MyLovelyPalindrome {
public static void main(String[] args) {
/*
Написать свой метод проверки строки на палиндром.
Учесть, что палиндром может быть предложением с пробелами.
При решении задачи используйте цикл.
Нельзя использовать методы replace(), reverse() и конструкции, которые вы не учили.
*/
System.out.println(checkPalindrome("А роза упала на лапу Азора")); //-> true
System.out.println(checkPalindrome("поп")); //-> true
System.out.println(checkPalindrome("школа"));//-> false
}
private static boolean checkPalindrome(String word) {
String input = word;
input = word.toLowerCase();
input = deleteSpace(input);
String output = wordReverse(input);
return input.equals(output);
}
private static String deleteSpace(String input) {
String output = "";
for (int i = 0; i < input.length(); i++) {
if (input.charAt(i) != ' ') {
output = output + input.charAt(i);
}
}
return output;
}
private static String wordReverse(String input) {
String result = "";
for (int i = 0; i < input.length(); i++) {
result = input.charAt(i) + result;
}
return result;
}
}
| [
"[email protected]"
] | |
44c852cc8edbc668e2c71b3ad516fab3888fc328 | e523858cc38870d3f19e9ce8347d6f149b784b72 | /src/main/java/com/laptrinhjavaweb/dao/impl/RoleDAO.java | ddfa353cdfe137d1240d6ea143765d4c3fc374e6 | [] | no_license | nhulq98/authorization-by-rbac-model | 5c6af56418cda6db99f012177d7e51c486c8784d | 4e4049c9c0844fb02319c9f13e03a30dda1f83eb | refs/heads/main | 2023-08-23T12:52:31.792381 | 2021-11-03T12:29:26 | 2021-11-03T12:29:26 | 415,790,132 | 2 | 0 | null | 2021-11-03T12:29:27 | 2021-10-11T05:29:40 | JavaScript | UTF-8 | Java | false | false | 2,846 | java | package com.laptrinhjavaweb.dao.impl;
import com.laptrinhjavaweb.dao.interf.IRoleDAO;
import com.laptrinhjavaweb.mapper.RoleMapper;
import com.laptrinhjavaweb.model.RoleModel;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;
public class RoleDAO extends AbtractDAO<RoleModel> implements IRoleDAO {
private String TBLROLES = "roles";
private String TBLROLES_COLUM_ID = "id";
private String TBLROLES_COLUM_NAME = "name";
private String TBLROLES_COLUM_CODE = "code";
private Connection connection;
private PreparedStatement prStatement;
private ResultSet resultSet;
@Override
public List<RoleModel> findAll() {
String sql_select = "SELECT * FROM roles" ;
return query(sql_select, new RoleMapper());
}
@Override
public void insert(RoleModel roleModel) {
String sql_insert = "INSERT into roles" +
"(name, code, created_date, modified_date, created_by, modified_by)" +
" values(?, ?, ?, ?, ?, ?);";
// get data from roleModel then add into database
long result = insert(sql_insert, roleModel.getName(),
roleModel.getCode(), roleModel.getCreatedDate(),
roleModel.getModifiedDate(), roleModel.getCreatedBy(), roleModel.getModifiedBy());
notification(result);
}
@Override
public void updateById(RoleModel roleModel) {
String sql_update = "UPDATE tblroles " +
"SET name=?, code=?," +
" created_date=?, modified_date=?, created_by=?, modified_by=?" +
"WHERE id=?";
update(sql_update, roleModel.getName(),
roleModel.getCode(), roleModel.getCreatedDate(),
roleModel.getModifiedDate(), roleModel.getCreatedBy(),
roleModel.getModifiedBy(), roleModel.getId());;
}
@Override
public void deleteById(RoleModel roleModel) {
String sql_delete = "DELETE FROM " + TBLROLES + " WHERE id = ?;";
update(sql_delete, roleModel.getId());
}
public static void main(String[] args) {
RoleDAO roleDAO = new RoleDAO();
// List<RoleModel> roleModels = roleDAO.findAll();
// for(RoleModel roleModel : roleModels){
// System.out.println(roleModel.getName());
// }
RoleModel roleModel1 = new RoleModel();
roleModel1.setId(3);
roleModel1.setCode("user-admin");
roleModel1.setName("quan tri");
//roleDAO.deleteById(roleModel1);
roleDAO.insert(roleModel1);
RoleModel roleModel2 = new RoleModel();
roleModel2.setId(4);
roleModel2.setCode("user-user");
roleModel2.setName("nguoi dung");
//roleDAO.deleteById(roleModel2);
roleDAO.insert(roleModel2);
}
}
| [
"[email protected]"
] | |
b3617fe77e2e5bfaa18f047b2737a63f3f98f1fc | f5545fe6ae7f73beb4ef96ea1c66b1974e989b25 | /app/src/main/java/com/example/smartmechanic/smart_mechanic/Model/RatingRequest.java | 177aafb99005be4f9b7fac95c46b73496071bc28 | [] | no_license | wnipuna/Mechanic | 2013fa88a6473002b8290525291b7b66af2beedc | ec6f650f56e8a4a17aecd8a04546bca6224cd9e7 | refs/heads/master | 2020-03-23T22:12:06.976186 | 2019-04-14T12:16:32 | 2019-04-14T12:16:32 | 142,160,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,179 | java | package com.example.smartmechanic.smart_mechanic.Model;
public class RatingRequest {
private String Username;
private String Password;
private String Name;
private String Address;
private String Phone;
private String IsStaff;
private String NIC;
private String Email;
private String VehicleNumber;
private String Type;
public RatingRequest() {
}
public RatingRequest(String username, String password, String name, String address, String nic, String email, String vNumber, String type) {
Username = username;
Password = password;
Name = name;
Address = address;
NIC=nic;
IsStaff = "false";
Email = email;
VehicleNumber = vNumber;
Type = type;
}
public String getNIC() {
return NIC;
}
public void setNIC(String NIC) {
this.NIC = NIC;
}
public String getIsStaff() {
return IsStaff;
}
public void setIsStaff(String isStaff) {
IsStaff = isStaff;
}
public String getPhone() {
return Phone;
}
public void setPhone(String phone) {
Phone = phone;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public String getAddress() {
return Address;
}
public void setAddress(String address) {
Address = address;
}
public String getUsername() {
return Username;
}
public void setUsername(String username) {
Username = username;
}
public String getPassword() {
return Password;
}
public void setPassword(String password) {
Password = password;
}
public String getEmail() {
return Email;
}
public void setEmail(String email) {
Email = email;
}
public String getVehicleNumber() {
return VehicleNumber;
}
public void setVehicleNumber(String vehicleNumber) {
VehicleNumber = vehicleNumber;
}
public String getType() {
return Type;
}
public void setType(String type) {
Type = type;
}
}
| [
"[email protected]"
] | |
8ba74a6421923749d5a16bd6ad307ec1635f58b5 | 87f49d587cc71a3afa1010d688123ca51a9aabeb | /sample/src/main/java/com/stfalcon/sample/video/EasyVideoPlayer.java | c3beff2cb6f17da989adc1bfd3ca4ba4727b4cb8 | [
"Apache-2.0"
] | permissive | AlexanderBuyko/StfalconImageViewer | 27f030117231aa3f0b1ebfcb70f21dea9d793e56 | c000f63f2efcd20878bc3e81560adaaa6eb8d9d9 | refs/heads/master | 2020-07-21T02:40:59.568347 | 2020-04-02T10:23:15 | 2020-04-02T10:23:15 | 206,737,161 | 2 | 0 | Apache-2.0 | 2019-09-06T07:21:57 | 2019-09-06T07:21:57 | null | UTF-8 | Java | false | false | 39,485 | java | package com.stfalcon.sample.video;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.PorterDuff;
import android.graphics.SurfaceTexture;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import androidx.annotation.CheckResult;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.FloatRange;
import androidx.annotation.IntDef;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.view.ViewCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Surface;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.SeekBar;
import android.widget.TextView;
import com.stfalcon.sample.R;
import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* @author Aidan Follestad (afollestad)
*/
public class EasyVideoPlayer extends FrameLayout implements IUserMethods, TextureView.SurfaceTextureListener,
MediaPlayer.OnPreparedListener, MediaPlayer.OnBufferingUpdateListener, MediaPlayer.OnCompletionListener,
MediaPlayer.OnVideoSizeChangedListener, MediaPlayer.OnErrorListener, View.OnClickListener, SeekBar.OnSeekBarChangeListener {
@IntDef({LEFT_ACTION_NONE, LEFT_ACTION_RESTART, LEFT_ACTION_RETRY})
@Retention(RetentionPolicy.SOURCE)
public @interface LeftAction {
}
@IntDef({RIGHT_ACTION_NONE, RIGHT_ACTION_SUBMIT, RIGHT_ACTION_CUSTOM_LABEL})
@Retention(RetentionPolicy.SOURCE)
public @interface RightAction {
}
public static final int LEFT_ACTION_NONE = 0;
public static final int LEFT_ACTION_RESTART = 1;
public static final int LEFT_ACTION_RETRY = 2;
public static final int RIGHT_ACTION_NONE = 3;
public static final int RIGHT_ACTION_SUBMIT = 4;
public static final int RIGHT_ACTION_CUSTOM_LABEL = 5;
private static final int UPDATE_INTERVAL = 100;
public EasyVideoPlayer(Context context) {
super(context);
init(context, null);
}
public EasyVideoPlayer(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
public EasyVideoPlayer(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs);
}
private TextureView mTextureView;
private Surface mSurface;
private View mControlsFrame;
private View mProgressFrame;
private View mClickFrame;
private SeekBar mSeeker;
private TextView mLabelPosition;
private TextView mLabelDuration;
private ImageButton mBtnRestart;
private TextView mBtnRetry;
private ImageButton mBtnPlayPause;
private TextView mBtnSubmit;
private TextView mLabelCustom;
private TextView mLabelBottom;
private MediaPlayer mPlayer;
private boolean mSurfaceAvailable;
private boolean mIsPrepared;
private boolean mWasPlaying;
private int mInitialTextureWidth;
private int mInitialTextureHeight;
private Handler mHandler;
private Uri mSource;
private EasyVideoCallback mCallback;
private EasyVideoProgressCallback mProgressCallback;
@LeftAction
private int mLeftAction = LEFT_ACTION_RESTART;
@RightAction
private int mRightAction = RIGHT_ACTION_NONE;
private CharSequence mRetryText;
private CharSequence mSubmitText;
private Drawable mRestartDrawable;
private Drawable mPlayDrawable;
private Drawable mPauseDrawable;
private CharSequence mCustomLabelText;
private CharSequence mBottomLabelText;
private boolean mHideControlsOnPlay = true;
private boolean mAutoPlay;
private int mInitialPosition = -1;
private boolean mControlsDisabled;
private int mThemeColor = 0;
private boolean mAutoFullscreen = false;
private boolean mLoop = false;
// Runnable used to run code on an interval to update counters and seeker
private final Runnable mUpdateCounters = new Runnable() {
@Override
public void run() {
if (mHandler == null || !mIsPrepared || mSeeker == null || mPlayer == null)
return;
int pos = mPlayer.getCurrentPosition();
final int dur = mPlayer.getDuration();
if (pos > dur) pos = dur;
mLabelPosition.setText(Util.getDurationString(pos, false));
mLabelDuration.setText(Util.getDurationString(dur - pos, true));
mSeeker.setProgress(pos);
mSeeker.setMax(dur);
if (mProgressCallback != null)
mProgressCallback.onVideoProgressUpdate(pos, dur);
if (mHandler != null)
mHandler.postDelayed(this, UPDATE_INTERVAL);
}
};
private void init(Context context, AttributeSet attrs) {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
setBackgroundColor(Color.BLACK);
if (attrs != null) {
TypedArray a = context.getTheme().obtainStyledAttributes(
attrs,
R.styleable.EasyVideoPlayer,
0, 0);
try {
String source = a.getString(R.styleable.EasyVideoPlayer_evp_source);
if (source != null && !source.trim().isEmpty())
mSource = Uri.parse(source);
//noinspection WrongConstant
mLeftAction = a.getInteger(R.styleable.EasyVideoPlayer_evp_leftAction, LEFT_ACTION_RESTART);
//noinspection WrongConstant
mRightAction = a.getInteger(R.styleable.EasyVideoPlayer_evp_rightAction, RIGHT_ACTION_NONE);
mCustomLabelText = a.getText(R.styleable.EasyVideoPlayer_evp_customLabelText);
mRetryText = a.getText(R.styleable.EasyVideoPlayer_evp_retryText);
mSubmitText = a.getText(R.styleable.EasyVideoPlayer_evp_submitText);
mBottomLabelText = a.getText(R.styleable.EasyVideoPlayer_evp_bottomText);
int restartDrawableResId = a.getResourceId(R.styleable.EasyVideoPlayer_evp_restartDrawable, -1);
int playDrawableResId = a.getResourceId(R.styleable.EasyVideoPlayer_evp_playDrawable, -1);
int pauseDrawableResId = a.getResourceId(R.styleable.EasyVideoPlayer_evp_pauseDrawable, -1);
if (restartDrawableResId != -1) {
mRestartDrawable = AppCompatResources.getDrawable(context, restartDrawableResId);
}
if (playDrawableResId != -1) {
mPlayDrawable = AppCompatResources.getDrawable(context, playDrawableResId);
}
if (pauseDrawableResId != -1) {
mPauseDrawable = AppCompatResources.getDrawable(context, pauseDrawableResId);
}
mHideControlsOnPlay = a.getBoolean(R.styleable.EasyVideoPlayer_evp_hideControlsOnPlay, true);
mAutoPlay = a.getBoolean(R.styleable.EasyVideoPlayer_evp_autoPlay, false);
mControlsDisabled = a.getBoolean(R.styleable.EasyVideoPlayer_evp_disableControls, false);
mThemeColor = a.getColor(R.styleable.EasyVideoPlayer_evp_themeColor,
Util.resolveColor(context, R.attr.colorPrimary));
mAutoFullscreen = a.getBoolean(R.styleable.EasyVideoPlayer_evp_autoFullscreen, false);
mLoop = a.getBoolean(R.styleable.EasyVideoPlayer_evp_loop, false);
} finally {
a.recycle();
}
} else {
mLeftAction = LEFT_ACTION_RESTART;
mRightAction = RIGHT_ACTION_NONE;
mHideControlsOnPlay = true;
mAutoPlay = false;
mControlsDisabled = false;
mThemeColor = Util.resolveColor(context, R.attr.colorPrimary);
mAutoFullscreen = false;
mLoop = false;
}
if (mRetryText == null)
mRetryText = context.getResources().getText(R.string.evp_retry);
if (mSubmitText == null)
mSubmitText = context.getResources().getText(R.string.evp_submit);
if (mRestartDrawable == null)
mRestartDrawable = AppCompatResources.getDrawable(context, R.drawable.evp_action_restart);
if (mPlayDrawable == null)
mPlayDrawable = AppCompatResources.getDrawable(context, R.drawable.evp_action_play);
if (mPauseDrawable == null)
mPauseDrawable = AppCompatResources.getDrawable(context, R.drawable.evp_action_pause);
}
@Override
public void setSource(@NonNull Uri source) {
boolean hadSource = mSource != null;
if (hadSource) stop();
mSource = source;
if (mPlayer != null) {
if (hadSource) {
sourceChanged();
} else {
prepare();
}
}
}
@Override
public void setCallback(@NonNull EasyVideoCallback callback) {
mCallback = callback;
}
@Override
public void setProgressCallback(@NonNull EasyVideoProgressCallback callback) {
mProgressCallback = callback;
}
@Override
public void setLeftAction(@LeftAction int action) {
if (action < LEFT_ACTION_NONE || action > LEFT_ACTION_RETRY)
throw new IllegalArgumentException("Invalid left action specified.");
mLeftAction = action;
invalidateActions();
}
@Override
public void setRightAction(@RightAction int action) {
if (action < RIGHT_ACTION_NONE || action > RIGHT_ACTION_CUSTOM_LABEL)
throw new IllegalArgumentException("Invalid right action specified.");
mRightAction = action;
invalidateActions();
}
@Override
public void setCustomLabelText(@Nullable CharSequence text) {
mCustomLabelText = text;
mLabelCustom.setText(text);
setRightAction(RIGHT_ACTION_CUSTOM_LABEL);
}
@Override
public void setCustomLabelTextRes(@StringRes int textRes) {
setCustomLabelText(getResources().getText(textRes));
}
@Override
public void setBottomLabelText(@Nullable CharSequence text) {
mBottomLabelText = text;
mLabelBottom.setText(text);
if (text == null || text.toString().trim().length() == 0)
mLabelBottom.setVisibility(View.GONE);
else mLabelBottom.setVisibility(View.VISIBLE);
}
@Override
public void setBottomLabelTextRes(@StringRes int textRes) {
setBottomLabelText(getResources().getText(textRes));
}
@Override
public void setRetryText(@Nullable CharSequence text) {
mRetryText = text;
mBtnRetry.setText(text);
}
@Override
public void setRetryTextRes(@StringRes int res) {
setRetryText(getResources().getText(res));
}
@Override
public void setSubmitText(@Nullable CharSequence text) {
mSubmitText = text;
mBtnSubmit.setText(text);
}
@Override
public void setSubmitTextRes(@StringRes int res) {
setSubmitText(getResources().getText(res));
}
@Override
public void setRestartDrawable(@NonNull Drawable drawable) {
mRestartDrawable = drawable;
mBtnRestart.setImageDrawable(drawable);
}
@Override
public void setRestartDrawableRes(@DrawableRes int res) {
setRestartDrawable(AppCompatResources.getDrawable(getContext(), res));
}
@Override
public void setPlayDrawable(@NonNull Drawable drawable) {
mPlayDrawable = drawable;
if (!isPlaying()) mBtnPlayPause.setImageDrawable(drawable);
}
@Override
public void setPlayDrawableRes(@DrawableRes int res) {
setPlayDrawable(AppCompatResources.getDrawable(getContext(), res));
}
@Override
public void setPauseDrawable(@NonNull Drawable drawable) {
mPauseDrawable = drawable;
if (isPlaying()) mBtnPlayPause.setImageDrawable(drawable);
}
@Override
public void setPauseDrawableRes(@DrawableRes int res) {
setPauseDrawable(AppCompatResources.getDrawable(getContext(), res));
}
@Override
public void setThemeColor(@ColorInt int color) {
mThemeColor = color;
invalidateThemeColors();
}
@Override
public void setThemeColorRes(@ColorRes int colorRes) {
setThemeColor(ContextCompat.getColor(getContext(), colorRes));
}
@Override
public void setHideControlsOnPlay(boolean hide) {
mHideControlsOnPlay = hide;
}
@Override
public void setAutoPlay(boolean autoPlay) {
mAutoPlay = autoPlay;
}
@Override
public void setInitialPosition(@IntRange(from = 0, to = Integer.MAX_VALUE) int pos) {
mInitialPosition = pos;
}
private void sourceChanged() {
setControlsEnabled(false);
mSeeker.setProgress(0);
mSeeker.setEnabled(false);
mPlayer.reset();
if (mCallback != null)
mCallback.onPreparing(this);
try {
setSourceInternal();
} catch (IOException e) {
throwError(e);
}
}
private void setSourceInternal() throws IOException {
if (mSource.getScheme() != null &&
(mSource.getScheme().equals("http") || mSource.getScheme().equals("https"))) {
LOG("Loading web URI: " + mSource.toString());
mPlayer.setDataSource(mSource.toString());
} else if (mSource.getScheme() != null && (mSource.getScheme().equals("file") && mSource.getPath().contains("/android_assets/"))) {
LOG("Loading assets URI: " + mSource.toString());
AssetFileDescriptor afd;
afd = getContext().getAssets().openFd(mSource.toString().replace("file:///android_assets/", ""));
mPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
afd.close();
} else if (mSource.getScheme() != null && mSource.getScheme().equals("asset")) {
LOG("Loading assets URI: " + mSource.toString());
AssetFileDescriptor afd;
afd = getContext().getAssets().openFd(mSource.toString().replace("asset://", ""));
mPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
afd.close();
} else {
LOG("Loading local URI: " + mSource.toString());
mPlayer.setDataSource(getContext(), mSource);
}
mPlayer.prepareAsync();
}
private void prepare() {
if (!mSurfaceAvailable || mSource == null || mPlayer == null || mIsPrepared)
return;
if (mCallback != null)
mCallback.onPreparing(this);
try {
mPlayer.setSurface(mSurface);
setSourceInternal();
} catch (IOException e) {
throwError(e);
}
}
private void setControlsEnabled(boolean enabled) {
if (mSeeker == null) return;
mSeeker.setEnabled(enabled);
mBtnPlayPause.setEnabled(enabled);
mBtnSubmit.setEnabled(enabled);
mBtnRestart.setEnabled(enabled);
mBtnRetry.setEnabled(enabled);
final float disabledAlpha = .4f;
mBtnPlayPause.setAlpha(enabled ? 1f : disabledAlpha);
mBtnSubmit.setAlpha(enabled ? 1f : disabledAlpha);
mBtnRestart.setAlpha(enabled ? 1f : disabledAlpha);
mClickFrame.setEnabled(enabled);
}
@Override
public void showControls() {
if (mControlsDisabled || isControlsShown() || mSeeker == null)
return;
mControlsFrame.animate().cancel();
mControlsFrame.setAlpha(0f);
mControlsFrame.setVisibility(View.VISIBLE);
mControlsFrame.animate().alpha(1f)
.setInterpolator(new DecelerateInterpolator())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (mAutoFullscreen)
setFullscreen(false);
}
}).start();
}
@Override
public void hideControls() {
if (mControlsDisabled || !isControlsShown() || mSeeker == null)
return;
mControlsFrame.animate().cancel();
mControlsFrame.setAlpha(1f);
mControlsFrame.setVisibility(View.VISIBLE);
mControlsFrame.animate().alpha(0f)
.setInterpolator(new DecelerateInterpolator())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
setFullscreen(true);
if (mControlsFrame != null)
mControlsFrame.setVisibility(View.INVISIBLE);
}
}).start();
}
@CheckResult
@Override
public boolean isControlsShown() {
return !mControlsDisabled && mControlsFrame != null && mControlsFrame.getAlpha() > .5f;
}
@Override
public void toggleControls() {
if (mControlsDisabled)
return;
if (isControlsShown()) {
hideControls();
} else {
showControls();
}
}
@Override
public void enableControls(boolean andShow) {
mControlsDisabled = false;
if (andShow) showControls();
mClickFrame.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
toggleControls();
}
});
mClickFrame.setClickable(true);
}
@Override
public void disableControls() {
mControlsDisabled = true;
mControlsFrame.setVisibility(View.GONE);
mClickFrame.setOnClickListener(null);
mClickFrame.setClickable(false);
}
@CheckResult
@Override
public boolean isPrepared() {
return mPlayer != null && mIsPrepared;
}
@CheckResult
@Override
public boolean isPlaying() {
return mPlayer != null && mPlayer.isPlaying();
}
@CheckResult
@Override
public int getCurrentPosition() {
if (mPlayer == null) return -1;
return mPlayer.getCurrentPosition();
}
@CheckResult
@Override
public int getDuration() {
if (mPlayer == null) return -1;
return mPlayer.getDuration();
}
@Override
public void start() {
if (mPlayer == null) return;
mPlayer.start();
if (mCallback != null) mCallback.onStarted(this);
if (mHandler == null) mHandler = new Handler();
mHandler.post(mUpdateCounters);
mBtnPlayPause.setImageDrawable(mPauseDrawable);
}
@Override
public void seekTo(@IntRange(from = 0, to = Integer.MAX_VALUE) int pos) {
if (mPlayer == null) return;
mPlayer.seekTo(pos);
}
public void setVolume(@FloatRange(from = 0f, to = 1f) float leftVolume, @FloatRange(from = 0f, to = 1f) float rightVolume) {
if (mPlayer == null || !mIsPrepared)
throw new IllegalStateException("You cannot use setVolume(float, float) until the player is prepared.");
mPlayer.setVolume(leftVolume, rightVolume);
}
@Override
public void pause() {
if (mPlayer == null || !isPlaying()) return;
mPlayer.pause();
mCallback.onPaused(this);
if (mHandler == null) return;
mHandler.removeCallbacks(mUpdateCounters);
mBtnPlayPause.setImageDrawable(mPlayDrawable);
}
@Override
public void stop() {
if (mPlayer == null) return;
try {
mPlayer.stop();
} catch (Throwable ignored) {
}
if (mHandler == null) return;
mHandler.removeCallbacks(mUpdateCounters);
mBtnPlayPause.setImageDrawable(mPauseDrawable);
}
@Override
public void reset() {
if (mPlayer == null) return;
mIsPrepared = false;
mPlayer.reset();
mIsPrepared = false;
}
@Override
public void release() {
mIsPrepared = false;
if (mPlayer != null) {
try {
mPlayer.release();
} catch (Throwable ignored) {
}
mPlayer = null;
}
if (mHandler != null) {
mHandler.removeCallbacks(mUpdateCounters);
mHandler = null;
}
LOG("Released player and Handler");
}
@Override
public void setAutoFullscreen(boolean autoFullscreen) {
this.mAutoFullscreen = autoFullscreen;
}
@Override
public void setLoop(boolean loop) {
mLoop = loop;
if (mPlayer != null)
mPlayer.setLooping(loop);
}
// Surface listeners
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height) {
LOG("Surface texture available: %dx%d", width, height);
mInitialTextureWidth = width;
mInitialTextureHeight = height;
mSurfaceAvailable = true;
mSurface = new Surface(surfaceTexture);
if (mIsPrepared) {
mPlayer.setSurface(mSurface);
} else {
prepare();
}
}
@Override
public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int width, int height) {
LOG("Surface texture changed: %dx%d", width, height);
adjustAspectRatio(width, height, mPlayer.getVideoWidth(), mPlayer.getVideoHeight());
}
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
LOG("Surface texture destroyed");
mSurfaceAvailable = false;
mSurface = null;
return false;
}
@Override
public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
}
// Media player listeners
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
LOG("onPrepared()");
mProgressFrame.setVisibility(View.INVISIBLE);
mIsPrepared = true;
if (mCallback != null)
mCallback.onPrepared(this);
mLabelPosition.setText(Util.getDurationString(0, false));
mLabelDuration.setText(Util.getDurationString(mediaPlayer.getDuration(), false));
mSeeker.setProgress(0);
mSeeker.setMax(mediaPlayer.getDuration());
setControlsEnabled(true);
if (mAutoPlay) {
if (!mControlsDisabled && mHideControlsOnPlay)
hideControls();
start();
if (mInitialPosition > 0) {
seekTo(mInitialPosition);
mInitialPosition = -1;
}
} else {
// Hack to show first frame, is there another way?
mPlayer.start();
mPlayer.pause();
}
}
@Override
public void onBufferingUpdate(MediaPlayer mediaPlayer, int percent) {
LOG("Buffering: %d%%", percent);
if (mCallback != null)
mCallback.onBuffering(percent);
if (mSeeker != null) {
if (percent == 100) mSeeker.setSecondaryProgress(0);
else mSeeker.setSecondaryProgress(mSeeker.getMax() * (percent / 100));
}
}
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
LOG("onCompletion()");
mBtnPlayPause.setImageDrawable(mPlayDrawable);
if (mHandler != null)
mHandler.removeCallbacks(mUpdateCounters);
mSeeker.setProgress(mSeeker.getMax());
showControls();
if (mCallback != null)
mCallback.onCompletion(this);
}
@Override
public void onVideoSizeChanged(MediaPlayer mediaPlayer, int width, int height) {
LOG("Video size changed: %dx%d", width, height);
adjustAspectRatio(mInitialTextureWidth, mInitialTextureHeight, width, height);
}
@Override
public boolean onError(MediaPlayer mediaPlayer, int what, int extra) {
if (what == -38) {
// Error code -38 happens on some Samsung devices
// Just ignore it
return false;
}
String errorMsg = "Preparation/playback error (" + what + "): ";
switch (what) {
default:
errorMsg += "Unknown error";
break;
case MediaPlayer.MEDIA_ERROR_IO:
errorMsg += "I/O error";
break;
case MediaPlayer.MEDIA_ERROR_MALFORMED:
errorMsg += "Malformed";
break;
case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK:
errorMsg += "Not valid for progressive playback";
break;
case MediaPlayer.MEDIA_ERROR_SERVER_DIED:
errorMsg += "Server died";
break;
case MediaPlayer.MEDIA_ERROR_TIMED_OUT:
errorMsg += "Timed out";
break;
case MediaPlayer.MEDIA_ERROR_UNSUPPORTED:
errorMsg += "Unsupported";
break;
}
throwError(new Exception(errorMsg));
return false;
}
// View events
@Override
protected void onFinishInflate() {
super.onFinishInflate();
initializePlayer();
setControlsEnabled(false);
invalidateActions();
prepare();
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.btnPlayPause) {
if (mPlayer.isPlaying()) {
pause();
} else {
if (mHideControlsOnPlay && !mControlsDisabled)
hideControls();
start();
}
} else if (view.getId() == R.id.btnRestart) {
seekTo(0);
if (!isPlaying()) start();
} else if (view.getId() == R.id.btnRetry) {
if (mCallback != null)
mCallback.onRetry(this, mSource);
} else if (view.getId() == R.id.btnSubmit) {
if (mCallback != null)
mCallback.onSubmit(this, mSource);
}
}
@Override
public void onProgressChanged(SeekBar seekBar, int value, boolean fromUser) {
if (fromUser) seekTo(value);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
mWasPlaying = isPlaying();
if (mWasPlaying) mPlayer.pause(); // keeps the time updater running, unlike pause()
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
if (mWasPlaying) mPlayer.start();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
LOG("Detached from window");
release();
mSeeker = null;
mLabelPosition = null;
mLabelDuration = null;
mBtnPlayPause = null;
mBtnRestart = null;
mBtnSubmit = null;
mControlsFrame = null;
mClickFrame = null;
mProgressFrame = null;
if (mHandler != null) {
mHandler.removeCallbacks(mUpdateCounters);
mHandler = null;
}
}
// Utilities
private static void LOG(String message, Object... args) {
try {
if (args != null)
message = String.format(message, args);
Log.d("EasyVideoPlayer", message);
} catch (Exception ignored) {
}
}
private void invalidateActions() {
switch (mLeftAction) {
case LEFT_ACTION_NONE:
mBtnRetry.setVisibility(View.GONE);
mBtnRestart.setVisibility(View.GONE);
break;
case LEFT_ACTION_RESTART:
mBtnRetry.setVisibility(View.GONE);
mBtnRestart.setVisibility(View.VISIBLE);
break;
case LEFT_ACTION_RETRY:
mBtnRetry.setVisibility(View.VISIBLE);
mBtnRestart.setVisibility(View.GONE);
break;
}
switch (mRightAction) {
case RIGHT_ACTION_NONE:
mBtnSubmit.setVisibility(View.GONE);
mLabelCustom.setVisibility(View.GONE);
break;
case RIGHT_ACTION_SUBMIT:
mBtnSubmit.setVisibility(View.VISIBLE);
mLabelCustom.setVisibility(View.GONE);
break;
case RIGHT_ACTION_CUSTOM_LABEL:
mBtnSubmit.setVisibility(View.GONE);
mLabelCustom.setVisibility(View.VISIBLE);
break;
}
}
private void adjustAspectRatio(int viewWidth, int viewHeight, int videoWidth, int videoHeight) {
final double aspectRatio = (double) videoHeight / videoWidth;
int newWidth, newHeight;
if (viewHeight > (int) (viewWidth * aspectRatio)) {
// limited by narrow width; restrict height
newWidth = viewWidth;
newHeight = (int) (viewWidth * aspectRatio);
} else {
// limited by short height; restrict width
newWidth = (int) (viewHeight / aspectRatio);
newHeight = viewHeight;
}
final int xoff = (viewWidth - newWidth) / 2;
final int yoff = (viewHeight - newHeight) / 2;
final Matrix txform = new Matrix();
mTextureView.getTransform(txform);
txform.setScale((float) newWidth / viewWidth, (float) newHeight / viewHeight);
txform.postTranslate(xoff, yoff);
mTextureView.setTransform(txform);
}
private void throwError(Exception e) {
if (mCallback != null)
mCallback.onError(this, e);
else throw new RuntimeException(e);
}
private static void setTint(@NonNull SeekBar seekBar, @ColorInt int color) {
ColorStateList s1 = ColorStateList.valueOf(color);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
seekBar.setThumbTintList(s1);
seekBar.setProgressTintList(s1);
seekBar.setSecondaryProgressTintList(s1);
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1) {
Drawable progressDrawable = DrawableCompat.wrap(seekBar.getProgressDrawable());
seekBar.setProgressDrawable(progressDrawable);
DrawableCompat.setTintList(progressDrawable, s1);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Drawable thumbDrawable = DrawableCompat.wrap(seekBar.getThumb());
DrawableCompat.setTintList(thumbDrawable, s1);
seekBar.setThumb(thumbDrawable);
}
} else {
PorterDuff.Mode mode = PorterDuff.Mode.SRC_IN;
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
mode = PorterDuff.Mode.MULTIPLY;
}
if (seekBar.getIndeterminateDrawable() != null)
seekBar.getIndeterminateDrawable().setColorFilter(color, mode);
if (seekBar.getProgressDrawable() != null)
seekBar.getProgressDrawable().setColorFilter(color, mode);
}
}
private Drawable tintDrawable(@NonNull Drawable d, @ColorInt int color) {
d = DrawableCompat.wrap(d.mutate());
DrawableCompat.setTint(d, color);
return d;
}
private void tintSelector(@NonNull View view, @ColorInt int color) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && view.getBackground() instanceof RippleDrawable) {
final RippleDrawable rd = (RippleDrawable) view.getBackground();
rd.setColor(ColorStateList.valueOf(Util.adjustAlpha(color, 0.3f)));
}
}
private void invalidateThemeColors() {
final int labelColor = Util.isColorDark(mThemeColor) ? Color.WHITE : Color.BLACK;
mControlsFrame.setBackgroundColor(Util.adjustAlpha(mThemeColor, 0.8f));
tintSelector(mBtnRestart, labelColor);
tintSelector(mBtnPlayPause, labelColor);
mLabelDuration.setTextColor(labelColor);
mLabelPosition.setTextColor(labelColor);
setTint(mSeeker, labelColor);
mBtnRetry.setTextColor(labelColor);
tintSelector(mBtnRetry, labelColor);
mBtnSubmit.setTextColor(labelColor);
tintSelector(mBtnSubmit, labelColor);
mLabelCustom.setTextColor(labelColor);
mLabelBottom.setTextColor(labelColor);
mPlayDrawable = tintDrawable(mPlayDrawable.mutate(), labelColor);
mRestartDrawable = tintDrawable(mRestartDrawable.mutate(), labelColor);
mPauseDrawable = tintDrawable(mPauseDrawable.mutate(), labelColor);
}
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
private void setFullscreen(boolean fullscreen) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
if (mAutoFullscreen) {
int flags = !fullscreen ? 0 : View.SYSTEM_UI_FLAG_LOW_PROFILE;
ViewCompat.setFitsSystemWindows(mControlsFrame, !fullscreen);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
flags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
if (fullscreen) {
flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE;
}
}
mClickFrame.setSystemUiVisibility(flags);
}
}
}
public void initializePlayer() {
if(mPlayer != null) {
return;
}
setKeepScreenOn(true);
mHandler = new Handler();
mPlayer = new MediaPlayer();
mPlayer.setOnPreparedListener(this);
mPlayer.setOnBufferingUpdateListener(this);
mPlayer.setOnCompletionListener(this);
mPlayer.setOnVideoSizeChangedListener(this);
mPlayer.setOnErrorListener(this);
mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mPlayer.setLooping(mLoop);
// Instantiate and add TextureView for rendering
final LayoutParams textureLp = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
mTextureView = new TextureView(getContext());
addView(mTextureView, textureLp);
mTextureView.setSurfaceTextureListener(this);
final LayoutInflater li = LayoutInflater.from(getContext());
// Inflate and add progress
mProgressFrame = li.inflate(R.layout.evp_include_progress, this, false);
addView(mProgressFrame);
// Instantiate and add click frame (used to toggle controls)
mClickFrame = new FrameLayout(getContext());
//noinspection RedundantCast
((FrameLayout) mClickFrame).setForeground(Util.resolveDrawable(getContext(), R.attr.selectableItemBackground));
addView(mClickFrame, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
// Inflate controls
mControlsFrame = li.inflate(R.layout.evp_include_controls, this, false);
final LayoutParams controlsLp = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
controlsLp.gravity = Gravity.BOTTOM;
addView(mControlsFrame, controlsLp);
if (mControlsDisabled) {
mClickFrame.setOnClickListener(null);
mControlsFrame.setVisibility(View.GONE);
} else {
mClickFrame.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
toggleControls();
}
});
}
// Retrieve controls
mSeeker = (SeekBar) mControlsFrame.findViewById(R.id.seeker);
mSeeker.setOnSeekBarChangeListener(this);
mLabelPosition = (TextView) mControlsFrame.findViewById(R.id.position);
mLabelPosition.setText(Util.getDurationString(0, false));
mLabelDuration = (TextView) mControlsFrame.findViewById(R.id.duration);
mLabelDuration.setText(Util.getDurationString(0, true));
mBtnRestart = (ImageButton) mControlsFrame.findViewById(R.id.btnRestart);
mBtnRestart.setOnClickListener(this);
mBtnRestart.setImageDrawable(mRestartDrawable);
mBtnRetry = (TextView) mControlsFrame.findViewById(R.id.btnRetry);
mBtnRetry.setOnClickListener(this);
mBtnRetry.setText(mRetryText);
mBtnPlayPause = (ImageButton) mControlsFrame.findViewById(R.id.btnPlayPause);
mBtnPlayPause.setOnClickListener(this);
mBtnPlayPause.setImageDrawable(mPlayDrawable);
mBtnSubmit = (TextView) mControlsFrame.findViewById(R.id.btnSubmit);
mBtnSubmit.setOnClickListener(this);
mBtnSubmit.setText(mSubmitText);
mLabelCustom = (TextView) mControlsFrame.findViewById(R.id.labelCustom);
mLabelCustom.setText(mCustomLabelText);
mLabelBottom = (TextView) mControlsFrame.findViewById(R.id.labelBottom);
setBottomLabelText(mBottomLabelText);
invalidateThemeColors();
}
} | [
"[email protected]"
] | |
013f76eda06dd942750910197efc09a9f3e8da5c | dd5b4bc3bffa5b69d02e5813ff3e4c4b400acc0e | /app/src/main/java/cc/easyandroid/easyvpn/tunnel/Tunnel.java | 2bbed182d936038a8ed0bb0dfa63cc48ec9e1bb9 | [
"Apache-2.0"
] | permissive | easyandroid-cc/EasyVpn | 32f20b7578278c0a7c2493eb8cba9742e181befb | c90cd05401996f857547a5acece5847d5c17391c | refs/heads/master | 2021-01-23T09:40:11.006828 | 2017-09-30T07:02:06 | 2017-09-30T07:02:06 | 102,592,230 | 3 | 1 | null | 2017-09-07T08:24:37 | 2017-09-06T09:51:40 | Java | UTF-8 | Java | false | false | 6,821 | java | package cc.easyandroid.easyvpn.tunnel;
import android.annotation.SuppressLint;
import cc.easyandroid.easyvpn.core.LocalVpnService;
import cc.easyandroid.easyvpn.core.ProxyConfig;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
public abstract class Tunnel {
final static ByteBuffer GL_BUFFER = ByteBuffer.allocate(20000);
public static long SessionCount;
protected abstract void onConnected(ByteBuffer buffer) throws Exception;
protected abstract boolean isTunnelEstablished();
protected abstract void beforeSend(ByteBuffer buffer) throws Exception;
protected abstract void afterReceived(ByteBuffer buffer) throws Exception;
protected abstract void onDispose();
private SocketChannel m_InnerChannel;
private ByteBuffer m_SendRemainBuffer;
private Selector m_Selector;
private Tunnel m_BrotherTunnel;
private boolean m_Disposed;
private InetSocketAddress m_ServerEP;
protected InetSocketAddress m_DestAddress;
public Tunnel(SocketChannel innerChannel, Selector selector) {
this.m_InnerChannel = innerChannel;
this.m_Selector = selector;
SessionCount++;
}
public Tunnel(InetSocketAddress serverAddress, Selector selector) throws IOException {
SocketChannel innerChannel = SocketChannel.open();
innerChannel.configureBlocking(false);
this.m_InnerChannel = innerChannel;
this.m_Selector = selector;
this.m_ServerEP = serverAddress;
SessionCount++;
}
public void setBrotherTunnel(Tunnel brotherTunnel) {
m_BrotherTunnel = brotherTunnel;
}
public void connect(InetSocketAddress destAddress) throws Exception {
if (LocalVpnService.Instance.protect(m_InnerChannel.socket())) {//保护socket不走vpn
m_DestAddress = destAddress;
m_InnerChannel.register(m_Selector, SelectionKey.OP_CONNECT, this);//注册连接事件
m_InnerChannel.connect(m_ServerEP);//连接目标
} else {
throw new Exception("VPN protect socket failed.");
}
}
protected void beginReceive() throws Exception {
if (m_InnerChannel.isBlocking()) {
m_InnerChannel.configureBlocking(false);
}
m_InnerChannel.register(m_Selector, SelectionKey.OP_READ, this);//注册读事件
}
protected boolean write(ByteBuffer buffer, boolean copyRemainData) throws Exception {
int bytesSent;
while (buffer.hasRemaining()) {
bytesSent = m_InnerChannel.write(buffer);
if (bytesSent == 0) {
break;//不能再发送了,终止循环
}
}
if (buffer.hasRemaining()) {//数据没有发送完毕
if (copyRemainData) {//拷贝剩余数据,然后侦听写入事件,待可写入时写入。
//拷贝剩余数据
if (m_SendRemainBuffer == null) {
m_SendRemainBuffer = ByteBuffer.allocate(buffer.capacity());
}
m_SendRemainBuffer.clear();
m_SendRemainBuffer.put(buffer);
m_SendRemainBuffer.flip();
m_InnerChannel.register(m_Selector, SelectionKey.OP_WRITE, this);//注册写事件
}
return false;
} else {//发送完毕了
return true;
}
}
protected void onTunnelEstablished() throws Exception {
this.beginReceive();//开始接收数据
m_BrotherTunnel.beginReceive();//兄弟也开始收数据吧
}
@SuppressLint("DefaultLocale")
public void onConnectable() {
try {
if (m_InnerChannel.finishConnect()) {//连接成功
onConnected(GL_BUFFER);//通知子类TCP已连接,子类可以根据协议实现握手等。
} else {//连接失败
LocalVpnService.Instance.writeLog("Error: connect to %s failed.", m_ServerEP);
this.dispose();
}
} catch (Exception e) {
LocalVpnService.Instance.writeLog("Error: connect to %s failed: %s", m_ServerEP, e);
this.dispose();
}
}
public void onReadable(SelectionKey key) {
try {
ByteBuffer buffer = GL_BUFFER;
buffer.clear();
int bytesRead = m_InnerChannel.read(buffer);
if (bytesRead > 0) {
buffer.flip();
afterReceived(buffer);//先让子类处理,例如解密数据。
if (isTunnelEstablished() && buffer.hasRemaining()) {//将读到的数据,转发给兄弟。
m_BrotherTunnel.beforeSend(buffer);//发送之前,先让子类处理,例如做加密等。
if (!m_BrotherTunnel.write(buffer, true)) {
key.cancel();//兄弟吃不消,就取消读取事件。
if (ProxyConfig.IS_DEBUG)
System.out.printf("%s can not read more.\n", m_ServerEP);
}
}
} else if (bytesRead < 0) {
this.dispose();//连接已关闭,释放资源。
}
} catch (Exception e) {
e.printStackTrace();
this.dispose();
}
}
public void onWritable(SelectionKey key) {
try {
this.beforeSend(m_SendRemainBuffer);//发送之前,先让子类处理,例如做加密等。
if (this.write(m_SendRemainBuffer, false)) {//如果剩余数据已经发送完毕
key.cancel();//取消写事件。
if (isTunnelEstablished()) {
m_BrotherTunnel.beginReceive();//这边数据发送完毕,通知兄弟可以收数据了。
} else {
this.beginReceive();//开始接收代理服务器响应数据
}
}
} catch (Exception e) {
this.dispose();
}
}
public void dispose() {
disposeInternal(true);
}
void disposeInternal(boolean disposeBrother) {
if (m_Disposed) {
return;
} else {
try {
m_InnerChannel.close();
} catch (Exception e) {
}
if (m_BrotherTunnel != null && disposeBrother) {
m_BrotherTunnel.disposeInternal(false);//把兄弟的资源也释放了。
}
m_InnerChannel = null;
m_SendRemainBuffer = null;
m_Selector = null;
m_BrotherTunnel = null;
m_Disposed = true;
SessionCount--;
onDispose();
}
}
}
| [
"[email protected]"
] | |
3fc6cdb4af4b2355c74c02489dae9ad0b2e5a65a | 8d4cf84bd14b1a7ddeb4c39f59ec08c32f3b31aa | /src/ru/Test/Bookstore/model/Book.java | 1bdac6037607ef854d4673a5532b96c7d9020f49 | [] | no_license | NikolayOvcharenko/BookStore | 29a4cd0a5806bdc9e3184213c22b997f8e4b726e | a69b526db666e1cf09b5f70970f695da5dd774d0 | refs/heads/master | 2020-09-25T06:11:09.274272 | 2019-12-10T07:17:31 | 2019-12-10T07:17:31 | 225,935,204 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,087 | java | package ru.Test.Bookstore.model;
public class Book {
private long id;
private String title;
private String author;
private double price;
private BookGenge genre;
public Book(long id, String title, String author, double price, BookGenge genre) {
this.id = id;
this.title = title;
this.author = author;
this.price = price;
this.genre = genre;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public BookGenge getGenre() {
return genre;
}
public void setGenre(BookGenge genre) {
this.genre = genre;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
}
| [
"[email protected]"
] | |
40b3c0c7799c3ed37f21fa5647d9de1c6f5a219c | c41b64c9d09cc3935d40634dfcf8bdb23d66e07e | /src/com/bleatware/throwgame/Counter.java | 2e6c9c22302c62ebe3912ea6ead3b2f05c3de8f4 | [] | no_license | vasuman/ShootEgg | 5972646e7db9e09937cbfe1b341fd781c2173b3b | 477c93666a0f547296dab6c5974f57441c5a455e | refs/heads/master | 2020-03-25T13:21:02.199868 | 2014-02-08T10:19:49 | 2014-02-08T10:19:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 644 | java | package com.bleatware.throwgame;
/**
* ThrowGame
* User: vasuman
* Date: 2/8/14
* Time: 5:02 AM
*/
public class Counter {
private float t;
private float count;
public Counter(float count) {
this.count = count;
t = 0;
}
public void reset() {
t = count;
}
public void fire() {
t = 0;
}
public void setCount(float count) {
this.count = count;
}
public float getCount() {
return count;
}
public boolean update(float delT) {
if((t -= delT) < 0) {
t = count;
return true;
}
return false;
}
}
| [
"[email protected]"
] | |
2343a19a159d67844c8a4c6526919ddf46099012 | 4980b88502782ab5736bff74749460f68ea7128e | /src/org/du/settings/doze/DozeService.java | d541b02508cdedf67d68e976d2d201d6a9a01a13 | [] | no_license | hsj51/doze | 43c82d453ba0fcde1127b34322c3c7f935fac620 | af4cad79d58f893759273e4075c814782843e065 | refs/heads/master | 2020-04-20T05:21:42.345912 | 2019-03-13T13:26:52 | 2019-03-13T13:26:52 | 168,654,059 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,114 | java | /*
* Copyright (c) 2015 The CyanogenMod Project
* 2017 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.du.settings.doze;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import android.util.Log;
public class DozeService extends Service {
private static final String TAG = "DozeService";
private static final boolean DEBUG = false;
private ProximitySensor mProximitySensor;
private TiltSensor mTiltSensor;
@Override
public void onCreate() {
if (DEBUG) Log.d(TAG, "Creating service");
mProximitySensor = new ProximitySensor(this);
mTiltSensor = new TiltSensor(this);
IntentFilter screenStateFilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF);
registerReceiver(mScreenStateReceiver, screenStateFilter);
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (DEBUG) Log.d(TAG, "Starting service");
return START_STICKY;
}
@Override
public void onDestroy() {
if (DEBUG) Log.d(TAG, "Destroying service");
super.onDestroy();
this.unregisterReceiver(mScreenStateReceiver);
mProximitySensor.disable();
mTiltSensor.disable();
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
private void onDisplayOn() {
if (DEBUG) Log.d(TAG, "Display on");
if (Utils.pickUpEnabled(this)) {
mTiltSensor.disable();
}
if (Utils.handwaveGestureEnabled(this) ||
Utils.pocketGestureEnabled(this)) {
mProximitySensor.disable();
}
}
private void onDisplayOff() {
if (DEBUG) Log.d(TAG, "Display off");
if (Utils.pickUpEnabled(this)) {
mTiltSensor.enable();
}
if (Utils.handwaveGestureEnabled(this) ||
Utils.pocketGestureEnabled(this)) {
mProximitySensor.enable();
}
}
private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
onDisplayOn();
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
onDisplayOff();
}
}
};
}
| [
"[email protected]"
] | |
9cf6b00655f6fa7e14e3b85699268f041467ab8a | bb429844eed8cac34a500c69cd52b1634e9a9af5 | /medicalCalculator/gen/com/example/medicalCalculator/Manifest.java | e48176cb594b3a836bc4c59e11b4f3280c5fe2c5 | [] | no_license | miteshmodi/Mobile-App-Course-Projects | 90cdf94b1d0b5096696101e9f5f4c2dd596d9e63 | 9dd2fcdf13020a007d8fc08c789fd527776fcda3 | refs/heads/master | 2021-09-28T09:08:19.720337 | 2015-04-28T06:20:11 | 2015-04-28T06:20:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 199 | java | /*___Generated_by_IDEA___*/
package com.example.medicalCalculator;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
} | [
"[email protected]"
] | |
e0c184a4d69b87ca131ad516dc8ab44cf80a34c2 | e850c1ae81ab56cdc334cda2523b0bf742dba0ed | /GrupoBruce/src/java/com/bruce/dao/design/IAusenciaDAO.java | 0a15bda9d8f2aa03db1116807c5298d547dad1f6 | [] | no_license | RicardoRuizBenites10/apocalipsis | cc1eecbbfc2e0ecfc18a60005b768c632747fd45 | 341e6293d18814510ce963c78a4a03f6cc080172 | refs/heads/master | 2021-06-02T20:40:16.814816 | 2020-07-21T00:56:39 | 2020-07-21T00:56:39 | 137,546,985 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 419 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.bruce.dao.design;
import com.bruce.dao.to.Ausencia;
import com.bruce.util.FilterPage;
import java.util.List;
/**
*
* @author RICARDO
*/
public interface IAusenciaDAO extends IEntidadDAO<Ausencia> {
}
| [
"RICARDO@ENGLOBASYSTEMS"
] | RICARDO@ENGLOBASYSTEMS |
5ca80459c20cd9082f9df57ec8515c62ff1ce5b9 | db3f555bf00309c47e4388c40eb7771e6e9dc450 | /src/net/imwork/zhanlong/proxy/staticProxy/Client.java | 45f57f46682020c3061be8f985a5496ae88cbf0e | [] | no_license | naeidxvTools/spring2 | 29d4742a6d4740447389a7958c22b28dacc047fa | 8e89f700ebf9033d0b2f5f7bef26b91e62b5590d | refs/heads/master | 2023-05-08T01:34:59.982132 | 2021-05-29T08:58:16 | 2021-05-29T08:58:16 | 369,221,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 182 | java | package net.imwork.zhanlong.proxy.staticProxy;
public class Client
{
public static void main(String[] args)
{
Subject subject = new ProxySubject();
subject.request();
}
}
| [
"[email protected]"
] | |
dde70909f8363fa2d97c219f548991b6fdddcbc4 | 9acb7c2c7131e182b3356f8d5a1c92745e6069bb | /kripton-processor/src/test/java/sqlite/feature/livedatax/persistence1/DaoPerson1.java | 766c17c1bb1d4ba9c62d56c2aeb10279f21ae263 | [
"Apache-2.0"
] | permissive | ajrulez/kripton | d4c04c1948a95dde5ad8dc188ffb7d60ae4e0362 | 9bd27f01cecad20f221ec40f3cf1404311b5e290 | refs/heads/master | 2020-03-25T05:22:30.600576 | 2018-07-31T07:04:46 | 2018-07-31T07:04:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,095 | java | /*******************************************************************************
* Copyright 2018 Francesco Benincasa ([email protected])
*
* 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 sqlite.feature.livedatax.persistence1;
import java.util.List;
import com.abubusoft.kripton.android.annotation.BindContentProviderEntry;
import com.abubusoft.kripton.android.annotation.BindContentProviderPath;
import com.abubusoft.kripton.android.annotation.BindDao;
import com.abubusoft.kripton.android.annotation.BindSqlInsert;
import com.abubusoft.kripton.android.annotation.BindSqlSelect;
import com.abubusoft.kripton.android.annotation.BindSqlUpdate;
import androidx.lifecycle.LiveData;
import sqlite.feature.livedata.data.Person;
/**
* The Interface DaoPerson1.
*/
@BindContentProviderPath(path="persons")
@BindDao(Person.class)
public interface DaoPerson1 {
/**
* Select.
*
* @param name the name
* @return the live data
*/
@BindContentProviderEntry(path="${name}")
@BindSqlSelect(where="name=${name}")
LiveData<List<Person>> select(String name);
/**
* Select all.
*
* @return the live data
*/
@BindContentProviderEntry
@BindSqlSelect
LiveData<List<Person>> selectAll();
/**
* Insert.
*
* @param bean the bean
*/
@BindContentProviderEntry
@BindSqlInsert
void insert(Person bean);
/**
* Update.
*
* @param bean the bean
*/
@BindContentProviderEntry(path="${bean.id}")
@BindSqlUpdate(where ="id=${bean.id}")
void update(Person bean);
}
| [
"[email protected]"
] | |
b3e0c297c7479b99e4faa87042f0ce72329398f8 | 930c207e245c320b108e9699bbbb036260a36d6a | /BRICK-RDF4J/generatedCode/src/main/java/brickschema/org/schema/_1_0_2/Brick/Hot_Water_Supply_Temperature_Low_Reset_Setpoint.java | bca07a184fce5760c10973d0394e8c1f18faebe9 | [] | no_license | InnovationSE/BRICK-Generated-By-OLGA | 24d278f543471e1ce622f5f45d9e305790181fff | 7874dfa450a8a2b6a6f9927c0f91f9c7d2abd4d2 | refs/heads/master | 2021-07-01T14:13:11.302860 | 2017-09-21T12:44:17 | 2017-09-21T12:44:17 | 104,251,784 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,183 | java | /**
* This file is automatically generated by OLGA
* @author OLGA
* @version 1.0
*/
package brickschema.org.schema._1_0_2.Brick;
import brick.global.util.GLOBAL;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.vocabulary.RDF;
import java.math.BigDecimal;
import javax.xml.datatype.XMLGregorianCalendar;
import java.util.Date;
import brickschema.org.schema._1_0_2.Brick.Temperature_Low_Reset_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Reset_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Setpoint;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
public class Hot_Water_Supply_Temperature_Low_Reset_Setpoint implements IHot_Water_Supply_Temperature_Low_Reset_Setpoint {
IRI newInstance;
public Hot_Water_Supply_Temperature_Low_Reset_Setpoint(String namespace, String instanceId) {
super();
newInstance = GLOBAL.factory.createIRI(namespace, instanceId);
GLOBAL.model.add(newInstance, RDF.TYPE, GLOBAL.factory.createIRI("https://brickschema.org/schema/1.0.2/Brick#Hot_Water_Supply_Temperature_Low_Reset_Setpoint"));
}
public IRI iri()
{
return newInstance;
}
}
| [
"[email protected]"
] | |
7e24609711fce4bb2d8b43dfb0dbca812c281c16 | c2dccf9aeb4d5ed9c1bd17f8c4409752ea9a16b7 | /CargoOnlinePaypalMPM/src/main/java/com/maxcom/mpm/paypal/bi/ConfirmacionCargoOnlineFacade.java | ccb8f3383edeeb8bd67125fbb0df9b17d4786b82 | [] | no_license | lnx1337/CirculoCredito | 2fa50b5e4d870c66237b0ff2ac9b62a233f91c24 | b0643af065cd177d5495ba7e556695b074b7c43f | refs/heads/master | 2020-05-07T15:29:29.864858 | 2014-10-26T00:11:27 | 2014-10-26T00:11:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,147 | java | package com.maxcom.mpm.paypal.bi;
import com.maxcom.mpm.paypal.bi.service.AutenticacionService;
import com.maxcom.mpm.paypal.bi.service.BitacoraService;
import com.maxcom.mpm.paypal.bi.service.CargoOnlineService;
import com.maxcom.mpm.paypal.bi.service.impl.AutenticacionServiceImpl;
import com.maxcom.mpm.paypal.bi.service.impl.BitacoraServiceImpl;
import com.maxcom.mpm.paypal.bi.service.impl.CargoOnlineServiceImpl;
import com.maxcom.mpm.paypal.dto.AutenticacionTO;
import com.maxcom.mpm.paypal.dto.DetalleErrorTO;
import com.maxcom.mpm.paypal.dto.RespuestaConfirmacionPagoTO;
import com.maxcom.mpm.paypal.dto.RespuestaDetallePagoTO;
import com.maxcom.mpm.paypal.dto.RespuestaSolicitudTO;
import com.maxcom.mpm.paypal.dto.TransaccionConfirmacionPagoTO;
import com.maxcom.mpm.paypal.dto.TransaccionDetallePagoTO;
import com.maxcom.mpm.paypal.dto.TransaccionSolicitudTO;
import com.maxcom.mpm.paypal.dto.TransaccionTO;
import static com.maxcom.mpm.paypal.util.Utilerias.isValidString;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class ConfirmacionCargoOnlineFacade implements ICargoOnline {
private BitacoraService bitacoraService;
private CargoOnlineService cargoOnlineService;
private AutenticacionService autenticacionService;
private List<DetalleErrorTO> listDetalleError;
private RespuestaConfirmacionPagoTO respuesta;
static final Logger logger = LogManager.getLogger(DetalleCargoOnlineFacade.class);
/**
* Constructor default de la clase
*/
public ConfirmacionCargoOnlineFacade(){
//Agregar DI
this.bitacoraService = new BitacoraServiceImpl();
this.cargoOnlineService = new CargoOnlineServiceImpl();
this.autenticacionService = new AutenticacionServiceImpl();
this.listDetalleError = new ArrayList<>();
}
/**
* Solicita el pago de la transaccion especificada
* @param transaccion Transaccion a procesar
* @return Regresa la respuesta que resulto del procesamiento.
* @since 1.0
*/
@Override
public RespuestaConfirmacionPagoTO confirmarPago(TransaccionConfirmacionPagoTO transaccion) {
try {
logger.info("CargoOnlineFacade:confirmarPago(E)");
if (!this.isTransaccionValida(transaccion)) {
this.respuesta = new RespuestaConfirmacionPagoTO("-", "-", null, "-",
"-", "-", 0, "-",
"ETRAN","Error - Transaccion nula",Calendar.getInstance().getTime());
return respuesta;
}
if(isTransaccionExistente(transaccion)){
return this.respuesta;
}
//Validando datos minimos requeridos
if (!this.isTransaccionCompleta(transaccion)) {
this.guardarBitacoraSolicitud(transaccion);
this.respuesta.setIdOperacionMPM(transaccion.getIdOrden());
this.guardarBitacoraRespuesta(this.respuesta);
return respuesta;
}
this.guardarBitacoraSolicitud(transaccion);
//Validando credenciales de la solicitud
if (!this.isAutenticacionValida(transaccion.getAutenticacion())) {
this.respuesta = new RespuestaConfirmacionPagoTO("-", "-", null, "-",
"-", "-", transaccion.getIdOrden(), transaccion.getIdTransaccion(),
"ETRAN","Error - Credenciales invalidas",Calendar.getInstance().getTime());
this.guardarBitacoraRespuesta(this.respuesta);
return respuesta;
}
this.respuesta = this.cargoOnlineService.confirmarPago(transaccion);
this.guardarBitacoraRespuesta(this.respuesta);
return this.respuesta;
} catch (Exception e) {
logger.error("Error en CargoOnlineFacade:confirmarPago - " + e.toString());
e.printStackTrace();
StringBuilder detalleErrorApp = new StringBuilder("");
detalleErrorApp.append("Error en el aplicativo - Servicio de CargoOnline Paypal - confirmarPago.");
//Agregar notificaciones de mail en caso de error
this.respuesta = new RespuestaConfirmacionPagoTO("-", "-", null, "-",
"-", "-", transaccion.getIdOrden(), transaccion.getIdTransaccion(),
"EAPP",detalleErrorApp.toString(),Calendar.getInstance().getTime());
try{
this.guardarBitacoraRespuesta(this.respuesta);
}catch(Exception err){
logger.error("Error al intentar guardar el error- " + err.getMessage());
}
return this.respuesta;
} finally {
logger.info("CargoOnlineFacade:confirmarPago(S)");
}
}
/**
* Valida que las credenciales de autenticacion sean validas.
* @param autenticacion Credenciales a validar.
* @return True - Si la autentucación es satisfactoria.
* @throws Exception Si algun error inesperado ocurre
*/
private boolean isAutenticacionValida(AutenticacionTO autenticacion) throws Exception {
try {
logger.info(" CargoOnlineFacade:isAutenticacionValida(E)");
if(autenticacionService.isAutenticacionValida(autenticacion)){
return true;
}
} catch (Exception e) {
logger.error(" Error en CargoOnlineFacade:isAutenticacionValida - "+ e.getMessage());
throw e;
} finally {
logger.info(" CargoOnlineFacade:isAutenticacionValida(S)");
}
return false;
}
/**
* Valida si la transaccion es valida. Una transaccion es valida si no es nula.
* @param transaccion Transaccion a validar
* @return True - Si la transaccion es valida.
*/
private boolean isTransaccionValida(TransaccionTO transaccion){
return transaccion != null;
}
/**
* Valida si la transaccion tiene la informacion minima requerida para su procesamiento.
* @param transaccion Transaccion a procesar.
* @return True - Si la transaccion cuenta con la informacion minima para su procesamiento.
*/
private boolean isTransaccionCompleta(TransaccionConfirmacionPagoTO transaccion) {
StringBuilder error = new StringBuilder();
if (!isValidString(transaccion.getIdTransaccion())) {
error.append("El campo idTransaccion es obligatorio - ");
}
if (!isValidString(transaccion.getReferencia())) {
error.append("El campo referencia es obligatorio.");
}
if (transaccion.getAutenticacion() == null) {
error.append("El campo autenticacion es obligatorio - ");
}else{
if (!isValidString(transaccion.getAutenticacion().getUsuario())) {
error.append("El campo usuario es obligatorio - ");
}
if (!isValidString(transaccion.getAutenticacion().getContrasenia())) {
error.append("El campo contrasenia es obligatorio - ");
}
}
if (!isValidString(transaccion.getReferencia())) {
error.append("El campo referencia es obligatorio - ");
}
if (!isValidString(transaccion.getToken())) {
error.append("El campo token es obligatorio - ");
}
if (!isValidString(transaccion.getPayerId())) {
error.append("El campo payerId es obligatorio - ");
}
if (transaccion.getOrderTotal()<=0.0) {
error.append("El campo orderTotal deber ser mayor a 0.0 - ");
}
if (error.length() > 0) {
this.respuesta = new RespuestaConfirmacionPagoTO("-", "-", null, "-",
"-", "-", transaccion.getIdOrden(), transaccion.getIdTransaccion(),
"ETRAN","Error - Transaccion incompleta ->"+error.toString(),Calendar.getInstance().getTime());
return false;
}
return true;
}
private void guardarBitacoraSolicitud(TransaccionConfirmacionPagoTO transaccion) throws Exception{
bitacoraService.guardarSolicitud(transaccion);
}
private void guardarBitacoraRespuesta(RespuestaConfirmacionPagoTO respuesta) throws Exception{
bitacoraService.guardarRespuesta(respuesta);
}
private boolean isTransaccionExistente(TransaccionConfirmacionPagoTO transaccion) throws Exception{
if(transaccion.getIdTransaccion()== null){
return false;
}
this.respuesta = new RespuestaConfirmacionPagoTO();
long idSolicitud = bitacoraService.buscarTransaccion(transaccion,respuesta);
return idSolicitud>0;
}
@Override
public RespuestaSolicitudTO solicitarPago(TransaccionSolicitudTO transaccion) {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public RespuestaDetallePagoTO recuperarDetallePago(TransaccionDetallePagoTO transaccion) {
throw new UnsupportedOperationException("Not supported.");
}
} | [
"[email protected]"
] | |
dd4f2e36515e2b5072e5477678cf24117d9e6599 | d314798b6bc651f22de5fc3f69383c3dc166ef85 | /src/lab/exercise3/two/one/CCASLock.java | 2c38535047b2910eccb8013d8b7b217dc10cbba4 | [] | no_license | mzaidkhan/Concurrency-Algorithms | 77fda9afb48ec7b8b60cad49afb956a031327a16 | 12e62058fd658c4db8277b620889b954bec4253b | refs/heads/master | 2021-01-10T06:56:33.911086 | 2016-01-30T21:05:16 | 2016-01-30T21:05:16 | 50,742,411 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,384 | java | package lab.exercise3.two.one;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
/**
* @author mohammed zaid khan
*
*/
class CCASLock implements Lock {
AtomicInteger state = new AtomicInteger(0);
/*
* (non-Javadoc)
*
* @see java.util.concurrent.locks.Lock#lock()
*/
@Override
public void lock() {
while (true) {
while (state.get() == 1) {
}
if (state.getAndSet(1) == 0)
return;
}
}
/*
* (non-Javadoc)
*
* @see java.util.concurrent.locks.Lock#unlock()
*/
@Override
public void unlock() {
state.set(0);
}
/*
* (non-Javadoc)
*
* @see java.util.concurrent.locks.Lock#lockInterruptibly()
*/
@Override
public void lockInterruptibly() throws InterruptedException {
}
/*
* (non-Javadoc)
*
* @see java.util.concurrent.locks.Lock#newCondition()
*/
@Override
public Condition newCondition() {
return null;
}
/*
* (non-Javadoc)
*
* @see java.util.concurrent.locks.Lock#tryLock()
*/
@Override
public boolean tryLock() {
return false;
}
/*
* (non-Javadoc)
*
* @see java.util.concurrent.locks.Lock#tryLock(long,
* java.util.concurrent.TimeUnit)
*/
@Override
public boolean tryLock(long arg0, TimeUnit arg1)
throws InterruptedException {
return false;
}
} | [
"[email protected]"
] | |
aa650597e0582d3d1ebd33c80914e601702d3c70 | 0fc9a85b1f475d73dbb4d63efdf4e531b856dca6 | /app/src/main/java/com/example/ted/android_networkconnectivity/MainActivity.java | 24eada38ab6f28936aa4fafa7dceba0af6791275 | [] | no_license | tedhagos/Android_networkConnectivity | 4b840e485d07edd69cd0df94eec220c832c0df39 | 0c5f4a3b6b2979b97682ab65f34fe977e5e7ad26 | refs/heads/master | 2016-09-14T02:15:56.707859 | 2016-04-17T12:01:44 | 2016-04-17T12:01:44 | 56,434,156 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,697 | java | package com.example.ted.android_networkconnectivity;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btnstart = (Button) findViewById(R.id.btnCheck);
final TextView txtlabel = (TextView) findViewById(R.id.textView);
assert btnstart != null;
btnstart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ConnectivityManager conman = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkinfo = conman.getActiveNetworkInfo();
String networkconn = "";
switch(networkinfo.getType()) {
case ConnectivityManager.TYPE_MOBILE:
networkconn = "Mobile";
break;
case ConnectivityManager.TYPE_WIFI:
networkconn = "Wifi";
break;
case ConnectivityManager.TYPE_WIMAX:
networkconn = "WiMax";
break;
case ConnectivityManager.TYPE_ETHERNET:
networkconn = "LAN";
break;
case ConnectivityManager.TYPE_BLUETOOTH:
networkconn = "BlueTooth";
break;
default:
networkconn = "Not Connnected";
}
txtlabel.setText(networkconn);
}
});
}
}
| [
"[email protected]"
] | |
fbf51c0a1db434cb01a79108434c5b17e5a466a5 | de3694f1be420e12ad228fbaa72d17344b15b427 | /s40-ci-backend-ejb/src/main/java/com/nokia/ci/ejb/ProjectAnnouncementEJB.java | e4e586ed1032d2a524316f55b7a878fe4e89b2a6 | [] | no_license | slimsymphony/ci-backend | 05a760611af610637fafccec5313e2dfac840309 | 7517d497464dd44e3ee951bddf102eaca26b029a | refs/heads/master | 2016-09-06T04:18:48.652987 | 2014-07-24T08:21:07 | 2014-07-24T08:21:07 | 22,204,436 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 662 | java | package com.nokia.ci.ejb;
import com.nokia.ci.ejb.model.ProjectAnnouncement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
/**
* Created by IntelliJ IDEA.
* User: djacko
* Date: 10/1/12
* Time: 10:33 AM
* To change this template use File | Settings | File Templates.
*/
@Stateless
@LocalBean
public class ProjectAnnouncementEJB extends CrudFunctionality<ProjectAnnouncement> {
/**
* Logger.
*/
private static Logger log = LoggerFactory.getLogger(ProjectAnnouncementEJB.class);
public ProjectAnnouncementEJB() {
super(ProjectAnnouncement.class);
}
}
| [
"[email protected]"
] | |
8ef07df42e025b05c67f311089790e441a47eb38 | 0ea271177f5c42920ac53cd7f01f053dba5c14e4 | /5.3.5/sources/android/support/v7/transition/ActionBarTransition.java | 658376bcd81e6a5bae834c05e02a1a32283cb804 | [] | no_license | alireza-ebrahimi/telegram-talaeii | 367a81a77f9bc447e729b2ca339f9512a4c2860e | 68a67e6f104ab8a0888e63c605e8bbad12c4a20e | refs/heads/master | 2020-03-21T13:44:29.008002 | 2018-12-09T10:30:29 | 2018-12-09T10:30:29 | 138,622,926 | 12 | 1 | null | null | null | null | UTF-8 | Java | false | false | 436 | java | package android.support.v7.transition;
import android.support.annotation.RestrictTo;
import android.support.annotation.RestrictTo.Scope;
import android.view.ViewGroup;
@RestrictTo({Scope.LIBRARY_GROUP})
public class ActionBarTransition {
private static final boolean TRANSITIONS_ENABLED = false;
private static final int TRANSITION_DURATION = 120;
public static void beginDelayedTransition(ViewGroup sceneRoot) {
}
}
| [
"[email protected]"
] | |
47d45ba6546702ebbae138bd72bdf2f7cecd323d | 2f5ba8ef75cfc152211a0d76efab2fad20799b81 | /Spring-Boot-Annotation/src/main/java/com/nguyendangkhoa25/condition/onclass/ConditionalOnClassService.java | 98b4506c456f129976fa11d88451160edd8ad097 | [] | no_license | nguyendangkhoa25/Spring-Boot-Training | 2ea9c3aa9b202ae189e687eb6d499775e0488a88 | dd72049c616b702c059c43dbb89e321a6147f861 | refs/heads/main | 2023-07-23T11:13:03.413872 | 2021-08-29T04:07:04 | 2021-08-29T04:07:04 | 394,508,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 92 | java | package com.nguyendangkhoa25.condition.onclass;
public class ConditionalOnClassService {
}
| [
"[email protected]"
] | |
d8c9acf8ad2e4a78160eab990a87d2c4f920b9f2 | 36cf99a400a30455d6302e3ffbffad2b9a4de972 | /src/ec/edu/ups/modelo/Telefono.java | ce61fcc1381b39e203a899539b4794983452fc85 | [
"MIT"
] | permissive | psidrovo/Practica03-IdrovoPaulPrueba | d3458c0708417f997fcb60666d47cb0917e0345e | 3a56e0713f8f9754b25e92e926384d7d5bc2629d | refs/heads/master | 2022-06-28T14:19:41.912527 | 2020-05-12T15:51:19 | 2020-05-12T15:51:19 | 263,319,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,202 | 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 ec.edu.ups.modelo;
/**
*
* @author Paul Idrovo
*/
public class Telefono {
private int codigo;
private String numero;
private String tipo;
private String operadora;
public int getCodigo() {
return codigo;
}
public void setCodigo(int codigo) {
this.codigo = codigo;
}
public String getNumero() {
return numero;
}
public void setNumero(String numero) {
this.numero = numero;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public String getOperadora() {
return operadora;
}
public void setOperadora(String operadora) {
this.operadora = operadora;
}
public Telefono() {
}
public Telefono(int codigo, String numero, String tipo, String operadora) {
this.codigo = codigo;
this.numero = numero;
this.tipo = tipo;
this.operadora = operadora;
}
}
| [
"[email protected]"
] | |
8b4ab36a9183dcc4df4cfb009b830e14cdd539a1 | eed1fa1ee66d130401eb10c356938527d6ee4f82 | /pinyougou_seckill_web/src/main/java/com/pinyougou/user/service/UserDetailServiceImpl.java | b38c1acbb7f85228b8ba9dcbab06b8f7cd682443 | [] | no_license | IslandWZ/rep1 | f162191e0ba1a9d4df411811fc50137f5d20dc16 | 986e603384471e08e6e068616062c9e70f987ecc | refs/heads/master | 2020-05-09T17:02:01.884550 | 2019-04-14T12:50:37 | 2019-04-14T12:50:37 | 181,292,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 983 | java | package com.pinyougou.user.service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
public class UserDetailServiceImpl implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
System.out.println("经过认证类:" + username);
List<GrantedAuthority> authorities = new ArrayList();
authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
return new User(username, "", authorities);
}
}
| [
"[email protected]"
] | |
ddb04300efefe9659864ea17e84a27ef3f49ecb4 | 1bb31f9b23b378a8e44e620dc2d732179cd5d789 | /app/src/test/java/com/edgar/doujinreader/ExampleUnitTest.java | bb8465d6c229409b60ffe295ea5c446b3de5d19a | [] | no_license | Hifairlady/DoujinReader | f339a48ad93469d8165a64a016b50d8092cc900e | b0688fb870593e83f6ef7fe91b9c029695b5367c | refs/heads/master | 2020-03-13T01:36:27.031833 | 2018-04-26T06:45:14 | 2018-04-26T06:45:14 | 130,907,061 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 394 | java | package com.edgar.doujinreader;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
31ae5cfd19a26554d649df256b6d93f3012bcfae | 627bb97a3f37764473f571b1b8395f8f65b44e97 | /src/de/fernunihagen/mathinf/kn/grossgasteiger/markovclassifier/javafx/Main.java | b598924d2f73210b91d6e8897a954057d610d660 | [] | no_license | calculon102/markov-classifier | 241e270a627ddd989c6382d00e4c462323d1035b | 7209185183a98429758b21e77fb04a1971e403ef | refs/heads/master | 2016-08-11T18:47:51.941464 | 2016-02-28T11:13:28 | 2016-02-28T11:13:28 | 52,715,941 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,976 | java | package de.fernunihagen.mathinf.kn.grossgasteiger.markovclassifier.javafx;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import de.fernunihagen.mathinf.kn.grossgasteiger.markovclassifier.logging.FileLogger;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
/**
* Entry-point for JavaFX-Application.
*
* @author Frank Großgasteiger <[email protected]>
*/
public final class Main extends Application {
/** Logger-Instance */
private static final Logger LOGGER = Logger.getLogger(Application.class.getName());
@Override
public void start(final Stage primaryStage) throws Exception {
final ResourceBundle resourceBundle = ResourceBundle.getBundle("de.fernunihagen.mathinf.kn.grossgasteiger.markovclassifier.javafx.MainWindow");
//
primaryStage.setTitle(resourceBundle.getString("app.title") + " - " + resourceBundle.getString("training.session.unsaved.title"));
//
final FXMLLoader mainWindowLoader = new FXMLLoader(getClass().getResource("MainWindow.fxml"), resourceBundle);
final Scene scene = mainWindowLoader.load();
primaryStage.setScene(scene);
//
primaryStage.getIcons().addAll(
new Image(Main.class.getResourceAsStream("icons/app.svg")),
new Image(Main.class.getResourceAsStream("icons/app_16.png")),
new Image(Main.class.getResourceAsStream("icons/app_24.png")),
new Image(Main.class.getResourceAsStream("icons/app_32.png")),
new Image(Main.class.getResourceAsStream("icons/app_64.png")));
//
primaryStage.show();
//
final MainController mainController = mainWindowLoader.getController();
mainController.setStage(primaryStage);
mainController.setHostServices(getHostServices());
}
public static void main(final String[] args) {
FileLogger.setup(Level.INFO);
LOGGER.info("Starting application.");
//
launch(args);
}
}
| [
"[email protected]"
] | |
338f5f7fb2d0b5f45817a4101e0bc8df4858c8e7 | 00e6cda6a8d689db84a5d274703b1e18c583b6ab | /book/Chapter11/StudentFiles/CodeInFigures/Dog.java | 60524c8b48ed0ef04ddffa74fcb746f485e9e04a | [] | no_license | cybertron97/CSC18A | 3861577179066d3eb47a90810fb19c8955cfc2c6 | 059ca5c4b93bab6aa30ef90f2dfe17b4aa3067bf | refs/heads/master | 2020-04-05T16:11:13.612753 | 2019-02-02T18:51:59 | 2019-02-02T18:51:59 | 157,000,584 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | public class Dog extends Animal
{
public void speak()
{
System.out.println("Woof!");
}
}
| [
"[email protected]"
] | |
52aca6d7e63edd8c93563020629515fbea44c91a | a276a3ab50b7caad04f71880ba68f61c0e844be2 | /Battleship/src/Ship.java | e7517a50dbd7d38f8f99501b68deaff230d2ceec | [] | no_license | ericpark22/Battleship | 43e0784c0c01c62db68b9c66d8ba881b4ffaf53d | 215ad4029081847e11c1246ba57a0ad141cd3665 | refs/heads/master | 2020-06-04T17:30:29.574568 | 2019-06-15T21:42:49 | 2019-06-15T21:42:49 | 192,125,351 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,007 | java | import java.util.ArrayList;
import java.util.List;
public abstract class Ship
{
private int length;
private List<Location> locations;
private List<Location> hitsTaken;
public Ship(int length)
{
this.length = length;
locations = new ArrayList<>();
hitsTaken = new ArrayList<>();
}
public void addLocation(Location... loc)
{
for(Location place : loc)
locations.add(place);
}
public List<Location> getLocations()
{
return locations;
}
/**
* Add Location loc to hitsTaken.
*
* @param loc
*/
public void takeHit(Location loc)
{
hitsTaken.add(loc);
}
/**
* Returns true if the number of hits taken is
* equal to the length of this ship.
*
* @return
*/
public boolean isSunk()
{
if(hitsTaken.size() == length)
return true;
return false;
}
}
| [
"[email protected]"
] | |
0ee16a637e9806832a71d4b2d9bd43e5e3cbd63f | c41399ac327e8e577f662c4e2485f8880b4f2a61 | /app-expert-server/src/main/java/uz/developer/appexpertserver1/service/PaymentService.java | ae84870b8734da28233ab8a5da0b43020f7b7f93 | [] | no_license | DilmurodRustamov/app-expert-server1 | 9ad1e6eb4e7b14812c28214319d9a343df057e60 | 8cea59f6275398005648fdb62a504a8ed83d6c96 | refs/heads/master | 2023-06-16T11:08:50.035816 | 2021-07-15T06:36:24 | 2021-07-15T06:36:24 | 383,572,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,652 | java | package uz.developer.appexpertserver1.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.rest.webmvc.ResourceNotFoundException;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import uz.developer.appexpertserver1.entity.PayType;
import uz.developer.appexpertserver1.entity.Payment;
import uz.developer.appexpertserver1.payload.ApiResponse;
import uz.developer.appexpertserver1.payload.ReqPayment;
import uz.developer.appexpertserver1.repository.PayTypeRepository;
import uz.developer.appexpertserver1.repository.PaymentRepository;
import uz.developer.appexpertserver1.repository.ProjectRepository;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
@Service
public class PaymentService {
@Autowired
PaymentRepository paymentRepository;
@Autowired
PayTypeRepository payTypeRepository;
@Autowired
ProjectRepository projectRepository;
public ApiResponse addPayment(ReqPayment reqPayment) {
Payment payment = new Payment(
payTypeRepository.findById(reqPayment.getPayTypeId()).orElseThrow(() -> new ResourceNotFoundException("Pay type not found!")),
projectRepository.findById(reqPayment.getProjectId()).orElseThrow(() -> new ResourceNotFoundException("Project not found!")),
reqPayment.getAmount(),
new Timestamp(new Date().getTime()));
paymentRepository.save(payment);
return new ApiResponse(true, "Added!");
}
public List<Payment> getAllPayment() {
return paymentRepository.findAll();
}
public Payment getPayment(UUID id) {
Optional<Payment> optionalPayment = paymentRepository.findById(id);
return paymentRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("payment not found!"));
}
public ApiResponse deletePayment(UUID id) {
if (paymentRepository.existsById(id)) {
paymentRepository.deleteById(id);
return new ApiResponse(true, " payment deleted");
}
return new ApiResponse(false, " payment not found");
}
//TODO buni to'ldirishim kk
public ApiResponse editPayment(UUID id, ReqPayment reqPayment){
Payment payment = new Payment();
if (paymentRepository.existsById(id)){
payment.setAmount(reqPayment.getAmount());
paymentRepository.save(payment);
return new ApiResponse(true,"payment edited!");
}
return new ApiResponse(false,"payment not found!");
}
}
| [
"[email protected]"
] | |
dc725d920e480ecacaa0b979f3452dfd1c8e1d86 | 2c623bedeb6e0b3039dc0762ed2c72383a2e03a6 | /platform/iov-factory-web/src/main/java/cn/yunovo/iov/factory/biz/statistics/assemble/model/StatisticsAssembleVO.java | 6cba54d1af1eaee9eb5a13d8aa98fc80f9bee3fc | [] | no_license | likenewton/factoryCenter | 9d45810c8fd2944e241a5007927dff6d933d0999 | b8f7ee33f533d0bf71ba19405092351ac50b8a08 | refs/heads/master | 2022-12-01T11:35:58.160920 | 2020-08-05T14:05:23 | 2020-08-05T14:05:23 | 285,305,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,065 | java | package cn.yunovo.iov.factory.biz.statistics.assemble.model;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.Digits;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
/**
* 展示对象:SampleVO,Sample一般为网页名称<br/>
*
* @author huangzz
*
*/
@ToString
@ApiModel(value="统计组织上报", description="统计组织上报查询对象")
public class StatisticsAssembleVO {
/**
* 主键ID
*/
@ApiModelProperty(value = "主键ID", name="id", hidden = true)
private Integer id;
/**
* 品牌名称(机构代码orgCode)
*/
@ApiModelProperty(value = "品牌名称(机构代码orgCode)", name="brandName")
@NotBlank(message="[brandName]为必填项")
@Size(min = 0, max = 64, message = "[brandName]长度在[0,64]之间")
private String brandName;
/**
* 工厂名称
*/
@ApiModelProperty(value = "工厂名称", name="factoryName")
@NotBlank(message="[factoryName]为必填项")
@Size(min = 0, max = 128, message = "[factoryName]长度在[0,128]之间")
private String factoryName;
/**
* 设备数量
*/
@ApiModelProperty(value = "设备数量", name="deviceNumber")
@Digits(fraction = 0, integer = Integer.MAX_VALUE)
private Integer deviceNumber;
/**
* 错误数量
*/
@ApiModelProperty(value = "错误数量", name="errorNumber")
private Integer errorNumber;
/**
* 上报时间
*/
@ApiModelProperty(value = "上报时间", name="reportTime")
private String reportTime;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间", name="createTime", hidden = true)
private String createTime;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间", name="updateTime", hidden = true)
private String updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getBrandName() {
return brandName;
}
public void setBrandName(String brandName) {
this.brandName = brandName;
}
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public Integer getDeviceNumber() {
return deviceNumber;
}
public void setDeviceNumber(Integer deviceNumber) {
this.deviceNumber = deviceNumber;
}
public Integer getErrorNumber() {
return errorNumber;
}
public void setErrorNumber(Integer errorNumber) {
this.errorNumber = errorNumber;
}
public String getReportTime() {
if(null != reportTime) {
return reportTime.substring(0, 10);
}
return reportTime;
}
public void setReportTime(String reportTime) {
this.reportTime = reportTime;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
}
| [
"[email protected]"
] | |
505db00fa959f92c9c682c238c417e57cbb1240d | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/jadx/tests/integration/generics/TestGenerics6.java | ee2fa79cafe7d7812e1e99d997362bfd3d8676ea | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 1,241 | java | package jadx.tests.integration.generics;
import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;
import jadx.tests.api.utils.JadxMatchers;
import java.util.Collection;
import org.junit.Assert;
import org.junit.Test;
public class TestGenerics6 extends IntegrationTest {
public static class TestCls {
public void test1(Collection<? extends TestGenerics6.TestCls.A> as) {
for (TestGenerics6.TestCls.A a : as) {
a.f();
}
}
public void test2(Collection<? extends TestGenerics6.TestCls.A> is) {
for (TestGenerics6.TestCls.I i : is) {
i.f();
}
}
private interface I {
void f();
}
private class A implements TestGenerics6.TestCls.I {
public void f() {
}
}
}
@Test
public void test() {
ClassNode cls = getClassNode(TestGenerics6.TestCls.class);
String code = cls.getCode().toString();
Assert.assertThat(code, JadxMatchers.containsOne("for (A a : as) {"));
// TODO: fix iterable arg type (unexpected cast to A in bytecode)
// assertThat(code, containsOne("for (I i : is) {"));
}
}
| [
"[email protected]"
] | |
c5fd584b8fd91660bf14b2fdaad4de0fa4edf194 | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/84/509.java | 06e43bca0feff96de92242878f9871b935057d04 | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 649 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
int i;
int k;
int[] n = new int[100];
int max;
int max2;
k = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));
for (i = 0;i < k;i++)
{
n[i] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));
}
i = 0;
max = 0;
max2 = 0;
do
{
if (n[i] > max)
{
max = n[i];
}
i++;
}while (i < k);
i = 0;
do
{
if (max2 <= n[i] & n[i] <= (max - 1))
{
max2 = n[i];
}
i++;
}while (i < k);
System.out.print(max);
System.out.print("\n");
System.out.print(max2);
System.out.print("\n");
return 0;
}
}
| [
"[email protected]"
] | |
b4ff80aafdc3bd2786371d78c89972c3559eb045 | 50cff846115c42bcb28a59ab05e62a15950dc2a8 | /J2SE/src/charactor/Heal.java | 6ae11b807428fadba0fd7bd21d4decafb4b2121d | [] | no_license | sherlockor/Java-study | 800c2437b9a5173c4e1e6e132c8f0dde759c5d91 | 60505f93d398e2b0d7cff79da080cf095b4148b4 | refs/heads/master | 2022-12-21T13:12:12.071135 | 2019-08-14T14:28:43 | 2019-08-14T14:28:43 | 159,778,241 | 0 | 0 | null | 2022-12-16T05:01:10 | 2018-11-30T06:24:15 | Roff | UTF-8 | Java | false | false | 69 | java | package charactor;
public interface Heal {
public void HealOP();
}
| [
"[email protected]"
] | |
2acad55b9154cf39347f5e80300aeb8b91933a22 | 51c209cb5da77d344156d9a20469364a254a3c09 | /src/main/java/com/example/cursomc/services/ClienteService.java | 1f279dfefd934d2e984b81ed9cbe4615c17de79f | [] | no_license | vanderborges/cursomc | 55842145a3fca8a4f27f428cccc0411d29d1bb33 | c42195243f950a5048ea5b5c4d022b1d634ff23e | refs/heads/master | 2021-08-17T09:45:11.165571 | 2021-01-07T14:55:32 | 2021-01-07T14:55:32 | 239,727,549 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,145 | java | package com.example.cursomc.services;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.example.cursomc.domain.Cidade;
import com.example.cursomc.domain.Cliente;
import com.example.cursomc.domain.Endereco;
import com.example.cursomc.domain.enums.TipoCliente;
import com.example.cursomc.dto.ClienteDTO;
import com.example.cursomc.dto.ClienteNewDTO;
import com.example.cursomc.repositories.ClienteRepository;
import com.example.cursomc.repositories.EnderecoRepository;
import com.example.cursomc.services.exceptions.DataIntegretyException;
import com.example.cursomc.services.exceptions.ObjectNotFoundException;
@Service
public class ClienteService {
@Autowired
private ClienteRepository repo;
@Autowired
private EnderecoRepository endRepo;
public Cliente find(Integer id) {
Optional<Cliente> obj = repo.findById(id);
return obj.orElseThrow( () -> new ObjectNotFoundException("Objeto não encontrado: " + id
+ ", Tipo: " + Cliente.class.getName()));
}
public List<Cliente> findAll() {
return repo.findAll();
}
public Cliente update(Cliente obj) {
Cliente objNew = find(obj.getId());
updateData(objNew, obj);
return repo.save(objNew);
}
public void delete(Integer id) {
try {
repo.deleteById(id);
} catch (DataIntegrityViolationException e) {
throw new DataIntegretyException("Não é possivel excluir uma Cliente");
}
}
public Page<Cliente> findPage(Integer page, Integer linesPerPage, String orderBy, String direction) {
PageRequest pageRequest = PageRequest.of(page, linesPerPage, Direction.valueOf(direction), orderBy);
return repo.findAll(pageRequest);
}
public Cliente fromDTO (ClienteDTO objDto) {
return new Cliente(objDto.getId(), objDto.getNome(), objDto.getEmail(), null, null);
}
public Cliente fromDTO (ClienteNewDTO objDto) {
Cliente cli = new Cliente(null, objDto.getNome(), objDto.getEmail(), objDto.getCpfOuCnpj(), TipoCliente.toEnum(objDto.getTipo()));
Cidade cidade = new Cidade(objDto.getCidadeId(), null, null);
Endereco end = new Endereco(null, objDto.getLogradouro(), objDto.getNumero(), objDto.getComplemento(), objDto.getBairro(), objDto.getCep(), cli, cidade);
cli.getEnderecos().add(end);
cli.getTelefones().add(objDto.getTelefone1());
if (objDto.getTelefone2() != null) {
cli.getTelefones().add(objDto.getTelefone2());
}
if (objDto.getTelefone3() != null) {
cli.getTelefones().add(objDto.getTelefone3());
}
return cli;
}
@Transactional
public Cliente insert(Cliente obj) {
obj.setId(null);
obj = repo.save(obj);
endRepo.saveAll(obj.getEnderecos());
return obj;
}
private void updateData(Cliente objNew, Cliente obj) {
objNew.setNome(obj.getNome());
objNew.setEmail(obj.getEmail());
}
}
| [
"[email protected]"
] | |
8ee320b93746339efb45226ea91e747058a469f2 | 46639889543315094ad36e493f014f3641eb31f6 | /JstxGWT/src/main/java/co/q64/jstx/gwt/ui/ace/AceCompletion.java | 990fa0274e05fb2ac842341415af5a6e63219220 | [] | no_license | richax/Jstx | b7809c680a6e5490ee8739867fa95d1356826ba0 | 699e45c9b30ecd1190bee3bbcdc0899669c54748 | refs/heads/master | 2023-03-15T16:45:38.709196 | 2018-04-12T03:42:44 | 2018-04-12T03:42:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,784 | java | // Copyright (c) 2011-2014, David H. Hovemeyer <[email protected]>
// Copyright (c) 2014, Chris Ainsley <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package co.q64.jstx.gwt.ui.ace;
import com.google.gwt.core.client.JavaScriptObject;
/**
* A completion proposed by an {@link AceCompletionProvider}.
*
* <strong>Warning</strong>: this is an experimental feature of AceGWT.
* It is possible that the API will change in an incompatible way
* in future releases.
*/
public abstract class AceCompletion {
/**
* A completion maps to a generated JavaScript object in a variety of formats depending on the concrete implementation
* @return A non-null JavaScript object.
*/
abstract JavaScriptObject toJsObject();
} | [
"[email protected]"
] | |
929adf8b1863d349e0f7e2fbde38404accaa1655 | e25cdaa1cf567c50562cc3b39cb4daf030800c39 | /src/main/java/com/sb/springsecurity/validators/UserValidator.java | 24dec2a0b39efeb9a794b28059aa208214c3b05b | [] | no_license | Stason1o/Spring-MVC-Security | 997dc0df5822cdaac9ef8aa31f73c61ddd4425c3 | 9d99243db2401b952c3dcf1828c1640bf4ebca0d | refs/heads/master | 2021-01-19T11:21:20.815571 | 2017-10-04T07:52:23 | 2017-10-04T07:52:23 | 87,957,591 | 1 | 0 | null | 2017-10-04T07:52:24 | 2017-04-11T16:43:43 | Java | UTF-8 | Java | false | false | 2,621 | java | package com.sb.springsecurity.validators;
import com.sb.springsecurity.model.User;
import com.sb.springsecurity.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
/**
* Created by Stanislav Bogdanschi on 16.04.2017.
*/
@Component
public class UserValidator implements Validator {
private static final String EMAIL_REGEX = "^(?!\\.)(([^\\r\\\\]|\\\\[\\r\\\\])*|([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?<!\\.)\\.)*)(?<!\\.)@[a-z0-9][\\w.-]*[a-z0-9]\\.[a-z][a-z.]*[a-z]$";
@Autowired
private UserService userService;
@Override
public boolean supports(Class<?> aClass) {
return User.class.equals(aClass);
}
@Override
public void validate(Object o, Errors errors) {
User user = (User) o;
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "firstName", "Required");
if(user.getFirstName().length() < 2 || user.getFirstName().length() > 32){
errors.rejectValue("firstName", "Size.userForm.firstName");
}
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "lastName", "Required");
if(user.getLastName().length() < 2 || user.getLastName().length() > 32){
errors.rejectValue("lastName", "Size.userForm.lastName");
}
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "email", "Required");
if(userService.findByEmail(user.getEmail()) != null){
errors.rejectValue("email", "Duplicate.userForm.email");
}
if(!user.getEmail().matches(EMAIL_REGEX)){
errors.rejectValue("email", "Wrong.userFrom.email");
}
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "username", "Required");
if(user.getUsername().length() < 8 || user.getUsername().length() > 32) {
errors.rejectValue("username", "Size.userFrom.username");
}
if(userService.findByUsername(user.getUsername()) != null){
errors.rejectValue("username", "Duplicate.userForm.username");
}
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "Required");
if(user.getPassword().length() < 8 || user.getPassword().length() > 32) {
errors.rejectValue("password", "Size.userForm.password");
}
if(!user.getConfirmPassword().equals(user.getPassword())) {
errors.rejectValue("confirmPassword", "Different.userForm.password");
}
}
}
| [
"[email protected]"
] | |
66879f28fb98a77cf2f62f90141eab823f190756 | 4bd27fa82e3204f9822fa9499376e6649ac3eb6a | /abora-gold/src/main/java/info/dgjones/abora/gold/java/missing/smalltalk/TypeDescription.java | fde4048c42d5956e670426e38391a7770f9012d4 | [
"MIT"
] | permissive | jonesd/udanax-gold2java | 089007df1b48272ef85f3b615e4d5180ff41c35e | def868447736dcf0928d5e3322ceeaa056463731 | refs/heads/master | 2022-01-25T11:45:24.907299 | 2022-01-07T03:07:41 | 2022-01-07T03:33:35 | 16,194,337 | 6 | 18 | MIT | 2022-01-07T03:42:40 | 2014-01-24T03:51:32 | Java | UTF-8 | Java | false | false | 1,272 | java | /**
* The MIT License
* Copyright (c) 2003 David G Jones
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package info.dgjones.abora.gold.java.missing.smalltalk;
public class TypeDescription {
public TypeDescription() {
super();
}
}
| [
"[email protected]"
] | |
5a7437381e710a52d461eaed905bf49ce32a1e4a | 6b27d3bfea6bb9425eb9e0f41c764cb374e025fc | /app/src/main/java/com/example/java2kotlinpractice/lesson2/PokemonData.java | 8acb1b889a315d532c2bb249cc30cb58030aa2df | [] | no_license | AAkira/Java2KotlinPractice | 199a3be895b2a7fa4127ee0c52ad7b2ee8f9b535 | eb7ea5f7cb2e57945816fd82234caac1b0bb2914 | refs/heads/master | 2021-01-19T13:55:50.028136 | 2017-09-18T06:31:22 | 2017-09-18T14:15:29 | 100,863,594 | 13 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,496 | java | package com.example.java2kotlinpractice.lesson2;
/**
* このclassをdata classに変更してみましょう
* https://kotlinlang.org/docs/reference/data-classes.html
*
* Hint : 物凄く短くなります
*/
public class PokemonData {
final private String name;
private int level;
private int hp;
public PokemonData(String name, int hp) {
this(name, 5, hp);
}
public PokemonData(String name, int level, int hp) {
this.name = name;
this.level = level;
this.hp = hp;
}
public String getName() {
return name;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public int getHp() {
return hp;
}
public void setHp(int hp) {
this.hp = hp;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PokemonData)) {
return false;
}
PokemonData that = (PokemonData) o;
if (level != that.level) {
return false;
}
if (hp != that.hp) {
return false;
}
return name != null ? name.equals(that.name) : that.name == null;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + level;
result = 31 * result + hp;
return result;
}
} | [
"[email protected]"
] | |
b1dead23836c66734b1d7f3fcc269c91ba22144e | bc2545ac545c0b45f6f62640e1171071996a03ef | /shirodemo/src/main/java/cn/wolfcode/domain/SystemDictionary.java | beb66ce199ac282df60b4e40acce87453807ff3d | [] | no_license | EDT777/Background-Development-Practice | 2f249042b21237dabba715312a9c10063e182ac4 | 9c12b077c811a43eb7f2f4864818909a971c473c | refs/heads/master | 2022-12-27T09:18:05.237853 | 2021-01-09T12:06:36 | 2021-01-09T12:06:36 | 253,843,855 | 0 | 0 | null | 2022-12-16T15:36:44 | 2020-04-07T16:00:27 | HTML | UTF-8 | Java | false | false | 658 | java | package cn.wolfcode.domain;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import java.util.HashMap;
/**
* 字典目录
*/
@Setter
@Getter
public class SystemDictionary extends BaseDomain{
/** 编码*/
private String sn;
/** 标题*/
private String title;
/** 简介*/
private String intro;
//转为json格式的字符串
public String getJson(){
HashMap map = new HashMap(); //更安全,页面要什么就给什么
map.put("id",id);
map.put("title",title);
map.put("sn",sn);
map.put("intro",intro);
return JSON.toJSONString(map);
}
} | [
"[email protected]"
] | |
67a35fd1d1d636cce475730d9c8af47e5a516053 | 4527cd47a2be21601176d0f035ba4ed2ff1058ce | /src/com/ids/idtma/config/ProjectConfig.java | f5d0a4a8b6452d477a8b6574e0ecf2a7bbbccad9 | [] | no_license | XieZhiXian1/MyIDT | 2e007a0246c1705e3dd0836a3102540a96676e88 | 148751891a7577385d42775c7c218e0266e4d693 | refs/heads/master | 2021-01-18T18:37:31.069414 | 2016-06-08T10:54:13 | 2016-06-08T10:54:13 | 60,600,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package com.ids.idtma.config;
public final class ProjectConfig {
//logo的显示与否
public final static boolean DEBUG = false;
//是否捕捉未知异常
public final static boolean APP_UNCAUGHT_EXCEPTION_HANDLER_OPEN = true;
//呼叫错误代码,是否捕捉
public final static boolean UI_CAUSE_SHOW = false;
}
| [
"[email protected]"
] | |
a65ad6be098b6e95ced8d7caa6028495461756ee | 04cbf73cc715fafc2859fbfa677bf493ea8cfe46 | /TransactionalDatabase/tdb-server/src/main/java/com/harystolho/tdb_server/cluster/command/InsertItemCommand.java | 75deb10250c605224eb5fffed832370855cefe4d | [] | no_license | victorbrndls/LearningProjects | 914133dcc9474ffa2bcbe1053b6600e0e9bd7e9d | fe8c9bf5ea1e9dd295c997c82e4db8c1e3e4354c | refs/heads/master | 2022-12-29T13:18:25.294901 | 2019-08-01T18:44:37 | 2019-08-01T18:44:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,360 | java | package com.harystolho.tdb_server.cluster.command;
import java.util.HashMap;
import java.util.Map;
import com.harystolho.tdb_server.cluster.Cluster;
import com.harystolho.tdb_server.cluster.query.ItemFieldQuery;
import com.harystolho.tdb_server.transaction.LogBlock;
import com.harystolho.tdb_shared.QueryResult;
public class InsertItemCommand extends TransactionalClusterCommand {
private Map<String, String> values;
public InsertItemCommand(long transactionId, String cluster, Map<String, String> values) {
super(cluster, transactionId);
this.values = values;
}
public Map<String, String> getValues() {
return new HashMap<String, String>(values);
}
@Override
public QueryResult execute(Cluster cluster) {
return cluster.handle(this);
}
public LogBlock toLogBlock(long itemId) {
Map<String, String> valuesToSave = new HashMap<>();
valuesToSave.put("_cluster", this.getClusterName());
valuesToSave.put("id", String.valueOf(itemId));
return new LogBlock(transactionId, "INSERT_ITEM", valuesToSave);
}
@SuppressWarnings("unchecked")
public static DeleteItemCommand undo(LogBlock logBlock) {
Map<String, String> values = (Map<String, String>) logBlock.getObject();
String cluster = values.remove("_cluster");
return new DeleteItemCommand(NO_TRANSACTION, cluster, ItemFieldQuery.equal("_id", values.get("id")));
}
}
| [
"[email protected]"
] | |
318e9d887a7eb4d9930aa8a11881cdb6b93e9396 | 74f723bee36229fa9d447e63d99c70d2a62dc193 | /roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/AssembleDaoImpl.java | f0be6b1bc3c091d89f489c99780e70e94ac1ee57 | [
"MIT"
] | permissive | Arronzheng/roncoo-education | 714568d864d5098052c44b34d9c4f730fc551af9 | 1afb481d4269597e1cebc339a8d257caaad9279a | refs/heads/master | 2022-09-13T13:45:22.315597 | 2020-07-29T01:52:22 | 2020-07-29T01:52:22 | 220,367,025 | 1 | 0 | MIT | 2022-09-01T23:15:24 | 2019-11-08T02:05:26 | Java | UTF-8 | Java | false | false | 4,936 | java |
package com.roncoo.education.course.service.dao.impl;
import com.roncoo.education.course.service.common.bo.AssembleIngBO;
import com.roncoo.education.course.service.dao.AssembleDao;
import com.roncoo.education.course.service.dao.impl.mapper.AssembleMapper;
import com.roncoo.education.course.service.dao.impl.mapper.entity.Assemble;
import com.roncoo.education.course.service.dao.impl.mapper.entity.AssembleCourse;
import com.roncoo.education.course.service.dao.impl.mapper.entity.AssembleExample;
import com.roncoo.education.util.base.Page;
import com.roncoo.education.util.base.PageUtil;
import com.roncoo.education.util.tools.IdWorker;
import com.xiaoleilu.hutool.util.CollectionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
/**
* 拼团表 服务实现类
*
* @author husend
* @since 2020-04-14
*/
@Repository
public class AssembleDaoImpl implements AssembleDao {
@Autowired
private AssembleMapper assembleMapper;
@Override
public int save(Assemble record) {
record.setId(IdWorker.getId());
return this.assembleMapper.insertSelective(record);
}
@Override
public int deleteById(Long id) {
return this.assembleMapper.deleteByPrimaryKey(id);
}
@Override
public int updateById(Assemble record) {
return this.assembleMapper.updateByPrimaryKeySelective(record);
}
@Override
public Assemble getById(Long id) {
return this.assembleMapper.selectByPrimaryKey(id);
}
@Override
public Page<Assemble> listForPage(int pageCurrent, int pageSize, AssembleExample example) {
int count = this.assembleMapper.countByExample(example);
pageSize = PageUtil.checkPageSize(pageSize);
pageCurrent = PageUtil.checkPageCurrent(count, pageSize, pageCurrent);
int totalPage = PageUtil.countTotalPage(count, pageSize);
example.setLimitStart(PageUtil.countOffset(pageCurrent, pageSize));
example.setPageSize(pageSize);
return new Page<Assemble>(count, totalPage, pageCurrent, pageSize, this.assembleMapper.selectByExample(example));
}
@Override
public void updateByAssembleId(Assemble a) {
AssembleExample example = new AssembleExample();
AssembleExample.Criteria c = example.createCriteria();
c.andAssembleIdEqualTo(a.getAssembleId());
this.assembleMapper.updateByExampleSelective(a, example);
}
@Override
public List<Assemble> getByAssembleId(Long id) {
AssembleExample example = new AssembleExample();
AssembleExample.Criteria c = example.createCriteria();
c.andAssembleIdEqualTo(id).andStatusEqualTo(1);
return this.assembleMapper.selectByExample(example);
}
@Override
public List<Assemble> getByCid(Long id, Long UserNo) {
AssembleExample example = new AssembleExample();
AssembleExample.Criteria c = example.createCriteria();
c.andCidEqualTo(id).andStatusEqualTo(1).andIsAsmerEqualTo(1);
return this.assembleMapper.selectByExample(example);
}
@Override
public List<Assemble> getByUid(Long userNo) {
AssembleExample example = new AssembleExample();
AssembleExample.Criteria c = example.createCriteria();
c.andUidEqualTo(userNo);
return this.assembleMapper.selectByExample(example);
}
@Override
public Assemble getOrderId(Long orderNo) {
AssembleExample example = new AssembleExample();
AssembleExample.Criteria c = example.createCriteria();
c.andOrderIdEqualTo(orderNo);
example.setOrderByClause("add_time desc");
List<Assemble> assembleList = this.assembleMapper.selectByExample(example);
if (CollectionUtil.isNotEmpty(assembleList)) {
return assembleList.get(0);
}
return null;
}
@Override
public Assemble getByUserNoAndPidAndStatus(AssembleIngBO assembleIngBO) {
AssembleExample example = new AssembleExample();
AssembleExample.Criteria c = example.createCriteria();
List<Integer> status = new ArrayList<>();
status.add(1);
status.add(4);
c.andUidEqualTo(assembleIngBO.getUserNo()).andPidEqualTo(assembleIngBO.getPid())
.andStatusIn(status);
example.setOrderByClause("add_time desc");
List<Assemble> assembleList = this.assembleMapper.selectByExample(example);
if (CollectionUtil.isNotEmpty(assembleList)) {
return assembleList.get(0);
}
return null;
}
@Override
public void updateByOrderId(Assemble assemble) {
AssembleExample example = new AssembleExample();
AssembleExample.Criteria c = example.createCriteria();
c.andOrderIdEqualTo(assemble.getOrderId());
this.assembleMapper.updateByExampleSelective(assemble, example);
}
}
| [
"[email protected]"
] | |
84995915e20fc8b07105ec1e38b98909b5d24d0e | f723e5c6496b7cb530f2c2da08183b195480f5de | /easy-spring-boot-starter/src/main/java/com/easy/EasyApplication.java | 8c72df26fbd4473eac45d18a4a2a365242c08f39 | [] | no_license | javaee02228/Easy | 9bd97433dd7bf3b830f66cbdf082e92ae7b65fef | c72ef1af67e9fbcf3147ef124da07ff5664af552 | refs/heads/master | 2020-03-30T06:06:34.914793 | 2018-09-27T09:11:54 | 2018-09-27T09:11:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package com.easy;
import com.easy.context.EasyContext;
import com.easy.context.Platform;
import com.easy.event.listener.EasyStartListener;
import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.ResourceLoader;
/**
* @Description: the Description of this class
* @Author: jp
* @CreateDate: 2018/9/2
* @Version: ${project.version}
*/
public class EasyApplication extends SpringApplication {
public EasyApplication(Class... primarySources) {
super((ResourceLoader)null, primarySources);
}
/*public EasyApplication(Class<?>[] primarySources) {
super(primarySources);
}*/
public EasyApplication(ResourceLoader resourceLoader, Class<?>[] primarySources) {
super(resourceLoader, primarySources);
}
{
this.addListeners(new EasyStartListener());
}
}
| [
"[email protected]"
] | |
5a9fb19a44df5bc4d63abf93e1c40455b4a57002 | c52772715b4e3e72cdbd605846a3f52d24bc8599 | /src/net/sourceforge/plantuml/math/AsciiMathOld.java | 65883d98afb56cebc2863cc30a7ed90357a8b7bc | [
"MIT"
] | permissive | vsujeesh/plantuml-mit | c172b089441a98e943c6acc559a4506d775da5a0 | e7133c02afdda24b556a8ddb7b5cc416cc0365d6 | refs/heads/master | 2022-02-21T22:23:47.415151 | 2019-10-14T17:03:26 | 2019-10-14T17:03:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,399 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Licensed under The MIT License (Massachusetts Institute of Technology License)
*
* See http://opensource.org/licenses/MIT
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Author: Arnaud Roques
*/
package net.sourceforge.plantuml.math;
import java.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.Dimension2DDouble;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
public class AsciiMathOld {
private static final String ASCIIMATH_PARSER_JS_LOCATION = "/net/sourceforge/plantuml/math/";
private static String JAVASCRIPT_CODE;
static {
try {
final BufferedReader br = new BufferedReader(new InputStreamReader(
AsciiMathOld.class.getResourceAsStream(ASCIIMATH_PARSER_JS_LOCATION + "AsciiMathParser.js"), "UTF-8"));
final StringBuilder sb = new StringBuilder();
String s = null;
while ((s = br.readLine()) != null) {
sb.append(s);
sb.append(BackSlash.NEWLINE);
}
br.close();
JAVASCRIPT_CODE = sb.toString();
} catch (Exception e) {
e.printStackTrace();
}
}
private final Node mathML;
public AsciiMathOld(String form) throws IOException, ScriptException, ParserConfigurationException,
NoSuchMethodException {
final ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
engine.eval(JAVASCRIPT_CODE);
final Invocable inv = (Invocable) engine;
final Document dom = createDocument();
mathML = (Node) inv.invokeFunction("plantuml", dom, form);
}
private Document createDocument() throws ParserConfigurationException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.newDocument();
return document;
}
private Dimension2D dim;
public String getSvg() throws IOException, ClassNotFoundException, NoSuchMethodException, SecurityException,
IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchFieldException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final Class<?> clConverter = Class.forName("net.sourceforge.jeuclid.converter.Converter");
final Method getInstance = clConverter.getMethod("getInstance");
final Object conv = getInstance.invoke(null);
final Method convert = clConverter.getMethod("convert", Node.class, OutputStream.class, String.class,
Class.forName("net.sourceforge.jeuclid.LayoutContext"));
dim = (Dimension2D) convert.invoke(conv, mathML, baos, "image/svg+xml", getLayout());
return new String(baos.toByteArray());
}
public BufferedImage getImage() throws IOException, ClassNotFoundException, NoSuchMethodException,
SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException,
NoSuchFieldException {
final Class<?> clConverter = Class.forName("net.sourceforge.jeuclid.converter.Converter");
final Method getInstance = clConverter.getMethod("getInstance");
final Object conv = getInstance.invoke(null);
// final LayoutContext layoutContext = LayoutContextImpl.getDefaultLayoutContext();
final Method render = clConverter.getMethod("render", Node.class,
Class.forName("net.sourceforge.jeuclid.LayoutContext"));
final BufferedImage result = (BufferedImage) render.invoke(conv, mathML, getLayout());
dim = new Dimension2DDouble(result.getWidth(), result.getHeight());
return result;
}
private Object getLayout() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, IllegalArgumentException, NoSuchFieldException, SecurityException {
final Class<?> clLayoutContextIml = Class.forName("net.sourceforge.jeuclid.context.LayoutContextImpl");
final Class<?> clParameter = Class.forName("net.sourceforge.jeuclid.context.Parameter");
final Method getDefaultLayoutContext = clLayoutContextIml.getMethod("getDefaultLayoutContext");
final Object layoutContext = getDefaultLayoutContext.invoke(null);
final Method setParameter = clLayoutContextIml.getMethod("setParameter", clParameter, Object.class);
setParameter.invoke(layoutContext, clParameter.getDeclaredField("SCRIPTSIZEMULTIPLIER").get(null), (float) 2);
return layoutContext;
}
public Dimension2D getDimension() {
return dim;
}
}
| [
"[email protected]"
] | |
a17168bbd6b4a4b587140c3301ac5001dd145ddd | 6c73e9676c16dfe778c23f1b2ec11f1869517257 | /server/src/main/java/org/hackduke/HelloWorldController.java | 90dcd74229515caca19499692c87f5037cf186ad | [] | no_license | zrehmani3/hackduke-fall-2015 | cd5c564d76bef9584d0c01161fa032e840515453 | c5c367e2f3b04f0c99f5f8e404d3b19e9b4332b9 | refs/heads/master | 2021-01-19T04:43:58.736560 | 2015-11-11T16:27:35 | 2015-11-11T16:27:46 | 50,521,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,035 | java | package org.hackduke;
import org.hackduke.db.ItemDb;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@Controller
public class HelloWorldController {
@RequestMapping("/add_item")
public String addItem(@RequestParam("item_name") String itemName) {
ItemDb itemDb = new ItemDb();
itemDb.setFoodBankId(1);
itemDb.setName(itemName);
itemDb.setQuantity(0);
itemDb.insert();
itemDb.close();
return "redirect:/dashboard";
}
@RequestMapping("/delete_item")
public String deleteItem(@RequestParam("item") int id) {
ItemDb itemDb = new ItemDb();
itemDb.setId(id);
itemDb.delete();
itemDb.close();
return "redirect:/dashboard";
}
@RequestMapping("/qty_item")
public String updateItem(@RequestParam("item") int id, @RequestParam("qty") int qty) {
ItemDb itemDb = new ItemDb();
itemDb.loadById(id);
itemDb.setQuantity(itemDb.getQuantity() + qty);
if (itemDb.getQuantity() < 0) {
itemDb.setQuantity(0);
}
itemDb.updateQuantity();
itemDb.close();
return "redirect:/dashboard";
}
@RequestMapping("/dashboard")
public String greeting(Model model) {
List<Item> items = new LinkedList<>();
List<Map<String, Object>> topTen = new LinkedList<>();
ItemDb itemDb = new ItemDb();
if (itemDb.loadByFoodBankId(1)) {
do {
Item item = new Item();
item.id = itemDb.getId();
item.name = itemDb.getName();
item.quantity = itemDb.getQuantity();
items.add(item);
} while (itemDb.next());
}
if (itemDb.loadTopTen()) {
do {
HashMap<String, Object> map = new HashMap<>();
map.put("label", itemDb.getName());
map.put("data", itemDb.getQuantity());
topTen.add(map);
} while (itemDb.next());
}
itemDb.close();
int totalQty = 0;
int qtyInPie = 0;
for (Map<String, Object> it : topTen) {
qtyInPie += (Integer) it.get("data");
}
for (Item it : items) {
totalQty += it.quantity;
}
HashMap<String, Object> other = new HashMap<>();
other.put("label", "Other");
other.put("data", totalQty - qtyInPie);
topTen.add(other);
model.addAttribute("topten", topTen);
model.addAttribute("items", items);
model.addAttribute("orgname", "Atlanta Community Food Bank");
return "tables";
}
private static class Item {
public int id;
public String name;
public int quantity;
}
}
| [
"[email protected]"
] | |
fed6891f9fd5731f8168dca175b628f719927a16 | c20fc7c16bf79f6bf6152e22c9d169866ab3a503 | /cfgstructure/src/petter/cfg/expression/types/Void.java | 6e0405c84843bde28251a4a189ad62e914d4eaae | [] | no_license | tsusho/simpleC-ssa | d10cc84323e8dc4cf4743396738b971a2ee54e33 | 464cdcb76711292ccbb8954bac2a446fec1695d4 | refs/heads/master | 2020-09-24T09:04:29.406400 | 2019-03-07T12:27:38 | 2019-03-07T12:27:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 755 | 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 petter.cfg.expression.types;
/**
*
* @author petter
*/
public class Void extends Type {
private Void() {}
private static Void singleton = new Void();
public static Void create(){
return singleton;
}
@Override
public boolean equals(Object obj) {
return obj==singleton;
}
@Override
public String toString() {
return "void"; //To change body of generated methods, choose Tools | Templates.
}
@Override
public boolean isBasicType() {
return true;
}
}
| [
"[email protected]"
] | |
f63e2f196fcc49985d60278d6f0593070490429e | 6b2e1f5fdd3668b32c471ff872f03f043b18d5f7 | /mutants/dataset/lcs_length/4093/LCS_LENGTH.java | dea7416ae0676b1dcc29c787f3d47a081931cfe7 | [] | no_license | mou23/Impact-of-Similarity-on-Repairing-Small-Programs | 87e58676348f1b55666171128ecced3571979d44 | 6704d78b2bc9c103d97bcf55ecd5c12810ba2851 | refs/heads/master | 2023-03-25T10:42:17.464870 | 2021-03-20T04:55:17 | 2021-03-20T04:55:17 | 233,513,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,956 | java | package buggy_java_programs;
import java.util.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author derricklin
*/
public class LCS_LENGTH {
public static Integer lcs_length(String s, String t) {
// make a Counter
// pair? no! just hashtable to a hashtable.. woo.. currying
Map<Integer, Map<Integer,Integer>> dp = new HashMap<Integer,Map<Integer,Integer>>();
// just set all the internal maps to 0
for (int i=0; i < s.length(); i++) {
Map<Integer,Integer> initialize = new HashMap<Integer,Integer>();
dp.put(i, initialize);
for (int j=0; j < t.length(); j++) {
Map<Integer,Integer> internal_map = dp.get(i);
internal_map.put(j,0);
dp.put(i, java.util);
}
}
// now the actual code
for (int i=0; i < s.length(); i++) {
for (int j=0; j < t.length(); j++) {
if (s.charAt(i) == t.charAt(j)) {
if (dp.containsKey(i-1)) {
Map<Integer, Integer> internal_map = dp.get(i);
int insert_value = dp.get(i-1).get(j) + 1;
internal_map.put(j, insert_value);
dp.put(i,internal_map);
} else {
Map<Integer, Integer> internal_map = dp.get(i);
internal_map.put(j,1);
dp.put(i,internal_map);
}
}
}
}
if (!dp.isEmpty()) {
List<Integer> ret_list = new ArrayList<Integer>();
for (int i=0; i<s.length(); i++) {
ret_list.add(!dp.get(i).isEmpty() ? Collections.max(dp.get(i).values()) : 0);
}
return Collections.max(ret_list);
} else {
return 0;
}
}
}
| [
"[email protected]"
] | |
b30a19b0103a147a12d49639301d17e60c5266b3 | 5ba57872428179aa560552f9833855e8a1b1e757 | /src/main/java/lddecker/boardgame/board/impl/FancyCell.java | d4df456e18ea666fc607c8e37f261375fd85c78b | [] | no_license | lddecker/boardgame | 4f2354ab1e540c9d03f77ce85d55cf5f63137ccf | ab62a37b6388ebe0566536dd6318525945798c42 | refs/heads/master | 2020-06-10T20:28:52.858600 | 2017-01-09T15:46:06 | 2017-01-09T15:46:06 | 75,883,413 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,513 | java | package lddecker.boardgame.board.impl;
import lddecker.boardgame.board.AbstractCell;
import javax.swing.*;
import java.awt.*;
public class FancyCell extends AbstractCell {
private JButton _button;
private final Insets _buttonMargin = new Insets(0, 0, 0, 0);
private final Color _defaultCellBackground = Color.WHITE;
public FancyCell() {
_button = new JButton();
_button.setMargin(_buttonMargin);
_button.setBackground(_defaultCellBackground);
_button.setText("");
}
public JButton getButton() {
return _button;
}
@Override
protected void updateCellValue(Character newVal) {
_button.setText(newVal.toString());
}
@Override
protected void resetImpl() {
_button.setText("");
}
@Override
protected void tripleScoreModifierImpl() {
_button.setBackground(Color.RED);
}
@Override
protected void doubleScoreModifierImpl() {
_button.setBackground(Color.PINK);
}
@Override
public void doubleScoreModifier(Object modifier) {
super.doubleScoreModifier(modifier);
_button.setBackground((Color) modifier);
}
@Override
public void tripleScoreModifier(Object modifier) {
super.tripleScoreModifier(modifier);
_button.setBackground((Color) modifier);
}
public void setAction(Action action) {
_button.setAction(action);
}
public Action getAction() {
return _button.getAction();
}
}
| [
"[email protected]"
] | |
7f612f12ccf73ba0e445a1fa5d85b76c53ff1efe | c7ff844a2ac95501e38a65d2a5b1c674d20f650c | /ashigel-compiler/src/test/java/com/asakusafw/compiler/flow/processor/operator/MasterJoinUpdateFlowImpl.java | 48ea2a01a83371896bbc2eee1d45afc79ed6ba21 | [
"Apache-2.0"
] | permissive | tottokomakotaro/asakusafw | 3a16cf125302169fecb9aec5df2c8a387663415c | fd237fc270165eeda831d33f984451b684d5356f | refs/heads/master | 2021-01-18T05:34:48.764909 | 2011-07-28T05:48:55 | 2011-07-28T05:49:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,036 | java | /**
* Copyright 2011 Asakusa Framework Team.
*
* 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.asakusafw.compiler.flow.processor.operator;
import javax.annotation.Generated;
/**
* {@link MasterJoinUpdateFlow}に関する演算子実装クラス。
*/
@Generated("OperatorImplementationClassGenerator:0.0.1") public class MasterJoinUpdateFlowImpl extends
MasterJoinUpdateFlow {
/**
* インスタンスを生成する。
*/
public MasterJoinUpdateFlowImpl() {
return;
}
} | [
"[email protected]"
] | |
1bfebf5be98c2e7dab5f26d04f6e3ca9f8575cd1 | c76a75c5dd7484983d912fa44ab81fecedd43fcd | /build-android/app/src/androidTest/java/edu/cornell/gdiac/helloworld/ExampleInstrumentedTest.java | 31d2679210a8df00f12c3846e21d29420fdd43bf | [] | no_license | apurvsethi/CUGL_AI | 224e69f394d52332e6b049b1710f47f08519d894 | 4e10e77ad7b439813c2ba564eebb4e3aa6867318 | refs/heads/master | 2021-09-22T14:19:33.472215 | 2018-09-11T02:03:14 | 2018-09-11T02:03:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 783 | java | package edu.cornell.gdiac.helloworld;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("edu.cornell.gdiac.helloworld", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
4a2a0d70cd029af3e3bab79e5886c31c59387177 | b0c61bd5c1ea165b91e8682dcd179f7a8d3bf9e8 | /build/generated/source/r/androidTest/debug/com/devin/core/R.java | 5a7f608e3bd76c3d128a5f42235708b2974acf8b | [] | no_license | 821917380/crash_report | 74e99fe7099e516382e432dac971bc7dad79f497 | 72d734823157ec864a78052eb363705afed31726 | refs/heads/master | 2021-01-19T23:20:10.354930 | 2017-04-21T09:33:44 | 2017-04-21T09:33:44 | 88,939,635 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 87,059 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.devin.core;
public final class R {
public static final class anim {
public static final int abc_fade_in = 0x7f040000;
public static final int abc_fade_out = 0x7f040001;
public static final int abc_grow_fade_in_from_bottom = 0x7f040002;
public static final int abc_popup_enter = 0x7f040003;
public static final int abc_popup_exit = 0x7f040004;
public static final int abc_shrink_fade_out_from_bottom = 0x7f040005;
public static final int abc_slide_in_bottom = 0x7f040006;
public static final int abc_slide_in_top = 0x7f040007;
public static final int abc_slide_out_bottom = 0x7f040008;
public static final int abc_slide_out_top = 0x7f040009;
}
public static final class attr {
public static final int actionBarDivider = 0x7f010040;
public static final int actionBarItemBackground = 0x7f010041;
public static final int actionBarPopupTheme = 0x7f01003a;
public static final int actionBarSize = 0x7f01003f;
public static final int actionBarSplitStyle = 0x7f01003c;
public static final int actionBarStyle = 0x7f01003b;
public static final int actionBarTabBarStyle = 0x7f010036;
public static final int actionBarTabStyle = 0x7f010035;
public static final int actionBarTabTextStyle = 0x7f010037;
public static final int actionBarTheme = 0x7f01003d;
public static final int actionBarWidgetTheme = 0x7f01003e;
public static final int actionButtonStyle = 0x7f01005b;
public static final int actionDropDownStyle = 0x7f010057;
public static final int actionLayout = 0x7f0100ac;
public static final int actionMenuTextAppearance = 0x7f010042;
public static final int actionMenuTextColor = 0x7f010043;
public static final int actionModeBackground = 0x7f010046;
public static final int actionModeCloseButtonStyle = 0x7f010045;
public static final int actionModeCloseDrawable = 0x7f010048;
public static final int actionModeCopyDrawable = 0x7f01004a;
public static final int actionModeCutDrawable = 0x7f010049;
public static final int actionModeFindDrawable = 0x7f01004e;
public static final int actionModePasteDrawable = 0x7f01004b;
public static final int actionModePopupWindowStyle = 0x7f010050;
public static final int actionModeSelectAllDrawable = 0x7f01004c;
public static final int actionModeShareDrawable = 0x7f01004d;
public static final int actionModeSplitBackground = 0x7f010047;
public static final int actionModeStyle = 0x7f010044;
public static final int actionModeWebSearchDrawable = 0x7f01004f;
public static final int actionOverflowButtonStyle = 0x7f010038;
public static final int actionOverflowMenuStyle = 0x7f010039;
public static final int actionProviderClass = 0x7f0100ae;
public static final int actionViewClass = 0x7f0100ad;
public static final int activityChooserViewStyle = 0x7f010063;
public static final int alertDialogButtonGroupStyle = 0x7f010087;
public static final int alertDialogCenterButtons = 0x7f010088;
public static final int alertDialogStyle = 0x7f010086;
public static final int alertDialogTheme = 0x7f010089;
public static final int allowStacking = 0x7f01009c;
public static final int arrowHeadLength = 0x7f0100a4;
public static final int arrowShaftLength = 0x7f0100a5;
public static final int autoCompleteTextViewStyle = 0x7f01008e;
public static final int background = 0x7f01000c;
public static final int backgroundSplit = 0x7f01000e;
public static final int backgroundStacked = 0x7f01000d;
public static final int backgroundTint = 0x7f0100df;
public static final int backgroundTintMode = 0x7f0100e0;
public static final int barLength = 0x7f0100a6;
public static final int borderlessButtonStyle = 0x7f010060;
public static final int buttonBarButtonStyle = 0x7f01005d;
public static final int buttonBarNegativeButtonStyle = 0x7f01008c;
public static final int buttonBarNeutralButtonStyle = 0x7f01008d;
public static final int buttonBarPositiveButtonStyle = 0x7f01008b;
public static final int buttonBarStyle = 0x7f01005c;
public static final int buttonPanelSideLayout = 0x7f010021;
public static final int buttonStyle = 0x7f01008f;
public static final int buttonStyleSmall = 0x7f010090;
public static final int buttonTint = 0x7f01009e;
public static final int buttonTintMode = 0x7f01009f;
public static final int checkboxStyle = 0x7f010091;
public static final int checkedTextViewStyle = 0x7f010092;
public static final int closeIcon = 0x7f0100b7;
public static final int closeItemLayout = 0x7f01001e;
public static final int collapseContentDescription = 0x7f0100d6;
public static final int collapseIcon = 0x7f0100d5;
public static final int color = 0x7f0100a0;
public static final int colorAccent = 0x7f01007e;
public static final int colorButtonNormal = 0x7f010082;
public static final int colorControlActivated = 0x7f010080;
public static final int colorControlHighlight = 0x7f010081;
public static final int colorControlNormal = 0x7f01007f;
public static final int colorPrimary = 0x7f01007c;
public static final int colorPrimaryDark = 0x7f01007d;
public static final int colorSwitchThumbNormal = 0x7f010083;
public static final int commitIcon = 0x7f0100bc;
public static final int contentInsetEnd = 0x7f010017;
public static final int contentInsetLeft = 0x7f010018;
public static final int contentInsetRight = 0x7f010019;
public static final int contentInsetStart = 0x7f010016;
public static final int controlBackground = 0x7f010084;
public static final int customNavigationLayout = 0x7f01000f;
public static final int defaultQueryHint = 0x7f0100b6;
public static final int dialogPreferredPadding = 0x7f010055;
public static final int dialogTheme = 0x7f010054;
public static final int displayOptions = 0x7f010005;
public static final int divider = 0x7f01000b;
public static final int dividerHorizontal = 0x7f010062;
public static final int dividerPadding = 0x7f0100aa;
public static final int dividerVertical = 0x7f010061;
public static final int drawableSize = 0x7f0100a2;
public static final int drawerArrowStyle = 0x7f010000;
public static final int dropDownListViewStyle = 0x7f010074;
public static final int dropdownListPreferredItemHeight = 0x7f010058;
public static final int editTextBackground = 0x7f010069;
public static final int editTextColor = 0x7f010068;
public static final int editTextStyle = 0x7f010093;
public static final int elevation = 0x7f01001c;
public static final int expandActivityOverflowButtonDrawable = 0x7f010020;
public static final int gapBetweenBars = 0x7f0100a3;
public static final int goIcon = 0x7f0100b8;
public static final int height = 0x7f010001;
public static final int hideOnContentScroll = 0x7f010015;
public static final int homeAsUpIndicator = 0x7f01005a;
public static final int homeLayout = 0x7f010010;
public static final int icon = 0x7f010009;
public static final int iconifiedByDefault = 0x7f0100b4;
public static final int imageButtonStyle = 0x7f01006a;
public static final int indeterminateProgressStyle = 0x7f010012;
public static final int initialActivityCount = 0x7f01001f;
public static final int isLightTheme = 0x7f010002;
public static final int itemPadding = 0x7f010014;
public static final int layout = 0x7f0100b3;
public static final int listChoiceBackgroundIndicator = 0x7f01007b;
public static final int listDividerAlertDialog = 0x7f010056;
public static final int listItemLayout = 0x7f010025;
public static final int listLayout = 0x7f010022;
public static final int listPopupWindowStyle = 0x7f010075;
public static final int listPreferredItemHeight = 0x7f01006f;
public static final int listPreferredItemHeightLarge = 0x7f010071;
public static final int listPreferredItemHeightSmall = 0x7f010070;
public static final int listPreferredItemPaddingLeft = 0x7f010072;
public static final int listPreferredItemPaddingRight = 0x7f010073;
public static final int logo = 0x7f01000a;
public static final int logoDescription = 0x7f0100d9;
public static final int maxButtonHeight = 0x7f0100d3;
public static final int measureWithLargestChild = 0x7f0100a8;
public static final int multiChoiceItemLayout = 0x7f010023;
public static final int navigationContentDescription = 0x7f0100d8;
public static final int navigationIcon = 0x7f0100d7;
public static final int navigationMode = 0x7f010004;
public static final int overlapAnchor = 0x7f0100b1;
public static final int paddingEnd = 0x7f0100dd;
public static final int paddingStart = 0x7f0100dc;
public static final int panelBackground = 0x7f010078;
public static final int panelMenuListTheme = 0x7f01007a;
public static final int panelMenuListWidth = 0x7f010079;
public static final int popupMenuStyle = 0x7f010066;
public static final int popupTheme = 0x7f01001d;
public static final int popupWindowStyle = 0x7f010067;
public static final int preserveIconSpacing = 0x7f0100af;
public static final int progressBarPadding = 0x7f010013;
public static final int progressBarStyle = 0x7f010011;
public static final int queryBackground = 0x7f0100be;
public static final int queryHint = 0x7f0100b5;
public static final int radioButtonStyle = 0x7f010094;
public static final int ratingBarStyle = 0x7f010095;
public static final int ratingBarStyleIndicator = 0x7f010096;
public static final int ratingBarStyleSmall = 0x7f010097;
public static final int searchHintIcon = 0x7f0100ba;
public static final int searchIcon = 0x7f0100b9;
public static final int searchViewStyle = 0x7f01006e;
public static final int seekBarStyle = 0x7f010098;
public static final int selectableItemBackground = 0x7f01005e;
public static final int selectableItemBackgroundBorderless = 0x7f01005f;
public static final int showAsAction = 0x7f0100ab;
public static final int showDividers = 0x7f0100a9;
public static final int showText = 0x7f0100ca;
public static final int singleChoiceItemLayout = 0x7f010024;
public static final int spinBars = 0x7f0100a1;
public static final int spinnerDropDownItemStyle = 0x7f010059;
public static final int spinnerStyle = 0x7f010099;
public static final int splitTrack = 0x7f0100c9;
public static final int srcCompat = 0x7f010026;
public static final int state_above_anchor = 0x7f0100b2;
public static final int submitBackground = 0x7f0100bf;
public static final int subtitle = 0x7f010006;
public static final int subtitleTextAppearance = 0x7f0100cc;
public static final int subtitleTextColor = 0x7f0100db;
public static final int subtitleTextStyle = 0x7f010008;
public static final int suggestionRowLayout = 0x7f0100bd;
public static final int switchMinWidth = 0x7f0100c7;
public static final int switchPadding = 0x7f0100c8;
public static final int switchStyle = 0x7f01009a;
public static final int switchTextAppearance = 0x7f0100c6;
public static final int textAllCaps = 0x7f01002a;
public static final int textAppearanceLargePopupMenu = 0x7f010051;
public static final int textAppearanceListItem = 0x7f010076;
public static final int textAppearanceListItemSmall = 0x7f010077;
public static final int textAppearanceSearchResultSubtitle = 0x7f01006c;
public static final int textAppearanceSearchResultTitle = 0x7f01006b;
public static final int textAppearanceSmallPopupMenu = 0x7f010052;
public static final int textColorAlertDialogListItem = 0x7f01008a;
public static final int textColorSearchUrl = 0x7f01006d;
public static final int theme = 0x7f0100de;
public static final int thickness = 0x7f0100a7;
public static final int thumbTextPadding = 0x7f0100c5;
public static final int title = 0x7f010003;
public static final int titleMarginBottom = 0x7f0100d1;
public static final int titleMarginEnd = 0x7f0100cf;
public static final int titleMarginStart = 0x7f0100ce;
public static final int titleMarginTop = 0x7f0100d0;
public static final int titleMargins = 0x7f0100d2;
public static final int titleTextAppearance = 0x7f0100cb;
public static final int titleTextColor = 0x7f0100da;
public static final int titleTextStyle = 0x7f010007;
public static final int toolbarNavigationButtonStyle = 0x7f010065;
public static final int toolbarStyle = 0x7f010064;
public static final int track = 0x7f0100c2;
public static final int voiceIcon = 0x7f0100bb;
public static final int windowActionBar = 0x7f01002b;
public static final int windowActionBarOverlay = 0x7f01002d;
public static final int windowActionModeOverlay = 0x7f01002e;
public static final int windowFixedHeightMajor = 0x7f010032;
public static final int windowFixedHeightMinor = 0x7f010030;
public static final int windowFixedWidthMajor = 0x7f01002f;
public static final int windowFixedWidthMinor = 0x7f010031;
public static final int windowMinWidthMajor = 0x7f010033;
public static final int windowMinWidthMinor = 0x7f010034;
public static final int windowNoTitle = 0x7f01002c;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs = 0x7f080000;
public static final int abc_allow_stacked_button_bar = 0x7f080001;
public static final int abc_config_actionMenuItemAllCaps = 0x7f080002;
public static final int abc_config_closeDialogWhenTouchOutside = 0x7f080003;
public static final int abc_config_showMenuShortcutsWhenKeyboardPresent = 0x7f080004;
}
public static final class color {
public static final int abc_background_cache_hint_selector_material_dark = 0x7f09003a;
public static final int abc_background_cache_hint_selector_material_light = 0x7f09003b;
public static final int abc_color_highlight_material = 0x7f09003d;
public static final int abc_input_method_navigation_guard = 0x7f090000;
public static final int abc_primary_text_disable_only_material_dark = 0x7f09003e;
public static final int abc_primary_text_disable_only_material_light = 0x7f09003f;
public static final int abc_primary_text_material_dark = 0x7f090040;
public static final int abc_primary_text_material_light = 0x7f090041;
public static final int abc_search_url_text = 0x7f090042;
public static final int abc_search_url_text_normal = 0x7f090001;
public static final int abc_search_url_text_pressed = 0x7f090002;
public static final int abc_search_url_text_selected = 0x7f090003;
public static final int abc_secondary_text_material_dark = 0x7f090043;
public static final int abc_secondary_text_material_light = 0x7f090044;
public static final int accent_material_dark = 0x7f090004;
public static final int accent_material_light = 0x7f090005;
public static final int background_floating_material_dark = 0x7f090006;
public static final int background_floating_material_light = 0x7f090007;
public static final int background_material_dark = 0x7f090008;
public static final int background_material_light = 0x7f090009;
public static final int bright_foreground_disabled_material_dark = 0x7f09000a;
public static final int bright_foreground_disabled_material_light = 0x7f09000b;
public static final int bright_foreground_inverse_material_dark = 0x7f09000c;
public static final int bright_foreground_inverse_material_light = 0x7f09000d;
public static final int bright_foreground_material_dark = 0x7f09000e;
public static final int bright_foreground_material_light = 0x7f09000f;
public static final int button_material_dark = 0x7f090010;
public static final int button_material_light = 0x7f090011;
public static final int dim_foreground_disabled_material_dark = 0x7f090012;
public static final int dim_foreground_disabled_material_light = 0x7f090013;
public static final int dim_foreground_material_dark = 0x7f090014;
public static final int dim_foreground_material_light = 0x7f090015;
public static final int foreground_material_dark = 0x7f090016;
public static final int foreground_material_light = 0x7f090017;
public static final int highlighted_text_material_dark = 0x7f090018;
public static final int highlighted_text_material_light = 0x7f090019;
public static final int hint_foreground_material_dark = 0x7f09001a;
public static final int hint_foreground_material_light = 0x7f09001b;
public static final int material_blue_grey_800 = 0x7f09001c;
public static final int material_blue_grey_900 = 0x7f09001d;
public static final int material_blue_grey_950 = 0x7f09001e;
public static final int material_deep_teal_200 = 0x7f09001f;
public static final int material_deep_teal_500 = 0x7f090020;
public static final int material_grey_100 = 0x7f090021;
public static final int material_grey_300 = 0x7f090022;
public static final int material_grey_50 = 0x7f090023;
public static final int material_grey_600 = 0x7f090024;
public static final int material_grey_800 = 0x7f090025;
public static final int material_grey_850 = 0x7f090026;
public static final int material_grey_900 = 0x7f090027;
public static final int primary_dark_material_dark = 0x7f090028;
public static final int primary_dark_material_light = 0x7f090029;
public static final int primary_material_dark = 0x7f09002a;
public static final int primary_material_light = 0x7f09002b;
public static final int primary_text_default_material_dark = 0x7f09002c;
public static final int primary_text_default_material_light = 0x7f09002d;
public static final int primary_text_disabled_material_dark = 0x7f09002e;
public static final int primary_text_disabled_material_light = 0x7f09002f;
public static final int ripple_material_dark = 0x7f090030;
public static final int ripple_material_light = 0x7f090031;
public static final int secondary_text_default_material_dark = 0x7f090032;
public static final int secondary_text_default_material_light = 0x7f090033;
public static final int secondary_text_disabled_material_dark = 0x7f090034;
public static final int secondary_text_disabled_material_light = 0x7f090035;
public static final int switch_thumb_disabled_material_dark = 0x7f090036;
public static final int switch_thumb_disabled_material_light = 0x7f090037;
public static final int switch_thumb_material_dark = 0x7f09004c;
public static final int switch_thumb_material_light = 0x7f09004d;
public static final int switch_thumb_normal_material_dark = 0x7f090038;
public static final int switch_thumb_normal_material_light = 0x7f090039;
}
public static final class dimen {
public static final int abc_action_bar_content_inset_material = 0x7f06000c;
public static final int abc_action_bar_default_height_material = 0x7f060001;
public static final int abc_action_bar_default_padding_end_material = 0x7f06000e;
public static final int abc_action_bar_default_padding_start_material = 0x7f06000f;
public static final int abc_action_bar_icon_vertical_padding_material = 0x7f060012;
public static final int abc_action_bar_overflow_padding_end_material = 0x7f060013;
public static final int abc_action_bar_overflow_padding_start_material = 0x7f060014;
public static final int abc_action_bar_progress_bar_size = 0x7f060002;
public static final int abc_action_bar_stacked_max_height = 0x7f060015;
public static final int abc_action_bar_stacked_tab_max_width = 0x7f060016;
public static final int abc_action_bar_subtitle_bottom_margin_material = 0x7f060017;
public static final int abc_action_bar_subtitle_top_margin_material = 0x7f060018;
public static final int abc_action_button_min_height_material = 0x7f060019;
public static final int abc_action_button_min_width_material = 0x7f06001a;
public static final int abc_action_button_min_width_overflow_material = 0x7f06001b;
public static final int abc_alert_dialog_button_bar_height = 0x7f060000;
public static final int abc_button_inset_horizontal_material = 0x7f06001c;
public static final int abc_button_inset_vertical_material = 0x7f06001d;
public static final int abc_button_padding_horizontal_material = 0x7f06001e;
public static final int abc_button_padding_vertical_material = 0x7f06001f;
public static final int abc_config_prefDialogWidth = 0x7f060005;
public static final int abc_control_corner_material = 0x7f060021;
public static final int abc_control_inset_material = 0x7f060022;
public static final int abc_control_padding_material = 0x7f060023;
public static final int abc_dialog_fixed_height_major = 0x7f060006;
public static final int abc_dialog_fixed_height_minor = 0x7f060007;
public static final int abc_dialog_fixed_width_major = 0x7f060008;
public static final int abc_dialog_fixed_width_minor = 0x7f060009;
public static final int abc_dialog_list_padding_vertical_material = 0x7f060024;
public static final int abc_dialog_min_width_major = 0x7f06000a;
public static final int abc_dialog_min_width_minor = 0x7f06000b;
public static final int abc_dialog_padding_material = 0x7f060025;
public static final int abc_dialog_padding_top_material = 0x7f060026;
public static final int abc_disabled_alpha_material_dark = 0x7f060027;
public static final int abc_disabled_alpha_material_light = 0x7f060028;
public static final int abc_dropdownitem_icon_width = 0x7f060029;
public static final int abc_dropdownitem_text_padding_left = 0x7f06002a;
public static final int abc_dropdownitem_text_padding_right = 0x7f06002b;
public static final int abc_edit_text_inset_bottom_material = 0x7f06002c;
public static final int abc_edit_text_inset_horizontal_material = 0x7f06002d;
public static final int abc_edit_text_inset_top_material = 0x7f06002e;
public static final int abc_floating_window_z = 0x7f06002f;
public static final int abc_list_item_padding_horizontal_material = 0x7f060030;
public static final int abc_panel_menu_list_width = 0x7f060031;
public static final int abc_search_view_preferred_width = 0x7f060034;
public static final int abc_seekbar_track_background_height_material = 0x7f060035;
public static final int abc_seekbar_track_progress_height_material = 0x7f060036;
public static final int abc_select_dialog_padding_start_material = 0x7f060037;
public static final int abc_switch_padding = 0x7f060010;
public static final int abc_text_size_body_1_material = 0x7f060038;
public static final int abc_text_size_body_2_material = 0x7f060039;
public static final int abc_text_size_button_material = 0x7f06003a;
public static final int abc_text_size_caption_material = 0x7f06003b;
public static final int abc_text_size_display_1_material = 0x7f06003c;
public static final int abc_text_size_display_2_material = 0x7f06003d;
public static final int abc_text_size_display_3_material = 0x7f06003e;
public static final int abc_text_size_display_4_material = 0x7f06003f;
public static final int abc_text_size_headline_material = 0x7f060040;
public static final int abc_text_size_large_material = 0x7f060041;
public static final int abc_text_size_medium_material = 0x7f060042;
public static final int abc_text_size_menu_material = 0x7f060044;
public static final int abc_text_size_small_material = 0x7f060045;
public static final int abc_text_size_subhead_material = 0x7f060046;
public static final int abc_text_size_subtitle_material_toolbar = 0x7f060003;
public static final int abc_text_size_title_material = 0x7f060047;
public static final int abc_text_size_title_material_toolbar = 0x7f060004;
public static final int disabled_alpha_material_dark = 0x7f060048;
public static final int disabled_alpha_material_light = 0x7f060049;
public static final int highlight_alpha_material_colored = 0x7f06004a;
public static final int highlight_alpha_material_dark = 0x7f06004b;
public static final int highlight_alpha_material_light = 0x7f06004c;
public static final int notification_large_icon_height = 0x7f06004d;
public static final int notification_large_icon_width = 0x7f06004e;
public static final int notification_subtext_size = 0x7f06004f;
}
public static final class drawable {
public static final int abc_ab_share_pack_mtrl_alpha = 0x7f020000;
public static final int abc_action_bar_item_background_material = 0x7f020001;
public static final int abc_btn_borderless_material = 0x7f020002;
public static final int abc_btn_check_material = 0x7f020003;
public static final int abc_btn_check_to_on_mtrl_000 = 0x7f020004;
public static final int abc_btn_check_to_on_mtrl_015 = 0x7f020005;
public static final int abc_btn_colored_material = 0x7f020006;
public static final int abc_btn_default_mtrl_shape = 0x7f020007;
public static final int abc_btn_radio_material = 0x7f020008;
public static final int abc_btn_radio_to_on_mtrl_000 = 0x7f020009;
public static final int abc_btn_radio_to_on_mtrl_015 = 0x7f02000a;
public static final int abc_btn_switch_to_on_mtrl_00001 = 0x7f02000b;
public static final int abc_btn_switch_to_on_mtrl_00012 = 0x7f02000c;
public static final int abc_cab_background_internal_bg = 0x7f02000d;
public static final int abc_cab_background_top_material = 0x7f02000e;
public static final int abc_cab_background_top_mtrl_alpha = 0x7f02000f;
public static final int abc_control_background_material = 0x7f020010;
public static final int abc_edit_text_material = 0x7f020012;
public static final int abc_ic_commit_search_api_mtrl_alpha = 0x7f020016;
public static final int abc_ic_menu_copy_mtrl_am_alpha = 0x7f020018;
public static final int abc_ic_menu_cut_mtrl_alpha = 0x7f020019;
public static final int abc_ic_menu_paste_mtrl_am_alpha = 0x7f02001b;
public static final int abc_ic_menu_selectall_mtrl_alpha = 0x7f02001c;
public static final int abc_ic_menu_share_mtrl_alpha = 0x7f02001d;
public static final int abc_ic_star_black_16dp = 0x7f02001f;
public static final int abc_ic_star_black_36dp = 0x7f020020;
public static final int abc_ic_star_half_black_16dp = 0x7f020022;
public static final int abc_ic_star_half_black_36dp = 0x7f020023;
public static final int abc_item_background_holo_dark = 0x7f020026;
public static final int abc_item_background_holo_light = 0x7f020027;
public static final int abc_list_divider_mtrl_alpha = 0x7f020028;
public static final int abc_list_focused_holo = 0x7f020029;
public static final int abc_list_longpressed_holo = 0x7f02002a;
public static final int abc_list_pressed_holo_dark = 0x7f02002b;
public static final int abc_list_pressed_holo_light = 0x7f02002c;
public static final int abc_list_selector_background_transition_holo_dark = 0x7f02002d;
public static final int abc_list_selector_background_transition_holo_light = 0x7f02002e;
public static final int abc_list_selector_disabled_holo_dark = 0x7f02002f;
public static final int abc_list_selector_disabled_holo_light = 0x7f020030;
public static final int abc_list_selector_holo_dark = 0x7f020031;
public static final int abc_list_selector_holo_light = 0x7f020032;
public static final int abc_menu_hardkey_panel_mtrl_mult = 0x7f020033;
public static final int abc_popup_background_mtrl_mult = 0x7f020034;
public static final int abc_ratingbar_indicator_material = 0x7f020035;
public static final int abc_ratingbar_small_material = 0x7f020037;
public static final int abc_scrubber_control_off_mtrl_alpha = 0x7f020038;
public static final int abc_scrubber_control_to_pressed_mtrl_000 = 0x7f020039;
public static final int abc_scrubber_control_to_pressed_mtrl_005 = 0x7f02003a;
public static final int abc_scrubber_primary_mtrl_alpha = 0x7f02003b;
public static final int abc_scrubber_track_mtrl_alpha = 0x7f02003c;
public static final int abc_seekbar_thumb_material = 0x7f02003d;
public static final int abc_seekbar_track_material = 0x7f02003f;
public static final int abc_spinner_mtrl_am_alpha = 0x7f020040;
public static final int abc_spinner_textfield_background_material = 0x7f020041;
public static final int abc_switch_thumb_material = 0x7f020042;
public static final int abc_switch_track_mtrl_alpha = 0x7f020043;
public static final int abc_tab_indicator_material = 0x7f020044;
public static final int abc_tab_indicator_mtrl_alpha = 0x7f020045;
public static final int abc_text_cursor_material = 0x7f020046;
public static final int abc_textfield_activated_mtrl_alpha = 0x7f02004d;
public static final int abc_textfield_default_mtrl_alpha = 0x7f02004e;
public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f02004f;
public static final int abc_textfield_search_default_mtrl_alpha = 0x7f020050;
public static final int abc_textfield_search_material = 0x7f020051;
public static final int notification_template_icon_bg = 0x7f020053;
}
public static final class id {
public static final int action0 = 0x7f0a0054;
public static final int action_bar = 0x7f0a0045;
public static final int action_bar_activity_content = 0x7f0a0000;
public static final int action_bar_container = 0x7f0a0044;
public static final int action_bar_root = 0x7f0a0040;
public static final int action_bar_spinner = 0x7f0a0001;
public static final int action_bar_subtitle = 0x7f0a0025;
public static final int action_bar_title = 0x7f0a0024;
public static final int action_context_bar = 0x7f0a0046;
public static final int action_divider = 0x7f0a0058;
public static final int action_menu_divider = 0x7f0a0002;
public static final int action_menu_presenter = 0x7f0a0003;
public static final int action_mode_bar = 0x7f0a0042;
public static final int action_mode_bar_stub = 0x7f0a0041;
public static final int action_mode_close_button = 0x7f0a0026;
public static final int activity_chooser_view_content = 0x7f0a0027;
public static final int alertTitle = 0x7f0a0033;
public static final int always = 0x7f0a001d;
public static final int beginning = 0x7f0a001a;
public static final int buttonPanel = 0x7f0a002e;
public static final int cancel_action = 0x7f0a0055;
public static final int checkbox = 0x7f0a003c;
public static final int chronometer = 0x7f0a005b;
public static final int collapseActionView = 0x7f0a001e;
public static final int contentPanel = 0x7f0a0034;
public static final int custom = 0x7f0a003a;
public static final int customPanel = 0x7f0a0039;
public static final int decor_content_parent = 0x7f0a0043;
public static final int default_activity_button = 0x7f0a002a;
public static final int disableHome = 0x7f0a000c;
public static final int edit_query = 0x7f0a0047;
public static final int end = 0x7f0a001b;
public static final int end_padder = 0x7f0a0060;
public static final int expand_activities_button = 0x7f0a0028;
public static final int expanded_menu = 0x7f0a003b;
public static final int home = 0x7f0a0004;
public static final int homeAsUp = 0x7f0a000d;
public static final int icon = 0x7f0a002c;
public static final int ifRoom = 0x7f0a001f;
public static final int image = 0x7f0a0029;
public static final int info = 0x7f0a005f;
public static final int line1 = 0x7f0a0059;
public static final int line3 = 0x7f0a005d;
public static final int listMode = 0x7f0a0009;
public static final int list_item = 0x7f0a002b;
public static final int media_actions = 0x7f0a0057;
public static final int middle = 0x7f0a001c;
public static final int multiply = 0x7f0a0014;
public static final int never = 0x7f0a0020;
public static final int none = 0x7f0a000e;
public static final int normal = 0x7f0a000a;
public static final int parentPanel = 0x7f0a0030;
public static final int progress_circular = 0x7f0a0005;
public static final int progress_horizontal = 0x7f0a0006;
public static final int radio = 0x7f0a003e;
public static final int screen = 0x7f0a0015;
public static final int scrollIndicatorDown = 0x7f0a0038;
public static final int scrollIndicatorUp = 0x7f0a0035;
public static final int scrollView = 0x7f0a0036;
public static final int search_badge = 0x7f0a0049;
public static final int search_bar = 0x7f0a0048;
public static final int search_button = 0x7f0a004a;
public static final int search_close_btn = 0x7f0a004f;
public static final int search_edit_frame = 0x7f0a004b;
public static final int search_go_btn = 0x7f0a0051;
public static final int search_mag_icon = 0x7f0a004c;
public static final int search_plate = 0x7f0a004d;
public static final int search_src_text = 0x7f0a004e;
public static final int search_voice_btn = 0x7f0a0052;
public static final int select_dialog_listview = 0x7f0a0053;
public static final int shortcut = 0x7f0a003d;
public static final int showCustom = 0x7f0a000f;
public static final int showHome = 0x7f0a0010;
public static final int showTitle = 0x7f0a0011;
public static final int spacer = 0x7f0a002f;
public static final int split_action_bar = 0x7f0a0007;
public static final int src_atop = 0x7f0a0016;
public static final int src_in = 0x7f0a0017;
public static final int src_over = 0x7f0a0018;
public static final int status_bar_latest_event_content = 0x7f0a0056;
public static final int submit_area = 0x7f0a0050;
public static final int tabMode = 0x7f0a000b;
public static final int text = 0x7f0a005e;
public static final int text2 = 0x7f0a005c;
public static final int textSpacerNoButtons = 0x7f0a0037;
public static final int time = 0x7f0a005a;
public static final int title = 0x7f0a002d;
public static final int title_template = 0x7f0a0032;
public static final int topPanel = 0x7f0a0031;
public static final int up = 0x7f0a0008;
public static final int useLogo = 0x7f0a0012;
public static final int withText = 0x7f0a0021;
public static final int wrap_content = 0x7f0a0019;
}
public static final class integer {
public static final int abc_config_activityDefaultDur = 0x7f0b0000;
public static final int abc_config_activityShortDur = 0x7f0b0001;
public static final int cancel_button_image_alpha = 0x7f0b0002;
public static final int status_bar_notification_info_maxnum = 0x7f0b0003;
}
public static final class layout {
public static final int abc_action_bar_title_item = 0x7f030000;
public static final int abc_action_bar_up_container = 0x7f030001;
public static final int abc_action_bar_view_list_nav_layout = 0x7f030002;
public static final int abc_action_menu_item_layout = 0x7f030003;
public static final int abc_action_menu_layout = 0x7f030004;
public static final int abc_action_mode_bar = 0x7f030005;
public static final int abc_action_mode_close_item_material = 0x7f030006;
public static final int abc_activity_chooser_view = 0x7f030007;
public static final int abc_activity_chooser_view_list_item = 0x7f030008;
public static final int abc_alert_dialog_button_bar_material = 0x7f030009;
public static final int abc_alert_dialog_material = 0x7f03000a;
public static final int abc_dialog_title_material = 0x7f03000b;
public static final int abc_expanded_menu_layout = 0x7f03000c;
public static final int abc_list_menu_item_checkbox = 0x7f03000d;
public static final int abc_list_menu_item_icon = 0x7f03000e;
public static final int abc_list_menu_item_layout = 0x7f03000f;
public static final int abc_list_menu_item_radio = 0x7f030010;
public static final int abc_popup_menu_item_layout = 0x7f030012;
public static final int abc_screen_content_include = 0x7f030013;
public static final int abc_screen_simple = 0x7f030014;
public static final int abc_screen_simple_overlay_action_mode = 0x7f030015;
public static final int abc_screen_toolbar = 0x7f030016;
public static final int abc_search_dropdown_item_icons_2line = 0x7f030017;
public static final int abc_search_view = 0x7f030018;
public static final int abc_select_dialog_material = 0x7f030019;
public static final int notification_media_action = 0x7f03001a;
public static final int notification_media_cancel_action = 0x7f03001b;
public static final int notification_template_big_media = 0x7f03001c;
public static final int notification_template_big_media_narrow = 0x7f03001d;
public static final int notification_template_lines = 0x7f03001e;
public static final int notification_template_media = 0x7f03001f;
public static final int notification_template_part_chronometer = 0x7f030020;
public static final int notification_template_part_time = 0x7f030021;
public static final int select_dialog_item_material = 0x7f030022;
public static final int select_dialog_multichoice_material = 0x7f030023;
public static final int select_dialog_singlechoice_material = 0x7f030024;
public static final int support_simple_spinner_dropdown_item = 0x7f030025;
}
public static final class string {
public static final int abc_action_bar_home_description = 0x7f050000;
public static final int abc_action_bar_home_description_format = 0x7f050001;
public static final int abc_action_bar_home_subtitle_description_format = 0x7f050002;
public static final int abc_action_bar_up_description = 0x7f050003;
public static final int abc_action_menu_overflow_description = 0x7f050004;
public static final int abc_action_mode_done = 0x7f050005;
public static final int abc_activity_chooser_view_see_all = 0x7f050006;
public static final int abc_activitychooserview_choose_application = 0x7f050007;
public static final int abc_capital_off = 0x7f050008;
public static final int abc_capital_on = 0x7f050009;
public static final int abc_search_hint = 0x7f05000a;
public static final int abc_searchview_description_clear = 0x7f05000b;
public static final int abc_searchview_description_query = 0x7f05000c;
public static final int abc_searchview_description_search = 0x7f05000d;
public static final int abc_searchview_description_submit = 0x7f05000e;
public static final int abc_searchview_description_voice = 0x7f05000f;
public static final int abc_shareactionprovider_share_with = 0x7f050010;
public static final int abc_shareactionprovider_share_with_application = 0x7f050011;
public static final int abc_toolbar_collapse_description = 0x7f050012;
public static final int app_name = 0x7f050021;
public static final int status_bar_notification_info_overflow = 0x7f050014;
}
public static final class style {
public static final int AlertDialog_AppCompat = 0x7f07008a;
public static final int AlertDialog_AppCompat_Light = 0x7f07008b;
public static final int Animation_AppCompat_Dialog = 0x7f07008c;
public static final int Animation_AppCompat_DropDownUp = 0x7f07008d;
public static final int Base_AlertDialog_AppCompat = 0x7f07008e;
public static final int Base_AlertDialog_AppCompat_Light = 0x7f07008f;
public static final int Base_Animation_AppCompat_Dialog = 0x7f070090;
public static final int Base_Animation_AppCompat_DropDownUp = 0x7f070091;
public static final int Base_DialogWindowTitleBackground_AppCompat = 0x7f070093;
public static final int Base_DialogWindowTitle_AppCompat = 0x7f070092;
public static final int Base_TextAppearance_AppCompat = 0x7f070038;
public static final int Base_TextAppearance_AppCompat_Body1 = 0x7f070039;
public static final int Base_TextAppearance_AppCompat_Body2 = 0x7f07003a;
public static final int Base_TextAppearance_AppCompat_Button = 0x7f070022;
public static final int Base_TextAppearance_AppCompat_Caption = 0x7f07003b;
public static final int Base_TextAppearance_AppCompat_Display1 = 0x7f07003c;
public static final int Base_TextAppearance_AppCompat_Display2 = 0x7f07003d;
public static final int Base_TextAppearance_AppCompat_Display3 = 0x7f07003e;
public static final int Base_TextAppearance_AppCompat_Display4 = 0x7f07003f;
public static final int Base_TextAppearance_AppCompat_Headline = 0x7f070040;
public static final int Base_TextAppearance_AppCompat_Inverse = 0x7f07000b;
public static final int Base_TextAppearance_AppCompat_Large = 0x7f070041;
public static final int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f07000c;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f070042;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f070043;
public static final int Base_TextAppearance_AppCompat_Medium = 0x7f070044;
public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f07000d;
public static final int Base_TextAppearance_AppCompat_Menu = 0x7f070045;
public static final int Base_TextAppearance_AppCompat_SearchResult = 0x7f070094;
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f070046;
public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f070047;
public static final int Base_TextAppearance_AppCompat_Small = 0x7f070048;
public static final int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f07000e;
public static final int Base_TextAppearance_AppCompat_Subhead = 0x7f070049;
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f07000f;
public static final int Base_TextAppearance_AppCompat_Title = 0x7f07004a;
public static final int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f070010;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f070083;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f07004b;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f07004c;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f07004d;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f07004e;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f07004f;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f070050;
public static final int Base_TextAppearance_AppCompat_Widget_Button = 0x7f070051;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f070084;
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f070095;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f070053;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f070054;
public static final int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f070055;
public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f070056;
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f070096;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f070057;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f070058;
public static final int Base_ThemeOverlay_AppCompat = 0x7f07009f;
public static final int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f0700a0;
public static final int Base_ThemeOverlay_AppCompat_Dark = 0x7f0700a1;
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0700a2;
public static final int Base_ThemeOverlay_AppCompat_Light = 0x7f0700a4;
public static final int Base_Theme_AppCompat = 0x7f070059;
public static final int Base_Theme_AppCompat_CompactMenu = 0x7f070097;
public static final int Base_Theme_AppCompat_Dialog = 0x7f070011;
public static final int Base_Theme_AppCompat_DialogWhenLarge = 0x7f070001;
public static final int Base_Theme_AppCompat_Dialog_Alert = 0x7f070098;
public static final int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f070099;
public static final int Base_Theme_AppCompat_Dialog_MinWidth = 0x7f07009a;
public static final int Base_Theme_AppCompat_Light = 0x7f07005a;
public static final int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f07009b;
public static final int Base_Theme_AppCompat_Light_Dialog = 0x7f070012;
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f070002;
public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 0x7f07009c;
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f07009d;
public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 0x7f07009e;
public static final int Base_V11_Theme_AppCompat_Dialog = 0x7f070014;
public static final int Base_V11_Theme_AppCompat_Light_Dialog = 0x7f070015;
public static final int Base_V12_Widget_AppCompat_AutoCompleteTextView = 0x7f07001e;
public static final int Base_V12_Widget_AppCompat_EditText = 0x7f07001f;
public static final int Base_V21_Theme_AppCompat = 0x7f07005b;
public static final int Base_V21_Theme_AppCompat_Dialog = 0x7f07005c;
public static final int Base_V21_Theme_AppCompat_Light = 0x7f07005d;
public static final int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f07005e;
public static final int Base_V22_Theme_AppCompat = 0x7f070081;
public static final int Base_V22_Theme_AppCompat_Light = 0x7f070082;
public static final int Base_V23_Theme_AppCompat = 0x7f070085;
public static final int Base_V23_Theme_AppCompat_Light = 0x7f070086;
public static final int Base_V7_Theme_AppCompat = 0x7f0700a5;
public static final int Base_V7_Theme_AppCompat_Dialog = 0x7f0700a6;
public static final int Base_V7_Theme_AppCompat_Light = 0x7f0700a7;
public static final int Base_V7_Theme_AppCompat_Light_Dialog = 0x7f0700a8;
public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 0x7f0700aa;
public static final int Base_V7_Widget_AppCompat_EditText = 0x7f0700ab;
public static final int Base_Widget_AppCompat_ActionBar = 0x7f0700ac;
public static final int Base_Widget_AppCompat_ActionBar_Solid = 0x7f0700ad;
public static final int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f0700ae;
public static final int Base_Widget_AppCompat_ActionBar_TabText = 0x7f070060;
public static final int Base_Widget_AppCompat_ActionBar_TabView = 0x7f070061;
public static final int Base_Widget_AppCompat_ActionButton = 0x7f070062;
public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f070063;
public static final int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f070064;
public static final int Base_Widget_AppCompat_ActionMode = 0x7f0700af;
public static final int Base_Widget_AppCompat_ActivityChooserView = 0x7f0700b0;
public static final int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f070020;
public static final int Base_Widget_AppCompat_Button = 0x7f070065;
public static final int Base_Widget_AppCompat_ButtonBar = 0x7f070069;
public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0700b2;
public static final int Base_Widget_AppCompat_Button_Borderless = 0x7f070066;
public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 0x7f070067;
public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0700b1;
public static final int Base_Widget_AppCompat_Button_Colored = 0x7f070087;
public static final int Base_Widget_AppCompat_Button_Small = 0x7f070068;
public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 0x7f07006a;
public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 0x7f07006b;
public static final int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f0700b3;
public static final int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f070000;
public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f0700b4;
public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f07006c;
public static final int Base_Widget_AppCompat_EditText = 0x7f070021;
public static final int Base_Widget_AppCompat_ImageButton = 0x7f07006d;
public static final int Base_Widget_AppCompat_Light_ActionBar = 0x7f0700b5;
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f0700b6;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0700b7;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f07006e;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f07006f;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f070070;
public static final int Base_Widget_AppCompat_Light_PopupMenu = 0x7f070071;
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f070072;
public static final int Base_Widget_AppCompat_ListPopupWindow = 0x7f070073;
public static final int Base_Widget_AppCompat_ListView = 0x7f070074;
public static final int Base_Widget_AppCompat_ListView_DropDown = 0x7f070075;
public static final int Base_Widget_AppCompat_ListView_Menu = 0x7f070076;
public static final int Base_Widget_AppCompat_PopupMenu = 0x7f070077;
public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f070078;
public static final int Base_Widget_AppCompat_PopupWindow = 0x7f0700b9;
public static final int Base_Widget_AppCompat_ProgressBar = 0x7f070017;
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f070018;
public static final int Base_Widget_AppCompat_RatingBar = 0x7f070079;
public static final int Base_Widget_AppCompat_RatingBar_Indicator = 0x7f070088;
public static final int Base_Widget_AppCompat_RatingBar_Small = 0x7f070089;
public static final int Base_Widget_AppCompat_SearchView = 0x7f0700ba;
public static final int Base_Widget_AppCompat_SearchView_ActionBar = 0x7f0700bb;
public static final int Base_Widget_AppCompat_SeekBar = 0x7f07007a;
public static final int Base_Widget_AppCompat_Spinner = 0x7f07007b;
public static final int Base_Widget_AppCompat_Spinner_Underlined = 0x7f070003;
public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f07007c;
public static final int Base_Widget_AppCompat_Toolbar = 0x7f0700bd;
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f07007d;
public static final int Platform_AppCompat = 0x7f070019;
public static final int Platform_AppCompat_Light = 0x7f07001a;
public static final int Platform_ThemeOverlay_AppCompat = 0x7f07007e;
public static final int Platform_ThemeOverlay_AppCompat_Dark = 0x7f07007f;
public static final int Platform_ThemeOverlay_AppCompat_Light = 0x7f070080;
public static final int Platform_V11_AppCompat = 0x7f07001b;
public static final int Platform_V11_AppCompat_Light = 0x7f07001c;
public static final int Platform_V14_AppCompat = 0x7f070023;
public static final int Platform_V14_AppCompat_Light = 0x7f070024;
public static final int Platform_Widget_AppCompat_Spinner = 0x7f07001d;
public static final int RtlOverlay_DialogWindowTitle_AppCompat = 0x7f07002a;
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f07002b;
public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 0x7f07002c;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f07002d;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f07002e;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f07002f;
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f070035;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f070030;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f070031;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f070032;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f070033;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f070034;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 0x7f070036;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 0x7f070037;
public static final int TextAppearance_AppCompat = 0x7f0700be;
public static final int TextAppearance_AppCompat_Body1 = 0x7f0700bf;
public static final int TextAppearance_AppCompat_Body2 = 0x7f0700c0;
public static final int TextAppearance_AppCompat_Button = 0x7f0700c1;
public static final int TextAppearance_AppCompat_Caption = 0x7f0700c2;
public static final int TextAppearance_AppCompat_Display1 = 0x7f0700c3;
public static final int TextAppearance_AppCompat_Display2 = 0x7f0700c4;
public static final int TextAppearance_AppCompat_Display3 = 0x7f0700c5;
public static final int TextAppearance_AppCompat_Display4 = 0x7f0700c6;
public static final int TextAppearance_AppCompat_Headline = 0x7f0700c7;
public static final int TextAppearance_AppCompat_Inverse = 0x7f0700c8;
public static final int TextAppearance_AppCompat_Large = 0x7f0700c9;
public static final int TextAppearance_AppCompat_Large_Inverse = 0x7f0700ca;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f0700cb;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f0700cc;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0700cd;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0700ce;
public static final int TextAppearance_AppCompat_Medium = 0x7f0700cf;
public static final int TextAppearance_AppCompat_Medium_Inverse = 0x7f0700d0;
public static final int TextAppearance_AppCompat_Menu = 0x7f0700d1;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0700d2;
public static final int TextAppearance_AppCompat_SearchResult_Title = 0x7f0700d3;
public static final int TextAppearance_AppCompat_Small = 0x7f0700d4;
public static final int TextAppearance_AppCompat_Small_Inverse = 0x7f0700d5;
public static final int TextAppearance_AppCompat_Subhead = 0x7f0700d6;
public static final int TextAppearance_AppCompat_Subhead_Inverse = 0x7f0700d7;
public static final int TextAppearance_AppCompat_Title = 0x7f0700d8;
public static final int TextAppearance_AppCompat_Title_Inverse = 0x7f0700d9;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0700da;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0700db;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0700dc;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0700dd;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0700de;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0700df;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f0700e0;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0700e1;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f0700e2;
public static final int TextAppearance_AppCompat_Widget_Button = 0x7f0700e3;
public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0700e4;
public static final int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0700e5;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0700e7;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0700e8;
public static final int TextAppearance_AppCompat_Widget_Switch = 0x7f0700e9;
public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0700ea;
public static final int TextAppearance_StatusBar_EventContent = 0x7f070025;
public static final int TextAppearance_StatusBar_EventContent_Info = 0x7f070026;
public static final int TextAppearance_StatusBar_EventContent_Line2 = 0x7f070027;
public static final int TextAppearance_StatusBar_EventContent_Time = 0x7f070028;
public static final int TextAppearance_StatusBar_EventContent_Title = 0x7f070029;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0700eb;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0700ec;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0700ed;
public static final int ThemeOverlay_AppCompat = 0x7f0700fc;
public static final int ThemeOverlay_AppCompat_ActionBar = 0x7f0700fd;
public static final int ThemeOverlay_AppCompat_Dark = 0x7f0700fe;
public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0700ff;
public static final int ThemeOverlay_AppCompat_Light = 0x7f070102;
public static final int Theme_AppCompat = 0x7f0700ee;
public static final int Theme_AppCompat_CompactMenu = 0x7f0700ef;
public static final int Theme_AppCompat_DayNight = 0x7f070004;
public static final int Theme_AppCompat_DayNight_DarkActionBar = 0x7f070005;
public static final int Theme_AppCompat_DayNight_Dialog = 0x7f070006;
public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 0x7f070009;
public static final int Theme_AppCompat_DayNight_Dialog_Alert = 0x7f070007;
public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 0x7f070008;
public static final int Theme_AppCompat_DayNight_NoActionBar = 0x7f07000a;
public static final int Theme_AppCompat_Dialog = 0x7f0700f0;
public static final int Theme_AppCompat_DialogWhenLarge = 0x7f0700f3;
public static final int Theme_AppCompat_Dialog_Alert = 0x7f0700f1;
public static final int Theme_AppCompat_Dialog_MinWidth = 0x7f0700f2;
public static final int Theme_AppCompat_Light = 0x7f0700f4;
public static final int Theme_AppCompat_Light_DarkActionBar = 0x7f0700f5;
public static final int Theme_AppCompat_Light_Dialog = 0x7f0700f6;
public static final int Theme_AppCompat_Light_DialogWhenLarge = 0x7f0700f9;
public static final int Theme_AppCompat_Light_Dialog_Alert = 0x7f0700f7;
public static final int Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0700f8;
public static final int Theme_AppCompat_Light_NoActionBar = 0x7f0700fa;
public static final int Theme_AppCompat_NoActionBar = 0x7f0700fb;
public static final int Widget_AppCompat_ActionBar = 0x7f070103;
public static final int Widget_AppCompat_ActionBar_Solid = 0x7f070104;
public static final int Widget_AppCompat_ActionBar_TabBar = 0x7f070105;
public static final int Widget_AppCompat_ActionBar_TabText = 0x7f070106;
public static final int Widget_AppCompat_ActionBar_TabView = 0x7f070107;
public static final int Widget_AppCompat_ActionButton = 0x7f070108;
public static final int Widget_AppCompat_ActionButton_CloseMode = 0x7f070109;
public static final int Widget_AppCompat_ActionButton_Overflow = 0x7f07010a;
public static final int Widget_AppCompat_ActionMode = 0x7f07010b;
public static final int Widget_AppCompat_ActivityChooserView = 0x7f07010c;
public static final int Widget_AppCompat_AutoCompleteTextView = 0x7f07010d;
public static final int Widget_AppCompat_Button = 0x7f07010e;
public static final int Widget_AppCompat_ButtonBar = 0x7f070114;
public static final int Widget_AppCompat_ButtonBar_AlertDialog = 0x7f070115;
public static final int Widget_AppCompat_Button_Borderless = 0x7f07010f;
public static final int Widget_AppCompat_Button_Borderless_Colored = 0x7f070110;
public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f070111;
public static final int Widget_AppCompat_Button_Colored = 0x7f070112;
public static final int Widget_AppCompat_Button_Small = 0x7f070113;
public static final int Widget_AppCompat_CompoundButton_CheckBox = 0x7f070116;
public static final int Widget_AppCompat_CompoundButton_RadioButton = 0x7f070117;
public static final int Widget_AppCompat_CompoundButton_Switch = 0x7f070118;
public static final int Widget_AppCompat_DrawerArrowToggle = 0x7f070119;
public static final int Widget_AppCompat_DropDownItem_Spinner = 0x7f07011a;
public static final int Widget_AppCompat_EditText = 0x7f07011b;
public static final int Widget_AppCompat_ImageButton = 0x7f07011c;
public static final int Widget_AppCompat_Light_ActionBar = 0x7f07011d;
public static final int Widget_AppCompat_Light_ActionBar_Solid = 0x7f07011e;
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f07011f;
public static final int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f070120;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f070121;
public static final int Widget_AppCompat_Light_ActionBar_TabText = 0x7f070122;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f070123;
public static final int Widget_AppCompat_Light_ActionBar_TabView = 0x7f070124;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f070125;
public static final int Widget_AppCompat_Light_ActionButton = 0x7f070126;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f070127;
public static final int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f070128;
public static final int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f070129;
public static final int Widget_AppCompat_Light_ActivityChooserView = 0x7f07012a;
public static final int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f07012b;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f07012c;
public static final int Widget_AppCompat_Light_ListPopupWindow = 0x7f07012d;
public static final int Widget_AppCompat_Light_ListView_DropDown = 0x7f07012e;
public static final int Widget_AppCompat_Light_PopupMenu = 0x7f07012f;
public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f070130;
public static final int Widget_AppCompat_Light_SearchView = 0x7f070131;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f070132;
public static final int Widget_AppCompat_ListPopupWindow = 0x7f070134;
public static final int Widget_AppCompat_ListView = 0x7f070135;
public static final int Widget_AppCompat_ListView_DropDown = 0x7f070136;
public static final int Widget_AppCompat_ListView_Menu = 0x7f070137;
public static final int Widget_AppCompat_PopupMenu = 0x7f070138;
public static final int Widget_AppCompat_PopupMenu_Overflow = 0x7f070139;
public static final int Widget_AppCompat_PopupWindow = 0x7f07013a;
public static final int Widget_AppCompat_ProgressBar = 0x7f07013b;
public static final int Widget_AppCompat_ProgressBar_Horizontal = 0x7f07013c;
public static final int Widget_AppCompat_RatingBar = 0x7f07013d;
public static final int Widget_AppCompat_RatingBar_Indicator = 0x7f07013e;
public static final int Widget_AppCompat_RatingBar_Small = 0x7f07013f;
public static final int Widget_AppCompat_SearchView = 0x7f070140;
public static final int Widget_AppCompat_SearchView_ActionBar = 0x7f070141;
public static final int Widget_AppCompat_SeekBar = 0x7f070142;
public static final int Widget_AppCompat_Spinner = 0x7f070144;
public static final int Widget_AppCompat_Spinner_DropDown = 0x7f070145;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f070146;
public static final int Widget_AppCompat_Spinner_Underlined = 0x7f070147;
public static final int Widget_AppCompat_TextView_SpinnerItem = 0x7f070148;
public static final int Widget_AppCompat_Toolbar = 0x7f070149;
public static final int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f07014a;
}
public static final class styleable {
public static final int[] ActionBar = { 0x7f010001, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01005a };
public static final int[] ActionBarLayout = { 0x010100b3 };
public static final int ActionBarLayout_android_layout_gravity = 0;
public static final int ActionBar_background = 10;
public static final int ActionBar_backgroundSplit = 12;
public static final int ActionBar_backgroundStacked = 11;
public static final int ActionBar_contentInsetEnd = 21;
public static final int ActionBar_contentInsetLeft = 22;
public static final int ActionBar_contentInsetRight = 23;
public static final int ActionBar_contentInsetStart = 20;
public static final int ActionBar_customNavigationLayout = 13;
public static final int ActionBar_displayOptions = 3;
public static final int ActionBar_divider = 9;
public static final int ActionBar_elevation = 26;
public static final int ActionBar_height = 0;
public static final int ActionBar_hideOnContentScroll = 19;
public static final int ActionBar_homeAsUpIndicator = 28;
public static final int ActionBar_homeLayout = 14;
public static final int ActionBar_icon = 7;
public static final int ActionBar_indeterminateProgressStyle = 16;
public static final int ActionBar_itemPadding = 18;
public static final int ActionBar_logo = 8;
public static final int ActionBar_navigationMode = 2;
public static final int ActionBar_popupTheme = 27;
public static final int ActionBar_progressBarPadding = 17;
public static final int ActionBar_progressBarStyle = 15;
public static final int ActionBar_subtitle = 4;
public static final int ActionBar_subtitleTextStyle = 6;
public static final int ActionBar_title = 1;
public static final int ActionBar_titleTextStyle = 5;
public static final int[] ActionMenuItemView = { 0x0101013f };
public static final int ActionMenuItemView_android_minWidth = 0;
public static final int[] ActionMenuView = { };
public static final int[] ActionMode = { 0x7f010001, 0x7f010007, 0x7f010008, 0x7f01000c, 0x7f01000e, 0x7f01001e };
public static final int ActionMode_background = 3;
public static final int ActionMode_backgroundSplit = 4;
public static final int ActionMode_closeItemLayout = 5;
public static final int ActionMode_height = 0;
public static final int ActionMode_subtitleTextStyle = 2;
public static final int ActionMode_titleTextStyle = 1;
public static final int[] ActivityChooserView = { 0x7f01001f, 0x7f010020 };
public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 1;
public static final int ActivityChooserView_initialActivityCount = 0;
public static final int[] AlertDialog = { 0x010100f2, 0x7f010021, 0x7f010022, 0x7f010023, 0x7f010024, 0x7f010025 };
public static final int AlertDialog_android_layout = 0;
public static final int AlertDialog_buttonPanelSideLayout = 1;
public static final int AlertDialog_listItemLayout = 5;
public static final int AlertDialog_listLayout = 2;
public static final int AlertDialog_multiChoiceItemLayout = 3;
public static final int AlertDialog_singleChoiceItemLayout = 4;
public static final int[] AppCompatImageView = { 0x01010119, 0x7f010026 };
public static final int AppCompatImageView_android_src = 0;
public static final int AppCompatImageView_srcCompat = 1;
public static final int[] AppCompatTextView = { 0x01010034, 0x7f01002a };
public static final int AppCompatTextView_android_textAppearance = 0;
public static final int AppCompatTextView_textAllCaps = 1;
public static final int[] AppCompatTheme = { 0x01010057, 0x010100ae, 0x7f01002b, 0x7f01002c, 0x7f01002d, 0x7f01002e, 0x7f01002f, 0x7f010030, 0x7f010031, 0x7f010032, 0x7f010033, 0x7f010034, 0x7f010035, 0x7f010036, 0x7f010037, 0x7f010038, 0x7f010039, 0x7f01003a, 0x7f01003b, 0x7f01003c, 0x7f01003d, 0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010041, 0x7f010042, 0x7f010043, 0x7f010044, 0x7f010045, 0x7f010046, 0x7f010047, 0x7f010048, 0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d, 0x7f01004e, 0x7f01004f, 0x7f010050, 0x7f010051, 0x7f010052, 0x7f010053, 0x7f010054, 0x7f010055, 0x7f010056, 0x7f010057, 0x7f010058, 0x7f010059, 0x7f01005a, 0x7f01005b, 0x7f01005c, 0x7f01005d, 0x7f01005e, 0x7f01005f, 0x7f010060, 0x7f010061, 0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065, 0x7f010066, 0x7f010067, 0x7f010068, 0x7f010069, 0x7f01006a, 0x7f01006b, 0x7f01006c, 0x7f01006d, 0x7f01006e, 0x7f01006f, 0x7f010070, 0x7f010071, 0x7f010072, 0x7f010073, 0x7f010074, 0x7f010075, 0x7f010076, 0x7f010077, 0x7f010078, 0x7f010079, 0x7f01007a, 0x7f01007b, 0x7f01007c, 0x7f01007d, 0x7f01007e, 0x7f01007f, 0x7f010080, 0x7f010081, 0x7f010082, 0x7f010083, 0x7f010084, 0x7f010085, 0x7f010086, 0x7f010087, 0x7f010088, 0x7f010089, 0x7f01008a, 0x7f01008b, 0x7f01008c, 0x7f01008d, 0x7f01008e, 0x7f01008f, 0x7f010090, 0x7f010091, 0x7f010092, 0x7f010093, 0x7f010094, 0x7f010095, 0x7f010096, 0x7f010097, 0x7f010098, 0x7f010099, 0x7f01009a, 0x7f01009b };
public static final int AppCompatTheme_actionBarDivider = 23;
public static final int AppCompatTheme_actionBarItemBackground = 24;
public static final int AppCompatTheme_actionBarPopupTheme = 17;
public static final int AppCompatTheme_actionBarSize = 22;
public static final int AppCompatTheme_actionBarSplitStyle = 19;
public static final int AppCompatTheme_actionBarStyle = 18;
public static final int AppCompatTheme_actionBarTabBarStyle = 13;
public static final int AppCompatTheme_actionBarTabStyle = 12;
public static final int AppCompatTheme_actionBarTabTextStyle = 14;
public static final int AppCompatTheme_actionBarTheme = 20;
public static final int AppCompatTheme_actionBarWidgetTheme = 21;
public static final int AppCompatTheme_actionButtonStyle = 50;
public static final int AppCompatTheme_actionDropDownStyle = 46;
public static final int AppCompatTheme_actionMenuTextAppearance = 25;
public static final int AppCompatTheme_actionMenuTextColor = 26;
public static final int AppCompatTheme_actionModeBackground = 29;
public static final int AppCompatTheme_actionModeCloseButtonStyle = 28;
public static final int AppCompatTheme_actionModeCloseDrawable = 31;
public static final int AppCompatTheme_actionModeCopyDrawable = 33;
public static final int AppCompatTheme_actionModeCutDrawable = 32;
public static final int AppCompatTheme_actionModeFindDrawable = 37;
public static final int AppCompatTheme_actionModePasteDrawable = 34;
public static final int AppCompatTheme_actionModePopupWindowStyle = 39;
public static final int AppCompatTheme_actionModeSelectAllDrawable = 35;
public static final int AppCompatTheme_actionModeShareDrawable = 36;
public static final int AppCompatTheme_actionModeSplitBackground = 30;
public static final int AppCompatTheme_actionModeStyle = 27;
public static final int AppCompatTheme_actionModeWebSearchDrawable = 38;
public static final int AppCompatTheme_actionOverflowButtonStyle = 15;
public static final int AppCompatTheme_actionOverflowMenuStyle = 16;
public static final int AppCompatTheme_activityChooserViewStyle = 58;
public static final int AppCompatTheme_alertDialogButtonGroupStyle = 94;
public static final int AppCompatTheme_alertDialogCenterButtons = 95;
public static final int AppCompatTheme_alertDialogStyle = 93;
public static final int AppCompatTheme_alertDialogTheme = 96;
public static final int AppCompatTheme_android_windowAnimationStyle = 1;
public static final int AppCompatTheme_android_windowIsFloating = 0;
public static final int AppCompatTheme_autoCompleteTextViewStyle = 101;
public static final int AppCompatTheme_borderlessButtonStyle = 55;
public static final int AppCompatTheme_buttonBarButtonStyle = 52;
public static final int AppCompatTheme_buttonBarNegativeButtonStyle = 99;
public static final int AppCompatTheme_buttonBarNeutralButtonStyle = 100;
public static final int AppCompatTheme_buttonBarPositiveButtonStyle = 98;
public static final int AppCompatTheme_buttonBarStyle = 51;
public static final int AppCompatTheme_buttonStyle = 102;
public static final int AppCompatTheme_buttonStyleSmall = 103;
public static final int AppCompatTheme_checkboxStyle = 104;
public static final int AppCompatTheme_checkedTextViewStyle = 105;
public static final int AppCompatTheme_colorAccent = 85;
public static final int AppCompatTheme_colorButtonNormal = 89;
public static final int AppCompatTheme_colorControlActivated = 87;
public static final int AppCompatTheme_colorControlHighlight = 88;
public static final int AppCompatTheme_colorControlNormal = 86;
public static final int AppCompatTheme_colorPrimary = 83;
public static final int AppCompatTheme_colorPrimaryDark = 84;
public static final int AppCompatTheme_colorSwitchThumbNormal = 90;
public static final int AppCompatTheme_controlBackground = 91;
public static final int AppCompatTheme_dialogPreferredPadding = 44;
public static final int AppCompatTheme_dialogTheme = 43;
public static final int AppCompatTheme_dividerHorizontal = 57;
public static final int AppCompatTheme_dividerVertical = 56;
public static final int AppCompatTheme_dropDownListViewStyle = 75;
public static final int AppCompatTheme_dropdownListPreferredItemHeight = 47;
public static final int AppCompatTheme_editTextBackground = 64;
public static final int AppCompatTheme_editTextColor = 63;
public static final int AppCompatTheme_editTextStyle = 106;
public static final int AppCompatTheme_homeAsUpIndicator = 49;
public static final int AppCompatTheme_imageButtonStyle = 65;
public static final int AppCompatTheme_listChoiceBackgroundIndicator = 82;
public static final int AppCompatTheme_listDividerAlertDialog = 45;
public static final int AppCompatTheme_listPopupWindowStyle = 76;
public static final int AppCompatTheme_listPreferredItemHeight = 70;
public static final int AppCompatTheme_listPreferredItemHeightLarge = 72;
public static final int AppCompatTheme_listPreferredItemHeightSmall = 71;
public static final int AppCompatTheme_listPreferredItemPaddingLeft = 73;
public static final int AppCompatTheme_listPreferredItemPaddingRight = 74;
public static final int AppCompatTheme_panelBackground = 79;
public static final int AppCompatTheme_panelMenuListTheme = 81;
public static final int AppCompatTheme_panelMenuListWidth = 80;
public static final int AppCompatTheme_popupMenuStyle = 61;
public static final int AppCompatTheme_popupWindowStyle = 62;
public static final int AppCompatTheme_radioButtonStyle = 107;
public static final int AppCompatTheme_ratingBarStyle = 108;
public static final int AppCompatTheme_ratingBarStyleIndicator = 109;
public static final int AppCompatTheme_ratingBarStyleSmall = 110;
public static final int AppCompatTheme_searchViewStyle = 69;
public static final int AppCompatTheme_seekBarStyle = 111;
public static final int AppCompatTheme_selectableItemBackground = 53;
public static final int AppCompatTheme_selectableItemBackgroundBorderless = 54;
public static final int AppCompatTheme_spinnerDropDownItemStyle = 48;
public static final int AppCompatTheme_spinnerStyle = 112;
public static final int AppCompatTheme_switchStyle = 113;
public static final int AppCompatTheme_textAppearanceLargePopupMenu = 40;
public static final int AppCompatTheme_textAppearanceListItem = 77;
public static final int AppCompatTheme_textAppearanceListItemSmall = 78;
public static final int AppCompatTheme_textAppearanceSearchResultSubtitle = 67;
public static final int AppCompatTheme_textAppearanceSearchResultTitle = 66;
public static final int AppCompatTheme_textAppearanceSmallPopupMenu = 41;
public static final int AppCompatTheme_textColorAlertDialogListItem = 97;
public static final int AppCompatTheme_textColorSearchUrl = 68;
public static final int AppCompatTheme_toolbarNavigationButtonStyle = 60;
public static final int AppCompatTheme_toolbarStyle = 59;
public static final int AppCompatTheme_windowActionBar = 2;
public static final int AppCompatTheme_windowActionBarOverlay = 4;
public static final int AppCompatTheme_windowActionModeOverlay = 5;
public static final int AppCompatTheme_windowFixedHeightMajor = 9;
public static final int AppCompatTheme_windowFixedHeightMinor = 7;
public static final int AppCompatTheme_windowFixedWidthMajor = 6;
public static final int AppCompatTheme_windowFixedWidthMinor = 8;
public static final int AppCompatTheme_windowMinWidthMajor = 10;
public static final int AppCompatTheme_windowMinWidthMinor = 11;
public static final int AppCompatTheme_windowNoTitle = 3;
public static final int[] ButtonBarLayout = { 0x7f01009c };
public static final int ButtonBarLayout_allowStacking = 0;
public static final int[] CompoundButton = { 0x01010107, 0x7f01009e, 0x7f01009f };
public static final int CompoundButton_android_button = 0;
public static final int CompoundButton_buttonTint = 1;
public static final int CompoundButton_buttonTintMode = 2;
public static final int[] DrawerArrowToggle = { 0x7f0100a0, 0x7f0100a1, 0x7f0100a2, 0x7f0100a3, 0x7f0100a4, 0x7f0100a5, 0x7f0100a6, 0x7f0100a7 };
public static final int DrawerArrowToggle_arrowHeadLength = 4;
public static final int DrawerArrowToggle_arrowShaftLength = 5;
public static final int DrawerArrowToggle_barLength = 6;
public static final int DrawerArrowToggle_color = 0;
public static final int DrawerArrowToggle_drawableSize = 2;
public static final int DrawerArrowToggle_gapBetweenBars = 3;
public static final int DrawerArrowToggle_spinBars = 1;
public static final int DrawerArrowToggle_thickness = 7;
public static final int[] LinearLayoutCompat = { 0x010100af, 0x010100c4, 0x01010126, 0x01010127, 0x01010128, 0x7f01000b, 0x7f0100a8, 0x7f0100a9, 0x7f0100aa };
public static final int[] LinearLayoutCompat_Layout = { 0x010100b3, 0x010100f4, 0x010100f5, 0x01010181 };
public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0;
public static final int LinearLayoutCompat_Layout_android_layout_height = 2;
public static final int LinearLayoutCompat_Layout_android_layout_weight = 3;
public static final int LinearLayoutCompat_Layout_android_layout_width = 1;
public static final int LinearLayoutCompat_android_baselineAligned = 2;
public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3;
public static final int LinearLayoutCompat_android_gravity = 0;
public static final int LinearLayoutCompat_android_orientation = 1;
public static final int LinearLayoutCompat_android_weightSum = 4;
public static final int LinearLayoutCompat_divider = 5;
public static final int LinearLayoutCompat_dividerPadding = 8;
public static final int LinearLayoutCompat_measureWithLargestChild = 6;
public static final int LinearLayoutCompat_showDividers = 7;
public static final int[] ListPopupWindow = { 0x010102ac, 0x010102ad };
public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0;
public static final int ListPopupWindow_android_dropDownVerticalOffset = 1;
public static final int[] MenuGroup = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 };
public static final int MenuGroup_android_checkableBehavior = 5;
public static final int MenuGroup_android_enabled = 0;
public static final int MenuGroup_android_id = 1;
public static final int MenuGroup_android_menuCategory = 3;
public static final int MenuGroup_android_orderInCategory = 4;
public static final int MenuGroup_android_visible = 2;
public static final int[] MenuItem = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x7f0100ab, 0x7f0100ac, 0x7f0100ad, 0x7f0100ae };
public static final int MenuItem_actionLayout = 14;
public static final int MenuItem_actionProviderClass = 16;
public static final int MenuItem_actionViewClass = 15;
public static final int MenuItem_android_alphabeticShortcut = 9;
public static final int MenuItem_android_checkable = 11;
public static final int MenuItem_android_checked = 3;
public static final int MenuItem_android_enabled = 1;
public static final int MenuItem_android_icon = 0;
public static final int MenuItem_android_id = 2;
public static final int MenuItem_android_menuCategory = 5;
public static final int MenuItem_android_numericShortcut = 10;
public static final int MenuItem_android_onClick = 12;
public static final int MenuItem_android_orderInCategory = 6;
public static final int MenuItem_android_title = 7;
public static final int MenuItem_android_titleCondensed = 8;
public static final int MenuItem_android_visible = 4;
public static final int MenuItem_showAsAction = 13;
public static final int[] MenuView = { 0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e, 0x0101012f, 0x01010130, 0x01010131, 0x7f0100af, 0x7f0100b0 };
public static final int MenuView_android_headerBackground = 4;
public static final int MenuView_android_horizontalDivider = 2;
public static final int MenuView_android_itemBackground = 5;
public static final int MenuView_android_itemIconDisabledAlpha = 6;
public static final int MenuView_android_itemTextAppearance = 1;
public static final int MenuView_android_verticalDivider = 3;
public static final int MenuView_android_windowAnimationStyle = 0;
public static final int MenuView_preserveIconSpacing = 7;
public static final int[] PopupWindow = { 0x01010176, 0x010102c9, 0x7f0100b1 };
public static final int[] PopupWindowBackgroundState = { 0x7f0100b2 };
public static final int PopupWindowBackgroundState_state_above_anchor = 0;
public static final int PopupWindow_android_popupBackground = 0;
public static final int PopupWindow_overlapAnchor = 2;
public static final int[] SearchView = { 0x010100da, 0x0101011f, 0x01010220, 0x01010264, 0x7f0100b3, 0x7f0100b4, 0x7f0100b5, 0x7f0100b6, 0x7f0100b7, 0x7f0100b8, 0x7f0100b9, 0x7f0100ba, 0x7f0100bb, 0x7f0100bc, 0x7f0100bd, 0x7f0100be, 0x7f0100bf };
public static final int SearchView_android_focusable = 0;
public static final int SearchView_android_imeOptions = 3;
public static final int SearchView_android_inputType = 2;
public static final int SearchView_android_maxWidth = 1;
public static final int SearchView_closeIcon = 8;
public static final int SearchView_commitIcon = 13;
public static final int SearchView_defaultQueryHint = 7;
public static final int SearchView_goIcon = 9;
public static final int SearchView_iconifiedByDefault = 5;
public static final int SearchView_layout = 4;
public static final int SearchView_queryBackground = 15;
public static final int SearchView_queryHint = 6;
public static final int SearchView_searchHintIcon = 11;
public static final int SearchView_searchIcon = 10;
public static final int SearchView_submitBackground = 16;
public static final int SearchView_suggestionRowLayout = 14;
public static final int SearchView_voiceIcon = 12;
public static final int[] Spinner = { 0x010100b2, 0x01010176, 0x0101017b, 0x01010262, 0x7f01001d };
public static final int Spinner_android_dropDownWidth = 3;
public static final int Spinner_android_entries = 0;
public static final int Spinner_android_popupBackground = 1;
public static final int Spinner_android_prompt = 2;
public static final int Spinner_popupTheme = 4;
public static final int[] SwitchCompat = { 0x01010124, 0x01010125, 0x01010142, 0x7f0100c0, 0x7f0100c1, 0x7f0100c2, 0x7f0100c3, 0x7f0100c4, 0x7f0100c5, 0x7f0100c6, 0x7f0100c7, 0x7f0100c8, 0x7f0100c9, 0x7f0100ca };
public static final int SwitchCompat_android_textOff = 1;
public static final int SwitchCompat_android_textOn = 0;
public static final int SwitchCompat_android_thumb = 2;
public static final int SwitchCompat_showText = 13;
public static final int SwitchCompat_splitTrack = 12;
public static final int SwitchCompat_switchMinWidth = 10;
public static final int SwitchCompat_switchPadding = 11;
public static final int SwitchCompat_switchTextAppearance = 9;
public static final int SwitchCompat_thumbTextPadding = 8;
public static final int SwitchCompat_track = 5;
public static final int[] TextAppearance = { 0x01010095, 0x01010096, 0x01010097, 0x01010098, 0x01010161, 0x01010162, 0x01010163, 0x01010164, 0x7f01002a };
public static final int TextAppearance_android_shadowColor = 4;
public static final int TextAppearance_android_shadowDx = 5;
public static final int TextAppearance_android_shadowDy = 6;
public static final int TextAppearance_android_shadowRadius = 7;
public static final int TextAppearance_android_textColor = 3;
public static final int TextAppearance_android_textSize = 0;
public static final int TextAppearance_android_textStyle = 2;
public static final int TextAppearance_android_typeface = 1;
public static final int TextAppearance_textAllCaps = 8;
public static final int[] Toolbar = { 0x010100af, 0x01010140, 0x7f010003, 0x7f010006, 0x7f01000a, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001d, 0x7f0100cb, 0x7f0100cc, 0x7f0100cd, 0x7f0100ce, 0x7f0100cf, 0x7f0100d0, 0x7f0100d1, 0x7f0100d2, 0x7f0100d3, 0x7f0100d4, 0x7f0100d5, 0x7f0100d6, 0x7f0100d7, 0x7f0100d8, 0x7f0100d9, 0x7f0100da, 0x7f0100db };
public static final int Toolbar_android_gravity = 0;
public static final int Toolbar_android_minHeight = 1;
public static final int Toolbar_collapseContentDescription = 23;
public static final int Toolbar_collapseIcon = 22;
public static final int Toolbar_contentInsetEnd = 6;
public static final int Toolbar_contentInsetLeft = 7;
public static final int Toolbar_contentInsetRight = 8;
public static final int Toolbar_contentInsetStart = 5;
public static final int Toolbar_logo = 4;
public static final int Toolbar_logoDescription = 26;
public static final int Toolbar_maxButtonHeight = 20;
public static final int Toolbar_navigationContentDescription = 25;
public static final int Toolbar_navigationIcon = 24;
public static final int Toolbar_popupTheme = 11;
public static final int Toolbar_subtitle = 3;
public static final int Toolbar_subtitleTextAppearance = 13;
public static final int Toolbar_subtitleTextColor = 28;
public static final int Toolbar_title = 2;
public static final int Toolbar_titleMarginBottom = 18;
public static final int Toolbar_titleMarginEnd = 16;
public static final int Toolbar_titleMarginStart = 15;
public static final int Toolbar_titleMarginTop = 17;
public static final int Toolbar_titleMargins = 19;
public static final int Toolbar_titleTextAppearance = 12;
public static final int Toolbar_titleTextColor = 27;
public static final int[] View = { 0x01010000, 0x010100da, 0x7f0100dc, 0x7f0100dd, 0x7f0100de };
public static final int[] ViewBackgroundHelper = { 0x010100d4, 0x7f0100df, 0x7f0100e0 };
public static final int ViewBackgroundHelper_android_background = 0;
public static final int ViewBackgroundHelper_backgroundTint = 1;
public static final int ViewBackgroundHelper_backgroundTintMode = 2;
public static final int[] ViewStubCompat = { 0x010100d0, 0x010100f2, 0x010100f3 };
public static final int ViewStubCompat_android_id = 0;
public static final int ViewStubCompat_android_inflatedId = 2;
public static final int ViewStubCompat_android_layout = 1;
public static final int View_android_focusable = 1;
public static final int View_android_theme = 0;
public static final int View_paddingEnd = 3;
public static final int View_paddingStart = 2;
public static final int View_theme = 4;
}
}
| [
"[email protected]"
] | |
b31c018cc69db8af8440c4184d4070e6313bfbe2 | 1cce29cd23674b1e7f3d523c779231032720add4 | /src/main/java/com/suixingpay/profit/atguigu/jdk/Builder.java | f6ec6f5fd92b1149e78b87868a1d065384913895 | [] | no_license | histjxg/hxg-all | b87a30f2c18c8c075067c406fb1aac8b56dbff4d | 01a1aabb12f3a56bb74698ac986fd16268421698 | refs/heads/master | 2023-07-11T22:10:39.808894 | 2021-08-18T16:07:35 | 2021-08-18T16:07:36 | 397,638,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package com.suixingpay.profit.atguigu.jdk;
public class Builder {
public static void main(String[] args) {
StringBuilder stringBuilder = new StringBuilder("hello world");
System.out.println(stringBuilder);
}
}
| [
"[email protected]"
] | |
0ecdfc2d078c99bdd43cebb4ce879ae304265e74 | 534efe193f0fdcf0a386b5092508779555587c80 | /3.JavaMultithreading/src/com/javarush/task/task29/task2913/Solution.java | a9fd08f251f1207c2c332e02ea42cd601ee1223b | [] | no_license | teoheel/JavaRushTasks | b1ddef5da78858aa1b462d19042208a5f1241688 | 447e9c3172324251aaaccd1e50134c2b4005b544 | refs/heads/master | 2023-07-16T04:59:32.379948 | 2021-09-06T14:54:15 | 2021-09-06T14:54:15 | 284,746,280 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package com.javarush.task.task29.task2913;
import java.util.Random;
/*
Замена рекурсии
*/
public class Solution {
private static int numberA;
private static int numberB;
public static String getAllNumbersBetween(int a, int b) {
StringBuilder result = new StringBuilder(String.valueOf(a));
while (a != b) {
result.append(" ").append(a > b ? --a : ++a);
}
return result.toString();
}
public static void main(String[] args) {
Random random = new Random();
numberA = random.nextInt(1000);
numberB = random.nextInt(1000);
System.out.println(getAllNumbersBetween(numberA, numberB));
System.out.println(getAllNumbersBetween(numberB, numberA));
}
} | [
"[email protected]"
] | |
b65a1ecee96b56d528f8a78f1696107d94cb8c28 | 9a517b5e77454a0c898430c89fe82fc99256f26d | /src/main/java/cn/tedu/nybike/web/GenderCountServlet.java | 12b5d1f75eb99cbab456bfda6557103ea90df0ed | [] | no_license | zhiyiTec/nyBike | 03ac228d83163091d08c486d0226a18bc10ebc02 | 50369498e8f3cd422b8fe1a44ed5dd0cd445443f | refs/heads/master | 2020-07-22T14:26:49.625786 | 2019-09-16T03:26:39 | 2019-09-16T03:26:39 | 207,232,719 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,746 | java | package cn.tedu.nybike.web;
import cn.tedu.nybike.listener.SCListener;
import cn.tedu.nybike.po.vo.GenderCountVo;
import cn.tedu.nybike.service.GetService;
import cn.tedu.nybike.service.impl.GetServiceImpl;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
public class GenderCountServlet extends HttpServlet {
private Logger logger = LoggerFactory.getLogger(this.getClass());
GetServiceImpl getService=new GetServiceImpl();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
ServletContext sc=getServletContext();//获取ServletContext对象
String info="";
try {
GenderCountVo genderCountVo = getService.getGenderCount();
//此处将对象转化为json
info= JSON.toJSONString(genderCountVo);
resp.setContentType("application/json;charset=utf-8");//此处用于将返回的数据变成json格式
resp.getWriter().write(info);//此处将数据返回给浏览器
logger.info("信息已经 存入request中,传入的信息为:"+info);
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doPost(req, resp);
}
}
| [
"[email protected]"
] | |
733fa2148606a2cbb6acbcc5972257fca92f36e5 | 48f17a05e69c115dd6259aa9b15b59dd590ffaa9 | /Model/DataModel.java | 0d431f91289b716c5aab07208663381f23d4504e | [] | no_license | alexviznytsya/sudoku-solver | e4e563e80f8992cd62b019d7d58acdd1ca3afbda | d539dae0b1fc3b6b6ae73e195934d34dec5df4a0 | refs/heads/master | 2020-04-19T07:30:01.825913 | 2019-02-05T20:46:31 | 2019-02-05T20:46:31 | 168,048,983 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,288 | java | /* file: AlgorithmModel.java
*
* Authors:
*
* Alex Viznytsya
*
* Date:
*
* 10/26/2017
*
* About:
*
* This class iS kind of storage for all variables that can be used
* between different parts of program. From storage of game board and
* candidate lists to variables that help interconnection between
* different parts of MVC software architectural pattern.
*
*/
package Model;
import View.BoardCell;
import java.io.File;
import java.util.*;
public class DataModel {
// Menu properties:
private File loadFile;
private File storeFile;
private boolean checkOnFillMode;
private boolean updateCandidateListsNeeded;
private boolean openFileOnLoad = false;
// Controls properties:
private BoardCell selectedLabel;
// Board properties
private int[][] gameBoardValues;
private int[] lastBoardUpdate;
private List<List<Integer>> candidateLists;
// Default constructor:
public DataModel() {
this.loadFile = null;
this.storeFile = null;
this.checkOnFillMode = false;
this.updateCandidateListsNeeded = true;
this.gameBoardValues = new int[9][9];
this.lastBoardUpdate = new int[3];
this.clearGameBoardValues();
this.candidateLists = new ArrayList<List<Integer>>(81);
this.initializeCandidateLists();
}
// Getter methods;
public File getLoadFile() {
return this.loadFile;
}
public File getStoreFile() {
return this.storeFile;
}
public boolean isCheckOnFillMode() {
return this.checkOnFillMode;
}
public boolean isUpdateCandidateListsNeeded() {
return this.updateCandidateListsNeeded;
}
public BoardCell getSelectedLabel() {
return selectedLabel;
}
public int[][] getGameBoardValues() {
return this.gameBoardValues;
}
public List<List<Integer>> getCandidateLists() {
return this.candidateLists;
}
public boolean isOpenFileOnLoad() {
return this.openFileOnLoad;
}
public int getGameBoardValueAt(int row, int column) {
return this.gameBoardValues[row][column];
}
public int[] getLastBoardUpdate() {
return this.lastBoardUpdate;
}
// Setter methods:
public void setOpenFileOnLoad(boolean openFileOnLoad) {
this.openFileOnLoad = openFileOnLoad;
}
public void setLoadFile(File loadFile) {
this.loadFile = loadFile;
}
public void setStoreFile(File storeFile) {
this.storeFile = storeFile;
}
public void setCheckOnFillMode(boolean checkOnFillMode) {
this.checkOnFillMode = checkOnFillMode;
}
public void setUpdateCandidateListsNeeded(boolean updateCandidateListsNeeded) {
this.updateCandidateListsNeeded = updateCandidateListsNeeded;
}
public void setSelectedLabel(BoardCell selectedLabel) {
this.selectedLabel = selectedLabel;
}
// Other methos that helps to find, set, and update data:
public void setSelectedValue(int position) {
int insertToColumn = position % 9;
int insertToRow = position / 9;
this.gameBoardValues[insertToRow][insertToColumn] = this.selectedLabel.getInlineValue();
}
public void clearGameBoardValues() {
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
this.gameBoardValues[i][j] = 0;
}
}
}
public void updateValue(int row, int column, int value) {
this.gameBoardValues[row][column] = value;
this.lastBoardUpdate[0] = row;
this.lastBoardUpdate[1] = column;
this.lastBoardUpdate[2] = value;
}
public boolean isCompleted() {
for(int i = 0; i < 9; i++) {
for(int j = 0; j < 9; j++) {
if(this.gameBoardValues[i][j] == 0) {
return false;
}
}
}
return true;
}
public void initializeCandidateLists() {
for(int i = 0; i < 81; i++) {
List<Integer> tempList = new ArrayList<Integer>(9);
this.candidateLists.add(tempList);
}
}
public void clearCandidateLists() {
for(int i = 0; i < 81; i++) {
this.candidateLists.get(i).clear();
}
}
public int getGameBoardValueAtBox(int box, int position) {
int counter = 0;
int row = box - (box % 3);
int column = 3 * (box % 3);
for(int i = row; i < (row + 3); i++) {
for(int j = column; j < (column + 3); j++) {
if(counter == position) {
return this.gameBoardValues[i][j];
}
counter++;
}
}
return 0;
}
public List<Integer> getCandidateListAt(int row, int column) {
int position = (row * 9) + column;
if(gameBoardValues[row][column] > 0) {
return new ArrayList<Integer>(9);
} else {
return this.candidateLists.get(position);
}
}
public List<Integer> getCandidateListAtBox(int box, int position){
int counter = 0;
int row = box - (box % 3);
int column = 3 * (box % 3);
for(int i = row; i < (row + 3); i++) {
for(int j = column; j < (column + 3); j++) {
if(counter == position && this.gameBoardValues[i][j] == 0) {
return this.getCandidateListAt(i, j);
} else {
counter++;
}
}
}
List<Integer> tempList = new ArrayList<Integer>(9);
return tempList;
}
public void setCandidateListAt(List<Integer> candidateSet, int row, int column) {
int position = (row * 9) + column;
this.candidateLists.set(position, candidateSet);
}
public void setCandidateListAtBox(List<Integer> updatedCandidaeList, int boxIndex, int boxCellPosition) {
int gameBoardRow = ((boxIndex / 3) * 3) + (boxCellPosition / 3);
int gameBoardColum = ((boxIndex % 3) * 3) + (boxCellPosition % 3);
int linearArrayPosition = (gameBoardRow * 9) + gameBoardColum;
this.candidateLists.set(linearArrayPosition, updatedCandidaeList);
}
}
| [
"[email protected]"
] | |
57c415fc2c5fb83c23927b59dcfa49ea828ea4b5 | 5a2600957dd6dcd58cec0b03d1407d51660ee608 | /src/com/qfedu/dao/ExamplyDao.java | e660c51529198f6cf443ee4282dae11d489b49b4 | [] | no_license | awenwww/smallShop | 3fbae901ec0d640dbb49939e763fb499e04e6f81 | 670b2753b1b438976cf7420d36d5783033e198bc | refs/heads/master | 2023-02-28T23:47:03.994834 | 2021-02-05T10:14:42 | 2021-02-05T10:14:42 | 335,468,641 | 0 | 1 | null | 2021-02-04T02:11:27 | 2021-02-03T01:06:45 | Java | UTF-8 | Java | false | false | 52 | java | package com.qfedu.dao;
public class ExamplyDao {
}
| [
"[email protected]"
] | |
e89fdbd576921302971f54e30dc4f0186ce8636f | 165f89c57c7932b7c180ead4ce6de30a0bb7061b | /src/zadaci_03_04_2017/Zadatak2.java | 749c196efd97064593171bbb375da51c91d86b4c | [] | no_license | Alma-0/BILD-IT-zadaci | 0459a1d0a6c20e72adbcf9c1e0fdea760df38d1d | a2b97426e42bf9934b12db1ec2b10d33c2d94b01 | refs/heads/master | 2021-01-22T03:57:45.946195 | 2017-04-10T15:37:09 | 2017-04-10T15:37:09 | 81,484,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 556 | java | package zadaci_03_04_2017;
import java.util.Scanner;
import userInput.InputSingleNumber;
public class Zadatak2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter two positive integers");
int m = InputSingleNumber.inputNumber(input,0);
int n = InputSingleNumber.inputNumber(input,0);
System.out.println("Greatest coomon divisor is "+gcd(m,n));
}
public static int gcd(int m, int n) {
if (m % n == 0)
return n;
else
return gcd(n, m % n);
}
}
| [
"Alma_@alma"
] | Alma_@alma |
3c4f516b1f202fc308b1e9efa4df5d2716eb6855 | 0e2757fde781e3339b37608f6dbc28d77b99e191 | /src/main/java/salad/TraditionalSalad.java | b056f323900b74ae453276d06f57f46c4581f9eb | [] | no_license | OmelyashchikK/Pattern | b5af2c0ac5b48dfda5c11b9a48d41fee57e85f23 | 0308ec3be2326cbd92a32cadd48a0e56f17c63e2 | refs/heads/master | 2016-09-05T14:42:07.531617 | 2014-12-23T09:49:47 | 2014-12-23T09:49:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | 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 salad;
import inerfaceProduct.Salad;
/**
*
* @author asus
*/
public class TraditionalSalad implements Salad {
@Override
public void cut() {
System.out.println("Cut salad 'Olivier'");
}
}
| [
"[email protected]"
] | |
5826e1d8c0715aaa22508484a09a4ba41c374790 | 415862872ec8a5df81d4bacb6beb4d43b49bbad5 | /Omnomnom/src/OmnomnomVisitor.java | acdb86728079a6ec99a12c1a804be2f9a5a5da0d | [] | no_license | mhozza/compilers2014 | 30b8693cbae2940d771b250d0fbcd0826d6f73e4 | 20d2804a53e6e7fd501d78170ebcd314e63ec235 | refs/heads/master | 2021-01-20T22:25:51.415760 | 2015-01-15T22:06:34 | 2015-01-15T22:06:34 | 24,514,418 | 0 | 6 | null | 2015-01-15T21:42:18 | 2014-09-26T20:31:14 | Java | UTF-8 | Java | false | false | 11,629 | java | // Generated from Omnomnom.g4 by ANTLR 4.4
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
/**
* This interface defines a complete generic visitor for a parse tree produced
* by {@link OmnomnomParser}.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
public interface OmnomnomVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code Write}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitWrite(@NotNull OmnomnomParser.WriteContext ctx);
/**
* Visit a parse tree produced by the {@code Ret}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitRet(@NotNull OmnomnomParser.RetContext ctx);
/**
* Visit a parse tree produced by the {@code Delete}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitDelete(@NotNull OmnomnomParser.DeleteContext ctx);
/**
* Visit a parse tree produced by the {@code Par}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitPar(@NotNull OmnomnomParser.ParContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#fblock}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFblock(@NotNull OmnomnomParser.FblockContext ctx);
/**
* Visit a parse tree produced by the {@code TypeTuple}
* labeled alternative in {@link OmnomnomParser#type}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypeTuple(@NotNull OmnomnomParser.TypeTupleContext ctx);
/**
* Visit a parse tree produced by the {@code Set}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSet(@NotNull OmnomnomParser.SetContext ctx);
/**
* Visit a parse tree produced by the {@code ValTuple}
* labeled alternative in {@link OmnomnomParser#val}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitValTuple(@NotNull OmnomnomParser.ValTupleContext ctx);
/**
* Visit a parse tree produced by the {@code SimpleAssign}
* labeled alternative in {@link OmnomnomParser#assignment}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSimpleAssign(@NotNull OmnomnomParser.SimpleAssignContext ctx);
/**
* Visit a parse tree produced by the {@code Una}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitUna(@NotNull OmnomnomParser.UnaContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#extern}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExtern(@NotNull OmnomnomParser.ExternContext ctx);
/**
* Visit a parse tree produced by the {@code Remove}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitRemove(@NotNull OmnomnomParser.RemoveContext ctx);
/**
* Visit a parse tree produced by the {@code Read}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitRead(@NotNull OmnomnomParser.ReadContext ctx);
/**
* Visit a parse tree produced by the {@code ValId}
* labeled alternative in {@link OmnomnomParser#val}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitValId(@NotNull OmnomnomParser.ValIdContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#arglist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitArglist(@NotNull OmnomnomParser.ArglistContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#function}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFunction(@NotNull OmnomnomParser.FunctionContext ctx);
/**
* Visit a parse tree produced by the {@code ValString}
* labeled alternative in {@link OmnomnomParser#val}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitValString(@NotNull OmnomnomParser.ValStringContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStatement(@NotNull OmnomnomParser.StatementContext ctx);
/**
* Visit a parse tree produced by the {@code Expon}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExpon(@NotNull OmnomnomParser.ExponContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#initialization}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitInitialization(@NotNull OmnomnomParser.InitializationContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#block}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBlock(@NotNull OmnomnomParser.BlockContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#id}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitId(@NotNull OmnomnomParser.IdContext ctx);
/**
* Visit a parse tree produced by the {@code TypeArray}
* labeled alternative in {@link OmnomnomParser#type}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypeArray(@NotNull OmnomnomParser.TypeArrayContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#init}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitInit(@NotNull OmnomnomParser.InitContext ctx);
/**
* Visit a parse tree produced by the {@code ValFloat}
* labeled alternative in {@link OmnomnomParser#val}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitValFloat(@NotNull OmnomnomParser.ValFloatContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#typelist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypelist(@NotNull OmnomnomParser.TypelistContext ctx);
/**
* Visit a parse tree produced by the {@code GetTuple}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitGetTuple(@NotNull OmnomnomParser.GetTupleContext ctx);
/**
* Visit a parse tree produced by the {@code ValBool}
* labeled alternative in {@link OmnomnomParser#val}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitValBool(@NotNull OmnomnomParser.ValBoolContext ctx);
/**
* Visit a parse tree produced by the {@code Def}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitDef(@NotNull OmnomnomParser.DefContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#var}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitVar(@NotNull OmnomnomParser.VarContext ctx);
/**
* Visit a parse tree produced by the {@code Bin}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBin(@NotNull OmnomnomParser.BinContext ctx);
/**
* Visit a parse tree produced by the {@code ValInt}
* labeled alternative in {@link OmnomnomParser#val}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitValInt(@NotNull OmnomnomParser.ValIntContext ctx);
/**
* Visit a parse tree produced by the {@code For}
* labeled alternative in {@link OmnomnomParser#block_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFor(@NotNull OmnomnomParser.ForContext ctx);
/**
* Visit a parse tree produced by the {@code Emp}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitEmp(@NotNull OmnomnomParser.EmpContext ctx);
/**
* Visit a parse tree produced by {@link OmnomnomParser#paramlist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitParamlist(@NotNull OmnomnomParser.ParamlistContext ctx);
/**
* Visit a parse tree produced by the {@code While}
* labeled alternative in {@link OmnomnomParser#block_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitWhile(@NotNull OmnomnomParser.WhileContext ctx);
/**
* Visit a parse tree produced by the {@code ValArray}
* labeled alternative in {@link OmnomnomParser#val}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitValArray(@NotNull OmnomnomParser.ValArrayContext ctx);
/**
* Visit a parse tree produced by the {@code TypeBasic}
* labeled alternative in {@link OmnomnomParser#type}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypeBasic(@NotNull OmnomnomParser.TypeBasicContext ctx);
/**
* Visit a parse tree produced by the {@code VarDef}
* labeled alternative in {@link OmnomnomParser#definition}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitVarDef(@NotNull OmnomnomParser.VarDefContext ctx);
/**
* Visit a parse tree produced by the {@code Append}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAppend(@NotNull OmnomnomParser.AppendContext ctx);
/**
* Visit a parse tree produced by the {@code Length}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitLength(@NotNull OmnomnomParser.LengthContext ctx);
/**
* Visit a parse tree produced by the {@code Get}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitGet(@NotNull OmnomnomParser.GetContext ctx);
/**
* Visit a parse tree produced by the {@code Value}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitValue(@NotNull OmnomnomParser.ValueContext ctx);
/**
* Visit a parse tree produced by the {@code Assign}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAssign(@NotNull OmnomnomParser.AssignContext ctx);
/**
* Visit a parse tree produced by the {@code Exp}
* labeled alternative in {@link OmnomnomParser#inline_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExp(@NotNull OmnomnomParser.ExpContext ctx);
/**
* Visit a parse tree produced by the {@code If}
* labeled alternative in {@link OmnomnomParser#block_statement}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIf(@NotNull OmnomnomParser.IfContext ctx);
/**
* Visit a parse tree produced by the {@code FCall}
* labeled alternative in {@link OmnomnomParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFCall(@NotNull OmnomnomParser.FCallContext ctx);
/**
* Visit a parse tree produced by the {@code Inc}
* labeled alternative in {@link OmnomnomParser#assignment}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitInc(@NotNull OmnomnomParser.IncContext ctx);
} | [
"[email protected]"
] | |
aa5ef8c31815857ecf5cf95488289029a2798c23 | f83e1ccdb21d06b925b99d5b19ba8831299d2a94 | /src/main/java/com/sapGarden/application/commons/dao/CommonDao.java | a3fa64405c553487f5876807ae9665946b60e651 | [] | no_license | itface/sg | 312209cc027f2e3ce41bdaef5adf2861211a2b78 | 05e6a42f0d98c8dfa6144126f039e9aaa8f5b218 | refs/heads/master | 2016-09-15T20:51:27.291695 | 2013-12-05T02:32:22 | 2013-12-05T02:32:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 852 | java | package com.sapGarden.application.commons.dao;
import java.util.List;
public interface CommonDao {
public long count(Class modelClass,long sapclient);
public List queryBySql(Class modelClass,String sql);
public List findByIds(Class modelClass,String ids);
public List findBySapclient(Class modelClass,long sapclient);
public List findBySapclientAndCondition(String modelName,int pageNumber,int rowsPerPage,long sapclient,String filter);
public void deleteBySapclient(Class modelClass,long sapclient);
public void updateGardenFlag(long sapclient,Class modelClass,int value);
public void delete(Object object);
public void save(Object object);
public void deleteById(Class modleClass,long id);
public void update(Object object);
public void updateBySql(String sql);
public Object findById(Class modleClass,long id);
}
| [
"[email protected]"
] | |
debf8cced49e8b4960ab19da6929728c1f49e19d | 4a015f5a9b655f027a4d4e04fdc926bb893d093d | /photo-service/src/main/java/mk/ukim/finki/photo/domain/Photo.java | 1cd5b7229b742ca8dfa97aed121b93afed6463eb | [
"MIT"
] | permissive | kirkovg/university-microservices | cd1bfe8f92dba3b422c56903b972a2aa9f0b45c7 | 2c8db22c3337014e3a8aa5de3e6a1a32d35c9ba0 | refs/heads/master | 2021-12-26T13:05:05.598702 | 2018-09-11T18:53:35 | 2018-09-11T18:53:35 | 147,234,534 | 0 | 0 | MIT | 2021-08-12T22:16:40 | 2018-09-03T17:25:19 | Java | UTF-8 | Java | false | false | 2,973 | java | package mk.ukim.finki.photo.domain;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
/**
* A Photo.
*/
@Entity
@Table(name = "photo")
public class Photo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "name")
private String name;
@Column(name = "description")
private String description;
@Lob
@Column(name = "picture", nullable = false)
private byte[] picture;
@Column(name = "picture_content_type", nullable = false)
private String pictureContentType;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public Photo name(String name) {
this.name = name;
return this;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public Photo description(String description) {
this.description = description;
return this;
}
public void setDescription(String description) {
this.description = description;
}
public byte[] getPicture() {
return picture;
}
public Photo picture(byte[] picture) {
this.picture = picture;
return this;
}
public void setPicture(byte[] picture) {
this.picture = picture;
}
public String getPictureContentType() {
return pictureContentType;
}
public Photo pictureContentType(String pictureContentType) {
this.pictureContentType = pictureContentType;
return this;
}
public void setPictureContentType(String pictureContentType) {
this.pictureContentType = pictureContentType;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Photo photo = (Photo) o;
if (photo.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), photo.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Photo{" +
"id=" + getId() +
", name='" + getName() + "'" +
", description='" + getDescription() + "'" +
", picture='" + getPicture() + "'" +
", pictureContentType='" + getPictureContentType() + "'" +
"}";
}
}
| [
"[email protected]"
] | |
dfca7b42be8fb59f12a0caa17728d57c03a8faa5 | b926fc22102ae99fb7bfad9e4d2ee9ef64be8a07 | /xdclass-user-service/src/test/java/xin/yyl/db/biz/AddressTest.java | 98c70e10ca18cab070a2271ae13ba45cdd0712f5 | [] | no_license | chengzix/yangyiluo-1024-shop | 7f75b5ece7005e023374d258f2c9785c4e42c49f | 623cf8ebcfb724a7bc43f8a41c3b8fdf5cc7ad3f | refs/heads/master | 2023-03-26T02:11:07.121956 | 2021-03-25T05:07:47 | 2021-03-25T05:07:47 | 351,280,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | package xin.yyl.db.biz;
import net.xdclass.UserApplication;
import net.xdclass.service.AddressService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = UserApplication.class)
public class AddressTest {
@Autowired
private AddressService addressService;
@Test
public void testAddress(){
addressService.getById(1);
}
}
| [
"[email protected]"
] | |
36f66df6b893da095c522fff62c07d5924d9f976 | 8e73034a233b8940b291ad1a2dcab068986f5404 | /src/test/java/utility/Driver.java | 3b0b342e0441cf836ca3d3bdc6e2056345308e3f | [] | no_license | ZeynepSulukcu/SDETProficiencyProject | f77b050789de7a351743cf6642f35db5de3ba3c6 | ae5d2ff9ed38fd01e9ffae43b746159da198ad91 | refs/heads/master | 2023-01-30T13:18:19.549234 | 2020-12-06T18:25:34 | 2020-12-06T18:25:34 | 319,101,948 | 0 | 0 | null | 2020-12-14T19:23:12 | 2020-12-06T18:24:55 | Java | UTF-8 | Java | false | false | 922 | java | package utility;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Driver {
protected static WebDriver driver;
public static WebDriver getDriver()
{
if (driver == null)
{
// System.SetProperty'nin karşılığı olarak projeyi chromedriver'la
// çalışacak şekilde buraya set etmiş olduk
WebDriverManager.chromedriver().setup(); // System.SetProperty nin karşılığı
driver=new ChromeDriver();
// firefox için de aşağıdaki şekilde
// WebDriverManager.firefoxdriver().setup();
// driver=new FirefoxDriver();
}
return driver;
}
public static void quitDriver()
{
if (driver != null)
{
driver.quit();
driver=null;
}
}
}
| [
"[email protected]"
] | |
9b5e55d1e4566af4c30a69f111674a4b363416fb | 498a51e529d0db51c0df964b4bae1626e646eeaa | /ffc/src/main/java/com/berry_med/monitordemo/view/WaveformView.java | 4d58f722f50e1f974fab2e655472f5fb86938426 | [
"Apache-2.0"
] | permissive | ffc-nectec/android | d8002b939fcd967eb55038775d244ea464ea721d | d5619537b8b292914995e0d0693c0c94824f091a | refs/heads/master | 2022-02-11T13:07:42.059252 | 2022-01-24T11:49:51 | 2022-01-24T11:52:39 | 125,313,191 | 2 | 1 | Apache-2.0 | 2022-01-25T08:48:08 | 2018-03-15T04:42:14 | JavaScript | UTF-8 | Java | false | false | 6,571 | java | package com.berry_med.monitordemo.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import ffc.app.R;
/**
* Created by ZXX on 2017/7/8.
*/
public class WaveformView extends SurfaceView implements SurfaceHolder.Callback{
private static final String TAG = ">>>WAVEFORM VIEW<<<";
private int mHeight;
private int mWidth;
private Paint mWavePaint;
private Paint mBackgroundPaint;
private SurfaceHolder mSurfaceHolder;
private Canvas mCanvas;
private Point mLastPoint;
private float pointStep;
private float mLineWidth;
private int[] mDataBuffer;
private int mDataBufferIndex;
private int mBufferSize;
private int mMaxValue;
private boolean isSurfaceViewAvailable;
public WaveformView(Context context){
this(context,null);
}
public WaveformView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public WaveformView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
TypedArray arr = context.getTheme().obtainStyledAttributes(attrs, R.styleable.WaveformView, defStyleAttr, 0);
int waveColor = arr.getColor(R.styleable.WaveformView_waveColor, Color.WHITE);
mLineWidth = arr.getDimension(R.styleable.WaveformView_lineWidth, TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, metrics));
pointStep = arr.getDimension(R.styleable.WaveformView_pointStep, TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1.4f, metrics));
mBufferSize = arr.getInt(R.styleable.WaveformView_bufferSize, 5);
mMaxValue = arr.getInteger(R.styleable.WaveformView_maxValue, 100);
mWavePaint = new Paint();
mWavePaint.setColor(waveColor);
mWavePaint.setStrokeWidth(mLineWidth);
mWavePaint.setStyle(Paint.Style.STROKE);
mWavePaint.setStrokeCap(Paint.Cap.ROUND);
mWavePaint.setStrokeJoin(Paint.Join.ROUND);
int backgroundColor = arr.getColor(R.styleable.WaveformView_backgroundColor, Color.rgb(70,189,147));
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(backgroundColor);
//mBackgroundPaint.setColor(R.color.red_50);
mSurfaceHolder = getHolder();
mSurfaceHolder.addCallback(this);
mDataBuffer = new int[mBufferSize*2];
mDataBufferIndex = 0;
setBackgroundColor(backgroundColor);
setZOrderOnTop(true);
getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = (MeasureSpec.getSize(widthMeasureSpec));
if(width > mWidth) mWidth = width;
int height = (int) (MeasureSpec.getSize(heightMeasureSpec)*0.95);
if(height > mHeight) mHeight = height;
//
// mWidth = (MeasureSpec.getSize(widthMeasureSpec));
// mHeight = (int) (MeasureSpec.getSize(heightMeasureSpec)*0.95);
// Log.i(TAG, "onMeasure: " + mWidth +"-" + mHeight );
}
public void addAmp(int amp){
if(!isSurfaceViewAvailable) {
mDataBufferIndex = 0;
return;
}
if(mLastPoint == null){
mLastPoint = new Point();
mLastPoint.x = 0;
mLastPoint.y = (int) (mHeight - mHeight/(float)mMaxValue * amp);
return;
}
mDataBuffer[mDataBufferIndex] = amp;
mDataBufferIndex++;
if(mDataBufferIndex >= mBufferSize){
mDataBufferIndex = 0;
int points = (int) ((mWidth - mLastPoint.x) / pointStep);
points = points > mBufferSize ? mBufferSize : points;
int xRight = (int) (mLastPoint.x + pointStep*points);
mCanvas = mSurfaceHolder.lockCanvas(new Rect(mLastPoint.x, 0, (int) (xRight + pointStep*2), (int) (mHeight + mLineWidth)));
if(mCanvas == null) return;
mCanvas.drawRect(new Rect(mLastPoint.x, 0, (int) (xRight + pointStep*2), (int) (mHeight+mLineWidth)), mBackgroundPaint);
for(int i = 0; i < points; i++){
Point point = new Point();
point.x = (int) (mLastPoint.x + pointStep);
point.y = (int) (mHeight - mHeight/(float)mMaxValue * mDataBuffer[i]);
mCanvas.drawLine(mLastPoint.x, mLastPoint.y,point.x, point.y ,mWavePaint);
mLastPoint = point;
}
mSurfaceHolder.unlockCanvasAndPost(mCanvas);
postInvalidate();
if((int) ((mWidth - mLastPoint.x) / pointStep) < 1){
mLastPoint.x = 0;
}
if(points < mBufferSize){
//Log.e(TAG, "addAmp: "+points);
mDataBufferIndex = mBufferSize - points;
for(int i = 0; i < mDataBufferIndex; i++){
mDataBuffer[i] = mDataBuffer[points + i];
}
mLastPoint.x = 0;
//Log.i(TAG, "drawLine mDataBufferIndex:" + mDataBufferIndex + " Points:" + points);
}
}
}
public void reset(){
mDataBufferIndex = 0;
mLastPoint = new Point(0,(int) (mHeight - mHeight/(float)mMaxValue * 128));
Canvas c = mSurfaceHolder.lockCanvas();
c.drawRect(new Rect(0,0,mWidth,mHeight), mBackgroundPaint);
mSurfaceHolder.unlockCanvasAndPost(c);
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
if(mLastPoint != null){
mLastPoint = null;
}
//Log.e(TAG, "surfaceCreated: ");
isSurfaceViewAvailable = true;
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Canvas c = holder.lockCanvas();
c.drawRect(new Rect(0,0,mWidth,mHeight), mBackgroundPaint);
holder.unlockCanvasAndPost(c);
// Log.e(TAG, "surfaceChanged: ");
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
isSurfaceViewAvailable = false;
}
}
| [
"[email protected]"
] | |
c278a6ba114f099ff42e8cdeda371106e2006b84 | 0cb952fd04c0b7f7eaf91dc095fedf792a905b4f | /src/com/cracking/coding/interview/system/stackOverflow/Badge.java | 70c8a05982c22e10bb5073c529862bde64b08c1e | [] | no_license | nitin023/Interview | faee9a89c4c302b02aca356f86c8f2282915dd7b | a1e44626666749a8d0405c72d0eb5ff86c206518 | refs/heads/master | 2023-04-07T21:57:05.557415 | 2021-04-22T04:45:00 | 2021-04-22T04:45:00 | 295,164,830 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 125 | java | package com.cracking.coding.interview.system.stackOverflow;
public class Badge {
String name;
String description;
}
| [
"[email protected]"
] | |
35757d37feeae2e5378805ff13fbf853c2289b06 | 525dd17d7e8bf0d45e77b657faf16426febaf005 | /src/main/java/com/liusoft/sc/http/RequestHeader.java | e928517594ffd737bcbe58622d951f3e5b23d057 | [] | no_license | liuinsect/servletcontainer | e79caac872b78834b74231f842b5db5c670ad482 | 22f38c8b05a6e75c82a1ca59f8bc76f342aed8f3 | refs/heads/master | 2021-01-20T08:44:13.453037 | 2014-02-13T11:59:45 | 2014-02-13T11:59:45 | 12,677,892 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,250 | java | package com.liusoft.sc.http;
import java.util.Map;
import com.liusoft.sc.constant.HttpHeaderConstant;
import com.liusoft.sc.exception.ExceptionFactory;
/**
* 请求头对应实体
* @Package com.liusoft.http
* @author liukunyang
* @date 2013-9-2 下午04:20:21
* @version V1.0
*/
public class RequestHeader {
private String method;
private String requestURI;
private String protocol;
private String protocolVersion;
private String accept;
private String acceptEncoding;
private String acceptLanguage;
private String connection;
private String cookie;
private String host;
private String referer;
private String userAgent;
public void init(Map<String,String> map){
if( map == null || map.isEmpty() ){
throw ExceptionFactory.throwRunTimeException("map is null or empty");
}
this.setMethod( map.get( HttpHeaderConstant.METHOD ) );
this.setRequestURI( map.get( HttpHeaderConstant.REQUEST_URI ) );
this.setProtocol( map.get( HttpHeaderConstant.PROTOCOL ) );
this.setProtocolVersion( map.get( HttpHeaderConstant.PROTOCOL_VERSION ) );
this.setAccept( map.get( HttpHeaderConstant.ACCEPT ) );
this.setAcceptEncoding( map.get( HttpHeaderConstant.ACCEPT_ENCODING ) );
this.setAcceptLanguage( map.get( HttpHeaderConstant.ACCEPT_LANGUAGE ) );
this.setConnection( map.get( HttpHeaderConstant.CONNECTION ) );
this.setCookie( map.get( HttpHeaderConstant.COOKIE ) );
this.setHost( map.get( HttpHeaderConstant.HOST ) );
this.setReferer( map.get( HttpHeaderConstant.REFERER ) );
this.setUserAgent( map.get( HttpHeaderConstant.USER_AGENT ) );
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getRequestURI() {
return requestURI;
}
public void setRequestURI(String requestURI) {
this.requestURI = requestURI;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
public String getProtocolVersion() {
return protocolVersion;
}
public void setProtocolVersion(String protocolVersion) {
this.protocolVersion = protocolVersion;
}
public String getAccept() {
return accept;
}
public void setAccept(String accept) {
this.accept = accept;
}
public String getAcceptEncoding() {
return acceptEncoding;
}
public void setAcceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
}
public String getAcceptLanguage() {
return acceptLanguage;
}
public void setAcceptLanguage(String acceptLanguage) {
this.acceptLanguage = acceptLanguage;
}
public String getConnection() {
return connection;
}
public void setConnection(String connection) {
this.connection = connection;
}
public String getCookie() {
return cookie;
}
public void setCookie(String cookie) {
this.cookie = cookie;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getReferer() {
return referer;
}
public void setReferer(String referer) {
this.referer = referer;
}
public String getUserAgent() {
return userAgent;
}
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}
}
| [
"[email protected]"
] | |
a6ac68cea5b6730d901ba5e99003721651ba6d29 | c3e009e6bdce40015980f1fc240b7e6e06accd84 | /ai/branches/firstAttemptCombat/MyScanner.java | ae7b83d50d197ce28e5c65035ae8cf2941666384 | [] | no_license | abe-taylor-970/AI-Challenge-2011 | ab16b91430d2b476de19815212e3e5c89239aaf8 | 8c7880697eb69507b7ba1d6cadc2f3b017b388c7 | refs/heads/master | 2021-01-10T14:44:09.489258 | 2016-02-06T21:49:38 | 2016-02-06T21:49:38 | 51,223,473 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | import java.util.StringTokenizer;
public class MyScanner extends StringTokenizer {
public MyScanner(String line) {
super(line);
}
public boolean hasNext() {
return (hasMoreTokens());
}
public boolean hasNextInt() {
return(hasMoreTokens());
}
public String next() {
return(nextToken());
}
public int nextInt() {
return (new Integer(next()));
}
}
| [
"[email protected]"
] | |
f3919d3fd36a2a8691065771776ca89a791fdfff | a7b868c8c81984dbcb17c1acc09c0f0ab8e36c59 | /src/main/java/com/alipay/api/domain/ZhimaCreditPeIndustryTradeCloseModel.java | db1d0e6fba887a44f7df80ad012073fe7fe680a1 | [
"Apache-2.0"
] | permissive | 1755616537/alipay-sdk-java-all | a7ebd46213f22b866fa3ab20c738335fc42c4043 | 3ff52e7212c762f030302493aadf859a78e3ebf7 | refs/heads/master | 2023-02-26T01:46:16.159565 | 2021-02-02T01:54:36 | 2021-02-02T01:54:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,149 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 信用服务产品交易关闭
*
* @author auto create
* @since 1.0, 2019-05-16 11:34:53
*/
public class ZhimaCreditPeIndustryTradeCloseModel extends AlipayObject {
private static final long serialVersionUID = 7271758621342558953L;
/**
* 关闭时间,接入方通过其他渠道实际收款时间,应小于当前时间. 可空,不传将默认取服务器当前时间
*/
@ApiField("close_time")
private String closeTime;
/**
* 扩展信息字段,格式:json,注意,如果字符串对应的json对象包含中文字符,需要对包含中文的字段进行编码
*/
@ApiField("ext_info")
private String extInfo;
/**
* 操作类型,close:资金单关闭,finish:资金单完结,已经通过其他渠道完成交易
*/
@ApiField("operate")
private String operate;
/**
* 商户扣款时传入的扣款资金单号,需要保证唯一
*/
@ApiField("out_fund_no")
private String outFundNo;
/**
* 签约产品码
*/
@ApiField("product_code")
private String productCode;
/**
* 平台订单号
*/
@ApiField("zm_order_id")
private String zmOrderId;
public String getCloseTime() {
return this.closeTime;
}
public void setCloseTime(String closeTime) {
this.closeTime = closeTime;
}
public String getExtInfo() {
return this.extInfo;
}
public void setExtInfo(String extInfo) {
this.extInfo = extInfo;
}
public String getOperate() {
return this.operate;
}
public void setOperate(String operate) {
this.operate = operate;
}
public String getOutFundNo() {
return this.outFundNo;
}
public void setOutFundNo(String outFundNo) {
this.outFundNo = outFundNo;
}
public String getProductCode() {
return this.productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getZmOrderId() {
return this.zmOrderId;
}
public void setZmOrderId(String zmOrderId) {
this.zmOrderId = zmOrderId;
}
}
| [
"[email protected]"
] | |
c1a0a989732bda5cd593b374d8aec6cbf6cee056 | fa338aa9a23c959b549a38ea732670415dd52fab | /src/com/portal/cms/action/admin/main/CmsAdminLocalAct.java | 4657ebad7cf062905b12ff480acbad97cea81ca8 | [] | no_license | liumangafei/lsq-portal | 0529cd3aa49cf00ee3204f06d2dc7eb4f2a0351b | 7a1ea543a085ec283546f466b8d0c86195a8d487 | refs/heads/master | 2020-04-10T17:32:06.555978 | 2015-07-12T15:58:49 | 2015-07-12T15:58:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,601 | java | package com.portal.cms.action.admin.main;
import static com.portal.common.page.SimplePage.cpn;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import com.portal.common.page.Pagination;
import com.portal.common.web.CookieUtils;
import com.portal.common.web.RequestUtils;
import com.portal.core.entity.CmsGroup;
import com.portal.core.entity.CmsRole;
import com.portal.core.entity.CmsSite;
import com.portal.core.entity.CmsUser;
import com.portal.core.entity.CmsUserExt;
import com.portal.core.entity.CmsUserSite;
import com.portal.core.web.WebErrors;
import com.portal.core.web.util.CmsUtils;
/**
* 本站管理员ACTION
*/
@Controller
public class CmsAdminLocalAct extends CmsAdminAbstract {
private static final Logger log = LoggerFactory
.getLogger(CmsAdminLocalAct.class);
@RequiresPermissions("admin_local:v_list")
@RequestMapping("/admin_local/v_list.do")
public String list(String queryUsername, String queryEmail,
Integer queryGroupId, Boolean queryDisabled, Integer pageNo,
HttpServletRequest request, ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
CmsUser currUser = CmsUtils.getUser(request);
Pagination pagination = manager.getPage(queryUsername, queryEmail, site
.getId(), queryGroupId, queryDisabled, true,
currUser.getRank(), cpn(pageNo), CookieUtils
.getPageSize(request));
model.addAttribute("pagination", pagination);
model.addAttribute("queryUsername", queryUsername);
model.addAttribute("queryEmail", queryEmail);
model.addAttribute("queryGroupId", queryGroupId);
model.addAttribute("queryDisabled", queryDisabled);
return "admin/local/list";
}
@RequiresPermissions("admin_local:v_add")
@RequestMapping("/admin_local/v_add.do")
public String add(HttpServletRequest request, ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
CmsUser currUser = CmsUtils.getUser(request);
List<CmsGroup> groupList = cmsGroupMng.getList();
List<CmsRole> roleList = cmsRoleMng.getList();
model.addAttribute("site", site);
model.addAttribute("groupList", groupList);
model.addAttribute("roleList", roleList);
model.addAttribute("currRank", currUser.getRank());
return "admin/local/add";
}
@RequiresPermissions("admin_local:v_edit")
@RequestMapping("/admin_local/v_edit.do")
public String edit(Integer id, Integer queryGroupId, Boolean queryDisabled,
HttpServletRequest request,HttpServletResponse response,ModelMap model) throws IOException {
CmsSite site = CmsUtils.getSite(request);
String queryUsername = RequestUtils.getQueryParam(request,
"queryUsername");
String queryEmail = RequestUtils.getQueryParam(request, "queryEmail");
CmsUser currUser = CmsUtils.getUser(request);
WebErrors errors = validateEdit(id, request);
if (errors.hasErrors()) {
return errors.showErrorPage(model);
}
CmsUser admin = manager.findById(id);
CmsUserSite userSite = admin.getUserSite(site.getId());
List<CmsGroup> groupList = cmsGroupMng.getList();
List<CmsRole> roleList = cmsRoleMng.getList();
model.addAttribute("cmsAdmin", admin);
model.addAttribute("site", site);
model.addAttribute("userSite", userSite);
model.addAttribute("roleIds", admin.getRoleIds());
model.addAttribute("groupList", groupList);
model.addAttribute("roleList", roleList);
model.addAttribute("currRank", currUser.getRank());
model.addAttribute("queryUsername", queryUsername);
model.addAttribute("queryEmail", queryEmail);
model.addAttribute("queryGroupId", queryGroupId);
model.addAttribute("queryDisabled", queryDisabled);
return "admin/local/edit";
}
@RequiresPermissions("admin_local:o_save")
@RequestMapping("/admin_local/o_save.do")
public String save(CmsUser bean, CmsUserExt ext, String username,
String email, String password,Boolean selfAdmin, Integer rank, Integer groupId,
Integer[] roleIds, Integer[] channelIds,
Byte step, Boolean allChannel, HttpServletRequest request,
ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
WebErrors errors = validateSave(bean, request);
if (errors.hasErrors()) {
return errors.showErrorPage(model);
}
Integer[] siteIds = new Integer[] { site.getId() };
Byte[] steps = new Byte[]{step};
Boolean[] allChannels = new Boolean[]{allChannel};
String ip = RequestUtils.getIpAddr(request);
bean = manager.saveAdmin(username, email, password, ip, false,
selfAdmin, rank, groupId,roleIds, channelIds,
siteIds, steps, allChannels, ext);
log.info("save CmsAdmin id={}", bean.getId());
cmsLogMng.operating(request, "cmsUser.log.save", "id=" + bean.getId()
+ ";username=" + bean.getUsername());
return "redirect:v_list.do";
}
@RequiresPermissions("admin_local:o_update")
@RequestMapping("/admin_local/o_update.do")
public String update(CmsUser bean, CmsUserExt ext, String password,
Integer groupId,Integer[] roleIds,Integer[] channelIds, Byte step, Boolean allChannel,
String queryUsername, String queryEmail, Integer queryGroupId,
Boolean queryDisabled, Integer pageNo, HttpServletRequest request,
ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
WebErrors errors = validateUpdate(bean.getId(),bean.getRank(), request);
if (errors.hasErrors()) {
return errors.showErrorPage(model);
}
bean = manager.updateAdmin(bean, ext, password, groupId,roleIds,channelIds, site.getId(), step, allChannel);
log.info("update CmsAdmin id={}.", bean.getId());
cmsLogMng.operating(request, "cmsUser.log.update", "id=" + bean.getId()
+ ";username=" + bean.getUsername());
return list(queryUsername, queryEmail, queryGroupId, queryDisabled,
pageNo, request, model);
}
@RequiresPermissions("admin_local:o_delete")
@RequestMapping("/admin_local/o_delete.do")
public String delete(Integer[] ids, Integer queryGroupId,
Boolean queryDisabled, Integer pageNo, HttpServletRequest request,
ModelMap model) {
String queryUsername = RequestUtils.getQueryParam(request,
"queryUsername");
String queryEmail = RequestUtils.getQueryParam(request, "queryEmail");
WebErrors errors = validateDelete(ids, request);
if (errors.hasErrors()) {
return errors.showErrorPage(model);
}
CmsUser[] beans = manager.deleteByIds(ids);
for (CmsUser bean : beans) {
log.info("delete CmsAdmin id={}", bean.getId());
cmsLogMng.operating(request, "cmsUser.log.delete", "id="
+ bean.getId() + ";username=" + bean.getUsername());
}
return list(queryUsername, queryEmail, queryGroupId, queryDisabled,
pageNo, request, model);
}
@RequiresPermissions("admin_local:v_channels_add")
@RequestMapping(value = "/admin_local/v_channels_add.do")
public String channelsAdd(Integer siteId, HttpServletRequest request,
HttpServletResponse response, ModelMap model) {
return channelsAddJson(siteId, request, response, model);
}
@RequiresPermissions("admin_local:v_channels_edit")
@RequestMapping(value = "/admin_local/v_channels_edit.do")
public String channelsEdit(Integer userId, Integer siteId,
HttpServletRequest request, HttpServletResponse response,
ModelMap model) {
return channelsEditJson(userId, siteId, request, response, model);
}
@RequiresPermissions("admin_local:v_check_username")
@RequestMapping(value = "/admin_local/v_check_username.do")
public void checkUsername(HttpServletRequest request, HttpServletResponse response) {
checkUserJson(request, response);
}
@RequiresPermissions("admin_local:v_check_email")
@RequestMapping(value = "/admin_local/v_check_email.do")
public void checkEmail(String email, HttpServletResponse response) {
checkEmailJson(email, response);
}
private WebErrors validateSave(CmsUser bean, HttpServletRequest request) {
WebErrors errors = WebErrors.create(request);
return errors;
}
private WebErrors validateEdit(Integer id, HttpServletRequest request) {
WebErrors errors = WebErrors.create(request);
if (vldExist(id, errors)) {
return errors;
}
return errors;
}
private WebErrors validateUpdate(Integer id,Integer rank, HttpServletRequest request) {
WebErrors errors = WebErrors.create(request);
if (vldExist(id, errors)) {
return errors;
}
if (vldParams(id,rank, request, errors)) {
return errors;
}
return errors;
}
private WebErrors validateDelete(Integer[] ids, HttpServletRequest request) {
WebErrors errors = WebErrors.create(request);
errors.ifEmpty(ids, "ids");
for (Integer id : ids) {
vldExist(id, errors);
}
return errors;
}
private boolean vldExist(Integer id, WebErrors errors) {
if (errors.ifNull(id, "id")) {
return true;
}
CmsUser entity = manager.findById(id);
if (errors.ifNotExist(entity, CmsUser.class, id)) {
return true;
}
return false;
}
private boolean vldParams(Integer id,Integer rank, HttpServletRequest request,
WebErrors errors) {
CmsUser user = CmsUtils.getUser(request);
CmsUser entity = manager.findById(id);
//提升等级大于当前登录用户
if (rank > user.getRank()) {
errors.addErrorCode("error.noPermissionToRaiseRank", id);
return true;
}
//修改的用户等级大于当前登录用户 无权限
if (entity.getRank() > user.getRank()) {
errors.addErrorCode("error.noPermission", CmsUser.class, id);
return true;
}
return false;
}
} | [
"[email protected]"
] | |
e4edb59e9c338dc1a14e5e0747265192f852fe8a | c6879cde47f500f05052c380bc7cc833aca98d12 | /eurekaclient2/src/test/java/com/example/eurekaclient2/Eurekaclient2ApplicationTests.java | eaa5a97c3e7c3878dc7dbe522caad962dc59d63b | [] | no_license | xianlao/springcloud | 3cfa66012775bf56034a382c0d4e86ae45f6fdc4 | 95452d0fe9eedd43d5de7662608960034c9521d8 | refs/heads/master | 2020-04-27T11:21:55.475623 | 2019-03-08T07:10:16 | 2019-03-08T07:10:16 | 174,292,785 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package com.example.eurekaclient2;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class Eurekaclient2ApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
563ba1c9127acc14ea64dcf75f4a4d0c99d7bfed | 0bfc1b107d44eb0c651a9bdc89e3dc9d87369cd7 | /app/src/main/java/com/example/reminder/AddEvents.java | 55a2df3b209bdeba89ccfb73083a0b0142bc172b | [] | no_license | Stephenayor/Reminder | 7a7785c6e678f2f36a024a57d1f97a781ddb7b80 | 9974eed9d25334ff73e4388e51afafc9a10f4d58 | refs/heads/master | 2023-06-12T18:28:59.100766 | 2021-07-05T15:43:23 | 2021-07-05T15:43:23 | 360,701,851 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,350 | java | package com.example.reminder;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import android.app.AlarmManager;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
import com.example.reminder.Database.EventsDatabase;
import com.example.reminder.Database.EventsModel;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
public class AddEvents extends AppCompatActivity {
private static final String LOG_TAG = AddEvents.class.getSimpleName();
public static final String EXTRA_EVENT_ID = "extraEventId";
private static final int DEFAULT_EVENT_ID = -1;
private static final String EVENTNAME = "eventsName";
private TextInputLayout eventNameInput;
private TextInputEditText eventNameEditText;
private TextInputLayout selectTimeInput;
private TextInputEditText selectTimeEditText;
private static TextView textView;
private Button datePickerButton;
private Button addEventsButton;
private EventsDatabase eventsDatabase;
private String eventName;
private String timeSelected;
private String dateSelected;
private int eventsId = DEFAULT_EVENT_ID;
public EventsModel eventsModel;
public AlarmManager alarmManager;
private PendingIntent alarmIntent;
private TimePicker timePicker;
private static Calendar calendar = Calendar.getInstance();
private static int year;
private static int month;
private static int day;
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_events);
eventNameInput = findViewById(R.id.eventName_text_input);
eventNameEditText = findViewById(R.id.eventName_edit_text);
textView = findViewById(R.id.display_date_text);
datePickerButton = findViewById(R.id.pick_date_button);
addEventsButton = findViewById(R.id.add_events_button);
eventsDatabase = EventsDatabase.getInstance(getApplicationContext());
timePicker = findViewById(R.id.time_picker);
// selectTimeEditText.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
//// final Calendar myCalender = Calendar.getInstance();
//// int hour = myCalender.get(Calendar.HOUR_OF_DAY);
//// int minute = myCalender.get(Calendar.MINUTE);
////
////
//// TimePickerDialog.OnTimeSetListener myTimeListener = new TimePickerDialog.OnTimeSetListener() {
//// @Override
//// public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
//// String am_pm;
//// if (hourOfDay >= 12) {
//// am_pm = "PM";
//// } else {
//// am_pm = "AM";
//// }
//// selectTimeEditText.setText(hourOfDay + ":" + minute + "" + am_pm);
////
////
//// if (view.isShown()) {
//// myCalender.set(Calendar.HOUR_OF_DAY, hourOfDay);
//// myCalender.set(Calendar.MINUTE, minute);
////
//// }
//// }
//// };
//// TimePickerDialog timePickerDialog = new TimePickerDialog(AddEvents.this,
//// android.R.style.Theme_Holo_Light_Dialog_NoActionBar, myTimeListener, hour, minute, true);
//// timePickerDialog.setTitle("Choose hour:");
//// timePickerDialog.getWindow().setBackgroundDrawableResource(android.R.color.darker_gray);
//// timePickerDialog.show();
// timePicker.is24HourView();
//
// }
//
//
// });
Intent intent = getIntent();
if (intent != null && intent.hasExtra(EXTRA_EVENT_ID)) {
addEventsButton.setText("Update");
textView.getText();
if (eventsId == DEFAULT_EVENT_ID) {
eventsId = intent.getIntExtra(EXTRA_EVENT_ID, DEFAULT_EVENT_ID);
EventsViewModelFactory eventsViewModelFactory = new EventsViewModelFactory(eventsDatabase, eventsId);
final AddEventsViewModel viewModel = ViewModelProviders.of(this, eventsViewModelFactory).
get(AddEventsViewModel.class);
viewModel.getEventsModelLiveData().observe(this, new Observer<EventsModel>() {
@Override
public void onChanged(EventsModel eventsModel) {
viewModel.getEventsModelLiveData().removeObserver(this);
PopulateUI(eventsModel);
}
});
}
}
}
private void PopulateUI(EventsModel eventsModel) {
if (eventsModel == null) {
return;
}
eventNameEditText.setText(eventsModel.getEventName());
//selectTimeEditText.setText(eventsModel.getTimeSelected());
Log.d("Date values", "Date return value");
datePickerButton.setText(eventsModel.getDateSelected());
}
public static class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current date as the default date in the picker
final Calendar calendar = Calendar.getInstance();
year = calendar.get(Calendar.YEAR);
//month = Integer.valueOf(calendar.get(Calendar.MONTH) + 1);
month = calendar.get(Calendar.MONTH);
day = calendar.get(Calendar.DAY_OF_MONTH);
// Create a new instance of DatePickerDialog and return it
return new DatePickerDialog(getActivity(), this, year, month, day);
}
public void onDateSet(DatePicker view, int year, int month, int day) {
final Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR,year);
calendar.set(Calendar.MONTH, month);
calendar.set(Calendar.DAY_OF_MONTH,day);
int Month = month+1;
textView.setText( + year + "-" + month + "-" + day);
}
}
public void showDatePickerDialog(View v) {
datePickerButton.setVisibility(View.GONE);
DialogFragment newFragment = new AddEvents.DatePickerFragment();
newFragment.show(getSupportFragmentManager(), "datePicker");
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
public void onClickAddEvents(View view) {
eventName = eventNameEditText.getText().toString();
// timeSelected = selectTimeEditText.getText().toString();
dateSelected = textView.getText().toString();
saveEvents();
}
private void saveEvents() {
eventsModel = new EventsModel(eventName, timeSelected, dateSelected,
TimePickerUtil.getTimePickerHour(timePicker), TimePickerUtil.getTimePickerMinute(timePicker));
EventsExecutor.getInstance().diskIO().execute(new Runnable() {
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public void run() {
if (eventsId == DEFAULT_EVENT_ID) {
//Save new events
Log.d("Date Checker", "check if date values are saved" );
eventsDatabase.eventsDao().insertEvents(eventsModel);
} else {
eventsModel.setId(eventsId);
eventsDatabase.eventsDao().updateEvents(eventsModel);
}
finish();
scheduleAlarm(getApplicationContext());
}
});
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
public void scheduleAlarm(Context context) {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(context, AlarmBroadcastReceiver.class);
intent.putExtra(EVENTNAME, eventName);
alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
final Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
// The date selected by the user
String selectedDate = eventsModel.getDateSelected();
String[] chosenDate = selectedDate.split("-");
String year = chosenDate[0];
String month = chosenDate[1];
String day = chosenDate[2];
int chosenYear =Integer.parseInt(year);
int chosenMonth = Integer.parseInt(month);
int chosenDay = Integer.parseInt(day);
calendar.set(Calendar.YEAR,chosenYear);
calendar.set(Calendar.MONTH,chosenMonth);
calendar.set(Calendar.DAY_OF_WEEK,chosenDay);
calendar.set(Calendar.HOUR_OF_DAY, TimePickerUtil.getTimePickerHour(timePicker));
calendar.set(Calendar.MINUTE, TimePickerUtil.getTimePickerMinute(timePicker));
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
alarmManager.setExact(
AlarmManager.RTC_WAKEUP,
calendar.getTimeInMillis(),
alarmIntent
);
}
//TODO :
// 1. The notification should display the alarm name
// 2. Make the timepicker attractive
// 3. Check the date again
// 4. Clean the code more
// 5. Use MVVM
}
| [
"[email protected]"
] | |
fbc3bee91a4d4c0e39621af70bb939eff0417924 | 50add8286b791d2a1ed21f3fe807c1cf87d64173 | /kettle5.0.1-src-eclipse/engine/org/pentaho/di/trans/steps/update/UpdateMeta.java | c23a666831c649427acff2d9cabc3a803f5bfa6a | [
"Apache-2.0"
] | permissive | Piouy/pentaho-kettle-serial | 418f63d981429eeab56160169deb0555a91008f6 | 5a915839de1ee5b0435f3fb6dbe9657f638d36a8 | refs/heads/master | 2021-09-10T06:11:54.094488 | 2018-03-21T09:58:15 | 2018-03-21T09:58:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 28,929 | java | /*******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2012 by Pentaho : http://www.pentaho.com
*
*******************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
package org.pentaho.di.trans.steps.update;
import java.util.List;
import org.pentaho.di.core.CheckResult;
import org.pentaho.di.core.CheckResultInterface;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.SQLStatement;
import org.pentaho.di.core.database.Database;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.repository.ObjectId;
import org.pentaho.di.repository.Repository;
import org.pentaho.di.shared.SharedObjectInterface;
import org.pentaho.di.trans.DatabaseImpact;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.BaseStepMeta;
import org.pentaho.di.trans.step.StepDataInterface;
import org.pentaho.di.trans.step.StepInterface;
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.step.StepMetaInterface;
import org.pentaho.metastore.api.IMetaStore;
import org.w3c.dom.Node;
/*
* Created on 26-apr-2003
*
*/
public class UpdateMeta extends BaseStepMeta implements StepMetaInterface
{
private static Class<?> PKG = UpdateMeta.class; // for i18n purposes, needed by Translator2!! $NON-NLS-1$
/** The lookup table name */
private String schemaName;
/** The lookup table name */
private String tableName;
/** database connection */
private DatabaseMeta databaseMeta;
/** which field in input stream to compare with? */
private String keyStream[];
/** field in table */
private String keyLookup[];
/** Comparator: =, <>, BETWEEN, ... */
private String keyCondition[];
/** Extra field for between... */
private String keyStream2[];
/** Field value to update after lookup */
private String updateLookup[];
/** Stream name to update value with */
private String updateStream[];
/** Commit size for inserts/updates */
private int commitSize;
/** update errors are ignored if this flag is set to true */
private boolean errorIgnored;
/** adds a boolean field to the output indicating success of the update */
private String ignoreFlagField;
/** adds a boolean field to skip lookup and directly update selected fields */
private boolean skipLookup;
/** Flag to indicate the use of batch updates, enabled by default but disabled for backward compatibility */
private boolean useBatchUpdate;
public UpdateMeta()
{
super(); // allocate BaseStepMeta
}
/**
* @return Returns the commitSize.
*/
public int getCommitSize()
{
return commitSize;
}
/**
* @param commitSize The commitSize to set.
*/
public void setCommitSize(int commitSize)
{
this.commitSize = commitSize;
}
/**
* @return Returns the skipLookup.
*/
public boolean isSkipLookup()
{
return skipLookup;
}
/**
* @param skipLookup The skipLookup to set.
*/
public void setSkipLookup(boolean skipLookup)
{
this.skipLookup = skipLookup;
}
/**
* @return Returns the database.
*/
public DatabaseMeta getDatabaseMeta()
{
return databaseMeta;
}
/**
* @param database The database to set.
*/
public void setDatabaseMeta(DatabaseMeta database)
{
this.databaseMeta = database;
}
/**
* @return Returns the keyCondition.
*/
public String[] getKeyCondition()
{
return keyCondition;
}
/**
* @param keyCondition The keyCondition to set.
*/
public void setKeyCondition(String[] keyCondition)
{
this.keyCondition = keyCondition;
}
/**
* @return Returns the keyLookup.
*/
public String[] getKeyLookup()
{
return keyLookup;
}
/**
* @param keyLookup The keyLookup to set.
*/
public void setKeyLookup(String[] keyLookup)
{
this.keyLookup = keyLookup;
}
/**
* @return Returns the keyStream.
*/
public String[] getKeyStream()
{
return keyStream;
}
/**
* @param keyStream The keyStream to set.
*/
public void setKeyStream(String[] keyStream)
{
this.keyStream = keyStream;
}
/**
* @return Returns the keyStream2.
*/
public String[] getKeyStream2()
{
return keyStream2;
}
/**
* @param keyStream2 The keyStream2 to set.
*/
public void setKeyStream2(String[] keyStream2)
{
this.keyStream2 = keyStream2;
}
/**
* @return Returns the tableName.
*/
public String getTableName()
{
return tableName;
}
/**
* @param tableName The tableName to set.
*/
public void setTableName(String tableName)
{
this.tableName = tableName;
}
/**
* @return Returns the updateLookup.
*/
public String[] getUpdateLookup()
{
return updateLookup;
}
/**
* @param updateLookup The updateLookup to set.
*/
public void setUpdateLookup(String[] updateLookup)
{
this.updateLookup = updateLookup;
}
/**
* @return Returns the updateStream.
*/
public String[] getUpdateStream()
{
return updateStream;
}
/**
* @param updateStream The updateStream to set.
*/
public void setUpdateStream(String[] updateStream)
{
this.updateStream = updateStream;
}
/**
* @return Returns the ignoreError.
*/
public boolean isErrorIgnored()
{
return errorIgnored;
}
/**
* @param ignoreError The ignoreError to set.
*/
public void setErrorIgnored(boolean ignoreError)
{
this.errorIgnored = ignoreError;
}
/**
* @return Returns the ignoreFlagField.
*/
public String getIgnoreFlagField()
{
return ignoreFlagField;
}
/**
* @param ignoreFlagField The ignoreFlagField to set.
*/
public void setIgnoreFlagField(String ignoreFlagField)
{
this.ignoreFlagField = ignoreFlagField;
}
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore)
throws KettleXMLException
{
readData(stepnode, databases);
}
public void allocate(int nrkeys, int nrvalues)
{
keyStream = new String[nrkeys];
keyLookup = new String[nrkeys];
keyCondition = new String[nrkeys];
keyStream2 = new String[nrkeys];
updateLookup = new String[nrvalues];
updateStream = new String[nrvalues];
}
public Object clone()
{
UpdateMeta retval = (UpdateMeta)super.clone();
int nrkeys = keyStream.length;
int nrvalues = updateLookup.length;
retval.allocate(nrkeys, nrvalues);
for (int i=0;i<nrkeys;i++)
{
retval.keyStream [i] = keyStream[i];
retval.keyLookup [i] = keyLookup[i];
retval.keyCondition[i] = keyCondition[i];
retval.keyStream2 [i] = keyStream2[i];
}
for (int i=0;i<nrvalues;i++)
{
retval.updateLookup[i] = updateLookup[i];
retval.updateStream[i] = updateStream[i];
}
return retval;
}
private void readData(Node stepnode, List<? extends SharedObjectInterface> databases)
throws KettleXMLException
{
try
{
String csize;
int nrkeys, nrvalues;
String con = XMLHandler.getTagValue(stepnode, "connection");
databaseMeta = DatabaseMeta.findDatabase(databases, con);
csize = XMLHandler.getTagValue(stepnode, "commit");
commitSize=Const.toInt(csize, 0);
useBatchUpdate = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "use_batch"));
skipLookup = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "skip_lookup"));
errorIgnored = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "error_ignored"));
ignoreFlagField = XMLHandler.getTagValue(stepnode, "ignore_flag_field");
schemaName = XMLHandler.getTagValue(stepnode, "lookup", "schema");
tableName = XMLHandler.getTagValue(stepnode, "lookup", "table");
Node lookup = XMLHandler.getSubNode(stepnode, "lookup");
nrkeys = XMLHandler.countNodes(lookup, "key");
nrvalues = XMLHandler.countNodes(lookup, "value");
allocate(nrkeys, nrvalues);
for (int i=0;i<nrkeys;i++)
{
Node knode = XMLHandler.getSubNodeByNr(lookup, "key", i);
keyStream [i] = XMLHandler.getTagValue(knode, "name");
keyLookup [i] = XMLHandler.getTagValue(knode, "field");
keyCondition[i] = XMLHandler.getTagValue(knode, "condition");
if (keyCondition[i]==null) keyCondition[i]="=";
keyStream2 [i] = XMLHandler.getTagValue(knode, "name2");
}
for (int i=0;i<nrvalues;i++)
{
Node vnode = XMLHandler.getSubNodeByNr(lookup, "value", i);
updateLookup[i] = XMLHandler.getTagValue(vnode, "name");
updateStream[i] = XMLHandler.getTagValue(vnode, "rename");
if (updateStream[i]==null) updateStream[i]=updateLookup[i]; // default: the same name!
}
}
catch(Exception e)
{
throw new KettleXMLException(BaseMessages.getString(PKG, "UpdateMeta.Exception.UnableToReadStepInfoFromXML"), e);
}
}
public void setDefault()
{
skipLookup=false;
keyStream = null;
updateLookup = null;
databaseMeta = null;
commitSize = 100;
schemaName = "";
tableName = BaseMessages.getString(PKG, "UpdateMeta.DefaultTableName");
int nrkeys = 0;
int nrvalues = 0;
allocate(nrkeys, nrvalues);
for (int i=0;i<nrkeys;i++)
{
keyLookup[i] = "age";
keyCondition[i] = "BETWEEN";
keyStream[i] = "age_from";
keyStream2[i] = "age_to";
}
for (int i=0;i<nrvalues;i++)
{
updateLookup[i]=BaseMessages.getString(PKG, "UpdateMeta.ColumnName.ReturnField")+i;
updateStream[i]=BaseMessages.getString(PKG, "UpdateMeta.ColumnName.NewName")+i;
}
}
public String getXML()
{
StringBuffer retval=new StringBuffer();
retval.append(" "+XMLHandler.addTagValue("connection", databaseMeta==null?"":databaseMeta.getName())); //$NON-NLS-3$
retval.append(" "+XMLHandler.addTagValue("skip_lookup", skipLookup));
retval.append(" "+XMLHandler.addTagValue("commit", commitSize));
retval.append(" "+XMLHandler.addTagValue("use_batch", useBatchUpdate));
retval.append(" "+XMLHandler.addTagValue("error_ignored", errorIgnored));
retval.append(" "+XMLHandler.addTagValue("ignore_flag_field", ignoreFlagField));
retval.append(" <lookup>"+Const.CR);
retval.append(" "+XMLHandler.addTagValue("schema", schemaName));
retval.append(" "+XMLHandler.addTagValue("table", tableName));
for (int i=0;i<keyStream.length;i++)
{
retval.append(" <key>"+Const.CR);
retval.append(" "+XMLHandler.addTagValue("name", keyStream[i]));
retval.append(" "+XMLHandler.addTagValue("field", keyLookup[i]));
retval.append(" "+XMLHandler.addTagValue("condition", keyCondition[i]));
retval.append(" "+XMLHandler.addTagValue("name2", keyStream2[i]));
retval.append(" </key>"+Const.CR);
}
for (int i=0;i<updateLookup.length;i++)
{
retval.append(" <value>"+Const.CR);
retval.append(" "+XMLHandler.addTagValue("name", updateLookup[i]));
retval.append(" "+XMLHandler.addTagValue("rename", updateStream[i]));
retval.append(" </value>"+Const.CR);
}
retval.append(" </lookup>"+Const.CR);
return retval.toString();
}
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases)
throws KettleException
{
try
{
databaseMeta = rep.loadDatabaseMetaFromStepAttribute(id_step, "id_connection", databases);
skipLookup = rep.getStepAttributeBoolean (id_step, "skip_lookup");
commitSize = (int)rep.getStepAttributeInteger(id_step, "commit");
useBatchUpdate = rep.getStepAttributeBoolean(id_step, "use_batch");
schemaName = rep.getStepAttributeString(id_step, "schema");
tableName = rep.getStepAttributeString(id_step, "table");
errorIgnored = rep.getStepAttributeBoolean(id_step, "error_ignored");
ignoreFlagField = rep.getStepAttributeString (id_step, "ignore_flag_field");
int nrkeys = rep.countNrStepAttributes(id_step, "key_name");
int nrvalues = rep.countNrStepAttributes(id_step, "value_name");
allocate(nrkeys, nrvalues);
for (int i=0;i<nrkeys;i++)
{
keyStream[i] = rep.getStepAttributeString(id_step, i, "key_name");
keyLookup[i] = rep.getStepAttributeString(id_step, i, "key_field");
keyCondition[i] = rep.getStepAttributeString(id_step, i, "key_condition");
keyStream2[i] = rep.getStepAttributeString(id_step, i, "key_name2");
}
for (int i=0;i<nrvalues;i++)
{
updateLookup[i] = rep.getStepAttributeString(id_step, i, "value_name");
updateStream[i] = rep.getStepAttributeString(id_step, i, "value_rename");
}
}
catch(Exception e)
{
throw new KettleException(BaseMessages.getString(PKG, "UpdateMeta.Exception.UnexpectedErrorReadingStepInfoFromRepository"), e);
}
}
public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step)
throws KettleException
{
try
{
rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", databaseMeta);
rep.saveStepAttribute(id_transformation, id_step, "skip_lookup", skipLookup);
rep.saveStepAttribute(id_transformation, id_step, "commit", commitSize);
rep.saveStepAttribute(id_transformation, id_step, "use_batch", useBatchUpdate);
rep.saveStepAttribute(id_transformation, id_step, "schema", schemaName);
rep.saveStepAttribute(id_transformation, id_step, "table", tableName);
rep.saveStepAttribute(id_transformation, id_step, "error_ignored", errorIgnored);
rep.saveStepAttribute(id_transformation, id_step, "ignore_flag_field", ignoreFlagField);
for (int i=0;i<keyStream.length;i++)
{
rep.saveStepAttribute(id_transformation, id_step, i, "key_name", keyStream[i]);
rep.saveStepAttribute(id_transformation, id_step, i, "key_field", keyLookup[i]);
rep.saveStepAttribute(id_transformation, id_step, i, "key_condition", keyCondition[i]);
rep.saveStepAttribute(id_transformation, id_step, i, "key_name2", keyStream2[i]);
}
for (int i=0;i<updateLookup.length;i++)
{
rep.saveStepAttribute(id_transformation, id_step, i, "value_name", updateLookup[i]);
rep.saveStepAttribute(id_transformation, id_step, i, "value_rename", updateStream[i]);
}
// Also, save the step-database relationship!
if (databaseMeta!=null) rep.insertStepDatabase(id_transformation, id_step, databaseMeta.getObjectId());
}
catch(Exception e)
{
throw new KettleException(BaseMessages.getString(PKG, "UpdateMeta.Exception.UnableToSaveStepInfoToRepository")+id_step, e);
}
}
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException
{
if (ignoreFlagField!=null && ignoreFlagField.length()>0)
{
ValueMetaInterface v = new ValueMeta(ignoreFlagField, ValueMetaInterface.TYPE_BOOLEAN);
v.setOrigin(name);
row.addValueMeta( v );
}
}
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore)
{
CheckResult cr;
String error_message = "";
if (databaseMeta!=null)
{
Database db = new Database(loggingObject, databaseMeta);
db.shareVariablesWith(transMeta);
try
{
db.connect();
if (!Const.isEmpty(tableName))
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.TableNameOK"), stepMeta);
remarks.add(cr);
boolean first=true;
boolean error_found=false;
error_message = "";
// Check fields in table
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(schemaName, tableName);
RowMetaInterface r = db.getTableFields( schemaTable );
if (r!=null)
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.TableExists"), stepMeta);
remarks.add(cr);
for (int i=0;i<keyLookup.length;i++)
{
String lufield = keyLookup[i];
ValueMetaInterface v = r.searchValueMeta(lufield);
if (v==null)
{
if (first)
{
first=false;
error_message+=BaseMessages.getString(PKG, "UpdateMeta.CheckResult.MissingCompareFieldsInTargetTable")+Const.CR;
}
error_found=true;
error_message+="\t\t"+lufield+Const.CR;
}
}
if (error_found)
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
}
else
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.AllLookupFieldsFound"), stepMeta);
}
remarks.add(cr);
// How about the fields to insert/update in the table?
first=true;
error_found=false;
error_message = "";
for (int i=0;i<updateLookup.length;i++)
{
String lufield = updateLookup[i];
ValueMetaInterface v = r.searchValueMeta(lufield);
if (v==null)
{
if (first)
{
first=false;
error_message+=BaseMessages.getString(PKG, "UpdateMeta.CheckResult.MissingFieldsToUpdateInTargetTable")+Const.CR;
}
error_found=true;
error_message+="\t\t"+lufield+Const.CR;
}
}
if (error_found)
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
}
else
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.AllFieldsToUpdateFoundInTargetTable"), stepMeta);
}
remarks.add(cr);
}
else
{
error_message=BaseMessages.getString(PKG, "UpdateMeta.CheckResult.CouldNotReadTableInfo");
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
remarks.add(cr);
}
}
// Look up fields in the input stream <prev>
if (prev!=null && prev.size()>0)
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.StepReceivingDatas",prev.size()+""), stepMeta);
remarks.add(cr);
boolean first=true;
error_message = "";
boolean error_found = false;
for (int i=0;i<keyStream.length;i++)
{
ValueMetaInterface v = prev.searchValueMeta(keyStream[i]);
if (v==null)
{
if (first)
{
first=false;
error_message+=BaseMessages.getString(PKG, "UpdateMeta.CheckResult.MissingFieldsInInput")+Const.CR;
}
error_found=true;
error_message+="\t\t"+keyStream[i]+Const.CR;
}
}
for (int i=0;i<keyStream2.length;i++)
{
if (keyStream2[i]!=null && keyStream2[i].length()>0)
{
ValueMetaInterface v = prev.searchValueMeta(keyStream2[i]);
if (v==null)
{
if (first)
{
first=false;
error_message+=BaseMessages.getString(PKG, "UpdateMeta.CheckResult.MissingFieldsInInput2")+Const.CR;
}
error_found=true;
error_message+="\t\t"+keyStream[i]+Const.CR;
}
}
}
if (error_found)
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
}
else
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.AllFieldsFoundInInput"), stepMeta);
}
remarks.add(cr);
// How about the fields to insert/update the table with?
first=true;
error_found=false;
error_message = "";
for (int i=0;i<updateStream.length;i++)
{
String lufield = updateStream[i];
ValueMetaInterface v = prev.searchValueMeta(lufield);
if (v==null)
{
if (first)
{
first=false;
error_message+=BaseMessages.getString(PKG, "UpdateMeta.CheckResult.MissingInputStreamFields")+Const.CR;
}
error_found=true;
error_message+="\t\t"+lufield+Const.CR;
}
}
if (error_found)
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
}
else
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.AllFieldsFoundInInput2"), stepMeta);
}
remarks.add(cr);
}
else
{
error_message=BaseMessages.getString(PKG, "UpdateMeta.CheckResult.MissingFieldsInInput3")+Const.CR;
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
remarks.add(cr);
}
}
catch(KettleException e)
{
error_message = BaseMessages.getString(PKG, "UpdateMeta.CheckResult.DatabaseErrorOccurred")+e.getMessage();
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
remarks.add(cr);
}
finally
{
db.disconnect();
}
}
else
{
error_message = BaseMessages.getString(PKG, "UpdateMeta.CheckResult.InvalidConnection");
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
remarks.add(cr);
}
// See if we have input streams leading to this step!
if (input.length>0)
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.StepReceivingInfoFromOtherSteps"), stepMeta);
remarks.add(cr);
}
else
{
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "UpdateMeta.CheckResult.NoInputError"), stepMeta);
remarks.add(cr);
}
}
public SQLStatement getSQLStatements(TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, Repository repository, IMetaStore metaStore)
{
SQLStatement retval = new SQLStatement(stepMeta.getName(), databaseMeta, null); // default: nothing to do!
if (databaseMeta!=null)
{
if (prev!=null && prev.size()>0)
{
if (!Const.isEmpty(tableName))
{
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(schemaName, tableName);
Database db = new Database(loggingObject, databaseMeta);
db.shareVariablesWith(transMeta);
try
{
db.connect();
if ( getIgnoreFlagField()!=null &&
getIgnoreFlagField().length()>0)
{
prev.addValueMeta(new ValueMeta(getIgnoreFlagField(), ValueMetaInterface.TYPE_BOOLEAN));
}
String cr_table = db.getDDL(schemaTable,
prev,
null,
false,
null,
true
);
String cr_index = "";
String idx_fields[] = null;
if (keyLookup!=null && keyLookup.length>0)
{
idx_fields = new String[keyLookup.length];
for (int i=0;i<keyLookup.length;i++) idx_fields[i] = keyLookup[i];
}
else
{
retval.setError(BaseMessages.getString(PKG, "UpdateMeta.CheckResult.MissingKeyFields"));
}
// Key lookup dimensions...
if (idx_fields!=null && idx_fields.length>0 && !db.checkIndexExists(schemaName, tableName, idx_fields)
)
{
String indexname = "idx_"+tableName+"_lookup";
cr_index = db.getCreateIndexStatement(schemaName, tableName, indexname, idx_fields, false, false, false, true);
}
String sql = cr_table+cr_index;
if (sql.length()==0) retval.setSQL(null); else retval.setSQL(sql);
}
catch(KettleException e)
{
retval.setError(BaseMessages.getString(PKG, "UpdateMeta.ReturnValue.ErrorOccurred")+e.getMessage());
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "UpdateMeta.ReturnValue.NoTableDefinedOnConnection"));
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "UpdateMeta.ReturnValue.NotReceivingAnyFields"));
}
}
else
{
retval.setError(BaseMessages.getString(PKG, "UpdateMeta.ReturnValue.NoConnectionDefined"));
}
return retval;
}
@Override
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta,
RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info,
Repository repository, IMetaStore metaStore) throws KettleStepException
{
if (prev != null)
{
// Lookup: we do a lookup on the natural keys
for (int i = 0; i < keyLookup.length; i++)
{
ValueMetaInterface v = prev.searchValueMeta(keyStream[i]);
DatabaseImpact ii = new DatabaseImpact(DatabaseImpact.TYPE_IMPACT_READ, transMeta.getName(), stepMeta.getName(), databaseMeta
.getDatabaseName(), tableName, keyLookup[i], keyStream[i], v!=null?v.getOrigin():"?", "", "Type = " + v.toStringMeta()); //$NON-NLS-3$
impact.add(ii);
}
// Update fields : read/write
for (int i = 0; i < updateLookup.length; i++)
{
ValueMetaInterface v = prev.searchValueMeta(updateStream[i]);
DatabaseImpact ii = new DatabaseImpact(DatabaseImpact.TYPE_IMPACT_UPDATE, transMeta.getName(), stepMeta.getName(), databaseMeta
.getDatabaseName(), tableName, updateLookup[i], updateStream[i], v!=null?v.getOrigin():"?", "", "Type = " + v.toStringMeta()); //$NON-NLS-3$
impact.add(ii);
}
}
}
public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr, Trans trans)
{
return new Update(stepMeta, stepDataInterface, cnr, tr, trans);
}
public StepDataInterface getStepData()
{
return new UpdateData();
}
public DatabaseMeta[] getUsedDatabaseConnections()
{
if (databaseMeta!=null)
{
return new DatabaseMeta[] { databaseMeta };
}
else
{
return super.getUsedDatabaseConnections();
}
}
/**
* @return the schemaName
*/
public String getSchemaName()
{
return schemaName;
}
/**
* @param schemaName the schemaName to set
*/
public void setSchemaName(String schemaName)
{
this.schemaName = schemaName;
}
public boolean supportsErrorHandling()
{
return true;
}
/**
* @return the useBatchUpdate
*/
public boolean useBatchUpdate() {
return useBatchUpdate;
}
/**
* @param useBatchUpdate the useBatchUpdate to set
*/
public void setUseBatchUpdate(boolean useBatchUpdate) {
this.useBatchUpdate = useBatchUpdate;
}
} | [
"[email protected]"
] | |
d67311e741c9941c9e804489dad81db2453a759a | e42e7de3dd0928a12cca14c034ddb5f9f2e2bc00 | /core/src/scripthis/towerdefence/model/Road.java | 2c60c9614b04b21433e5d3a1d3739ab8816c2a3e | [] | no_license | nicocurat/TowerDefence | aec9913c3ae84ef1c340ee7cf15c74c5fbff32ab | 718b40f28e9c8d483500d3594594723743390d1c | refs/heads/master | 2021-01-20T09:26:36.296804 | 2015-11-20T19:35:59 | 2015-11-20T19:35:59 | 46,582,666 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,988 | java | package scripthis.towerdefence.model;
import scripthis.towerdefence.Point2D.ListPoint;
import scripthis.towerdefence.Point2D.Point;
import scripthis.towerdefence.Point2D.PolyLine;
import java.util.LinkedList;
public class Road{
protected ListPoint start;
protected ListPoint end;
private Point finishLine;
LinkedList<Point> points = new LinkedList<Point>();
public Road(){
Point[] points = {new Point(0,220), new Point(105,220), new Point(105,360), new Point(230,360), new Point(230,170), new Point(400,170), new Point(400, 260), new Point(650,260)};
for(Point p: points){
addPoint(p);
}
finishLine = new Point(645,260);
createRoad();
}
public Point getFinishLine() {
return finishLine;
}
public void setFinishLine(Point finishLine) {
this.finishLine = finishLine;
}
public Point getLastPoint(){return points.get(points.size()-1);}
public void addPoint(Point point){
ListPoint newEnd = new ListPoint(point);
if(start == null){
start = newEnd;
} else {
end.setNext(newEnd);
}
end = newEnd;
}
public void createRoad() {
ListPoint nextPoint = start;
while(nextPoint != null && nextPoint.getNext() != null){
int aX = nextPoint.getPoint().getX();
int bX = nextPoint.getNext().getPoint().getX();
int aY = nextPoint.getPoint().getY();
int bY = nextPoint.getNext().getPoint().getY();
int x = bX - aX;
int y = bY - aY;
int omega = Math.abs(x) + Math.abs(y);
for(int i = 0; i <= omega; i++){
int newX = (i*x)/(omega) + aX;
int newY = (i*y)/(omega) + aY;
points.add(new Point(newX, newY));
}
nextPoint = nextPoint.getNext();
}
}
public LinkedList<Point> getList(){ return this.points; }
}
| [
"[email protected]"
] | |
bba0346b4e3f6287bd5219c6e643091e9b8f5220 | e7f273912532c58533fa95b381e7b35927455a39 | /tajo-plan/src/main/java/org/apache/tajo/plan/visitor/BasicLogicalPlanVisitor.java | 23c834d5c77333b4bc1caad8362cfb94b61bf811 | [
"BSD-3-Clause",
"Apache-2.0",
"PostgreSQL",
"MIT"
] | permissive | tempbottle/tajo | 979fb6613962d8d9d0f29fc29aae104218acc6e5 | a9ae3cab69526294475a771014e9c0e49c80462b | refs/heads/master | 2021-01-17T05:37:14.159134 | 2015-03-18T14:57:06 | 2015-03-18T14:57:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,640 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.tajo.plan.visitor;
import org.apache.tajo.plan.LogicalPlan;
import org.apache.tajo.plan.PlanningException;
import org.apache.tajo.plan.logical.*;
import java.util.Stack;
public class BasicLogicalPlanVisitor<CONTEXT, RESULT> implements LogicalPlanVisitor<CONTEXT, RESULT> {
/**
* The prehook is called before each node is visited.
*/
@SuppressWarnings("unused")
public void preHook(LogicalPlan plan, LogicalNode node, Stack<LogicalNode> stack, CONTEXT data)
throws PlanningException {
}
/**
* The posthook is called after each node is visited.
*/
@SuppressWarnings("unused")
public void postHook(LogicalPlan plan, LogicalNode node, Stack<LogicalNode> stack, CONTEXT data)
throws PlanningException {
}
public CONTEXT visit(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block)
throws PlanningException {
visit(context, plan, block, block.getRoot(), new Stack<LogicalNode>());
return context;
}
/**
* visit visits each logicalNode recursively.
*/
public RESULT visit(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, LogicalNode node,
Stack<LogicalNode> stack)
throws PlanningException {
RESULT current;
switch (node.getType()) {
case ROOT:
current = visitRoot(context, plan, block, (LogicalRootNode) node, stack);
break;
case SET_SESSION:
current = visitSetSession(context, plan, block, (SetSessionNode) node, stack);
break;
case EXPRS:
current = visitEvalExpr(context, plan, block, (EvalExprNode) node, stack);
break;
case PROJECTION:
current = visitProjection(context, plan, block, (ProjectionNode) node, stack);
break;
case LIMIT:
current = visitLimit(context, plan, block, (LimitNode) node, stack);
break;
case SORT:
current = visitSort(context, plan, block, (SortNode) node, stack);
break;
case HAVING:
current = visitHaving(context, plan, block, (HavingNode) node, stack);
break;
case GROUP_BY:
current = visitGroupBy(context, plan, block, (GroupbyNode) node, stack);
break;
case WINDOW_AGG:
current = visitWindowAgg(context, plan, block, (WindowAggNode) node, stack);
break;
case DISTINCT_GROUP_BY:
current = visitDistinctGroupby(context, plan, block, (DistinctGroupbyNode) node, stack);
break;
case SELECTION:
current = visitFilter(context, plan, block, (SelectionNode) node, stack);
break;
case JOIN:
current = visitJoin(context, plan, block, (JoinNode) node, stack);
break;
case UNION:
current = visitUnion(context, plan, block, (UnionNode) node, stack);
break;
case EXCEPT:
current = visitExcept(context, plan, block, (ExceptNode) node, stack);
break;
case INTERSECT:
current = visitIntersect(context, plan, block, (IntersectNode) node, stack);
break;
case TABLE_SUBQUERY:
current = visitTableSubQuery(context, plan, block, (TableSubQueryNode) node, stack);
break;
case SCAN:
current = visitScan(context, plan, block, (ScanNode) node, stack);
break;
case PARTITIONS_SCAN:
current = visitPartitionedTableScan(context, plan, block, (PartitionedTableScanNode) node, stack);
break;
case STORE:
current = visitStoreTable(context, plan, block, (StoreTableNode) node, stack);
break;
case INSERT:
current = visitInsert(context, plan, block, (InsertNode) node, stack);
break;
case CREATE_DATABASE:
current = visitCreateDatabase(context, plan, block, (CreateDatabaseNode) node, stack);
break;
case DROP_DATABASE:
current = visitDropDatabase(context, plan, block, (DropDatabaseNode) node, stack);
break;
case CREATE_TABLE:
current = visitCreateTable(context, plan, block, (CreateTableNode) node, stack);
break;
case DROP_TABLE:
current = visitDropTable(context, plan, block, (DropTableNode) node, stack);
break;
case ALTER_TABLESPACE:
current = visitAlterTablespace(context, plan, block, (AlterTablespaceNode) node, stack);
break;
case ALTER_TABLE:
current = visitAlterTable(context, plan, block, (AlterTableNode) node, stack);
break;
case TRUNCATE_TABLE:
current = visitTruncateTable(context, plan, block, (TruncateTableNode) node, stack);
break;
default:
throw new PlanningException("Unknown logical node type: " + node.getType());
}
return current;
}
@Override
public RESULT visitRoot(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, LogicalRootNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitSetSession(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, SetSessionNode node,
Stack<LogicalNode> stack) throws PlanningException {
return null;
}
@Override
public RESULT visitEvalExpr(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, EvalExprNode node,
Stack<LogicalNode> stack) throws PlanningException {
return null;
}
@Override
public RESULT visitProjection(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, ProjectionNode node,
Stack<LogicalNode> stack)
throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitLimit(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, LimitNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitSort(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, SortNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitHaving(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitGroupBy(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, GroupbyNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitWindowAgg(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, WindowAggNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
public RESULT visitDistinctGroupby(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block,
DistinctGroupbyNode node, Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitFilter(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, SelectionNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitJoin(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, JoinNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getLeftChild(), stack);
visit(context, plan, block, node.getRightChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitUnion(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, UnionNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = null;
if (plan != null) {
LogicalPlan.QueryBlock leftBlock = plan.getBlock(node.getLeftChild());
result = visit(context, plan, leftBlock, leftBlock.getRoot(), stack);
LogicalPlan.QueryBlock rightBlock = plan.getBlock(node.getRightChild());
visit(context, plan, rightBlock, rightBlock.getRoot(), stack);
} else {
result = visit(context, plan, null, node.getLeftChild(), stack);
visit(context, plan, null, node.getRightChild(), stack);
}
stack.pop();
return result;
}
@Override
public RESULT visitExcept(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, ExceptNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getLeftChild(), stack);
visit(context, plan, block, node.getRightChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitIntersect(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, IntersectNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getLeftChild(), stack);
visit(context, plan, block, node.getRightChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitTableSubQuery(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block,
TableSubQueryNode node, Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = null;
if (plan != null) {
LogicalPlan.QueryBlock childBlock = plan.getBlock(node.getSubQuery());
result = visit(context, plan, childBlock, childBlock.getRoot(), stack);
} else {
result = visit(context, plan, null, node.getSubQuery(), stack);
}
stack.pop();
return result;
}
@Override
public RESULT visitScan(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, ScanNode node,
Stack<LogicalNode> stack) throws PlanningException {
return null;
}
@Override
public RESULT visitPartitionedTableScan(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block,
PartitionedTableScanNode node, Stack<LogicalNode> stack)
throws PlanningException {
return null;
}
@Override
public RESULT visitStoreTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, StoreTableNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitInsert(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, InsertNode node,
Stack<LogicalNode> stack) throws PlanningException {
stack.push(node);
RESULT result = visit(context, plan, block, node.getChild(), stack);
stack.pop();
return result;
}
@Override
public RESULT visitCreateDatabase(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block,
CreateDatabaseNode node, Stack<LogicalNode> stack) throws PlanningException {
return null;
}
@Override
public RESULT visitDropDatabase(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, DropDatabaseNode node, Stack<LogicalNode> stack) throws PlanningException {
return null;
}
@Override
public RESULT visitCreateTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, CreateTableNode node,
Stack<LogicalNode> stack) throws PlanningException {
RESULT result = null;
stack.push(node);
if (node.hasSubQuery()) {
result = visit(context, plan, block, node.getChild(), stack);
}
stack.pop();
return result;
}
@Override
public RESULT visitDropTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, DropTableNode node,
Stack<LogicalNode> stack) {
return null;
}
@Override
public RESULT visitAlterTablespace(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block,
AlterTablespaceNode node, Stack<LogicalNode> stack) throws PlanningException {
return null;
}
@Override
public RESULT visitAlterTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, AlterTableNode node,
Stack<LogicalNode> stack) {
return null;
}
@Override
public RESULT visitTruncateTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block,
TruncateTableNode node, Stack<LogicalNode> stack) throws PlanningException {
return null;
}
}
| [
"[email protected]"
] | |
8f9f306cdb24185d3d1e1e7695110c1c95fb9a34 | f9e61de476d18e026f6228b4aa104cdeaa012e1d | /src/main/webapp/static/template/codeFile/wsn_train/WsnTrain.java | e6e34777fc9f7602778f6b30a4bead5d2f180176 | [] | no_license | hojohn/wsn | 933993943b0d035191a0afdf8a033d57ea5c82f0 | 13a69fe2c365a92611bbe65702543f51abdfac96 | refs/heads/master | 2021-01-13T08:12:46.566842 | 2017-06-13T07:26:01 | 2017-06-13T07:26:01 | 69,871,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,096 | java | package com.ai.mnt.model.employee;
import java.io.Serializable;
import java.util.Date;
/**
* @Title: WsnTrain
* @Description: WsnTrain Model
* @Author: Auto Generate.
* @Date: 2016-10-16
*/
public class WsnTrain implements Serializable{
private static final long serialVersionUID = 1L;
/**培训编码*/
private Integer trainId;
/**培新名称*/
private String trainName;
/**培训内容*/
private String trainContent;
/**培训课时*/
private String trainHours;
/**培训教师*/
private String trainTeacher;
/**培训方式*/
private String trainMethod;
/**培训时间*/
private Date trainDate;
/**备注*/
private String remark;
/**删除标识,1删除,0未删除*/
private String deleteFlag;
/**创建人*/
private String creator;
/**创建时间*/
private Date createDate;
/**修改人*/
private String modifier;
/**修改时间*/
private Date modifyDate;
public Integer getTrainId() {
return trainId;
}
public void setTrainId(Integer trainId) {
this.trainId = trainId;
}
public String getTrainName() {
return trainName;
}
public void setTrainName(String trainName) {
this.trainName = trainName;
}
public String getTrainContent() {
return trainContent;
}
public void setTrainContent(String trainContent) {
this.trainContent = trainContent;
}
public String getTrainHours() {
return trainHours;
}
public void setTrainHours(String trainHours) {
this.trainHours = trainHours;
}
public String getTrainTeacher() {
return trainTeacher;
}
public void setTrainTeacher(String trainTeacher) {
this.trainTeacher = trainTeacher;
}
public String getTrainMethod() {
return trainMethod;
}
public void setTrainMethod(String trainMethod) {
this.trainMethod = trainMethod;
}
public Date getTrainDate() {
return trainDate;
}
public void setTrainDate(Date trainDate) {
this.trainDate = trainDate;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(String deleteFlag) {
this.deleteFlag = deleteFlag;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getModifier() {
return modifier;
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public Date getModifyDate() {
return modifyDate;
}
public void setModifyDate(Date modifyDate) {
this.modifyDate = modifyDate;
}
} | [
"[email protected]"
] | |
fca0678395b721229810e1367519e08af6144714 | c164d02f06283ca09df4e7148894aed3a4a98a45 | /Pro_OceanParadise/src/FlyingMan.java | 01975898b73e924e054ca5511d5a4736f9f57cb9 | [] | no_license | lxk403216058/oop-class | b9c2f81dfc11762f1988f98545bfdef9ff70aef0 | b98cac0f9097b07843d95aa84d02562d0d3b2167 | refs/heads/main | 2023-01-22T21:28:13.459734 | 2020-12-08T02:50:25 | 2020-12-08T02:50:25 | 319,504,923 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 267 | java |
public class FlyingMan implements Fly {
private int score;
public FlyingMan(){
}
public void setScore(){
this.score =(int)(Math.random()*10 + 1);
}
public int getScore(){
return score;
}
public String fly(){
return "·ÉÈ˷ɹý";
}
}
| [
"[email protected]"
] | |
e801c3b398932c267c8277eccc64d8c39fd4e84a | a8886dac59f8a4d51bc13aed8ca1a3b252cc609d | /app/src/main/java/com/malaab/ya/action/actionyamalaab/utils/NetworkUtils.java | 7a9261607bcbf431aba55bdf3e8cc6790c52f0c9 | [] | no_license | gamal-alghol/ActionYaMalaabCaptain | 5a447311ea99f37d13a4362b05b4ec74c484375b | cd3e4d58dab3d5437878a990363c16595d392181 | refs/heads/master | 2023-05-29T09:10:38.077477 | 2021-06-16T09:42:42 | 2021-06-16T09:42:42 | 377,442,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | package com.malaab.ya.action.actionyamalaab.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public final class NetworkUtils {
private NetworkUtils() {
// This utility class is not publicly instantiable
}
public static boolean isNetworkConnected(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (null != cm) {
NetworkInfo info = cm.getActiveNetworkInfo();
return (info != null && info.isConnected());
}
return false;
}
}
| [
"[email protected]"
] | |
6aa2ae483775226c31ddf2a8766a9e5e006733a4 | b969bf8c5ab18aaa4820278e5a154676fdd814cb | /src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/FlowBasedHMMEngine.java | 9af6c6a1311979d2882ac68d304617affd291b60 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | vruano/gatk | 55f820d10b406939b363ebd107c8ed1598468c95 | 43e2d048338e613e47cab0fbc522ebfdc76ae5c9 | refs/heads/master | 2023-02-25T00:31:42.292545 | 2023-01-12T18:03:20 | 2023-01-12T18:03:20 | 95,934,181 | 0 | 0 | null | 2017-07-01T01:10:43 | 2017-07-01T01:10:43 | null | UTF-8 | Java | false | false | 13,929 | java | package org.broadinstitute.hellbender.tools.walkers.haplotypecaller;
import com.google.common.annotations.VisibleForTesting;
import htsjdk.samtools.SAMFileHeader;
import org.broadinstitute.hellbender.exceptions.GATKException;
import org.broadinstitute.hellbender.utils.MathUtils;
import org.broadinstitute.hellbender.utils.Utils;
import org.broadinstitute.hellbender.utils.dragstr.DragstrParams;
import org.broadinstitute.hellbender.utils.genotyper.*;
import org.broadinstitute.hellbender.utils.haplotype.Haplotype;
import org.broadinstitute.hellbender.utils.pairhmm.FlowBasedPairHMM;
import org.broadinstitute.hellbender.utils.pairhmm.PairHMMInputScoreImputation;
import org.broadinstitute.hellbender.utils.pairhmm.PairHMMInputScoreImputator;
import org.broadinstitute.hellbender.utils.read.FlowBasedReadUtils;
import org.broadinstitute.hellbender.utils.read.GATKRead;
import org.broadinstitute.hellbender.utils.haplotype.FlowBasedHaplotype;
import org.broadinstitute.hellbender.utils.read.FlowBasedRead;
import org.broadinstitute.hellbender.tools.FlowBasedArgumentCollection;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.ToDoubleFunction;
/**
* Flow Based HMM, intended to incorporate the scoring model of the {@link FlowBasedAlignmentLikelihoodEngine} while allowing for frame-shift insertions
* and deletions for better genotyping.
*/
public class FlowBasedHMMEngine implements ReadLikelihoodCalculationEngine {
private final double readDisqualificationScale;
private final boolean dynamicReadDisqualification;
private double log10globalReadMismappingRate;
private final double expectedErrorRatePerBase;
private PairHMMLikelihoodCalculationEngine.PCRErrorModel pcrErrorModel;
final FlowBasedArgumentCollection fbargs;
@VisibleForTesting
public static final double INITIAL_QSCORE = 40.0;
private final FlowBasedPairHMM flowPairHMM;
public static final byte MIN_USABLE_Q_SCORE_DEFAULT = 6;
private static final int MIN_ADJUSTED_QSCORE = 10;
private byte minUsableIndelScoreToUse;
private PairHMMInputScoreImputator inputScoreImputator;
private final DragstrParams dragstrParams;
private byte constantGCP;
private final byte flatInsertionPenalty;
private final byte flatDeletionPenalty;
/**
* Default constructor
* @param fbargs - arguments
* @param log10globalReadMismappingRate - probability for wrong mapping (maximal contribution of the read to data likelihood)
* @param expectedErrorRatePerBase - the expected rate of random sequencing errors for a read originating from its true haplotype.
* @param pcrErrorModel
*/
public FlowBasedHMMEngine(final FlowBasedArgumentCollection fbargs, final byte constantGCP, final double log10globalReadMismappingRate, final double expectedErrorRatePerBase,
final PairHMMLikelihoodCalculationEngine.PCRErrorModel pcrErrorModel, final DragstrParams dragstrParams, final boolean dynamicReadDisqualification, final double readDisqualificationScale,
final int minUsableIndelScoreToUse, final byte flatDeletionPenalty, final byte flatInsertionPenalty) {
this.fbargs = fbargs;
this.log10globalReadMismappingRate = log10globalReadMismappingRate;
this.expectedErrorRatePerBase = expectedErrorRatePerBase;
this.readDisqualificationScale = readDisqualificationScale;
this.dynamicReadDisqualification = dynamicReadDisqualification;
this.pcrErrorModel = pcrErrorModel;
this.flowPairHMM = new FlowBasedPairHMM();
this.dragstrParams = dragstrParams;
this.constantGCP = constantGCP;
this.flatDeletionPenalty = flatDeletionPenalty;
this.flatInsertionPenalty = flatInsertionPenalty;
this.minUsableIndelScoreToUse = (byte)minUsableIndelScoreToUse;
// validity checks
if (fbargs.flowOrderCycleLength != 4) {
throw new GATKException("FlowBasedHMMEngine requires flow order of 4 elements but cycle length is specified as " + fbargs.flowOrderCycleLength);
}
initializePCRErrorModel();
}
public AlleleLikelihoods<GATKRead, Haplotype> computeReadLikelihoods(final List<Haplotype> haplotypeList,
final SAMFileHeader hdr,
final SampleList samples,
final Map<String, List<GATKRead>> perSampleReadList, final boolean filterPoorly) {
Utils.nonNull(samples, "samples is null");
Utils.nonNull(perSampleReadList, "perSampleReadList is null");
Utils.nonNull(haplotypeList, "haplotypeList is null");
final AlleleList<Haplotype> haplotypes = new IndexedAlleleList<>(haplotypeList);
// Add likelihoods for each sample's reads to our result
final AlleleLikelihoods<GATKRead, Haplotype> result = new AlleleLikelihoods<>(samples, haplotypes, perSampleReadList);
final int sampleCount = result.numberOfSamples();
for (int i = 0; i < sampleCount; i++) {
computeReadLikelihoods(result.sampleMatrix(i), hdr);
}
result.normalizeLikelihoods(log10globalReadMismappingRate, true);
if ( filterPoorly ) {
filterPoorlyModeledEvidence(result, dynamicReadDisqualification, expectedErrorRatePerBase, readDisqualificationScale);
}
return result;
}
/** Calculate minimal likelihood that reasonably matching read can get. We divide errors into "expected", e.g.
* hmer indels without 0->1/1->0 errors. Those on average occur with expectedErrorRate and "catastrophic' e.g.
* 1->0 and 0->1 errors (or large hmer indels). Those occur with probability fbargs.fillingValue.
* If the read has more than 3 expected and more than 2 "catastrophic" errors it will probably be deemed unfit to the
* haplotype
*
* @param expectedErrorRate error rate for expected errors.
* @return minimal likelihood for the read to be considered not poorly modeled
*/
@Override
public ToDoubleFunction<GATKRead> log10MinTrueLikelihood(final double expectedErrorRate, final boolean capLikelihoods) {
final double log10ErrorRate = Math.log10(expectedErrorRate);
final double catastrophicErrorRate = Math.log10(fbargs.fillingValue);
return read -> {
final double maxErrorsForRead = Math.max(3.0, Math.ceil(read.getLength() * expectedErrorRate));
final double maxCatastrophicErrorsForRead = Math.max(2.0, Math.ceil(read.getLength() * catastrophicErrorRate));
return maxErrorsForRead * log10ErrorRate + maxCatastrophicErrorsForRead*catastrophicErrorRate;
};
}
private byte[] pcrIndelErrorModelCache;
private void initializePCRErrorModel() {
inputScoreImputator = dragstrParams == null
? NonSymmetricalPairHMMInputScoreImputator.newInstance(constantGCP, flatInsertionPenalty, flatDeletionPenalty)
: DragstrPairHMMInputScoreImputator.of(dragstrParams) ;
if ( !pcrErrorModel.hasRateFactor() ) {
return;
}
pcrIndelErrorModelCache = new byte[ReadLikelihoodCalculationEngine.MAX_REPEAT_LENGTH + 1];
final double rateFactor = pcrErrorModel.getRateFactor();
for( int i = 0; i <= ReadLikelihoodCalculationEngine.MAX_REPEAT_LENGTH; i++ ) {
pcrIndelErrorModelCache[i] = getErrorModelAdjustedQual(i, rateFactor, minUsableIndelScoreToUse);
}
}
// TODO these methods are ripped whole cloth from the PairHMMLikelihoodsCalculationEngine and should be uinfied/fixed if possible
@VisibleForTesting
void applyPCRErrorModel( final byte[] readBases, final byte[] readInsQuals, final byte[] readDelQuals ) {
if ( pcrErrorModel == PairHMMLikelihoodCalculationEngine.PCRErrorModel.NONE ) {
return;
}
for ( int i = 1; i < readBases.length; i++ ) {
final int repeatLength = ReadLikelihoodCalculationEngine.findTandemRepeatUnits(readBases, i-1).getRight();
readInsQuals[i-1] = (byte) Math.min(0xff & readInsQuals[i - 1], 0xff & pcrIndelErrorModelCache[repeatLength]);
readDelQuals[i-1] = (byte) Math.min(0xff & readDelQuals[i - 1], 0xff & pcrIndelErrorModelCache[repeatLength]);
}
}
private static void capMinimumReadIndelQualities(final byte[] readInsQuals, final byte[] readDelQuals, final byte minUsableQualScore) {
for( int i = 0; i < readInsQuals.length; i++ ) {
readInsQuals[i] = (byte)Math.max(readInsQuals[i], minUsableQualScore);
readDelQuals[i] = (byte)Math.max(readDelQuals[i], minUsableQualScore);
}
}
static byte getErrorModelAdjustedQual(final int repeatLength, final double rateFactor, final byte minUsableIndelScoreToUse) {
return (byte) Math.max(minUsableIndelScoreToUse, MathUtils.fastRound(INITIAL_QSCORE - Math.exp(repeatLength / (rateFactor * Math.PI)) + 1.0));
}
/**
* Initialize our flowPairHMM with parameters appropriate to the haplotypes and reads we're going to evaluate
*
* After calling this routine the PairHMM will be configured to best evaluate all reads in the samples
* against the set of haplotypes
* @param haplotypes a non-null list of haplotypes
* @param perSampleReadList a mapping from sample -> reads
*/
private void initializeFlowPairHMM(final List<FlowBasedHaplotype> haplotypes, final List<FlowBasedRead> perSampleReadList) {
initializePCRErrorModel();
final int readMaxLength = perSampleReadList.stream().mapToInt(FlowBasedRead::getKeyLength).max().orElse(0);
final int haplotypeMaxLength = haplotypes.stream().mapToInt(h -> h.getKeyLength()).max().orElse(0);
// initialize arrays to hold the probabilities of being in the match, insertion and deletion cases
flowPairHMM.initialize(readMaxLength, haplotypeMaxLength);;
}
/**
* Compute read likelihoods for a single sample
* @param likelihoods Single sample likelihood matrix
* @param hdr SAM header that corresponds to the sample
*/
private void computeReadLikelihoods(final LikelihoodMatrix<GATKRead, Haplotype> likelihoods,
final SAMFileHeader hdr) {
final List<FlowBasedRead> processedReads = new ArrayList<>(likelihoods.evidenceCount());
final List<FlowBasedHaplotype> processedHaplotypes = new ArrayList<>(likelihoods.numberOfAlleles());
// establish flow order based on the first evidence. Note that all reads belong to the same sample (group)
final FlowBasedReadUtils.ReadGroupInfo rgInfo = (likelihoods.evidenceCount() != 0)
? FlowBasedReadUtils.getReadGroupInfo(hdr, likelihoods.evidence().get(0))
: null;
final String flowOrder = (rgInfo != null)
? rgInfo.flowOrder.substring(0, fbargs.flowOrderCycleLength)
: FlowBasedReadUtils.findFirstUsableFlowOrder(hdr, fbargs);
//convert all reads to FlowBasedReads (i.e. parse the matrix of P(call | haplotype) for each read from the BAM)
for (int i = 0 ; i < likelihoods.evidenceCount(); i++) {
final GATKRead rd = likelihoods.evidence().get(i);
// create a flow based read
final FlowBasedRead fbRead = new FlowBasedRead(rd, flowOrder, rgInfo.maxClass, fbargs);
fbRead.applyAlignment();
//TODO This currently supports any ScoreImputator in GATK but will probably need a custom one to handle flow based data in the future:
final PairHMMInputScoreImputation inputScoreImputation = inputScoreImputator.impute(fbRead);
final byte[] readInsQuals = inputScoreImputation.insOpenPenalties();
final byte[] readDelQuals = inputScoreImputation.delOpenPenalties();
final byte[] overallGCP = inputScoreImputation.gapContinuationPenalties();
applyPCRErrorModel(fbRead.getBases(), readInsQuals, readDelQuals);
capMinimumReadIndelQualities(readInsQuals, readDelQuals, minUsableIndelScoreToUse);
fbRead.setReadInsQuals(readInsQuals);
fbRead.setReadDelQuals(readDelQuals);
fbRead.setOverallGCP(overallGCP);
processedReads.add(fbRead);
}
//same for the haplotypes - each haplotype is converted to FlowBasedHaplotype
for (int i = 0; i < likelihoods.numberOfAlleles(); i++){
final FlowBasedHaplotype fbh = new FlowBasedHaplotype(likelihoods.alleles().get(i), flowOrder);
processedHaplotypes.add(fbh);
}
//NOTE: we assume all haplotypes start and end on the same place!
final int haplotypeStart = processedHaplotypes.get(0).getStart();
final int haplotypeEnd = processedHaplotypes.get(0).getEnd();
for (int i = 0 ; i < processedReads.size(); i++) {
final FlowBasedRead fbr=processedReads.get(i);
final int readStart = fbr.getStart();
final int readEnd = fbr.getEnd();
final int diffLeft = haplotypeStart - readStart;
final int diffRight = readEnd - haplotypeEnd;
//It is rare that this function is applied, maybe just some boundary cases
//in general reads are already trimmed to the haplotype starts and ends so diff_left <= 0 and diff_right <= 0
fbr.applyBaseClipping(Math.max(0, diffLeft), Math.max(diffRight, 0), false);
}
initializeFlowPairHMM(processedHaplotypes, processedReads);
flowPairHMM.computeLog10LikelihoodsFlowBased(likelihoods, processedReads, processedHaplotypes);
}
@Override
public void close() {}
}
| [
"[email protected]"
] | |
5b86337cfbf86b79133d94d29a8d8174b981083a | 92f10c41bad09bee05acbcb952095c31ba41c57b | /app/src/main/java/io/github/alula/ohmygod/MainActivity2850.java | 1a41a090b916a9b830a9aa53ed600ee173aa02a5 | [] | no_license | alula/10000-activities | bb25be9aead3d3d2ea9f9ef8d1da4c8dff1a7c62 | f7e8de658c3684035e566788693726f250170d98 | refs/heads/master | 2022-07-30T05:54:54.783531 | 2022-01-29T19:53:04 | 2022-01-29T19:53:04 | 453,501,018 | 16 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package io.github.alula.ohmygod;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity2850 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
} | [
"[email protected]"
] | |
b70a9e8982ab4929064fa7d5191f1939a6c0d860 | f5170bf4089afba4176e8eba4fbd7ea547f15a4f | /OpenBook/app/src/main/java/org/team2/unithon/openbook/utils/StaticServerUrl.java | 00aa21a6f16b3d1879a9465d44177862eae80b1b | [
"Apache-2.0"
] | permissive | KimHunJin/OpenBook | 8692298286ae461f54dc8e0a403e1534ab1c8da2 | 56f80ccd662b656f050bd2cfd9f96e6474b8fc8d | refs/heads/master | 2021-01-09T05:48:02.289515 | 2017-09-20T16:56:42 | 2017-09-20T16:56:42 | 80,837,514 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 276 | java | package org.team2.unithon.openbook.utils;
/**
* Created by HunJin on 2017-02-04.
*/
public class StaticServerUrl {
public static final String URL = " http://api.hongkevin.com/"; // server url
public static final String URL2 = "http://moonwon.gonetis.com:3002/";
}
| [
"[email protected]"
] | |
55bdbef43817f386310e92004420e4255f0bc1b1 | 7c23749f10820d2449af470999d09b753711b77c | /warehouse-service/src/main/java/example/service/WarehouseService.java | 95e35b3c8dfff622467f10bd8af4407eb847416f | [] | no_license | Bingo0408/backbone-microservice | c58ebad2807326aa3447392b9c804ccce4cd3c91 | 8e65358f13900bf7f8ba2815e952a66e6956c7c8 | refs/heads/master | 2022-11-20T17:38:47.411056 | 2020-07-29T13:42:12 | 2020-07-29T13:42:12 | 283,507,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | package example.service;
import example.OperationResponse;
import example.entity.ReduceStockRequestVO;
public interface WarehouseService {
OperationResponse reduceStock(ReduceStockRequestVO reduceStockRequestVO) throws Exception;
}
| [
"[email protected]"
] | |
e15b42fbfe1ac9c18ccf184ea6f9d897bf617db5 | 0da93883a1f014791341fc8c42c0edf6f49c5f3f | /demo-test/src/main/java/com/example/demo/entity/BaseEntity.java | 4a6090e3eac3323b11af7e73ee44ea35d6d6aeab | [] | no_license | LayHuts/forward-generation-starter | e8f320899640dea163c9100a87f89c7af548ad01 | dc7d4eb2559e046231d37b16a696256dccf094fd | refs/heads/master | 2022-03-28T12:50:47.266466 | 2020-01-27T16:30:30 | 2020-01-27T16:30:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package com.example.demo.entity;
import java.util.Date;
/**
* <br>
*
* @author 永健
* @since 2019/5/9 9:47
*/
public class BaseEntity
{
private Date createTime;
private Date updateTime;
}
| [
"[email protected]"
] | |
9ab1065a4dc307f1018d813e0f65e3bc62b2d5c5 | 574b00aa68ca29bc92454dda23aac816dae5374a | /exchange/core/src/main/java/org/hbird/exchange/core/NamedInstanceIdentifier.java | fc0f68ae6b129f94ab7702159f6300352cd6b072 | [
"Apache-2.0"
] | permissive | laurikimmel/hbird-business | 58252c5d5191ac5bad86f2c0a36a5c27130e37b3 | 09267655d567b80560a09942b60d7d0f7e1b89a7 | refs/heads/master | 2021-01-15T17:28:28.593603 | 2013-02-21T15:16:56 | 2013-02-21T15:16:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,243 | java | /**
* Licensed to the Hummingbird Foundation (HF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The HF 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.hbird.exchange.core;
import java.io.Serializable;
public class NamedInstanceIdentifier implements Serializable {
/**
*
*/
private static final long serialVersionUID = 2768378707513305322L;
public String name;
public long timestamp;
public String type;
public NamedInstanceIdentifier(String name, long timestamp, String type) {
super();
this.name = name;
this.timestamp = timestamp;
this.type = type;
}
}
| [
"[email protected]"
] | |
b719ebbbec5fdf9caf4887b2e94913dad28d1ad3 | fdc3216e39e83621663634b152a1374fc977571d | /src/test/java/com/quality/project/JUnit/passwordConfigTest/IPasswordMock.java | ce02b82e89552b11556f8a270707ad7614b876b6 | [
"MIT"
] | permissive | naveenkusakula/RecipesManager | 45a18a9e8cb5f52744da04f65b47d1e859683be5 | bc079646da896529946be0b144c3ced3754fd105 | refs/heads/master | 2022-04-01T15:34:21.993055 | 2020-01-09T18:35:18 | 2020-01-09T18:35:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package com.quality.project.JUnit.passwordConfigTest;
import com.quality.project.password.IPasswordParam;
public interface IPasswordMock {
IPasswordParam getPasswordMock(String identifier);
}
| [
"[email protected]"
] | |
98a20eef6f7e17fc21bd7e959cec3421a881b069 | 85ccd731066ab8b6a9f8af504dfe67d01683b874 | /src/main/java/com/cinovation/web/entity/maintenance/UnitEntity.java | 28658bc6f7e12ffbce61069d32d50ea130a4a394 | [] | no_license | robbyrahmana/Husada-Bunda | b56915abb5d51321313f369b0b983d335c02be0f | bde391ff52b031f65e4fd1fb851e7549308c7d45 | refs/heads/master | 2021-07-17T07:05:29.182285 | 2017-10-22T10:40:43 | 2017-10-22T10:40:43 | 107,856,407 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,627 | java | package com.cinovation.web.entity.maintenance;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
@Entity(name = "UnitEntity")
@Table(name = "t_mt_unit")
public class UnitEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1738241914361382411L;
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid2")
@Column(name = "ID", unique = true)
private String id;
@Column(name = "unit")
private String unit;
@Column(name = "remark")
private String remark;
@Column(name = "createDate")
private Date createDate;
@Column(name = "updateDate")
private Date updateDate;
@Column(name = "isDel")
private int isDel;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public int getIsDel() {
return isDel;
}
public void setIsDel(int isDel) {
this.isDel = isDel;
}
}
| [
"[email protected]"
] | |
29dda2044b273662a0f48fe65d9ffb57833df98e | 917bba6fd754e42b5bafd1ac5b0c57f8f0ed1d1f | /apache-commons-collections-ReferenceMap/mutants/org.apache.commons.collections4.map.AbstractReferenceMap_IOD_15.java | 866b6193cea1b9bb9417e699097ba413aab63706 | [
"Apache-2.0"
] | permissive | sbu-test-lab/object-coverage-case-studies | a2a2d916ec7d2d40366ebe0b62dd153000789496 | b09d12a104cdd382c7f9adf0fd941efce6cc1b3a | refs/heads/main | 2023-08-12T15:45:16.418461 | 2021-09-15T11:45:02 | 2021-09-15T11:45:02 | 348,349,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 35,729 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.collections4.map;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;
import org.apache.commons.collections4.MapIterator;
import org.apache.commons.collections4.keyvalue.DefaultMapEntry;
/**
* An abstract implementation of a hash-based map that allows the entries to
* be removed by the garbage collector.
* <p>
* This class implements all the features necessary for a subclass reference
* hash-based map. Key-value entries are stored in instances of the
* {@code ReferenceEntry} class which can be overridden and replaced.
* The iterators can similarly be replaced, without the need to replace the KeySet,
* EntrySet and Values view classes.
* </p>
* <p>
* Overridable methods are provided to change the default hashing behavior, and
* to change how entries are added to and removed from the map. Hopefully, all you
* need for unusual subclasses is here.
* </p>
* <p>
* When you construct an {@code AbstractReferenceMap}, you can specify what
* kind of references are used to store the map's keys and values.
* If non-hard references are used, then the garbage collector can remove
* mappings if a key or value becomes unreachable, or if the JVM's memory is
* running low. For information on how the different reference types behave,
* see {@link Reference}.
* </p>
* <p>
* Different types of references can be specified for keys and values.
* The keys can be configured to be weak but the values hard,
* in which case this class will behave like a
* <a href="http://java.sun.com/j2se/1.4/docs/api/java/util/WeakHashMap.html">
* {@code WeakHashMap}</a>. However, you can also specify hard keys and
* weak values, or any other combination. The default constructor uses
* hard keys and soft values, providing a memory-sensitive cache.
* </p>
* <p>
* This {@link Map} implementation does <i>not</i> allow null elements.
* Attempting to add a null key or value to the map will raise a
* {@code NullPointerException}.
* </p>
* <p>
* All the available iterators can be reset back to the start by casting to
* {@code ResettableIterator} and calling {@code reset()}.
* </p>
* <p>
* This implementation is not synchronized.
* You can use {@link java.util.Collections#synchronizedMap} to
* provide synchronized access to a {@code ReferenceMap}.
* </p>
*
* @param <K> the type of the keys in this map
* @param <V> the type of the values in this map
*
* @see java.lang.ref.Reference
* @since 3.1 (extracted from ReferenceMap in 3.0)
*/
public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V> {
/**
* Reference type enum.
*/
public enum ReferenceStrength {
HARD(0), SOFT(1), WEAK(2);
/** value */
public final int value;
/**
* Resolve enum from int.
* @param value the int value
* @return ReferenceType
* @throws IllegalArgumentException if the specified value is invalid.
*/
public static ReferenceStrength resolve(final int value) {
switch (value) {
case 0:
return HARD;
case 1:
return SOFT;
case 2:
return WEAK;
default:
throw new IllegalArgumentException();
}
}
ReferenceStrength(final int value) {
this.value = value;
}
}
/**
* The reference type for keys.
*/
private ReferenceStrength keyType;
/**
* The reference type for values.
*/
private ReferenceStrength valueType;
/**
* Should the value be automatically purged when the associated key has been collected?
*/
private boolean purgeValues;
/**
* ReferenceQueue used to eliminate stale mappings.
* See purge.
*/
private transient ReferenceQueue<Object> queue;
//-----------------------------------------------------------------------
/**
* Constructor used during deserialization.
*/
protected AbstractReferenceMap() {
}
/**
* Constructs a new empty map with the specified reference types,
* load factor and initial capacity.
*
* @param keyType the type of reference to use for keys;
* must be {@link ReferenceStrength#HARD HARD},
* {@link ReferenceStrength#SOFT SOFT},
* {@link ReferenceStrength#WEAK WEAK}
* @param valueType the type of reference to use for values;
* must be {@link ReferenceStrength#HARD},
* {@link ReferenceStrength#SOFT SOFT},
* {@link ReferenceStrength#WEAK WEAK}
* @param capacity the initial capacity for the map
* @param loadFactor the load factor for the map
* @param purgeValues should the value be automatically purged when the
* key is garbage collected
*/
protected AbstractReferenceMap(
final ReferenceStrength keyType, final ReferenceStrength valueType, final int capacity,
final float loadFactor, final boolean purgeValues) {
super(capacity, loadFactor);
this.keyType = keyType;
this.valueType = valueType;
this.purgeValues = purgeValues;
}
/**
* Initialize this subclass during construction, cloning or deserialization.
*/
@Override
protected void init() {
queue = new ReferenceQueue<>();
}
//-----------------------------------------------------------------------
/**
* Gets the size of the map.
*
* @return the size
*/
@Override
public int size() {
purgeBeforeRead();
return super.size();
}
/**
* Checks whether the map is currently empty.
*
* @return true if the map is currently size zero
*/
@Override
public boolean isEmpty() {
purgeBeforeRead();
return super.isEmpty();
}
/**
* Checks whether the map contains the specified key.
*
* @param key the key to search for
* @return true if the map contains the key
*/
@Override
public boolean containsKey(final Object key) {
purgeBeforeRead();
final Entry<K, V> entry = getEntry(key);
if (entry == null) {
return false;
}
return entry.getValue() != null;
}
/**
* Checks whether the map contains the specified value.
*
* @param value the value to search for
* @return true if the map contains the value
*/
@Override
public boolean containsValue(final Object value) {
purgeBeforeRead();
if (value == null) {
return false;
}
return super.containsValue(value);
}
/**
* Gets the value mapped to the key specified.
*
* @param key the key
* @return the mapped value, null if no match
*/
@Override
public V get(final Object key) {
purgeBeforeRead();
final Entry<K, V> entry = getEntry(key);
if (entry == null) {
return null;
}
return entry.getValue();
}
/**
* Puts a key-value mapping into this map.
* Neither the key nor the value may be null.
*
* @param key the key to add, must not be null
* @param value the value to add, must not be null
* @return the value previously mapped to this key, null if none
* @throws NullPointerException if either the key or value is null
*/
@Override
public V put(final K key, final V value) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(value, "value");
purgeBeforeWrite();
return super.put(key, value);
}
/**
* Removes the specified mapping from this map.
*
* @param key the mapping to remove
* @return the value mapped to the removed key, null if key not in map
*/
@Override
public V remove(final Object key) {
if (key == null) {
return null;
}
purgeBeforeWrite();
return super.remove(key);
}
/**
* Clears this map.
*/
@Override
public void clear() {
super.clear();
// drain the queue
while (queue.poll() != null) {
// empty
}
}
//-----------------------------------------------------------------------
/**
* Gets a MapIterator over the reference map.
* The iterator only returns valid key/value pairs.
*
* @return a map iterator
*/
@Override
public MapIterator<K, V> mapIterator() {
return new ReferenceMapIterator<>(this);
}
/**
* Returns a set view of this map's entries.
* An iterator returned entry is valid until {@code next()} is called again.
* The {@code setValue()} method on the {@code toArray} entries has no effect.
*
* @return a set view of this map's entries
*/
@Override
public Set<Map.Entry<K, V>> entrySet() {
if (entrySet == null) {
entrySet = new ReferenceEntrySet<>(this);
}
return entrySet;
}
/**
* Returns a set view of this map's keys.
*
* @return a set view of this map's keys
*/
@Override
public Set<K> keySet() {
if (keySet == null) {
keySet = new ReferenceKeySet<>(this);
}
return keySet;
}
/**
* Returns a collection view of this map's values.
*
* @return a set view of this map's values
*/
@Override
public Collection<V> values() {
if (values == null) {
values = new ReferenceValues<>(this);
}
return values;
}
//-----------------------------------------------------------------------
/**
* Purges stale mappings from this map before read operations.
* <p>
* This implementation calls {@link #purge()} to maintain a consistent state.
*/
protected void purgeBeforeRead() {
purge();
}
/**
* Purges stale mappings from this map before write operations.
* <p>
* This implementation calls {@link #purge()} to maintain a consistent state.
*/
protected void purgeBeforeWrite() {
purge();
}
/**
* Purges stale mappings from this map.
* <p>
* Note that this method is not synchronized! Special
* care must be taken if, for instance, you want stale
* mappings to be removed on a periodic basis by some
* background thread.
*/
protected void purge() {
Reference<?> ref = queue.poll();
while (ref != null) {
purge(ref);
ref = queue.poll();
}
}
/**
* Purges the specified reference.
*
* @param ref the reference to purge
*/
protected void purge(final Reference<?> ref) {
// The hashCode of the reference is the hashCode of the
// mapping key, even if the reference refers to the
// mapping value...
final int hash = ref.hashCode();
final int index = hashIndex(hash, data.length);
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
final ReferenceEntry<K, V> refEntry = (ReferenceEntry<K, V>) entry;
if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
refEntry.onPurge();
return;
}
previous = entry;
entry = entry.next;
}
}
//-----------------------------------------------------------------------
/**
* Gets the entry mapped to the key specified.
*
* @param key the key
* @return the entry, null if no match
*/
@Override
protected HashEntry<K, V> getEntry(final Object key) {
if (key == null) {
return null;
}
return super.getEntry(key);
}
/**
* Gets the hash code for a MapEntry.
* Subclasses can override this, for example to use the identityHashCode.
*
* @param key the key to get a hash code for, may be null
* @param value the value to get a hash code for, may be null
* @return the hash code, as per the MapEntry specification
*/
protected int hashEntry(final Object key, final Object value) {
return (key == null ? 0 : key.hashCode()) ^
(value == null ? 0 : value.hashCode());
}
/**
* Compares two keys, in internal converted form, to see if they are equal.
* <p>
* This implementation converts the key from the entry to a real reference
* before comparison.
*
* @param key1 the first key to compare passed in from outside
* @param key2 the second key extracted from the entry via {@code entry.key}
* @return true if equal
*/
//=== bug-seed
/*@Override
@SuppressWarnings("unchecked")
protected boolean isEqualKey(final Object key1, Object key2) {
key2 = keyType == ReferenceStrength.HARD ? key2 : ((Reference<K>) key2).get();
return key1 == key2 || key1.equals(key2);
}*/
/**
* Creates a ReferenceEntry instead of a HashEntry.
*
* @param next the next entry in sequence
* @param hashCode the hash code to use
* @param key the key to store
* @param value the value to store
* @return the newly created entry
*/
@Override
protected ReferenceEntry<K, V> createEntry(final HashEntry<K, V> next, final int hashCode,
final K key, final V value) {
return new ReferenceEntry<>(this, next, hashCode, key, value);
}
/**
* Creates an entry set iterator.
*
* @return the entrySet iterator
*/
@Override
protected Iterator<Map.Entry<K, V>> createEntrySetIterator() {
return new ReferenceEntrySetIterator<>(this);
}
/**
* Creates an key set iterator.
*
* @return the keySet iterator
*/
@Override
protected Iterator<K> createKeySetIterator() {
return new ReferenceKeySetIterator<>(this);
}
/**
* Creates an values iterator.
*
* @return the values iterator
*/
@Override
protected Iterator<V> createValuesIterator() {
return new ReferenceValuesIterator<>(this);
}
//-----------------------------------------------------------------------
/**
* EntrySet implementation.
*/
static class ReferenceEntrySet<K, V> extends EntrySet<K, V> {
protected ReferenceEntrySet(final AbstractHashedMap<K, V> parent) {
super(parent);
}
@Override
public Object[] toArray() {
return toArray(new Object[size()]);
}
@Override
public <T> T[] toArray(final T[] arr) {
// special implementation to handle disappearing entries
final ArrayList<Map.Entry<K, V>> list = new ArrayList<>(size());
for (final Map.Entry<K, V> entry : this) {
list.add(new DefaultMapEntry<>(entry));
}
return list.toArray(arr);
}
}
//-----------------------------------------------------------------------
/**
* KeySet implementation.
*/
static class ReferenceKeySet<K> extends KeySet<K> {
protected ReferenceKeySet(final AbstractHashedMap<K, ?> parent) {
super(parent);
}
@Override
public Object[] toArray() {
return toArray(new Object[size()]);
}
@Override
public <T> T[] toArray(final T[] arr) {
// special implementation to handle disappearing keys
final List<K> list = new ArrayList<>(size());
for (final K key : this) {
list.add(key);
}
return list.toArray(arr);
}
}
//-----------------------------------------------------------------------
/**
* Values implementation.
*/
static class ReferenceValues<V> extends Values<V> {
protected ReferenceValues(final AbstractHashedMap<?, V> parent) {
super(parent);
}
@Override
public Object[] toArray() {
return toArray(new Object[size()]);
}
@Override
public <T> T[] toArray(final T[] arr) {
// special implementation to handle disappearing values
final List<V> list = new ArrayList<>(size());
for (final V value : this) {
list.add(value);
}
return list.toArray(arr);
}
}
//-----------------------------------------------------------------------
/**
* A MapEntry implementation for the map.
* <p>
* If getKey() or getValue() returns null, it means
* the mapping is stale and should be removed.
*
* @since 3.1
*/
protected static class ReferenceEntry<K, V> extends HashEntry<K, V> {
/** The parent map */
private final AbstractReferenceMap<K, V> parent;
/**
* Creates a new entry object for the ReferenceMap.
*
* @param parent the parent map
* @param next the next entry in the hash bucket
* @param hashCode the hash code of the key
* @param key the key
* @param value the value
*/
public ReferenceEntry(final AbstractReferenceMap<K, V> parent, final HashEntry<K, V> next,
final int hashCode, final K key, final V value) {
super(next, hashCode, null, null);
this.parent = parent;
this.key = toReference(parent.keyType, key, hashCode);
this.value = toReference(parent.valueType, value, hashCode); // the key hashCode is passed in deliberately
}
/**
* Gets the key from the entry.
* This method dereferences weak and soft keys and thus may return null.
*
* @return the key, which may be null if it was garbage collected
*/
@Override
@SuppressWarnings("unchecked")
public K getKey() {
return (K) (parent.keyType == ReferenceStrength.HARD ? key : ((Reference<K>) key).get());
}
/**
* Gets the value from the entry.
* This method dereferences weak and soft value and thus may return null.
*
* @return the value, which may be null if it was garbage collected
*/
@Override
@SuppressWarnings("unchecked")
public V getValue() {
return (V) (parent.valueType == ReferenceStrength.HARD ? value : ((Reference<V>) value).get());
}
/**
* Sets the value of the entry.
*
* @param obj the object to store
* @return the previous value
*/
@Override
@SuppressWarnings("unchecked")
public V setValue(final V obj) {
final V old = getValue();
if (parent.valueType != ReferenceStrength.HARD) {
((Reference<V>) value).clear();
}
value = toReference(parent.valueType, obj, hashCode);
return old;
}
/**
* Compares this map entry to another.
* <p>
* This implementation uses {@code isEqualKey} and
* {@code isEqualValue} on the main map for comparison.
*
* @param obj the other map entry to compare to
* @return true if equal, false if not
*/
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof Map.Entry == false) {
return false;
}
final Map.Entry<?, ?> entry = (Map.Entry<?, ?>) obj;
final Object entryKey = entry.getKey(); // convert to hard reference
final Object entryValue = entry.getValue(); // convert to hard reference
if (entryKey == null || entryValue == null) {
return false;
}
// compare using map methods, aiding identity subclass
// note that key is direct access and value is via method
return parent.isEqualKey(entryKey, key) &&
parent.isEqualValue(entryValue, getValue());
}
/**
* Gets the hashcode of the entry using temporary hard references.
* <p>
* This implementation uses {@code hashEntry} on the main map.
*
* @return the hashcode of the entry
*/
@Override
public int hashCode() {
return parent.hashEntry(getKey(), getValue());
}
/**
* Constructs a reference of the given type to the given referent.
* The reference is registered with the queue for later purging.
*
* @param <T> the type of the referenced object
* @param type HARD, SOFT or WEAK
* @param referent the object to refer to
* @param hash the hash code of the <i>key</i> of the mapping;
* this number might be different from referent.hashCode() if
* the referent represents a value and not a key
* @return the reference to the object
*/
protected <T> Object toReference(final ReferenceStrength type, final T referent, final int hash) {
if (type == ReferenceStrength.HARD) {
return referent;
}
if (type == ReferenceStrength.SOFT) {
return new SoftRef<>(hash, referent, parent.queue);
}
if (type == ReferenceStrength.WEAK) {
return new WeakRef<>(hash, referent, parent.queue);
}
throw new Error();
}
/**
* This is the callback for custom "after purge" logic
*/
protected void onPurge() {
// empty
}
/**
* Purges the specified reference
* @param ref the reference to purge
* @return true or false
*/
protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType != ReferenceStrength.HARD && key == ref;
r = r || parent.valueType != ReferenceStrength.HARD && value == ref;
if (r) {
if (parent.keyType != ReferenceStrength.HARD) {
((Reference<?>) key).clear();
}
if (parent.valueType != ReferenceStrength.HARD) {
((Reference<?>) value).clear();
} else if (parent.purgeValues) {
nullValue();
}
}
return r;
}
/**
* Gets the next entry in the bucket.
*
* @return the next entry in the bucket
*/
protected ReferenceEntry<K, V> next() {
return (ReferenceEntry<K, V>) next;
}
/**
* This method can be overridden to provide custom logic to purge value
*/
protected void nullValue() {
value = null;
}
}
//-----------------------------------------------------------------------
/**
* Base iterator class.
*/
static class ReferenceBaseIterator<K, V> {
/** The parent map */
final AbstractReferenceMap<K, V> parent;
// These fields keep track of where we are in the table.
int index;
ReferenceEntry<K, V> entry;
ReferenceEntry<K, V> previous;
// These Object fields provide hard references to the
// current and next entry; this assures that if hasNext()
// returns true, next() will actually return a valid element.
K currentKey, nextKey;
V currentValue, nextValue;
int expectedModCount;
ReferenceBaseIterator(final AbstractReferenceMap<K, V> parent) {
this.parent = parent;
index = parent.size() != 0 ? parent.data.length : 0;
// have to do this here! size() invocation above
// may have altered the modCount.
expectedModCount = parent.modCount;
}
public boolean hasNext() {
checkMod();
while (nextNull()) {
ReferenceEntry<K, V> e = entry;
int i = index;
while (e == null && i > 0) {
i--;
e = (ReferenceEntry<K, V>) parent.data[i];
}
entry = e;
index = i;
if (e == null) {
currentKey = null;
currentValue = null;
return false;
}
nextKey = e.getKey();
nextValue = e.getValue();
if (nextNull()) {
entry = entry.next();
}
}
return true;
}
private void checkMod() {
if (parent.modCount != expectedModCount) {
throw new ConcurrentModificationException();
}
}
private boolean nextNull() {
return nextKey == null || nextValue == null;
}
protected ReferenceEntry<K, V> nextEntry() {
checkMod();
if (nextNull() && !hasNext()) {
throw new NoSuchElementException();
}
previous = entry;
entry = entry.next();
currentKey = nextKey;
currentValue = nextValue;
nextKey = null;
nextValue = null;
return previous;
}
protected ReferenceEntry<K, V> currentEntry() {
checkMod();
return previous;
}
public void remove() {
checkMod();
if (previous == null) {
throw new IllegalStateException();
}
parent.remove(currentKey);
previous = null;
currentKey = null;
currentValue = null;
expectedModCount = parent.modCount;
}
}
/**
* The EntrySet iterator.
*/
static class ReferenceEntrySetIterator<K, V>
extends ReferenceBaseIterator<K, V> implements Iterator<Map.Entry<K, V>> {
ReferenceEntrySetIterator(final AbstractReferenceMap<K, V> parent) {
super(parent);
}
@Override
public Map.Entry<K, V> next() {
return nextEntry();
}
}
/**
* The keySet iterator.
*/
static class ReferenceKeySetIterator<K> extends ReferenceBaseIterator<K, Object> implements Iterator<K> {
@SuppressWarnings("unchecked")
ReferenceKeySetIterator(final AbstractReferenceMap<K, ?> parent) {
super((AbstractReferenceMap<K, Object>) parent);
}
@Override
public K next() {
return nextEntry().getKey();
}
}
/**
* The values iterator.
*/
static class ReferenceValuesIterator<V> extends ReferenceBaseIterator<Object, V> implements Iterator<V> {
@SuppressWarnings("unchecked")
ReferenceValuesIterator(final AbstractReferenceMap<?, V> parent) {
super((AbstractReferenceMap<Object, V>) parent);
}
@Override
public V next() {
return nextEntry().getValue();
}
}
/**
* The MapIterator implementation.
*/
static class ReferenceMapIterator<K, V> extends ReferenceBaseIterator<K, V> implements MapIterator<K, V> {
protected ReferenceMapIterator(final AbstractReferenceMap<K, V> parent) {
super(parent);
}
@Override
public K next() {
return nextEntry().getKey();
}
@Override
public K getKey() {
final HashEntry<K, V> current = currentEntry();
if (current == null) {
throw new IllegalStateException(AbstractHashedMap.GETKEY_INVALID);
}
return current.getKey();
}
@Override
public V getValue() {
final HashEntry<K, V> current = currentEntry();
if (current == null) {
throw new IllegalStateException(AbstractHashedMap.GETVALUE_INVALID);
}
return current.getValue();
}
@Override
public V setValue(final V value) {
final HashEntry<K, V> current = currentEntry();
if (current == null) {
throw new IllegalStateException(AbstractHashedMap.SETVALUE_INVALID);
}
return current.setValue(value);
}
}
//-----------------------------------------------------------------------
// These two classes store the hashCode of the key of
// of the mapping, so that after they're dequeued a quick
// lookup of the bucket in the table can occur.
/**
* A soft reference holder.
*/
static class SoftRef<T> extends SoftReference<T> {
/** the hashCode of the key (even if the reference points to a value) */
private final int hash;
SoftRef(final int hash, final T r, final ReferenceQueue<? super T> q) {
super(r, q);
this.hash = hash;
}
@Override
public int hashCode() {
return hash;
}
}
/**
* A weak reference holder.
*/
static class WeakRef<T> extends WeakReference<T> {
/** the hashCode of the key (even if the reference points to a value) */
private final int hash;
WeakRef(final int hash, final T r, final ReferenceQueue<? super T> q) {
super(r, q);
this.hash = hash;
}
@Override
public int hashCode() {
return hash;
}
}
//-----------------------------------------------------------------------
/**
* Replaces the superclass method to store the state of this class.
* <p>
* Serialization is not one of the JDK's nicest topics. Normal serialization will
* initialize the superclass before the subclass. Sometimes however, this isn't
* what you want, as in this case the {@code put()} method on read can be
* affected by subclass state.
* <p>
* The solution adopted here is to serialize the state data of this class in
* this protected method. This method must be called by the
* {@code writeObject()} of the first serializable subclass.
* <p>
* Subclasses may override if they have a specific field that must be present
* on read before this implementation will work. Generally, the read determines
* what must be serialized here, if anything.
*
* @param out the output stream
* @throws IOException if an error occurs while writing to the stream
*/
@Override
protected void doWriteObject(final ObjectOutputStream out) throws IOException {
out.writeInt(keyType.value);
out.writeInt(valueType.value);
out.writeBoolean(purgeValues);
out.writeFloat(loadFactor);
out.writeInt(data.length);
for (final MapIterator<K, V> it = mapIterator(); it.hasNext();) {
out.writeObject(it.next());
out.writeObject(it.getValue());
}
out.writeObject(null); // null terminate map
// do not call super.doWriteObject() as code there doesn't work for reference map
}
/**
* Replaces the superclass method to read the state of this class.
* <p>
* Serialization is not one of the JDK's nicest topics. Normal serialization will
* initialize the superclass before the subclass. Sometimes however, this isn't
* what you want, as in this case the {@code put()} method on read can be
* affected by subclass state.
* <p>
* The solution adopted here is to deserialize the state data of this class in
* this protected method. This method must be called by the
* {@code readObject()} of the first serializable subclass.
* <p>
* Subclasses may override if the subclass has a specific field that must be present
* before {@code put()} or {@code calculateThreshold()} will work correctly.
*
* @param in the input stream
* @throws IOException if an error occurs while reading from the stream
* @throws ClassNotFoundException if an object read from the stream can not be loaded
*/
@Override
@SuppressWarnings("unchecked")
protected void doReadObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
this.keyType = ReferenceStrength.resolve(in.readInt());
this.valueType = ReferenceStrength.resolve(in.readInt());
this.purgeValues = in.readBoolean();
this.loadFactor = in.readFloat();
final int capacity = in.readInt();
init();
data = new HashEntry[capacity];
// COLLECTIONS-599: Calculate threshold before populating, otherwise it will be 0
// when it hits AbstractHashedMap.checkCapacity() and so will unnecessarily
// double up the size of the "data" array during population.
//
// NB: AbstractHashedMap.doReadObject() DOES calculate the threshold before populating.
//
threshold = calculateThreshold(data.length, loadFactor);
while (true) {
final K key = (K) in.readObject();
if (key == null) {
break;
}
final V value = (V) in.readObject();
put(key, value);
}
// do not call super.doReadObject() as code there doesn't work for reference map
}
/**
* Provided protected read-only access to the key type.
* @param type the type to check against.
* @return true if keyType has the specified type
*/
protected boolean isKeyType(final ReferenceStrength type) {
return this.keyType == type;
}
/**
* Provided protected read-only access to the value type.
* @param type the type to check against.
* @return true if valueType has the specified type
*/
protected boolean isValueType(final ReferenceStrength type) {
return this.valueType == type;
}
}
| [
"[email protected]"
] | |
59dea58afcc5ea96d459bb5959bb7cc838cf2c1f | 943b714b4d90e2935c4e73f8d2c6e7cc416525f8 | /log-util/src/main/java/vip/liteng/log/Logger.java | 0d5b95ce2dd721996dbbbe17845e2f01ae40cfc5 | [] | no_license | BoringRicky/yuque | 4d153e42bd15d046cefddaa176ff67009481217a | 8f2f6f44ce4c773589566212a8fbed0d9a7ccbff | refs/heads/master | 2020-05-22T15:16:24.721813 | 2019-05-14T10:32:01 | 2019-05-14T10:32:01 | 186,403,732 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,566 | java | package vip.liteng.log;
import timber.log.Timber;
/**
* @author LiTeng
* @date 2019-05-10
*/
public class Logger {
private static final boolean DEBUG = true;
private static String sTag;
private Logger() {}
public static void register() {
Timber.plant(new Timber.DebugTree());
}
public static void tag(String tag) {
sTag = tag;
}
public static void v(String message, Object... objects) {
if (!DEBUG) {
return;
}
Timber.tag(sTag).v(message, objects);
}
public static void i(String message, Object... objects) {
if (!DEBUG) {
return;
}
Timber.tag(sTag).i(message, objects);
}
public static void d(String message, Object... objects) {
if (!DEBUG) {
return;
}
Timber.tag(sTag).d(message, objects);
}
public static void w(String message, Object... objects) {
if (!DEBUG) {
return;
}
Timber.tag(sTag).w(message, objects);
}
public static void e(String message, Object... objects) {
if (!DEBUG) {
return;
}
Timber.tag(sTag).e(message, objects);
}
public static void e(Throwable throwable) {
if (!DEBUG) {
return;
}
Timber.tag(sTag).e(throwable);
}
public static void e(Throwable throwable, String message, Object... objects) {
if (!DEBUG) {
return;
}
Timber.tag(sTag).e(throwable, message, objects);
}
}
| [
"[email protected]"
] | |
9f0c2412f4760498831d77324cd74fe7c5438c72 | a2b029ad507b2b747761d9c15ca70e41b4f70b4c | /src/main/java/com/jhta/project/service/PetsitterPriceService.java | 977ccdca8f1b1e2082c7b0b2de2dcac7e7d72959 | [] | no_license | KimDayeong00/FinalProject_3 | 15985eaf6e6aaeec668ab59f09dee17d24438c6d | 70797b90d2ab8ff065801072345a8f07d16c4a41 | refs/heads/master | 2022-12-24T08:57:26.750342 | 2019-09-20T06:11:21 | 2019-09-20T06:11:21 | 129,702,085 | 0 | 0 | null | 2022-12-16T05:10:23 | 2018-04-16T07:24:25 | Java | UTF-8 | Java | false | false | 425 | java | package com.jhta.project.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jhta.project.dao.PetsitterPriceDao;
import com.jhta.project.vo.PetSitterPriceVo;
@Service
public class PetsitterPriceService {
@Autowired PetsitterPriceDao dao;
public PetSitterPriceVo select(String ps_email) {
return dao.select(ps_email);
}
}
| [
"[email protected]"
] | |
e5924a95db6bae8b99e72d6d711090d70fb0aed1 | 9d9503b2ea70ad24d5a6528dd506f5901766daad | /src/main/java/com/sinapsisenergia/repository/SubestacaoRepository.java | 3b71f016f0939f48575491e2fb2196b579a572dd | [] | no_license | MichaelAlves26/TesteDesenvolvedor | 90987dbae5e2546438e600f69f77d1f1a43c6f6d | 3812c4cbafca553206d9c5490ba5040e71fb1508 | refs/heads/main | 2022-12-31T21:15:22.211011 | 2020-10-16T14:54:05 | 2020-10-16T14:54:05 | 304,657,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | package com.sinapsisenergia.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.sinapisienergia.entity.Subestacao;
@Repository
public interface SubestacaoRepository extends JpaRepository<Subestacao, Long> {
}
| [
"[email protected]"
] | |
db68a44ed7f2f2d69b224871d5134494d2c1889f | c257342df49362a5c041453f3b97109cf38f0d15 | /SefinWeb/SiafiWeb/src/java/br/com/siafi/dao/LicitacaoUnidadeOrcamentariaDAO.java | 482d92f67459533e6c5a3ecab7d255212383f885 | [] | no_license | aricomputacao/s13 | 42acc4709dc9029c26f928da8c5b7da0544fba36 | 14599ce1e1728d53383af7150dc0e20995f6f4d3 | refs/heads/master | 2021-01-13T02:07:27.557209 | 2014-08-15T06:32:18 | 2014-08-15T06:32:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,943 | 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 br.com.siafi.dao;
import br.com.guardiao.dao.DAO;
import br.com.guardiao.modelo.UnidadeOrcamentaria;
import br.com.siafi.modelo.Credor;
import br.com.siafi.modelo.LicitacaoUnidadeOrcamentaria;
import br.com.siafi.modelo.LicitacaoUnidadeOrcamentariaPk;
import java.io.Serializable;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
/**
*
* @author ari
*/
@Stateless
public class LicitacaoUnidadeOrcamentariaDAO extends DAO<LicitacaoUnidadeOrcamentaria, LicitacaoUnidadeOrcamentariaPk> implements Serializable {
public LicitacaoUnidadeOrcamentariaDAO() {
super(LicitacaoUnidadeOrcamentaria.class);
}
public List<LicitacaoUnidadeOrcamentaria> listarLicitacaoUnidadeOrcamentaria() throws Exception {
TypedQuery<LicitacaoUnidadeOrcamentaria> q = getEm().createQuery("SELECT d FROM LicitacaoUnidadeOrcamentaria d ", LicitacaoUnidadeOrcamentaria.class);
return q.getResultList();
}
public List<LicitacaoUnidadeOrcamentaria> listarLicitacaoUnidadeOrcamentaria(UnidadeOrcamentaria o, Credor c) throws Exception {
Query q = getEm().createQuery("SELECT DISTINCT l.licitacao FROM LicitacaoUnidadeOrcamentaria l WHERE l.unidadeOrcamentaria = :o AND "
+ "l.licitacao IN ( SELECT i.licitacao FROM ItemLicitacao i WHERE i.credor=:credor) AND l.licitacao NOT IN ( SELECT s.contrato.licitacao FROM SolicitacaoFinanceira s WHERE s.contrato IS NOT NULL AND s.situacaoSolicitacao<>'Negado' AND s.situacaoSolicitacao <> 'Cancelado' )", LicitacaoUnidadeOrcamentaria.class);
q.setParameter("o", o);
q.setParameter("c", c);
return q.getResultList();
}
}
| [
"[email protected]"
] | |
f092210da45a615c8a84e8e7e94860d1a37f91c3 | 6c5c1bb6e5a80d79e0ad3026345995530aae9b6b | /src/main/java/com/locus/demo/util/IntervalCalculator.java | 28c14cffc31cfd1e8eb35162083e3efb2f74bacc | [] | no_license | sanjairocky/LocationSimulator | 54a868dfe24ba5da8833ea775004ba898fea0aaa | 49b2276cb13fe06e121d1081872e109519337cee | refs/heads/main | 2023-08-02T12:10:02.319240 | 2021-10-10T19:12:49 | 2021-10-10T19:25:36 | 415,677,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,694 | java | package com.locus.demo.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import org.springframework.stereotype.Component;
import com.locus.demo.domain.LatLng;
/**
* @author sanjaikumar.arumugam
*/
@Component
public class IntervalCalculator {
public static final int INTERVAL = 50;
/**
* We need to get the locations on the route such that they are separated by
* INTERVAL = 50m
*
* @param locations
* @return
*/
public List<LatLng> getDesiredLocations(List<LatLng> locations) {
LinkedList<LatLng> desiredLocations = new LinkedList<>();
List<List<LatLng>> pairs = plotCoordinatesRoutes(locations);
for (int i = 0; i < pairs.size(); i++) {
List<LatLng> step = pairs.get(i);
desiredLocations.add(step.get(0));
if (step.size() < 2)
continue;
if (step.size() > INTERVAL && step.size() < 2 * INTERVAL)
desiredLocations.add(step.get(step.size() / 2));
else
for (int j = 1; j < step.size() - 1; j++) {
double distanceTo = step.get(j).distanceTo(desiredLocations.peekLast());
if (!(distanceTo < INTERVAL))
desiredLocations.add(step.get(j));
}
desiredLocations.add(step.get(step.size() - 1));
}
return desiredLocations;
}
/**
* call the consumer for eact pair for coordinates once they are analyzed or
* return final filtered LatLng pairs
*
* @param locations
* @return
*/
public List<List<LatLng>> plotCoordinatesRoutes(List<LatLng> points) {
List<List<LatLng>> steps = new LinkedList<>();
steps.add(Arrays.asList(points.get(0)));
for (int i = 1; i < points.size(); i++) {
if (points.get(i).distanceTo(points.get(i - 1)) <= INTERVAL) {
steps.add(Arrays.asList(points.get(i)));
} else
steps.add(getLocations(1, points.get(i - 1).initialBearingTo(points.get(i)), points.get(i - 1),
points.get(i)));
}
return steps;
}
/**
* returns every coordinate pair in between two coordinate pairs given the
* desired interval
*
* @param interval
* @param azimuth
* @param start
* @param end
* @source https://gis.stackexchange.com/questions/157693/getting-all-vertex-lat-long-coordinates-every-1-meter-between-two-known-points
* @return
*/
private List<LatLng> getLocations(int interval, double azimuth, LatLng start, LatLng end) {
double d = start.distanceTo(end);
int dist = (int) d / interval;
int coveredDist = interval;
List<LatLng> coords = new ArrayList<>();
coords.add(start);
for (int distance = 0; distance < dist; distance += interval) {
coords.add(start.destinationPoint(coveredDist, azimuth));
coveredDist += interval;
}
coords.add(end);
return coords;
}
}
| [
"[email protected]"
] | |
66cd26fd68cb2e55e0a4ab63066b5a15212dc8c2 | 72c83a1ce4b628a2ee8b6eb1d3855ac3cda15e08 | /HomeWork3/Prime.java | 9c3e7229adc60b16eb919c29b809df4638147dd5 | [] | no_license | OleksiiN/Prog.kiev.ua | afdc84cc1d31acc3810cacb6f049e099cc9cfd69 | 4b9eebfc8cca57318a61dadf2fb3a2b6746c9571 | refs/heads/master | 2021-01-10T20:31:52.825127 | 2015-08-18T20:07:42 | 2015-08-18T20:07:42 | 34,371,335 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 541 | java | /**
* Created by Oleksii on 27.04.2015.
*/
public class Prime {
public static void main(String[] args) {
for (int i = 0; i<1000; i++) {
if (isPrime(i) == true)
System.out.println(i+": "+isPrime(i));
}
}
private static boolean isPrime(int a) {
boolean z = false;
if (a <= 1) return false;
for (int i = 2; i < a; i++) {
if (a % i == 0) {
z = false;
break;
} else z = true;
}
return z;
}
} | [
"[email protected]"
] | |
893dbd370e49238b31c790fa6f556c8e2832b503 | 2af9e6a1ffb0e90cd2da48113f553a9a8773b2e6 | /byte-buddy-dep/src/test/java/net/bytebuddy/implementation/bytecode/ByteCodeAppenderSizeTest.java | e92f764351e1071c573c243b73614d68bbfbf7f0 | [
"Apache-2.0"
] | permissive | frank0417/byte-buddy | fae39dbc7cd5e719dec86bc3dfffa3dea5a9e61a | 0f14bb074aff7a3e111a98145bc7c797d4e7e2f2 | refs/heads/master | 2021-05-31T16:14:21.622522 | 2015-12-03T07:51:19 | 2015-12-03T07:51:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,051 | java | package net.bytebuddy.implementation.bytecode;
import net.bytebuddy.test.utility.ObjectPropertyAssertion;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
public class ByteCodeAppenderSizeTest {
private static final int LOWER = 3, BIGGER = 5;
@Test
public void testMerge() throws Exception {
ByteCodeAppender.Size left = new ByteCodeAppender.Size(LOWER, BIGGER);
ByteCodeAppender.Size right = new ByteCodeAppender.Size(BIGGER, LOWER);
ByteCodeAppender.Size mergedLeft = left.merge(right);
ByteCodeAppender.Size mergedRight = right.merge(left);
assertThat(mergedLeft, equalTo(mergedRight));
assertThat(mergedLeft.getOperandStackSize(), is(BIGGER));
assertThat(mergedLeft.getLocalVariableSize(), is(BIGGER));
}
@Test
public void testObjectProperties() throws Exception {
ObjectPropertyAssertion.of(ByteCodeAppender.Size.class).apply();
}
}
| [
"[email protected]"
] | |
fc002c03951807abc85e0f9939ac6861b1dcfe9d | f2d85e3f5d6dcac0a7b18cbfef6d6b7c62ab570a | /rdma-based-storm/external/sql/storm-sql-core/src/test/org/apache/storm/sql/compiler/backends/trident/TestPlanCompiler.java | 9ba726786bc879dacc7f30571f90202acbf35fe2 | [
"Apache-2.0",
"MIT",
"BSD-3-Clause",
"BSD-2-Clause",
"GPL-1.0-or-later"
] | permissive | dke-knu/i2am | 82bb3cf07845819960f1537a18155541a1eb79eb | 0548696b08ef0104b0c4e6dec79c25300639df04 | refs/heads/master | 2023-07-20T01:30:07.029252 | 2023-07-07T02:00:59 | 2023-07-07T02:00:59 | 71,136,202 | 8 | 14 | Apache-2.0 | 2023-07-07T02:00:31 | 2016-10-17T12:29:48 | Java | UTF-8 | Java | false | false | 10,362 | 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
* * <p>
* * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/
package org.apache.storm.sql.compiler.backends.trident;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.apache.calcite.DataContext;
import org.apache.calcite.avatica.util.DateTimeUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.storm.Config;
import org.apache.storm.LocalCluster;
import org.apache.storm.LocalCluster.LocalTopology;
import org.apache.storm.sql.TestUtils;
import org.apache.storm.sql.javac.CompilingClassLoader;
import org.apache.storm.sql.planner.trident.QueryPlanner;
import org.apache.storm.sql.runtime.ISqlTridentDataSource;
import org.apache.storm.sql.AbstractTridentProcessor;
import org.apache.storm.trident.TridentTopology;
import org.apache.storm.tuple.Fields;
import org.apache.storm.tuple.Values;
import org.apache.storm.utils.Utils;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import java.time.ZoneOffset;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import static org.apache.storm.sql.TestUtils.MockState.getCollectedValues;
public class TestPlanCompiler {
private static LocalCluster cluster;
@BeforeClass
public static void staticSetup() throws Exception {
cluster = new LocalCluster();
}
@AfterClass
public static void staticCleanup() {
if (cluster!= null) {
cluster.shutdown();
cluster = null;
}
}
@Before
public void setUp() {
getCollectedValues().clear();
}
@Test
public void testCompile() throws Exception {
final int EXPECTED_VALUE_SIZE = 2;
String sql = "SELECT ID FROM FOO WHERE ID > 2";
TestCompilerUtils.CalciteState state = TestCompilerUtils.sqlOverDummyTable(sql);
final Map<String, ISqlTridentDataSource> data = new HashMap<>();
data.put("FOO", new TestUtils.MockSqlTridentDataSource());
QueryPlanner planner = new QueryPlanner(state.schema());
AbstractTridentProcessor proc = planner.compile(data, sql);
final TridentTopology topo = proc.build();
Fields f = proc.outputStream().getOutputFields();
proc.outputStream().partitionPersist(new TestUtils.MockStateFactory(),
f, new TestUtils.MockStateUpdater(), new Fields());
runTridentTopology(EXPECTED_VALUE_SIZE, proc, topo);
Assert.assertArrayEquals(new Values[] { new Values(3), new Values(4)}, getCollectedValues().toArray());
}
@Test
public void testInsert() throws Exception {
final int EXPECTED_VALUE_SIZE = 1;
String sql = "INSERT INTO BAR SELECT ID, NAME, ADDR FROM FOO WHERE ID > 3";
TestCompilerUtils.CalciteState state = TestCompilerUtils.sqlOverDummyTable(sql);
final Map<String, ISqlTridentDataSource> data = new HashMap<>();
data.put("FOO", new TestUtils.MockSqlTridentDataSource());
data.put("BAR", new TestUtils.MockSqlTridentDataSource());
QueryPlanner planner = new QueryPlanner(state.schema());
AbstractTridentProcessor proc = planner.compile(data, sql);
final TridentTopology topo = proc.build();
runTridentTopology(EXPECTED_VALUE_SIZE, proc, topo);
Assert.assertArrayEquals(new Values[] { new Values(4, "abcde", "y")}, getCollectedValues().toArray());
}
@Test
public void testUdf() throws Exception {
int EXPECTED_VALUE_SIZE = 1;
String sql = "SELECT MYPLUS(ID, 3)" +
"FROM FOO " +
"WHERE ID = 2";
TestCompilerUtils.CalciteState state = TestCompilerUtils.sqlOverDummyTable(sql);
Map<String, ISqlTridentDataSource> data = new HashMap<>();
data.put("FOO", new TestUtils.MockSqlTridentDataSource());
QueryPlanner planner = new QueryPlanner(state.schema());
AbstractTridentProcessor proc = planner.compile(data, sql);
final TridentTopology topo = proc.build();
Fields f = proc.outputStream().getOutputFields();
proc.outputStream().partitionPersist(new TestUtils.MockStateFactory(),
f, new TestUtils.MockStateUpdater(), new Fields());
runTridentTopology(EXPECTED_VALUE_SIZE, proc, topo);
Assert.assertArrayEquals(new Values[] { new Values(5) }, getCollectedValues().toArray());
}
@Test
public void testCaseStatement() throws Exception {
int EXPECTED_VALUE_SIZE = 5;
String sql = "SELECT CASE WHEN NAME IN ('a', 'abc', 'abcde') THEN UPPER('a') " +
"WHEN UPPER(NAME) = 'AB' THEN 'b' ELSE {fn CONCAT(NAME, '#')} END FROM FOO";
TestCompilerUtils.CalciteState state = TestCompilerUtils.sqlOverDummyTable(sql);
final Map<String, ISqlTridentDataSource> data = new HashMap<>();
data.put("FOO", new TestUtils.MockSqlTridentDataSource());
QueryPlanner planner = new QueryPlanner(state.schema());
AbstractTridentProcessor proc = planner.compile(data, sql);
final TridentTopology topo = proc.build();
Fields f = proc.outputStream().getOutputFields();
proc.outputStream().partitionPersist(new TestUtils.MockStateFactory(), f, new TestUtils.MockStateUpdater(), new Fields());
runTridentTopology(EXPECTED_VALUE_SIZE, proc, topo);
Assert.assertArrayEquals(new Values[]{new Values("A"), new Values("b"), new Values("A"), new Values("abcd#"), new Values("A")}, getCollectedValues().toArray());
}
@Test
public void testNested() throws Exception {
int EXPECTED_VALUE_SIZE = 1;
String sql = "SELECT ID, MAPFIELD['c'], NESTEDMAPFIELD, ARRAYFIELD " +
"FROM FOO " +
"WHERE NESTEDMAPFIELD['a']['b'] = 2 AND ARRAYFIELD[2] = 200";
TestCompilerUtils.CalciteState state = TestCompilerUtils.sqlOverNestedTable(sql);
final Map<String, ISqlTridentDataSource> data = new HashMap<>();
data.put("FOO", new TestUtils.MockSqlTridentNestedDataSource());
QueryPlanner planner = new QueryPlanner(state.schema());
AbstractTridentProcessor proc = planner.compile(data, sql);
final TridentTopology topo = proc.build();
Fields f = proc.outputStream().getOutputFields();
proc.outputStream().partitionPersist(new TestUtils.MockStateFactory(), f, new TestUtils.MockStateUpdater(), new Fields());
runTridentTopology(EXPECTED_VALUE_SIZE, proc, topo);
Map<String, Integer> map = ImmutableMap.of("b", 2, "c", 4);
Map<String, Map<String, Integer>> nestedMap = ImmutableMap.of("a", map);
Assert.assertArrayEquals(new Values[]{new Values(2, 4, nestedMap, Arrays.asList(100, 200, 300))}, getCollectedValues().toArray());
}
@Test
public void testDateKeywords() throws Exception {
int EXPECTED_VALUE_SIZE = 1;
String sql = "SELECT " +
"LOCALTIME, CURRENT_TIME, LOCALTIMESTAMP, CURRENT_TIMESTAMP, CURRENT_DATE " +
"FROM FOO " +
"WHERE ID > 0 AND ID < 2";
TestCompilerUtils.CalciteState state = TestCompilerUtils.sqlOverDummyTable(sql);
final Map<String, ISqlTridentDataSource> data = new HashMap<>();
data.put("FOO", new TestUtils.MockSqlTridentDataSource());
QueryPlanner planner = new QueryPlanner(state.schema());
AbstractTridentProcessor proc = planner.compile(data, sql);
final DataContext dataContext = proc.getDataContext();
final TridentTopology topo = proc.build();
Fields f = proc.outputStream().getOutputFields();
proc.outputStream().partitionPersist(new TestUtils.MockStateFactory(), f, new TestUtils.MockStateUpdater(), new Fields());
runTridentTopology(EXPECTED_VALUE_SIZE, proc, topo);
long utcTimestamp = (long) dataContext.get(DataContext.Variable.UTC_TIMESTAMP.camelName);
long currentTimestamp = (long) dataContext.get(DataContext.Variable.CURRENT_TIMESTAMP.camelName);
long localTimestamp = (long) dataContext.get(DataContext.Variable.LOCAL_TIMESTAMP.camelName);
System.out.println(getCollectedValues());
java.sql.Timestamp timestamp = new java.sql.Timestamp(utcTimestamp);
int dateInt = (int) timestamp.toLocalDateTime().atOffset(ZoneOffset.UTC).toLocalDate().toEpochDay();
int localTimeInt = (int) (localTimestamp % DateTimeUtils.MILLIS_PER_DAY);
int currentTimeInt = (int) (currentTimestamp % DateTimeUtils.MILLIS_PER_DAY);
Assert.assertArrayEquals(new Values[]{new Values(localTimeInt, currentTimeInt, localTimestamp, currentTimestamp, dateInt)}, getCollectedValues().toArray());
}
private void runTridentTopology(final int expectedValueSize, AbstractTridentProcessor proc,
TridentTopology topo) throws Exception {
final Config conf = new Config();
conf.setMaxSpoutPending(20);
if (proc.getClassLoaders() != null && proc.getClassLoaders().size() > 0) {
CompilingClassLoader lastClassloader = proc.getClassLoaders().get(proc.getClassLoaders().size() - 1);
Utils.setClassLoaderForJavaDeSerialize(lastClassloader);
}
try (LocalTopology stormTopo = cluster.submitTopology("storm-sql", conf, topo.build())) {
waitForCompletion(1000 * 1000, new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return getCollectedValues().size() < expectedValueSize;
}
});
} finally {
while(cluster.getClusterInfo().get_topologies_size() > 0) {
Thread.sleep(10);
}
Utils.resetClassLoaderForJavaDeSerialize();
}
}
private void waitForCompletion(long timeout, Callable<Boolean> cond) throws Exception {
long start = TestUtils.monotonicNow();
while (TestUtils.monotonicNow() - start < timeout && cond.call()) {
Thread.sleep(100);
}
}
} | [
"[email protected]"
] | |
eb1ba1bb95cdd645c43584acf2198484e8aef761 | f5afb5b12d162149d6b2723d4d0c3c52b1490e65 | /Erpoge Server/src/erpoge/core/meta/Direction.java | 6430ef5d91b7fe93e6f43d57c50d42edcaf8b43a | [] | no_license | Cookson/Ten-Thousand-Journeys | f6195c0acdab06a8641fbd045e2219f5872edd57 | 18c6bf94e37f01e0c4fc8e5e96bccf72f4a1a13d | refs/heads/master | 2021-01-13T02:23:56.829317 | 2013-01-16T09:38:03 | 2013-01-16T09:38:03 | 2,905,119 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 515 | java | package erpoge.core.meta;
/**
* Enum for representing horizontal or vertical direction
*/
public enum Direction {
H,V;
public Direction reverted() {
/**
* Return perpendicular direction
*/
if (this == H) {
return V;
} else {
return H;
}
}
public boolean isH() {
return this == H;
}
public boolean isV() {
return this == V;
}
public static Direction bool2dir(boolean bool) {
/**
* Returns Direction.V if bool == true, otherwise returns Direction.H.
*/
return bool ? V : H;
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.