blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
760c4fe006978871e68aec76b3698ec3235c3697 | d4a1ffa60a91605d80af211c9583a0b6ffee452f | /app/src/main/java/com/carbonmade/corybsa/kwadspots/ui/main/profile/ProfileContract.java | 9e4359a1775ef5f8bd299c73f38d7c6a814b01bb | [] | no_license | corybsa/KwadSpots-Android | 9b77105dab0fde2b0bfde7c3c8280a07bf775210 | b3956f30b096547f068b70d1eef2abfd732ee427 | refs/heads/master | 2020-07-04T21:02:12.994155 | 2018-06-28T20:56:13 | 2018-06-28T20:56:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package com.carbonmade.corybsa.kwadspots.ui.main.profile;
import com.carbonmade.corybsa.kwadspots.ui.BasePresenter;
import com.carbonmade.corybsa.kwadspots.ui.BaseView;
interface ProfileContract {
interface View extends BaseView<Presenter> {
}
interface Presenter extends BasePresenter<View> {
}
}
| [
"corybsa@gmail.com"
] | corybsa@gmail.com |
7f0406f1dd91d7925b3c419531c4c88c91780ec2 | ac336162e6b16cdfa5caae80078584393292cdf5 | /app/src/release/java/eu/fiskur/daggerexample/Modules.java | 3a0bbbdeda9c6a7c3e30ae292009d89d28cb78b4 | [] | no_license | Degree53/AndroidDaggerExample | f74b506f35fc78f377bc25b6388aa0465e03e43c | 1eb4c0cbfa9ea46ca4f71447746b2c727d2e9d5b | refs/heads/master | 2016-09-06T19:30:10.339223 | 2015-03-26T08:54:58 | 2015-03-26T08:54:58 | 29,251,910 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package eu.fiskur.daggerexample;
/**
* Created by jonathan.fisher on 13/01/2015.
*/
final class Modules {
static Object[] list(DaggerExampleApp app) {
return new Object[] {
new DaggerExampleModule(app)
};
}
private Modules() {
}
}
| [
"jonathan@fiskur.eu"
] | jonathan@fiskur.eu |
2430b29c4b09d592ab979313bb85d7a7377e42e4 | b8cfed2c24215324cbbf72673b0b4cc739f01289 | /javac-plugin/src/test/java/org/moditect/deptective/plugintest/basic/barstaticfield/BarStaticField.java | 41f854be66c4e003280e0d45f3d57516ad25e665 | [
"Apache-2.0"
] | permissive | wuetherich/deptective | e55c4a2ae6e40244cfe3c0a041ace44f9d3650a1 | 91c89d49ab4d5c695c719f0b07671aba3e315df9 | refs/heads/master | 2020-04-16T08:37:54.275822 | 2019-01-19T19:28:13 | 2019-01-19T19:28:13 | 165,431,883 | 0 | 0 | Apache-2.0 | 2019-01-12T20:16:41 | 2019-01-12T20:16:41 | null | UTF-8 | Java | false | false | 766 | java | /**
* Copyright 2019 The ModiTect authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.moditect.deptective.plugintest.basic.barstaticfield;
public class BarStaticField {
public static String BAR_STATIC = "barStatic";
}
| [
"gunnar.morling@googlemail.com"
] | gunnar.morling@googlemail.com |
1fb0d09a9fcab744eec798a5e936ea03502e0e53 | 791697e42f2ccf9b70c7cd4fd7f79a608037d69a | /src/SudokuSolver/ReadSolution.java | 729771b8d259d2fe7b8a9b80320afeee00919a60 | [] | no_license | scdroske/Sudoku | 0de2e8000efd9d4e54cceac459a35cccd35327dd | 28c403615b5aecbef70692d7707ae61542cbc15e | refs/heads/master | 2020-04-10T19:29:16.195477 | 2018-12-11T04:59:13 | 2018-12-11T04:59:13 | 161,236,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,030 | java | package SudokuSolver;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.NoSuchElementException;
import java.util.Scanner;
public class ReadSolution {
private Scanner scanner;
private String file = "C:\\Users\\scdro\\OneDrive\\Desktop\\CS5700\\Sudoku\\Solutions\\Puzzle-9x9-0001.txt";
//private String file = "C:\\Users\\scdro\\OneDrive\\Desktop\\CS5700\\Sudoku\\Solutions\\Puzzle-4x4-0001.txt";
protected String[] contents; //contains everything in file
public int size; //contains the size of the array
public int length; //contains the length of the array to check that length = size
public int[][] solvedSudokuBoard; //contains the initial board
public int[] variables; //contains the variables to use
public ReadSolution(){
openFile();
readFile();
}
public void openFile() {
try {
Scanner scanner;
scanner = new Scanner(new File(file));
this.scanner = scanner;
} catch (Exception e) {
System.out.println("Cannot Find File");
}
}
public void readFile() {
//count how many lines are in file
//create array and copy elements in
try {
int counter = 0;
Scanner readinPuzzle = new Scanner(new File(file));
try {
while (readinPuzzle.hasNext()) {
/**
* establishes the size of the board to be made
*/
if (counter == 0) {
int size;
size = readinPuzzle.nextInt();
// System.out.print(size + "\n");
this.size = size;
counter++;
continue;
}
if (counter > 0) {
int[][] sudokuboard = new int[size][size];
for (int x = 0; x < size; x++) {
for (int y = 0; y < size; y++) {
sudokuboard[x][y] = readinPuzzle.nextInt();
}
}
for (int x = 0; x < size; x++) {
for (int y = 0; y < size; y++) {
//System.out.println(sudokuboard[x][y]);
}
// System.out.println("\n");
}
this.solvedSudokuBoard = sudokuboard;
}
else
continue;
//counter++;
//readinPuzzle.next();
}
//System.out.println(counter);
}
catch(NoSuchElementException e){
System.out.println("Mismatched element");
}
} catch (FileNotFoundException e) {
System.out.println("Cannot read file");
}
}
}
| [
"scdroske@aggiemail.usu.edu"
] | scdroske@aggiemail.usu.edu |
f2aa7da4e1188b05117bab5d1dd1adcf4578a5fa | b170f742c985c91753bce1d8215ba6beaa215648 | /src/main/java/demo/model/dto/BaseReqDto.java | d283e170433e9c08dc8f511a133f07fc5016ac8c | [] | no_license | supercjy009/OAWeb | 8e562dcf22427c0a50dbbe496962a57f8f6da897 | d8f4534f2bf58c53047e000b9f41e2a923b3ebea | refs/heads/master | 2020-03-23T03:00:27.395548 | 2019-03-07T02:41:11 | 2019-03-07T02:41:11 | 141,004,111 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package demo.model.dto;
public class BaseReqDto {
private Long uid;
private Boolean seeAll;
public Long getUid() {
return uid;
}
public void setUid(Long uid) {
this.uid = uid;
}
public Boolean getSeeAll() {
return seeAll;
}
public void setSeeAll(Boolean seeAll) {
this.seeAll = seeAll;
}
}
| [
"www.913043770@qq.com"
] | www.913043770@qq.com |
3780d85561a60bf75579ee3ba2a7bf88b16a05c9 | 14956dbed8ae4fba1d65b9829d9405fcf43ac698 | /Cyber Security/Capture the Flag Competitions/2020/Houseplant CTF 2020/Reversing/RTCP Trivia/client_source_from_JADX/sources/p000/C0345fn.java | 6dac80fcad5634cd814f3f87c3629f937bce209d | [] | no_license | Hackin7/Programming-Crappy-Solutions | ae8bbddad92a48cf70976cec91bf66234c9b4d39 | ffa3b3c26a6a06446cc49c8ac4f35b6d30b1ee0f | refs/heads/master | 2023-03-21T01:21:00.764957 | 2022-12-28T14:22:33 | 2022-12-28T14:22:33 | 201,292,128 | 12 | 7 | null | 2023-03-05T16:05:34 | 2019-08-08T16:00:21 | Roff | UTF-8 | Java | false | false | 5,895 | java | package p000;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.util.AttributeSet;
import android.util.Log;
import java.lang.reflect.Method;
import org.xmlpull.v1.XmlPullParser;
/* renamed from: fn */
public final class C0345fn {
/* renamed from: a */
private static Method f1634a;
/* renamed from: b */
private static boolean f1635b;
/* renamed from: c */
private static Method f1636c;
/* renamed from: d */
private static boolean f1637d;
/* renamed from: a */
public static void m1144a(Drawable drawable, float f, float f2) {
if (VERSION.SDK_INT >= 21) {
drawable.setHotspot(f, f2);
}
}
/* renamed from: a */
public static void m1145a(Drawable drawable, int i) {
if (VERSION.SDK_INT >= 21) {
drawable.setTint(i);
return;
}
if (drawable instanceof C0346fo) {
((C0346fo) drawable).setTint(i);
}
}
/* renamed from: a */
public static void m1146a(Drawable drawable, int i, int i2, int i3, int i4) {
if (VERSION.SDK_INT >= 21) {
drawable.setHotspotBounds(i, i2, i3, i4);
}
}
/* renamed from: a */
public static void m1147a(Drawable drawable, ColorStateList colorStateList) {
if (VERSION.SDK_INT >= 21) {
drawable.setTintList(colorStateList);
return;
}
if (drawable instanceof C0346fo) {
((C0346fo) drawable).setTintList(colorStateList);
}
}
/* renamed from: a */
public static void m1148a(Drawable drawable, Theme theme) {
if (VERSION.SDK_INT >= 21) {
drawable.applyTheme(theme);
}
}
/* renamed from: a */
public static void m1149a(Drawable drawable, Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Theme theme) {
if (VERSION.SDK_INT >= 21) {
drawable.inflate(resources, xmlPullParser, attributeSet, theme);
} else {
drawable.inflate(resources, xmlPullParser, attributeSet);
}
}
/* renamed from: a */
public static void m1150a(Drawable drawable, Mode mode) {
if (VERSION.SDK_INT >= 21) {
drawable.setTintMode(mode);
return;
}
if (drawable instanceof C0346fo) {
((C0346fo) drawable).setTintMode(mode);
}
}
/* renamed from: a */
public static void m1151a(Drawable drawable, boolean z) {
if (VERSION.SDK_INT >= 19) {
drawable.setAutoMirrored(z);
}
}
/* renamed from: a */
public static boolean m1152a(Drawable drawable) {
if (VERSION.SDK_INT >= 19) {
return drawable.isAutoMirrored();
}
return false;
}
/* renamed from: b */
public static int m1153b(Drawable drawable) {
if (VERSION.SDK_INT >= 19) {
return drawable.getAlpha();
}
return 0;
}
/* renamed from: b */
public static boolean m1154b(Drawable drawable, int i) {
if (VERSION.SDK_INT >= 23) {
return drawable.setLayoutDirection(i);
}
if (VERSION.SDK_INT >= 17) {
if (!f1635b) {
try {
Method declaredMethod = Drawable.class.getDeclaredMethod("setLayoutDirection", new Class[]{Integer.TYPE});
f1634a = declaredMethod;
declaredMethod.setAccessible(true);
} catch (NoSuchMethodException e) {
Log.i("DrawableCompat", "Failed to retrieve setLayoutDirection(int) method", e);
}
f1635b = true;
}
if (f1634a != null) {
try {
f1634a.invoke(drawable, new Object[]{Integer.valueOf(i)});
return true;
} catch (Exception e2) {
Log.i("DrawableCompat", "Failed to invoke setLayoutDirection(int) via reflection", e2);
f1634a = null;
}
}
}
return false;
}
/* renamed from: c */
public static boolean m1155c(Drawable drawable) {
if (VERSION.SDK_INT >= 21) {
return drawable.canApplyTheme();
}
return false;
}
/* renamed from: d */
public static Drawable m1156d(Drawable drawable) {
return VERSION.SDK_INT >= 23 ? drawable : VERSION.SDK_INT >= 21 ? !(drawable instanceof C0346fo) ? new C0351fr(drawable) : drawable : !(drawable instanceof C0346fo) ? new C0348fq(drawable) : drawable;
}
/* renamed from: e */
public static int m1157e(Drawable drawable) {
if (VERSION.SDK_INT >= 23) {
return drawable.getLayoutDirection();
}
if (VERSION.SDK_INT >= 17) {
if (!f1637d) {
try {
Method declaredMethod = Drawable.class.getDeclaredMethod("getLayoutDirection", new Class[0]);
f1636c = declaredMethod;
declaredMethod.setAccessible(true);
} catch (NoSuchMethodException e) {
Log.i("DrawableCompat", "Failed to retrieve getLayoutDirection() method", e);
}
f1637d = true;
}
if (f1636c != null) {
try {
return ((Integer) f1636c.invoke(drawable, new Object[0])).intValue();
} catch (Exception e2) {
Log.i("DrawableCompat", "Failed to invoke getLayoutDirection() via reflection", e2);
f1636c = null;
}
}
}
return 0;
}
}
| [
"zunmun@gmail.com"
] | zunmun@gmail.com |
aa1a94ecf5cdf8d600fa3abd4037f03a195516a5 | 8db4df8a2053d868bcdc380729429d3616bebf16 | /src/main/java/com/mycompany/maprpractice/Reducer/WordCountReducer.java | 4016666f974a458d175ac8828cc79faca90d1b6e | [] | no_license | priyamdixitv2/MapRPractice | 193975daed92b9c14503ceea1209ad9bbc187609 | 0da3bd99dc9fdba9a60231abb4c5fd435a5e90bc | refs/heads/master | 2021-01-22T10:56:47.487756 | 2017-02-15T06:26:17 | 2017-02-15T06:26:17 | 82,055,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 899 | 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.mycompany.maprpractice.Reducer;
import com.mycompany.maprpractice.runnerClass.*;
/**
*
* @author QAI
*/
import java.io.IOException;
import java.util.Iterator;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
public class WordCountReducer extends Reducer<Text, IntWritable, Text, IntWritable>{
@Override
protected void reduce(Text key, Iterable<IntWritable> values,
Context context)
throws IOException, InterruptedException {
int sum = 0;
Iterator<IntWritable> valuesIt = values.iterator();
while(valuesIt.hasNext()){
sum = sum + valuesIt.next().get();
}
context.write(key, new IntWritable(sum));
}
} | [
"priyamdixit@qainfotech.net"
] | priyamdixit@qainfotech.net |
481574cef2312a79471e54845742c6a597045b40 | 0155d3c448a69c23180e211b9ad3de7b760197b6 | /usuario/src/main/java/pe/edu/unp/poc/microservices/usuario/controller/UsuarioController.java | f377a32cb0c61a040ff7046a4b20b5d711446817 | [] | no_license | hugoangeles0810/cloud-microservices-poc | 2642679d6b7cd976ba065f73111a34289e7c2a18 | 04122a9fdace5773a72afe409720c2b8179ffb94 | refs/heads/master | 2023-01-14T22:46:34.556281 | 2020-11-28T22:20:22 | 2020-11-28T22:20:22 | 316,393,309 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package pe.edu.unp.poc.microservices.usuario.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pe.edu.unp.poc.microservices.usuario.bean.User;
import pe.edu.unp.poc.microservices.usuario.service.UsuarioService;
@RestController
@RequestMapping("/usuario")
public class UsuarioController {
@Autowired
private UsuarioService service;
@GetMapping("/username/${name}")
public User getUserByUsername(@RequestParam("name") String username) {
return this.service.getUser(username);
}
}
| [
"josemaria1036@gmail.com"
] | josemaria1036@gmail.com |
a6150717bc02a43ea527e451b2e64a749b9723a6 | 0f58b692991e9488218f89fc38c0e11f49044ddf | /src/main/java/ro/fasttrackit/curs12/course/service/controller/CourseController.java | 3d58af73d4a28ffe3aec86663b8a19d799c4be94 | [] | no_license | markvaradi94/fullstack-curs12-course-service | e3de50fc123befa8e11d7f7c7738d3c73b1bbc34 | aebb51498990e83b3b93611e5c2663b829f4a36c | refs/heads/master | 2023-05-15T02:00:32.074035 | 2021-06-06T17:27:28 | 2021-06-06T17:27:28 | 374,422,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,008 | java | package ro.fasttrackit.curs12.course.service.controller;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import ro.fasttrackit.curs12.course.service.model.api.Course;
import ro.fasttrackit.curs12.course.service.service.CourseService;
import javax.validation.Valid;
import java.util.List;
@RestController
@RequestMapping("courses")
@RequiredArgsConstructor
public class CourseController {
private final CourseService service;
@GetMapping
public List<Course> findAllCourses() {
return service.findAllCourses();
}
@GetMapping("{courseId}")
public Course findCourse(@PathVariable String courseId) {
return service.findCourse(courseId);
}
@PostMapping
public Course addCourse(@Valid @RequestBody Course course) {
return service.addCourse(course);
}
@DeleteMapping("{courseId}")
public Course deleteCourse(@PathVariable String courseId) {
return service.deleteCourse(courseId);
}
}
| [
"mark.varadi03@gmail.com"
] | mark.varadi03@gmail.com |
4bded91b49b3e4aeb94b883a7df353420ae767a7 | 103c07cf5529b63f86730a1e9f7ff014733211b5 | /ProjetoTriangulo/src/classes/telaTriangulo.java | 4a85e1d52f29927b04181576031563260593b154 | [
"MIT"
] | permissive | RonaldoBilhar/Estudos-em-Java | a066565f9090021e5923fb4f8e92f6ecf6ce4b87 | 6c4f5922a87bb95e47a9a78b5d0c762bc46b5583 | refs/heads/main | 2023-02-13T07:01:36.760432 | 2021-01-08T05:04:08 | 2021-01-08T05:04:08 | 327,803,939 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,082 | 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 classes;
/**
*
* @author ronaldo_bilhar
*/
public class telaTriangulo extends javax.swing.JFrame {
/**
* Creates new form telaTriangulo
*/
public telaTriangulo() {
initComponents();
panResposta.setVisible(false);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
sliA = new javax.swing.JSlider();
sliB = new javax.swing.JSlider();
sliC = new javax.swing.JSlider();
lblA = new javax.swing.JLabel();
lblB = new javax.swing.JLabel();
lblC = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
panResposta = new javax.swing.JPanel();
lblStatus = new javax.swing.JLabel();
lblTipo = new javax.swing.JLabel();
btnVerificar = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel1.setText("Segmento a");
jLabel2.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel2.setText("Segmento b");
jLabel3.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel3.setText("Segmento c");
sliA.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
sliA.setMaximum(20);
sliA.setValue(0);
sliA.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
sliAStateChanged(evt);
}
});
sliB.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
sliB.setMaximum(20);
sliB.setValue(0);
sliB.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
sliBStateChanged(evt);
}
});
sliC.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
sliC.setMaximum(20);
sliC.setValue(0);
sliC.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
sliCStateChanged(evt);
}
});
lblA.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
lblA.setText("0");
lblB.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
lblB.setText("0");
lblC.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
lblC.setText("0");
jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/medidas-do-triangulo.png"))); // NOI18N
lblStatus.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
lblStatus.setForeground(new java.awt.Color(51, 51, 255));
lblStatus.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lblStatus.setText("jLabel9");
lblTipo.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
lblTipo.setForeground(new java.awt.Color(255, 51, 51));
lblTipo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
lblTipo.setText("jLabel10");
javax.swing.GroupLayout panRespostaLayout = new javax.swing.GroupLayout(panResposta);
panResposta.setLayout(panRespostaLayout);
panRespostaLayout.setHorizontalGroup(
panRespostaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panRespostaLayout.createSequentialGroup()
.addContainerGap()
.addGroup(panRespostaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblTipo, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE))
.addContainerGap())
);
panRespostaLayout.setVerticalGroup(
panRespostaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panRespostaLayout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(lblStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(lblTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(44, Short.MAX_VALUE))
);
btnVerificar.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
btnVerificar.setText("Verificar");
btnVerificar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnVerificarActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(sliB, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(sliA, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sliC, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(btnVerificar, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblA)
.addComponent(lblC)
.addComponent(lblB))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7)
.addGap(15, 15, 15))
.addGroup(layout.createSequentialGroup()
.addGap(60, 60, 60)
.addComponent(panResposta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel8)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(sliA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblA))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(sliB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblB))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(lblC)
.addComponent(sliC, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))))
.addGap(10, 10, 10)
.addComponent(btnVerificar, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(panResposta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(27, 27, 27))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnVerificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerificarActionPerformed
// TODO add your handling code here:
int a = sliA.getValue();
int b = sliB.getValue();
int c = sliC.getValue();
if (a < b + c && b < a + c && c < a + b) {
lblStatus.setText("Formam um Triângulo");
if (a == b && b == c) {
lblTipo.setText("Triângulo Equilátero");
} else if (a != b && b != c && a != c) {
lblTipo.setText("Triângulo Escaleno");
} else {
lblTipo.setText("Triângulo Isósceles");
}
} else {
lblStatus.setText("Não formam um Triângulo");
lblTipo.setText("_ _ _ _");
}
panResposta.setVisible(true);
}//GEN-LAST:event_btnVerificarActionPerformed
private void sliAStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sliAStateChanged
// TODO add your handling code here:
lblA.setText(Integer.toString(sliA.getValue()));
}//GEN-LAST:event_sliAStateChanged
private void sliBStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sliBStateChanged
// TODO add your handling code here:
lblB.setText(Integer.toString(sliB.getValue()));
}//GEN-LAST:event_sliBStateChanged
private void sliCStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sliCStateChanged
// TODO add your handling code here:
lblC.setText(Integer.toString(sliC.getValue()));
}//GEN-LAST:event_sliCStateChanged
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(telaTriangulo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(telaTriangulo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(telaTriangulo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(telaTriangulo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new telaTriangulo().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnVerificar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel lblA;
private javax.swing.JLabel lblB;
private javax.swing.JLabel lblC;
private javax.swing.JLabel lblStatus;
private javax.swing.JLabel lblTipo;
private javax.swing.JPanel panResposta;
private javax.swing.JSlider sliA;
private javax.swing.JSlider sliB;
private javax.swing.JSlider sliC;
// End of variables declaration//GEN-END:variables
}
| [
"ronaldo_bilhar@hotmail.com"
] | ronaldo_bilhar@hotmail.com |
5c6d1914322b57f0584cc061f73db05cf47553d1 | a9f269ac1be36d70a8b8bb9f03d294e6b258c71c | /02-java-oop/06-object-master-p2/Wizard.java | 81e37f7be376be10de637652b198cb0fe1196b50 | [] | no_license | java-august-2021/JamesS-Assignments | ca3be09f4dea4702225ba86deecd20630cf26e27 | de97dd16101a2b9230ee3edde71cd9ef5ce6328b | refs/heads/master | 2023-07-31T16:21:09.398746 | 2021-09-17T04:37:26 | 2021-09-17T04:37:26 | 392,764,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 522 | java | public class Wizard extends Human{
public Wizard(String wizardName){
super(wizardName, 3, 8, 3, 50);
}
public void heal(Human target){
int healAmount = this.getIntelligence();
int newHealth = target.getHealth() + healAmount;
target.setHealth(newHealth);
}
public void fireball(Human target){
int attackAmount = this.getIntelligence() * 3;
int newHealth = target.getHealth() - attackAmount;
target.setHealth(newHealth);
}
}
| [
"81770949+jamesgabbie@users.noreply.github.com"
] | 81770949+jamesgabbie@users.noreply.github.com |
dc9cce298156d76475bee44f6da751aba1e7dd3a | a7d92fa6e7538c265c1677639cd2f07080d262bc | /src/com/company/service/ConversionUtils.java | 07807500f9547769752ba167dc7b027dddcae3e5 | [] | no_license | enesuzana/JavaDevBootcamp2018 | 84eae44a909db726fac143dffce1ae183525a054 | c81c0a2d946f2346c54bb3bb5fb565e39d7e71b8 | refs/heads/master | 2020-03-11T15:18:57.821008 | 2018-04-24T15:48:12 | 2018-04-24T15:48:12 | 130,080,635 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 960 | java | package com.company.service;
import com.company.vehicle.Bus;
import com.company.vehicle.Car;
import com.company.vehicle.Tipper;
import com.company.vehicle.Vehicle;
final class ConversionUtils {
private ConversionUtils() {
}
static Vehicle getVehicle(String vehicleName, int age, long numberOfMiles, boolean isDiesel) {
final String carClassName = Car.class.getSimpleName().toUpperCase();
final String busClassName = Bus.class.getSimpleName().toUpperCase();
final String tipperClassName = Tipper.class.getSimpleName().toUpperCase();
if (vehicleName.equals(carClassName)) {
return new Car(age, numberOfMiles, isDiesel);
}
if (vehicleName.equals(busClassName)) {
return new Bus(age, numberOfMiles, isDiesel);
}
if (vehicleName.equals(tipperClassName)) {
return new Tipper(age, numberOfMiles, isDiesel);
}
return null;
}
} | [
"suzana_ene@yahoo.com"
] | suzana_ene@yahoo.com |
cc8e5e71f318baf77471c27b0282a65b50fb4545 | 4e75a27310d8eaabee5bf460d8fe8184db4af8f8 | /LinkedList/[Leetcode] 25. Reverse Nodes in k-Group/test25/src/main/java/lzhou/programmingtest/leetcode/test25/ListNode.java | 6dc33df32fe7f93441dcce19e8607981336e108c | [] | no_license | lingyanzhou/Programming-Tests | 01e32b7d7930020b68b3e160ec704de30557a574 | cb732360095e476728c20b2f1314de92c7bac057 | refs/heads/master | 2021-01-11T19:44:44.459171 | 2017-07-10T00:06:22 | 2017-07-10T00:06:22 | 79,385,967 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package lzhou.programmingtest.leetcode.test25;
public class ListNode {
public int val;
public ListNode next;
public ListNode(int x) { val = x; }
}
| [
"zhoulingyan19900228@gmail.com"
] | zhoulingyan19900228@gmail.com |
2cf10b2b4c87a29930490129d05867514f4f1def | 9de053c703eec59eb3d2e786fec40a124dfc04fe | /app/src/main/java/com/zwstudio/logicpuzzlesandroid/puzzles/nurikabe/domain/NurikabeHintObject.java | cb0479abe0783e7bb5e6764525b33c773bff05f7 | [] | no_license | iamrahulyadav/LogicPuzzlesAndroid | a288fda6384b6527cc403619476aaff4fb6aed0b | ce88371561e1dd89b1360c6d98efbe7ec75baf10 | refs/heads/master | 2020-03-27T18:39:02.133516 | 2018-08-23T15:56:25 | 2018-08-23T15:56:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 300 | java | package com.zwstudio.logicpuzzlesandroid.puzzles.nurikabe.domain;
import com.zwstudio.logicpuzzlesandroid.home.domain.HintState;
public class NurikabeHintObject extends NurikabeObject {
public HintState state = HintState.Normal;
public String objAsString() {
return "hint";
}
}
| [
"zwvista@msn.com"
] | zwvista@msn.com |
fb7acae1b0140bfa2c1d6e06c3c48abdf3bca2f8 | 679a0d0f16eb2647f755b7f01245402f7713e885 | /src/main/java/Direction.java | c8028def54467135484f91483c6d2df06b637905 | [] | no_license | tavisca-akhatri/MarsRover | 4cd4dc3afcaca7e1a60bc4c5dd40bc86d9fa1a53 | 24f884500cb3d3d2b9c043b6ae10b5e8c99d45fa | refs/heads/master | 2020-06-26T02:01:50.250269 | 2019-08-13T11:43:45 | 2019-08-13T11:43:45 | 199,491,776 | 0 | 0 | null | 2019-08-19T07:05:13 | 2019-07-29T16:46:18 | Java | UTF-8 | Java | false | false | 221 | java | //direction.move(currentvector)
public interface Direction
{
//public TwoDVector move(TwoDVector v);
public Vector move(Vector v);
public Vector turnLeft(Vector v);
public Vector turnRight(Vector v);
}
| [
"akhatri@tavisca.com"
] | akhatri@tavisca.com |
289dbc659b12f7574b40b90c2b8ff9035dbc4233 | caadc8d1b42ddccfa2049863f1865af5ef2a8612 | /src/com/akash/sorting/algo/CountingSort.java | c5999f6dea5870930876a7fc6796bda6398ffd9b | [] | no_license | akash-sharma/DataStructure | e1b958028f150bb19e3b47e9526b088eefd30ece | 625ad67c2b6c945fec28736b74ee174d89310a99 | refs/heads/master | 2021-11-21T04:47:54.596470 | 2021-08-05T08:43:11 | 2021-08-05T08:43:11 | 23,738,868 | 0 | 2 | null | 2020-10-12T22:54:14 | 2014-09-06T16:18:49 | Java | UTF-8 | Java | false | false | 1,111 | java | package com.akash.sorting.algo;
import java.util.Arrays;
public class CountingSort {
public static void main(String args[]) {
CountingSort cs = new CountingSort();
int arrA[] = new int[] { 2, 5, 3, 1, 2, 3, 1, 3 };
int arrB[] = new int[arrA.length];
cs.countSort(arrA, arrB, 6);
System.out.println(Arrays.toString(arrB));
}
// Considering that arrC will include numbers from 0 to k-1
public void countSort(int arrA[], int arrB[], int k) {
int arrC[] = new int[k];
for (int i = 0; i < arrA.length; i++) {
arrC[arrA[i]]++;
}
for (int i = 1; i < arrC.length; i++) {
arrC[i] = arrC[i] + arrC[i - 1];
}
for (int i = arrB.length - 1; i >= 0; i--) {
arrB[arrC[arrA[i]] - 1] = arrA[i];
arrC[arrA[i]]--;
}
}
}
/*
(1)NOTE : It is a stable sort.
(2)
value at C[i] denotes total no. of elements less than equal to i .
eg:
C[2] = 4 , there are 4 elements between 0 and 2 .
(3)
Some algorithms share an interesting property: the sorted order they determine
is based only on comparisons between the input elements. We call such sorting
algorithms comparison sorts.
*/
| [
"akash777.sharma@gmail.com"
] | akash777.sharma@gmail.com |
56472427143fd7095c579a9cb36bff5ad2959342 | 67f637c569c8ba680eabf52892524ba1640e109f | /src/main/java/com/example/demo/c04cinema/c04cinema/c04cinema/promotion_customer/generated/GeneratedPromotionCustomerController.java | 60f8f483875ccea72320971118dfee53cb75ef86 | [] | no_license | c0420g1/c04cinema_backend | 707b0d74136a33c80568f5878c27574b67715767 | 28980f0e0ef4b99b04ce6028a423111d7ade446a | refs/heads/develop | 2023-01-21T06:12:21.157775 | 2020-12-07T16:19:15 | 2020-12-07T16:19:15 | 306,291,851 | 0 | 0 | null | 2020-11-02T06:41:08 | 2020-10-22T09:46:25 | Java | UTF-8 | Java | false | false | 17,519 | java | package com.example.demo.c04cinema.c04cinema.c04cinema.promotion_customer.generated;
import com.example.demo.c04cinema.c04cinema.c04cinema.promotion_customer.PromotionCustomer;
import com.example.demo.c04cinema.c04cinema.c04cinema.promotion_customer.PromotionCustomerManager;
import com.example.demo.c04cinema.c04cinema.c04cinema.promotion_customer.generated.GeneratedPromotionCustomer.Identifier;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.speedment.common.annotation.GeneratedCode;
import com.speedment.common.json.Json;
import com.speedment.enterprise.plugins.json.JsonCollectors;
import com.speedment.enterprise.plugins.json.JsonComponent;
import com.speedment.enterprise.plugins.json.JsonEncoder;
import com.speedment.enterprise.plugins.spring.runtime.AbstractFilter;
import com.speedment.enterprise.plugins.spring.runtime.AbstractSort;
import com.speedment.enterprise.plugins.spring.runtime.ControllerUtil;
import com.speedment.runtime.field.Field;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Stream;
import javax.annotation.PostConstruct;
import static java.util.stream.Collectors.toList;
/**
* The default REST controller logic for PromotionCustomer entities.
* <p>
* This file has been automatically generated by Speedment. Any changes made to
* it will be overwritten.
*
* @author Speedment
*/
@GeneratedCode("Speedment")
@CrossOrigin(origins = "*", maxAge = 3600)
public abstract class GeneratedPromotionCustomerController {
protected @Autowired JsonComponent jsonComponent;
protected @Autowired PromotionCustomerManager manager;
protected JsonEncoder<PromotionCustomer> encoder;
@PostConstruct
void createPromotionCustomerEncoder() {
encoder = jsonComponent.<PromotionCustomer>emptyEncoder()
.put("id", PromotionCustomer.ID)
.put("promotionId", PromotionCustomer.PROMOTION_ID)
.put("customerId", PromotionCustomer.CUSTOMER_ID)
.put("promotionCode", PromotionCustomer.PROMOTION_CODE)
.build();
}
@GetMapping(path = "/promotion_customer", produces = "application/json")
public String get(
@RequestParam(name = "filter", defaultValue = "[]") String filters,
@RequestParam(name = "sort", defaultValue = "[]") String sorters,
@RequestParam(value = "start", defaultValue = "0") long start,
@RequestParam(value = "limit", defaultValue = "25") long limit) {
return getHelper(
ControllerUtil.parseFilters(filters, PromotionCustomerFilter::new).collect(toList()),
ControllerUtil.parseSorts(sorters, PromotionCustomerSort::new).collect(toList()),
start,
limit
);
}
@ResponseStatus(code = HttpStatus.CREATED)
@PostMapping(path = "/promotion_customer", consumes = "application/json")
public void create(
@RequestBody @Validated CreateBody createBody) {
manager.persist(manager.create()
.setPromotionId(createBody.getPromotionId())
.setCustomerId(createBody.getCustomerId())
.setPromotionCode(createBody.getPromotionCode())
);
}
@ResponseStatus(code = HttpStatus.OK)
@PatchMapping(path = "/promotion_customer/{id}", consumes = "application/json")
public void update(
@PathVariable(name = "id") int id,
@RequestBody @Validated UpdateBody updateBody) {
manager.stream()
.filter(PromotionCustomer.ID.equal(id))
.map(promotionCustomer -> {
promotionCustomer.setPromotionId(updateBody.getPromotionId());
promotionCustomer.setCustomerId(updateBody.getCustomerId());
promotionCustomer.setPromotionCode(updateBody.getPromotionCode());
return promotionCustomer;
}).forEach(manager.updater());
}
@ResponseStatus(code = HttpStatus.NO_CONTENT)
@DeleteMapping(path = "/promotion_customer/{id}")
public void delete(
@PathVariable(name = "id") int id) {
manager.stream()
.filter(PromotionCustomer.ID.equal(id))
.forEach(manager.remover());
}
@ExceptionHandler(JsonMappingException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public String handleMissingValueError() {
Map<String, Object> error = new HashMap<>();
error.put("error", "Bad Request");
error.put("status", 400);
error.put("message", "Invalid request body: missing required fields");
return Json.toJson(error, true);
}
@ExceptionHandler(JsonParseException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public String handleInvalidJsonError() {
Map<String, Object> error = new HashMap<>();
error.put("error", "Bad Request");
error.put("status", 400);
error.put("message", "Invalid request body: invalid JSON syntax");
return Json.toJson(error, true);
}
protected final Set<Identifier> parseColumns(String jsonColumnList) {
try {
@SuppressWarnings("unchecked")
final List<String> parsed = (List<String>) Json.fromJson(jsonColumnList);
final Set<GeneratedPromotionCustomer.Identifier> result = EnumSet.noneOf(GeneratedPromotionCustomer.Identifier.class);
parsed.stream().map(this::parseColumn).forEach(result::add);
return result;
} catch (final ClassCastException ex) {
throw new IllegalArgumentException("Error in parsed JSON.");
}
}
protected final Identifier parseColumn(String jsonColumn) {
switch (jsonColumn) {
case "id": return GeneratedPromotionCustomer.Identifier.ID;
case "promotionId": return GeneratedPromotionCustomer.Identifier.PROMOTION_ID;
case "customerId": return GeneratedPromotionCustomer.Identifier.CUSTOMER_ID;
case "promotionCode": return GeneratedPromotionCustomer.Identifier.PROMOTION_CODE;
default: throw new IllegalArgumentException(
"Unknown column '" + jsonColumn + "'."
);
}
}
protected final Field<PromotionCustomer> fieldOf(Identifier columnId) {
switch (columnId) {
case ID: return PromotionCustomer.ID;
case PROMOTION_ID: return PromotionCustomer.PROMOTION_ID;
case CUSTOMER_ID: return PromotionCustomer.CUSTOMER_ID;
case PROMOTION_CODE: return PromotionCustomer.PROMOTION_CODE;
default: throw new IllegalArgumentException(
"Unknown column '" + columnId + "'."
);
}
}
protected String getHelper(
List<Predicate<PromotionCustomer>> predicates,
List<Comparator<PromotionCustomer>> sorters,
long start,
long limit) {
Stream<PromotionCustomer> stream = manager.stream();
for (final Predicate<PromotionCustomer> predicate : predicates) {
stream = stream.filter(predicate);
}
if (!sorters.isEmpty()) {
final Optional<Comparator<PromotionCustomer>> comparator = sorters.stream()
.reduce(Comparator::thenComparing);
stream = stream.sorted(comparator.get());
}
return stream
.skip(start)
.limit(limit)
.collect(JsonCollectors.toList(encoder));
}
/**
* How to filter the results from the controller. This class is designed to
* be deserialized automatically from JSON.
*/
public static final class PromotionCustomerFilter extends AbstractFilter<PromotionCustomer> {
public PromotionCustomerFilter(
String operator,
String property,
String value) {
super(operator, property, value);
}
@Override
public Predicate<PromotionCustomer> toPredicate() {
switch (property()) {
case "id" : {
final int v = Integer.parseInt(value());
switch (operator()) {
case "eq" : return PromotionCustomer.ID.equal(v);
case "ne" : return PromotionCustomer.ID.notEqual(v);
case "lt" : return PromotionCustomer.ID.lessThan(v);
case "le" : return PromotionCustomer.ID.lessOrEqual(v);
case "gt" : return PromotionCustomer.ID.greaterThan(v);
case "ge" : return PromotionCustomer.ID.greaterOrEqual(v);
case "like" : // Fallthrough
default : throw new IllegalArgumentException(
"'" + operator() + "' is not a valid operator for " +
"PromotionCustomer.id."
);
}
}
case "promotionId" : {
final Integer v = Integer.parseInt(value());
switch (operator()) {
case "eq" : return PromotionCustomer.PROMOTION_ID.equal(v);
case "ne" : return PromotionCustomer.PROMOTION_ID.notEqual(v);
case "lt" : return PromotionCustomer.PROMOTION_ID.lessThan(v);
case "le" : return PromotionCustomer.PROMOTION_ID.lessOrEqual(v);
case "gt" : return PromotionCustomer.PROMOTION_ID.greaterThan(v);
case "ge" : return PromotionCustomer.PROMOTION_ID.greaterOrEqual(v);
case "like" : // Fallthrough
default : throw new IllegalArgumentException(
"'" + operator() + "' is not a valid operator for " +
"PromotionCustomer.promotionId."
);
}
}
case "customerId" : {
final Integer v = Integer.parseInt(value());
switch (operator()) {
case "eq" : return PromotionCustomer.CUSTOMER_ID.equal(v);
case "ne" : return PromotionCustomer.CUSTOMER_ID.notEqual(v);
case "lt" : return PromotionCustomer.CUSTOMER_ID.lessThan(v);
case "le" : return PromotionCustomer.CUSTOMER_ID.lessOrEqual(v);
case "gt" : return PromotionCustomer.CUSTOMER_ID.greaterThan(v);
case "ge" : return PromotionCustomer.CUSTOMER_ID.greaterOrEqual(v);
case "like" : // Fallthrough
default : throw new IllegalArgumentException(
"'" + operator() + "' is not a valid operator for " +
"PromotionCustomer.customerId."
);
}
}
case "promotionCode" : {
final String v = value();
switch (operator()) {
case "eq" : return PromotionCustomer.PROMOTION_CODE.equal(v);
case "ne" : return PromotionCustomer.PROMOTION_CODE.notEqual(v);
case "lt" : return PromotionCustomer.PROMOTION_CODE.lessThan(v);
case "le" : return PromotionCustomer.PROMOTION_CODE.lessOrEqual(v);
case "gt" : return PromotionCustomer.PROMOTION_CODE.greaterThan(v);
case "ge" : return PromotionCustomer.PROMOTION_CODE.greaterOrEqual(v);
case "like" : return PromotionCustomer.PROMOTION_CODE.contains(v);
default : throw new IllegalArgumentException(
"'" + operator() + "' is not a valid operator for " +
"PromotionCustomer.promotionCode."
);
}
}
default : throw new IllegalArgumentException(
"'" + property() + "' is not a valid PromotionCustomer property."
);
}
}
}
/**
* How to sort the results from the controller. This class is designed to be
* deserialized automatically from JSON.
*/
public static final class PromotionCustomerSort extends AbstractSort<PromotionCustomer> {
public PromotionCustomerSort(String property, String direction) {
super(property, direction);
}
@Override
public Comparator<PromotionCustomer> toComparator() {
final Comparator<PromotionCustomer> comparator;
switch (property()) {
case "id" : comparator = PromotionCustomer.ID.comparator(); break;
case "promotionId" : comparator = PromotionCustomer.PROMOTION_ID.comparator(); break;
case "customerId" : comparator = PromotionCustomer.CUSTOMER_ID.comparator(); break;
case "promotionCode" : comparator = PromotionCustomer.PROMOTION_CODE.comparator(); break;
default : throw new IllegalArgumentException(
"'" + property() + "' is not a valid PromotionCustomer property."
);
}
switch (direction()) {
case "ASC" : return comparator;
case "DESC" : return comparator.reversed();
default : throw new IllegalArgumentException(
"'" + direction() + "' is not a valid sort direction. " +
"Use either 'ASC' or 'DESC', or leave out."
);
}
}
}
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class CreateBody {
private final Integer promotionId;
private final Integer customerId;
private final String promotionCode;
@JsonCreator
public CreateBody(
@JsonProperty("promotionId") Integer promotionId,
@JsonProperty("customerId") Integer customerId,
@JsonProperty("promotionCode") String promotionCode) {
this.promotionId = Objects.requireNonNull(promotionId, "`promotionId` is required");
this.customerId = Objects.requireNonNull(customerId, "`customerId` is required");
this.promotionCode = Objects.requireNonNull(promotionCode, "`promotionCode` is required");
}
public Integer getPromotionId() {
return this.promotionId;
}
public Integer getCustomerId() {
return this.customerId;
}
public String getPromotionCode() {
return this.promotionCode;
}
}
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class UpdateBody {
private final Integer promotionId;
private final Integer customerId;
private final String promotionCode;
@JsonCreator
public UpdateBody(
@JsonProperty("promotionId") Integer promotionId,
@JsonProperty("customerId") Integer customerId,
@JsonProperty("promotionCode") String promotionCode) {
this.promotionId = Objects.requireNonNull(promotionId, "`promotionId` is required");
this.customerId = Objects.requireNonNull(customerId, "`customerId` is required");
this.promotionCode = Objects.requireNonNull(promotionCode, "`promotionCode` is required");
}
public Integer getPromotionId() {
return this.promotionId;
}
public Integer getCustomerId() {
return this.customerId;
}
public String getPromotionCode() {
return this.promotionCode;
}
}
} | [
"63178225+quocnna@users.noreply.github.com"
] | 63178225+quocnna@users.noreply.github.com |
74054fb764db03b51a08edd62814144d9e000b9f | e9fad861a862ba73a6eaf9302eac6e6a42bdc3c9 | /src/main/java/com/xavier/hadoop/zookeeper/ZooKeeperDemo.java | b789a2d1c14e7873a8c2ed55e98831908f7ca59f | [] | no_license | finchan/Libraries | ec6c1bdd81265f1f9b34caa49002d28df0bcf448 | 86a56f484d9e987487d28ecde16b3049d715df0f | refs/heads/master | 2022-12-24T06:50:17.559197 | 2020-01-11T15:00:40 | 2020-01-11T15:00:40 | 60,065,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,961 | java | package com.xavier.hadoop.zookeeper;
import org.apache.zookeeper.*;
import org.apache.zookeeper.data.Stat;
import java.io.IOException;
public class ZooKeeperDemo implements Watcher {
private static final int SESSION_TIMEOUT = 30000;
public static ZooKeeper zooKeeper;
public static void main(String[] args) {
String path = "/mynode";
try{
zooKeeper = new ZooKeeper("192.168.153.132:2181", SESSION_TIMEOUT, new ZooKeeperDemo());
//exists - Return the stat of the node of the given path. Return null if no such a node exists.
//If the watch is true and the call is successful (no exception is thrown),
// a watch will be left on the node with the given path. The watch will be triggered
// by a successful operation that creates/delete the node or sets the data on the node.
Stat stat = zooKeeper.exists(path, true);
if (stat == null) {
zooKeeper.create(path, "myContent1".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
Thread.sleep(3000);
}
zooKeeper.close();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (KeeperException e) {
e.printStackTrace();
}
}
public void process(WatchedEvent watchedEvent) {
if(Event.KeeperState.SyncConnected == watchedEvent.getState()) {
if(Event.EventType.NodeCreated == watchedEvent.getType()) {
System.out.println("Node created successfully");
try {
zooKeeper.exists(watchedEvent.getPath(), true);
} catch (KeeperException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
| [
"qc_a856af5fe73e46a1b19701bd04a8a1e6@git.code.tencent.com"
] | qc_a856af5fe73e46a1b19701bd04a8a1e6@git.code.tencent.com |
f33c43d87855d701c225b22b48a023cb2d8032e7 | 718a8498e6da032fcdd976691ad07fb646bd9703 | /test_5.29/src/Review5_20/ThreadDemo19.java | c77aec069bbcb6c05268ad6a2058bd1e9fc6ee97 | [] | no_license | Nineodes19/happy-end | 716cb8026e5e9d1175ac068fdd866852a97f9494 | 07ec40c587f5247cd8e59e259c1c9dc14d1c488e | refs/heads/master | 2022-07-13T05:53:10.808060 | 2020-10-24T15:18:36 | 2020-10-24T15:18:36 | 217,953,407 | 0 | 0 | null | 2022-06-21T04:03:12 | 2019-10-28T02:47:47 | Java | UTF-8 | Java | false | false | 1,416 | java | package Review5_20;
/**
* @program:test_5.29
* @author:Nine_odes
* @description:
* @create:2020-05-29 22:32
**/
import com.sun.jnlp.PersistenceServiceNSBImpl;
/**
* 单例模式要求:某个类的实例,。在一个程序中只能存在一个,不能存在多个
* 当代码中不小心针对这个不该实例化多次的类进行多次实例化时,编译器就会做出
* 一些对应的检查/限制
*/
public class ThreadDemo19 {
static class Singleton{
private static Singleton instance = new Singleton();
//把构造方法设为私有,此时这个类无法在类外被实例化
private Singleton(){
}
public static Singleton getInstance(){
return instance;
}
}
public static void main(String[] args) {
//具体用法
//要想获取到Singleton实力,必须通过getInstance获取,不能new
Singleton singleton = Singleton.getInstance();
Singleton singleton1 = Singleton.getInstance();
Singleton singleton2 = Singleton.getInstance();
//getInstance得到的类内部的静态成员
//静态成员是和类相关的(在类对象中),每个类只有一个类对象
//此时每次调用getInstance得到的实力其实是同一个
System.out.println(singleton == singleton2);
System.out.println(singleton == singleton1);
}
}
| [
"3100863513@qq.com"
] | 3100863513@qq.com |
44fae6c2d7c53357cfa624118f1d5284ce92ed46 | 7bdd096c60948321b936631633e049cc7f9adb4d | /LMCalculator/src/LogWindow/LogFrame.java | 12327d7fed36ea4215214f85d8eb16e33a9891de | [] | no_license | lmiori92/lmcalculator | 22d34f50ba80234daa352372ef877be0337ac342 | fd6bc1bed2c7b93561c25b1c6f3335d015b415bc | refs/heads/master | 2021-01-10T08:15:03.031760 | 2016-02-29T20:02:16 | 2016-02-29T20:02:16 | 52,720,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,161 | java | /*
* Lorenzo Miori - 19/01/2012
* Creates a new frame visualizing the LogPanel object.
* Having this window opened, user can still use the calculator!
*/
/*
Copyright (C) 2012 Lorenzo Miori
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package LogWindow;
import javax.swing.*;
import java.awt.*;
import CalcTools.Logger;
/**
* @author lorenzo
*/
public class LogFrame {
private JFrame logFrame;
private JPanel logPanel;
private LogPanel innerLogPanel;
public LogFrame(Logger calcLog) {
logFrame = new JFrame("LMCalculator History");
/* Hide the window when the user wants to close it... */
logFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
/* Get the main panel to be used later */
logPanel = (JPanel)logFrame.getContentPane();
/* User cannot resize the about window freely: set a default fixed size */
logFrame.setResizable(false);
logFrame.setPreferredSize(new Dimension(400, 300));
logFrame.setLocationRelativeTo(logFrame.getRootPane());
logFrame.pack();
/* Finally show our info panel... */
innerLogPanel = new LogPanel(calcLog);
logPanel.add(innerLogPanel);
}
public void setVisible(boolean x) {
logFrame.setVisible(x);
innerLogPanel.updateText();
}
public void updateText() {
if (logFrame.isVisible()) {
innerLogPanel.updateText();
}
}
public boolean isVisible() {
return logFrame.isVisible();
}
} | [
"memoryS60@gmail.com"
] | memoryS60@gmail.com |
4232b0a188d61bc0b90c6498055c085296cbabc9 | c7207236b63cd251deff17a18205d7eb41383792 | /deploy/source/core/AI.java | 28909c12f910947ba03befa2b1e7c14d74d7faf9 | [] | no_license | csiki/ProjectWaifu | 2e7305fb7d5273ac4cd14b0f8f0f51a2775b7326 | 612cb6ca937598d480c9507c0fe8af2371db0b56 | refs/heads/master | 2021-01-10T13:16:44.164969 | 2015-11-18T23:51:43 | 2015-11-18T23:51:43 | 47,329,863 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | java | package core;
import java.util.List;
// @ Project : ProjectWaifu
// @ File Name : AI.java
// @ Date : 2013.07.02.
// @ Author : csiki
// @ Copyright : All rights reserved
public class AI {
//private List<Sensor> sensors; // later may be used
private UserActionFactory userActionFactory;
private CounterActionFactory counterActionFactory;
private BehaviorContainer behContainer;
private volatile boolean busy;
public AI(
List<Sensor> sensors,
BehaviorContainer behContainer,
UserActionFactory userActionFactory,
CounterActionFactory counterActionFactory
) {
//this.sensors = sensors; // later may be used
this.behContainer = behContainer;
this.userActionFactory = userActionFactory;
this.counterActionFactory = counterActionFactory;
this.busy = false;
}
public void conditionFulfilled(Behavior beh) {
if (!this.busy && behContainer.isBehaviorActivated(beh)) {
this.busy = true;
beh.consequent(counterActionFactory);
this.busy = false;
}
else {
//beh.condition(userActionFactory);
}
}
public void newBehaviorsLoaded() {
// call condition to all activated behaviors
for (int i = 0; i < this.behContainer.getNumOfBehaviors(); ++i) {
if (this.behContainer.isBehaviorActivated(i)) {
this.behContainer.getBehavior(i).condition(userActionFactory);
}
}
}
}
| [
"chickenhun@gmail.com"
] | chickenhun@gmail.com |
1b4a3368c42d79b3a172075c46ae403d657c4dc5 | 98f1e95a67bab50c3052413240107485df2a9f27 | /常用工具类/exception/BaseException.java | fa6ac68b08e2e02026fc5c4787bc121eba53b982 | [] | no_license | jmqAPI/JavaPlugins | 6761ddf5650bf88176cb4271714fec72362af277 | b1756965188c017568d8771cdd31416d03041af3 | refs/heads/master | 2020-03-28T23:20:35.094597 | 2018-09-20T12:13:35 | 2018-09-20T12:13:35 | 149,287,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 354 | java | package com.skywing.utils.exception;
public class BaseException extends RuntimeException{
public BaseException(Throwable throwable) {
super(throwable);
}
public BaseException(String msg, Throwable throwable) {
super(msg, throwable);
}
public BaseException(String msg) {
super(msg);
}
}
| [
"jmqfly@foxmail.com"
] | jmqfly@foxmail.com |
8e84b259418b4d8730484afccf9e594712a228f8 | 79bda260da678bf50fbbf4a2de322716e6b64aa7 | /swagger/springdoc-openapi-demos-master/springdoc-openapi-test-app1/src/main/java/org/springdoc/demo/app1/sample2/InventoryApiController.java | 405199275c0108d5184dc72106584c80398c1199 | [] | no_license | amitkmrghosh/spring | 46211a49559ebd383e38d7028e2d117b9b43f37b | dd6a2b8b070b9b33c0908d859872a10a5300c7f8 | refs/heads/master | 2022-12-23T10:56:46.882078 | 2019-12-28T07:33:37 | 2019-12-28T07:33:37 | 195,633,466 | 1 | 0 | null | 2022-12-16T00:47:37 | 2019-07-07T09:32:35 | Java | UTF-8 | Java | false | false | 2,226 | java | package org.springdoc.demo.app1.sample2;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Parameter;
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-07-08T09:37:36.546Z[GMT]")
@RestController
public class InventoryApiController implements InventoryApi {
@SuppressWarnings("unused")
private final ObjectMapper objectMapper;
private final HttpServletRequest request;
@org.springframework.beans.factory.annotation.Autowired
public InventoryApiController(ObjectMapper objectMapper, HttpServletRequest request) {
this.objectMapper = objectMapper;
this.request = request;
}
public ResponseEntity<Void> addInventory(
@Parameter(description = "Inventory item to add") @Valid @RequestBody InventoryItem body) {
@SuppressWarnings("unused")
String accept = request.getHeader("Accept");
return new ResponseEntity<Void>(HttpStatus.NOT_IMPLEMENTED);
}
public ResponseEntity<List<InventoryItem>> searchInventory(
@Parameter(description = "pass an optional search string for looking up inventory") @Valid @RequestParam(value = "searchString", required = false) String searchString,
@Min(0) @Parameter(description = "number of records to skip for pagination") @Valid @RequestParam(value = "skip", required = true) Integer skip,
@Min(0) @Max(50) @Parameter(description = "maximum number of records to return") @Valid @RequestParam(value = "limit", required = true) Integer limit) {
@SuppressWarnings("unused")
String accept = request.getHeader("Accept");
return new ResponseEntity<List<InventoryItem>>(HttpStatus.NOT_IMPLEMENTED);
}
public String getme(String language) {
return language;
}
}
| [
"amitkmrghosh@gmail.com"
] | amitkmrghosh@gmail.com |
4e4acb375f55d49d7cfd03d1771edf6012b33d94 | 68d312fac71254a04fa1bc4e6435599c50cdaee3 | /src/main/java/com/ljs/demo/Service/Impl/JourneyServiceImpl.java | d493a798ba84410cd8ce76f4a0111a2103496f45 | [] | no_license | cp994913344/teamProjects | 08c72b44fd97dc8c657f3b313af28e5137666e59 | 44f9ee7da2fc96cfc75aa7bf61143b82f5421304 | refs/heads/master | 2021-06-18T18:18:00.234203 | 2020-12-29T05:47:32 | 2020-12-29T05:47:32 | 130,335,941 | 0 | 0 | null | 2019-01-07T07:16:01 | 2018-04-20T08:49:46 | HTML | UTF-8 | Java | false | false | 566 | java | package com.ljs.demo.Service.Impl;
import com.ljs.demo.Service.JourneyService;
import com.ljs.demo.pojo.domain.Journey;
import com.ljs.demo.pojo.mapper.JourneyMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class JourneyServiceImpl implements JourneyService {
@Autowired
JourneyMapper journeyMapper;
@Override
public Journey selectByPrimaryKey(Integer id) {
return journeyMapper.selectByPrimaryKey(id);
}
}
| [
"liu_js@suixingpay.com"
] | liu_js@suixingpay.com |
5b4fa8dfc8ec52e7f9cfb7b31d171bf03175308f | 9e74234ad6c8bc10349d1e443c5e04b7c213c294 | /event-listener/src/main/java/ua/kernel/dabbd/eventlistener/service/Sender.java | d596b7d7007f822f556c81b679328457d417325e | [] | no_license | sergey-nemchenko/dabbd | 6bdcdb5daa954c6f9638349cd927afae308bd8e3 | 46179deb9b1151a24bdd6c4aae6a6c2a904b33d9 | refs/heads/master | 2020-04-11T21:30:53.268780 | 2018-12-17T01:26:18 | 2018-12-17T01:26:18 | 162,108,020 | 0 | 0 | null | 2018-12-17T09:43:44 | 2018-12-17T09:43:43 | null | UTF-8 | Java | false | false | 787 | java | package ua.kernel.dabbd.eventlistener.service;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class Sender {
// private static final Logger LOG = LoggerFactory.getLogger(Sender.class);
@Autowired
private KafkaTemplate<String, String> kafkaTemplate;
@Value("${kernel.dabbd.listener.topic}")
private String topic;
public void send(String message){
log.info("sending message='{}' to topic='{}'", message, topic);
kafkaTemplate.send(topic, message);
}
} | [
"maks.pain@gmail.com"
] | maks.pain@gmail.com |
6fd7a44631d3f85b437af0382d103c49654cd430 | a5d01febfd8d45a61f815b6f5ed447e25fad4959 | /Source Code/5.5.1/sources/com/iqoption/d/vr.java | af5a4480ec57362cb9f73d12d55c1005d7ec69aa | [] | no_license | kkagill/Decompiler-IQ-Option | 7fe5911f90ed2490687f5d216cb2940f07b57194 | c2a9dbbe79a959aa1ab8bb7a89c735e8f9dbc5a6 | refs/heads/master | 2020-09-14T20:44:49.115289 | 2019-11-04T06:58:55 | 2019-11-04T06:58:55 | 223,236,327 | 1 | 0 | null | 2019-11-21T18:17:17 | 2019-11-21T18:17:16 | null | UTF-8 | Java | false | false | 1,014 | java | package com.iqoption.d;
import android.databinding.DataBindingComponent;
import android.databinding.ViewDataBinding;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
/* compiled from: IndicatorTitleItemBinding */
public abstract class vr extends ViewDataBinding {
@NonNull
public final TextView agA;
@NonNull
public final LinearLayout avm;
@NonNull
public final ImageView bIo;
@NonNull
public final ImageView bIp;
@NonNull
public final ImageView bmu;
protected vr(DataBindingComponent dataBindingComponent, View view, int i, ImageView imageView, ImageView imageView2, LinearLayout linearLayout, ImageView imageView3, TextView textView) {
super(dataBindingComponent, view, i);
this.bIo = imageView;
this.bIp = imageView2;
this.avm = linearLayout;
this.bmu = imageView3;
this.agA = textView;
}
}
| [
"yihsun1992@gmail.com"
] | yihsun1992@gmail.com |
8e8b6f934aca2f986a72158cb0eb30f1185158a6 | da5ffe115d8e246d6bab779309e8efa1465a47e5 | /app/src/main/java/com/iboxshare/testble/ui/activity/SetScreenPasswordActivity.java | 479f1a59b4c79041c8308521cb05d022e71d872f | [] | no_license | kncxstudio/BLE-Lock | 5c82177f1c7bf49ba0b00cef89bca193766d75c7 | 7176cb8f50924478c04c5080dfa8ea50b2263ba4 | refs/heads/master | 2020-04-12T06:17:17.696428 | 2016-12-01T01:57:36 | 2016-12-01T01:57:36 | 65,069,681 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,472 | java | package com.iboxshare.testble.ui.activity;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDialog;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import com.bumptech.glide.util.Util;
import com.iboxshare.testble.R;
import com.iboxshare.testble.util.Utils;
/**
* Created by KN on 16/9/20.
*/
public class SetScreenPasswordActivity extends Activity {
private Context context = this;
private TextInputLayout passwordTIL;
private Button commitBtn;
//flags
private int PASSWORD_IS_SET = 0;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_set_screen_passowrd);
bindView();
init();
}
void bindView(){
passwordTIL = (TextInputLayout) findViewById(R.id.activity_set_screen_password_TIL);
commitBtn = (Button) findViewById(R.id.activity_set_screen_password_commit);
}
void init(){
commitBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (passwordTIL.getEditText() != null) {
String passowrd = passwordTIL.getEditText().getText().toString();
if (passowrd.isEmpty() || passowrd.length() != 6){
Utils.showGlobalToast(context,"请输入6位数字密码");
}else {
PASSWORD_IS_SET = 1;
MainActivity.setScreenPassword(Integer.valueOf(passowrd));
finish();
}
}
}
});
}
@Override
protected void onStop() {
super.onStop();
if(PASSWORD_IS_SET == 0){
setResult(0);
Utils.showGlobalToast(context,"取消设置密码");
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK){
Utils.showGlobalToast(context,"请设置触屏解锁密码");
return false;
}
return super.onKeyDown(keyCode, event);
}
}
| [
"kncx@qq.com"
] | kncx@qq.com |
7ebf7b665b59232d7e596b0007859d46629aba18 | 2486a78d442b75defb3d03cb6749e350c64b7fcf | /Sorteador/src/JogoMalucoComSorteadores.java | d1b3c092efc6da377888699cd004380587ef53e7 | [] | no_license | vigusmao/Comp2_2021_1 | 144a56e38b9bb974d360b2d244dd0be7567b7f5e | 2e88ab9694a5c5b29c7e6b8d3902101da466307c | refs/heads/master | 2023-08-02T06:21:37.896454 | 2021-10-08T10:53:00 | 2021-10-08T10:53:00 | 385,058,708 | 5 | 6 | null | null | null | null | UTF-8 | Java | false | false | 1,214 | java | public class JogoMalucoComSorteadores<S1 extends Sorteador<Integer>, S2 extends Sorteador<Integer>>
extends JogoDeDoisJogadores {
/**
* Sorteador que será utilizada, em cada rodada, pelo jogador 1.
*/
private S1 sorteador1;
/**
* Sorteador que será utilizada, em cada rodada, pelo jogador 2.
*/
private S2 sorteador2;
public JogoMalucoComSorteadores(String nomeJogador1, String nomeJogador2,
int numeroDeRodadas,
S1 sorteador1, S2 sorteador2) {
super("Jogo Maluco", nomeJogador1, nomeJogador2, numeroDeRodadas);
this.sorteador1 = sorteador1;
this.sorteador2 = sorteador2;
}
@Override
protected Resultado executarRodadaDoJogo() {
int valorSorteadoParaOJogador1 = sorteador1.sortear();
int valorSorteadoParaOJogador2 = sorteador2.sortear();
if (valorSorteadoParaOJogador1 > valorSorteadoParaOJogador2) {
return Resultado.VITORIA_JOGADOR_1;
} else if (valorSorteadoParaOJogador1 < valorSorteadoParaOJogador2) {
return Resultado.VITORIA_JOGADOR_2;
}
return Resultado.EMPATE;
}
}
| [
"vigusmao@gmail.com"
] | vigusmao@gmail.com |
d6d521e92398ee56c3a381ee030130b156f5bd70 | ac26802936acef7f8dc7b9c726ab3a5a2b692ca3 | /LanguageWorkbench/ecnu.TSHS.model.edit/src/TSHS_Ecore/provider/StateItemProvider.java | c418fbbb6047986581003645e9a73802ce6158f7 | [] | no_license | wangyao2221/SHML2UPPAAL | 9d8040d1ab247ef9ca07561d097f05d115f5fb7b | 7d6ad73f4412720bb215c2066fac28d071be7d5e | refs/heads/master | 2020-04-17T17:29:59.249640 | 2019-01-24T09:10:59 | 2019-01-24T09:10:59 | 166,784,242 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,643 | java | /**
*/
package TSHS_Ecore.provider;
import TSHS_Ecore.State;
import TSHS_Ecore.TSHS_EcorePackage;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link TSHS_Ecore.State} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class StateItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StateItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addNamePropertyDescriptor(object);
addSlaveodePropertyDescriptor(object);
addOutgoingctPropertyDescriptor(object);
addIncomingctPropertyDescriptor(object);
addOutgoingptPropertyDescriptor(object);
addIncomingptPropertyDescriptor(object);
addUrgentPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_State_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_State_name_feature", "_UI_State_type"),
TSHS_EcorePackage.Literals.STATE__NAME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Slaveode feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addSlaveodePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_State_slaveode_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_State_slaveode_feature", "_UI_State_type"),
TSHS_EcorePackage.Literals.STATE__SLAVEODE,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Outgoingct feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addOutgoingctPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_State_outgoingct_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_State_outgoingct_feature", "_UI_State_type"),
TSHS_EcorePackage.Literals.STATE__OUTGOINGCT,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Incomingct feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addIncomingctPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_State_incomingct_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_State_incomingct_feature", "_UI_State_type"),
TSHS_EcorePackage.Literals.STATE__INCOMINGCT,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Outgoingpt feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addOutgoingptPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_State_outgoingpt_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_State_outgoingpt_feature", "_UI_State_type"),
TSHS_EcorePackage.Literals.STATE__OUTGOINGPT,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Incomingpt feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addIncomingptPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_State_incomingpt_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_State_incomingpt_feature", "_UI_State_type"),
TSHS_EcorePackage.Literals.STATE__INCOMINGPT,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Urgent feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addUrgentPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_State_urgent_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_State_urgent_feature", "_UI_State_type"),
TSHS_EcorePackage.Literals.STATE__URGENT,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
/**
* This returns State.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/State"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((State)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_State_type") :
getString("_UI_State_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(State.class)) {
case TSHS_EcorePackage.STATE__NAME:
case TSHS_EcorePackage.STATE__URGENT:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return TSHS_EcoreEditPlugin.INSTANCE;
}
}
| [
"wangyao2221@163.com"
] | wangyao2221@163.com |
6e37c123981ff7e66c2238ce8017e3328214e29b | fe94dfa76e3b7384a8d5bb27d076e1fedfb5e2f8 | /src/main/java/com/example/demo/repository/CustomerRepo.java | 4b3c6b123321671f650ea0cac8ee0d70e1f8c5cc | [] | no_license | raman-M0NK3Y/Customer-Mgmt-System-Springboot | 9c9c44fde3f8e7740ecd01d72057d2866ce66f75 | 22c4c9176f2d4bf9e29bfe3f99f52203fc9d652f | refs/heads/main | 2023-02-17T04:50:50.922544 | 2021-01-13T05:53:19 | 2021-01-13T05:53:19 | 327,984,928 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | package com.example.demo.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.example.demo.model.Customer;
@Repository
public interface CustomerRepo extends JpaRepository<Customer, Long> {
@Query("SELECT c FROM Customer c WHERE CONCAT(c.fName, ' ', c.lName, ' ', c.email, ' ', c.phoNumber) LIKE %?1%")
public List<Customer> search(String keyword); //
}
| [
"ramandeep_12@hotmail.com"
] | ramandeep_12@hotmail.com |
175fc6fed135343d213e753d37e1ce2d2991988f | 22e8a5271b20d19332886e33664419b2226d909e | /leetcode/src/leetcode/SolutionReverseString.java | 3a6ee0c33fe4bbb8f748c22aa59424ed6f518b23 | [] | no_license | jbhou/leetcode | 21b2daeee9cd9ab888581c802e09e4f42b8cd306 | 8e5be12a417c377511c5c4a39c245fe6456dfd0a | refs/heads/master | 2021-06-08T01:06:30.050716 | 2021-05-18T09:22:42 | 2021-05-18T09:22:42 | 134,560,147 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 365 | java | package leetcode;
public class SolutionReverseString {
public void reverseString(char[] s) {
if (s == null || s.length <= 1) {
return;
}
int i = 0, j = s.length - 1;
while (i < j) {
char t = s[i];
s[i] = s[j];
s[j] = t;
i++;
j--;
}
}
}
| [
"java_hou@163.com"
] | java_hou@163.com |
9d0577100c905f58c5b8740f0e116e114f648829 | 958ff3e1cb3f6889707680e2db5fedc8662d6b4a | /src/com/rxoa/mypay/db/service/DealConfigService.java | 19639b300bfb299c774037dbcd7249c8058e0618 | [] | no_license | xuanyunze/dgl-server | 675d15c49b8cb275ca3a1d5b3704edb52c626221 | 1aac87905d9b41e1a03f9d06e388d4b6f2914a94 | refs/heads/master | 2020-04-17T17:29:18.156027 | 2016-08-19T01:42:01 | 2016-08-19T01:42:01 | 66,040,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 747 | java | package com.rxoa.mypay.db.service;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.rxoa.mypay.base.AbstractService;
import com.rxoa.mypay.base.IOperations;
import com.rxoa.mypay.db.service.in.IDealConfigService;
import com.rxoa.mypay.db.dao.in.IDealConfigDao;
import com.rxoa.mypay.db.po.DealConfig;
/**
* deal_config Service服务类
* Tue Apr 05 11:23:27 CST 2016 baiyu
*/
@Service("dealConfigService")
public class DealConfigService extends AbstractService<DealConfig> implements IDealConfigService {
@Resource(name="dealConfigDao")
private IDealConfigDao dao;
public DealConfigService() {
super();
}
@Override
protected IOperations<DealConfig> getDao() {
return this.dao;
}
}
| [
"13552005525@139.com"
] | 13552005525@139.com |
18832cc21afd6c061058cf670ab9d6430003a1ba | b9a58c607ff4344de822c98ad693581eef1e1db6 | /src/Utils/JDBCUtil.java | f710ea00dc743bcc2a3214da3b197b4d48270108 | [] | no_license | huohehuo/LinServer | f6080619049ea81d1ca46f504eb7a18470915886 | 0a1b416d66bafa1150aba7417d1873a2d73683a6 | refs/heads/master | 2023-01-19T07:51:31.830278 | 2020-11-24T16:23:12 | 2020-11-24T16:23:12 | 267,913,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,520 | java | package Utils;
import WebSide.Utils.FileControl;
import WebSide.Utils.Info;
import java.sql.*;
public class JDBCUtil {
public static Connection getConn(String url,String password,String user) throws SQLException, ClassNotFoundException{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
return DriverManager.getConnection(url, user, password);
}
public static Connection getSQLiteConn() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbsetfile.db");
return conn;
}
public static Connection getSQLiteConn1() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbother.db");
return conn;
}
public static Connection getSQLite4Company() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbCompany.db");
return conn;
}
public static Connection getSQLite4Company4WC() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbWeChatTest.db");
return conn;
}
public static Connection getSQLite4Statistical() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbStatistical.db");
return conn;
}
public static Connection getSQLite4UserControl() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbUserControl.db");
return conn;
}
//获取时间表的时间
public static Connection getSQLiteForTime() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbManager.db");
return conn;
}
public static Connection getSQLiteForFeedBack() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbWebFeedBack.db");
return conn;
}
public static Connection getUserDbConn(String dbname) throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbUser.db");
return conn;
}
public static Connection getMqttUserDbConn(String dbname) throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbMqttUser.db");
return conn;
}
public static Connection getUserDataConn(String dbname) throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
try {
//当指定文件不存在时,定位到基础db文件,避免生成0kb的程序影响后续操作
if (!FileControl.hasFile(Info.copyUserDataFile(dbname))){
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/app/dbUserData.db");
return conn;
}
} catch (Exception e) {
Lg.e("文件或数据处理出错....");
}
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/app/dbUserData"+dbname+".db");
return conn;
}
public static Connection getTestDbConn() throws ClassNotFoundException, SQLException{
Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/dbTest.db");
return conn;
}
// public static Connection getUserDbConn(String dbname) throws ClassNotFoundException, SQLException{
// Class.forName("org.sqlite.JDBC");
// Connection conn = DriverManager.getConnection("jdbc:sqlite://c:/properties/web/dbWebAppBase"+dbname+".db");
// return conn;
// }
public static void close(ResultSet rs,PreparedStatement sta,Connection connection){
if(rs!=null){
try {
rs.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(sta!=null){
try {
sta.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(connection!=null){
try {
connection.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
| [
"753392431@qq.com"
] | 753392431@qq.com |
fd078ee723ac540cc92e589d54216623d8595c8a | 31082d1cb51e8a71f60360f283b05fa2e2f51a95 | /elmt_dashboard-war/src/com/mrm/action/Item.java | a3f396366ef2052c3e805c1a805bc43e281ab071 | [] | no_license | digiblitz/ELMT | 8dac25660417284d78b43cb52f0803f9161cd929 | 22628a2cc526906354453f67029f14ca94032908 | refs/heads/master | 2020-08-08T19:45:48.528747 | 2019-10-18T11:38:01 | 2019-10-18T11:38:01 | 213,902,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,528 | java | /*******************************************************************************
* * * Copyright: 2019 digiBlitz Foundation
* * *
* * * License: digiBlitz Public License 1.0 (DPL)
* * * Administered by digiBlitz Foundation. www.digiblitz.org/dpl/
* * *
* * * Inventor: Suresh Kannan (Maya Suresh Kannan Balabisegan ) (www.sureshkannan.org)
* * *
* * * Authors: Suresh Kannan (Maya Suresh Kannan Balabisegan )& digiBlitz.
* * *
* * * "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 in accordance to the rules & restrictions of the digiBlitz Public License."
******************************************************************************/
// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov Date: 19-03-2012 10:25:34
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: Item.java
package com.mrm.action;
public class Item
{
public Item()
{
items = null;
values = null;
}
public String getItems()
{
return items;
}
public void setItems(String items)
{
this.items = items;
}
public Double getValues()
{
return values;
}
public void setValues(Double values)
{
this.values = values;
}
String items;
Double values;
}
| [
"maniimp85@gmail.com"
] | maniimp85@gmail.com |
483699654b1bf99a0ec35f2174fb39367267cd03 | 0ea9024442bcb58a0479cbaaee34eed5b4a46252 | /module.sdk/src/main/java/com/bpc/modulesdk/modulity/facilities/mainmenu/MainMenuGroup.java | 4f72e4996abfe714d3d49277050474cd0082f538 | [] | no_license | AlexGorbachev2198/ExchangeRates-MVVM- | 6415bd52471f3a9ece7e5b9c1e7aabec7a2e036a | 3641c1ee4b4aa7a8db5fe6e57e4c3483544c18ed | refs/heads/master | 2021-01-01T19:36:43.134933 | 2017-07-28T07:54:25 | 2017-07-28T07:54:25 | 98,624,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 795 | java | package com.bpc.modulesdk.modulity.facilities.mainmenu;
import com.bpc.modulesdk.BaseApp;
import ru.bpc.mobilebanksdk.R;
/**
* Created by Smolyaninov on 20.06.2017.
*/
public enum MainMenuGroup implements Comparable<MainMenuGroup> {
AGENT(R.string.agent, 3), CUSTOMER(R.string.customer, 2), TOP(R.string.main, 100), BOTTOM(R.string.settings, 0);
MainMenuGroup(int id, int priority) {
this.group = BaseApp.getContext().getString(id);
this.priority = priority;
}
String group;
int priority;
public String getGroup() {
return group;
}
public int getPriority() {return priority;}
public void setGroup(String group) {
this.group = group;
}
@Override
public String toString() {
return group;
}
}
| [
"gorbachev2198@gmail.com"
] | gorbachev2198@gmail.com |
9f8853c42953cea4dc89d5e452b9a254ff7f0157 | ad64a14fac1f0d740ccf74a59aba8d2b4e85298c | /linkwee-supermarket/src/main/java/com/linkwee/api/response/cim/CimUnrecordInvestListResponse.java | 0325415d6bf4af895e2893dcb16432ac95759c4f | [] | no_license | zhangjiayin/supermarket | f7715aa3fdd2bf202a29c8683bc9322b06429b63 | 6c37c7041b5e1e32152e80564e7ea4aff7128097 | refs/heads/master | 2020-06-10T16:57:09.556486 | 2018-10-30T07:03:15 | 2018-10-30T07:03:15 | 193,682,975 | 0 | 1 | null | 2019-06-25T10:03:03 | 2019-06-25T10:03:03 | null | UTF-8 | Java | false | false | 4,575 | java | package com.linkwee.api.response.cim;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwee.core.util.DateUtils;
import com.linkwee.web.model.cim.CimUnrecordInvestListResp;
import com.linkwee.xoss.util.WebUtil;
/**
*
* @描述: 实体Bean
*
* @创建人: chenjl
*
* @创建时间:2018年01月29日 17:10:52
*
* Copyright (c) 深圳领会科技有限公司-版权所有
*/
public class CimUnrecordInvestListResponse implements Serializable
{
private static final long serialVersionUID = 1L;
public CimUnrecordInvestListResponse() {
}
public CimUnrecordInvestListResponse(CimUnrecordInvestListResp obj) {
WebUtil.initObj(this, obj);
this.id = obj.getId();
this.platfromName = obj.getPlatfromName();
this.platfromIco = obj.getPlatfromIco();
this.investAmt = obj.getInvestAmt();
this.status = obj.getStatus();
this.productDeadLine = obj.getProductDeadLine();
this.feeAmt = obj.getFeeAmt();
this.investTime = obj.getInvestTime();
this.recordTime = obj.getRecordTime();
this.shareStatus = obj.getShareStatus();
this.updateTime = obj.getUpdateTime();
this.payStatus = obj.getPayStatus();
this.payTime = obj.getPayTime();
this.feeStrategy = obj.getFeeStrategy();
this.repaymentTime = obj.getRepaymentTime();
}
private String payStatus;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date payTime;
private String platfromName;//平台名称
private String platfromIco;//平台logo
private String investAmt;//投资金额
private String status;//报单状态
private String productDeadLine;//产品期限
private String feeAmt;//返现金额
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date investTime;//投资时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date recordTime;//报单时间
private String shareStatus;//报单状态:0=未晒单|1=已晒单
private String id;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date updateTime;
private String feeStrategy;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date repaymentTime;
public String getFeeStrategy() {
return feeStrategy;
}
public void setFeeStrategy(String feeStrategy) {
this.feeStrategy = feeStrategy;
}
public String getPayStatus() {
return payStatus;
}
public void setPayStatus(String payStatus) {
this.payStatus = payStatus;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getShareStatus() {
return shareStatus;
}
public void setShareStatus(String shareStatus) {
this.shareStatus = shareStatus;
}
public String getPlatfromName() {
return platfromName;
}
public void setPlatfromName(String platfromName) {
this.platfromName = platfromName;
}
public String getPlatfromIco() {
return platfromIco;
}
public void setPlatfromIco(String platfromIco) {
this.platfromIco = platfromIco;
}
public String getInvestAmt() {
return investAmt;
}
public void setInvestAmt(String investAmt) {
this.investAmt = investAmt;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getProductDeadLine() {
return productDeadLine;
}
public void setProductDeadLine(String productDeadLine) {
this.productDeadLine = productDeadLine;
}
public String getFeeAmt() {
return feeAmt;
}
public void setFeeAmt(String feeAmt) {
this.feeAmt = feeAmt;
}
public Date getInvestTime() {
return investTime;
}
public void setInvestTime(Date investTime) {
this.investTime = investTime;
}
public Date getRecordTime() {
return recordTime;
}
public void setRecordTime(Date recordTime) {
this.recordTime = recordTime;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
public Date getRepaymentTime() {
return repaymentTime;
}
public void setRepaymentTime(Date repaymentTime) {
this.repaymentTime = repaymentTime;
}
} | [
"liqimoon@qq.com"
] | liqimoon@qq.com |
c041cada00e14488294385072ad5978df0dac343 | cf8277fa03b91c9dcafaf777f521e78435e86724 | /Chat with API/app/src/main/java/com/mad/practice/inclass10/SignUp.java | efe0d7d2f191266d12a901205ecf4ec5d4d323ae | [] | no_license | prashantdesai93/Android_Applications | ddae932a8e009ef250972e1f52fe16c5a505c570 | ab5b10e5b0b570fba0774465b8766a4d6e4ff35f | refs/heads/master | 2020-04-23T12:25:54.077196 | 2019-02-17T20:21:18 | 2019-02-17T20:21:18 | 171,167,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,492 | java | package com.mad.practice.inclass10;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class SignUp extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up);
final EditText etFname = (EditText) findViewById(R.id.etFname);
final EditText etLname = (EditText) findViewById(R.id.etLname);
final EditText etEmail = (EditText) findViewById(R.id.etEmail);
final EditText etPwd = (EditText) findViewById(R.id.etPwd);
final EditText etCpwd = (EditText) findViewById(R.id.etCpwd);
Button btnCancel = (Button) findViewById(R.id.btnCancel);
Button btnSignup = (Button) findViewById(R.id.btnSignup1);
btnCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
btnSignup.findViewById(R.id.btnSignup1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
User u = new User();
String pass = null;
String cPass = null;
boolean error=false;
try{
if(etEmail.getText().length()>1){
u.setUser_email(etEmail.getText().toString());
}else{
error = true;
etEmail.setError("Required");
}
if(etFname.getText().length()>1){
u.setUser_fname(etFname.getText().toString());
}else{
error = true;
etFname.setError("Required");
}
if(etLname.getText().length()>1){
u.setUser_lname(etLname.getText().toString());
}else{
error = true;
etLname.setError("Required");
}
if(etPwd.getText().length()>1){
pass =etPwd.getText().toString();
}else{
error = true;
etPwd.setError("Required");
}
if(etCpwd.getText().length()>1){
cPass =etCpwd.getText().toString();
}else{
error = true;
etCpwd.setError("Required");
}
}catch(Exception e){
}
if(!error){
if(pass.equalsIgnoreCase(cPass)){
signUp(u,etPwd.getText().toString(),etCpwd.getText().toString());
}else{
etCpwd.setError("Passwords Do not Match");
}
}else{
Toast.makeText(SignUp.this, "Please Try Again", Toast.LENGTH_SHORT).show();
}
}
});
}
public void signUp(User u, String pass, String cPass){
OkHttpClient client = new OkHttpClient();
String url = "http://ec2-54-91-96-147.compute-1.amazonaws.com/api/signup";
RequestBody formBody = new FormBody.Builder()
.add("fname", u.getUser_fname())
.add("lname",u.getUser_lname())
.add("email",u.getUser_email())
.add("password",pass)
.build();
Request request =new Request.Builder()
.url(url)
.post(formBody)
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
Log.d("demo", "SignUp : onResponse: "+response.body().string());
finish();
}
});
}
}
| [
"prashantdesai93@gmail.com"
] | prashantdesai93@gmail.com |
0ab65b98a7b77e1db3a168af2989376234d55ed3 | af7b8bbe77461e59f32ba746f4bb055620a5c110 | /zookeeper/src/test/java/com/hz/yk/zk/jute/JuteTests.java | 9125a27225de0a2f9b7bdaf382430cd53f8b7eb4 | [] | no_license | ykdsg/MyJavaProject | 3e51564a3fb57ab4ae043c9112e1936ccc179dd5 | a7d88aee2f58698aed7d497c2cf6e23a605ebb59 | refs/heads/master | 2023-06-26T02:23:33.812330 | 2023-06-12T11:28:23 | 2023-06-12T11:28:23 | 1,435,034 | 4 | 6 | null | 2022-12-01T15:21:01 | 2011-03-03T13:30:03 | Java | UTF-8 | Java | false | false | 3,510 | java | package com.hz.yk.zk.jute;
import com.google.common.base.MoreObjects;
import org.apache.jute.BinaryInputArchive;
import org.apache.jute.BinaryOutputArchive;
import org.apache.jute.Index;
import org.apache.jute.InputArchive;
import org.apache.jute.OutputArchive;
import org.apache.jute.Record;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.TreeMap;
/**
* @author wuzheng.yk
* @date 2021/5/24
*/
public class JuteTests {
private String pathname = "jute-data";
@Test
public void testSerDe() throws Exception {
Files.deleteIfExists(Paths.get(pathname));
serialize();
deserialize();
}
private void serialize() throws Exception {
try (OutputStream os = new FileOutputStream(new File(pathname));) {
BinaryOutputArchive oa = BinaryOutputArchive.getArchive(os);
// Primitive types
oa.writeBool(true, "boolean");
oa.writeInt(1024, "int");
oa.writeString("yao", "string");
// Records
Student xiaoMing = new Student(2, "xiaoMing");
oa.writeRecord(xiaoMing, "xiaoMing");
// TreeMap
TreeMap<String, Integer> map = new TreeMap<>();
map.put("one", 1);
map.put("two", 2);
oa.startMap(map, "map");
int i = 1;
for (String key : map.keySet()) {
String tag = i + "";
oa.writeString(key, tag);
oa.writeInt(map.get(key), tag);
i++;
}
oa.endMap(map, "map");
}
}
private void deserialize() throws Exception {
try (FileInputStream is = new FileInputStream(new File(pathname));) {
BinaryInputArchive ia = BinaryInputArchive.getArchive(is);
System.out.printf("boolean: %b\n", ia.readBool("boolean"));
System.out.printf("int: %d\n", ia.readInt("int"));
System.out.printf("string: %s\n", ia.readString("string"));
Student xiaoMing = new Student();
ia.readRecord(xiaoMing, "xiaoMing");
System.out.printf("xiaoMing: %s\n", xiaoMing);
Index index = ia.startMap("map");
int i = 1;
while (!index.done()) {
String tag = i + "";
System.out.printf("key: %s, value: %d\n", ia.readString(tag), ia.readInt(tag));
index.incr();
i++;
}
}
}
}
class Student implements Record {
private int grade;
private String name;
public Student() {}
public Student(int grade, String name) {
this.grade = grade;
this.name = name;
}
@Override
public void serialize(OutputArchive oa, String tag) throws IOException {
oa.startRecord(this, tag);
oa.writeInt(grade, "grade");
oa.writeString(name, "name");
oa.endRecord(this, tag);
}
@Override
public void deserialize(InputArchive ia, String tag) throws IOException {
ia.startRecord(tag);
grade = ia.readInt("grade");
name = ia.readString("name");
ia.endRecord(tag);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this).add("grade", grade).add("name", name).toString();
}
}
| [
"17173as@163.com"
] | 17173as@163.com |
fecfb3669f6fef0a6b673f8692f156c4cca6e4f0 | 9755328d95225d1fbdf17a400655f17a8ff95aef | /src/main/test/com/stackroute/p1/OddEvenTest.java | 9ea6b06e63d3ee082146784accb85d9b8df14d81 | [] | no_license | vishalpattnaik/JAVA-PE1 | 77e48a0ca06bdfbf3c614157c67ebd3e6ce61a50 | 9e31acb619bd09a7b5e1f1c3a257dfb651027b2a | refs/heads/master | 2020-06-11T16:23:31.847692 | 2019-07-03T07:13:36 | 2019-07-03T07:13:36 | 194,022,462 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 952 | java | package com.stackroute.p1;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class OddEvenTest {
OddEven ob = null;
@Before
public void setUp() throws Exception {
ob = new OddEven();
}
@After
public void tearDown() throws Exception {
ob = null;
}
@Test
public void checkLimit() {
String result = ob.checkOddEven(56);
assertEquals("Number doesn't exists between 20 and 30", result);
}
@Test
public void checkEven() {
String result = ob.checkOddEven(26);
assertEquals("Jerry", result);
}
@Test
public void checkOdd() {
String result = ob.checkOddEven(21);
assertEquals("Tom", result);
}
@Test
public void checkCharacter() {
String result = ob.checkOddEven('a');
assertEquals("Please enter a number", result);
}
} | [
"vishalpattnaik387@gmail.com"
] | vishalpattnaik387@gmail.com |
f13ad7a3bfac37d5d8f19520904fe218f4064d82 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/15/15_c64a5c3fdbd37417a46f70291fd48c5ef550517e/RavenWeapon/15_c64a5c3fdbd37417a46f70291fd48c5ef550517e_RavenWeapon_s.java | 226ec41a56ded697953befcc8dfd5962c3b7b202 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,284 | java | /**
*
*/
package raven.game.armory;
import java.util.List;
import raven.game.RavenBot;
import raven.game.RavenObject;
import raven.goals.fuzzy.FuzzyModule;
import raven.math.Vector2D;
/**
* @author chester
*
*/
public abstract class RavenWeapon {
private RavenBot owner;
private RavenObject itemType;
private FuzzyModule fuzzyModule;
private int roundsLeft, maxRoundCapacity;
private double rateOfFire, timeNextAvailable, lastDesireabilityScore, idealRange, maxProjectileSpeed;
private List<Vector2D> WeaponVB, WeaponVBTrans;
public RavenWeapon(RavenObject weaponType, int defaultRoundsCount, int maxCapacity,
double RoF, double iRange, double projectileSpd, RavenBot holder)
{
itemType = weaponType;
owner = holder;
roundsLeft = defaultRoundsCount;
maxRoundCapacity = maxCapacity;
rateOfFire = RoF;
timeNextAvailable = System.nanoTime();
idealRange = iRange;
maxProjectileSpeed = projectileSpd;
lastDesireabilityScore = 0;
}
/* OVERRIDES */
/**
* Causes the weapon to shoot at the chosen position. Each weapons overrides this method.
* @param position
*/
public void ShootAt(Vector2D position) {}
/**
* Draws the weapon on the display via GameCanvas static calls. Overridden by each weapon.
*/
public void render() {}
/**
* This overridden method uses fuzzy logic to assign a desireability value to this weapon, based on the distance and the logic
* currently assigned to the weapon.
* @param distanceToTarget
* @return
*/
public double GetDesireability(double distanceToTarget) { return 0; }
/* ACCESSORS */
public final boolean AimAt(Vector2D target) { return owner.rotateFacingTowardPosition(target); }
public double getMaxProjectileSpeed() { return maxProjectileSpeed; }
public int getRoundsRemaining() { return roundsLeft; }
public void decrementRoundsLeft() { if(roundsLeft > 0) --roundsLeft; }
public List<Vector2D> getWeaponVectorBuffer() { return WeaponVB; }
public List<Vector2D> getWeaponVectorTransBuffer() { return WeaponVBTrans; }
public void setWeaponVectorTransBuffer(List<Vector2D> tempBuffer) { WeaponVBTrans = tempBuffer; }
public RavenBot getOwner() { return owner; }
public FuzzyModule getFuzzyModule() { return fuzzyModule; }
public void setLastDesireability(double newDesireability) { lastDesireabilityScore = newDesireability; }
/**
* Adds the specified number of rounds to this weapons' magazine, without exceeding the max capacity.
* @param numberToAdd
*/
public void incrementRounds(int numberToAdd){
roundsLeft += numberToAdd;
if(roundsLeft > maxRoundCapacity) roundsLeft = maxRoundCapacity;
}
public RavenObject getWeaponType() {return itemType; }
public double getIdealRange() { return idealRange; }
public boolean isReadyForNextShot() { return System.nanoTime() > timeNextAvailable; }
public void UpdateTimeWeaponIsNextAvailable() { timeNextAvailable = System.nanoTime() + 1.0/rateOfFire; }
private void InitializeFuzzyModule() {}
public double getLastDesirabilityScore() {
return lastDesireabilityScore;
}
public int getMaxRounds()
{
return maxRoundCapacity;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
8837de25ef6af6f29559947f770535d118d13f7f | b4e0e50e467ee914b514a4f612fde6acc9a82ba7 | /hbase-client/src/main/java/org/apache/hadoop/hbase/client/ResultScanner.java | aad84034e1b2b0a7eb90800348ff7ffd39eb01d2 | [
"Apache-2.0",
"CPL-1.0",
"MPL-1.0"
] | permissive | tenggyut/HIndex | 5054b13118c3540d280d654cfa45ed6e3edcd4c6 | e0706e1fe48352e65f9f22d1f80038f4362516bb | refs/heads/master | 2021-01-10T02:58:08.439962 | 2016-03-10T01:15:18 | 2016-03-10T01:15:18 | 44,219,351 | 3 | 4 | Apache-2.0 | 2023-03-20T11:47:22 | 2015-10-14T02:34:53 | Java | UTF-8 | Java | false | false | 1,775 | java | /**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hbase.client;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import java.io.Closeable;
import java.io.IOException;
/**
* Interface for client-side scanning.
* Go to {@link HTable} to obtain instances.
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public interface ResultScanner extends Closeable, Iterable<Result> {
/**
* Grab the next row's worth of values. The scanner will return a Result.
* @return Result object if there is another row, null if the scanner is
* exhausted.
* @throws IOException e
*/
Result next() throws IOException;
/**
* @param nbRows number of rows to return
* @return Between zero and <param>nbRows</param> Results
* @throws IOException e
*/
Result [] next(int nbRows) throws IOException;
/**
* Closes the scanner and releases any resources it has allocated
*/
void close();
}
| [
"tengyutong0213@gmail.com"
] | tengyutong0213@gmail.com |
d04f76e7b4f8879ed2b80fa195022381ebddce97 | e27d6bce6c259bb5923015d159b6df90edb8fe72 | /LeetCode/src/MinStack.java | 9fb8552d51674a5b58c00c9d580e918bf0a40b57 | [] | no_license | Jugram-Chen/JavaRep01 | 21a192382ea85bc589bf9662598387c30683d50e | cb3949194d13fa4b6d0554c5512c668083b3f32a | refs/heads/master | 2023-01-06T03:51:07.064093 | 2020-10-24T04:07:57 | 2020-10-24T04:07:57 | 306,802,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 506 | java | import java.util.LinkedList;
import java.util.List;
public class MinStack {
List<Integer> ll;
public MinStack() {
ll=new LinkedList<>();
}
public void push(int x) {
ll.add(x);
}
public void pop() {
ll.remove(ll.size()-1);
}
public int top() {
return ll.get(ll.size()-1);
}
public int getMin() {
int min=ll.get(0);
for(int i:ll){
if(i<min)
min=i;
}
return min;
}
}
| [
"dchen21@stevens.edu"
] | dchen21@stevens.edu |
6dcbba370f1794f63752dd373076653c80163438 | 9e7fc42bf4b38e653e87908c62bcefe61c99ab89 | /src/test/java/com/brancheview/cpmv/config/WebConfigurerTest.java | 1d99966bb3e7568693e299ef1c59c979cd6e2d03 | [] | no_license | BulkSecurityGeneratorProject/cpmv | 2a5d7c937dbb06aa923201db8fa52e47c1d1b5f1 | 64632432eec7744c34038edcd4dd8e22b4186ccc | refs/heads/master | 2022-12-15T19:24:07.522154 | 2019-08-26T11:11:32 | 2019-08-26T11:11:32 | 296,542,760 | 0 | 0 | null | 2020-09-18T07:11:36 | 2020-09-18T07:11:35 | null | UTF-8 | Java | false | false | 7,178 | java | package com.brancheview.cpmv.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.github.jhipster.web.filter.CachingHttpHeadersFilter;
import org.h2.server.web.WebServlet;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.mock.web.MockServletContext;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import javax.servlet.*;
import java.io.File;
import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Unit tests for the {@link WebConfigurer} class.
*/
public class WebConfigurerTest {
private WebConfigurer webConfigurer;
private MockServletContext servletContext;
private MockEnvironment env;
private JHipsterProperties props;
@BeforeEach
public void setup() {
servletContext = spy(new MockServletContext());
doReturn(mock(FilterRegistration.Dynamic.class))
.when(servletContext).addFilter(anyString(), any(Filter.class));
doReturn(mock(ServletRegistration.Dynamic.class))
.when(servletContext).addServlet(anyString(), any(Servlet.class));
env = new MockEnvironment();
props = new JHipsterProperties();
webConfigurer = new WebConfigurer(env, props);
}
@Test
public void testStartUpProdServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
webConfigurer.onStartup(servletContext);
verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class));
}
@Test
public void testStartUpDevServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
webConfigurer.onStartup(servletContext);
verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class));
}
@Test
public void testCustomizeServletContainer() {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
UndertowServletWebServerFactory container = new UndertowServletWebServerFactory();
webConfigurer.customize(container);
assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg");
assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8");
assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8");
if (container.getDocumentRoot() != null) {
assertThat(container.getDocumentRoot()).isEqualTo(new File("target/classes/static/"));
}
}
@Test
public void testCorsFilterOnApiPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
options("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"))
.andExpect(header().string(HttpHeaders.VARY, "Origin"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800"));
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"));
}
@Test
public void testCorsFilterOnOtherPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/test/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testCorsFilterDeactivated() throws Exception {
props.getCors().setAllowedOrigins(null);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testCorsFilterDeactivated2() throws Exception {
props.getCors().setAllowedOrigins(new ArrayList<>());
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
81632a77b52fecd1e8e50e2ab1e511458668596f | 1eb48edd88e92ebe037d553c404e42090ba25cfd | /src/Java/DataStructures/JavaGenerics.java | b8044cb87156a944055033a1cd28d4a938b72b27 | [] | no_license | evaleriog/HackerRank-Solutions | 46d5d6ec581870a5b7bdd7c3cbb727cc6552e32b | b7109374c54cc6c0ee288dc58ff87a872b781fa3 | refs/heads/master | 2021-04-03T14:17:04.123458 | 2020-04-10T19:35:41 | 2020-04-10T19:35:41 | 248,364,709 | 0 | 0 | null | 2020-04-10T19:35:43 | 2020-03-18T23:21:10 | Java | UTF-8 | Java | false | false | 1,510 | java | //Generic methods are a very efficient way to handle multiple datatypes using a single method. This problem will test your knowledge on Java Generic methods.
// Let's say you have an integer array and a string array. You have to write a single method printArray that can print all the elements of both arrays. The method should be able to accept both integer arrays or string arrays.
// You are given code in the editor. Complete the code so that it prints the following lines:
// 1
// 2
// 3
// Hello
// World
// Do not use method overloading because your answer will not be accepted.
package DataStructures;
import java.io.IOException;
import java.lang.reflect.Method;
class Printer
{
//Write your code here
public static <E> void printArray(E[] list){
for(E element : list){
System.out.println(element);
}
}
}
public class JavaGenerics {
public static void main( String args[] ) {
Printer myPrinter = new Printer();
Integer[] intArray = { 1, 2, 3 };
String[] stringArray = {"Hello", "World"};
myPrinter.printArray(intArray);
myPrinter.printArray(stringArray);
int count = 0;
for (Method method : Printer.class.getDeclaredMethods()) {
String name = method.getName();
if(name.equals("printArray"))
count++;
}
if(count > 1)System.out.println("Method overloading is not allowed!");
}
}
| [
"evaleriog@outlook.com"
] | evaleriog@outlook.com |
d3249203ce08b05f67445eb5fecc43625bb68cfe | d4f739bb2516b85da426b962009f5e0f2b1def7a | /app/src/main/java/com/example/nguyenvancuong_project/fragment/SingerFragment.java | e3b6001efbe364efb1844b24096805b04fd919e1 | [] | no_license | viocuong/MusicApp_Android | e1ef661f68ce955e6405c30c49f0b14f20446fdf | 4ce32c6a966a64c8161b3c6e4f393f17410d9a87 | refs/heads/master | 2023-05-07T01:46:13.512235 | 2021-06-04T04:36:53 | 2021-06-04T04:36:53 | 371,363,974 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,806 | java | package com.example.nguyenvancuong_project.fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.nguyenvancuong_project.R;
import com.example.nguyenvancuong_project.Static;
import com.example.nguyenvancuong_project.adapter.MusicAdapter;
import com.example.nguyenvancuong_project.adapter.MusicSingerAdapter;
import com.example.nguyenvancuong_project.model.Category;
import com.example.nguyenvancuong_project.model.Music;
import com.example.nguyenvancuong_project.model.Singer;
import com.example.nguyenvancuong_project.singleton.VolleySingleton;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/**
* A simple {@link Fragment} subclass.
* Use the {@link SingerFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class SingerFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private ImageView img;
private TextView name;
private Singer singer;
private Toolbar btnBack;
private RecyclerView rcv;
private ArrayList<Music> musicList = new ArrayList<>();
private MusicSingerAdapter adapter;
public SingerFragment() {
}
public static SingerFragment newInstance(String param1, String param2) {
SingerFragment fragment = new SingerFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = getArguments();
singer = (Singer)bundle.getSerializable("singer");
loadMusic(singer.getName());
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_singer, container, false);
img = v.findViewById(R.id.singerImg);
name = v.findViewById(R.id.singerName);
btnBack = v.findViewById(R.id.btnBack);
Log.d("so luong",""+musicList.size());
rcv = v.findViewById(R.id.rcv);
rcv.setLayoutManager(new LinearLayoutManager(getActivity(),RecyclerView.VERTICAL,false));
adapter = new MusicSingerAdapter(getActivity(),musicList,SingerFragment.this);
rcv.setAdapter(adapter);
setListener();
Static.loadImage(getContext(),img,"http://"+singer.getImg());
name.setText(singer.getName());
return v;
}
private void setListener() {
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getParentFragmentManager().popBackStack();
}
});
}
private void loadMusic(String name){
StringRequest rq = new StringRequest(Request.Method.POST,Static.HOST+"/api/musicbysinger", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
String n= null;
try {
n = new String(response.getBytes("ISO-8859-1"), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
JSONArray res=null;
try {
res= new JSONArray(n);
} catch (JSONException e) {
e.printStackTrace();
}
// Log.d("ket qua la",""+response+" "+res.length());
for (int i = 0; i < res.length(); i++) {
try {
JSONObject music = res.getJSONObject(i);
Singer singer = new Singer(music.getString("singer_name"), "http://" + music.getString("singer_url"), music.getString("singer_dob"));
Category category = new Category(music.getString("category_name"));
Music m = new Music(singer, category, music.getString("name"), music.getString("file_url"), music.getString("img_url"));
musicList.add(m);
//System.out.println(m.getName()+" "+m.getImageUrl()+" "+m.getSinger().getName());
} catch (JSONException e) {
e.printStackTrace();
}
}
adapter = new MusicSingerAdapter(getActivity(),musicList, SingerFragment.this);
rcv.setLayoutManager(new LinearLayoutManager(getActivity(),RecyclerView.VERTICAL,false));
rcv.setAdapter(adapter);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}){
@Nullable
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> m = new HashMap<>();
m.put("name",name);
return m;
}
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String,String> params = new HashMap<String, String>();
params.put("Content-Type","application/x-www-form-urlencoded");
return params;
}
};
VolleySingleton.getInstance(getContext()).addToRequestQueue(rq);
}
} | [
"cuong1999ads@gmail.com"
] | cuong1999ads@gmail.com |
bee98322d7751fe6353695ddf6354146eecce1ce | edeb40ab2a084e1809b546a17c1e6024fc858851 | /Projeto-Back/projetodeploy/projeto/projeto/src/main/java/com/projetointegrador/projeto/seguranca/UserDetailsServiceImpl.java | bfc138c4337852b3c8d036da1ff8b0028f9566be | [] | no_license | AnaClaudiaOT/Generation-PI-Angular | 83ebf073797cb2bb62f84da8b571ef82cacd34c6 | 9c2ae1205d3f99ce6d0fe00754d3cbb8d615f747 | refs/heads/master | 2023-01-24T00:43:39.508122 | 2020-11-17T19:55:45 | 2020-11-17T19:55:45 | 290,783,340 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package com.projetointegrador.projeto.seguranca;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import com.projetointegrador.projeto.model.UsuarioModel;
import com.projetointegrador.projeto.repository.UsuarioRepository;
@Service
public class UserDetailsServiceImpl implements UserDetailsService {
@Autowired
private UsuarioRepository userRepository;
@Override
public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException {
Optional<UsuarioModel> user = userRepository.findByEmail(userName);
user.orElseThrow(() -> new UsernameNotFoundException(userName + " not found."));
return user.map(UserDetailsImpl::new).get();
}
}
| [
"ana.claudia.tavares@hotmail.com"
] | ana.claudia.tavares@hotmail.com |
f3b8c264b7ea0e0cf2763725408fd2871821fb00 | 683b91885d0c015284f44ed39330303c15e83881 | /app/src/main/java/wadru/dcapp/Endless/DownListAdapter.java | fd0ed133043ba4f8a02e0f4e0a5c7e733c49a379 | [] | no_license | wadru/DCProject | e398eb3163bbbb81db2a8411f174e2324442e4c2 | a8dc3e455211e0c30e06c2fe4d474c2275699bb4 | refs/heads/master | 2020-06-12T12:10:01.787338 | 2017-01-06T05:06:04 | 2017-01-06T05:06:04 | 75,579,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,278 | java | package wadru.dcapp.Endless;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import java.io.File;
import java.util.ArrayList;
import wadru.dcapp.Activity.MainActivity;
import wadru.dcapp.Download.MediaScanning;
import wadru.dcapp.Extra.StaticChange;
import wadru.dcapp.R;
/**
* Created by hodongkim on 2016. 11. 25..
*/
public class DownListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private ArrayList<String> list;
private Context mContext;
private DisplayMetrics dm;
private int width;
private int height;
private boolean isData;
public static class DownViewHolder extends RecyclerView.ViewHolder {
public ImageView downimg;
public DownViewHolder(View itemView) {
super(itemView);
downimg = (ImageView) itemView.findViewById(R.id.down_img);
}
}
public DownListAdapter(ArrayList<String> list, Context context, boolean isData) {
super();
this.list = list;
this.mContext = context;
this.isData = isData;
int pixel = StaticChange.dpToPixel(context,8);
dm = mContext.getResources().getDisplayMetrics();
width = dm.widthPixels/2-pixel;
height = dm.heightPixels-pixel;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position){
String fileName = list.get(position);
final File file = new File(MainActivity.storagePath,fileName);
Uri imgUri = Uri.fromFile(file);
Glide.with(mContext).load(imgUri).asBitmap().skipMemoryCache(false).diskCacheStrategy(DiskCacheStrategy.RESULT).override(width,height).into(((DownViewHolder)holder).downimg);
((DownViewHolder)holder).downimg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder= new AlertDialog.Builder(v.getContext());
builder.setTitle("이미지 삭제").setMessage("위 이미지를 삭제하시겠습니까?").setCancelable(false).setPositiveButton("삭제", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
file.delete();
list.clear();
File file1 = MainActivity.storagePath;
String[] mPreList = file1.list();
for(int i=mPreList.length-1; i>-1; i--){
list.add(mPreList[i]);
}
DownListAdapter.this.notifyDataSetChanged();
}
}).setNegativeButton("취소", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
});
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
Context context = parent.getContext();
LayoutInflater layoutInflater = LayoutInflater.from(context);
RecyclerView.ViewHolder viewHolder;
View detailView = layoutInflater.inflate(R.layout.down_gall_item,parent,false);
viewHolder = new DownViewHolder(detailView);
return viewHolder;
}
@Override
public int getItemCount() {
if(isData){
return list.size();
}else{
return 0;
}
}
@Override
public int getItemViewType(int position) {
return super.getItemViewType(position);
}
@Override
public long getItemId(int position) {
return super.getItemId(position);
}
}
| [
"uieu6408@gmail.com"
] | uieu6408@gmail.com |
829c24e99e50c774f7c9298637ec09455ee15977 | 8c53dc77a7c33ef56d2eb2323812d645c8c0b7db | /Exams/ExamPrep2/src/main/java/hell/engine/Engine.java | 264d0e3730d5c07fea3b0f9758fb75aafdec413e | [] | no_license | AleksandarBoev/Software-University-Java-OOP-Advanced | a68a1305db7fb3ba2d9a24bdad91e86ce298c7d8 | 2c92ab3beb5371ea8d8df78ea79cf493ad18cb19 | refs/heads/master | 2020-03-22T15:58:39.173553 | 2018-10-23T19:42:58 | 2018-10-23T19:42:58 | 140,293,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package hell.engine;
import java.io.IOException;
public interface Engine {
void run() throws IOException, NoSuchFieldException, IllegalAccessException;
}
| [
"aleksandarboev95@gmail.com"
] | aleksandarboev95@gmail.com |
f27a6148a6c2689f9970d2c4c99cf51694e487e6 | 42244a7b579fd91c0c34385d71b0a725c936a242 | /src/com/coolweather/android/util/HttpUtil.java | d8bccc7b2731476c772e16e6f1e5141c54877ed0 | [] | no_license | qiou2719/coolweather | 032122fc5c698b83d855f8620bbd067b0275fdd7 | 852ee12c4de18a25b83406c38e801ffd56dbd9bd | refs/heads/master | 2021-01-21T17:23:25.493089 | 2017-03-22T08:11:33 | 2017-03-22T08:11:33 | 85,279,994 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package com.coolweather.android.util;
import okhttp3.OkHttpClient;
public class HttpUtil
{
public static void sendOkHttpRequest(String address, okhttp3.Callback callback)
{
OkHttpClient client = new OkHttpClient();
okhttp3.Request request = new okhttp3.Request.Builder().url(address).build();
client.newCall(request).enqueue(callback);
}
}
| [
"n007546@archermind.com"
] | n007546@archermind.com |
e42e5995c634f2ffeae4424054b597b7a770bda7 | 7f51a61cc07068a2489b222a0aad620f228c7bca | /masterdata/src/test/java/org/motechproject/nms/masterdata/it/HealthFacilityCsvHandlerIT.java | 3c7fe186a034c191e56d8da43f61ba4f83e28659 | [
"BSD-2-Clause"
] | permissive | motech-implementations/bbc-nms | 996c52fe249a552a42af80b86dc7cb3d6e76bb63 | 4796bed392227e847b0511c5bd30ede3a0d4ea6a | refs/heads/master | 2021-01-02T08:09:26.700539 | 2015-02-24T16:27:06 | 2015-03-20T17:35:47 | 28,104,008 | 2 | 5 | null | null | null | null | UTF-8 | Java | false | false | 5,361 | java | package org.motechproject.nms.masterdata.it;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.motechproject.nms.masterdata.constants.LocationConstants;
import org.motechproject.nms.masterdata.domain.*;
import org.motechproject.nms.masterdata.event.handler.HealthFacilityCsvUploadHandler;
import org.motechproject.nms.masterdata.service.*;
import org.motechproject.nms.util.service.BulkUploadErrLogService;
import org.motechproject.testing.osgi.BasePaxIT;
import org.motechproject.testing.osgi.container.MotechNativeTestContainerFactory;
import org.ops4j.pax.exam.ExamFactory;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerSuite;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.List;
import static junit.framework.TestCase.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
* This class is used to test(IT) the operations of HealthFacility Csv
*/
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerSuite.class)
@ExamFactory(MotechNativeTestContainerFactory.class)
public class HealthFacilityCsvHandlerIT extends BasePaxIT {
private HealthFacilityCsvUploadHandler healthFacilityCsvHandler;
List<Long> createdIds = new ArrayList<Long>();
@Inject
private StateService stateService;
@Inject
private DistrictService districtService;
@Inject
private TalukaService talukaService;
@Inject
private HealthFacilityCsvService healthFacilityCsvService;
@Inject
private HealthFacilityService healthFacilityService;
@Inject
private HealthBlockService healthBlockService;
@Inject
private BulkUploadErrLogService bulkUploadErrLogService;
@Before
public void setUp() {
healthFacilityCsvHandler = new HealthFacilityCsvUploadHandler(stateService,
districtService, talukaService, healthFacilityCsvService,
healthFacilityService, healthBlockService, bulkUploadErrLogService);
}
@Test
public void testDataServiceInstance() throws Exception {
assertNotNull(healthFacilityCsvService);
assertNotNull(healthFacilityService);
assertNotNull(talukaService);
assertNotNull(districtService);
assertNotNull(stateService);
assertNotNull(bulkUploadErrLogService);
assertNotNull(healthFacilityCsvHandler);
}
@Test
public void testHealthFacilityCsvHandler() {
State stateData = TestHelper.getStateData();
District districtData = TestHelper.getDistrictData();
Taluka talukaData = TestHelper.getTalukaData();
HealthBlock healthBlockData = TestHelper.getHealthBlockData();
stateData.getDistrict().add(districtData);
districtData.getTaluka().add(talukaData);
talukaData.getHealthBlock().add(healthBlockData);
stateService.create(stateData);
HealthFacilityCsv csvData = TestHelper.getHealthFacilityCsvData();
HealthFacilityCsv invalidCsvData = TestHelper.getInvalidHealthFacilityCsvData();
createHealthFacilityCsvData(csvData);
createHealthFacilityCsvData(invalidCsvData);
createdIds.add(csvData.getId());
createdIds.add(invalidCsvData.getId());
createdIds.add(csvData.getId() + 1);
healthFacilityCsvHandler.healthFacilityCsvSuccess(TestHelper.createMotechEvent(createdIds, LocationConstants.HEALTH_FACILITY_CSV_SUCCESS));
HealthFacility healthFacilityData = healthFacilityService.findHealthFacilityByParentCode(123L, 456L, 8L, 1002L, 1111L);
assertNotNull(healthFacilityData);
assertTrue(123L == healthFacilityData.getStateCode());
assertTrue(456L == healthFacilityData.getDistrictCode());
assertTrue(8L == healthFacilityData.getTalukaCode());
assertTrue(1002L == healthFacilityData.getHealthBlockCode());
assertTrue(1111L == healthFacilityData.getHealthFacilityCode());
assertTrue(9999L == healthFacilityData.getHealthFacilityType());
assertTrue("HF1".equals(healthFacilityData.getName()));
csvData = TestHelper.getUpdateHealthFacilityCsvData();
createHealthFacilityCsvData(csvData);
clearId();
createdIds.add(csvData.getId());
healthFacilityCsvHandler.healthFacilityCsvSuccess(TestHelper.createMotechEvent(createdIds, LocationConstants.HEALTH_FACILITY_CSV_SUCCESS));
HealthFacility healthFacilityUpdateData = healthFacilityService.findHealthFacilityByParentCode(123L, 456L, 8L, 1002L, 1111L);
assertNotNull(healthFacilityUpdateData);
assertTrue(123L == healthFacilityUpdateData.getStateCode());
assertTrue(456L == healthFacilityUpdateData.getDistrictCode());
assertTrue(8L == healthFacilityUpdateData.getTalukaCode());
assertTrue(1002L == healthFacilityUpdateData.getHealthBlockCode());
assertTrue(1111L == healthFacilityUpdateData.getHealthFacilityCode());
assertTrue(9999L == healthFacilityUpdateData.getHealthFacilityType());
assertTrue("HF2".equals(healthFacilityUpdateData.getName()));
}
private void clearId() {
createdIds.clear();
}
private void createHealthFacilityCsvData(HealthFacilityCsv csvData) {
healthFacilityCsvService.create(csvData);
}
}
| [
"kthirumalai@grameenfoundation.org"
] | kthirumalai@grameenfoundation.org |
0f95b1a814629cefebeb4bba69e4f1e542a5a07e | 24e51ece7d63bc6898020d73a34d35d1e7254741 | /exaliquo/ExtraCompost.java | bc3c745ea3c120c3729dec8642ad692d2a1d7eff | [
"MIT"
] | permissive | regelneef/Ex-Aliquo | e2fca0b8858a93b04f77851a5177207c09a41fbf | 858eef1f9e6efddb1b51938bb9e0e9a7dc022a25 | refs/heads/master | 2020-12-27T01:45:56.488396 | 2014-03-19T10:54:44 | 2014-03-19T10:54:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,895 | java | package exaliquo;
import net.minecraft.item.Item;
import exnihilo.registries.CompostRegistry;
import exnihilo.registries.ColorRegistry;
import static exaliquo.data.ModIDs.getIDs;
import exaliquo.data.Configurations;
import exaliquo.data.ModIDs.Info;
public class ExtraCompost
{
public static void registerTinkerCompost()
{
if (Configurations.allowTinkerBushCompost)
{
CompostRegistry.register(getIDs(Info.oreberry), 0, 1.0F, ColorRegistry.color("ironberry"));
CompostRegistry.register(getIDs(Info.oreberry), 1, 1.0F, ColorRegistry.color("goldberry"));
CompostRegistry.register(getIDs(Info.oreberry), 2, 1.0F, ColorRegistry.color("copperberry"));
CompostRegistry.register(getIDs(Info.oreberry), 3, 1.0F, ColorRegistry.color("tinberry"));
CompostRegistry.register(getIDs(Info.oreberrybush2), 0, 1.0F, ColorRegistry.color("aluminumberry"));
CompostRegistry.register(getIDs(Info.oreberrybush2), 1, 1.0F, ColorRegistry.color("essenceberry"));
}
CompostRegistry.register(getIDs(Info.oreberry), 5, 0.1F, ColorRegistry.color("essenceberry"));
CompostRegistry.register(getIDs(Info.hambone), 0, 1.0F, ColorRegistry.color("pork_raw"));
}
public static void registerNaturaCompost()
{
CompostRegistry.register(getIDs(Info.good), 0, 0.2F, ColorRegistry.color("raspbush"));
CompostRegistry.register(getIDs(Info.good), 1, 0.2F, ColorRegistry.color("bluebush"));
CompostRegistry.register(getIDs(Info.good), 2, 0.2F, ColorRegistry.color("blackbush"));
CompostRegistry.register(getIDs(Info.good), 3, 0.2F, ColorRegistry.color("geobush"));
CompostRegistry.register(getIDs(Info.evil), 0, 0.2F, ColorRegistry.color("blightbush"));
CompostRegistry.register(getIDs(Info.evil), 1, 0.2F, ColorRegistry.color("duskbush"));
CompostRegistry.register(getIDs(Info.evil), 2, 0.2F, ColorRegistry.color("skybush"));
CompostRegistry.register(getIDs(Info.evil), 3, 0.2F, ColorRegistry.color("stingbush"));
CompostRegistry.register(getIDs(Info.goodberry), 0, 0.05F, ColorRegistry.color("raspberry"));
CompostRegistry.register(getIDs(Info.goodberry), 1, 0.05F, ColorRegistry.color("blueberry"));
CompostRegistry.register(getIDs(Info.goodberry), 2, 0.05F, ColorRegistry.color("blackberry"));
CompostRegistry.register(getIDs(Info.goodberry), 3, 0.05F, ColorRegistry.color("geoberry"));
CompostRegistry.register(getIDs(Info.badberry), 0, 0.05F, ColorRegistry.color("blightberry"));
CompostRegistry.register(getIDs(Info.badberry), 1, 0.05F, ColorRegistry.color("duskbery"));
CompostRegistry.register(getIDs(Info.badberry), 2, 0.05F, ColorRegistry.color("skyberry"));
CompostRegistry.register(getIDs(Info.badberry), 3, 0.05F, ColorRegistry.color("stingberry"));
CompostRegistry.register(getIDs(Info.leaves), 0, 0.005F, ColorRegistry.color("redwood"));
CompostRegistry.register(getIDs(Info.leaves), 1, 0.125F, ColorRegistry.color("eucalyptus"));
CompostRegistry.register(getIDs(Info.leaves), 2, 0.125F, ColorRegistry.color("hopseed"));
CompostRegistry.register(getIDs(Info.rareleaves), 0, 0.125F, ColorRegistry.color("maple"));
CompostRegistry.register(getIDs(Info.rareleaves), 1, 0.125F, ColorRegistry.color("silverbell"));
CompostRegistry.register(getIDs(Info.rareleaves), 2, 0.125F, ColorRegistry.color("amaranth"));
CompostRegistry.register(getIDs(Info.rareleaves), 3, 0.125F, ColorRegistry.color("tigerwood"));
CompostRegistry.register(getIDs(Info.darkleaves), 0, 0.125F, ColorRegistry.color("darkwood"));
CompostRegistry.register(getIDs(Info.darkleaves), 1, 0.125F, ColorRegistry.color("darkwood"));
CompostRegistry.register(getIDs(Info.darkleaves), 2, 0.125F, ColorRegistry.color("darkwood"));
CompostRegistry.register(getIDs(Info.darkleaves), 3, 0.125F, ColorRegistry.color("fusewood"));
CompostRegistry.register(getIDs(Info.monochrome), 0, 0.125F, ColorRegistry.color("sakura"));
CompostRegistry.register(getIDs(Info.monochrome), 1, 0.125F, ColorRegistry.color("ghostwood"));
CompostRegistry.register(getIDs(Info.monochrome), 2, 0.125F, ColorRegistry.color("bloodwood"));
CompostRegistry.register(getIDs(Info.monochrome), 3, 0.125F, ColorRegistry.color("willow"));
CompostRegistry.register(getIDs(Info.flora), 0, 0.005F, ColorRegistry.color("redwood"));
CompostRegistry.register(getIDs(Info.flora), 1, 0.125F, ColorRegistry.color("eucalyptus"));
CompostRegistry.register(getIDs(Info.flora), 2, 0.125F, ColorRegistry.color("hopseed"));
CompostRegistry.register(getIDs(Info.flora), 3, 0.125F, ColorRegistry.color("sakura"));
CompostRegistry.register(getIDs(Info.flora), 4, 0.125F, ColorRegistry.color("ghostwood"));
CompostRegistry.register(getIDs(Info.flora), 5, 0.125F, ColorRegistry.color("bloodwood"));
CompostRegistry.register(getIDs(Info.flora), 6, 0.125F, ColorRegistry.color("darkwood"));
CompostRegistry.register(getIDs(Info.flora), 7, 0.125F, ColorRegistry.color("fusewood"));
CompostRegistry.register(getIDs(Info.raresap), 0, 0.125F, ColorRegistry.color("maple"));
CompostRegistry.register(getIDs(Info.raresap), 1, 0.125F, ColorRegistry.color("silverbell"));
CompostRegistry.register(getIDs(Info.raresap), 2, 0.125F, ColorRegistry.color("amaranth"));
CompostRegistry.register(getIDs(Info.raresap), 3, 0.125F, ColorRegistry.color("tigerwood"));
CompostRegistry.register(getIDs(Info.raresap), 4, 0.125F, ColorRegistry.color("willow"));
CompostRegistry.register(getIDs(Info.glowshroom), 0, 0.1F, ColorRegistry.color("blueglow"));
CompostRegistry.register(getIDs(Info.glowshroom), 1, 0.1F, ColorRegistry.color("greenglow"));
CompostRegistry.register(getIDs(Info.glowshroom), 2, 0.1F, ColorRegistry.color("purpleglow"));
CompostRegistry.register(getIDs(Info.cactus), 0, 0.1F, ColorRegistry.color("saguaro"));
CompostRegistry.register(getIDs(Info.fruit), 0, 0.1F, ColorRegistry.color("fruit"));
CompostRegistry.register(getIDs(Info.potash), 0, 0.1F, ColorRegistry.color("potash"));
CompostRegistry.register(getIDs(Info.plants), 0, 0.08F, ColorRegistry.color("barley"));
CompostRegistry.register(getIDs(Info.plants), 1, 0.08F, ColorRegistry.color("barley"));
CompostRegistry.register(getIDs(Info.plants), 2, 0.08F, ColorRegistry.color("flour"));
CompostRegistry.register(getIDs(Info.plants), 3, 0.04F, ColorRegistry.color("white"));
CompostRegistry.register(getIDs(Info.bluebell), 0, 0.1F, ColorRegistry.color("bluebell"));
CompostRegistry.register(getIDs(Info.thornvines), 0, 0.1F, ColorRegistry.color("thornvine"));
CompostRegistry.register(getIDs(Info.impmeat), 0, 0.2F, ColorRegistry.color("impmeat"));
CompostRegistry.register(getIDs(Info.impmeat), 1, 0.2F, ColorRegistry.color("impmeat"));
}
public static void registerArsCompost()
{
CompostRegistry.register(getIDs(Info.nova), 0, 0.1F, ColorRegistry.color("nova"));
CompostRegistry.register(getIDs(Info.orchid), 0, 0.1F, ColorRegistry.color("orchid"));
CompostRegistry.register(getIDs(Info.aum), 0, 0.1F, ColorRegistry.color("white"));
CompostRegistry.register(getIDs(Info.witchwood), 0, 0.125F, ColorRegistry.color("witchwood"));
CompostRegistry.register(getIDs(Info.witchleaves), 0, 0.125F, ColorRegistry.color("witchwood"));
CompostRegistry.register(getIDs(Info.wakebloom), 0, 0.125F, ColorRegistry.color("wakebloom"));
CompostRegistry.register(getIDs(Info.tarma), 0, 0.125F, ColorRegistry.color("tarma"));
}
public static void registerThaumicCompost()
{
CompostRegistry.register(getIDs(Info.thaumplants), 0, 0.125F, ColorRegistry.color("greatwood"));
CompostRegistry.register(getIDs(Info.thaumplants), 1, 0.125F, ColorRegistry.color("silverwood"));
CompostRegistry.register(getIDs(Info.thaumplants), 2, 0.1F, ColorRegistry.color("shimmerleaf"));
CompostRegistry.register(getIDs(Info.thaumplants), 3, 0.1F, ColorRegistry.color("cinderpearl"));
CompostRegistry.register(getIDs(Info.thaumplants), 4, 0.1F, ColorRegistry.color("etherealbloom"));
CompostRegistry.register(getIDs(Info.thaumleaves), 0, 0.125F, ColorRegistry.color("greatwood"));
CompostRegistry.register(getIDs(Info.thaumleaves), 1, 0.125F, ColorRegistry.color("silverwood"));
}
public static void registerGrowthcraftAppleCompost()
{
CompostRegistry.register(getIDs(Info.gcapple), 0, 0.03125F, ColorRegistry.color("apple"));
CompostRegistry.register(Item.appleRed.itemID, 0, 0.03125F, ColorRegistry.color("apple"));
CompostRegistry.register(getIDs(Info.gcsappling), 0, 0.03125F, ColorRegistry.color("oak"));
}
public static void registerGrowthcraftBambooCompost()
{
CompostRegistry.register(getIDs(Info.gcbamboo), 0, 0.125F, ColorRegistry.color("oak"));
CompostRegistry.register(getIDs(Info.gcleaves), 0, 0.125F, ColorRegistry.color("oak"));
}
public static void registerMFRCompost()
{
CompostRegistry.register(getIDs(Info.rubberleaves), 0, 0.125F, ColorRegistry.color("oak"));
CompostRegistry.register(getIDs(Info.rubbersapling), 0, 0.125F, ColorRegistry.color("oak"));
}
} | [
"Zerokyuuni@users.noreply.github.com"
] | Zerokyuuni@users.noreply.github.com |
90501d670af0eeca19d4cccac48e194abb116739 | 66e8aa42c8573ec2f2e4b766e7f781cb448b73f2 | /paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/UacRoleMenuService.java | 504f04bff25ce6bc3c7207072e1fa76a9823401a | [
"Apache-2.0"
] | permissive | NewlyLan/nearEat | 528db429fad958da087f64f53c6c9188f17d924f | 99007ca6335958dff5328a03e4b1cb8eb08ca8d8 | refs/heads/master | 2020-05-16T23:13:50.177300 | 2019-04-25T05:06:19 | 2019-04-25T05:06:19 | 183,357,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,299 | java | /*
* Copyright (c) 2018. paascloud.net All Rights Reserved.
* 项目名称:附近有好吃的
* 类名称:UacRoleMenuService.java
* 创建人:兰龙斌
* 联系方式:llb7891@163.com
* 开源地址: https://github.com/NewlyLan/nearbyEat.git
*
*
*/
package com.paascloud.provider.service;
import com.paascloud.provider.model.domain.UacRoleMenu;
import com.paascloud.core.support.IService;
import java.util.List;
import java.util.Set;
/**
* The interface Uac role menu service.
*
* @author paascloud.net @gmail.com
*/
public interface UacRoleMenuService extends IService<UacRoleMenu> {
/**
* Del role menu list int.
*
* @param uacRoleMenus the uac role menus
*
* @return the int
*/
int delRoleMenuList(Set<UacRoleMenu> uacRoleMenus);
/**
* Delete by role id.
*
* @param roleId the role id
*/
void deleteByRoleId(Long roleId);
/**
* List by role id list.
*
* @param roleId the role id
*
* @return the list
*/
List<UacRoleMenu> listByRoleId(Long roleId);
/**
* Insert.
*
* @param roleId the role id
* @param menuIdList the menu id list
*/
void insert(Long roleId, Set<Long> menuIdList);
/**
* Delete by role id list.
*
* @param roleIdList the role id list
*/
void deleteByRoleIdList(List<Long> roleIdList);
}
| [
"826550251@qq.com"
] | 826550251@qq.com |
7e4544dc89b1d2fe306ea78e8f00df50559073d3 | d3cbb93c650410964e20ca855f723b540b95047e | /src/main/java/com/ems/config/CacheConfiguration.java | 091f2f2dbdb8aaad64d4265199ed0581bb82475e | [] | no_license | BulkSecurityGeneratorProject/ems-java | a87511b7d8da4bbb692bd604a8e765254b14ed5e | 0b3f33c31f12250d2eb6431889114ed1f5d44485 | refs/heads/master | 2022-12-17T12:45:05.580845 | 2018-04-11T19:30:31 | 2018-04-11T19:30:31 | 296,588,486 | 0 | 0 | null | 2020-09-18T10:24:52 | 2020-09-18T10:24:51 | null | UTF-8 | Java | false | false | 2,215 | java | package com.ems.config;
import io.github.jhipster.config.JHipsterProperties;
import org.ehcache.config.builders.CacheConfigurationBuilder;
import org.ehcache.config.builders.ResourcePoolsBuilder;
import org.ehcache.expiry.Duration;
import org.ehcache.expiry.Expirations;
import org.ehcache.jsr107.Eh107Configuration;
import java.util.concurrent.TimeUnit;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.*;
@Configuration
@EnableCaching
@AutoConfigureAfter(value = { MetricsConfiguration.class })
@AutoConfigureBefore(value = { WebConfigurer.class, DatabaseConfiguration.class })
public class CacheConfiguration {
private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration;
public CacheConfiguration(JHipsterProperties jHipsterProperties) {
JHipsterProperties.Cache.Ehcache ehcache =
jHipsterProperties.getCache().getEhcache();
jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration(
CacheConfigurationBuilder.newCacheConfigurationBuilder(Object.class, Object.class,
ResourcePoolsBuilder.heap(ehcache.getMaxEntries()))
.withExpiry(Expirations.timeToLiveExpiration(Duration.of(ehcache.getTimeToLiveSeconds(), TimeUnit.SECONDS)))
.build());
}
@Bean
public JCacheManagerCustomizer cacheManagerCustomizer() {
return cm -> {
cm.createCache(com.ems.repository.UserRepository.USERS_BY_LOGIN_CACHE, jcacheConfiguration);
cm.createCache(com.ems.repository.UserRepository.USERS_BY_EMAIL_CACHE, jcacheConfiguration);
cm.createCache(com.ems.domain.User.class.getName(), jcacheConfiguration);
cm.createCache(com.ems.domain.Authority.class.getName(), jcacheConfiguration);
cm.createCache(com.ems.domain.User.class.getName() + ".authorities", jcacheConfiguration);
// jhipster-needle-ehcache-add-entry
};
}
}
| [
"test@test.com"
] | test@test.com |
23efcb8c205998ffb18b17790caa0d708e8cbd97 | f6a24190c35f4a77ca292189bc05d0deefe0f77f | /src/com/vo/Product.java | 448a13ae68eee952bb6fcf32d058ab233de6dd52 | [] | no_license | lihuiyan97/JD1.2.0 | 30d7cae5aafbd5849f001556e49248d79d3a852d | 25d9dba9e7e0211ab40d17c1084e7f5a35ec4fdb | refs/heads/master | 2021-05-15T23:40:14.509765 | 2017-10-14T13:27:55 | 2017-10-14T13:27:55 | 106,930,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,040 | java | package com.vo;
public class Product {
private Integer pid;
private String pname;
private double price;
private int pingjiaSum;
private String dianpuName;
private String productListLargeImage;
private String productListSmallImage1;
private String productListSmallImage2;
private String productListSmallImage3;
private String pdesc;
private int productSum;
private String detailLargeImg;
private String detailSmallImg1;
private String detailSmallImg2;
private String detailSmallImg3;
private String detailSmallImg4;
private String detailSmallImg5;
private Integer onsale;
public Integer getOnsale() {
return onsale;
}
public void setOnsale(Integer onsale) {
this.onsale = onsale;
}
private Integer cid;
public Integer getPid() {
return pid;
}
public void setPid(Integer pid) {
this.pid = pid;
}
public String getPname() {
return pname;
}
public void setPname(String pname) {
this.pname = pname;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getPingjiaSum() {
return pingjiaSum;
}
public void setPingjiaSum(int pingjiaSum) {
this.pingjiaSum = pingjiaSum;
}
public String getDianpuName() {
return dianpuName;
}
public void setDianpuName(String dianpuName) {
this.dianpuName = dianpuName;
}
public String getProductListLargeImage() {
return productListLargeImage;
}
public void setProductListLargeImage(String productListLargeImage) {
this.productListLargeImage = productListLargeImage;
}
public String getProductListSmallImage1() {
return productListSmallImage1;
}
public void setProductListSmallImage1(String productListSmallImage1) {
this.productListSmallImage1 = productListSmallImage1;
}
public String getProductListSmallImage2() {
return productListSmallImage2;
}
public void setProductListSmallImage2(String productListSmallImage2) {
this.productListSmallImage2 = productListSmallImage2;
}
public String getProductListSmallImage3() {
return productListSmallImage3;
}
public void setProductListSmallImage3(String productListSmallImage3) {
this.productListSmallImage3 = productListSmallImage3;
}
public String getPdesc() {
return pdesc;
}
public void setPdesc(String pdesc) {
this.pdesc = pdesc;
}
public int getProductSum() {
return productSum;
}
public void setProductSum(int productSum) {
this.productSum = productSum;
}
public String getDetailLargeImg() {
return detailLargeImg;
}
public void setDetailLargeImg(String detailLargeImg) {
this.detailLargeImg = detailLargeImg;
}
public String getDetailSmallImg1() {
return detailSmallImg1;
}
public void setDetailSmallImg1(String detailSmallImg1) {
this.detailSmallImg1 = detailSmallImg1;
}
public String getDetailSmallImg2() {
return detailSmallImg2;
}
public void setDetailSmallImg2(String detailSmallImg2) {
this.detailSmallImg2 = detailSmallImg2;
}
public String getDetailSmallImg3() {
return detailSmallImg3;
}
public void setDetailSmallImg3(String detailSmallImg3) {
this.detailSmallImg3 = detailSmallImg3;
}
public String getDetailSmallImg4() {
return detailSmallImg4;
}
public void setDetailSmallImg4(String detailSmallImg4) {
this.detailSmallImg4 = detailSmallImg4;
}
public String getDetailSmallImg5() {
return detailSmallImg5;
}
public void setDetailSmallImg5(String detailSmallImg5) {
this.detailSmallImg5 = detailSmallImg5;
}
@Override
public String toString() {
return "Product [pid=" + pid + ", pname=" + pname + ", price=" + price
+ ", pingjiaSum=" + pingjiaSum + ", dianpuName=" + dianpuName
+ ", pdesc=" + pdesc + ", productSum=" + productSum
+ ", onsale=" + onsale + ", cid=" + cid + "]";
}
public Integer getCid() {
return cid;
}
public void setCid(Integer cid) {
this.cid = cid;
}
}
| [
"lihuiyan97@qq.com"
] | lihuiyan97@qq.com |
89c72f650590d1108f572b3e2a027379fbae9333 | 3fd6b0a7d7cc1d1443758e33e59af876b6e5ce2d | /mybaits/src/main/java/com/springboot/dao/CityDao.java | b6a2d7a2a2f67bf00de06909476f221c21bd1f92 | [] | no_license | zhouyb126/springboot | c68e87b78b17f2aae62fb803d701678e9ff6661b | 643189a553d4f59066c6731877873c7a22dbb046 | refs/heads/master | 2022-08-04T03:00:18.273317 | 2019-08-13T07:54:51 | 2019-08-13T07:54:51 | 202,055,479 | 0 | 0 | null | 2022-06-21T01:39:28 | 2019-08-13T03:19:17 | Java | UTF-8 | Java | false | false | 374 | java | package com.springboot.dao;
import com.springboot.domain.City;
import org.apache.ibatis.annotations.Param;
/**
* 城市 DAO 接口类
* Created by wanglu-jf on 17/6/27.
*/
public interface CityDao {
/**
* 根据城市名称,查询城市信息
*
* @param cityName 城市名
*/
public City queryByName(@Param("cityName") String cityName);
}
| [
"password"
] | password |
3b2b803895f611f599f2d0d46d7ad0e5234a42ed | 421b92d1d8f5efe643bd9c09bb666fc08952b717 | /app/src/main/java/com/mndev/diplomski/AudioMasterActivity.java | 3027440ab69c9a3d85d4525149168ee9eeb69eb9 | [] | no_license | nikola-miljkovic/Diplomski | ac20f90c6fa9bf809e96d384a9082228e15f42a3 | d0b893e4be81f02d706133ef723c34398c8e6de4 | refs/heads/master | 2021-07-05T13:02:00.134403 | 2017-09-28T22:31:04 | 2017-09-28T22:31:04 | 104,000,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,885 | java | package com.mndev.diplomski;
import android.app.Activity;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioRecord;
import android.media.MediaPlayer;
import android.media.MediaRecorder;
import android.media.ToneGenerator;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.TextView;
import com.mndev.diplomski.model.AudioParamsModel;
import com.mndev.diplomski.utils.TimeUtils;
import static com.mndev.diplomski.FunctionSurface.SAMPLE_RATE;
public class AudioMasterActivity extends Activity implements SurfaceHolder.Callback {
private final Handler mHandler = new Handler();
private long[] mTimestampVector;
private AudioParamsModel mParams;
private Paint mPaint;
private SurfaceView mSurfaceView;
private SurfaceHolder mSurfaceHolder;
private BeepThread mBeepThread;
private TextView mActualTimestampTV;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_audio_master);
mParams = (AudioParamsModel)getIntent().getSerializableExtra(MainActivity.EXTRA_AUDIO_PARAMS);
mTimestampVector = TimeUtils.getTimeVector(mParams.getTime(), mParams.getInterval(), mParams.getIterations());
mActualTimestampTV = (TextView)findViewById(R.id.tv_actualts);
mSurfaceView = (SurfaceView)findViewById(R.id.audio_surface);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
mPaint = new Paint();
mPaint.setStrokeWidth(8.0f);
mPaint.setAntiAlias(true);
mPaint.setColor(Color.BLUE);
mBeepThread = new BeepThread(mHandler, mTimestampVector, mParams);
long delta = mTimestampVector[0] - System.currentTimeMillis();
mHandler.postDelayed(mBeepThread, delta);
}
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
recordAudio();
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
}
@Override
protected void onStop() {
super.onStop();
mHandler.removeCallbacks(mBeepThread);
}
void recordAudio() {
new Thread(new Runnable() {
@Override
public void run() {
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO);
// buffer size in bytes
int bufferSize = AudioRecord.getMinBufferSize(SAMPLE_RATE,
AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT);
if (bufferSize == AudioRecord.ERROR || bufferSize == AudioRecord.ERROR_BAD_VALUE) {
bufferSize = SAMPLE_RATE * 2;
}
float drawSize;
float drawY = (float) mSurfaceView.getHeight() / 2;
short[] audioBuffer = new short[bufferSize / 2];
AudioRecord record = new AudioRecord(MediaRecorder.AudioSource.DEFAULT,
SAMPLE_RATE,
AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT,
bufferSize / 2);
if (record.getState() != AudioRecord.STATE_INITIALIZED) {
Log.e("AUDIO", "Audio Record can't initialize!");
return;
}
record.startRecording();
Log.v("AUDIO", "Start recording");
float rms = 0.0f;
long time = System.currentTimeMillis();
FunctionSurface functionSurface = new FunctionSurface(mSurfaceView.getMeasuredHeight(), mSurfaceView.getMeasuredWidth(), 120);
while (true) {
long timeMil = System.currentTimeMillis();
int numberOfShort = record.read(audioBuffer, 0, audioBuffer.length);
drawSize = (float) mSurfaceView.getWidth() * 4 / bufferSize;
rms = 0.0f;
for (int i = 0; i < audioBuffer.length; i += 1) {
rms += audioBuffer[i] * audioBuffer[i];
}
rms = 20.0f * (float)Math.log10(Math.sqrt(rms / audioBuffer.length));
functionSurface.addValue(rms);
if (System.currentTimeMillis() - 16 > time) {
Canvas canvas = mSurfaceHolder.lockCanvas();
canvas.drawColor(Color.WHITE);
functionSurface.draw(canvas);
mSurfaceHolder.unlockCanvasAndPost(canvas);
time = System.currentTimeMillis();
AudioMasterActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
long currentTime = System.currentTimeMillis();
mActualTimestampTV.setText(String.valueOf(currentTime));
}
});
}
}
/*record.stop();
record.release();
Log.v("OUTPUTS", String.format("Recording stopped. Samples read: %d", shortsRead));*/
}
}).start();
}
private class BeepThread implements Runnable {
private Handler mHandler;
private long mDelta;
private ToneGenerator mTone = new ToneGenerator(AudioManager.STREAM_ALARM, 80);
long[] mVector;
AudioParamsModel mParams;
int mIteration = 0;
public BeepThread(Handler handler, long[] vector, AudioParamsModel params) {
mHandler = handler;
mVector = vector;
mParams = params;
}
@Override
public void run() {
mTone.startTone(ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD, 200);
mDelta = System.currentTimeMillis() - mVector[mIteration];
mIteration += 1;
if (mIteration == mVector.length) {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
MediaPlayer mPlayer = MediaPlayer.create(AudioMasterActivity.this, R.raw.mario);
mPlayer.start();
}
}, 5000 - mDelta);
} else {
mHandler.postDelayed(this, mParams.getInterval() - mDelta);
}
}
}
}
| [
"milja1337@gmail.com"
] | milja1337@gmail.com |
ffc53b178d9cc85167730bbf731bcd8aa15ee621 | 31681f165a1caf3cfe068f7bbb00f9c674dee5ee | /nachos/machine/Config.java | 7a7ddc8fd34ce3164c080c46cc72eaadc89ab1d5 | [
"MIT-Modern-Variant",
"MIT"
] | permissive | vacancy/Nachos-Threading | c8be5f8898aaab9e7d732492015d335d56842f7f | 92a382389bef2be76fb464ec7316764b8d1f7203 | refs/heads/master | 2021-03-27T10:02:33.371534 | 2017-04-30T09:29:09 | 2017-04-30T09:29:09 | 84,129,541 | 1 | 0 | null | 2017-04-30T09:29:10 | 2017-03-06T22:56:39 | Java | UTF-8 | Java | false | false | 8,507 | java | // PART OF THE MACHINE SIMULATION. DO NOT CHANGE.
package nachos.machine;
import java.util.HashMap;
import java.io.File;
import java.io.FileReader;
import java.io.Reader;
import java.io.StreamTokenizer;
/**
* Provides routines to access the Nachos configuration.
*/
public final class Config {
/**
* Load configuration information from the specified file. Must be called
* before the Nachos security manager is installed.
*
* @param fileName
* the name of the file containing the configuration to use.
*/
public static void load(String fileName) {
System.out.print(" config");
Lib.assertTrue(!loaded);
loaded = true;
configFile = fileName;
try {
config = new HashMap<String, String>();
File file = new File(configFile);
Reader reader = new FileReader(file);
StreamTokenizer s = new StreamTokenizer(reader);
s.resetSyntax();
s.whitespaceChars(0x00, 0x20);
s.wordChars(0x21, 0xFF);
s.eolIsSignificant(true);
s.commentChar('#');
s.quoteChar('"');
int line = 1;
s.nextToken();
while (true) {
if (s.ttype == StreamTokenizer.TT_EOF)
break;
if (s.ttype == StreamTokenizer.TT_EOL) {
line++;
s.nextToken();
continue;
}
if (s.ttype != StreamTokenizer.TT_WORD)
loadError(line);
String key = s.sval;
if (s.nextToken() != StreamTokenizer.TT_WORD || !s.sval.equals("="))
loadError(line);
if (s.nextToken() != StreamTokenizer.TT_WORD && s.ttype != '"')
loadError(line);
String value = s.sval;
// ignore everything after first string
while (s.nextToken() != StreamTokenizer.TT_EOL && s.ttype != StreamTokenizer.TT_EOF)
;
if (config.get(key) != null)
loadError(line);
config.put(key, value);
line++;
}
} catch (Throwable e) {
System.err.println("Error loading " + configFile);
System.exit(1);
}
}
private static void loadError(int line) {
System.err.println("Error in " + configFile + " line " + line);
System.exit(1);
}
private static void configError(String message) {
System.err.println("");
System.err.println("Error in " + configFile + ": " + message);
System.exit(1);
}
/**
* Get the value of a key in <tt>nachos.conf</tt>.
*
* @param key
* the key to look up.
* @return the value of the specified key, or <tt>null</tt> if it is not
* present.
*/
public static String getString(String key) {
return (String) config.get(key);
}
/**
* Get the value of a key in <tt>nachos.conf</tt>, returning the specified
* default if the key does not exist.
*
* @param key
* the key to look up.
* @param defaultValue
* the value to return if the key does not exist.
* @return the value of the specified key, or <tt>defaultValue</tt> if it is
* not present.
*/
public static String getString(String key, String defaultValue) {
String result = getString(key);
if (result == null)
return defaultValue;
return result;
}
private static Integer requestInteger(String key) {
try {
String value = getString(key);
if (value == null)
return null;
return new Integer(value);
} catch (NumberFormatException e) {
configError(key + " should be an integer");
Lib.assertNotReached();
return null;
}
}
/**
* Get the value of an integer key in <tt>nachos.conf</tt>.
*
* @param key
* the key to look up.
* @return the value of the specified key.
*/
public static int getInteger(String key) {
Integer result = requestInteger(key);
if (result == null)
configError("missing int " + key);
return result.intValue();
}
/**
* Get the value of an integer key in <tt>nachos.conf</tt>, returning the
* specified default if the key does not exist.
*
* @param key
* the key to look up.
* @param defaultValue
* the value to return if the key does not exist.
* @return the value of the specified key, or <tt>defaultValue</tt> if the
* key does not exist.
*/
public static int getInteger(String key, int defaultValue) {
Integer result = requestInteger(key);
if (result == null)
return defaultValue;
return result.intValue();
}
private static Double requestDouble(String key) {
try {
String value = getString(key);
if (value == null)
return null;
return new Double(value);
} catch (NumberFormatException e) {
configError(key + " should be a double");
Lib.assertNotReached();
return null;
}
}
/**
* Get the value of a double key in <tt>nachos.conf</tt>.
*
* @param key
* the key to look up.
* @return the value of the specified key.
*/
public static double getDouble(String key) {
Double result = requestDouble(key);
if (result == null)
configError("missing double " + key);
return result.doubleValue();
}
/**
* Get the value of a double key in <tt>nachos.conf</tt>, returning the
* specified default if the key does not exist.
*
* @param key
* the key to look up.
* @param defaultValue
* the value to return if the key does not exist.
* @return the value of the specified key, or <tt>defaultValue</tt> if the
* key does not exist.
*/
public static double getDouble(String key, double defaultValue) {
Double result = requestDouble(key);
if (result == null)
return defaultValue;
return result.doubleValue();
}
private static Boolean requestBoolean(String key) {
String value = getString(key);
if (value == null)
return null;
if (value.equals("1") || value.toLowerCase().equals("true")) {
return Boolean.TRUE;
} else if (value.equals("0") || value.toLowerCase().equals("false")) {
return Boolean.FALSE;
} else {
configError(key + " should be a boolean");
Lib.assertNotReached();
return null;
}
}
/**
* Get the value of a boolean key in <tt>nachos.conf</tt>.
*
* @param key
* the key to look up.
* @return the value of the specified key.
*/
public static boolean getBoolean(String key) {
Boolean result = requestBoolean(key);
if (result == null)
configError("missing boolean " + key);
return result.booleanValue();
}
/**
* Get the value of a boolean key in <tt>nachos.conf</tt>, returning the
* specified default if the key does not exist.
*
* @param key
* the key to look up.
* @param defaultValue
* the value to return if the key does not exist.
* @return the value of the specified key, or <tt>defaultValue</tt> if the
* key does not exist.
*/
public static boolean getBoolean(String key, boolean defaultValue) {
Boolean result = requestBoolean(key);
if (result == null)
return defaultValue;
return result.booleanValue();
}
private static boolean loaded = false;
private static String configFile;
private static HashMap<String, String> config;
}
| [
"dhh1995@163.com"
] | dhh1995@163.com |
ad30f86cb8f73a6901dbc7fa4d47541c71e3f393 | cef0f3f976d5bdcf84d0e2e13fec5f1bb8449da4 | /src/main/java/com/ua/dp/notepad/NotePad.java | 70a6309b5564800da76e9d8ddd03cf0ee735f21d | [] | no_license | AlexeyIlin/KeysNotePad | a4752a66954bca969cfe65731223cc5a48f96bc1 | 64563c381bf85332e1b48d7d5eecc0f8823f7236 | refs/heads/master | 2020-04-15T23:58:29.546881 | 2019-01-10T19:28:38 | 2019-01-10T19:28:38 | 165,119,194 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package com.ua.dp.notepad;
import com.ua.dp.notepad.gui.NotePadModalAccessFrame;
public class NotePad {
public static void main(String[] args) {
NotePadModalAccessFrame npmaf = new NotePadModalAccessFrame();
npmaf.setVisible(true);
}
}
| [
"archon@ua.fm"
] | archon@ua.fm |
4eec00cae5740114ab637539d4a0a2366e99fa4e | dfac561de273ec193289532cdbb9db7733fcffaa | /src/main/java/com/jeecms/bbs/action/BbsAdminAct.java | 2a6de08f35a5f4271fc17ba0a94433e4a7e157e5 | [] | no_license | foxandyhu/bbs | faa5b3762f68d36d6acc001df14e8275910e4859 | d0b7033a9c181a243e511ce72b2df9c2c680e7a3 | refs/heads/master | 2020-04-05T02:44:15.445124 | 2018-11-13T10:02:53 | 2018-11-13T10:02:53 | 156,488,319 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,256 | java | package com.jeecms.bbs.action;
import static com.jeecms.common.page.SimplePage.cpn;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import com.jeecms.bbs.entity.BbsUser;
import com.jeecms.bbs.entity.BbsUserExt;
import com.jeecms.bbs.entity.BbsUserGroup;
import com.jeecms.bbs.entity.BbsWebservice;
import com.jeecms.bbs.manager.BbsUserGroupMng;
import com.jeecms.bbs.manager.BbsUserMng;
import com.jeecms.bbs.manager.BbsWebserviceMng;
import com.jeecms.bbs.web.CmsUtils;
import com.jeecms.common.page.Pagination;
import com.jeecms.common.web.CookieUtils;
import com.jeecms.common.web.RequestUtils;
import com.jeecms.common.web.ResponseUtils;
import com.jeecms.core.entity.CmsRole;
import com.jeecms.core.entity.CmsSite;
import com.jeecms.core.manager.CmsRoleMng;
import com.jeecms.core.manager.CmsSiteMng;
import com.jeecms.core.security.BbsAuthorizingRealm;
import com.jeecms.core.web.WebErrors;
/**
* 管理员ACTION
*/
@Controller
public class BbsAdminAct {
private static final Logger log = LoggerFactory
.getLogger(BbsAdminAct.class);
@RequiresPermissions("admin:v_list")
@RequestMapping("/admin/v_list.html")
public String list(String queryUsername, String queryEmail,
Integer queryGroupId, Boolean queryDisabled,
Integer orderBy, Integer pageNo,
HttpServletRequest request, ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
BbsUser currUser = CmsUtils.getUser(request);
Pagination pagination = manager.getPage(queryUsername, queryEmail,
queryGroupId, queryDisabled, true, null,
null, currUser.getRank(),orderBy,
cpn(pageNo), CookieUtils.getPageSize(request));
List<CmsRole> roleList = cmsRoleMng.getList(currUser.getTopRoleLevel());
model.addAttribute("roleList", roleList);
model.addAttribute("pagination", pagination);
appendQueryParam(model, queryUsername, queryEmail, queryGroupId, queryDisabled);
model.addAttribute("groupList", bbsUserGroupMng.getList(site.getId()));
return "admin/list";
}
@RequiresPermissions("admin:v_add")
@RequestMapping("/admin/v_add.html")
public String add(HttpServletRequest request, ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
BbsUser currUser = CmsUtils.getUser(request);
List<BbsUserGroup> groupList = bbsUserGroupMng.getList(site.getId());
List<CmsRole> roleList = cmsRoleMng.getList(currUser.getTopRoleLevel());
model.addAttribute("site", site);
model.addAttribute("groupList", groupList);
model.addAttribute("roleList", roleList);
model.addAttribute("currRank", currUser.getRank());
return "admin/add";
}
@RequiresPermissions("admin:v_edit")
@RequestMapping("/admin/v_edit.html")
public String edit(Integer id, String queryUsername, String queryEmail,
Integer queryGroupId, Boolean queryDisabled,
Integer orderBy,HttpServletRequest request,
HttpServletResponse response,ModelMap model) throws IOException {
CmsSite site = CmsUtils.getSite(request);
BbsUser currUser = CmsUtils.getUser(request);
WebErrors errors = validateEdit(id, request);
if (errors.hasErrors()) {
return errors.showErrorPage(model);
}
BbsUser admin = manager.findById(id);
List<BbsUserGroup> groupList = bbsUserGroupMng.getList(site.getId());
List<CmsRole> roleList = cmsRoleMng.getList(currUser.getTopRoleLevel());
model.addAttribute("cmsAdmin", admin);
model.addAttribute("site", site);
model.addAttribute("roleIds", admin.getRoleIds());
model.addAttribute("groupList", groupList);
model.addAttribute("roleList", roleList);
model.addAttribute("currRank", currUser.getRank());
appendQueryParam(model, queryUsername, queryEmail, queryGroupId,queryDisabled);
return "admin/edit";
}
@RequiresPermissions("admin:o_save")
@RequestMapping("/admin/o_save.html")
public String save(BbsUser bean, BbsUserExt ext, String username,
String email, String password,Integer rank,
Integer groupId,Integer[] roleIds,HttpServletRequest request,ModelMap model) {
WebErrors errors = validateSave(bean, request);
if (errors.hasErrors()) {
return errors.showErrorPage(model);
}
String ip = RequestUtils.getIpAddr(request);
try {
bean = manager.saveAdmin(username, email, password, ip, rank,
groupId, roleIds, ext);
} catch (Exception e) {
//e.printStackTrace();
log.error(e.getMessage());
}
callWebService(username, password, email, ext,BbsWebservice.SERVICE_TYPE_ADD_USER);
log.info("save CmsAdmin id={}", bean.getId());
return "redirect:v_list.html";
}
@RequiresPermissions("admin:o_update")
@RequestMapping("/admin/o_update.html")
public String update(BbsUser bean, BbsUserExt ext, String password,
Integer groupId, Integer[] roleIds,String queryUsername, String queryEmail,
Integer queryGroupId, Boolean queryDisabled,
Integer orderBy, Integer pageNo, HttpServletRequest request,ModelMap model) {
WebErrors errors = validateUpdate(bean.getId(),bean.getRank(), request);
if (errors.hasErrors()) {
return errors.showErrorPage(model);
}
bean = manager.updateAdmin(bean, ext, password, groupId,roleIds);
callWebService(bean.getUsername(), password, bean.getEmail(), ext,BbsWebservice.SERVICE_TYPE_UPDATE_USER);
log.info("update CmsAdmin id={}.", bean.getId());
return list(queryUsername, queryEmail, queryGroupId, queryDisabled,
orderBy, pageNo, request, model);
}
@RequiresPermissions("admin:o_delete")
@RequestMapping("/admin/o_delete.html")
public String delete(Integer[] ids, String queryUsername, String queryEmail,
Integer queryGroupId, Boolean queryDisabled,
Integer orderBy,Integer pageNo, HttpServletRequest request,
ModelMap model) {
WebErrors errors = validateDelete(ids, request);
if (errors.hasErrors()) {
return errors.showErrorPage(model);
}
BbsUser[] beans = manager.deleteByIds(ids);
BbsUser user =CmsUtils.getUser(request);
boolean deleteCurrentUser=false;
for (BbsUser bean : beans) {
Map<String,String>paramsValues=new HashMap<String, String>();
paramsValues.put("username", bean.getUsername());
paramsValues.put("admin", "true");
bbsWebserviceMng.callWebService(BbsWebservice.SERVICE_TYPE_DELETE_USER, paramsValues);
log.info("delete CmsAdmin id={}", bean.getId());
if(user.getUsername().equals(bean.getUsername())){
deleteCurrentUser=true;
}
}
if(deleteCurrentUser){
Subject subject = SecurityUtils.getSubject();
subject.logout();
return "login";
}
return list(queryUsername, queryEmail, queryGroupId, queryDisabled,
orderBy, pageNo, request, model);
}
@RequiresPermissions("admin:v_check_username")
@RequestMapping(value = "/admin/v_check_username.html")
public void checkUsername(HttpServletRequest request, HttpServletResponse response) {
checkUserJson(request, response);
}
@RequiresPermissions("admin:v_check_email")
@RequestMapping(value = "/admin/v_check_email.html")
public void checkEmail(String email, HttpServletResponse response) {
checkEmailJson(email, response);
}
private void callWebService(String username,String password,String email,BbsUserExt userExt,String operate){
if(bbsWebserviceMng.hasWebservice(operate)){
Map<String,String>paramsValues=new HashMap<String, String>();
paramsValues.put("username", username);
paramsValues.put("password", password);
if(StringUtils.isNotBlank(email)){
paramsValues.put("email", email);
}
if(StringUtils.isNotBlank(userExt.getRealname())){
paramsValues.put("realname", userExt.getRealname());
}
if(userExt.getGender()!=null){
paramsValues.put("sex", userExt.getGender().toString());
}
if(StringUtils.isNotBlank(userExt.getMoble())){
paramsValues.put("tel",userExt.getMoble());
}
bbsWebserviceMng.callWebService(operate, paramsValues);
}
}
private void appendQueryParam(ModelMap model,
String queryUsername, String queryEmail,
Integer queryGroupId, Boolean queryDisabled){
model.addAttribute("queryUsername", queryUsername);
model.addAttribute("queryEmail", queryEmail);
model.addAttribute("queryGroupId", queryGroupId);
model.addAttribute("queryDisabled", queryDisabled);
}
protected void checkUserJson(HttpServletRequest request,HttpServletResponse response) {
String username=RequestUtils.getQueryParam(request,"username");
String pass;
if (StringUtils.isBlank(username)) {
pass = "false";
} else {
pass = manager.usernameNotExist(username) ? "true" : "false";
}
ResponseUtils.renderJson(response, pass);
}
protected void checkEmailJson(String email, HttpServletResponse response) {
String pass;
if (StringUtils.isBlank(email)) {
pass = "false";
} else {
pass = manager.emailNotExist(email) ? "true" : "false";
}
ResponseUtils.renderJson(response, pass);
}
private WebErrors validateSave(BbsUser 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;
}
BbsUser entity = manager.findById(id);
if (errors.ifNotExist(entity, BbsUser.class, id)) {
return true;
}
return false;
}
private boolean vldParams(Integer id,Integer rank, HttpServletRequest request,
WebErrors errors) {
BbsUser user = CmsUtils.getUser(request);
BbsUser entity = manager.findById(id);
//提升等级大于当前登录用户
if (rank > user.getRank()) {
errors.addErrorCode("error.noPermissionToRaiseRank", id);
return true;
}
//修改的用户等级大于当前登录用户 无权限
if (entity.getRank() > user.getRank()) {
errors.addErrorCode("error.noPermission", BbsUser.class, id);
return true;
}
return false;
}
@Autowired
protected CmsSiteMng cmsSiteMng;
@Autowired
protected CmsRoleMng cmsRoleMng;
@Autowired
protected BbsUserMng manager;
@Autowired
protected BbsWebserviceMng bbsWebserviceMng;
@Autowired
protected BbsAuthorizingRealm authorizingRealm;
@Autowired
private BbsUserGroupMng bbsUserGroupMng;
} | [
"andy_hulibo@163.com"
] | andy_hulibo@163.com |
8f6eff054ff70bdc0328b63261e667f7295a5729 | ff0cd15fd2fab4a068073f4a7296ce5d8852caef | /src/main/java/com/nauticana/manhour/model/ViewProgressBrief.java | 881abd7ddd367fe6b168fe4ed70182fbbd51502a | [] | no_license | oatilla/NauticanaManHour | 11897aa897bbdb42b5b580b835c7b804187aefae | b0ff0604096919ac857b18e5395f9142c6434b1f | refs/heads/master | 2021-01-22T07:47:22.754262 | 2017-12-20T13:43:30 | 2017-12-20T13:43:30 | 102,310,884 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,813 | java | package com.nauticana.manhour.model;
import java.util.ArrayList;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
@Entity
public class ViewProgressBrief {
public static final String[] fieldNames = new String[] {"CATEGORY_ID", "PARENT_ID", "TREE_CODE", "CAPTION", "PROJECT_ID", "UNIT", "METRIC", "QUANTITY", "WORKFORCE", "PUP_METRIC", "PUP_QUANTITY", "PUP_WORKFORCE", "PLANNED_METRIC", "PLANNED_QUANTITY", "PLANNED_WORKFORCE", "SUM_QUANTITY", "SUM_MANHOUR", "SUM_METRIC", "PROGRESS", "EARNED_MANHOUR", "PERFORMANCE", "PERFORMANCE_MULTIPLIER", "ESTIMATED_MANHOUR", "REMAINING_COMPLETION_MANHOUR", "DEVIATION"};
private int categoryId;
private int parentId;
private String treeCode;
private String caption;
private String unit;
private float metric;
private float quantity;
private float workforce;
private float pupMetric;
private float pupQuantity;
private float pupWorkforce;
private float sumQuantity;
private float plannedMetric;
private float plannedQuantity;
private float plannedWorkforce;
private int sumManhour;
// transient values
private float sumMetric;
private float progress;
private float earnedManhour;
private float performans;
private float performansMultip;
private float estimatedCompMH;
private float remainingMH;
private float deviation;
private ArrayList<ViewProgressBrief> children;
private ViewProgressBrief parent;
public ViewProgressBrief(int categoryId, int parentId, String treeCode, String caption, String unit, float metric, float quantity, float workforce, float pupMetric, float pupQuantity, float pupWorkforce, float plannedMetric, float plannedQuantity, float plannedWorkforce, float sumQuantity, int sumManhour) {
super();
this.categoryId = categoryId;
try {this.parentId = parentId;}catch (Exception e) {this.parentId = -1;}
this.treeCode = treeCode;
this.caption = caption;
this.unit = unit;
this.metric = metric;
this.quantity = quantity;
this.workforce = workforce;
this.pupMetric = pupMetric;
this.pupQuantity = pupQuantity;
this.pupWorkforce = pupWorkforce;
this.plannedMetric = plannedMetric;
this.plannedQuantity = plannedQuantity;
this.plannedWorkforce = plannedWorkforce;
this.sumQuantity = sumQuantity;
this.sumManhour = sumManhour;
if (sumQuantity == 0)
sumMetric = 0;
else
sumMetric = sumManhour/sumQuantity;
if(quantity == 0 )
this.progress=0;
else
this.progress= sumQuantity/pupQuantity;
this.earnedManhour = this.progress * this.pupWorkforce;
if (this.sumManhour == 0)
this.performans = 0;
else
this.performans = this.earnedManhour / this.sumManhour;
if (this.performans == 0)
this.performansMultip = 0;
else
this.performansMultip = 1 / this.performans;
this.estimatedCompMH = this.performansMultip * this.pupWorkforce;
this.remainingMH = this.estimatedCompMH - this.sumManhour;
if (this.pupWorkforce == 0) this.deviation = 0;
else this.deviation = 1 - this.estimatedCompMH / this.pupWorkforce;
this.children = new ArrayList<ViewProgressBrief>();
this.parent = null;
}
@Id
@Column(name="CATEGORY_ID")
public int getId() {
return categoryId;
}
public void setId(int id) {
this.categoryId = id;
}
@Column(name="PARENT_ID")
public int getParentId() {
return parentId;
}
public void setParentId(int parentId) {
this.parentId = parentId;
}
@Column(name="TREE_CODE")
public String getTreeCode() {
return treeCode;
}
public void setTreeCode(String treeCode) {
this.treeCode = treeCode;
}
@Column(name="CAPTION")
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption;
}
@Column(name="UNIT")
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
@Column(name="METRIC")
public float getMetric() {
return metric;
}
public void setMetric(float metric) {
this.metric = metric;
}
@Column(name="QUANTITY")
public float getQuantity() {
return quantity;
}
public void setQuantity(float quantity) {
this.quantity = quantity;
}
@Column(name="WORKFORCE")
public float getWorkforce() {
return this.workforce;
}
public void setWorkforce(float workforce) {
this.workforce = workforce;
}
@Column(name="PUP_QUANTITY")
public float getPupQuantity() {
return pupQuantity;
}
public void setPupQuantity(float pupQuantity) {
this.pupQuantity = pupQuantity;
}
@Column(name="PUP_METRIC")
public float getPupMetric() {
return pupMetric;
}
public void setPupMetric(float pupMetric) {
this.pupMetric = pupMetric;
}
@Column(name="PUP_WORKFORCE")
public float getPupWorkforce() {
return this.pupWorkforce;
}
public void setPupWorkforce(float pupWorkforce) {
this.pupWorkforce = pupWorkforce;
}
@Column(name="PLANNED_QUANTITY")
public float getPlannedQuantity() {
return plannedQuantity;
}
public void setPlannedQuantity(float plannedQuantity) {
this.plannedQuantity = plannedQuantity;
}
@Column(name="PLANNED_METRIC")
public float getPlannedMetric() {
return plannedMetric;
}
public void setPlannedMetric(float plannedMetric) {
this.plannedMetric = plannedMetric;
}
@Column(name="PLANNED_WORKFORCE")
public float getPlannedWorkforce() {
return this.plannedWorkforce;
}
public void setPlannedWorkforce(float plannedWorkforce) {
this.plannedWorkforce = plannedWorkforce;
}
@Column(name="SUM_QUANTITY")
public float getSumQuantity() {
return sumQuantity;
}
public void setSumQuantity(float sumQuantity) {
this.sumQuantity = sumQuantity;
}
@Column(name="SUM_MANHOUR")
public int getSumManhour() {
return sumManhour;
}
public void setSumManhour(int sumManhour) {
this.sumManhour = sumManhour;
}
@Transient
public float getSumMetric() {
return this.sumMetric;
}
@Transient
public float getProgress() {
return progress;
}
@Transient
public float getEarnedManhour() {
return earnedManhour;
}
@Transient
public float getPerformans() {
return performans;
}
@Transient
public float getPerformansMultip() {
return performansMultip;
}
@Transient
public float getEstimatedCompMH() {
return estimatedCompMH;
}
@Transient
public float getRemainingMH() {
return remainingMH;
}
@Transient
public float getDeviation() {
return deviation;
}
@Transient
public ArrayList<ViewProgressBrief> getChildren() {
return children;
}
public void addChild(ViewProgressBrief child) {
this.children.add(child);
}
@Transient
public ViewProgressBrief getParent() {
return parent;
}
public void setParent(ViewProgressBrief parent) {
this.parent = parent;
}
@Override
public String toString() {
return getId() + "," + treeCode + "," + caption + "," + unit + "," + metric + "," + quantity + "," + sumQuantity + "," + sumManhour;// + "," + begda + "," + endda + "," + lastQuantity + "," + nextBegda;
}
public void setProgress(float progress) {
this.progress = progress;
}
public void setEarnedManhour(float earnedManhour) {
this.earnedManhour = earnedManhour;
}
public void setPerformans(float performans) {
this.performans = performans;
}
public void setEstimatedCompMH(float estimatedCompMH) {
this.estimatedCompMH = estimatedCompMH;
}
public void setRemainingMH(float remainingMH) {
this.remainingMH = remainingMH;
}
public void setDeviation(float deviation) {
this.deviation = deviation;
}
}
| [
"o_atilla@hotmail.com"
] | o_atilla@hotmail.com |
55bccaa9f82edd20ae3abbf94cb83f178826c381 | f610f79738ddbcdd0d5785cd5625e3e7e35e144c | /src/main/java/org/adbcj/mysql/pool/org/apache/commons/pool2/impl/EvictionConfig.java | 09289c82e7f33f748c1147c2057aebeefb11910c | [] | no_license | ponsonio/adbcj-pool | 9c1a2419cd711e45be674cb6e3fc6e318801d283 | 5ec74150d4c1c7ccdb3a0c42af0660def2036ab3 | refs/heads/master | 2020-01-24T20:52:07.992992 | 2013-07-08T10:50:31 | 2013-07-08T10:50:31 | 73,855,485 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,008 | 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.adbcj.mysql.pool.org.apache.commons.pool2.impl;
/**
* This class is used by pool implementations to pass configuration information
* to {@link EvictionPolicy} instances. The {@link EvictionPolicy} may also have
* its own specific configuration attributes.
* <p>
* This class is immutable and thread-safe.
*
* @version $Revision: $
*
* @since 2.0
*/
public class EvictionConfig {
private final long idleEvictTime;
private final long idleSoftEvictTime;
private final int minIdle;
public EvictionConfig(long poolIdleEvictTime, long poolIdleSoftEvictTime,
int minIdle) {
if (poolIdleEvictTime > 0) {
idleEvictTime = poolIdleEvictTime;
} else {
idleEvictTime = Long.MAX_VALUE;
}
if (poolIdleSoftEvictTime > 0) {
idleSoftEvictTime = poolIdleSoftEvictTime;
} else {
idleSoftEvictTime = Long.MAX_VALUE;
}
this.minIdle = minIdle;
}
public long getIdleEvictTime() {
return idleEvictTime;
}
public long getIdleSoftEvictTime() {
return idleSoftEvictTime;
}
public int getMinIdle() {
return minIdle;
}
}
| [
"shenxun@taobao.com"
] | shenxun@taobao.com |
3772243dbedc228cd48bf5ad54967a6b51297d6f | dcea2959171e3ae76fd2c3e936818ce99c982721 | /src/main/java/it/unicam/cs/pa2021/formulaUno/model/creator/BotPlayerCreator.java | c49a29b2b644eda0970f5740d6720c34b5a1ca4a | [] | no_license | rpiero99/Formula-Uno | a67c11b2d67eb3ded2c07314b3724353b818d506 | a62ccc5b2b242c7a67e0bdd496a6e56e8982cac5 | refs/heads/master | 2023-06-24T07:51:01.642180 | 2021-07-18T11:21:04 | 2021-07-18T11:21:04 | 371,416,653 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package it.unicam.cs.pa2021.formulaUno.model.creator;
import it.unicam.cs.pa2021.formulaUno.model.BotPlayer;
import it.unicam.cs.pa2021.formulaUno.model.GameField;
import it.unicam.cs.pa2021.formulaUno.model.Location;
import it.unicam.cs.pa2021.formulaUno.model.Player;
/**
* Classe responsabile della creazione di un bot player.
* @param <L> tipo per la posizione degli angoli.
*/
public class BotPlayerCreator<L extends Location> implements PlayerCreator<L>{
@Override
public Player<L> createPlayer(String name, GameField<L> field) {
return new BotPlayer<>(name, field);
}
}
| [
"riccardo.pierini@studenti.unicam.it"
] | riccardo.pierini@studenti.unicam.it |
c918e1518ea850ff416882c506d70b7c8c33720b | 931034f7af3435c5a63c5eab1358e782c21adc32 | /src/main/java/com/letovi/cijeneletova/services/SearchResultService.java | 1170f185fbf579416ed14d08cb646bfb525ee7d4 | [] | no_license | kremenovic96/avio-backend | a110a1f816a80c64e1d24b03b19c94801bae0351 | aa44cb20e5e1a9579f9e139c8552cd06841b9354 | refs/heads/master | 2022-04-10T01:38:53.956467 | 2020-02-25T22:46:44 | 2020-02-25T22:46:44 | 241,903,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,357 | java | package com.letovi.cijeneletova.services;
import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.resources.FlightOffer;
import com.google.gson.JsonElement;
import com.letovi.cijeneletova.models.SearchResult;
import com.letovi.cijeneletova.repositories.SearchResultRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Component
public class SearchResultService {
private static final String DEPARTURE = "DEPARTURE";
private static final String ARRIVAL = "ARRIVAL";
@Autowired
SearchResultRepo searchResultRepo;
@Autowired
Amadeus amadeus;
@Autowired
AirPortAndCityService airPortAndCityService;
/**
* @param flightOffer
* @param iataCode
* @return full airport name based on its iataCode
*/
private String getDetailedNameFromIataCode(FlightOffer flightOffer, String iataCode, String place) throws ResponseException {
//user entered iataCode for example JFK
if (flightOffer.getResponse().getResult().getAsJsonObject("dictionaries").get("locations").getAsJsonObject().get(iataCode.toUpperCase()) != null) {
JsonElement airPortObj = flightOffer.getResponse().getResult().getAsJsonObject("dictionaries").get("locations").getAsJsonObject().get(iataCode).getAsJsonObject().get("detailedName");
return airPortObj != null ? airPortObj.toString()
.replaceAll("\"", "") : "Nedostupno";
}
//user entered code. like NYC
else {
String arrivalAirPortIataCode = getAirPortIataCode(flightOffer, place);
return airPortAndCityService.getAirPortDetailedNameByKeyWord(arrivalAirPortIataCode);
}
}
/***
*
* @param flightOffer
* @param place with value of ARRIVAL or DEPARTURE
* @return iata code of found airport
*/
private String getAirPortIataCode(FlightOffer flightOffer, String place) {
switch (place) {
case "ARRIVAL":
return getArrivalAirPortIataCode(flightOffer);
case "DEPARTURE":
return getDepartureAirPortIataCode(flightOffer);
default:
throw new IllegalArgumentException("Place " + place + " not supported. Should be ARRIVAL or DEPARTURE");
}
}
private String getDepartureAirPortIataCode(FlightOffer flightOffer) {
String departureIata = flightOffer.getOfferItems()[0].getServices()[0].getSegments()[0].getFlightSegment().getDeparture().getIataCode();
return departureIata;
}
private String getArrivalAirPortIataCode(FlightOffer flightOffer) {
int lastFlightSegmentIndex = flightOffer.getOfferItems()[0].getServices()[0].getSegments().length - 1;
String arrivalIata = flightOffer.getOfferItems()[0].getServices()[0].getSegments()[lastFlightSegmentIndex].getFlightSegment().getArrival().getIataCode();
return arrivalIata;
}
private Double getTotalPrice(FlightOffer flightOffer) {
System.out.println(flightOffer.getOfferItems().length + " OfferItems len");
return flightOffer.getOfferItems()[0].getPrice().getTotal();
}
private int getNumberOfStopsFromOrigin(FlightOffer flightOffer) {
return flightOffer.getOfferItems()[0].getServices()[0].getSegments().length - 1;
}
private int getNumberOfStopsFromDestination(FlightOffer flightOffer) {
return flightOffer.getOfferItems()[0].getServices()[1].getSegments().length - 1;
}
/**
*
* @param searchCriteria
* @return existing SearchResult with same searchCriteria, or new if its not existent(saves it also)
* @throws ResponseException
*/
public List<SearchResult> getCachedOrNew(Map<String, String> searchCriteria) throws ResponseException {
String origin = searchCriteria.get("origin");
String destination = searchCriteria.get("destination");
Integer numberOfAdults = Integer.valueOf(searchCriteria.get("adults"));
LocalDate departureDate = LocalDate.parse(searchCriteria.get("departureDate"));
LocalDate returnDate = LocalDate.parse(searchCriteria.get("returnDate"));
//number of results to get
String max = searchCriteria.getOrDefault("max", "10");
List<SearchResult> cachedSearchResults = searchResultRepo.findBySameFields(origin.toUpperCase(), destination.toUpperCase(), numberOfAdults, departureDate, returnDate);
if (!cachedSearchResults.isEmpty()) {
return cachedSearchResults;
}
return createNewSearchResult(origin.toUpperCase(), destination.toUpperCase(), departureDate, returnDate, numberOfAdults, max);
}
private List<SearchResult> createNewSearchResult(String origin, String destination, LocalDate departureDate, LocalDate returnDate, Integer numberOfAdults,
String max) throws ResponseException {
FlightOffer[] flightOffers = amadeus.shopping.flightOffers.get(Params.with(
"origin", origin)
.and("destination", destination)
.and("departureDate", departureDate)
.and("returnDate", returnDate)
.and("adults", numberOfAdults)
.and("max", max));
List<SearchResult> newlySavedSearchResults = new ArrayList<>();
for(FlightOffer flightOffer : flightOffers) {
//TODO: look into currency
newlySavedSearchResults.add(saveSearchToDb(flightOffer, origin, destination, numberOfAdults, departureDate, returnDate, "EUR"));
}
return newlySavedSearchResults;
}
/**
* @param flightOffer
* @param originIataCode
* @param departureIataCode
* @param numberOfAdults
* @param departureDate
* @param returnDate
* @param currency
* @return SearchResult with its fields populated with api call results
*/
private SearchResult saveSearchToDb(FlightOffer flightOffer, String originIataCode, String departureIataCode, Integer numberOfAdults, LocalDate departureDate, LocalDate returnDate,
String currency) throws ResponseException {
SearchResult searchResult = new SearchResult();
searchResult.setBrojPutnika(numberOfAdults);
searchResult.setDatumPolaska(departureDate);
searchResult.setDatumPovratka(returnDate);
searchResult.setValuta(currency);
searchResult.setPolazniAerodromIataKod(originIataCode);
searchResult.setOdredisniAerodromNazivIataKod(departureIataCode);
searchResult.setPolazniAerodromNaziv(getDetailedNameFromIataCode(flightOffer, originIataCode, DEPARTURE));
searchResult.setOdredisniAerodromNaziv(getDetailedNameFromIataCode(flightOffer, departureIataCode, ARRIVAL));
searchResult.setUkupnaCijena(getTotalPrice(flightOffer));
searchResult.setBrojPresjedanjaUOdlasku(getNumberOfStopsFromOrigin(flightOffer));
searchResult.setBrojPresjedanjaUPovratku(getNumberOfStopsFromDestination(flightOffer));
SearchResult savedSearch = searchResultRepo.save(searchResult);
return savedSearch;
}
}
| [
"ranko.kremenovic@gmail.com"
] | ranko.kremenovic@gmail.com |
7a3494669c5afeae3175a2afed36b638bdf9ea32 | 06354d2ca7da31af4d7d6123f53952e9933cb3ab | /src/main/java/com/melot/kkgame/service/RoomService.java | fd46f361efe45297ee44629889e85ae31a86066f | [] | no_license | sj123sheng/meShow | 2e582e0fbb816d12c677636b4e0ca57b99176c6c | 4e6fef5b4411a8257884229f34bebbaa97c003f2 | refs/heads/feature/sheng_develop | 2023-06-24T01:42:03.605265 | 2018-03-02T07:55:19 | 2018-03-02T07:55:19 | 123,651,311 | 0 | 0 | null | 2023-06-14T20:21:26 | 2018-03-03T02:18:46 | Java | UTF-8 | Java | false | false | 2,723 | java | package com.melot.kkgame.service;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.google.gson.JsonObject;
import com.melot.api.menu.sdk.dao.RoomSubCatalogDao;
import com.melot.api.menu.sdk.dao.domain.RoomInfo;
import com.melot.api.menu.sdk.service.RoomInfoService;
import com.melot.kktv.util.Cache;
import com.melot.kktv.util.ConfigHelper;
import com.melot.kktv.util.ConstantEnum;
import com.melot.kktv.util.HttpClient;
import com.melot.sdk.core.util.MelotBeanFactory;
public class RoomService {
private static Logger logger = Logger.getLogger(RoomService.class);
private static final Cache oneMiniteCahce = new Cache(60*1000);
/**
* 直播全站热门50位主播缓存key
*/
private static final String KKGAME_HOT_ACTOR_KEYS = "kkgame_hot_actors";
/**
* 获取热门主播
*/
@SuppressWarnings("unchecked")
public static List<RoomInfo> getTopActors(RoomSubCatalogDao roomSubCatalogDao){
List<RoomInfo> list = (List<RoomInfo>) oneMiniteCahce.getObject(KKGAME_HOT_ACTOR_KEYS);
if(list != null){
return list;
}else{
list = roomSubCatalogDao.getPartLiveRoomList(ConstantEnum.KKGAME_ALL_ACTORS_CATAID, 0, 50);
oneMiniteCahce.insertObject(KKGAME_HOT_ACTOR_KEYS, list);
}
return list;
}
/**
* 根据roomIds获取列表, roomIds以","作为分隔符
*/
public static List<RoomInfo> getRoomListByRoomIds(String roomIds){
RoomInfoService roomInfoServie = (RoomInfoService)MelotBeanFactory.getBean("roomInfoService", RoomInfoService.class);
return roomInfoServie.getRoomListByRoomIds(roomIds);
}
/**
* 发送消息到房间,通知
* @param type
* @param msg
* @return
*/
public static boolean sendMsgToRoom (int type, int roomId, int platform, JsonObject msg) {
boolean result = false;
Map<String, String>params = new HashMap<String, String>();
try {
params.put("type",String.valueOf(type));
params.put("msg", msg.toString());
params.put("roomId", String.valueOf(roomId));
if (platform > 0) {
params.put("platform", String.valueOf(platform));
}
String response = HttpClient.doGet(ConfigHelper.getRunwayUrl(), params);
logger.info("sendRunwayMsg response: " + response);
}catch (IOException e) {
logger.error("sendRunwayMsg response error: " + params);
}
return result;
}
} | [
"songjianming@2fe1c438-e5a1-4f48-b1bb-90b7b6eba2af"
] | songjianming@2fe1c438-e5a1-4f48-b1bb-90b7b6eba2af |
abd1609f64a277b7dd7d17b74c7e399ebc19ed55 | 377dbeb5bab35ec7293e3838afd06673043fc88f | /Java-Fundamentals-Exams/01.Mid-Exam/Exam03Task.java | e084ec9f7e139378a72a5685da9bddaf5d078b39 | [] | no_license | stefanG92/SoftUni-Education | 46a6de981b332b7aaa248f3fa1864321d7dc3054 | 9997f6e468090e6b2377a5e431c2195b7af651e7 | refs/heads/main | 2023-04-30T05:29:45.935251 | 2021-05-11T14:29:02 | 2021-05-11T14:29:02 | 337,355,783 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,097 | java | import java.util.*;
import java.util.stream.Collectors;
public class Exam03Task {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[] array = Arrays.stream(scanner.nextLine().split(" "))
.mapToInt(Integer::parseInt).toArray();
int sum = sumValue(array);
double averageValue = sum / (double) array.length;
List<Integer> topNumber = new ArrayList<>();
for (int number : array) {
if (number > averageValue) {
topNumber.add(number);
}
}
if (topNumber.isEmpty()) {
System.out.println("No");
} else {
Collections.sort(topNumber);
Collections.reverse(topNumber);
for (int i = 0; i < Math.min(topNumber.size(), 5); i++) {
System.out.print(topNumber.get(i) + " ");
}
}
}
public static int sumValue(int[] array) {
int sum = 0;
for (int number : array) {
sum += number;
}
return sum;
}
}
| [
"stefanG92@abv.bg"
] | stefanG92@abv.bg |
d4e7a01028171040712ea949e387ccdd44d0793c | 95be01d865ef35ec3f2eb5e55f7bccec52a5c156 | /src/main/java/hu/helixlab/tracking/entity/Roles.java | 9c1df77a47f9ad5dacf2ef6c0b7d238997be8f9a | [] | no_license | wandrea/TrackingApp | 3ae2387a1d059c46872dfcee9ef60cbdb6d570fb | 156979706193359d9b024677ac8f3dcb5747de93 | refs/heads/master | 2021-05-04T14:06:12.269693 | 2018-02-04T20:30:00 | 2018-02-04T20:30:00 | 120,192,809 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,367 | java | package hu.helixlab.tracking.entity;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@Entity
@Table(name = "roles", schema = "public")
public class Roles extends BaseEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 7796410086419764350L;
private int roleId;
private String roleName;
public Roles() {
}
public Roles(int roleId, String roleName) {
this.roleId = roleId;
this.roleName = roleName;
}
@Id
@SequenceGenerator(name="roles_role_id_seq", sequenceName="roles_role_id_seq", allocationSize=1)
@GeneratedValue(strategy=GenerationType.AUTO, generator="roles_role_id_seq")
@Column(name = "role_id", unique = true, nullable = false)
public int getRoleId() {
return this.roleId;
}
public void setRoleId(int roleId) {
this.roleId = roleId;
}
@Column(name = "role_name", nullable = false, length = 20)
public String getRoleName() {
return this.roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
@Override
public String toString() {
return "Roles [roleId=" + roleId + ", roleName=" + roleName + "]";
}
}
| [
"wagenhofferandrea@gmail.com"
] | wagenhofferandrea@gmail.com |
91fb3843e446f4815b4d590e4126998bf4f78856 | c371118adb9bf4d7c0b5123081258836665e147e | /src/multiplayer/GameClient.java | 5533b37d8dd5d3194830641e574114986499190b | [] | no_license | Arashhs/JTanks-Game | 2c1f3e49728e0fe094c512c5b148b7051d2f4080 | 2f31e89e50f20b2e58a32b973e06197b8c77e758 | refs/heads/master | 2022-12-06T19:08:09.092609 | 2020-08-17T23:47:39 | 2020-08-17T23:47:39 | 259,147,391 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,173 | java | package multiplayer;
import bufferstrategy.GameLoop;
import bufferstrategy.GameState;
import bufferstrategy.Main;
import gameMap.*;
import javax.swing.*;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
/**
* This is the client's class
* This reads data from server and updates client's game
* This also sends the state of client's tank and other necessary datas to the server
* @author Arash
*/
public class GameClient implements Runnable {
private Socket connection;
private ObjectInputStream networkInputStream;
private ObjectOutputStream networkOutputStream;
private String serverAddress;
private boolean interruptThis;
private boolean connectionStatus;
public static OtherTank otherTank;
public GameClient() {
connectionStatus = false;
serverAddress = JOptionPane.showInputDialog("Enter IP Address of a machine that is\n" + "running the date service on port 50000:");
while (!connectionStatus) {
try {
connection = new Socket(serverAddress, 50000);
System.out.println("Client connected");
connectionStatus = true;
} catch (IOException e) {
e.printStackTrace();
serverAddress = JOptionPane.showInputDialog("We couldn't find selected IP Adress\nEnter a valid IP Address of a machine that is\n" + "running the date service on port 50000:");
}
}
try {
networkOutputStream = new ObjectOutputStream(connection.getOutputStream());
networkInputStream = new ObjectInputStream(connection.getInputStream());
} catch (IOException e){
e.printStackTrace();
}
otherTank = new OtherTank(500 , 600 , 0 , 0 , null);
interruptThis = false;
}
public void run(){
int i = 0;
while (!interruptThis) {
i++;
if(i>10) {
tick();
i = 11;
} /*
try {
Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
} */
}
}
/**
* Syncs data between server and client
*/
public void tick() {
Tank ta;
Level lvl;
Enemies enemies;
GameState gameState;
try {
networkOutputStream.writeObject(GameLoop.getState().getTank());
networkOutputStream.reset();
gameState = (GameState) networkInputStream.readObject();
ta = gameState.getTankForNet();
// lvl = gameState.getLevelForNet();
enemies = gameState.getEnemiesForNet();
initOtherTank(ta);
// GameState.setLevel(lvl);
GameState.setEnemies(enemies);
} catch (IOException e) {
System.out.println("Server Left the Game");
GameState.lastEvent = "Server left the game!";
try {
Thread.sleep(5000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
System.exit(0);
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
/**
* updates the other player's tank (= Server player's tank) in client's game
* @param ta otherPlayer's tank
*/
public void initOtherTank(Tank ta){
otherTank.setBulletSprites(ta.getBulletSprites());
otherTank.setOtherAngle(ta.getTurretAngle());
otherTank.locX = ta.locX;
otherTank.locY = ta.locY;
otherTank.setVertical(ta.isVertical());
otherTank.setGunState(ta.getGunState());
otherTank.setMachinGunUpgraded(ta.isMachinGunUpgraded());
otherTank.setCannonUpgraded(ta.isCannonUpgraded());
otherTank.setHp(ta.getHp());
if(ta.getHp() <= 0){
Main.gameMode = 0;
Main.connectionType = -1;
interruptThis = true;
}
}
}
| [
"hajisafiarash@gmail.com"
] | hajisafiarash@gmail.com |
f664f9bcead861d0f20e64f35172f197710bb653 | 7fbc487d18d2c541567a79eb257e11429a1d632e | /src/main/java/pl/waterborn/messagesender/domain/MessageRepository.java | 9de9d32ad75c4a58ff912c5e9fe9ce8f95a1aba1 | [] | no_license | MerikScott/springcore | fcfac063576e480ba80cc54874ffadb362552347 | c02e19c1637878317a72ce1cabf81fedd3b79354 | refs/heads/master | 2021-04-28T17:00:06.616253 | 2018-02-18T10:57:18 | 2018-02-18T10:57:18 | 121,844,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 185 | java | package pl.waterborn.messagesender.domain;
public interface MessageRepository {
boolean exists(String id);
void add(Message message);
boolean exists(Message message);
}
| [
"dharma@codemandala.com"
] | dharma@codemandala.com |
179aba23a3b7434fd691ac5bde2b326feacd1d08 | 78b71689f2107417b229ca907b41e9f0de3fd81b | /src/main/java/com/ProximityCalculatorApplication/ProximityCalculatorApplication/RequestStrings.java | 62ce004fe82e2b29805c0a2061f4d6001e2dd6dd | [] | no_license | robinchabouk/ProximityCalculatorApplication | 32a5fec8926173aee8db2c0011b5db386b3a12bc | 2b54a46d8dc85b99ec9c87f084a8d2c10f656f1c | refs/heads/master | 2023-06-28T21:54:17.368283 | 2021-08-01T15:01:21 | 2021-08-01T15:01:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package com.ProximityCalculatorApplication.ProximityCalculatorApplication;
public class RequestStrings {
static final String HEROKU_URL = "https://bpdts-test-app.herokuapp.com/";
static final String FOR_CITY = "city/";
static final String INSTRUCTIONS = "instructions";
static final String USER = "user/";
static final String USERS = "users";
}
| [
"robin.chabouk.2016@live.rhul.ac.uk"
] | robin.chabouk.2016@live.rhul.ac.uk |
0e1c5c1c1ad9a4ccb247249bc052e9de0247f796 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_d75c68b17e488ec9f785869113bbb6570583d9c4/Carousel/11_d75c68b17e488ec9f785869113bbb6570583d9c4_Carousel_t.java | 0b6e2fba538ba2cf342d916f14edee45a52becf7 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 10,941 | java | /*
* Copyright 2012 Daniel Kurka
*
* 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.googlecode.mgwt.ui.client.widget;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.logical.shared.HasSelectionHandlers;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;
import com.googlecode.mgwt.collection.shared.LightArrayInt;
import com.googlecode.mgwt.dom.client.event.orientation.OrientationChangeEvent;
import com.googlecode.mgwt.dom.client.event.orientation.OrientationChangeHandler;
import com.googlecode.mgwt.ui.client.MGWT;
import com.googlecode.mgwt.ui.client.MGWTStyle;
import com.googlecode.mgwt.ui.client.theme.base.CarouselCss;
import com.googlecode.mgwt.ui.client.widget.event.scroll.ScrollEndEvent;
import com.googlecode.mgwt.ui.client.widget.event.scroll.ScrollRefreshEvent;
import com.googlecode.mgwt.ui.client.widget.touch.TouchWidget;
/**
* the carousel widget renders its children in a horizontal row. users can select a different child
* by swiping between them
*
* @author Daniel Kurka
*
*/
public class Carousel extends Composite implements HasWidgets, HasSelectionHandlers<Integer> {
private static class CarouselIndicatorContainer extends Composite {
private FlowPanel main;
private final CarouselCss css;
private ArrayList<CarouselIndicator> indicators;
private int selectedIndex;
public CarouselIndicatorContainer(CarouselCss css, int numberOfPages) {
if (numberOfPages < 0) {
throw new IllegalArgumentException();
}
this.css = css;
main = new FlowPanel();
initWidget(main);
main.addStyleName(this.css.indicatorContainer());
indicators = new ArrayList<Carousel.CarouselIndicator>(numberOfPages);
selectedIndex = 0;
for (int i = 0; i < numberOfPages; i++) {
CarouselIndicator indicator = new CarouselIndicator(css);
indicators.add(indicator);
main.add(indicator);
}
setSelectedIndex(selectedIndex);
}
public void setSelectedIndex(int index) {
if (selectedIndex != -1) {
indicators.get(selectedIndex).setActive(false);
}
selectedIndex = index;
if (selectedIndex != -1) {
indicators.get(selectedIndex).setActive(true);
}
}
}
private static class CarouselIndicator extends TouchWidget {
private final CarouselCss css;
public CarouselIndicator(CarouselCss css) {
this.css = css;
setElement(DOM.createDiv());
addStyleName(css.indicator());
}
public void setActive(boolean active) {
if (active) {
addStyleName(css.indicatorActive());
} else {
removeStyleName(css.indicatorActive());
}
}
}
private static class WidgetHolder extends FlowPanel {
public WidgetHolder(CarouselCss css) {
addStyleName(css.carouselHolder());
}
@Override
public void add(Widget w) {
super.add(w);
if (w instanceof ScrollPanel) {
w.addStyleName(MGWTStyle.getTheme().getMGWTClientBundle().getLayoutCss()
.fillPanelExpandChild());
}
}
}
private FlowPanel main;
private final CarouselCss css;
private ScrollPanel scrollPanel;
private FlowPanel container;
private CarouselIndicatorContainer carouselIndicatorContainer;
private int currentPage;
private Map<Widget, Widget> childToHolder;
private com.google.web.bindery.event.shared.HandlerRegistration refreshHandler;
private static final CarouselImpl IMPL = GWT.create(CarouselImpl.class);
/**
* Construct a carousel widget with the default css
*/
public Carousel() {
this(MGWTStyle.getTheme().getMGWTClientBundle().getCarouselCss());
}
/**
* Construct a carousel widget with a given css
*
* @param css the css to use
*/
public Carousel(CarouselCss css) {
this.css = css;
this.css.ensureInjected();
childToHolder = new HashMap<Widget, Widget>();
main = new FlowPanel();
initWidget(main);
main.addStyleName(css.carousel());
scrollPanel = new ScrollPanel();
scrollPanel.addStyleName(css.carouselScroller());
main.add(scrollPanel);
container = new FlowPanel();
container.addStyleName(css.carouselContainer());
scrollPanel.setWidget(container);
scrollPanel.setSnap(true);
scrollPanel.setMomentum(false);
scrollPanel.setShowScrollBarX(false);
scrollPanel.setShowScrollBarY(false);
scrollPanel.setScrollingEnabledY(true);
scrollPanel.setAutoHandleResize(false);
currentPage = 0;
scrollPanel.addScrollEndHandler(new ScrollEndEvent.Handler() {
@Override
public void onScrollEnd(ScrollEndEvent event) {
int page;
page = scrollPanel.getCurrentPageX();
carouselIndicatorContainer.setSelectedIndex(page);
currentPage = page;
SelectionEvent.fire(Carousel.this, currentPage);
}
});
MGWT.addOrientationChangeHandler(new OrientationChangeHandler() {
@Override
public void onOrientationChanged(OrientationChangeEvent event) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
refresh();
}
});
}
});
addSelectionHandler(new SelectionHandler<Integer>() {
@Override
public void onSelection(SelectionEvent<Integer> event) {
carouselIndicatorContainer.setSelectedIndex(currentPage);
}
});
if (MGWT.getOsDetection().isDesktop()) {
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
refresh();
}
});
}
});
}
}
@Override
public void add(Widget w) {
WidgetHolder widgetHolder = new WidgetHolder(css);
widgetHolder.add(w);
childToHolder.put(w, widgetHolder);
container.add(widgetHolder);
}
@Override
public void clear() {
container.clear();
childToHolder.clear();
}
@Override
public Iterator<Widget> iterator() {
Set<Widget> keySet = childToHolder.keySet();
return keySet.iterator();
}
@Override
public boolean remove(Widget w) {
Widget holder = childToHolder.remove(w);
if (holder != null) {
return container.remove(holder);
}
return false;
}
@Override
protected void onAttach() {
super.onAttach();
refresh();
}
/**
* refresh the carousel widget, this is necessary after changing child elements
*/
public void refresh() {
IMPL.adjust(main, container);
scrollPanel.setScrollingEnabledX(true);
scrollPanel.setScrollingEnabledY(false);
scrollPanel.setShowScrollBarX(false);
scrollPanel.setShowScrollBarY(false);
if (carouselIndicatorContainer != null) {
carouselIndicatorContainer.removeFromParent();
}
int widgetCount = container.getWidgetCount();
carouselIndicatorContainer = new CarouselIndicatorContainer(css, widgetCount);
main.add(carouselIndicatorContainer);
if (currentPage >= widgetCount) {
currentPage = widgetCount - 1;
}
carouselIndicatorContainer.setSelectedIndex(currentPage);
scrollPanel.refresh();
refreshHandler = scrollPanel.addScrollRefreshHandler(new ScrollRefreshEvent.Handler() {
@Override
public void onScrollRefresh(ScrollRefreshEvent event) {
refreshHandler.removeHandler();
refreshHandler = null;
scrollPanel.scrollToPage(currentPage, 0, 0);
}
});
}
public void setSelectedPage(int index) {
LightArrayInt pagesX = scrollPanel.getPagesX();
if (index < 0 || index >= pagesX.length()) {
throw new IllegalArgumentException("invalid value for index: " + index);
}
currentPage = index;
scrollPanel.scrollToPage(index, 0, 300);
}
@Override
public HandlerRegistration addSelectionHandler(SelectionHandler<Integer> handler) {
return addHandler(handler, SelectionEvent.getType());
}
/**
*
* @author Daniel Kurka
*
*/
public static interface CarouselImpl {
/**
*
* @param main
* @param container
*/
void adjust(FlowPanel main, FlowPanel container);
}
/**
*
* @author Daniel Kurka
*
*/
public static class CarouselImplSafari implements CarouselImpl {
@Override
public void adjust(FlowPanel main, FlowPanel container) {
int widgetCount = container.getWidgetCount();
double sizeFactor = 100d / widgetCount;
for (int i = 0; i < widgetCount; i++) {
container.getWidget(i).setWidth(sizeFactor + "%");
}
container.setWidth((widgetCount * 100) + "%");
}
}
/**
*
* @author Daniel Kurka
*
*/
public static class CarouselImplGecko implements CarouselImpl {
@Override
public void adjust(FlowPanel main, FlowPanel container) {
int widgetCount = container.getWidgetCount();
int offsetWidth = main.getOffsetWidth();
container.setWidth(widgetCount * offsetWidth + "px");
for (int i = 0; i < widgetCount; i++) {
container.getWidget(i).setWidth(offsetWidth + "px");
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
ee01efa6ce3d30b677567967d7c4adc94668c9e4 | 72e5a0244e0b50def3e0a5f84634e12cdbdae4fa | /src/main/java/com/shiro/class12/entity/User.java | f5b85f37d194ac9983e936af5430f1a332cc2cbd | [] | no_license | xieyongpeng/shiro | b4c5d5a4516bc1668b7b6cac39691735c13c58ff | c3ce59447db89323808e1284128930929e51cb23 | refs/heads/master | 2022-12-23T19:03:36.153508 | 2020-02-01T13:32:00 | 2020-02-01T13:32:00 | 232,465,639 | 0 | 0 | null | 2022-12-16T10:42:27 | 2020-01-08T03:03:17 | Java | UTF-8 | Java | false | false | 1,963 | java | package com.shiro.class12.entity;
import java.io.Serializable;
/**
* <p>User: Zhang Kaitao
* <p>Date: 14-1-28
* <p>Version: 1.0
*/
public class User implements Serializable {
private Long id;
private String username;
private String password;
private String salt;
private Boolean locked = Boolean.FALSE;
public User() {
}
public User(String username, String password) {
this.username = username;
this.password = password;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public String getCredentialsSalt() {
return username + salt;
}
public Boolean getLocked() {
return locked;
}
public void setLocked(Boolean locked) {
this.locked = locked;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
if (id != null ? !id.equals(user.id) : user.id != null) return false;
return true;
}
@Override
public int hashCode() {
return id != null ? id.hashCode() : 0;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", username='" + username + '\'' +
", password='" + password + '\'' +
", salt='" + salt + '\'' +
", locked=" + locked +
'}';
}
}
| [
"xieyp@asiainfo.com"
] | xieyp@asiainfo.com |
7f6894ba5eaa27f869b96c4a373da5ada7809ab6 | cc7f3fe1330eda7cb6f4a257f7aa94a4125af561 | /src/com/shawn/main/AB.java | 715243c1a36a27e955d403786e9db42001bc8306 | [] | no_license | shawn2409/CoreJava | 453d641cb119101b88660651b4706bda39739157 | 6e6c144f92f4901ebcd232deee048c0fe8528147 | refs/heads/master | 2023-01-20T14:36:17.892784 | 2020-11-16T03:49:54 | 2020-11-16T03:49:54 | 279,478,131 | 0 | 0 | null | 2020-07-14T04:09:35 | 2020-07-14T04:07:13 | null | UTF-8 | Java | false | false | 724 | java | package com.shawn.main;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
public class AB {
public static void main(String[] args) {
Integer[] a = {1, 1, 2, 2, 2, 2, 3,};
Map<Integer, Integer> integerMap = new HashMap<>();
for (int i = 0; i < a.length; i++) {
if (integerMap.containsKey(a[i])) {
integerMap.put(a[i], a[i] + 1);
} else {
integerMap.put(a[i], 1);
}
}
for (Map.Entry m : integerMap.entrySet()) {
System.out.println(m.getKey() + " " + m.getValue());
}
String[] b = {"er", "sd", "ss", "fs", "lp"};
}
}
| [
"shawnc850@gmail.com"
] | shawnc850@gmail.com |
9a0f355695d1a0977fd3516058146c1a93c73a9a | 9f380a08d00b9713c9cf5f1aa66a9d27e01dab8a | /ssserver/src/main/java/com/hellozjf/shadowsocks/ssserver/encryption/CryptUtil.java | 6eae6fdc8e15c364286212f3297b801b69151638 | [] | no_license | hellozjf/shadowsocks-java.del | 9b272a2921bc7337aae4185db78fe3dde8fc7368 | acb3f7570b7fbc93e01d2819084e61e2dfdc78e6 | refs/heads/master | 2021-10-08T08:45:01.577208 | 2018-11-05T05:20:53 | 2018-11-05T05:20:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,088 | java | package com.hellozjf.shadowsocks.ssserver.encryption;
import io.netty.buffer.ByteBuf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class CryptUtil {
private static Logger logger = LoggerFactory.getLogger(CryptUtil.class);
public static byte[] encrypt(ICrypt crypt, Object msg) {
byte[] data = null;
ByteArrayOutputStream _remoteOutStream = null;
try {
_remoteOutStream = new ByteArrayOutputStream();
ByteBuf bytebuff = (ByteBuf) msg;
int len = bytebuff.readableBytes();
byte[] arr = new byte[len];
bytebuff.getBytes(0, arr);
crypt.encrypt(arr, arr.length, _remoteOutStream);
data = _remoteOutStream.toByteArray();
} catch (Exception e) {
logger.error("encrypt error", e);
} finally {
if (_remoteOutStream != null) {
try {
_remoteOutStream.close();
} catch (IOException e) {
}
}
}
return data;
}
public static byte[] decrypt(ICrypt crypt, Object msg) {
byte[] data = null;
ByteArrayOutputStream _localOutStream = null;
try {
_localOutStream = new ByteArrayOutputStream();
ByteBuf bytebuff = (ByteBuf) msg;
int len = bytebuff.readableBytes();
byte[] arr = new byte[len];
bytebuff.getBytes(0, arr);
// logger.debug("before:" + Arrays.toString(arr));
crypt.decrypt(arr, arr.length, _localOutStream);
data = _localOutStream.toByteArray();
// logger.debug("after:" + Arrays.toString(data));
} catch (Exception e) {
logger.error("decrypt error", e);
} finally {
if (_localOutStream != null) {
try {
_localOutStream.close();
} catch (IOException e) {
}
}
}
return data;
}
}
| [
"908686171@qq.com"
] | 908686171@qq.com |
cf4c71e990b86467b3029ecda8f10bf34c628cfd | d0a035af319f5ed43047defc1804980cdf3469aa | /azkarra-api/src/main/java/io/streamthoughts/azkarra/api/query/LocalPreparedQuery.java | 3d7a6acf736cb8934454e6c792b3ff8d863d9316 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | streamthoughts/azkarra-streams | 43f9d742081818a4349d0a54403255ac4db7ac11 | a485a42f520f1d86919da4f1ba8d752dac037940 | refs/heads/master | 2023-01-05T21:27:15.555160 | 2022-01-04T16:33:45 | 2022-01-06T13:21:22 | 224,235,390 | 186 | 26 | Apache-2.0 | 2023-01-05T01:50:51 | 2019-11-26T16:18:45 | HTML | UTF-8 | Java | false | false | 2,942 | java | /*
* Copyright 2019-2020 StreamThoughts.
*
* 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 io.streamthoughts.azkarra.api.query;
import io.streamthoughts.azkarra.api.errors.Error;
import io.streamthoughts.azkarra.api.monad.Validator;
import io.streamthoughts.azkarra.api.query.error.InvalidQueryException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* A {@code LocalStoreQueryBuilder} is used to build new {@link LocalExecutableQuery}.
*
* @param <K> the expected type for key.
* @param <V> the expected type for value.
*/
public interface LocalPreparedQuery<K, V> {
/**
* Gets a new {@link Validator} for the given parameters.
*
* @param params the query parameters to validate.
* @return the {@link Validator}.
*/
default Validator<QueryParams> validator(final QueryParams params) {
return Validator.of(Objects.requireNonNull(params, "params cannot be null"));
}
/**
* Validates the given query parameters.
*
* @param params the query parameters to validate.
* @return the optional list of errors.
*/
default Optional<List<Error>> validate(final QueryParams params) {
Objects.requireNonNull(params, "parameters cannot be null");
return validator(params)
.toEither()
.right()
.toOptional();
}
/**
* Builds a new {@link LocalExecutableQuery} based on the given {@link Query}.
*
* @param params the parameters of the query.
* @return the new {@link LocalExecutableQuery}.
*/
LocalExecutableQuery<K, V> compile(final QueryParams params) throws InvalidQueryException;
final class MissingRequiredKeyError extends Error {
private final String key;
public static MissingRequiredKeyError of(final String key) {
return new MissingRequiredKeyError(key);
}
MissingRequiredKeyError(final String key) {
super("missing required parameter '" + key + "'.");
this.key = key;
}
public String invalidKey() {
return key;
}
}
}
| [
"florian.hussonnois@gmail.com"
] | florian.hussonnois@gmail.com |
cdbf956c0c098df6bd40534f5e1ac8c5b83a0a1f | aca457909ef8c4eb989ba23919de508c490b074a | /DialerJADXDecompile/bt.java | d3267b168fe877066f87d6bd89407ecd51322978 | [] | no_license | KHikami/ProjectFiCallingDeciphered | bfccc1e1ba5680d32a4337746de4b525f1911969 | cc92bf6d4cad16559a2ecbc592503d37a182dee3 | refs/heads/master | 2021-01-12T17:50:59.643861 | 2016-12-08T01:20:34 | 2016-12-08T01:23:04 | 71,650,754 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,514 | java | import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.ConstantState;
/* compiled from: PG */
final class bt extends ConstantState {
int a;
bs b;
ColorStateList c;
Mode d;
boolean e;
Bitmap f;
ColorStateList g;
Mode h;
int i;
boolean j;
boolean k;
Paint l;
public bt(bt btVar) {
this.c = null;
this.d = bn.a;
if (btVar != null) {
this.a = btVar.a;
this.b = new bs(btVar.b);
if (btVar.b.b != null) {
this.b.b = new Paint(btVar.b.b);
}
if (btVar.b.a != null) {
this.b.a = new Paint(btVar.b.a);
}
this.c = btVar.c;
this.d = btVar.d;
this.e = btVar.e;
}
}
public final void a(int i, int i2) {
this.f.eraseColor(0);
this.b.a(new Canvas(this.f), i, i2, null);
}
public bt() {
this.c = null;
this.d = bn.a;
this.b = new bs();
}
public final Drawable newDrawable() {
return new bn(this);
}
public final Drawable newDrawable(Resources resources) {
return new bn(this);
}
public final int getChangingConfigurations() {
return this.a;
}
}
| [
"chu.rachelh@gmail.com"
] | chu.rachelh@gmail.com |
75dd19b2a840400dc504e57cd54170827d47e238 | 8bed8c8d545323e1d455f1eb54123545fe089e3c | /providers/elasticsearch/shedlock-provider-elasticsearch/src/main/java/net/javacrumbs/shedlock/provider/elasticsearch/ElasticsearchLockProvider.java | 81ac487c6a9e7d3e97079733931ec8d3052d8aed | [
"Apache-2.0"
] | permissive | jesty/ShedLock | 36edab7ea4bdc9850158cebed727c70b5bee9e2a | 2e1deb3d71c59451c0e72af6ed6e83a4cbcad567 | refs/heads/master | 2020-06-13T02:31:19.803949 | 2019-10-21T09:28:45 | 2019-10-21T09:28:45 | 194,502,347 | 0 | 0 | Apache-2.0 | 2019-06-30T10:17:48 | 2019-06-30T10:17:48 | null | UTF-8 | Java | false | false | 7,087 | java | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 net.javacrumbs.shedlock.provider.elasticsearch;
import net.javacrumbs.shedlock.core.AbstractSimpleLock;
import net.javacrumbs.shedlock.core.LockConfiguration;
import net.javacrumbs.shedlock.core.LockProvider;
import net.javacrumbs.shedlock.core.SimpleLock;
import net.javacrumbs.shedlock.support.LockException;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.DocWriteResponse;
import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptType;
import java.io.IOException;
import java.time.Instant;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import static net.javacrumbs.shedlock.support.Utils.getHostname;
/**
* Lock using ElasticSearch >= 6.4.0.
* Requires elasticsearch-rest-high-level-client > 6.4.0
* <p>
* It uses a collection that contains documents like this:
* <pre>
* {
* "name" : "lock name",
* "lockUntil" : {
* "type": "date",
* "format": "epoch_millis"
* },
* "lockedAt" : {
* "type": "date",
* "format": "epoch_millis"
* }:
* "lockedBy" : "hostname"
* }
* </pre>
* <p>
* lockedAt and lockedBy are just for troubleshooting and are not read by the code
*
* <ol>
* <li>
* Attempts to insert a new lock record. As an optimization, we keep in-memory track of created lock records. If the record
* has been inserted, returns lock.
* </li>
* <li>
* We will try to update lock record using filter _id == name AND lock_until <= now
* </li>
* <li>
* If the update succeeded (1 updated document), we have the lock. If the update failed (0 updated documents) somebody else holds the lock
* </li>
* <li>
* When unlocking, lock_until is set to now.
* </li>
* </ol>
*/
public class ElasticsearchLockProvider implements LockProvider {
static final String SCHEDLOCK_DEFAULT_INDEX = "shedlock";
static final String SCHEDLOCK_DEFAULT_TYPE = "lock";
static final String LOCK_UNTIL = "lockUntil";
static final String LOCKED_AT = "lockedAt";
static final String LOCKED_BY = "lockedBy";
static final String NAME = "name";
private static final String UPDATE_SCRIPT =
"if (ctx._source." + LOCK_UNTIL + " <= " + "params." + LOCKED_AT + ") { " +
"ctx._source." + LOCKED_BY + " = params." + LOCKED_BY + "; " +
"ctx._source." + LOCKED_AT + " = params." + LOCKED_AT + "; " +
"ctx._source." + LOCK_UNTIL + " = params." + LOCK_UNTIL + "; " +
"} else { " +
"ctx.op = 'none' " +
"}";
private final RestHighLevelClient highLevelClient;
private final String hostname;
private final String index;
private final String type;
private ElasticsearchLockProvider(RestHighLevelClient highLevelClient, String index, String type) {
this.highLevelClient = highLevelClient;
this.hostname = getHostname();
this.index = index;
this.type = type;
}
public ElasticsearchLockProvider(RestHighLevelClient highLevelClient, String documentType) {
this(highLevelClient, SCHEDLOCK_DEFAULT_INDEX, documentType);
}
public ElasticsearchLockProvider(RestHighLevelClient highLevelClient) {
this(highLevelClient, SCHEDLOCK_DEFAULT_INDEX, SCHEDLOCK_DEFAULT_TYPE);
}
@Override
public Optional<SimpleLock> lock(LockConfiguration lockConfiguration) {
try {
Map<String, Object> lockObject = lockObject(lockConfiguration.getName(),
lockConfiguration.getLockAtMostUntil(),
now());
UpdateRequest ur = new UpdateRequest()
.index(index)
.type(type)
.id(lockConfiguration.getName())
.script(new Script(ScriptType.INLINE,
"painless",
UPDATE_SCRIPT,
lockObject)
)
.upsert(lockObject)
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
UpdateResponse res = highLevelClient.update(ur, RequestOptions.DEFAULT);
if (res.getResult() != DocWriteResponse.Result.NOOP) {
return Optional.of(new ElasticsearchSimpleLock(lockConfiguration));
} else {
return Optional.empty();
}
} catch (IOException | ElasticsearchException e) {
if (e instanceof ElasticsearchException && ((ElasticsearchException) e).status() == RestStatus.CONFLICT) {
return Optional.empty();
} else {
throw new LockException("Unexpected exception occurred", e);
}
}
}
private Instant now() {
return Instant.now();
}
private Map<String, Object> lockObject(String name, Instant lockUntil, Instant lockedAt) {
Map<String, Object> lock = new HashMap<>();
lock.put(NAME, name);
lock.put(LOCKED_BY, hostname);
lock.put(LOCKED_AT, lockedAt.toEpochMilli());
lock.put(LOCK_UNTIL, lockUntil.toEpochMilli());
return lock;
}
private final class ElasticsearchSimpleLock extends AbstractSimpleLock {
private ElasticsearchSimpleLock(LockConfiguration lockConfiguration) {
super(lockConfiguration);
}
@Override
public void doUnlock() {
// Set lockUtil to now or lockAtLeastUntil whichever is later
try {
UpdateRequest ur = new UpdateRequest()
.index(index)
.type(type)
.id(lockConfiguration.getName())
.script(new Script(ScriptType.INLINE,
"painless",
"ctx._source.lockUntil = params.unlockTime",
Collections.singletonMap("unlockTime", lockConfiguration.getUnlockTime().toEpochMilli())));
highLevelClient.update(ur, RequestOptions.DEFAULT);
} catch (IOException | ElasticsearchException e) {
throw new LockException("Unexpected exception occurred", e);
}
}
}
} | [
"lukas@krecan.net"
] | lukas@krecan.net |
469d99d94efc0061237358b58eeab0490fa0da3b | ef03c8f258d69e39c71e1de5492511323a7cc3af | /security-demo/src/test/java/security/test/BaseTest.java | c8784e9264ae723c201e65263fbd427699336038 | [] | no_license | ysyl/security_module | f758a68d803000262769788544864987463fd2cf | 01bd0b13294ef0e594f13b482fd1cdea52584c9f | refs/heads/master | 2020-03-22T20:55:49.777749 | 2018-08-13T09:26:36 | 2018-08-13T09:26:36 | 140,643,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 860 | java | package security.test;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration( locations= {"classpath:applicationContext.xml"})
public class BaseTest {
private static final Logger logger = Logger.getLogger(BaseTest.class.getName());
@Autowired
UserDetailsService uds;
@Test
public void test() {
UserDetails ud = uds.loadUserByUsername("verrickt");
logger.info(ud.getPassword());
}
}
| [
"zhoujian1237@gmail.com"
] | zhoujian1237@gmail.com |
f68f56fb6b499fee09eb1b874155ccded094126a | 8712369447a7d796127cedbfa5a027cc07bbdf82 | /src/PingPong/EdgeClass.java | 5a6c0f4ba1ae265fca981ad342b2b73ac9ba20a8 | [] | no_license | tjfzt091690/PingPongOptimazationAlgrithm | 4756849b70d448632b4c2e633b53c45082f1dba5 | 57b7491bd0b85f719e67b31d0093b1711fd6683f | refs/heads/master | 2020-04-28T16:35:09.257126 | 2019-03-14T13:17:32 | 2019-03-14T13:17:32 | 175,416,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package PingPong;
import java.util.ArrayList;
public class EdgeClass extends Edge{
@Override
public ArrayList<Double> touchCollision(ArrayList<Double> x) {
ArrayList<Double> dirs=new ArrayList<Double>(x.size());
for(int i=0;i<x.size();i++){
if(x.get(i)>=-1.0 && x.get(i)<=1.0)
dirs.add(1.0);
else
dirs.add(-1.0);
}
return dirs;
}
}
| [
"976755393@qq.com"
] | 976755393@qq.com |
82ca60e7f40514a7f0e180e8547ef22d60590aae | 09b96c69e0c2a098c375483b73575ddb6b1e3f0f | /app/src/main/java/com/example/prince/g_app/Why_gate.java | 6a7d0351c81b0debb61d09660ec460566030b033 | [] | no_license | Prince779/Gate-Android-App | 0193c5fb5475417951b1b8d068ab398b1568bb55 | 2da4365a737e3cd62482e7b34da9c175b6aa5882 | refs/heads/master | 2020-08-14T05:12:39.236613 | 2019-10-14T17:28:39 | 2019-10-14T17:28:39 | 215,060,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,809 | java | package com.example.prince.g_app;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TabLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
public class Why_gate extends AppCompatActivity {
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
* fragments for each of the sections. We use a
* {@link FragmentPagerAdapter} derivative, which will keep every
* loaded fragment in memory. If this becomes too memory intensive, it
* may be best to switch to a
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
private SectionsPagerAdapter mSectionsPagerAdapter;
/**
* The {@link ViewPager} that will host the section contents.
*/
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_why_gate);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabDots);
tabLayout.setupWithViewPager(mViewPager, true);
mViewPager.setAdapter(mSectionsPagerAdapter);
ImageView back=(ImageView)findViewById(R.id.back);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_why_gate, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/*
public void jumptoleft(View view) {
mViewPager.setCurrentItem(mViewPager.getCurrentItem() - 1, true);
}
public void jumptoright(View view) {
mViewPager.setCurrentItem(mViewPager.getCurrentItem() + 1, true);
}*/
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
/**
* The fragment argument representing the section number for this
* fragment.
*/
private static final String ARG_SECTION_NUMBER = "section_number";
public PlaceholderFragment() {
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_why_gate, container, false);
TextView textView = (TextView) rootView.findViewById(R.id.section_label);
textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
return rootView;
}
}
/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
if(position==0){
return new why_fragment_1();
}else if(position==1) {
return new why_fragment_2();
}if(position==2) {
return new why_fragment_3();
}else
return PlaceholderFragment.newInstance(position + 1);
}
@Override
public int getCount() {
// Show 3 total pages.
return 3;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "SECTION 1";
case 1:
return "SECTION 2";
case 2:
return "SECTION 3";
}
return null;
}
}
}
| [
"princekumar23142@gmail.com"
] | princekumar23142@gmail.com |
fd5ff38a2099dccf0791f4733fcb7de3e25fabb9 | 7d7c61ab633dfd7cc709e3b1a24b2da2c925a8df | /src/amazon_questions/others/PartitionLabel.java | 58ef72aa9f80997b48d136230e3fe5dab3161919 | [] | no_license | omup80/Data-Structure | 083753afa92c2cefafaeccdf86e11544c30ea528 | 672248bccd032d92a09b580400f64c767ccdf1ca | refs/heads/master | 2023-02-22T18:16:21.492791 | 2021-01-27T18:23:43 | 2021-01-27T18:23:43 | 273,060,617 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 691 | java | package amazon_questions.others;
import java.util.ArrayList;
import java.util.List;
//763. Partition Labels
//https://leetcode.com/problems/partition-labels/
class PartitionLabel {
public List<Integer> partitionLabels(String S) {
int[] last = new int[26];
for (int i = 0; i < S.length(); ++i)
last[S.charAt(i) - 'a'] = i;
int j = 0, anchor = 0;
List<Integer> ans = new ArrayList();
for (int i = 0; i < S.length(); ++i) {
j = Math.max(j, last[S.charAt(i) - 'a']);
if (i == j) {
ans.add(i - anchor + 1);
anchor = i + 1;
}
}
return ans;
}
} | [
"omjitsingh2020@u.northwestern.edu"
] | omjitsingh2020@u.northwestern.edu |
accc20d9625a80d896525773fff9326f3f95a5eb | 8d3dcf19deb7f9869c6c05976418add7b4af179c | /app-wanda-credit-ds/src/main/java/com/wanda/credit/ds/client/wangshu/BaseYinXingAuthenBankCardDataSourceRequestor.java | c92524cbdaec8ee3ebf48a61a091c5cc7d6f808a | [] | no_license | jianyking/credit-core | 87fb22f1146303fa2a64e3f9519ca6231a4a452d | c0ba2a95919828bb0a55cb5f76c81418e6d38951 | refs/heads/master | 2022-04-07T05:41:19.684089 | 2020-02-14T05:29:10 | 2020-02-14T05:29:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,667 | java | package com.wanda.credit.ds.client.wangshu;
import com.alibaba.fastjson.JSONObject;
import com.wanda.credit.base.Conts;
import com.wanda.credit.common.template.PropertyEngine;
import com.wanda.credit.ds.dao.iface.IAllAuthCardService;
import com.wanda.credit.ds.iface.IDataSourceRequestor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
/**
* @author shiwei
* @version $$Id: BaseYinXingAuthenBankCardDataSourceRequestor, V 0.1 2017/10/25 13:54 shiwei Exp $$
*/
public abstract class BaseYinXingAuthenBankCardDataSourceRequestor extends BaseWDWangShuDataSourceRequestor
implements IDataSourceRequestor {
private final Logger logger = LoggerFactory.getLogger(BaseYinXingAuthenBankCardDataSourceRequestor.class);
@Autowired
protected WDWangShuTokenService tokenService;
@Autowired
protected IAllAuthCardService allAuthCardService;
protected Map<String,Object> doRequest(String trade_id, String url,boolean forceRefresh) throws Exception {
Map<String,Object> header = new HashMap<String,Object>();
if(forceRefresh){
logger.info("{} 强制刷新token",trade_id);
tokenService.setToken(tokenService.getNewToken());
logger.info("{} 强制刷新token结束",trade_id);
}else if(tokenService.getToken() == null){
logger.info("{} 发起token请求",trade_id);
tokenService.setToken(tokenService.getNewToken());
logger.info("{} 发起token请求结束",trade_id);
}
// String token = PropertyEngine.get("tmp_tokenid");
String token = tokenService.getToken();
header.put("X-Access-Token",token);
logger.info("{} tokenid {}",trade_id,token);
logger.info("{} start request",trade_id);
Map<String,Object> rspMap = doGetForHttpAndHttps(url,trade_id,header,null);
logger.info("{} end request",trade_id);
return rspMap;
}
protected boolean needRetry(int httpstatus, JSONObject rsponse) {
if(httpstatus == 401){
return true;
}
return false;
}
protected boolean isSuccess(JSONObject rspData) {
if("2001".equals(rspData.getString("code"))){
return true;
}
return false;
}
protected String buildTag(String trade_id, JSONObject rspData) {
Object res = rspData.get("respCode");
String resstr = null;
if(res != null ){
resstr = res.toString();
if("00".equals(resstr) || "01".equals(resstr)){
return Conts.TAG_TST_SUCCESS;
}
}
return Conts.TAG_TST_FAIL;
}
protected Map<? extends String, ? extends Object> visitBusiData(
String trade_id, JSONObject data, boolean isOut) {
Map<String,Object> ret = new HashMap<String,Object>();
Object resObj = data.get("respCode");
if(resObj == null){
logger.error("{} respCode 字段值非法 ,",trade_id,data.toJSONString());
return ret;
}
String message = data.getString("respMsg");
String res = resObj.toString();
String respCode = res; String resMsg = message;
if("00".equals(res)){
respCode = "2000" ;
resMsg = "认证一致" ;
}else if("01".equals(res)){
respCode = "2001";
resMsg = "认证不一致";
}else if("02".equals(res)){
respCode = "2003";
resMsg = "不支持验证";
}else if("03".equals(res)){
respCode = "-9991";
resMsg = "验证要素格式有误";
}else if("04".equals(res)){
respCode = "-9999";
resMsg = "系统异常";
}
ret.put("respCode", respCode);
ret.put("respDesc", resMsg);
String detailRespCode = data.getString("detailRespCode");
String detailRespMsg = data.getString("detailRespMsg");
//转换detailRespCode 为万达标准
Map<String, String> respDetailMap = getRespDetailMap();
if(respDetailMap.containsKey(detailRespCode)) {
ret.put("detailRespCode", respDetailMap.get(detailRespCode));
}
if (!isOut){
ret.put("certType", data.getString("certType"));
ret.put("dcType", data.getString("dcType"));
ret.put("detailRespMsg", detailRespMsg);
}
return ret;
}
public Map<String, String> getRespDetailMap(){
Map<String, String> respDetailMap = new HashMap<>();
respDetailMap.put("0000", "");
respDetailMap.put("2310", "0101");
respDetailMap.put("2311", "0102");
respDetailMap.put("2314", "0103");
respDetailMap.put("2315", "0301");
respDetailMap.put("2316", "0104");
respDetailMap.put("2317", "");
respDetailMap.put("2318", "0105");
respDetailMap.put("2319", "0106");
respDetailMap.put("2320", "0107");
respDetailMap.put("2321", "0302");
respDetailMap.put("2325", "0303");
respDetailMap.put("2326", "0108");
respDetailMap.put("2330", "0109");
respDetailMap.put("2334", "0304");
respDetailMap.put("2343", "0305");
respDetailMap.put("2344", "0110");
respDetailMap.put("2345", "0306");
respDetailMap.put("2400", "0111");
respDetailMap.put("2401", "0112");
respDetailMap.put("2402", "0113");
respDetailMap.put("2403", "0114");
respDetailMap.put("2404", "0114");
respDetailMap.put("5000", "0308");
respDetailMap.put("4001", "");
respDetailMap.put("4002", "");
respDetailMap.put("4003", "");
respDetailMap.put("4004", "");
respDetailMap.put("4005", "");
respDetailMap.put("4006", "");
respDetailMap.put("1103", "0201");
respDetailMap.put("1201", "0202");
respDetailMap.put("1302", "0203");
respDetailMap.put("1305", "0204");
respDetailMap.put("1399", "0205");
respDetailMap.put("2208", "0206");
respDetailMap.put("2301", "0207");
respDetailMap.put("2302", "0208");
respDetailMap.put("2306", "0209");
respDetailMap.put("2308", "0210");
respDetailMap.put("2309", "0211");
respDetailMap.put("2324", "0212");
respDetailMap.put("2327", "0213");
respDetailMap.put("2329", "0214");
respDetailMap.put("2341", "0215");
respDetailMap.put("2342", "0216");
respDetailMap.put("2405", "0217");
return respDetailMap;
}
} | [
"liunan1944@163.com"
] | liunan1944@163.com |
48da73c3a881626e1677afe40ce297fd54ad9319 | b465521e8f69ae2e0cf8f3b83539dad111a749ee | /app/src/main/java/com/example/micha/googlemapsagain/BaseView.java | 12af323d5f9f5929f358c594a55bd055c4a38b7a | [] | no_license | Mazogu/FunWithGoogleMaps | 2366472e48934da23f9ba19109e9728127ca4421 | 3799085568d4107da8ed36650bbab931cd7dfe28 | refs/heads/master | 2021-04-27T01:46:04.268898 | 2018-02-23T23:02:42 | 2018-02-23T23:02:42 | 122,681,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 147 | java | package com.example.micha.googlemapsagain;
/**
* Created by micha on 2/23/2018.
*/
public interface BaseView {
void showError(String s);
}
| [
"michael_doom@hotmail.com"
] | michael_doom@hotmail.com |
6d5040c1881472b24808fc8ae122c52db7d9f4da | ae7441f40ad25f3db2066656525081be47467e60 | /Add_an_Entry_Bank.java | 18ef5655d735de700534e6a95b3b6a224d80b826 | [] | no_license | Tharanya15/Personal-Vault | c264b6e2e01548b7838f4acd51d32bd56fee1a33 | 434fe309b38d2881dcee209895a2124f4652c5ba | refs/heads/main | 2023-04-21T14:14:42.821922 | 2021-05-04T05:59:17 | 2021-05-04T05:59:17 | 364,154,760 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,469 | java |
package Orginal_Project;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class Add_an_Entry_Bank
{
JLabel l,l_accno,l_holder,l_bank,l_branch,l_ifsc;
JTextField t_accno,t_holder,t_bank,t_branch,t_ifsc;
JButton b_add,b_cancel;
public Add_an_Entry_Bank(String str)
{
JFrame f=new JFrame();
f.setTitle("Bank Details");
f.setBounds(590,150,700,800);
f.getContentPane().setBackground(new Color(42, 43, 41));
l=new JLabel("Bank Details");
l_accno=new JLabel("Account Number");
l_holder=new JLabel("Account Holder Name");
l_bank=new JLabel("Bank Name");
l_branch=new JLabel("Bank Branch");
l_ifsc=new JLabel("IFSC code");
l.setBounds(240,30,250,30);
l_accno.setBounds(100,100,200,30);
l_holder.setBounds(100,200,250,30);
l_bank.setBounds(100,300,150,30);
l_branch.setBounds(100,400,150,30);
l_ifsc.setBounds(100,500,250,30);
l.setForeground(new Color(250, 74, 20));
l_accno.setForeground(new Color(250, 74, 20));
l_holder.setForeground(new Color(250, 74, 20));
l_bank.setForeground(new Color(250, 74, 20));
l_branch.setForeground(new Color(250, 74, 20));
l_ifsc.setForeground(new Color(250, 74, 20));
l.setFont(new Font("Dialog",Font.BOLD,40));
l_accno.setFont(new Font("serif",Font.BOLD,25));
l_holder.setFont(new Font("serif",Font.BOLD,25));
l_bank.setFont(new Font("serif",Font.BOLD,25));
l_branch.setFont(new Font("serif",Font.BOLD,25));
l_ifsc.setFont(new Font("serif",Font.BOLD,25));
JPanel p=new JPanel();
p.setBounds(350,95,260,42);
p.setBackground(new Color(240, 105, 14));
JPanel p1=new JPanel();
p1.setBounds(350,195,260,42);
p1.setBackground(new Color(240, 105, 14));
JPanel p2=new JPanel();
p2.setBounds(350,295,260,42);
p2.setBackground(new Color(240, 105, 14));
JPanel p3=new JPanel();
p3.setBounds(350,395,260,42);
p3.setBackground(new Color(240, 105, 14));
JPanel p4=new JPanel();
p4.setBounds(350,495,260,42);
p4.setBackground(new Color(240, 105, 14));
t_accno=new JTextField();
t_holder=new JTextField();
t_bank=new JTextField();
t_branch=new JTextField();
t_ifsc=new JTextField();
t_accno.setBounds(355,100,250,30);
t_holder.setBounds(355,200,250,30);
t_bank.setBounds(355,300,250,30);
t_branch.setBounds(355,400,250,30);
t_ifsc.setBounds(355,500,250,30);
b_add=new JButton("Add");
b_cancel=new JButton("Cancel");
b_add.setBounds(200,600,150,50);
b_cancel.setBounds(380,600,150,50);
b_add.setBackground(new Color(250, 74, 20));
b_cancel.setBackground(new Color(250, 74, 20));
b_add.setFont(new Font("Monospace",Font.BOLD,35));
b_cancel.setFont(new Font("Monospace",Font.BOLD,35));
b_cancel.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent w)
{
f.setVisible(false);
new new_View_table(str);
}
});
b_add.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent t)
{
String acc_no=t_accno.getText();
String holder=t_holder.getText();
String bank=t_bank.getText();
String branch=t_branch.getText();
String ifsc=t_ifsc.getText();
if(acc_no.equals("")|| holder.equals("")|| bank.equals("")|| branch.equals("")||ifsc.equals(""))
{
if(acc_no.equals(""))
{
JOptionPane.showMessageDialog(null,"Account number is mandatory!");
}
else if(holder.equals(""))
{
JOptionPane.showMessageDialog(null,"Name is mandatory!");
}
else if(bank.equals(""))
{
JOptionPane.showMessageDialog(null,"Bank name is mandatory!");
}
else if(branch.equals(""))
{
JOptionPane.showMessageDialog(null,"Branch name is mandatory!");
}
else if(ifsc.equals(""))
{
JOptionPane.showMessageDialog(null,"IFSC code is mandatory!");
}
}
else
{
String regex1="^\\d{9,18}$"; //REGEX NOTE: CORRECT!
Pattern p=Pattern.compile(regex1);
Matcher m=p.matcher(acc_no);
Boolean b=m.matches();
int flag1=0;
if(b==false)
{
JOptionPane.showMessageDialog(null,"Enter a valid account number!");
}
else
{
flag1=1;
}
String regex2="^[A-Z]{4}0[A-Z0-9]{6}$";
Pattern p1=Pattern.compile(regex2);
Matcher m1=p1.matcher(ifsc);
Boolean b1=m1.matches();
int flag2=0;
if(b1==false)
{
JOptionPane.showMessageDialog(null,"Enter a valid IFSC code!");
}
else
{
flag2=1;
System.out.println("valid ifsc");
}
if(flag1==1 && flag2==1)
{
int flag_accno=0,flag_ifsc=0;
try
{
Connection con=Database_Connection.getConnection(str);
Statement st=con.createStatement();
String pass_value="_AccountDetails";
String query="select * from "+str+pass_value;
ResultSet rs=st.executeQuery(query);
//System.out.println("success");
while(rs.next())
{
if(acc_no.equals(rs.getString("acc_number")))
{ flag_accno=1;
break;
}
if(ifsc.equals(rs.getString("ifsc")))
{
flag_ifsc=1;
break;
}
}
if(flag_accno==1)
{
JOptionPane.showMessageDialog(null,"You might have entered the wrong Account Number!");
}
if(flag_ifsc==1)
{
JOptionPane.showMessageDialog(null,"You might have entered the wrong IFSC!");
}
if(flag_accno==0)
{
if(flag_ifsc==0)
{
String q="Insert into "+str+pass_value+" values('"+acc_no+"','"+holder+"','"+bank+"','"+branch+"','"+ifsc+"')";
int r=st.executeUpdate(q);
System.out.println(r);
JOptionPane.showMessageDialog(null,"Sucessfully added!");
f.setVisible(false);
new new_View_table(str);
}
}
}
catch(Exception ee)
{
System.out.println(ee);
}
}
}
}});
f.add(l);
f.add(l_accno);
f.add(l_bank);
f.add(l_holder);
f.add(l_branch);
f.add(l_ifsc);
f.add(t_accno);
f.add(t_holder);
f.add(t_bank);
f.add(t_branch);
f.add(t_ifsc);
f.add(b_add);
f.add(b_cancel);
f.add(p);
f.add(p1);
f.add(p2);
f.add(p3);
f.add(p4);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String args[])
{
}
}
| [
"tharanyachikku@gmail.com"
] | tharanyachikku@gmail.com |
36fcb42ff12e14a08dde83e0c59a6cc8974d682a | e0477f51e31e33c0a44df9e403022fc21c8cab97 | /src/main/java/Dealer.java | 1d74ede8ce7e47de2d098c744a6a102b5aa92338 | [] | no_license | DVEC95/Blackjack | e17f06016c0611dcb50a2113983a8d0b96fea84b | 2bacf8b789350252dd28ec29adc15e23ec15e044 | refs/heads/master | 2022-12-27T16:02:46.559969 | 2020-07-19T17:23:44 | 2020-07-19T17:23:44 | 280,915,315 | 0 | 0 | null | 2020-10-13T23:43:10 | 2020-07-19T17:24:28 | Java | UTF-8 | Java | false | false | 635 | java | import java.util.ArrayList;
public class Dealer {
private ArrayList<Card> cards;
private int primaryCardTotal;
private int secondaryCardTotal;
public Dealer() {
this.cards = new ArrayList<Card>();
this.primaryCardTotal = 0;
this.secondaryCardTotal = 0;
}
public ArrayList<Card> getCards() {
return cards;
}
public void addCard(Card card){
this.cards.add(card);
}
public int getCardTotal(){
int cardTotal = 0;
for (Card card : this.cards){
cardTotal += card.getPrimaryValue();
}
return cardTotal;
}
}
| [
"davideastcroft95@gmail.com"
] | davideastcroft95@gmail.com |
7bd098b010ae7cb6731b368f64493b5ad7095804 | 7e7d25721fc5e29ebbf81596247896201c6e669a | /l01/TurtleGraphics/src/main/java/Turtle.java | f10293f4fcc77cf97fc4a2645d5d89e8457b6483 | [] | no_license | benevolent0505/pro-enshu-scala | 64b72018f5f34dfcb9cba1d4c660b3ab8d6c1814 | 785fbe843733b27ecdf8fc35b3aea64d0f24f014 | refs/heads/master | 2021-01-10T14:08:19.280330 | 2015-10-14T23:17:39 | 2015-10-14T23:17:39 | 44,015,776 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,164 | java | //
// Turtle Graphics Library extension for teaching OO concepts
// by Hideki Tsuiki, Kyoto University
// as a modification of Tatsuya Hagino's Turtle Graphics Library
// Copyright (C) 2000, Hideki Tsuiki, Kyoto University
// Turtle Graphics Library for Information Processing I
// Copyright (C) 1998, Tatsuya Hagino, Keio University
//
// Permission to use, copy, modify, and distribute this software
// for educational purpose only is hereby granted, provided that
// the above copyright notice appear in all copies and that both
// the copyright notice and this permission notice appear in
// supporting documentation. This software is provided "as is"
// with no warranty.
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.lang.Math;
import java.util.Vector;
/** タートルのクラス。 */
public class Turtle implements Cloneable{
/** もし、false なら、個々のタートルの
* withTurtle の値に関わらず、全てのタートルに高速な描画を行う。
* 初期値は true。*/
public static boolean withTurtleAll = true;
public Color tcolor = Color.green;
public double tscale = 0.4;
// animation parameters
private static double rotateStep = 5.0 *Math.PI/180.0 ;
private static int moveStep = 5;
private static int[] speedStep = {100000, 20, 5, 2};
// turtle animation speed constants
public final static int speedNoTurtle = 0;
public final static int speedFast = 1;
public final static int speedNormal = 2;
public final static int speedSlow = 3;
// set the menu
public static void speedAll(int s) {
if (s <= 0 || s >= speedStep.length) return;
rotateStep = speedStep[s] *Math.PI/180.0;
moveStep = speedStep[s];
}
private TurtleFrame f; // on this TurtleFrame
private double angle; // turtle current angle
private double x, y; // turtle current position
private double dx, dy; // dx = sin(angle), dy = -cos(angle)
private boolean penDown; // pen status (up or down)
private Color c = Color.black; // pen color
private int turtleType = 0;
// turtle animation rubber line
private int rx, ry;
private boolean rubber = false;
private int moveWait = 20;
private int rotateWait = 20;
/** (x, y) という座標に angle の角度で、Turtle を作成。 */
public Turtle(int x,int y, int ia)
{
this.x = ((double)x + 0.5);
this.y = ((double)y + 0.5);
setangle((double)ia *Math.PI/180.0);
penDown = true;
}
/** (200,200) という座標に 0 度の角度で、Turtle を作成。 */
public Turtle()
{
this(200,200, 0);
}
// turtle
public static final int turtleFig[][] =
{ {-12,-6,-12,6,0,18,12,6,12,-6,0,-18,-12,-6},
{-18,-12,-12,-6},
{-6,-24,0,-18,6,-24},
{12,-6,18,-12},
{12,6,18,12},
{-6,24,0,18,6,24},
{-18,12,-12,6},
{-18,12,-18,-12,-6,-24,6,-24,18,-12,18,12,6,24,-6,24,-18,12},
{-15,-15,-18,-24,-9,-21},
{9,-21,18,-24,15,-15},
{15,15,18,24,9,21},
{-9,21,-18,24,-15,15},
{-3,24,0,30,3,24},
{-6,-24,-12,-36,-6,-48,6,-48,12,-36,6,-24}
};
public static final int turtleRFig[][] =
{ {-12,-6,-12,6,0,18,12,6,12,-6,0,-18,-12,-6},
{-18,-12,-12,-6},
{-6,-24,0,-18,6,-24},
{12,-6,18,-12},
{12,6,18,12},
{-6,24,0,18,6,24},
{-18,12,-12,6},
{-18,12,-18,-12,-6,-24,6,-24,18,-12,18,12,6,24,-6,24,-18,12},
{-15,-15,-24,-18,-9,-21},
{-9,21,-24,18,-15,15},
{-3,24,-3,30,3,24},
{-6,-24,-6,-36,0,-48,12,-48,18,-36,6,-24},
{9,-21,18,-30,15,-15},
{15,15,18,30,9,21}
};
public static final int turtleLFig[][] =
{ {-12,-6,-12,6,0,18,12,6,12,-6,0,-18,-12,-6},
{-18,-12,-12,-6},
{-6,-24,0,-18,6,-24},
{12,-6,18,-12},
{12,6,18,12},
{-6,24,0,18,6,24},
{-18,12,-12,6},
{-18,12,-18,-12,-6,-24,6,-24,18,-12,18,12,6,24,-6,24,-18,12},
{-15,-15,-18,-30,-9,-21},
{-9,21,-18,30,-15,15},
{-3,24,3,30,3,24},
{-6,-24,-18,-36,-12,-48,0,-48,6,-36,6,-24},
{9,-21,24,-18,15,-15},
{15,15,24,18,9,21}
};
protected int[][] turtleC = turtleFig;
protected int[][] turtleR = turtleRFig;
protected int[][] turtleL = turtleLFig;
// draw animation turtle
private void turtleDraw(Graphics g, int[][] data) {
int ix = (int)x, iy = (int)y;
g.setColor(tcolor);
for (int i = 0; i < data.length; i++) {
int px = 0, py = 0;
for (int j = 0; j < data[i].length; j += 2) {
int kx = data[i][j], ky = data[i][j+1];
int nx = (int)((kx*(-dy) + ky*(-dx)) * tscale);
int ny = (int)((kx*dx+ ky*(-dy)) * tscale);
if (j > 0) g.drawLine(ix + px, iy + py, ix + nx, iy + ny);
px = nx;
py = ny;
}
}
g.setColor(c);
g.fillOval(ix - 1, iy - 1, 2,2);
}
void setFrame(TurtleFrame f){
this.f = f;
}
void show(Graphics g){
if (rubber) {
g.setColor(c);
g.drawLine(rx, ry, (int)x, (int)y);
}
if (withTurtleAll) {
switch ((turtleType/2) % 4) {
case 0: case 2:
turtleDraw(g, turtleC);
break;
case 1:
turtleDraw(g, turtleR);
break;
case 3:
turtleDraw(g, turtleL);
break;
}
}
}
private void fcheck(){
if(f == null) {
System.out.println("Turtle に対して fd などを呼び出すまえに,TurtleFrame に add してください。");
System.exit(1);
}
}
// turtle animation update
private void turtleShow(int wait) {
turtleType++;
f.repaint();
if (withTurtleAll) {
try {
Thread.sleep(wait);
} catch (InterruptedException e) {
}
}
}
/** n だけ前に進む。 */
public void fd(int n) {
dfd(n);
}
public void dfd(double n) {
double xx = x;
double yy = y;
int back = 1;
if(n < 0){
back = -1; n = -n;
}
fcheck();
if (penDown) {
rx = (int)x;
ry = (int)y;
rubber = true;
}
for (int i = moveStep; i < n; i += moveStep) {
x = xx + back * dx * i;
y = yy + back * dy * i;
turtleShow(moveWait);
}
x = xx + back * dx * n;
y = yy + back * dy * n;
if (penDown) {
f.addLineElement((int)xx, (int)yy, (int)x, (int)y, c);
rubber = false;
}
turtleShow(moveWait);
}
/** n だけ後ろに進む。 */
public void bk(int n) {
fd(-n);
}
private void setangle(double a)
{
angle = a;
dx = Math.sin(a);
dy = -Math.cos(a);
}
// set turtle angle
private void turtleAngle(double a) {
dx = Math.sin(a);
dy = -Math.cos(a);
turtleShow(rotateWait);
}
/** n 度だけ右に回る。 */
public void rt(int ia) {
rtd((double)ia*Math.PI/180.0);
}
private void rtd(double a) {
fcheck();
for (double i = rotateStep; i < a; i += rotateStep)
turtleAngle(angle + i);
angle = (angle + a);
turtleAngle(angle);
}
/** n 度だけ左に回る。 */
public void lt(int ia) {
ltd((double)ia*Math.PI/180.0);
}
public void ltd(double a) {
fcheck();
for (double i = rotateStep; i < a; i += rotateStep)
turtleAngle(angle - i);
angle = (angle - a);
turtleAngle(angle);
}
/** ペンをあげる。 */
public void up() {
penDown = false;
}
/** ペンをおろす。ペンをおろした状態で進むと、その軌跡が画面に残る。*/
public void down() {
penDown = true;
}
/** ペンが上がっているかどうか */
public boolean isDown() {
return (penDown);
}
/** ペンの色を nc に変更する。 */
public void setColor(Color nc) {
c = nc;
}
/** 動きの早さを x に設定する。x = 20 がデフォルトである。数字が小さいほど早い。*/
public void speed(int x)
{
moveWait = x;
rotateWait = x;
}
/** 現在の座標の X 成分を返す。 */
public int getX()
{
return (int)this.x;
}
/** 現在の座標の Y 成分を返す。*/
public int getY()
{
return (int)this.y;
}
/** 現在の角度を返す。*/
public int getAngle()
{
return (int)(this.angle * 180.0 /Math.PI);
}
public int moveTo(double x, double y) {
double prevx = this.x; double prevy = this.y;
// double a = Math.atan2(-( y - prevy), x - prevx);
double a = Math.atan2(x - prevx, -( y - prevy));
setangle(a);
int r = (int)Math.sqrt((prevx - x) * (prevx - x) + (prevy - y) * (prevy - y));
fd(r);
this.x = ((double)x + 0.5);
this.y = ((double)y + 0.5);
turtleShow(moveWait);
return(r);
}
public int moveTo(double x, double y, double aa) {
int r = moveTo(x, y);
setangle(aa);
turtleShow(moveWait);
return(r);
}
/** moveTo(x, y) と同様だが,その後に,angle の方向を向く。
* 移動した距離を返す。
*/
public int moveTo(int x, int y, int angle){
return moveTo((double)x, (double)y, (double)angle*Math.PI/180.0);
}
/** (x, y) という座標まで移動する。ペンをおろした状態なら、線が描画される。
* 移動した距離を返す。
*/
public int moveTo(int x, int y){
return moveTo((double)x, (double)y);
}
/* t と同じ座標まで移動する。ペンをおろした状態なら、線が描画される。
* 移動した距離を返す。
*/
public int moveTo(Turtle t)
{
return moveTo(t.x, t.y);
}
/* 自分と同じ状態の Turtle を作成し,返す。
*/
public Turtle clone()
{
try{
return (Turtle)super.clone();
}catch(CloneNotSupportedException e){}
return null;
}
}
| [
"mikio.fjt@gmail.com"
] | mikio.fjt@gmail.com |
527ef4c3055cf5172ecaaea6b78d41cffa137f3e | dcb1819887a979cc8107235e1d7353219df6b9f4 | /MyWaifu/app/src/main/java/com/hikki/mywaifu/splash.java | d6c4c50a62c991076470134076eb2f87a1ecfdb0 | [
"MIT"
] | permissive | rickyricko302/waifu-search | a9134a8db0106bdbcd206505a2c5addc9f698004 | da53493223f376acbd3788b7770c56aed2582eec | refs/heads/main | 2023-03-30T05:04:01.210580 | 2021-04-03T13:43:48 | 2021-04-03T13:43:48 | 351,092,363 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,376 | java | package com.hikki.mywaifu;
import android.os.*;
import android.support.v7.app.*;
import java.io.*;
import java.net.*;
import org.json.*;
import android.widget.*;
import android.view.*;
import java.util.*;
import android.content.*;
public class splash extends AppCompatActivity
{
LinearLayout lr;
Button bt;
JSONArray ja;
ArrayList<String> link = new ArrayList<>();
ArrayList<String> name = new ArrayList<>();
ArrayList<String> anime = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState)
{
// TODO: Implement this method
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
lr = findViewById(R.id.lin);
bt = findViewById(R.id.buttons);
new loadSata().execute();
bt.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View p1)
{
// TODO: Implement this method
new loadSata().execute();
hide();
}
});
}
private void tampil(){
lr.animate().alpha(255);
}
private void hide(){
lr.animate().alpha(0);
lr.setVisibility(View.GONE);
}
public class loadSata extends AsyncTask<Void,Void,Boolean>
{
Exception error;
@Override
protected Boolean doInBackground(Void[] p1)
{
// TODO: Implement this method
try
{
URL u = new URL("https://waifu-generator.vercel.app/api/v1");
URLConnection uc = u.openConnection();
BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
String g;
StringBuilder sb = new StringBuilder();
while ((g = br.readLine())!=null){
sb.append(g);
}
ja = new JSONArray(sb.toString());
return true;
}
catch (Exception e){
error = e;
return false;
}
}
@Override
protected void onPostExecute(Boolean result)
{
// TODO: Implement this method
if (result){
try{
for (int i=0;i<ja.length();i++){
link.add(ja.getJSONObject(i).get("image").toString());
name.add(ja.getJSONObject(i).get("name").toString());
anime.add(ja.getJSONObject(i).get("anime").toString());
}
Intent in = new Intent(splash.this,MainActivity.class);
in.putExtra("link",link);
in.putExtra("name",name);
in.putExtra("anime",anime);
startActivity(in);
}catch(JSONException e){}
}
else{
lr.setVisibility(View.VISIBLE);
tampil();
}
super.onPostExecute(result);
}
}
}
| [
"rickyricko302@gmail.com"
] | rickyricko302@gmail.com |
6b766ef113a1c692c7d1a8cbae50e2f6dfdd4c32 | b2dfa320dfcbf8a351e402ccad54f6d13245e54d | /src/backtracking/Restore_IP_Address_93.java | 935f7e99d6f190a779bfa31e190ada6dfe69dc34 | [] | no_license | tichen47/Leetcode | a3748e9888051dcae5e7d5f9dc1cc803f8a5ad07 | 7efb6058aad291d317ae70b7b7e64af8d0e0917a | refs/heads/master | 2021-07-12T02:12:29.190662 | 2020-09-05T05:40:01 | 2020-09-05T05:40:01 | 177,894,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,369 | java | package backtracking;
import java.util.*;
public class Restore_IP_Address_93 {
/*
* Solution: DFS backtracking
* Time Complexity: O(3^4)
* Space Complexity: O(19) No more than 19 valid IP addresses
*/
public List<String> restoreIpAddresses(String s) {
List<String> ret = new ArrayList<>();
restoreIpAddresses(ret, "", 0, 1, s);
return ret;
}
public void restoreIpAddresses(List<String> ret, String path, int index, int part, String s){
if(part == 4){
String last = s.substring(index);
if(valid(last)) ret.add(path+last);
return;
}
for(int i = 0; i < 3; i++){
if(index + i + (4 - part) >= s.length()) break;
String ip = s.substring(index, index + i + 1);
if(valid(ip))
restoreIpAddresses(ret, path + ip + ".", index + i + 1, part + 1, s);
}
}
/*
* Check if the current segment is valid :
* 1. less or equal to 255
* 2. the first character could be '0'
* only if the segment is equal to '0'
*/
public boolean valid(String address){
if(address.length() == 1) return true;
if(address.length() > 3 || address.charAt(0) == '0') return false;
return Integer.valueOf(address) <= 255;
}
}
| [
"tichen47@gmail.com"
] | tichen47@gmail.com |
673e37dd678bcfed1363140d174cebcb76de2ec7 | f7fbbad849a2ee9570580185f2d3def91f61011d | /api/src/main/java/org/jfrog/artifactory/client/model/LocalReplication.java | 27c0a1364e54efec15a25b4db4d302c301fe67eb | [
"Apache-2.0"
] | permissive | yifeih/artifactory-client-java | 5c1c3aee506803155efefb081ba3b56662648136 | 5b0c94cc2387ea24646067c10618b59c8b81024d | refs/heads/master | 2021-07-13T04:08:37.157562 | 2017-08-20T11:03:28 | 2017-08-20T11:03:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package org.jfrog.artifactory.client.model;
public interface LocalReplication extends Replication {
String getUrl();
long getSocketTimeoutMillis();
String getUsername();
String getPassword();
boolean isEnableEventReplication();
boolean isSyncStatistics();
String getPathPrefix();
}
| [
"francois.ritaly@workday.com"
] | francois.ritaly@workday.com |
12ddeab8436a52e617a9329e0d5879257bd304b1 | 5dfcab9380950e7428db9307e17bcef7ece56f5a | /src/main/java/com/education/repository/DiaryStudentRepository.java | 23768dafd4a090a3ffa1dfded66ca7d38bb3f491 | [
"Apache-2.0"
] | permissive | CleristonLincoln/Education-api | fcb8237870c022ad0cf05e18a00af6ec0a0c440e | e51569d89534122ca52ebbb60624e24310914dcb | refs/heads/master | 2020-05-17T16:48:42.538917 | 2019-05-04T19:45:54 | 2019-05-04T19:45:54 | 183,829,625 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package com.education.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.education.model.diary.DiaryStudent;
import com.education.repository.query.DiaryStudentRepositoryQuery;
public interface DiaryStudentRepository extends JpaRepository<DiaryStudent, Long>, DiaryStudentRepositoryQuery {
}
| [
"cleristonlincoln@hotmail.com"
] | cleristonlincoln@hotmail.com |
c7ffb8c4126b4159df62fc5752a34803326d3170 | 4c72185a32bc087669e7fd9089d9fc873f4501c0 | /src/snorri/semantics/SecondSuffixPronoun.java | 17ac50b4b40bb7fb1e1a434cb8c87c9f7cbba3de | [] | no_license | adammoftah/SpokenWord | f747f215c39cf8e93a5bda6cdfbbced3ebb01cc2 | 636fbe6389b5c9fde067afccccd030bc87ec49c1 | refs/heads/master | 2020-04-08T01:40:03.893941 | 2016-07-04T02:52:57 | 2016-07-04T02:52:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package snorri.semantics;
import snorri.events.SpellEvent;
import snorri.nonterminals.SuffixPronoun;
public class SecondSuffixPronoun extends Definition {
public SecondSuffixPronoun() {
super(SuffixPronoun.class);
}
@Override
public Object getMeaning(SpellEvent e) {
return e.getSecondPerson();
}
}
| [
"vikingarnir.will@gmail.com"
] | vikingarnir.will@gmail.com |
7e0fedc0b131e1d90371ee2c4224ecf123b56d19 | 08f3b549dc023103b7b93117c63b8db3f0ee0c72 | /kikr_app_services/src/main/java/com/flatlaylib/bean/Uuid.java | 377297c68603cac9c625f683e3d597c59e4a19f5 | [] | no_license | FLATLAY/Kikr-Android-Studio | 50871fdb18fd1f09559932a986afe572e2349b32 | a8c8dde37f37ca737321599d61faa60a2fca22e8 | refs/heads/master | 2021-03-19T17:20:30.830949 | 2018-06-01T06:24:22 | 2018-06-01T06:24:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package com.flatlaylib.bean;
public class Uuid {
String uuid;
String inrange;
public String getInrange() {
return inrange;
}
public void setInrange(String inrange) {
this.inrange = inrange;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
| [
"nokhodian@gmail.com"
] | nokhodian@gmail.com |
a6625d20f0e9282a6bb9c602164840de1e194829 | 2c82000bf80fc53a2c44d4766b230d23d1e280f3 | /src/main/java/dao/SubjectDaoImpl.java | 8ee590b93398025115315e13e946a53e372a7f52 | [] | no_license | AngelinaDrozd/Web01 | 37219e44e539d5136fc2926eede9dd11a97f91c1 | 0d33d7b0be7f4869a14401f3bd3d7904267cfdc6 | refs/heads/master | 2023-02-08T05:50:39.998002 | 2020-12-23T19:47:34 | 2020-12-23T19:47:34 | 307,332,762 | 0 | 0 | null | 2020-12-23T20:02:21 | 2020-10-26T10:15:38 | JavaScript | UTF-8 | Java | false | false | 4,074 | java | package dao;
import db.ConnectionFactory;
import model.Subject;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class SubjectDaoImpl implements SubjectDao{
@Override
public List<Subject> listSubjects() {
List<Subject> list = new ArrayList<>();
ResultSet resultSet;
try (Connection connection = ConnectionFactory.getConnection()) {
resultSet = connection.createStatement().executeQuery("select a.id, a.title, l.name, l.surname, l.fathername, a.lecturer_id, a.credits from subjects a inner join lecturers l on l.id = a.lecturer_id order by id");
while (resultSet.next()) {
Subject subject = new Subject();
subject.setId(resultSet.getInt("id"));
subject.setCredits(resultSet.getInt("credits"));
subject.setTitle(resultSet.getString("title"));
subject.setLecturerId(resultSet.getInt("lecturer_id"));
String lecturer =
resultSet.getString("name") + " " +
resultSet.getString("fathername") + " " +
resultSet.getString("surname");
subject.setLecturer(lecturer);
list.add(subject);
}
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return list;
}
@Override
public void saveSubject(Subject subject) {
//TODO add editing existing entry
try (Connection connection = ConnectionFactory.getConnection()) {
PreparedStatement pst;
pst = connection.prepareStatement("insert into subjects(title, lecturer_id, credits) values (?,?,?)");
pst.setString(1, subject.getTitle());
pst.setInt(2, subject.getLecturerId());
pst.setInt(3, subject.getCredits());
pst.executeUpdate();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
}
@Override
public void updateSubject(Subject subject) {
try (Connection connection = ConnectionFactory.getConnection()) {
PreparedStatement pst;
pst = connection.prepareStatement("update subjects set title = ?, lecturer_id = ?, credits = ? where id = ?");
pst.setString(1, subject.getTitle());
pst.setInt(2, subject.getLecturerId());
pst.setInt(3, subject.getCredits());
pst.setInt(4, subject.getId());
pst.executeUpdate();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
}
@Override
public Subject getSubjectById(int id) {
ResultSet resultSet;
try (Connection connection = ConnectionFactory.getConnection()) {
PreparedStatement pst =
connection.prepareStatement("select a.id, a.title, l.name, l.surname, l.fathername, a.lecturer_id, a.credits " +
"from subjects a inner join lecturers l on l.id = a.lecturer_id where a.id=?");
pst.setInt(1, id);
resultSet = pst.executeQuery();
while (resultSet.next()) {
Subject subject = new Subject();
subject.setId(resultSet.getInt("id"));
subject.setCredits(resultSet.getInt("credits"));
subject.setTitle(resultSet.getString("title"));
subject.setLecturerId(resultSet.getInt("lecturer_id"));
String lecturer =
resultSet.getString("name") + " " +
resultSet.getString("fathername") + " " +
resultSet.getString("surname");
subject.setLecturer(lecturer);
return subject;
}
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return new Subject();
}
}
| [
"19fi.a.drozd@std.npu.edu.ua"
] | 19fi.a.drozd@std.npu.edu.ua |
ad2007a0080734b02cc7de6219d540d4e9f23f6c | a259df255e7203787fa74704ed454f1bd5a4a76f | /src/main/java/com/jinchuangan/Filter.java | 1e6a077bf785eabfd9340834fd70b340a9a207b1 | [] | no_license | zhzhd/stock | c301022230a5684dfa9f3a29c8f907ee769db93a | 6b635aecfdb319a13b683dd269b2047385861b28 | refs/heads/master | 2021-01-15T12:59:33.304765 | 2017-08-08T08:30:00 | 2017-08-08T08:30:00 | 99,665,098 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,389 | java | /*
*
*
*/
package com.jinchuangan;
import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
/**
* 筛选
*
*
* @version 1.0
*/
public class Filter implements Serializable {
private static final long serialVersionUID = -8712382358441065075L;
/**
* 运算符
*/
public enum Operator {
/** 等于 */
eq,
/** 不等于 */
ne,
/** 大于 */
gt,
/** 小于 */
lt,
/** 大于等于 */
ge,
/** 小于等于 */
le,
/** 相似 */
like,
/** 包含 */
in,
/** 为Null */
isNull,
/** 不为Null */
isNotNull;
/**
* 从String中获取Operator
*
* @param value
* 值
* @return String对应的operator
*/
public static Operator fromString(String value) {
return Operator.valueOf(value.toLowerCase());
}
}
/** 默认是否忽略大小写 */
private static final boolean DEFAULT_IGNORE_CASE = false;
/** 属性 */
private String property;
/** 运算符 */
private Operator operator;
/** 值 */
private Object value;
/** 是否忽略大小写 */
private Boolean ignoreCase = DEFAULT_IGNORE_CASE;
/**
* 初始化一个新创建的Filter对象
*/
public Filter() {
}
/**
* 初始化一个新创建的Filter对象
*
* @param property
* 属性
* @param operator
* 运算符
* @param value
* 值
*/
public Filter(String property, Operator operator, Object value) {
this.property = property;
this.operator = operator;
this.value = value;
}
/**
* 初始化一个新创建的Filter对象
*
* @param property
* 属性
* @param operator
* 运算符
* @param value
* 值
* @param ignoreCase
* 忽略大小写
*/
public Filter(String property, Operator operator, Object value, boolean ignoreCase) {
this.property = property;
this.operator = operator;
this.value = value;
this.ignoreCase = ignoreCase;
}
/**
* 返回等于筛选
*
* @param property
* 属性
* @param value
* 值
* @return 等于筛选
*/
public static Filter eq(String property, Object value) {
return new Filter(property, Operator.eq, value);
}
/**
* 返回等于筛选
*
* @param property
* 属性
* @param value
* 值
* @param ignoreCase
* 忽略大小写
* @return 等于筛选
*/
public static Filter eq(String property, Object value, boolean ignoreCase) {
return new Filter(property, Operator.eq, value, ignoreCase);
}
/**
* 返回不等于筛选
*
* @param property
* 属性
* @param value
* 值
* @return 不等于筛选
*/
public static Filter ne(String property, Object value) {
return new Filter(property, Operator.ne, value);
}
/**
* 返回不等于筛选
*
* @param property
* 属性
* @param value
* 值
* @param ignoreCase
* 忽略大小写
* @return 不等于筛选
*/
public static Filter ne(String property, Object value, boolean ignoreCase) {
return new Filter(property, Operator.ne, value, ignoreCase);
}
/**
* 返回大于筛选
*
* @param property
* 属性
* @param value
* 值
* @return 大于筛选
*/
public static Filter gt(String property, Object value) {
return new Filter(property, Operator.gt, value);
}
/**
* 返回小于筛选
*
* @param property
* 属性
* @param value
* 值
* @return 小于筛选
*/
public static Filter lt(String property, Object value) {
return new Filter(property, Operator.lt, value);
}
/**
* 返回大于等于筛选
*
* @param property
* 属性
* @param value
* 值
* @return 大于等于筛选
*/
public static Filter ge(String property, Object value) {
return new Filter(property, Operator.ge, value);
}
/**
* 返回小于等于筛选
*
* @param property
* 属性
* @param value
* 值
* @return 小于等于筛选
*/
public static Filter le(String property, Object value) {
return new Filter(property, Operator.le, value);
}
/**
* 返回相似筛选
*
* @param property
* 属性
* @param value
* 值
* @return 相似筛选
*/
public static Filter like(String property, Object value) {
return new Filter(property, Operator.like, value);
}
/**
* 返回包含筛选
*
* @param property
* 属性
* @param value
* 值
* @return 包含筛选
*/
public static Filter in(String property, Object value) {
return new Filter(property, Operator.in, value);
}
/**
* 返回为Null筛选
*
* @param property
* 属性
* @return 为Null筛选
*/
public static Filter isNull(String property) {
return new Filter(property, Operator.isNull, null);
}
/**
* 返回不为Null筛选
*
* @param property
* 属性
* @return 不为Null筛选
*/
public static Filter isNotNull(String property) {
return new Filter(property, Operator.isNotNull, null);
}
/**
* 返回忽略大小写筛选
*
* @return 忽略大小写筛选
*/
public Filter ignoreCase() {
this.ignoreCase = true;
return this;
}
/**
* 获取属性
*
* @return 属性
*/
public String getProperty() {
return property;
}
/**
* 设置属性
*
* @param property
* 属性
*/
public void setProperty(String property) {
this.property = property;
}
/**
* 获取运算符
*
* @return 运算符
*/
public Operator getOperator() {
return operator;
}
/**
* 设置运算符
*
* @param operator
* 运算符
*/
public void setOperator(Operator operator) {
this.operator = operator;
}
/**
* 获取值
*
* @return 值
*/
public Object getValue() {
return value;
}
/**
* 设置值
*
* @param value
* 值
*/
public void setValue(Object value) {
this.value = value;
}
/**
* 获取是否忽略大小写
*
* @return 是否忽略大小写
*/
public Boolean getIgnoreCase() {
return ignoreCase;
}
/**
* 设置是否忽略大小写
*
* @param ignoreCase
* 是否忽略大小写
*/
public void setIgnoreCase(Boolean ignoreCase) {
this.ignoreCase = ignoreCase;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
if (this == obj) {
return true;
}
Filter other = (Filter) obj;
return new EqualsBuilder().append(getProperty(), other.getProperty()).append(getOperator(), other.getOperator()).append(getValue(), other.getValue()).isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(getProperty()).append(getOperator()).append(getValue()).toHashCode();
}
} | [
"562599006@qq.com"
] | 562599006@qq.com |
51551def3dbf1fca7b524827238f355c33b414b1 | 1ca3d9a8050a563daa6ff07f568ff39c96415d01 | /GeoSpot/src/com/example/geospot/PlacesService.java | a09f4dc4c026ac4549e52cfd3bffc80784d9ed70 | [] | no_license | AteneoHacks2015/GeoSpot | e159b369f6f04362ae1f1c33e5c2142994807bbd | eca350ec4a717c7e7cdfc0de9cfc109bc1cf82d9 | refs/heads/master | 2016-09-05T14:26:28.486208 | 2015-01-11T03:55:08 | 2015-01-11T03:55:08 | 29,080,325 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,806 | java | package com.example.geospot;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.util.Log;
public class PlacesService {
private String API_KEY;
private String radius1 = "1";
public PlacesService(String apikey, String rad) {
this.API_KEY = apikey;
radius1 = rad;
}
public void setApiKey(String apikey) {
this.API_KEY = apikey;
}
public ArrayList<Place> findPlaces(double latitude, double longitude,
String placeSpacification) {
String urlString = makeUrl(latitude, longitude, placeSpacification);
try {
String json = getJSON(urlString);
System.out.println(json);
JSONObject object = new JSONObject(json);
JSONArray array = object.getJSONArray("results");
ArrayList<Place> arrayList = new ArrayList<Place>();
for (int i = 0; i < array.length(); i++) {
try {
Place place = Place
.jsonToPontoReferencia((JSONObject) array.get(i));
Log.v("Places Services ", "" + place);
arrayList.add(place);
} catch (Exception e) {
}
}
return arrayList;
} catch (JSONException ex) {
Logger.getLogger(PlacesService.class.getName()).log(Level.SEVERE,
null, ex);
}
return null;
}
// https://maps.googleapis.com/maps/api/place/search/json?location=28.632808,77.218276&radius=500&types=atm&sensor=false&key=https://maps.googleapis.com/maps/api/place/search/json?location=28.632808,77.218276&radius=500&types=atm&sensor=false&key=AIzaSyBN5XKu0NnTAG0Vq6Hg_YkfsXCq2ccl9Yc
private String makeUrl(double latitude, double longitude, String place) {
StringBuilder urlString = new StringBuilder(
"https://maps.googleapis.com/maps/api/place/nearbysearch/json?");
if (place.equals("")) {
urlString.append("&location=");
urlString.append(Double.toString(latitude));
urlString.append(",");
urlString.append(Double.toString(longitude));
urlString.append("&radius="+radius1+"000");
// urlString.append("&types="+place);
urlString.append("&sensor=false&key=" + API_KEY);
} else {
urlString.append("&location=");
urlString.append(Double.toString(latitude));
urlString.append(",");
urlString.append(Double.toString(longitude));
urlString.append("&radius="+radius1+"000");
urlString.append("&types=airport"+"|"+
"amusement_park"+"|"+
"art_gallery"+"|"+
"cemetery"+"|"+
"church"+"|"+
"city_hall"+"|"+
"courthouse"+"|"+
"embassy"+"|"+
"hindu_temple"+"|"+
"hospital"+"|"+
"library"+"|"+
"local_government_office"+"|"+
"mosque"+"|"+
"museum"+"|"+
"post_office"+"|"+
"school"+"|"+
"shopping_mall"+"|"+
"stadium"+"|"+
"university"+"|"+
"zoo");
urlString.append("&sensor=false&key=" + API_KEY);
}
return urlString.toString();
}
protected String getJSON(String url) {
return getUrlContents(url);
}
private String getUrlContents(String theUrl) {
StringBuilder content = new StringBuilder();
try {
URL url = new URL(theUrl);
URLConnection urlConnection = url.openConnection();
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(urlConnection.getInputStream()), 8);
String line;
while ((line = bufferedReader.readLine()) != null) {
content.append(line + "\n");
}
bufferedReader.close();
}catch (Exception e) {
e.printStackTrace();
}
return content.toString();
}
} | [
"markangelpenaranda@gmail.com"
] | markangelpenaranda@gmail.com |
e787d4dc99a7644c74f98592687cf5c43fd700fe | b14e11b1624ea7569b5b448235b7caa3ed44ccf7 | /mybatis/src/main/java/com/cn/config/druid/DruidStatViewServlet.java | a396e71290319c42f53b3e557bf218408f9bf6cc | [] | no_license | 13661230034/spring-boot | 122a66991fe32eb4661bc18d1b7464a31f2faa7f | 0ae02e80668f00681bda189091c17e67ac9455a5 | refs/heads/master | 2020-03-19T02:55:24.703590 | 2018-06-29T07:16:02 | 2018-06-29T07:16:02 | 135,675,097 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,022 | java | package com.cn.config.druid;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import com.alibaba.druid.support.http.StatViewServlet;
/**
*
* @ClassName DruidStatViewServlet
* @Description TODO(配置)
* @author 姚通
* @Date 2018年1月5日 下午3:43:18
* @version 1.0.0
*/
@SuppressWarnings("serial")
@WebServlet(urlPatterns = "/druid/*", initParams = { @WebInitParam(name = "allow", value = "127.0.0.1,0.0.0.0"), // IP白名单
// (没有配置或者为空,则允许所有访问)
@WebInitParam(name = "deny", value = "192.168.16.111"), // IP黑名单
// (存在共同时,deny优先于allow)
@WebInitParam(name = "loginUsername", value = "admin"), // 用户名
@WebInitParam(name = "loginPassword", value = "admin"), // 密码
@WebInitParam(name = "resetEnable", value = "false")// 禁用HTML页面上的“Reset
// All”功能
})
public class DruidStatViewServlet extends StatViewServlet {
}
| [
"13661230034@163.com"
] | 13661230034@163.com |
e95fd94a81a2c748bac33122d7d8fcdc54c2c915 | 459c2c592f9ad1c20529dd446e8580a6cfa50ced | /app/src/main/java/baas202/baspondman_pset4/DeleteAllTask.java | bd6abdbdd78bb047037f438d03b424ee353ba040 | [] | no_license | Baas202/BasPondman-pset4 | 8fad3f827628acdcd629ddb39102e38b65e7951b | 263e3ded0c3db87cb2151bbf521dcf506ac3a6ef | refs/heads/master | 2020-06-22T04:43:09.318327 | 2016-11-25T22:59:53 | 2016-11-25T22:59:53 | 74,756,503 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,430 | java | package baas202.baspondman_pset4;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class DeleteAllTask extends Activity implements View.OnClickListener {
private DBManager dbManager;
private Button deleteall_button, cancel_button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle("Are you sure?");
setContentView(R.layout.deteledb_activity);
dbManager = new DBManager(this);
dbManager.open();
deleteall_button = (Button) findViewById(R.id.delete_all_button);
cancel_button = (Button) findViewById(R.id.cancel_button);
deleteall_button.setOnClickListener(this);
cancel_button.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.delete_all_button:
dbManager.deleteAll();
return_main_screen();
break;
case R.id.cancel_button:
return_main_screen();
break;
}
}
public void return_main_screen() {
Intent return_main = new Intent(getApplicationContext(), ShowTaskList.class)
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(return_main);
}
}
| [
"b.pondman@gmail.com"
] | b.pondman@gmail.com |
77a37748a08ee99fbcdffc4dac60b4535586e06b | f688710ed0a3b843f948778f0ba9575aa5cf792b | /Mobile_App/GBTS/app/src/main/java/com/example/gbts/navigationdraweractivity/asyntask/FireBaseIDTask.java | 8414c15ad3476d52cafef43b95f46fc7ab4f7839 | [] | no_license | dnhoang/GBTS | c3ba4df92e441c7cc9f7824364a7927d6e3f92ab | fda790d7fa588fd947b99afd383cc7a460d503ec | refs/heads/master | 2021-01-17T18:27:15.055731 | 2016-12-14T11:49:52 | 2016-12-14T11:49:52 | 68,697,864 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,724 | java | package com.example.gbts.navigationdraweractivity.asyntask;
/**
* Created by HoangDN on 10/3/2016.
*/
import android.os.AsyncTask;
import android.util.Log;
import com.example.gbts.navigationdraweractivity.constance.Constance;
import com.example.gbts.navigationdraweractivity.utils.JSONParser;
import org.json.JSONObject;
public class FireBaseIDTask extends AsyncTask<String, Void, JSONObject> {
//JSON Node Names
private static final String TAG_SUCCESS = "success";
private static final String TAG_MASSAGE = "message";
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected JSONObject doInBackground(String... params) {
JSONParser jParser = new JSONParser();
String strURL = Constance.API_NOTIFICATION + "&phone=" + params[0] + "&token=" + params[1];
// Getting JSON from URL
JSONObject json = jParser.getJSONFromUrlPOST(strURL);
return json;
}
@Override
protected void onPostExecute(JSONObject jsonObject) {
super.onPostExecute(jsonObject);
boolean success = false;
String message = null;
//check success
if (jsonObject != null) {
try {
success = jsonObject.optBoolean(TAG_SUCCESS);
message = jsonObject.optString(TAG_MASSAGE);
if (success) {
Log.i("FireBaseIDTask", message);
} else {
Log.i("FireBaseIDTask", message);
}
} catch (Exception e) {
e.printStackTrace();
}
} else {
//
Log.i("FireBaseIDTask", "jsonObject null");
}
}
} | [
"truongtq2506@gmail.com"
] | truongtq2506@gmail.com |
dd2f5aac748d59fc47ef192d4a5361bb74ff1219 | b9852e928c537ce2e93aa7e378689e5214696ca5 | /hse-entity-service/src/main/java/com/hd/hse/entity/other/ReviewRecord.java | ed24c78a71fd4433a0ce095868f817b5262f1da7 | [] | no_license | zhanshen1373/Hseuse | bc701c6de7fd88753caced249032f22d2ca39f32 | 110f9d1a8db37d5b0ea348069facab8699e251f1 | refs/heads/master | 2023-04-04T08:27:10.675691 | 2021-03-29T07:44:02 | 2021-03-29T07:44:02 | 352,548,680 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 12,786 | java | /**
* File: UdCbsglJcjl.java
* Author: hd
* Company:
* Created: 2014-09-26 17:26:39
* Purpose: 定义数据类 UdCbsglJcjl
* NOTE: 该文件为自动生成,请勿手工改动!
*/
package com.hd.hse.entity.other;
import com.hd.hse.common.entity.SuperEntity;
import com.hd.hse.common.field.DBField;
import com.hd.hse.common.table.DBTable;
/** @pdOid 97b3e4c6-8b10-4724-b884-55523cf64152 */
@DBTable(tableName = "ud_cbsgl_jcjl")
public class ReviewRecord extends com.hd.hse.common.entity.SuperEntity {
/** @pdOid 8c904a10-86c7-4a9b-8222-20e220fcdceb */
private static final long serialVersionUID = -5427593390652516570L;
/** ID
*
* @pdOid 49f1cbce-39c1-436a-93d1-a28175b0a3e2 */
@DBField(id=true)
private Integer ud_cbsgl_jcjlid;
/** 作业许可证编号
*
* @pdOid 24326c65-92c8-4602-8854-ddf06e592a83 */
@DBField
private String zycardnum;
/** 级别
*
* @pdOid 2f8e61f7-5414-4b5d-b878-64cfc5958c5a */
@DBField
private String jllevel;
/** 检查单位
*
* @pdOid 1f5e42d0-004c-4d0c-b7cd-1059a7695c20 */
@DBField
private String jcdept;
/** 检查单位
*
* @pdOid 39a50ad4-78fa-4023-afae-8345cc4e159e */
@DBField
private String jcdept_desc;
/** 问题责任人
*
* @pdOid ba0c9a61-576b-4229-b143-5c97dd53e023 */
@DBField
private String zrperson;
/** 检查人
*
* @pdOid ea98f6b3-1185-4340-8736-d2cc1d600774 */
@DBField
private String zrperson_desc;
/** 被检单位
*
* @pdOid 61c2656c-2d6c-4e4d-9127-f17b0ac80345 */
@DBField
private String bjcdept;
/** 被检查单位
*
* @pdOid 5d0c04a2-e82d-4430-9fab-f4026c61471a */
@DBField
private String bjcdept_desc;
/** 检查事实描述
*
* @pdOid a85907f4-834c-4a3a-a897-4b16fba9311a */
@DBField
private String jcresult;
/** 检查/违约时间
*
* @pdOid a0deb5af-3edc-4dcb-9582-3f631438bc78 */
@DBField
private String wydate;
/** 违约地点
*
* @pdOid 0a348b5b-2726-458a-a18c-3bfc63160d7b */
@DBField
private String wyaddress;
/** 是否有问题
*
* @pdOid a3b0ded8-7f58-47ea-8455-474fe9e89e23 */
@DBField
private String isproblem;
/** 检查人
*
* @pdOid 57a84d5c-f644-4360-9ffe-9753bd662478 */
@DBField
private String jzperson;
/** 检查人
*
* @pdOid 242864bc-2349-4d79-9759-7291db4b4615 */
@DBField
private String jzperson_description;
/** 是否整改
*
* @pdOid b277695c-3944-453f-8110-0edb9f4186e4 */
@DBField
private Integer iszg;
/** 整改状态
*
* @pdOid 52b0d92a-c017-4b9e-bafb-b0fae574be1a */
@DBField
private String zgstatus;
/** 复查人
*
* @pdOid 6601d3ca-1544-42a5-8f7c-7cdfbe1435eb */
@DBField
private String fcperson;
/** 复查人
*
* @pdOid a68d7184-4016-46f0-a8c5-f75e7a3bc880 */
@DBField
private String fcperson_desc;
/** 复查时间
*
* @pdOid a7b8bb23-1b7d-4df9-92ba-c6bd23736aa0 */
@DBField
private String fctime;
/** 作业申请ID
*
* @pdOid d697d18c-6be1-44a0-8a43-9f72c1a193a6 */
@DBField
private Integer ud_zyxk_zysqid;
/** 上传
*
* @pdOid 33f73659-b2b7-4ba2-b2d5-551eb7f115df */
@DBField
private Integer isupload;
/** 整改人
*
* @pdOid e22736c7-1630-4bc4-bb58-25b213854e1e */
@DBField
private String zgperson;
/** 整改人
*
* @pdOid 72cf2c8b-634c-4094-ae6e-ff3d59462fcd */
@DBField
private String zgperson_desc;
/** 整改时间
*
* @pdOid 36746509-45de-4848-90c1-574c619cb9de */
@DBField
private String zgtime;
/** pda上传记录id
*
* @pdOid 76fd4c8b-1f8a-4267-8a6d-88401de810f3 */
@DBField
private String pdajcjlid;
/** @return the ud_cbsgl_jcjlid
*
* @pdOid 1124c706-d73f-4136-b71c-c9329745923b */
public Integer getUd_cbsgl_jcjlid() {
return ud_cbsgl_jcjlid;
}
/** @param ud_cbsgl_jcjlid the ud_cbsgl_jcjlid to set
* @pdOid 52cafd9e-fb78-4937-a04c-3ec3a6618c98 */
public void setUd_cbsgl_jcjlid(Integer ud_cbsgl_jcjlid) {
this.ud_cbsgl_jcjlid = ud_cbsgl_jcjlid;
}
/** @return the zycardnum
*
* @pdOid fdd9505b-b220-416b-b69a-2dbe76d8f949 */
public String getZycardnum() {
return zycardnum;
}
/** @param zycardnum the zycardnum to set
* @pdOid b8e46e3d-6082-4c42-beb3-8067be104e71 */
public void setZycardnum(String zycardnum) {
this.zycardnum = zycardnum;
}
/** @return the jllevel
*
* @pdOid 842c9755-9df8-410c-a1de-6f732b440209 */
public String getJllevel() {
return jllevel;
}
/** @param jllevel the jllevel to set
* @pdOid f086e79e-2b06-464c-b234-5f429471a5bd */
public void setJllevel(String jllevel) {
this.jllevel = jllevel;
}
/** @return the jcdept
*
* @pdOid 9544dbea-3b40-40aa-8297-09cbd6ed7b7f */
public String getJcdept() {
return jcdept;
}
/** @param jcdept the jcdept to set
* @pdOid 567c6146-54de-4360-877d-7d4184bf3e7d */
public void setJcdept(String jcdept) {
this.jcdept = jcdept;
}
/** @return the jcdept_desc
*
* @pdOid c439fad3-c5da-4a1b-95a4-69309d29410a */
public String getJcdept_desc() {
return jcdept_desc;
}
/** @param jcdept_desc the jcdept_desc to set
* @pdOid a0755f48-868d-4b90-a3e0-ed1d1cea7584 */
public void setJcdept_desc(String jcdept_desc) {
this.jcdept_desc = jcdept_desc;
}
/** @return the zrperson
*
* @pdOid c49a607f-0199-46ea-8ede-d4e6e11a6d49 */
public String getZrperson() {
return zrperson;
}
/** @param zrperson the zrperson to set
* @pdOid 34223f8c-a23b-4d17-9d0c-63eaa8814826 */
public void setZrperson(String zrperson) {
this.zrperson = zrperson;
}
/** @return the zrperson_desc
*
* @pdOid 6f2501df-caf5-42ae-b570-4df4a21ca912 */
public String getZrperson_desc() {
return zrperson_desc;
}
/** @param zrperson_desc the zrperson_desc to set
* @pdOid 42ea9ea6-4aa1-4a40-8c1b-b16517a520af */
public void setZrperson_desc(String zrperson_desc) {
this.zrperson_desc = zrperson_desc;
}
/** @return the bjcdept
*
* @pdOid 00c1ffd2-4fae-4a11-ac14-c505a41b603d */
public String getBjcdept() {
return bjcdept;
}
/** @param bjcdept the bjcdept to set
* @pdOid 2b1b56e1-b6f0-45e9-a2c7-04a906c058cb */
public void setBjcdept(String bjcdept) {
this.bjcdept = bjcdept;
}
/** @return the bjcdept_desc
*
* @pdOid 6dc19edd-f0f7-476b-9749-638f2afbfd68 */
public String getBjcdept_desc() {
return bjcdept_desc;
}
/** @param bjcdept_desc the bjcdept_desc to set
* @pdOid 73a4abd9-5cef-4650-9473-3e47504725cf */
public void setBjcdept_desc(String bjcdept_desc) {
this.bjcdept_desc = bjcdept_desc;
}
/** @return the jcresult
*
* @pdOid 9efe0616-40cf-4dde-ad23-b6f3f0fd6f94 */
public String getJcresult() {
return jcresult;
}
/** @param jcresult the jcresult to set
* @pdOid 7ee2eb80-a474-485a-9d9f-d1144f144794 */
public void setJcresult(String jcresult) {
this.jcresult = jcresult;
}
/** @return the wydate
*
* @pdOid ff60f2d7-5dd5-4f6c-aaf4-6ea9c07cda6d */
public String getWydate() {
return wydate;
}
/** @param wydate the wydate to set
* @pdOid 6578dd14-5cb0-4970-abd4-79ab993d105f */
public void setWydate(String wydate) {
this.wydate = wydate;
}
/** @return the wyaddress
*
* @pdOid 6f9e1b0b-bace-437e-beba-a2ce5458f057 */
public String getWyaddress() {
return wyaddress;
}
/** @param wyaddress the wyaddress to set
* @pdOid 65f3fdf0-abfb-42a2-a9b1-947fa834f460 */
public void setWyaddress(String wyaddress) {
this.wyaddress = wyaddress;
}
/** @return the isproblem
*
* @pdOid 51b76b9f-4bf6-4c4c-9467-19d176676146 */
public String getIsproblem() {
return isproblem;
}
/** @param isproblem the isproblem to set
* @pdOid 26cf3b6d-86bf-4636-b073-2a3ad2eb3d69 */
public void setIsproblem(String isproblem) {
this.isproblem = isproblem;
}
/** @return the jzperson
*
* @pdOid f40c11af-2d9a-4226-a0e3-402a7664ed69 */
public String getJzperson() {
return jzperson;
}
/** @param jzperson the jzperson to set
* @pdOid dddd832d-f5ea-439a-8964-c8641a8563f3 */
public void setJzperson(String jzperson) {
this.jzperson = jzperson;
}
/** @return the jzperson_description
*
* @pdOid a21ec92c-6f09-4d7e-9e57-de05952cd776 */
public String getJzperson_description() {
return jzperson_description;
}
/** @param jzperson_description the jzperson_description to set
* @pdOid 928fbed9-7066-4fa2-8e4a-45d13d9b9cfa */
public void setJzperson_description(String jzperson_description) {
this.jzperson_description = jzperson_description;
}
/** @return the iszg
*
* @pdOid 8fb40141-dd5d-45e1-8f63-9523505e9460 */
public Integer getIszg() {
return iszg;
}
/** @param iszg the iszg to set
* @pdOid c950c799-93d6-4703-829a-c76e6b5aa99a */
public void setIszg(Integer iszg) {
this.iszg = iszg;
}
/** @return the zgstatus
*
* @pdOid d1e8f054-976c-43bb-bd67-2c42b2c54389 */
public String getZgstatus() {
return zgstatus;
}
/** @param zgstatus the zgstatus to set
* @pdOid 0a28b1aa-0ca1-4b06-aa98-d10bbf2c5464 */
public void setZgstatus(String zgstatus) {
this.zgstatus = zgstatus;
}
/** @return the fcperson
*
* @pdOid 912f587f-6ee6-4ecd-a8b8-6c54232c434b */
public String getFcperson() {
return fcperson;
}
/** @param fcperson the fcperson to set
* @pdOid 7ccaae78-df10-4e53-b9ce-5a2b1d5404d9 */
public void setFcperson(String fcperson) {
this.fcperson = fcperson;
}
/** @return the fcperson_desc
*
* @pdOid 4fcef2e2-9958-4a15-beff-401e6de5e661 */
public String getFcperson_desc() {
return fcperson_desc;
}
/** @param fcperson_desc the fcperson_desc to set
* @pdOid f0a87cae-0aec-43b9-82cc-df8d7bdcd1e6 */
public void setFcperson_desc(String fcperson_desc) {
this.fcperson_desc = fcperson_desc;
}
/** @return the fctime
*
* @pdOid 0aee6bac-fba3-4912-98b9-ad5d131b7483 */
public String getFctime() {
return fctime;
}
/** @param fctime the fctime to set
* @pdOid 3cb7812e-bae1-48cc-8d59-04762883c9aa */
public void setFctime(String fctime) {
this.fctime = fctime;
}
/** @return the ud_zyxk_zysqid
*
* @pdOid 6e21ada8-41ae-4c8d-8584-98f01b77452c */
public Integer getUd_zyxk_zysqid() {
return ud_zyxk_zysqid;
}
/** @param ud_zyxk_zysqid the ud_zyxk_zysqid to set
* @pdOid 5823be50-c183-4fb2-8a93-9f5cc6283ad1 */
public void setUd_zyxk_zysqid(Integer ud_zyxk_zysqid) {
this.ud_zyxk_zysqid = ud_zyxk_zysqid;
}
/** @return the isupload
*
* @pdOid 5143519e-93be-4fcf-b5bf-13a7a5dc9ba2 */
public Integer getIsupload() {
return isupload;
}
/** @param isupload the isupload to set
* @pdOid dfd0be31-8159-4ef5-88da-ae78a08da17f */
public void setIsupload(Integer isupload) {
this.isupload = isupload;
}
/** @return the zgperson
*
* @pdOid affa5e40-1d62-45ca-b0e2-02bb9573c8a0 */
public String getZgperson() {
return zgperson;
}
/** @param zgperson the zgperson to set
* @pdOid c1864a5f-75c5-4dc6-a4be-a8f62b9351f3 */
public void setZgperson(String zgperson) {
this.zgperson = zgperson;
}
/** @return the zgperson_desc
*
* @pdOid 86c82cd0-4158-4e64-8a56-55572eb3b062 */
public String getZgperson_desc() {
return zgperson_desc;
}
/** @param zgperson_desc the zgperson_desc to set
* @pdOid 95acc67a-d35e-4c89-a8b1-c597bbcef3e8 */
public void setZgperson_desc(String zgperson_desc) {
this.zgperson_desc = zgperson_desc;
}
/** @return the zgtime
*
* @pdOid 5cc709d6-4142-4702-b687-cbaf419e622f */
public String getZgtime() {
return zgtime;
}
/** @param zgtime the zgtime to set
* @pdOid 7f41942b-caf4-43d8-bdf1-0de9cd6d17a7 */
public void setZgtime(String zgtime) {
this.zgtime = zgtime;
}
/** @return the pdajcjlid
*
* @pdOid fc88cbf4-166e-430c-8ca5-40214871be88 */
public String getPdajcjlid() {
return pdajcjlid;
}
/** @param pdajcjlid the pdajcjlid to set
* @pdOid e8c3b101-c05f-460d-9227-374f902dc148 */
public void setPdajcjlid(String pdajcjlid) {
this.pdajcjlid = pdajcjlid;
}
} | [
"dubojian@ushayden.com"
] | dubojian@ushayden.com |
89b35b6d3cb666b3ef9d94c94a915adfd11142c3 | 51e2bca5817883a687f3b03444910387639a9f5d | /zpro-base/src/main/java/cn/zpro/se/SearchBin.java | f2ccb3b0896ae84824045b02bed9ffbbadc048fd | [] | no_license | zhangglCoder/study-plan | 00013d8c3bcb65337a11bef051ca6174b98a3db6 | 7a10e25c378057136b0ab526f7222fcade930b06 | refs/heads/master | 2021-01-01T04:07:23.019870 | 2018-02-22T05:36:51 | 2018-02-22T05:36:51 | 97,122,679 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 661 | java | package cn.zpro.se;
import java.util.Arrays;
public class SearchBin {
public static void main(String[] args) {
int[] array = {1, 2, 4, 5, 23, 88, 105};
System.out.println(Arrays.binarySearch(array,1));
System.out.println(searchBin(array, 1));
}
public static int searchBin(int[] array, int k) {
int a = 0;
int b = array.length;
while (a < b) {
int m = (a + b) / 2;
if (k < array[m]) {
b = m;
} else if (k > array[m]) {
a = m + 1;
} else {
return m;
}
}
return -1;
}
}
| [
"742819432@qq.com"
] | 742819432@qq.com |
d105249c694f22126ab66a6b1ef7a95b08809201 | c21a03baea751eb5d9743b32d7035d885519eee6 | /Openstack/src/main/java/com/inforstack/openstack/utils/MapUtil.java | 60f1808792073f8ce81d99ebc7efba0dc512c479 | [] | no_license | thaingo/PY-rest-utils | 780322327806cc5811f54c17057891a442567726 | ac5a40dc6d0c8370bd9c2fdb79b983e79c7790ee | refs/heads/master | 2020-04-01T19:38:01.882214 | 2013-03-14T05:08:24 | 2013-03-14T05:08:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,176 | java | package com.inforstack.openstack.utils;
import java.util.HashMap;
import java.util.Map;
public class MapUtil {
public static boolean isNullOrEmpty(Map<? extends Object, ? extends Object> map){
if(map == null || map.isEmpty()){
return true;
}
return false;
}
public static String buildPropStr(Map<String, String> properties){
if(isNullOrEmpty(properties)){
return "";
}
StringBuilder builder = new StringBuilder();
for(String key : properties.keySet()){
String value = properties.get(key);
if(StringUtil.isNullOrEmpty(value)){
continue;
}
builder.append(key).append('=').append(value).append(';');
}
return builder.toString();
}
public static Map<String, String> buildPropMap(String s){
Map<String, String> map = new HashMap<String, String>();
if(StringUtil.isNullOrEmpty(s)){
return map;
}
for(String prop : s.split(";")){
if(StringUtil.isNullOrEmpty(prop)){
continue;
}
String[] keyValue = prop.split("=");
if(keyValue.length != 2){
continue;
}
map.put(keyValue[0], keyValue[1]);
}
return map;
}
}
| [
"jpshao@445347b9-a622-0248-9c6a-1ca700c04f83"
] | jpshao@445347b9-a622-0248-9c6a-1ca700c04f83 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.