blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
033c929253992ff69a47a698a2420306645f47da | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/32/32_2412c59f5c3a26027f32c25bc7db1510c75afb19/Gotoh/32_2412c59f5c3a26027f32c25bc7db1510c75afb19_Gotoh_t.java | 9ec7f44f73a675e4974fcaa324fc92a838bfb813 | [] | 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 | 15,999 | java | package de.bioinformatikmuenchen.pg4.alignment;
import de.bioinformatikmuenchen.pg4.alignment.gap.ConstantGapCost;
import de.bioinformatikmuenchen.pg4.alignment.gap.IGapCost;
import de.bioinformatikmuenchen.pg4.alignment.io.DPMatrixExporter;
import de.bioinformatikmuenchen.pg4.alignment.io.IAlignmentOutputFormatter;
import de.bioinformatikmuenchen.pg4.alignment.io.IDPMatrixExporter;
import de.bioinformatikmuenchen.pg4.common.Sequence;
import de.bioinformatikmuenchen.pg4.common.alignment.AlignmentResult;
import de.bioinformatikmuenchen.pg4.common.alignment.SequencePairAlignment;
import de.bioinformatikmuenchen.pg4.common.distance.IDistanceMatrix;
import java.io.IOException;
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author tobias
*/
public class Gotoh extends AlignmentProcessor {
private double[][] matrixA;
private double[][] matrixIn;
private double[][] matrixDel;
private double score;
private int xSize = -1;
private int ySize = -1;
private String querySequence;
private String targetSequence;
private String querySequenceId;
private String targetSequenceId;
private boolean freeshift = false;
private boolean local = false;
boolean[][] leftPath;
boolean[][] leftTopPath;
boolean[][] topPath;
boolean[][] hasPath;
public Gotoh(AlignmentMode mode, AlignmentAlgorithm algorithm, IDistanceMatrix distanceMatrix, IGapCost gapCost) {
super(mode, algorithm, distanceMatrix, gapCost);
assert algorithm == AlignmentAlgorithm.GOTOH;
//AlignmentResult result = new AlignmentResult();
}
public Gotoh(AlignmentMode mode, AlignmentAlgorithm algorithm, IDistanceMatrix distanceMatrix, IGapCost gapCost, IAlignmentOutputFormatter outputFormatter) {
super(mode, algorithm, distanceMatrix, gapCost, outputFormatter);
assert gapCost instanceof ConstantGapCost : "Classic Needleman Wunsch can't use affine gap cost";
assert algorithm == AlignmentAlgorithm.NEEDLEMAN_WUNSCH;
}
@Override
public AlignmentResult align(Sequence seq1, Sequence seq2) {
assert seq1 != null && seq2 != null;
assert seq1.getSequence().length() > 0;
assert seq2.getSequence().length() > 0;
this.querySequence = seq1.getSequence();
this.targetSequence = seq2.getSequence();
this.querySequenceId = seq1.getId();
this.targetSequenceId = seq2.getId();
this.xSize = querySequence.length();
this.ySize = targetSequence.length();
AlignmentResult result = new AlignmentResult();
initMatrix(seq1.getSequence().length(), seq2.getSequence().length());
fillMatrix(seq1.getSequence(), seq2.getSequence(), result);////////////////////// SCORE übergeben!
this.score = matrixA[xSize - 1][ySize - 1];
//Calculate the alignment and add it to the result
if (mode == AlignmentMode.GLOBAL) {
result.setAlignments(Collections.singletonList(backTrackingGlobal()));
} else if (mode == AlignmentMode.LOCAL) {
result.setAlignments(Collections.singletonList(backTrackingLocal()));
} else if (mode == AlignmentMode.FREESHIFT) {
result.setAlignments(Collections.singletonList(backTrackingFreeShift()));
} else {
throw new IllegalArgumentException("Unknown alignment mode: " + mode);
}
result.setQuerySequenceId(seq1.getId());
result.setTargetSequenceId(seq2.getId());
// System.out.println(printMatrix());
return result;
}
public void initMatrix(int xSize, int ySize) {
this.xSize = xSize;
this.ySize = ySize;
xSize++;
ySize++;
//Create the matrices
matrixA = new double[xSize][ySize];
matrixIn = new double[xSize][ySize];
matrixDel = new double[xSize][ySize];
leftPath = new boolean[xSize][ySize];
leftTopPath = new boolean[xSize][ySize];
topPath = new boolean[xSize][ySize];
hasPath = new boolean[xSize][ySize];
matrixDel[0][0] = Double.NEGATIVE_INFINITY;//NaN;
matrixIn[0][0] = Double.NEGATIVE_INFINITY;//NaN;
if (!(mode == AlignmentMode.FREESHIFT || mode == AlignmentMode.LOCAL)) {// " == if(global)"
for (int i = 1; i < xSize; i++) {
matrixA[i][0] = gapCost.getGapCost(i);
}
for (int i = 1; i < ySize; i++) {
matrixA[0][i] = gapCost.getGapCost(i);
}
}
for (int i = 1; i < xSize; i++) {
matrixIn[i][0] = Double.NEGATIVE_INFINITY;
matrixDel[i][0] = Double.NEGATIVE_INFINITY;//NaN;
}
for (int i = 1; i < ySize; i++) {
matrixIn[0][i] = Double.NEGATIVE_INFINITY;//NaN;
matrixDel[0][i] = Double.NEGATIVE_INFINITY;
}
//init the boolean[][] arrays which store the path taken by the backtracking algorithm
for (int x = 0; x < xSize; x++) {
for (int y = 0; y < ySize; y++) {
leftPath[x][y] = false;
leftTopPath[x][y] = false;
topPath[x][y] = false;
hasPath[x][y] = false;
}
}
}
public double[] findMaximumInMatrix() {//returns the coordinates (x,y) and entry of the cell with the maximum entry (in this order)
int x = -1;
int y = -1;
double maxCell = Double.NEGATIVE_INFINITY;
for (int i = 0; i < xSize; i++) {
for (int j = 0; j < ySize; j++) {
if (matrixA[i][j] >= maxCell) {
x = i;
y = j;
maxCell = matrixA[i][j];
}
}
}
assert (x >= 0 && y >= 0 && maxCell > Double.NEGATIVE_INFINITY);
return new double[]{x, y, maxCell};
}
public void fillMatrix(String seq1, String seq2, AlignmentResult result) {
assert ((gapCost != null) && (distanceMatrix != null));
for (int x = 1; x < xSize + 1; x++) {
for (int y = 1; y < ySize + 1; y++) {
matrixIn[x][y] = Math.max(matrixA[x - 1][y] + gapCost.getGapCost(1), matrixIn[x - 1][y] + gapCost.getGapExtensionPenalty(0, 1));
matrixDel[x][y] = Math.max(matrixA[x][y - 1] + gapCost.getGapCost(1), matrixDel[x][y - 1] + gapCost.getGapExtensionPenalty(0, 1));
matrixA[x][y] = Math.max(Math.max(matrixIn[x][y], matrixDel[x][y]), matrixA[x - 1][y - 1] + distanceMatrix.distance(seq1.charAt(x - 1), seq2.charAt(y - 1)));
}
}
if (mode == AlignmentMode.GLOBAL) {
result.setScore(matrixA[xSize][ySize]);
} else if (mode == AlignmentMode.LOCAL) {
result.setScore(findMaximumInMatrix()[2]);
}
}
public SequencePairAlignment backTrackingLocal() {
StringBuilder queryLine = new StringBuilder();
StringBuilder targetLine = new StringBuilder();
//find the cell with the greatest entry:
double[] maxEntry = findMaximumInMatrix();
int x = (int) maxEntry[0];
int y = (int) maxEntry[1];
double maxCell = maxEntry[2];
while (matrixA[x][y] != 0 && x > 0 && y > 0) {
assert (x >= 0 && y >= 0 && maxCell > Double.NEGATIVE_INFINITY);
while (matrixA[x][y] != 0 && x > 0 && y > 0) {
char A = querySequence.charAt(x - 1);
char B = targetSequence.charAt(y - 1);
if (matrixA[x][y] == matrixA[x - 1][y - 1] + distanceMatrix.distance(A, B)) {
leftTopPath[x][y] = true;
hasPath[x][y] = true;
queryLine.append(A);
targetLine.append(B);
x--;
y--;
} else if (matrixA[x][y] == matrixIn[x][y]) {
int shift = findK(matrixA[x][y], x, y, true);
for (int i = x; i >= (x - shift) && i > 0; i--) {
leftPath[i][y] = true;
hasPath[i][y] = true;
queryLine.append(querySequence.charAt(i - 1));
targetLine.append('-');
}
x -= shift;
} else if (matrixA[x][y] == matrixDel[x][y]) {
int shift = findK(matrixA[x][y], x, y, false);
for (int i = y; i >= (y - shift) && i > 0; i--) {
topPath[x][i] = true;
hasPath[x][i] = true;
queryLine.append('-');
targetLine.append(targetSequence.charAt(i - 1));
}
y -= shift;
} else {
throw new AlignmentException("No possibility found to move on (indicates a sure failure)");
}
}
}
return new SequencePairAlignment(queryLine.reverse().toString(), targetLine.reverse().toString());
}
public SequencePairAlignment backTrackingFreeShift() {
return backTrackingGlobal();
}
public SequencePairAlignment backTrackingGlobal() {
int x = xSize;
int y = ySize;
StringBuilder queryLine = new StringBuilder();
StringBuilder targetLine = new StringBuilder();
while (x >= 0 && y >= 0) {//while the rim of the matrix or its left upper corner is not reached
// System.out.println("Stuff " + x);
// => ab hier: x > 0 && y > 0
char A = (x == 0 ? '?' : querySequence.charAt(x - 1));
char B = (y == 0 ? '?' : targetSequence.charAt(y - 1));
if (x == 0) {
//System.out.println("x==0");
while (y > 0) {
//System.out.println("x==0 x,y: " + x + ", " + y);
topPath[x][y] = true;
hasPath[x][y] = true;
queryLine.append('-');
targetLine.append(targetSequence.charAt(y - 1));
y--;
}
break;
} else if (y == 0) {
//System.out.println("y==0");
while (x > 0) {
//System.out.println("y==0 left x,y: " + x + ", " + y);
leftPath[x][y] = true;
hasPath[x][y] = true;
queryLine.append(querySequence.charAt(x - 1));
targetLine.append('-');
x--;
}
break;
} else if (Math.abs((matrixA[x][y]) - (matrixA[x - 1][y - 1] + distanceMatrix.distance(A, B))) < 0.0000000001) {//leftTop
leftTopPath[x][y] = true;
hasPath[x][y] = true;
queryLine.append(A);
targetLine.append(B);
x--;
y--;
} else if (Math.abs(matrixA[x][y] - matrixIn[x][y]) < 0.0000000001) {// Insertion -> to the left
int xShift = 1;
while (Math.abs(matrixA[x][y] - (matrixA[x - xShift][y] + gapCost.getGapCost(xShift))) > 0.0000000001) {
leftPath[x - xShift][y] = true;
hasPath[x - xShift][y] = true;
queryLine.append(querySequence.charAt(x - xShift - 1));
targetLine.append('-');
xShift++;
}
leftPath[x - xShift][y] = true;
hasPath[x - xShift][y] = true;
queryLine.append(querySequence.charAt(x - 1));
targetLine.append('-');
x -= xShift;
} else if (Math.abs(matrixA[x][y] - matrixDel[x][y]) < 0.0000000001) {// Deletion -> to the right
int yShift = 1;
while (Math.abs(matrixA[x][y] - (matrixA[x][y - yShift] + gapCost.getGapCost(yShift))) > 0.0000000001) {
topPath[x][y - yShift] = true;
hasPath[x][y - yShift] = true;
queryLine.append('-');
targetLine.append(targetSequence.charAt(y - yShift - 1));
yShift++;
}
topPath[x][y - yShift] = true;
hasPath[x][y - yShift] = true;
queryLine.append('-');
targetLine.append(targetSequence.charAt(y - 1));
y -= yShift;
} else {
throw new AlignmentException("No possibility found to move on (indicates a sure failure)");
}
}
return new SequencePairAlignment(queryLine.reverse().toString(), targetLine.reverse().toString());
}
private int findK(double entry, int x, int y, boolean insertion) {//not neccessary anymore
int shift = 0;
if (insertion) {
while (x != 0) {
if ((matrixA[x - 1][y] + gapCost.getGapCost(shift + 1)) == entry) {
shift++;
break;
} else {
shift++;
x--;
}
}
} else {//Deletion
while (y != 0) {
if ((matrixA[x][y - 1] + gapCost.getGapCost(shift + 1)) == entry) {
shift++;
break;
} else {
shift++;
y--;
}
}
}
assert shift > 0;
return shift;
}
public boolean setFreeshift(boolean freeshift) {
this.freeshift = freeshift;
return this.freeshift;
}
public boolean setLocal(boolean local) {
this.local = local;
return this.local;
}
public String printMatrix() {
StringBuilder builder = new StringBuilder();
builder.append("\t\t");
for (int x = 0; x < querySequence.length(); x++) {
builder.append(querySequence.charAt(x)).append("\t");
}
builder.append("\n");
for (int y = 0; y <= targetSequence.length(); y++) {
builder.append(y == 0 ? ' ' : targetSequence.charAt(y - 1)).append("\t");
for (int x = 0; x <= querySequence.length(); x++) {
builder.append(matrixA[x][y]).append("\t");
}
builder.append("\n");
}
return builder.toString();
}
@Override
public void writeMatrices(IDPMatrixExporter exporter) {
DPMatrixExporter.DPMatrixInfo info = new DPMatrixExporter.DPMatrixInfo();
//Set sequences
info.query = querySequence;
info.target = targetSequence;
//Set IDs
info.queryId = querySequenceId;
info.targetId = targetSequenceId;
info.xSize = xSize;
info.ySize = ySize;
info.matrix = this.matrixA;
info.matrixPostfix = "Gotoh alignment matrix";
try {
exporter.write(info);
} catch (IOException ex) {
Logger.getLogger(Gotoh.class.getName()).log(Level.SEVERE, null, ex);
}
info.matrix = this.matrixIn;
info.matrixPostfix = "Gotoh insertions matrix";
try {
exporter.write(info);
} catch (IOException ex) {
Logger.getLogger(Gotoh.class.getName()).log(Level.SEVERE, null, ex);
}
info.matrix = this.matrixDel;
info.matrixPostfix = "Gotoh deletions matrix";
try {
exporter.write(info);
} catch (IOException ex) {
Logger.getLogger(Gotoh.class.getName()).log(Level.SEVERE, null, ex);
}
info.score = score;
}
}
| [
"[email protected]"
] | |
7aecfb847a40794f37aa832a6689bec0c1f944b3 | 332e5b265241fe9a7d7287abdcae389fe2b772c0 | /Android App/app/src/main/java/gps_sms/mitko/tuesgpsapp/MyFirebaseMessagingService.java | a9e241f59ee6c5dafd40f2e8e6b9c63985e07a95 | [] | no_license | dneshev99/GPS-Dog-Tracker | aa3476025f7ef5f103e2bf9f49495dd3550769d7 | 2e05526f8049e78e2a98961d884c7907a3b3b240 | refs/heads/master | 2021-01-20T01:46:21.207547 | 2017-05-28T13:27:37 | 2017-05-28T13:27:37 | 89,329,287 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package gps_sms.mitko.tuesgpsapp;
import android.content.Intent;
import com.google.android.gms.maps.model.LatLng;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage.getNotification() != null) {
String body = remoteMessage.getNotification().getBody();
String[] tokens = body.split(" ");
if (tokens[0].equals("location:") && tokens.length == 3) {
LatLng location = new LatLng(Double.parseDouble(tokens[1]), Double.parseDouble(tokens[2]));
Intent message = new Intent("locationUpdates");
message.putExtra("location", location);
sendBroadcast(message);
}
}
}
}
| [
"[email protected]"
] | |
2aaf64dc80b2564edf056cd7ae46cda0b287e2b4 | 88bf23ad030017eb6645d76a7179260436bac431 | /src/main/java/com/znjt/dao/impl/PCITransferDao.java | 8d6395563ecf6bb963dc93d8d7aa51775282b395 | [] | no_license | qiury/deliverc | 4a939163bc935c3435a6c8d14055a3858f4b1ef5 | 0247e9480a54341bc013c0102caeb4cbcd3ef0ad | refs/heads/master | 2022-07-16T03:16:36.453444 | 2019-07-12T02:52:40 | 2019-07-12T02:52:40 | 177,367,127 | 0 | 0 | null | 2022-06-21T01:00:37 | 2019-03-24T03:39:28 | Java | UTF-8 | Java | false | false | 2,455 | java | package com.znjt.dao.impl;
import com.znjt.dao.beans.PCITransferIniBean;
import com.znjt.dao.mapper.PCITransferBeanMapper;
import com.znjt.datasource.enhance.EnhanceDbUtils;
import com.znjt.datasource.enhance.EnhanceMapperFactory;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import java.util.List;
/**
* Created by qiuzx on 2019-04-18
* Company BTT
* Depart Tech
*/
public class PCITransferDao {
public List<PCITransferIniBean> findUnUpLoadPCIRecordDatas(String dbname, int pageSize) {
List<PCITransferIniBean> recordDatas = null;
try {
SqlSession sqlSession = EnhanceMapperFactory.getMultiSqlSession(dbname, true);
PCITransferBeanMapper mapper = EnhanceMapperFactory.createMapper(PCITransferBeanMapper.class, sqlSession);
recordDatas = mapper.findUnUpLoadPCIRecordDatas(pageSize);
} catch (Exception e) {
e.printStackTrace();
new RuntimeException("查询未上传的PCI记录出现异常",e);
} finally {
EnhanceDbUtils.closeSession();
}
return recordDatas;
}
public void updateCurrentUpLoadedSuccessPCIRescords(String dbname,List<PCITransferIniBean> pciTransferIniBeans) {
try {
SqlSession sqlSession = EnhanceMapperFactory.getMultiSqlSession(dbname, false);
PCITransferBeanMapper mapper = EnhanceMapperFactory.createMapper(PCITransferBeanMapper.class, sqlSession);
mapper.updateCurrentUpLoadedSuccessPCIRescords(pciTransferIniBeans);
sqlSession.commit();
} catch (Exception e) {
new RuntimeException("更新已经上传的PCI记录状态出现异常",e);
} finally {
EnhanceDbUtils.closeSession();
}
}
public void upLoadPCIRecordDatas2UpStream(String dbname,List<PCITransferIniBean> pciTransferIniBeans) {
try {
SqlSession sqlSession = EnhanceMapperFactory.getMultiSqlSession(dbname, false, ExecutorType.BATCH);
PCITransferBeanMapper mapper = EnhanceMapperFactory.createMapper(PCITransferBeanMapper.class, sqlSession);
mapper.upLoadPICRecordDatas2UpStream(pciTransferIniBeans);
sqlSession.commit();
} catch (Exception e) {
new RuntimeException("更新已经上传的IRI状态出现异常",e);
} finally {
EnhanceDbUtils.closeSession();
}
}
}
| [
"[email protected]"
] | |
b9def918bb2a97ae36488afa0f33b9a11cfe2e93 | 1e5e092e50d88dfa47e2468dd146ac512ad1843a | /netbeans/curso-java-basico/src/com/loiane/cursojava/aula13/OperadoresAritmeticos.java | 79cecadb500b768e3da32706f63b04babffeef04 | [] | no_license | loiane/curso-java-basico | fa2f3223697db4404973e644570810c0143217bc | 6154c70c46f450358d3480cd85c70a5488e49de7 | refs/heads/master | 2023-08-15T07:58:24.717700 | 2022-11-23T21:11:12 | 2022-11-23T21:11:12 | 12,656,659 | 998 | 855 | null | 2022-11-23T21:11:49 | 2013-09-06T23:20:19 | Java | UTF-8 | Java | false | false | 1,190 | java | package com.loiane.cursojava.aula13;
public class OperadoresAritmeticos {
public static void main(String[] args) {
int resultado = 1 + 2;
System.out.println(resultado);
resultado = resultado - 1;
System.out.println(resultado);
resultado = resultado * 2;
System.out.println(resultado);
resultado = resultado / 2;
System.out.println(resultado);
resultado = resultado + 8;
System.out.println(resultado);
resultado = resultado % 7;
System.out.println(resultado);
String primeiroNome = "Esta é";
String segundoNome = " uma String concatenada.";
String terceiroNome = primeiroNome + segundoNome;
System.out.println(terceiroNome);
resultado = resultado + 1;
System.out.println(resultado);
resultado++;
System.out.println(resultado);
//5
System.out.println(resultado++);
//mesma coisa que
//System.out.println(resultado);
//resultado = resultado + 1;
//resultado += 1;
System.out.println(++resultado);
//mesma coisa que
//resultado += 1;
//System.out.println(resultado);
resultado--;
System.out.println(resultado);
System.out.println(resultado--);
System.out.println(--resultado);
}
}
| [
"[email protected]"
] | |
55ac30a0842ed59c15f0094c7394817be8c800df | fdfeaab24e27e136e3b4f70d4f5cd461cc98c462 | /src/ictgradschool/project/servlets/admin/AdminInterfaceServlet.java | 43e529e41166cb1a658ad47357470437abfef9b4 | [] | no_license | ShuyunLiuRun/Blogging_website_Sunflower | e64c0fd28bd31ff00887dbce309743460e9acaf9 | ca44b004a0e55fd1279b4295f018a78b0d13e6ff | refs/heads/master | 2020-08-04T07:00:02.875816 | 2019-10-01T08:49:57 | 2019-10-01T08:49:57 | 212,047,213 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,577 | java | package ictgradschool.project.servlets.admin;
import ictgradschool.project.daos.AdminDAO;
import ictgradschool.project.javabeans.Article;
import ictgradschool.project.javabeans.User;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@WebServlet(name = "AdminInterfaceServlet")
public class AdminInterfaceServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
if (request.getSession().getAttribute("admin") == null) {
request.setAttribute("message", "You do not have permission to access that page");
request.getRequestDispatcher("home").forward(request, response);
} else {
List<User> userList;
userList = AdminDAO.getAllUsers(getServletContext());
request.setAttribute("users", userList);
List<Article> articles;
articles = AdminDAO.getAllArticles(getServletContext());
request.setAttribute("articles", articles);
request.getRequestDispatcher("web-pages/admin-interface.jsp").forward(request, response);
}
}
}
| [
"[email protected]"
] | |
0a985a7e28a74dbcdbf40d8d0e9a5773506f42b6 | da44e679a93bb2e90a3c501975a5ade0fd666b43 | /src/main/java/com/example/designpatterns/factory/factorymethod/PersonFactory.java | f3efe0aedf7c472e95dde5174f483a5dbc5c190d | [] | no_license | yoxiyoxiiii/design-patterns | 1346dffb3d011d4f1bd0ffbe7e16d862b13365e0 | 4d3f3d7951b5a0ac5ce7e664a62b76df311b6fe0 | refs/heads/master | 2020-05-20T15:07:31.990242 | 2019-05-12T05:58:10 | 2019-05-12T05:58:10 | 185,636,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 122 | java | package com.example.designpatterns.factory.factorymethod;
public interface PersonFactory {
Person createPerson();
}
| [
"[email protected]"
] | |
798fbfa19808cd4884ff531c4259ba64fd35bd87 | e387bf8e88ab9a1725a9887a8f20efced7bfe918 | /AndroidChess36/app/src/main/java/model/Pawn.java | cd8e3220e918e917df34059dad14e546cc04a480 | [] | no_license | aldermanwhitney/AndroidChess | 3975c2b6137a464e03c5b114f98be4e0986f9530 | fcbba70d908eba960d0fd9fa72c65118340d9685 | refs/heads/master | 2022-07-02T04:16:48.744648 | 2020-05-09T18:50:08 | 2020-05-09T18:50:08 | 262,634,531 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,884 | java | package model;
/**
* @authors Gazal Arora and Whitney Alderman
*/
//package pieces;
//import chess.Block;
//import chess.Chessboard;
import controller.*;
import view.*;
import model.*;
public class Pawn extends Pieces{
static int oR = -1, oC = -1;
static Pieces enpL = null , enpR = null;
static boolean enpassantL, enpassantR;
static boolean canEnp;
public static int r = -1, c = -1;
/**
* Pawn(String color)
* Constructor for a Pawn Piece with given color and type pawn,
*
* @param color - color black or white using parameter
*/
public Pawn(String color) {
super(color);
type = "pawn";
}
/**
* isValidMove(int oldCol, int oldRow, int newCol, int newRow)
* checks to see if a move is valid from old position to new position for a Pawn piece
* @param oldCol - old block's File
* @param oldRow - old block's Rank
* @param newCol - new block's File
* @param newRow - new blocks Rank
*
*
* @return boolean
*/
public boolean isValidMove(int oldCol, int oldRow, int newCol, int newRow){
//System.out.println("In is valid move for pawn");
//forward move with in an empty block
if(Chessboard.chessBoard[newRow][newCol].getPiece()!=null) {
{
//diagonal move of pawn where it can beat opponent's piece
//first checks if pieces at new and old positions are of opposing sides
if((Chessboard.chessBoard[newRow][newCol].getPiece().isWhite() && !Chessboard.chessBoard[oldRow][oldCol].getPiece().isWhite()) ||
(!Chessboard.chessBoard[newRow][newCol].getPiece().isWhite() && Chessboard.chessBoard[oldRow][oldCol].getPiece().isWhite())) {
//adjacent column only
if(newCol==oldCol-1 || newCol==oldCol+1) {
//for black piece and next row
if(!Chessboard.chessBoard[oldRow][oldCol].getPiece().isWhite() && newRow==oldRow+1) {
//enpassantL = false;
//enpassantR = false;
return true;
}
//white piece and forward row
else if (Chessboard.chessBoard[oldRow][oldCol].getPiece().isWhite() && newRow==oldRow-1) {
// enpassantL = false;
//enpassantR = false;
return true;
}
}
}
//enpassantL = false;
//enpassantR = false;
return false;
}
}
else {
//vertical forward move for white piece
//System.out.println("Moving white piece with no piece in way");
if(Chessboard.chessBoard[oldRow][oldCol].getPiece().isWhite()) {
//System.out.println("here 1");
//first move of white pawn is at row 6 and
//clear path checks when first move is moving over 2 blocks
if(oldRow==6 && (newRow ==oldRow-2) ) {
//System.out.println("here 2");
//System.out.println("first move valid");
//moves the pawn only if new position has no pieces
if(pathClear(oldCol,oldRow, newCol, newRow) ) {
//System.out.println("path is clear");
if(newCol != 0 && newCol!= 7) {
if(Chessboard.chessBoard[newRow][newCol-1].getPiece()!=null && !Chessboard.chessBoard[newRow][newCol-1].getPiece().isWhite())
{
if(Chessboard.chessBoard[newRow][newCol-1].getPieceType().equals("p")) {
enpL= Chessboard.chessBoard[newRow][newCol-1].getPiece();
enpassantL = true;
//System.out.println("here 3 enpL = " + enpassantL);
}
//else {enpassantL =false;}
}
if(Chessboard.chessBoard[newRow][newCol+1].getPiece()!=null && !Chessboard.chessBoard[newRow][newCol+1].getPiece().isWhite())
{
if(Chessboard.chessBoard[newRow][newCol+1].getPieceType().equals("p")) {
enpR= Chessboard.chessBoard[newRow][newCol+1].getPiece();
enpassantR = true;
//System.out.println("here 3 enpR = " + enpassantR);
}
//else {enpassantR = false;}
}
/*
if(Chessboard.chessBoard[newRow][newCol-1].getPiece()==null || Chessboard.chessBoard[newRow][newCol-1].getPiece().isWhite()) {
enpassantL = false;
}
if(Chessboard.chessBoard[newRow][newCol+1].getPiece()==null || Chessboard.chessBoard[newRow][newCol+1].getPiece().isWhite()) {
enpassantR = false;
}
*/
//System.out.println("here 3");
}
else if (newCol==0) {
if(Chessboard.chessBoard[newRow][newCol+1].getPiece()!=null && !Chessboard.chessBoard[newRow][newCol+1].getPiece().isWhite())
{
if(Chessboard.chessBoard[newRow][newCol+1].getPieceType().equals("p")) {
enpR= Chessboard.chessBoard[newRow][newCol+1].getPiece();
enpassantR = true;
}
//else {enpassantR = false;}
}
/*else {
enpassantR = false;
}*/
// System.out.println("here 4");
}
else if (newCol == 7) {
if(Chessboard.chessBoard[newRow][newCol-1].getPiece()!=null && !Chessboard.chessBoard[newRow][newCol-1].getPiece().isWhite())
{
if(Chessboard.chessBoard[newRow][newCol-1].getPieceType().equals("p")) {
enpL= Chessboard.chessBoard[newRow][newCol-1].getPiece();
enpassantL = true;
}
//else { enpassantL = false; }
}
/* else {
enpassantL = false;
}*/
}
// System.out.println("here 5");
if(enpassantL || enpassantR) {
oR = newRow;
oC = newCol;
}
//System.out.println("here 7");
return true;
}
}
else if (oldRow==6 && newRow == oldRow-1) {
//System.out.println("here 8");
if(pathClear(oldCol,oldRow, newCol, newRow) ) {
//System.out.println("path is clear");
// enpassantL = false;
// enpassantR = false;
canEnp=false;
return true;
}
}
//if its not the first move of respective pawn, then we can only move one block forward
//given that new position has no piece in that block
else if ((oldRow!=6 && newRow == oldRow-1) && (oldCol == newCol)) {
//System.out.println("here 9");
// System.out.println(enpassantL + " enpassant value 1" + enpassantR +" " + r + c);
// enpassantL = false;
//enpassantR = false;
r = -1;
c = -1;
canEnp=false;
return true;
}
else if ((oldRow==3 && newRow == 2) && (newCol==oldCol+1 || newCol == oldCol-1)) {
//System.out.println("here 10");
//System.out.println(enpassantL + " enpassant value 2" + enpassantR+" " + r + c);
if( enpassant(oldCol, oldRow, newCol, newRow)) canEnp = true;
else canEnp = false;
return canEnp;
}
/*else{
canEnp=false;
}*/
//System.out.println("here 11");
}
//vertical forward move for black piece
else if (!Chessboard.chessBoard[oldRow][oldCol].getPiece().isWhite()) {
//first move of black pawn is at row 1 and
//clear path checks when first move is moving over 2 blocks
if(oldRow==1 && (newRow ==oldRow+2) ) {
//moves the pawn only if new position has no pieces
if(pathClear(oldCol,oldRow, newCol, newRow)) {
//System.out.println("here");
if((newCol != 0 && newCol!= 7)) {
if(Chessboard.chessBoard[newRow][newCol-1].getPiece()!=null && Chessboard.chessBoard[newRow][newCol-1].getPiece().isWhite())
{
if(Chessboard.chessBoard[newRow][newCol-1].getPieceType().equals("p")) {
enpL= Chessboard.chessBoard[newRow][newCol-1].getPiece();
enpassantL = true;
//System.out.println("here 3 enpL = " + enpassantL);
}
// else {enpassantL =false;}
}
if(Chessboard.chessBoard[newRow][newCol+1].getPiece()!=null && Chessboard.chessBoard[newRow][newCol+1].getPiece().isWhite())
{
if(Chessboard.chessBoard[newRow][newCol+1].getPieceType().equals("p")) {
enpR= Chessboard.chessBoard[newRow][newCol+1].getPiece();
enpassantR = true;
//System.out.println("here 3 enpR = " + enpassantR);
}
//else {enpassantR = false;}
}
/*
if(Chessboard.chessBoard[newRow][newCol-1].getPiece()==null || !Chessboard.chessBoard[newRow][newCol-1].getPiece().isWhite()) {
enpassantL = false;
}
if(Chessboard.chessBoard[newRow][newCol+1].getPiece()==null || !Chessboard.chessBoard[newRow][newCol+1].getPiece().isWhite()) {
enpassantR = false;
}
*/
//System.out.println("here 3 ");
}
else if (newCol==0) {
if(Chessboard.chessBoard[newRow][newCol+1].getPiece()!=null && Chessboard.chessBoard[newRow][newCol+1].getPiece().isWhite())
{ if(Chessboard.chessBoard[newRow][newCol+1].getPieceType().equals("p")) {
enpR= Chessboard.chessBoard[newRow][newCol+1].getPiece();
enpassantR = true;
}
//else {enpassantR = false;}
}
/* else {
enpassantR = false;
}*/
}
else if (newCol == 7) {
if(Chessboard.chessBoard[newRow][newCol-1].getPiece()!=null && Chessboard.chessBoard[newRow][newCol-1].getPiece().isWhite())
{
if(Chessboard.chessBoard[newRow][newCol-1].getPieceType().equals("p")) {
enpL= Chessboard.chessBoard[newRow][newCol-1].getPiece();
enpassantL = true;
}
/* else
{ enpassantL = false; }
}
else {
enpassantL = false;
*/
}
}
if(enpassantL || enpassantR) {
oR = newRow;
oC = newCol;
}
return true;
}
}
else if (oldRow==1 && (newRow == oldRow+1) ) {
if(pathClear(oldCol,oldRow, newCol, newRow)) {
//System.out.println("here");
// enpassantL = false;
// enpassantR = false;
canEnp=false;
return true;
}
}
//if its not the first move of respective pawn, then we can only move one block forward
//given that new position has no piece in that block
else if ((oldRow!=1 && newRow == oldRow+1) && (oldCol == newCol)){
// enpassantL = false;
// enpassantR = false;
r = -1;
c = -1;
canEnp=false;
return true;
}
else if ((oldRow==4 && newRow == 5) && (newCol==oldCol+1 || newCol ==oldCol-1)) {
// System.out.println(enpassantL + " enpassant value " + enpassantR);
if( enpassant(oldCol, oldRow, newCol, newRow)) canEnp = true;
else canEnp = false;
return canEnp;
}
/*
else{
canEnp=false;
}*/
}
//System.out.println("here 12");
return false; //false if new position has a piece
}
}
/**
* pathClear(int oldCol, int oldRow, int newCol, int newRow)
* Checks if the path from old position to new position is clear, returns false if it isn't
* @param oldCol - old block's File
* @param oldRow - old block's Rank
* @param newCol - new block's File
* @param newRow - new blocks Rank
* @return boolean
*/
public boolean pathClear(int oldCol, int oldRow, int newCol, int newRow) {
//only need vertical path check for pawn, if not in the same column then returns false
//which in turn makes isValidMove false
if(oldCol == newCol) {
while (oldRow!=newRow) {
if(oldRow>newRow) {
if (Chessboard.chessBoard[oldRow-1][oldCol].getPiece() != null) {
return false;
}
oldRow--;
}
else if (oldRow<newRow) {
if (Chessboard.chessBoard[oldRow+1][oldCol].getPiece() != null) {
return false;
}
oldRow++;
}
Pawn.r = oldRow; Pawn.c = oldCol;
//System.out.println("row col: " + oldRow + oldCol);
return true;
}
}
return false;
}
/**
* move(int oldCol, int oldRow, int newCol, int newRow, char promo)
* moves a Pawn piece if isValidMove is true and destroys any pieces on applicable collision at new position
* @param oldCol - old block's File
* @param oldRow - old block's Rank
* @param newCol - new block's File
* @param newRow - new blocks Rank
* @param promo - promotion value Q/R/N/B for pawn promotion
*
* @return boolean
*/
public boolean move(int oldCol, int oldRow, int newCol, int newRow, char promo) {
if(isValidMove(oldCol, oldRow, newCol, newRow)) {
// not a valid move for current player for ANY piece
// if current players king will be in check as a result
// move is disallowed
if (King.isPlayerKingInCheck(oldRow, oldCol, newRow, newCol)) {
return false;
}
else {
if (Chessboard.whitesTurn==true) {
Chessboard.whiteincheck=false;
}
if (Chessboard.blacksTurn==true) {
Chessboard.blackincheck=false;
}
}
if((oldRow==1 && newRow == 0) && Chessboard.chessBoard[oldRow][oldCol].getPiece().isWhite() ) {
Chessboard.chessBoard[oldRow][oldCol].setPiece(null);
// Chessboard.chessBoard[newRow][newCol].getPiece().moved();
//System.out.println("promotion value: " + promo);
switch(promo) {
case 'Q' : Chessboard.chessBoard[newRow][newCol].setPiece(new Queen("white")); Chessboard.chessBoard[newRow][newCol].getPiece().moved(); break;
case 'N' : Chessboard.chessBoard[newRow][newCol].setPiece(new Knight("white")); Chessboard.chessBoard[newRow][newCol].getPiece().moved();break;
case 'B' : Chessboard.chessBoard[newRow][newCol].setPiece(new Bishop("white")); Chessboard.chessBoard[newRow][newCol].getPiece().moved();break;
case 'R' : Chessboard.chessBoard[newRow][newCol].setPiece(new Rook("white")); Chessboard.chessBoard[newRow][newCol].getPiece().moved();break;
default: return true;
}
if (King.isOpponentKingInCheck(newRow, newCol)){
if (Chessboard.whitesTurn==true) {
Chessboard.blackincheck=true;
}
if (Chessboard.blacksTurn==true) {
Chessboard.whiteincheck=true;
}
}
else {
if (Chessboard.whitesTurn==true) {
Chessboard.blackincheck=false;
}
if (Chessboard.blacksTurn==true) {
Chessboard.whiteincheck=false;
}
}
if(King.isOpponentKinginCheckmate(newRow, newCol)) {
Chessboard.checkMate=true;
}
//System.out.println("promotion value: " + promo);
return true;
}
else if ((oldRow==6 && newRow == 7) && !Chessboard.chessBoard[oldRow][oldCol].getPiece().isWhite() ) {
Chessboard.chessBoard[oldRow][oldCol].setPiece(null);
// Chessboard.chessBoard[newRow][newCol].getPiece().moved();
// System.out.println("promotion value: " + promo);
switch(promo) {
case 'Q' : Chessboard.chessBoard[newRow][newCol].setPiece(new Queen("black")); Chessboard.chessBoard[newRow][newCol].getPiece().moved();break;
case 'N' : Chessboard.chessBoard[newRow][newCol].setPiece(new Knight("black")); Chessboard.chessBoard[newRow][newCol].getPiece().moved(); break;
case 'B' : Chessboard.chessBoard[newRow][newCol].setPiece(new Bishop("black")); Chessboard.chessBoard[newRow][newCol].getPiece().moved();break;
case 'R' : Chessboard.chessBoard[newRow][newCol].setPiece(new Rook("black")); Chessboard.chessBoard[newRow][newCol].getPiece().moved();break;
default: return true;
}
if (King.isOpponentKingInCheck(newRow, newCol)){
if (Chessboard.whitesTurn==true) {
Chessboard.blackincheck=true;
}
if (Chessboard.blacksTurn==true) {
Chessboard.whiteincheck=true;
}
}
else {
if (Chessboard.whitesTurn==true) {
Chessboard.blackincheck=false;
}
if (Chessboard.blacksTurn==true) {
Chessboard.whiteincheck=false;
}
}
if(King.isOpponentKinginCheckmate(newRow, newCol)) {
Chessboard.checkMate=true;
}
// System.out.println("promotion value: " + promo);
return true;
}
else {
if(canEnp){
Chessboard.chessBoard[oR][oC].setPiece(null);
}
Chessboard.chessBoard[newRow][newCol].setPiece(Chessboard.chessBoard[oldRow][oldCol].getPiece());
Chessboard.chessBoard[oldRow][oldCol].setPiece(null);
Chessboard.chessBoard[newRow][newCol].getPiece().moved();
//this will probably need to be added after your switch statements too, idk
if (King.isOpponentKingInCheck(newRow, newCol)){
if (Chessboard.whitesTurn==true) {
Chessboard.blackincheck=true;
}
if (Chessboard.blacksTurn==true) {
Chessboard.whiteincheck=true;
}
}
else {
if (Chessboard.whitesTurn==true) {
Chessboard.blackincheck=false;
}
if (Chessboard.blacksTurn==true) {
Chessboard.whiteincheck=false;
}
}
if(King.isOpponentKinginCheckmate(newRow, newCol)) {
Chessboard.checkMate=true;
}
return true;
}
}
return false;
}
/**
* enpassant(int oldCol, int oldRow, int newCol, int newRow)
* Checks if an enpassant Pawn move is valid and allowed. If so, return true.
* @param oldCol - old block's File
* @param oldRow - old block's Rank
* @param newCol - new block's File
* @param newRow - new blocks Rank
*
* @return boolean
*/
public boolean enpassant(int oldCol, int oldRow, int newCol, int newRow) {
if(Pawn.r==newRow && Pawn.c == newCol) {
if(enpassantL) {
if(Chessboard.chessBoard[oldRow][oldCol].getPiece().equals(enpL)) {
enpassantL = false;
enpassantR = false;
enpL = null;
enpR = null;
return true;
}
}
if(enpassantR) {
if(Chessboard.chessBoard[oldRow][oldCol].getPiece().equals(enpR) ){
enpassantL = false;
enpassantR = false;
enpL = null;
enpR = null;
return true;
}
}
}
enpassantL = false;
enpassantR = false;
enpL = null;
enpR = null;
return false;
}
}
| [
"[email protected]"
] | |
f2aff4379b94cfc7d7b2aa66385d86ae5c2a3ee5 | 96d8f9a9be21b4ba02338123ffdab3d457d2ed8d | /mendez/Leet_code_234_palindrome_linkedList.java | 6879914ef75ea24dd31778e3ce7b170dbe5865ea | [] | no_license | otaruMendez/XtremeX | 95f9b5fabd5a61e5504683995db8afc24c17763f | 8ec9f34ca8c9f06cbc730e4ef527a317ac046050 | refs/heads/master | 2021-01-20T15:53:34.411972 | 2016-08-03T17:56:10 | 2016-08-03T17:56:10 | 60,859,222 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | java | /**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
public class Solution {
boolean isPalindrome(ListNode head) {
Stack<Integer> nodes = new Stack();
ListNode currentNode = head;
while(currentNode != null){
nodes.push(currentNode.val);
currentNode = currentNode.next;
}
currentNode = head;
while(currentNode != null){
if(currentNode.val != nodes.pop()){
return false;
}
currentNode = currentNode.next;
}
return true;
}
}
| [
"[email protected]"
] | |
bd43fef75eaa09f9573b9fb966880b4ff7cac3d2 | 4e647c158096ca953086856f6d0fc4346566503c | /module/lang/src/main/java/net/fluance/commons/lang/FluancePrintingMap.java | 2255c5acd9414893a85a618e36776e8265024af6 | [] | no_license | Fluance/fec-mw-common-libraries | c192b33875e2b930d7c04c324236db93dcaf6644 | 4d3b4b9244f2c7182ac051eb58c271f8d274b60a | refs/heads/master | 2022-11-18T21:23:26.302125 | 2021-03-17T15:14:08 | 2021-03-17T15:14:08 | 245,970,279 | 0 | 0 | null | 2022-11-16T09:29:16 | 2020-03-09T07:30:51 | Java | UTF-8 | Java | false | false | 1,142 | java | package net.fluance.commons.lang;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
public class FluancePrintingMap<K, V> {
private Map<K, V> map;
public FluancePrintingMap(Map<K, V> map) {
this.map = map;
}
/**
* Returns a string representation of the Map
*/
@Override
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
Iterator<Entry<K, V>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
Entry<K, V> entry = iterator.next();
stringBuilder.append(entry.getKey());
stringBuilder.append('=');
if(entry.getValue() instanceof String[]){
String[] values = (String[]) entry.getValue();
stringBuilder.append("[");
for(int i=0; i<values.length; i++){
stringBuilder.append(values[i]);
if (i<values.length-1){
stringBuilder.append(',');
}
}
stringBuilder.append("]");
} else {
stringBuilder.append(entry.getValue());
}
if (iterator.hasNext()) {
stringBuilder.append(',').append(' ');
}
}
return stringBuilder.toString();
}
public Map<K, V> getMap(){
return this.map;
}
} | [
"[email protected]"
] | |
430cca8047a16bc9b57cc6dd3c48461dc17d3d4b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/20/20_db933908b999d47b84ac73d8e49eb1ae1fa504cb/MapControls/20_db933908b999d47b84ac73d8e49eb1ae1fa504cb_MapControls_s.java | b5cd9a5d228f6ecb321d7ca9d46510a95c6863b4 | [] | 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 | 9,418 | java | /**
* Copyright (C) 2002-2011 The FreeCol Team
*
* This file is part of FreeCol.
*
* FreeCol is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* FreeCol 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 FreeCol. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.freecol.client.gui.panel;
import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Action;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import net.sf.freecol.client.ClientOptions;
import net.sf.freecol.client.FreeColClient;
import net.sf.freecol.client.gui.Canvas;
import net.sf.freecol.client.gui.GUI;
import net.sf.freecol.client.gui.ViewMode;
import net.sf.freecol.client.gui.action.ActionManager;
import net.sf.freecol.client.gui.action.BuildColonyAction;
import net.sf.freecol.client.gui.action.DisbandUnitAction;
import net.sf.freecol.client.gui.action.FortifyAction;
import net.sf.freecol.client.gui.action.SentryAction;
import net.sf.freecol.client.gui.action.SkipUnitAction;
import net.sf.freecol.client.gui.action.WaitAction;
import net.sf.freecol.client.gui.panel.MapEditorTransformPanel.MapTransform;
import net.sf.freecol.common.model.Tile;
import net.sf.freecol.common.model.TileImprovementType;
import net.sf.freecol.common.model.Map.Direction;
import net.sf.freecol.common.resources.ResourceManager;
/**
* A collection of panels and buttons that are used to provide
* the user with a more detailed view of certain elements on the
* map and also to provide a means of input in case the user
* can't use the keyboard.
*
* The MapControls are useless by themselves, this object needs to
* be placed on a JComponent in order to be usable.
*/
public final class MapControls {
private final FreeColClient freeColClient;
private final InfoPanel infoPanel;
private final MiniMap miniMap;
private final List<UnitButton> unitButtons = new ArrayList<UnitButton>();
private final JLabel compassRose;
private static final int CONTROLS_LAYER = JLayeredPane.MODAL_LAYER;
/**
* The basic constructor.
* @param freeColClient The main controller object for the client
*/
public MapControls(final FreeColClient freeColClient) {
this.freeColClient = freeColClient;
//
// Create GUI Objects
//
infoPanel = new InfoPanel(freeColClient);
miniMap = new MiniMap(freeColClient);
compassRose = new JLabel(ResourceManager.getImageIcon("compass.image"));
updateUnitButtons();
//
// Don't allow them to gain focus
//
infoPanel.setFocusable(false);
miniMap.setFocusable(false);
compassRose.setFocusable(false);
compassRose.setSize(compassRose.getPreferredSize());
compassRose.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
int x = e.getX() - compassRose.getWidth()/2;
int y = e.getY() - compassRose.getHeight()/2;
double theta = Math.atan2(y, x) + Math.PI/2 + Math.PI/8;
if (theta < 0) {
theta += 2*Math.PI;
}
Direction direction = Direction.values()[(int) Math.floor(theta / (Math.PI/4))];
freeColClient.getInGameController().moveActiveUnit(direction);
}
});
}
public void updateUnitButtons() {
final ActionManager am = freeColClient.getActionManager();
unitButtons.clear();
unitButtons.add(new UnitButton(am.getFreeColAction(WaitAction.id)));
unitButtons.add(new UnitButton(am.getFreeColAction(SkipUnitAction.id)));
unitButtons.add(new UnitButton(am.getFreeColAction(SentryAction.id)));
unitButtons.add(new UnitButton(am.getFreeColAction(FortifyAction.id)));
for (TileImprovementType type : freeColClient.getGame().getSpecification()
.getTileImprovementTypeList()) {
if (!type.isNatural()) {
unitButtons.add(new UnitButton(am.getFreeColAction(type.getShortId() + "Action")));
}
}
unitButtons.add(new UnitButton(am.getFreeColAction(BuildColonyAction.id)));
unitButtons.add(new UnitButton(am.getFreeColAction(DisbandUnitAction.id)));
for (UnitButton button : unitButtons) {
button.setFocusable(false);
}
}
/**
* Updates this <code>InfoPanel</code>.
*
* @param mapTransform The current MapTransform.
*/
public void update(MapTransform mapTransform) {
if (infoPanel != null) {
infoPanel.update(mapTransform);
}
}
/**
* Adds the map controls to the given component.
* @param component The component to add the map controls to.
*/
public void addToComponent(Canvas component) {
if (freeColClient.getGame() == null
|| freeColClient.getGame().getMap() == null) {
return;
}
//
// Relocate GUI Objects
//
infoPanel.setLocation(component.getWidth() - infoPanel.getWidth(), component.getHeight() - infoPanel.getHeight());
miniMap.setLocation(0, component.getHeight() - miniMap.getHeight());
compassRose.setLocation(component.getWidth() - compassRose.getWidth() - 20, 20);
final int WIDTH = unitButtons.get(0).getWidth();
final int SPACE = 5;
int x = miniMap.getWidth() + 1 +
((infoPanel.getX() - miniMap.getWidth() -
unitButtons.size() * WIDTH -
(unitButtons.size() - 1) * SPACE - WIDTH) / 2);
int y = component.getHeight() - 40;
for (UnitButton button : unitButtons) {
button.setLocation(x, y);
x += (WIDTH + SPACE);
}
//
// Add the GUI Objects to the container
//
component.add(infoPanel, CONTROLS_LAYER, false);
component.add(miniMap, CONTROLS_LAYER, false);
if (freeColClient.getClientOptions().getBoolean(ClientOptions.DISPLAY_COMPASS_ROSE)) {
component.add(compassRose, CONTROLS_LAYER, false);
}
if (!freeColClient.isMapEditor()) {
for (UnitButton button : unitButtons) {
component.add(button, CONTROLS_LAYER, false);
Action a = button.getAction();
button.setAction(null);
button.setAction(a);
}
}
}
/**
* Returns the width of the InfoPanel.
*
* @return an <code>int</code> value
*/
public int getInfoPanelWidth() {
return infoPanel.getWidth();
}
/**
* Returns the height of the InfoPanel.
*
* @return an <code>int</code> value
*/
public int getInfoPanelHeight() {
return infoPanel.getHeight();
}
/**
* Removes the map controls from the parent canvas component.
*
* @param canvas <code>Canvas</code> parent
*/
public void removeFromComponent(Canvas canvas) {
canvas.remove(infoPanel, false);
canvas.remove(miniMap, false);
canvas.remove(compassRose, false);
for (UnitButton button : unitButtons) {
canvas.remove(button, false);
}
}
public boolean isShowing() {
return infoPanel.getParent() != null;
}
/**
* Zooms in the mini map.
*/
public void zoomIn() {
miniMap.zoomIn();
}
/**
* Zooms out the mini map.
*/
public void zoomOut() {
miniMap.zoomOut();
}
public boolean canZoomIn() {
return miniMap.canZoomIn();
}
public boolean canZoomOut() {
return miniMap.canZoomOut();
}
/**
*
* @param newColor
*/
public void changeBackgroundColor(Color newColor) {
miniMap.setBackgroundColor(newColor);
}
/**
* Updates this <code>MapControls</code>.
*/
public void update() {
GUI gui = freeColClient.getGUI();
int viewMode = gui.getViewMode().getView();
switch (viewMode) {
case ViewMode.MOVE_UNITS_MODE:
infoPanel.update(gui.getActiveUnit());
break;
case ViewMode.VIEW_TERRAIN_MODE:
if (gui.getSelectedTile() != null) {
Tile selectedTile = gui.getSelectedTile();
if (infoPanel.getTile() != selectedTile) {
infoPanel.update(selectedTile);
}
}
break;
}
}
}
| [
"[email protected]"
] | |
9f9d8b962a59858c66beaa75e3754a74382e88d9 | d5e36650e5c9dbd43e356dd3a52f410068389b4c | /src/main/java/org/cyberpwn/factionsplus/FA.java | 33ced29b02f8650607a402a770c521c55006eb22 | [] | no_license | cyberpwnn/FactionsPlus | 29cf680796a8a41267e2c1685b98525b3f08c13c | 92ec4c974f5834227c523bda2ac7d5bb5dde684f | refs/heads/master | 2021-01-19T10:54:54.979693 | 2016-11-23T09:15:36 | 2016-11-23T09:15:36 | 70,333,398 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,670 | java | package org.cyberpwn.factionsplus;
import java.util.HashSet;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.phantomapi.lang.GList;
import org.phantomapi.world.W;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.struct.Role;
public class FA
{
public static boolean isClaimed(Faction f)
{
return !f.isWilderness() && !f.isSafeZone() && !f.isWarZone();
}
public static boolean isWild(Faction f)
{
return f.isWilderness();
}
public static boolean isClaimed(Location l)
{
return isClaimed(getFaction(l));
}
public static boolean isClaimed(Chunk c)
{
return isClaimed(getFaction(c));
}
public static Faction getFaction(Player p)
{
return getFPlayer(p).getFaction();
}
public static FPlayer getFPlayer(Player p)
{
return FPlayers.getInstance().getByPlayer(p);
}
public static Faction getFaction(Location l)
{
return Board.getInstance().getFactionAt(new FLocation(l));
}
public static Faction getFaction(Chunk c)
{
return getFaction(c.getBlock(0, 0, 0).getLocation());
}
public static Chunk getChunk(FLocation fchunk)
{
return fchunk.getWorld().getChunkAt((int) fchunk.getX(), (int) fchunk.getZ());
}
public static FLocation getFLocation(Chunk c)
{
return new FLocation(c.getWorld().getName(), c.getX(), c.getZ());
}
public static GList<Chunk> getClaims(Player p)
{
return getClaims(getFaction(p));
}
public static boolean isOwnFaction(Player p, Chunk c)
{
return isClaimed(c) && getFaction(c).equals(getFaction(p));
}
public static boolean isOwner(Player p, Faction f)
{
return f.getFPlayerAdmin().getName().equals(p.getName());
}
public static boolean isOwner(Player p)
{
return isOwner(p, getFaction(p));
}
public static boolean isModerator(Player p)
{
return getFPlayer(p).getRole().equals(Role.MODERATOR);
}
public static boolean isAdmin(Player p)
{
return getFPlayer(p).getRole().equals(Role.ADMIN);
}
public static boolean isStaffed(Player p)
{
return isAdmin(p) || isModerator(p);
}
public static boolean isWithFaction(Player p, Faction f)
{
return getPlayers(f).contains(p);
}
public static GList<Chunk> getClaims(Faction f)
{
GList<Chunk> cx = new GList<Chunk>();
for(FLocation i : f.getAllClaims())
{
cx.add(getChunk(i));
}
return cx;
}
public static GList<Chunk> getClaims(Faction f, Location c, int rad)
{
GList<Chunk> cx = getClaims(f);
GList<Chunk> cs = W.chunkRadius(c.getChunk(), rad);
for(Chunk i : cx.copy())
{
if(!cs.contains(i))
{
cx.remove(i);
}
}
return cx;
}
public static GList<Player> getPlayers(Faction f)
{
GList<Player> p = new GList<Player>();
for(FPlayer i : f.getFPlayers())
{
if(i.isOnline())
{
p.add(i.getPlayer());
}
}
return p;
}
public static void addOwnership(Player p, Chunk c)
{
if(isOwnFaction(p, c))
{
FLocation l = getFLocation(c);
Faction f = getFaction(p);
if(!f.getClaimOwnership().containsKey(l))
{
f.getClaimOwnership().put(l, new HashSet<String>());
}
f.getClaimOwnership().get(l).add(p.getUniqueId().toString());
}
}
public static void removeOwnership(Player p, Chunk c)
{
if(isOwnFaction(p, c))
{
FLocation l = getFLocation(c);
Faction f = getFaction(p);
if(!f.getClaimOwnership().containsKey(l))
{
return;
}
f.getClaimOwnership().get(l).remove(p.getUniqueId().toString());
}
}
}
| [
"[email protected]"
] | |
8694ccee8b527f712c576a68cb5b57e603b90cd4 | ad1ec12f35deafff2a010b5fc4172d14d703e352 | /src/vaultPrograms/SortWithoutCollections_6.java | b20fb56197d1e04c715b7cfa795cdf81713933f1 | [] | no_license | PKavyaSri/JavaPrograms | b45f67a26ad127c3b765d49021057c6acf8c0227 | 3ba5e0e0d6ce65c65d3458bcc6e7f902078f82a6 | refs/heads/master | 2020-07-28T19:30:49.821798 | 2019-09-19T19:57:01 | 2019-09-19T19:57:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,076 | java | package vaultPrograms;
import java.util.Arrays;
public class SortWithoutCollections_6 {
public static void main(String[] args) {
// TODO Auto-generated method stub
/* int[] a= {2,7,5,1,0,9,6,3};
for(int i=0;i<a.length;i++)
{
for(int j=i+1;j<a.length;j++)
{
if(a[i]>a[j])
{
int temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
System.out.println(Arrays.toString(a));
}*/
//*****************DESCENDING ORDER****************
/* int[] a= {30,-1,9,0,4,22,11,6};
for(int i=0;i<a.length;i++)
{
for(int j=i+1;j<a.length;j++)
{
if(a[i]<a[j])
{
int temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
System.out.println(Arrays.toString(a));
}*/
//****************BUBBLE SORT ***************
int[] a= {3,1,5,0,9,4,7};
System.out.println(Arrays.toString(a));
for(int i=1;i<a.length;i++)
{
if(a[i]>a[i-1])
{
a[i]=a[i]+a[i-1];
a[i-1]=a[i]-a[i-1];
a[i]=a[i]-a[i-1];
i=0;
}
}
System.out.println(Arrays.copyOf(a,a.length));
}
} | [
"[email protected]"
] | |
8fb63a77831287feba00792798b42f85938a0ae9 | 758a627ad4de1ace49885034f08ba513beb69ed7 | /tirepressuremonitoringsystem/src/test/java/tddmicroexercises/tirepressuremonitoringsystem/sensor/TestSensor.java | 705d7cd73648dc9311083a4553e160a7cae6f69a | [] | no_license | sebastianstoelen/codingkatas | debf0b6db47a832d2ec8221f4cbc7e94cfaa13c0 | 8f28c02e438502795917933b824e163c793e0167 | refs/heads/master | 2020-03-07T10:14:55.049299 | 2018-04-21T09:33:49 | 2018-04-21T09:33:49 | 127,426,926 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package tddmicroexercises.tirepressuremonitoringsystem.sensor;
public class TestSensor implements Sensor{
private double returnValue;
public void setReturnValue(double returnValue){
this.returnValue = returnValue;
}
public double popNextPressurePsiValue() {
return returnValue;
}
}
| [
"[email protected]"
] | |
4e869415bbce2dd9457ad6b421868e9f93e86020 | 47f12e7cae2ef77e64dc2401effcc1af7e4f209b | /src/main/java/ge/idealab/kedi/security/oauth2/user/OAuth2UserInfoFactory.java | f2f8e9883fafd8e93d07081db3dbe4347fa2e837 | [] | no_license | geass94/kedi | 75b141fde66bd969202b02c9f935ef8ab21999d3 | 25a0d2565738f4e85b26bfde7e34a202d0ae2973 | refs/heads/master | 2020-04-18T02:31:41.572167 | 2019-04-04T17:45:00 | 2019-04-04T17:45:00 | 167,166,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 929 | java | package ge.idealab.kedi.security.oauth2.user;
import ge.idealab.kedi.exception.OAuth2AuthenticationProcessingException;
import ge.idealab.kedi.model.enums.AuthProvider;
import java.util.Map;
public class OAuth2UserInfoFactory {
public static OAuth2UserInfo getOAuth2UserInfo(String registrationId, Map<String, Object> attributes) {
if(registrationId.equalsIgnoreCase(AuthProvider.google.toString())) {
return new GoogleOAuth2UserInfo(attributes);
} else if (registrationId.equalsIgnoreCase(AuthProvider.facebook.toString())) {
return new FacebookOAuth2UserInfo(attributes);
} else if (registrationId.equalsIgnoreCase(AuthProvider.github.toString())) {
return new GithubOAuth2UserInfo(attributes);
} else {
throw new OAuth2AuthenticationProcessingException("Sorry! Login with " + registrationId + " is not supported yet.");
}
}
}
| [
"[email protected]"
] | |
f9e1b71e54eb4d4dd47447c40fb315a89238d886 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/plugin/favorite/d.java | 867fc950e775b8efadc8a57d0c6eaa9defec06b5 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 45,860 | java | package com.tencent.mm.plugin.favorite;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.SpannableString;
import android.widget.Toast;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.aw.e;
import com.tencent.mm.aw.f;
import com.tencent.mm.g.a.ld;
import com.tencent.mm.model.aw;
import com.tencent.mm.model.r;
import com.tencent.mm.model.s;
import com.tencent.mm.plugin.fav.a.i;
import com.tencent.mm.plugin.fav.a.m;
import com.tencent.mm.plugin.fav.a.m.a;
import com.tencent.mm.plugin.fav.a.m.b;
import com.tencent.mm.plugin.fav.ui.i.a;
import com.tencent.mm.plugin.messenger.foundation.a.a.h;
import com.tencent.mm.pluginsdk.ui.applet.g.a;
import com.tencent.mm.protocal.protobuf.aar;
import com.tencent.mm.protocal.protobuf.aas;
import com.tencent.mm.protocal.protobuf.aau;
import com.tencent.mm.protocal.protobuf.aay;
import com.tencent.mm.protocal.protobuf.aaz;
import com.tencent.mm.protocal.protobuf.abe;
import com.tencent.mm.protocal.protobuf.abf;
import com.tencent.mm.protocal.protobuf.abh;
import com.tencent.mm.protocal.protobuf.abl;
import com.tencent.mm.protocal.protobuf.abo;
import com.tencent.mm.protocal.protobuf.abs;
import com.tencent.mm.protocal.protobuf.abu;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.storage.bi.a;
import com.tencent.mm.ui.widget.a.c.a.b;
import com.tencent.mm.vfs.j;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public final class d
{
private static int[] mqq = { 2131822651, 2131822652, 2131822653, 2131822654, 2131822655 };
private static String H(com.tencent.mm.plugin.fav.a.g paramg)
{
Object localObject = null;
AppMethodBeat.i(20512);
if (paramg.field_favProto == null)
{
AppMethodBeat.o(20512);
paramg = localObject;
}
while (true)
{
return paramg;
if ((paramg.field_favProto.whA != null) && (!bo.isNullOrNil(paramg.field_favProto.whA.canvasPageXml)))
{
paramg = paramg.field_favProto.whA.canvasPageXml;
AppMethodBeat.o(20512);
}
else
{
paramg = paramg.field_favProto.wiv;
if ((paramg != null) && (paramg.size() == 1))
{
paramg = ((aar)paramg.get(0)).canvasPageXml;
AppMethodBeat.o(20512);
}
else
{
AppMethodBeat.o(20512);
paramg = localObject;
}
}
}
}
private static String I(com.tencent.mm.plugin.fav.a.g paramg)
{
Object localObject = null;
AppMethodBeat.i(20513);
if (paramg.field_favProto == null)
{
AppMethodBeat.o(20513);
paramg = localObject;
}
while (true)
{
return paramg;
if ((paramg.field_favProto.whA != null) && (!bo.isNullOrNil(paramg.field_favProto.whA.thumbUrl)))
{
paramg = paramg.field_favProto.whA.thumbUrl;
AppMethodBeat.o(20513);
}
else
{
paramg = paramg.field_favProto.wiv;
if ((paramg != null) && (paramg.size() == 1))
{
paramg = ((aar)paramg.get(0)).fgE;
AppMethodBeat.o(20513);
}
else
{
AppMethodBeat.o(20513);
paramg = localObject;
}
}
}
}
private static void a(Context paramContext, com.tencent.mm.plugin.fav.a.g paramg, boolean paramBoolean, abh paramabh)
{
AppMethodBeat.i(20509);
Intent localIntent = new Intent();
localIntent.putExtra("key_detail_info_id", paramg.field_localId);
localIntent.putExtra("show_share", paramBoolean);
localIntent.putExtra("prePublishId", "msgrecord_detail");
localIntent.putExtra("preChatTYPE", 15);
a(paramabh, localIntent);
i.el("FavRecordDetailUI", paramabh.cvF);
com.tencent.mm.bp.d.b(paramContext, "record", ".ui.FavRecordDetailUI", localIntent);
AppMethodBeat.o(20509);
}
private static void a(com.tencent.mm.plugin.fav.a.g paramg, abh paramabh, Intent paramIntent)
{
AppMethodBeat.i(20519);
a(paramabh, paramIntent);
paramIntent.putExtra("key_detail_info_id", paramg.field_localId);
AppMethodBeat.o(20519);
}
public static void a(g.a parama, Context paramContext, com.tencent.mm.plugin.fav.a.g paramg)
{
Object localObject1 = null;
Object localObject2 = null;
AppMethodBeat.i(20521);
if ((paramg == null) || (paramContext == null))
{
ab.w("MicroMsg.FavItemLogic", "getDisplayInfo favItemInfo is null");
AppMethodBeat.o(20521);
}
label32: aar localaar1;
label50: Object localObject3;
label53: Object localObject4;
while (true)
{
return;
localaar1 = com.tencent.mm.plugin.fav.a.b.c(paramg);
if (paramg == null)
{
ab.w("MicroMsg.FavItemLogic", "GetThumbUrlAndLocalPath favItemInfo is null");
localObject3 = null;
if (!(localObject3 instanceof String))
break label1413;
}
for (localObject3 = (String)localObject3; ; localObject3 = null)
{
localObject4 = paramg.field_favProto.whA;
switch (paramg.field_type)
{
case 3:
case 9:
case 10:
case 11:
case 12:
case 13:
case 15:
case 17:
default:
paramg = localObject2;
if (localObject4 != null)
{
paramg = localObject2;
if (!bo.isNullOrNil(((abu)localObject4).title))
paramg = ((abu)localObject4).title;
}
localObject3 = paramg;
if (bo.isNullOrNil(paramg))
localObject3 = localaar1.title;
parama.ajC(paramContext.getResources().getString(2131296527) + (String)localObject3);
AppMethodBeat.o(20521);
break label32;
aar localaar2 = com.tencent.mm.plugin.fav.a.b.c(paramg);
if (5 == paramg.field_type)
{
localObject3 = new com.tencent.mm.vfs.b(com.tencent.mm.plugin.fav.a.b.c(localaar2));
if (((com.tencent.mm.vfs.b)localObject3).exists())
{
localObject3 = j.w(((com.tencent.mm.vfs.b)localObject3).dMD());
break label53;
}
localObject3 = paramg.field_favProto.whA;
if (localObject3 == null);
for (localObject3 = null; ; localObject3 = ((abu)localObject3).thumbUrl)
{
localObject4 = localObject3;
if (bo.isNullOrNil((String)localObject3))
localObject4 = localaar2.cvq;
localObject4 = com.tencent.mm.plugin.fav.a.b.LD((String)localObject4);
localObject3 = localObject4;
if (!bo.isNullOrNil((String)localObject4))
break;
localObject3 = Integer.valueOf(2131230820);
break;
}
}
if ((11 == paramg.field_type) || (10 == paramg.field_type))
{
localObject3 = paramg.field_favProto.whC;
if (localObject3 != null)
{
localObject4 = com.tencent.mm.plugin.fav.a.b.LD(((abe)localObject3).thumbUrl);
localObject3 = localObject4;
if (!bo.isNullOrNil((String)localObject4))
break label53;
localObject3 = Integer.valueOf(2131230813);
break label53;
}
}
if ((15 == paramg.field_type) || (12 == paramg.field_type))
{
localObject3 = paramg.field_favProto.whE;
if (localObject3 != null)
{
localObject4 = com.tencent.mm.plugin.fav.a.b.LD(((abo)localObject3).thumbUrl);
localObject3 = localObject4;
if (!bo.isNullOrNil((String)localObject4))
break label53;
localObject3 = Integer.valueOf(2131230813);
break label53;
}
}
if ((2 == paramg.field_type) || (7 == paramg.field_type) || (16 == paramg.field_type) || (4 == paramg.field_type))
{
localObject3 = new com.tencent.mm.vfs.b(com.tencent.mm.plugin.fav.a.b.c(localaar2));
if (((com.tencent.mm.vfs.b)localObject3).exists())
{
localObject3 = j.w(((com.tencent.mm.vfs.b)localObject3).dMD());
break label53;
}
localObject3 = com.tencent.mm.plugin.fav.a.b.LD(localaar2.cvq);
localObject4 = localObject3;
if (bo.isNullOrNil((String)localObject3))
{
com.tencent.mm.plugin.fav.a.b.a(paramg, localaar2);
localObject4 = com.tencent.mm.plugin.fav.a.b.c(localaar2);
}
localObject3 = localObject4;
if (!bo.isNullOrNil((String)localObject4))
break label53;
}
switch (paramg.field_type)
{
default:
localObject3 = Integer.valueOf(2131230817);
break;
case 2:
localObject3 = Integer.valueOf(2130837705);
break;
case 7:
localObject3 = Integer.valueOf(2131230800);
break;
if ((3 == paramg.field_type) || (6 == paramg.field_type))
break label50;
if (8 == paramg.field_type)
{
localObject3 = Integer.valueOf(com.tencent.mm.pluginsdk.d.ail(localaar2.wgo));
break;
}
if (17 == paramg.field_type)
{
aw.ZK();
localObject3 = com.tencent.mm.model.c.XO().Rn(localaar2.desc);
if ((((bi.a)localObject3).svN != null) && (((bi.a)localObject3).svN.length() != 0))
{
localObject3 = new SpannableString(((bi.a)localObject3).svN);
break;
}
localObject3 = Integer.valueOf(2130838444);
break;
}
if ((14 != paramg.field_type) || (paramg.field_favProto.wiv == null))
break label50;
localObject3 = paramg.field_favProto.wiv.iterator();
do
{
do
{
if (!((Iterator)localObject3).hasNext())
break;
localaar2 = (aar)((Iterator)localObject3).next();
}
while (localaar2.dataType == 1);
if (localaar2.dataType == 3)
{
localObject3 = Integer.valueOf(2131230819);
break label53;
}
if (localaar2.dataType == 6)
{
localObject3 = Integer.valueOf(2131230798);
break label53;
}
if (localaar2.dataType == 8)
{
localObject3 = Integer.valueOf(com.tencent.mm.pluginsdk.d.ail(localaar2.wgo));
break label53;
}
if ((localaar2.dataType == 2) || (localaar2.dataType == 7) || (localaar2.dataType == 15) || (localaar2.dataType == 4))
{
localObject3 = new com.tencent.mm.vfs.b(com.tencent.mm.plugin.fav.a.b.c(localaar2));
if (((com.tencent.mm.vfs.b)localObject3).exists())
{
localObject3 = j.w(((com.tencent.mm.vfs.b)localObject3).dMD());
break label53;
}
localObject3 = com.tencent.mm.plugin.fav.a.b.LD(localaar2.cvq);
if (bo.isNullOrNil((String)localObject3))
switch (localaar2.dataType)
{
default:
localObject3 = Integer.valueOf(2131230817);
break;
case 2:
localObject3 = Integer.valueOf(2130837705);
break;
case 7:
localObject3 = Integer.valueOf(2131230800);
break;
}
break label53;
}
if (localaar2.dataType == 5)
{
localObject3 = new com.tencent.mm.vfs.b(com.tencent.mm.plugin.fav.a.b.c(localaar2));
if (((com.tencent.mm.vfs.b)localObject3).exists())
{
localObject3 = j.w(((com.tencent.mm.vfs.b)localObject3).dMD());
break label53;
}
localObject3 = localaar2.wgT.whA;
if (localObject3 == null);
for (localObject3 = null; ; localObject3 = ((abu)localObject3).thumbUrl)
{
localObject4 = localObject3;
if (bo.isNullOrNil((String)localObject3))
localObject4 = localaar2.cvq;
localObject4 = com.tencent.mm.plugin.fav.a.b.LD((String)localObject4);
localObject3 = localObject4;
if (!bo.isNullOrNil((String)localObject4))
break;
localObject3 = Integer.valueOf(2131230820);
break;
}
}
if ((localaar2.dataType == 10) || (localaar2.dataType == 11))
{
localObject4 = localaar2.wgT.whC;
if (localObject4 != null)
{
localObject4 = com.tencent.mm.plugin.fav.a.b.LD(((abe)localObject4).thumbUrl);
localObject3 = localObject4;
if (!bo.isNullOrNil((String)localObject4))
break label53;
localObject3 = Integer.valueOf(2131230813);
break label53;
}
}
if ((localaar2.dataType == 12) || (localaar2.dataType == 14))
{
localObject4 = localaar2.wgT.whE;
if (localObject4 != null)
{
localObject4 = com.tencent.mm.plugin.fav.a.b.LD(((abo)localObject4).thumbUrl);
localObject3 = localObject4;
if (!bo.isNullOrNil((String)localObject4))
break label53;
localObject3 = Integer.valueOf(2131230813);
break label53;
}
}
}
while (localaar2.dataType != 16);
aw.ZK();
localObject3 = com.tencent.mm.model.c.XO().Rn(localaar2.desc);
if ((((bi.a)localObject3).svN != null) && (((bi.a)localObject3).svN.length() != 0))
{
localObject3 = new SpannableString(((bi.a)localObject3).svN);
break;
}
localObject3 = Integer.valueOf(2130838444);
break;
label1413: if ((localObject3 instanceof Integer))
((Integer)localObject3).intValue();
break;
}
break;
case 8:
case 1:
case 6:
case 5:
case 14:
case 2:
case 16:
case 4:
case 18:
case 7:
}
}
localObject3 = paramg.field_favProto.title;
paramg = (com.tencent.mm.plugin.fav.a.g)localObject3;
if (bo.isNullOrNil((String)localObject3))
paramg = localaar1.title;
parama.ajC(paramContext.getResources().getString(2131296942) + paramg);
AppMethodBeat.o(20521);
continue;
parama.ajC(paramg.field_favProto.desc);
parama.djw();
parama.a(new d.2(paramg, paramContext));
AppMethodBeat.o(20521);
continue;
paramg = paramg.field_favProto.why;
parama.ajC(paramContext.getString(2131296967) + paramg.label);
AppMethodBeat.o(20521);
}
if ((localObject4 != null) && (!bo.isNullOrNil(((abu)localObject4).title)))
{
paramg = ((abu)localObject4).title;
localObject3 = ((abu)localObject4).desc;
}
while (true)
{
localObject4 = paramg;
if (bo.isNullOrNil(paramg))
localObject4 = localaar1.title;
bo.isNullOrNil((String)localObject3);
parama.ajC(paramContext.getResources().getString(2131297071) + (String)localObject4);
AppMethodBeat.o(20521);
break;
paramg = i.a.a(paramContext, paramg).title;
parama.ajC(paramContext.getResources().getString(2131297030) + paramg);
AppMethodBeat.o(20521);
break;
parama.b(com.tencent.mm.sdk.platformtools.d.aml((String)localObject3), 3);
AppMethodBeat.o(20521);
break;
parama.b(com.tencent.mm.sdk.platformtools.d.aml((String)localObject3), 2);
AppMethodBeat.o(20521);
break;
parama.b(com.tencent.mm.sdk.platformtools.d.aml((String)localObject3), 2);
AppMethodBeat.o(20521);
break;
localObject3 = paramContext.getResources().getString(2131296993);
paramContext = i.a.a(paramContext, paramg).desc.replaceAll("\n", " ");
parama.ajC((String)localObject3 + paramContext);
AppMethodBeat.o(20521);
break;
paramg = localObject1;
if (localObject4 != null)
{
paramg = localObject1;
if (!bo.isNullOrNil(((abu)localObject4).title))
paramg = ((abu)localObject4).title;
}
localObject3 = paramg;
if (bo.isNullOrNil(paramg))
localObject3 = localaar1.title;
parama.ajC(paramContext.getResources().getString(2131296980) + (String)localObject3);
AppMethodBeat.o(20521);
break;
localObject3 = null;
paramg = null;
}
}
private static void a(abh paramabh, Intent paramIntent)
{
AppMethodBeat.i(20520);
paramIntent.putExtra("key_detail_fav_scene", paramabh.scene);
paramIntent.putExtra("key_detail_fav_sub_scene", paramabh.jSW);
paramIntent.putExtra("key_detail_fav_index", paramabh.index);
paramIntent.putExtra("key_detail_fav_query", paramabh.query);
paramIntent.putExtra("key_detail_fav_sessionid", paramabh.cvF);
paramIntent.putExtra("key_detail_fav_tags", paramabh.mfg);
AppMethodBeat.o(20520);
}
private static boolean a(Context paramContext, aar paramaar, com.tencent.mm.plugin.fav.a.g paramg)
{
boolean bool = true;
AppMethodBeat.i(20516);
aau localaau = paramaar.wgZ;
if ((localaau == null) || (bo.isNullOrNil(localaau.fiG)))
{
AppMethodBeat.o(20516);
bool = false;
}
while (true)
{
return bool;
m.a(m.a.mfu, paramg);
String str = com.tencent.mm.plugin.fav.a.b.c(paramaar);
Intent localIntent = new Intent();
localIntent.putExtra("IsAd", false);
localIntent.putExtra("KStremVideoUrl", localaau.fiG);
localIntent.putExtra("StreamWording", localaau.fiJ);
localIntent.putExtra("StremWebUrl", localaau.fiK);
localIntent.putExtra("KThumUrl", localaau.fiL);
localIntent.putExtra("KSta_StremVideoAduxInfo", localaau.fiM);
localIntent.putExtra("KSta_StremVideoPublishId", localaau.fiN);
localIntent.putExtra("KSta_SourceType", 2);
localIntent.putExtra("KSta_Scene", m.b.mfE.value);
localIntent.putExtra("KSta_FromUserName", paramg.field_fromUser);
localIntent.putExtra("KSta_FavID", paramg.field_id);
localIntent.putExtra("KSta_SnsStatExtStr", paramaar.cMn);
localIntent.putExtra("KBlockFav", true);
localIntent.putExtra("KMediaId", "fakeid_" + paramg.field_id);
localIntent.putExtra("KThumbPath", str);
localIntent.putExtra("KMediaVideoTime", localaau.wid);
localIntent.putExtra("KMediaTitle", localaau.fiI);
com.tencent.mm.bp.d.b(paramContext, "sns", ".ui.VideoAdPlayerUI", localIntent);
AppMethodBeat.o(20516);
}
}
public static void b(Context paramContext, com.tencent.mm.plugin.fav.a.g paramg, abh paramabh)
{
AppMethodBeat.i(20508);
if (paramContext == null)
{
ab.w("MicroMsg.FavItemLogic", "Context is null");
AppMethodBeat.o(20508);
}
while (true)
{
return;
if (paramg == null)
{
ab.w("MicroMsg.FavItemLogic", "Fav item is null");
AppMethodBeat.o(20508);
}
else
{
ab.i("MicroMsg.FavItemLogic", "Handler favItemInfo id %d, type %d", new Object[] { Long.valueOf(paramg.field_localId), Integer.valueOf(paramg.field_type) });
switch (paramg.field_type)
{
case -1:
case 0:
case 9:
case 13:
default:
ab.w("MicroMsg.FavItemLogic", "Do not match any type %d", new Object[] { Integer.valueOf(paramg.field_type) });
case 1:
case 2:
case 3:
case 16:
case 4:
case 5:
case 6:
case 7:
case 8:
case 10:
case 12:
case 15:
case 11:
case 14:
case 17:
do
{
AppMethodBeat.o(20508);
break;
localObject1 = new Intent();
((Intent)localObject1).putExtra("key_detail_text", paramg.field_favProto.desc);
((Intent)localObject1).putExtra("key_detail_info_id", paramg.field_localId);
((Intent)localObject1).putExtra("key_detail_can_share_to_friend", paramg.but());
((Intent)localObject1).putExtra("key_detail_time", paramg.field_updateTime);
if (paramg.field_sourceCreateTime <= 0L);
for (long l = paramg.field_updateTime; ; l = paramg.field_sourceCreateTime)
{
((Intent)localObject1).putExtra("key_detail_create_time", l);
a(paramabh, (Intent)localObject1);
i.el("FavoriteTextDetailUI", paramabh.cvF);
com.tencent.mm.plugin.fav.a.b.b(paramContext, ".ui.detail.FavoriteTextDetailUI", (Intent)localObject1);
AppMethodBeat.o(20508);
break;
}
e(paramContext, paramg, paramabh);
AppMethodBeat.o(20508);
break;
localObject1 = new Intent();
a(paramg, paramabh, (Intent)localObject1);
((Intent)localObject1).putExtra("key_detail_create_time", paramg.field_favProto.wit.createTime);
i.el("FavoriteVoiceDetailUI", paramabh.cvF);
com.tencent.mm.plugin.fav.a.b.b(paramContext, ".ui.detail.FavoriteVoiceDetailUI", (Intent)localObject1);
AppMethodBeat.o(20508);
break;
localObject1 = com.tencent.mm.plugin.fav.a.b.c(paramg);
if ((localObject1 != null) && (((aar)localObject1).wgZ != null) && ((!bo.isNullOrNil(((aar)localObject1).wgZ.fiG)) || (!bo.isNullOrNil(((aar)localObject1).wgZ.fiK))))
{
ab.i("MicroMsg.FavItemLogic", "it is ad sight.");
c(paramContext, paramg, paramabh);
AppMethodBeat.o(20508);
break;
}
d(paramContext, paramg, paramabh);
AppMethodBeat.o(20508);
break;
d(paramContext, paramg, paramabh);
AppMethodBeat.o(20508);
break;
d(paramContext, paramg, true, paramabh);
AppMethodBeat.o(20508);
break;
Object localObject2 = paramg.field_favProto.why;
Object localObject3 = paramg.field_favProto.hHV;
localObject1 = paramg.field_favProto.wit;
if ((localObject1 != null) && (!bo.isNullOrNil(((abl)localObject1).whU)));
for (localObject1 = s.mJ(((abl)localObject1).whU); ; localObject1 = s.mJ(paramg.field_fromUser))
{
ArrayList localArrayList = new ArrayList();
if (paramg.field_tagProto.wiJ != null)
localArrayList.addAll(paramg.field_tagProto.wiJ);
i.el("RedirectUI", paramabh.cvF);
com.tencent.mm.plugin.fav.a.b.a(paramg.field_localId, (aay)localObject2, (String)localObject1, (String)localObject3, localArrayList, paramContext);
AppMethodBeat.o(20508);
break;
}
localObject3 = paramg.field_favProto.wit;
localObject2 = com.tencent.mm.plugin.fav.a.b.c(paramg);
localObject1 = new com.tencent.mm.vfs.b(com.tencent.mm.plugin.fav.a.b.c((aar)localObject2));
if (!((com.tencent.mm.vfs.b)localObject1).exists())
if (((aar)localObject2).cvq == null)
{
localObject1 = "";
localObject1 = f.a(6, null, ((aar)localObject2).title, ((aar)localObject2).desc, ((aar)localObject2).wgg, ((aar)localObject2).wgk, ((aar)localObject2).wgi, ((aar)localObject2).mnd, com.tencent.mm.plugin.fav.a.b.bul(), (String)localObject1, "", ((abl)localObject3).appId);
if (com.tencent.mm.plugin.fav.a.b.e((aar)localObject2))
break label893;
ab.i("MicroMsg.FavItemLogic", " start play music");
com.tencent.mm.aw.a.b((e)localObject1);
}
while (true)
{
((e)localObject1).fKs = String.valueOf(paramg.field_localId);
paramg = new Intent();
paramg.putExtra("key_scene", 2);
i.el("MusicMainUI", paramabh.cvF);
com.tencent.mm.bp.d.b(paramContext, "music", ".ui.MusicMainUI", paramg);
AppMethodBeat.o(20508);
break;
localObject1 = new com.tencent.mm.vfs.b(com.tencent.mm.plugin.fav.a.b.bue() + com.tencent.mm.a.g.x(((aar)localObject2).cvq.getBytes()));
if (((com.tencent.mm.vfs.b)localObject1).exists());
for (localObject1 = j.w(((com.tencent.mm.vfs.b)localObject1).dMD()); ; localObject1 = "")
break;
localObject1 = j.w(((com.tencent.mm.vfs.b)localObject1).dMD());
break label692;
ab.i("MicroMsg.FavItemLogic", "The music is playing, don't start play again");
}
c(paramContext, paramg, true, paramabh);
AppMethodBeat.o(20508);
break;
ab.d("MicroMsg.FavItemLogic", "start product ui, fav id %d, fav local id %d", new Object[] { Integer.valueOf(paramg.field_id), Long.valueOf(paramg.field_localId) });
l = paramg.field_localId;
paramg = paramg.field_favProto.whC.info;
paramabh = new Intent();
paramabh.putExtra("key_is_favorite_item", true);
paramabh.putExtra("key_favorite_local_id", l);
paramabh.putExtra("key_Product_xml", paramg);
paramabh.putExtra("key_can_delete_favorite_item", true);
paramabh.putExtra("key_ProductUI_getProductInfoScene", 3);
com.tencent.mm.bp.d.b(paramContext, "scanner", ".ui.ProductUI", paramabh);
AppMethodBeat.o(20508);
break;
ab.d("MicroMsg.FavItemLogic", "start tv ui, fav id %d, fav local id %d", new Object[] { Integer.valueOf(paramg.field_id), Long.valueOf(paramg.field_localId) });
l = paramg.field_localId;
paramg = paramg.field_favProto.whE.info;
paramabh = new Intent();
paramabh.putExtra("key_TV_getProductInfoScene", 3);
paramabh.putExtra("key_is_favorite_item", true);
paramabh.putExtra("key_favorite_local_id", l);
paramabh.putExtra("key_TV_xml", paramg);
paramabh.putExtra("key_can_delete_favorite_item", true);
com.tencent.mm.bp.d.b(paramContext, "shake", ".ui.TVInfoUI", paramabh);
AppMethodBeat.o(20508);
break;
ab.d("MicroMsg.FavItemLogic", "start product ui, fav id %d, fav local id %d", new Object[] { Integer.valueOf(paramg.field_id), Long.valueOf(paramg.field_localId) });
paramabh = new Intent();
paramabh.putExtra("key_product_scene", 4);
paramabh.putExtra("key_product_info", paramg.field_favProto.whC.info);
com.tencent.mm.bp.d.b(paramContext, "product", ".ui.MallProductUI", paramabh);
AppMethodBeat.o(20508);
break;
a(paramContext, paramg, true, paramabh);
AppMethodBeat.o(20508);
break;
paramg = com.tencent.mm.plugin.fav.a.b.c(paramg).desc;
aw.ZK();
paramg = com.tencent.mm.model.c.XO().Rn(paramg);
}
while (paramg == null);
Object localObject1 = new Intent();
((Intent)localObject1).putExtra("Contact_User", paramg.svN);
((Intent)localObject1).putExtra("Contact_Alias", paramg.dFl);
((Intent)localObject1).putExtra("Contact_Nick", paramg.nickname);
((Intent)localObject1).putExtra("Contact_QuanPin", paramg.gwG);
((Intent)localObject1).putExtra("Contact_PyInitial", paramg.gwF);
((Intent)localObject1).putExtra("Contact_Uin", paramg.pnz);
((Intent)localObject1).putExtra("Contact_Mobile_MD5", paramg.xZi);
((Intent)localObject1).putExtra("Contact_full_Mobile_MD5", paramg.xZj);
((Intent)localObject1).putExtra("Contact_QQNick", paramg.dtZ());
((Intent)localObject1).putExtra("User_From_Fmessage", false);
((Intent)localObject1).putExtra("Contact_Scene", paramg.scene);
((Intent)localObject1).putExtra("Contact_FMessageCard", true);
((Intent)localObject1).putExtra("Contact_RemarkName", paramg.gwK);
((Intent)localObject1).putExtra("Contact_VUser_Info_Flag", paramg.ufB);
((Intent)localObject1).putExtra("Contact_VUser_Info", paramg.duh);
((Intent)localObject1).putExtra("Contact_BrandIconURL", paramg.pln);
((Intent)localObject1).putExtra("Contact_Province", paramg.getProvince());
((Intent)localObject1).putExtra("Contact_City", paramg.getCity());
((Intent)localObject1).putExtra("Contact_Sex", paramg.dtS);
((Intent)localObject1).putExtra("Contact_Signature", paramg.signature);
((Intent)localObject1).putExtra("Contact_ShowUserName", false);
((Intent)localObject1).putExtra("Contact_KSnsIFlag", 0);
i.el("ContactInfoUI", paramabh.cvF);
com.tencent.mm.bp.d.b(paramContext, "profile", ".ui.ContactInfoUI", (Intent)localObject1);
com.tencent.mm.bq.a.Lu(paramg.scene);
AppMethodBeat.o(20508);
break;
case 18:
b(paramContext, paramg, true, paramabh);
AppMethodBeat.o(20508);
break;
case -2:
label692: label893: Toast.makeText(paramContext, 2131299758, 0).show();
AppMethodBeat.o(20508);
}
}
}
}
private static void b(Context paramContext, com.tencent.mm.plugin.fav.a.g paramg, boolean paramBoolean, abh paramabh)
{
AppMethodBeat.i(20510);
ab.i("MicroMsg.FavItemLogic", "click WNNoteItem, handleWNNoteItem");
ld localld = new ld();
localld.cGU.field_localId = paramg.field_localId;
if (paramg.field_localId == -1L)
localld.cGU.cHa = 4;
while (true)
{
localld.cGU.context = paramContext;
paramContext = new Bundle();
aaz localaaz = paramg.field_favProto.vzK;
if (localaaz != null)
{
paramContext.putString("noteauthor", localaaz.wim);
paramContext.putString("noteeditor", localaaz.win);
}
paramContext.putLong("edittime", paramg.field_updateTime);
localld.cGU.cGZ = paramContext;
localld.cGU.field_favProto = paramg.field_favProto;
localld.cGU.type = 2;
localld.cGU.cHc = paramBoolean;
localld.cGU.cHd = paramabh;
com.tencent.mm.sdk.b.a.xxA.m(localld);
i.el("NoteEditorUI", paramabh.cvF);
AppMethodBeat.o(20510);
return;
localld.cGU.cGW = paramg.field_xml;
}
}
public static void b(g.a parama, final Context paramContext, final com.tencent.mm.plugin.fav.a.g paramg)
{
AppMethodBeat.i(20522);
if ((paramg == null) || (paramContext == null))
{
ab.w("MicroMsg.FavItemLogic", "getDisplayInfo favItemInfo is null");
AppMethodBeat.o(20522);
return;
}
final aar localaar = com.tencent.mm.plugin.fav.a.b.c(paramg);
switch (paramg.field_type)
{
case 3:
case 7:
case 9:
case 10:
case 11:
case 12:
case 13:
case 15:
case 17:
default:
case 8:
case 1:
case 6:
case 5:
case 14:
case 2:
case 4:
case 16:
case 18:
}
while (true)
{
AppMethodBeat.o(20522);
break;
parama.a(new d.3(paramContext, paramg));
AppMethodBeat.o(20522);
break;
parama.a(new d.4(paramg, paramContext));
AppMethodBeat.o(20522);
break;
parama.a(new c.a.b()
{
public final void bwF()
{
AppMethodBeat.i(20503);
Intent localIntent = new Intent();
localIntent.putExtra("map_view_type", 1);
localIntent.putExtra("kwebmap_slat", this.mqr.lat);
localIntent.putExtra("kwebmap_lng", this.mqr.lng);
localIntent.putExtra("Kwebmap_locaion", this.mqr.label);
localIntent.putExtra("kShowshare", false);
com.tencent.mm.bp.d.b(paramContext, "location", ".ui.RedirectUI", localIntent);
AppMethodBeat.o(20503);
}
});
AppMethodBeat.o(20522);
break;
parama.a(new c.a.b()
{
public final void bwF()
{
AppMethodBeat.i(20504);
d.g(this.val$context, paramg, new abh());
AppMethodBeat.o(20504);
}
});
AppMethodBeat.o(20522);
break;
parama.a(new c.a.b()
{
public final void bwF()
{
AppMethodBeat.i(20505);
d.h(this.val$context, paramg, new abh());
AppMethodBeat.o(20505);
}
});
AppMethodBeat.o(20522);
break;
parama.a(new c.a.b()
{
public final void bwF()
{
AppMethodBeat.i(20506);
Intent localIntent = new Intent();
localIntent.putExtra("key_detail_info_id", this.meI.field_localId);
localIntent.putExtra("key_detail_data_id", localaar.mnd);
localIntent.putExtra("show_share", false);
com.tencent.mm.plugin.fav.a.b.b(paramContext, ".ui.FavImgGalleryUI", localIntent);
AppMethodBeat.o(20506);
}
});
AppMethodBeat.o(20522);
break;
parama.a(new d.9(paramg, paramContext));
AppMethodBeat.o(20522);
break;
parama.a(new d.1(paramContext, paramg));
}
}
private static void c(Context paramContext, com.tencent.mm.plugin.fav.a.g paramg, abh paramabh)
{
AppMethodBeat.i(20515);
m.a(m.a.mfs, paramg);
Intent localIntent = new Intent();
localIntent.putExtra("key_detail_info_id", paramg.field_localId);
a(paramabh, localIntent);
com.tencent.mm.plugin.fav.a.b.b(paramContext, ".ui.detail.FavoriteSightDetailUI", localIntent);
AppMethodBeat.o(20515);
}
private static void c(Context paramContext, com.tencent.mm.plugin.fav.a.g paramg, boolean paramBoolean, abh paramabh)
{
AppMethodBeat.i(20511);
Object localObject = com.tencent.mm.plugin.fav.a.b.c(paramg);
if ((paramabh != null) && (paramabh.cOi == 1))
{
localObject = new Intent();
((Intent)localObject).putExtra("key_detail_info_id", paramg.field_localId);
((Intent)localObject).putExtra("key_detail_open_way", true);
((Intent)localObject).putExtra("show_share", paramBoolean);
a(paramabh, (Intent)localObject);
i.el("FavoriteFileDetailUI", paramabh.cvF);
com.tencent.mm.plugin.fav.a.b.b(paramContext, ".ui.detail.FavoriteFileDetailUI", (Intent)localObject);
AppMethodBeat.o(20511);
}
while (true)
{
return;
if ((paramabh != null) && (paramabh.cOi == 2))
{
com.tencent.mm.pluginsdk.ui.tools.a.b((Activity)paramContext, com.tencent.mm.plugin.fav.a.b.b((aar)localObject), ((aar)localObject).wgo, 2);
AppMethodBeat.o(20511);
}
else if (com.tencent.mm.plugin.fav.a.b.f((aar)localObject))
{
if (com.tencent.mm.plugin.fav.a.b.g((aar)localObject))
{
e(paramContext, paramg, paramabh);
AppMethodBeat.o(20511);
}
else if (!com.tencent.mm.pluginsdk.ui.tools.a.M(com.tencent.mm.plugin.fav.a.b.b((aar)localObject), ((aar)localObject).wgo, 2))
{
AppMethodBeat.o(20511);
}
}
else
{
localObject = new Intent();
((Intent)localObject).putExtra("key_detail_info_id", paramg.field_localId);
((Intent)localObject).putExtra("show_share", paramBoolean);
a(paramabh, (Intent)localObject);
i.el("FavoriteFileDetailUI", paramabh.cvF);
com.tencent.mm.plugin.fav.a.b.b(paramContext, ".ui.detail.FavoriteFileDetailUI", (Intent)localObject);
AppMethodBeat.o(20511);
}
}
}
private static void d(Context paramContext, com.tencent.mm.plugin.fav.a.g paramg, abh paramabh)
{
AppMethodBeat.i(20517);
aar localaar = com.tencent.mm.plugin.fav.a.b.c(paramg);
if (a(paramContext, localaar, paramg))
AppMethodBeat.o(20517);
while (true)
{
return;
Object localObject2;
if ((bo.isNullOrNil(localaar.wgq)) || (localaar.wgu <= 0L))
{
ab.w("MicroMsg.FavItemLogic", "full md5[%s], fullsize[%d], start use url", new Object[] { localaar.wgq, Long.valueOf(localaar.wgu) });
Object localObject1 = com.tencent.mm.plugin.fav.a.b.c(paramg).wgg;
localObject2 = localObject1;
if (bo.isNullOrNil((String)localObject1))
localObject2 = com.tencent.mm.plugin.fav.a.b.c(paramg).wgk;
if (bo.isNullOrNil((String)localObject2))
{
ab.w("MicroMsg.FavItemLogic", "onClick video url null, return");
c(paramContext, paramg, paramabh);
AppMethodBeat.o(20517);
}
else
{
paramabh = new Intent();
localObject1 = new Bundle();
((Bundle)localObject1).putString("key_snsad_statextstr", localaar.cMn);
((Bundle)localObject1).putLong("favlocalid", paramg.field_localId);
paramabh.putExtra("jsapiargs", (Bundle)localObject1);
paramabh.putExtra("rawUrl", (String)localObject2);
paramabh.putExtra("is_favorite_item", true);
paramabh.putExtra("fav_local_id", paramg.field_localId);
paramabh.putExtra("geta8key_scene", 14);
ab.d("MicroMsg.FavItemLogic", "start video webview, fav id %d, fav local id %d", new Object[] { Integer.valueOf(paramg.field_id), Long.valueOf(paramg.field_localId) });
paramabh.putExtra("geta8key_scene", 14);
com.tencent.mm.bp.d.b(paramContext, "webview", ".ui.tools.WebViewUI", paramabh);
AppMethodBeat.o(20517);
}
}
else
{
localObject2 = new Intent();
a(paramg, paramabh, (Intent)localObject2);
i.el("FavoriteSightDetailUI", paramabh.cvF);
com.tencent.mm.plugin.fav.a.b.b(paramContext, ".ui.detail.FavoriteSightDetailUI", (Intent)localObject2);
AppMethodBeat.o(20517);
}
}
}
private static void d(Context paramContext, com.tencent.mm.plugin.fav.a.g paramg, boolean paramBoolean, abh paramabh)
{
AppMethodBeat.i(20514);
Object localObject1 = H(paramg);
if (!bo.isNullOrNil((String)localObject1))
{
paramabh = new Intent();
paramabh.putExtra("sns_landing_pages_xml", (String)localObject1);
paramabh.putExtra("sns_landig_pages_from_source", 7);
paramabh.putExtra("sns_landing_pages_share_thumb_url", I(paramg));
paramabh.putExtra("sns_landing_favid", r.Yz() + "_" + paramg.field_id);
paramabh.addFlags(268435456);
com.tencent.mm.bp.d.b(paramContext, "sns", ".ui.SnsAdNativeLandingPagesPreviewUI", paramabh);
AppMethodBeat.o(20514);
}
while (true)
{
return;
abl localabl = paramg.field_favProto.wit;
Object localObject2 = "";
localObject1 = "";
Object localObject3 = "";
if (paramg.field_favProto.whA != null)
{
localObject3 = paramg.field_favProto.whA;
localObject2 = ((abu)localObject3).wiY;
localObject1 = ((abu)localObject3).title;
localObject3 = ((abu)localObject3).desc;
}
Object localObject4 = localObject2;
if (localabl != null)
{
localObject4 = localObject2;
if (bo.isNullOrNil((String)localObject2))
localObject4 = localabl.link;
}
if (bo.isNullOrNil((String)localObject4))
{
AppMethodBeat.o(20514);
}
else
{
aar localaar = com.tencent.mm.plugin.fav.a.b.c(paramg);
Object localObject5 = localObject1;
Object localObject6 = localObject3;
if (localaar != null)
{
localObject2 = localObject1;
if (bo.isNullOrNil((String)localObject1))
localObject2 = localaar.title;
localObject5 = localObject2;
localObject6 = localObject3;
if (bo.isNullOrNil((String)localObject3))
{
localObject6 = localaar.desc;
localObject5 = localObject2;
}
}
ab.d("MicroMsg.FavItemLogic", "start web view, fav id %d, fav local id %d", new Object[] { Integer.valueOf(paramg.field_id), Long.valueOf(paramg.field_localId) });
localObject1 = new Intent();
((Intent)localObject1).putExtra("rawUrl", (String)localObject4);
((Intent)localObject1).putExtra("showShare", paramBoolean);
((Intent)localObject1).putExtra("is_favorite_item", true);
((Intent)localObject1).putExtra("fav_local_id", paramg.field_localId);
((Intent)localObject1).putExtra("favorite_control_argument", paramg.buv());
((Intent)localObject1).putExtra("sentUsername", paramg.field_fromUser);
if ((localabl != null) && (!bo.isNullOrNil(localabl.csl)))
((Intent)localObject1).putExtra("srcDisplayname", s.mJ(localabl.csl));
((Intent)localObject1).putExtra("mode", 1);
((Intent)localObject1).putExtra("geta8key_scene", 14);
localObject3 = new Bundle();
((Bundle)localObject3).putString("key_snsad_statextstr", com.tencent.mm.plugin.fav.a.b.c(paramg).cMn);
((Bundle)localObject3).putLong("favlocalid", paramg.field_localId);
((Intent)localObject1).putExtra("jsapiargs", (Bundle)localObject3);
((Intent)localObject1).putExtra("from_scence", 4);
localObject3 = "fav_" + r.Yz() + "_" + paramg.field_id;
((Intent)localObject1).putExtra("KPublisherId", (String)localObject3);
((Intent)localObject1).putExtra("pre_username", paramg.field_fromUser);
((Intent)localObject1).putExtra("prePublishId", (String)localObject3);
((Intent)localObject1).putExtra("preChatTYPE", 14);
((Intent)localObject1).putExtra("share_report_pre_msg_url", (String)localObject4);
((Intent)localObject1).putExtra("share_report_pre_msg_title", localObject5);
((Intent)localObject1).putExtra("share_report_pre_msg_desc", (String)localObject6);
((Intent)localObject1).putExtra("share_report_pre_msg_icon_url", I(paramg));
((Intent)localObject1).putExtra("share_report_pre_msg_appid", "");
((Intent)localObject1).putExtra("share_report_from_scene", 4);
localObject3 = com.tencent.mm.modelstat.a.c.tL(com.tencent.mm.pluginsdk.model.d.class.getName());
((Bundle)localObject3).putInt("mm_rpt_fav_id", paramg.field_id);
((Bundle)localObject3).putInt("key_detail_fav_scene", paramabh.scene);
((Bundle)localObject3).putInt("key_detail_fav_sub_scene", paramabh.jSW);
((Bundle)localObject3).putInt("key_detail_fav_index", paramabh.index);
((Bundle)localObject3).putString("key_detail_fav_query", paramabh.query);
((Bundle)localObject3).putString("key_detail_fav_sessionid", paramabh.cvF);
((Bundle)localObject3).putString("key_detail_fav_tags", paramabh.mfg);
i.el("WebViewUI", paramabh.cvF);
((Intent)localObject1).putExtra("mm_report_bundle", (Bundle)localObject3);
((Intent)localObject1).putExtra("geta8key_scene", 14);
com.tencent.mm.bp.d.b(paramContext, "webview", ".ui.tools.WebViewUI", (Intent)localObject1);
AppMethodBeat.o(20514);
}
}
}
private static void e(Context paramContext, com.tencent.mm.plugin.fav.a.g paramg, abh paramabh)
{
AppMethodBeat.i(20518);
Intent localIntent = new Intent();
a(paramg, paramabh, localIntent);
i.el("FavoriteImgDetailUI", paramabh.cvF);
com.tencent.mm.plugin.fav.a.b.b(paramContext, ".ui.detail.FavoriteImgDetailUI", localIntent);
AppMethodBeat.o(20518);
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes7-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.favorite.d
* JD-Core Version: 0.6.2
*/ | [
"[email protected]"
] | |
b7576bc1483482101be931852d1252a4834c7415 | 3aecf26d933667423bd6ed44f0895c36a9d77eb5 | /java/ruby/bamboo/enchant/SilkTouch.java | 95ed26c4bdef83a1788572a61817ef7101fb278d | [] | no_license | rubnsn/mcmod18x | 74ace10554908217e37730a9c67463f9eb224177 | c9532cc1c4d38a5c5b2e6cc2e304cf87cfd994d9 | refs/heads/master | 2020-12-24T06:23:43.896601 | 2019-04-07T12:58:02 | 2019-04-07T12:58:02 | 31,073,624 | 2 | 8 | null | 2017-01-03T02:32:00 | 2015-02-20T16:32:52 | Java | UTF-8 | Java | false | false | 292 | java | package ruby.bamboo.enchant;
public class SilkTouch extends EnchantBase {
public SilkTouch(int id, String name) {
super(id, name);
}
@Override
public int getRarity() {
return 10;
}
@Override
public int getMaxLevel() {
return 1;
}
}
| [
"[email protected]"
] | |
af72221717a13b4dab227ee429367ff54a3a3769 | f436ba4c05f3217c6e6f9e69cbe916b0b4de2310 | /source/spiralcraft/data/query/SetFilter.java | bfe9a55e598eafdaf78d0628ab7d716b3de13ca1 | [] | no_license | Spiralcraft/core | 0884fbaa790a1cb4260cc78766b083f873074585 | 94da8d1739238fe02d558d7e2c5073505551c451 | refs/heads/master | 2022-04-27T12:37:58.465986 | 2022-04-13T00:53:02 | 2022-04-13T00:53:02 | 17,853,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,424 | java | //
// Copyright (c) 2009 Michael Toth
// Spiralcraft Inc., All Rights Reserved
//
// This package is part of the Spiralcraft project and is licensed under
// a multiple-license framework.
//
// You may not use this file except in compliance with the terms found in the
// SPIRALCRAFT-LICENSE.txt file at the top of this distribution, or available
// at http://www.spiralcraft.org/licensing/SPIRALCRAFT-LICENSE.txt.
//
// Unless otherwise agreed to in writing, this software is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
//
package spiralcraft.data.query;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import spiralcraft.lang.Expression;
import spiralcraft.lang.Focus;
import spiralcraft.lang.Channel;
import spiralcraft.lang.BindException;
import spiralcraft.lang.IterationDecorator;
import spiralcraft.lang.TeleFocus;
//import spiralcraft.lang.parser.CurrentFocusNode;
//import spiralcraft.lang.parser.Node;
//import spiralcraft.lang.parser.ParentFocusNode;
//import spiralcraft.log.ClassLog;
import spiralcraft.log.Level;
import spiralcraft.data.DataException;
import spiralcraft.data.Tuple;
import spiralcraft.data.FieldSet;
import spiralcraft.data.Type;
import spiralcraft.data.access.ScrollableCursor;
import spiralcraft.data.access.SerialCursor;
/**
* <p>A Query operation which constrains the result of a source Query by
* testing a function of the result for inclusion in a set that is
* constant over the source result.
* </p>
*
* <p>The set is hash-indexed for a constant-time filter comparison
* </p>
*/
public class SetFilter<T>
extends Query
{
// private static final ClassLog log
// =ClassLog.getInstance(SetFilter.class);
private Expression<?> filterSetX;
private Expression<T> searchX;
private boolean excludeMatch;
{ mergeable=true;
}
public SetFilter()
{
}
/**
* Construct a Selection which reads data from the specified source Query and filters
* data according to the specified constraints expression.
*/
public SetFilter(Query source,Expression<?> filterSetX,Expression<T> searchX)
{
this.filterSetX=filterSetX;
this.searchX=searchX;
setSource(source);
}
@Override
public FieldSet getFieldSet()
{
if (sources.size()>0)
{ return sources.get(0).getFieldSet();
}
else
{ return null;
}
}
public SetFilter
(Selection baseQuery
,Expression<?> filterSetX
,Expression<T> searchX
)
{
super(baseQuery);
this.filterSetX=filterSetX;
this.searchX=searchX;
}
/**
* Specify the Expression which resolves to the set (something that can be
* iterated) that is used to filter the results.
*/
public void setFilterSetX(Expression<?> filterSetX)
{ this.filterSetX=filterSetX;
}
/**
* The Expression which resolves the value to search for within the set,
* as a function of the source tuple.
*
* @param searchX
*/
public void setSearchX(Expression<T> searchX)
{ this.searchX=searchX;
}
public void setSource(Query source)
{
type=source.getType();
addSource(source);
}
/**
*@return the Expression which resolves to the set
*/
public Expression<?> getFilterSetX()
{ return filterSetX;
}
/**
*@return the Expression which resolves the value to search for within the
* set, as a function of the source tuple.
*/
public Expression<T> getSearchX()
{ return searchX;
}
/**
* Specify that when the search value is found in the set, exclude the Tuple
* from the result instead of including it. Defaults to false.
*
* @param excludeMatch
*/
public void setExcludeMatch(boolean excludeMatch)
{ this.excludeMatch=excludeMatch;
}
public boolean getExcludeMatch()
{ return this.excludeMatch;
}
@Override
public <X extends Tuple> BoundQuery<?,X>
getDefaultBinding(Focus<?> focus,Queryable<?> store)
throws DataException
{ return new SetFilterBinding<T,X>(this,focus,store);
}
// private boolean referencesCurrentFocus(Node node)
// {
// if (node instanceof CurrentFocusNode)
// { return true;
// }
// if (node instanceof ParentFocusNode)
// { return false;
// }
//
// Node[] children=node.getSources();
// if (children!=null)
// {
// for (Node child:children)
// {
// if (child==null)
// { log.warning(node+" returned null child");
// }
// else if (referencesCurrentFocus(child))
// { return true;
// }
// }
// }
// return false;
// }
@Override
public String toString()
{ return super.toString()
+"[constraints="+filterSetX+"]: sources="
+getSources().toString();
}
}
class SetFilterBinding<Ti,Tt extends Tuple>
extends UnaryBoundQuery<SetFilter<Ti>,Tt,Tt>
{
private Focus<Tt> focus;
private IterationDecorator<?,Ti> decorator;
private Channel<Ti> searchChannel;
private boolean resolved;
private boolean excludeMatch;
public SetFilterBinding
(SetFilter<Ti> query
,Focus<?> paramFocus
,Queryable<?> store
)
throws DataException
{
super(query,query.getSources(),paramFocus,store);
this.excludeMatch=getQuery().getExcludeMatch();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void resolve() throws DataException
{
if (!resolved)
{
super.resolve();
try
{
Channel<?> setChannel=paramFocus.bind(getQuery().getFilterSetX());
decorator=setChannel.<IterationDecorator>decorate(IterationDecorator.class);
if (debugLevel.canLog(Level.FINE))
{ setChannel.setDebug(true);
}
}
catch (BindException x)
{ throw new DataException("Error binding searchX "+x,x);
}
focus= new TeleFocus<Tt>(paramFocus,sourceChannel);
if (debugLevel.canLog(Level.DEBUG))
{ log.fine("Binding searchX "+getQuery().getSearchX());
}
try
{
searchChannel=focus.bind(getQuery().getSearchX());
if (debugLevel.canLog(Level.FINE))
{ searchChannel.setDebug(true);
}
}
catch (BindException x)
{ throw new DataException("Error binding searchX "+x,x);
}
resolved=true;
}
}
@Override
protected SerialCursor<Tt> newSerialCursor(SerialCursor<Tt> source)
throws DataException
{ return new SelectionSerialCursor(source);
}
@Override
protected ScrollableCursor<Tt>
newScrollableCursor(ScrollableCursor<Tt> source)
throws DataException
{ return new SelectionScrollableCursor(source);
}
protected class SelectionSerialCursor
extends UnaryBoundQuerySerialCursor
{
protected final Collection<Ti> set;
public SelectionSerialCursor(SerialCursor<Tt> source)
throws DataException
{
super(source);
set=new HashSet<Ti>();
Iterator<Ti> iterator=decorator.iterator();
if (iterator!=null)
{
while (iterator.hasNext())
{ set.add(iterator.next());
}
}
}
@Override
protected boolean integrate()
{
Tt t=sourceChannel.get();
if (t==null)
{
if (debugFine)
{ log.fine(toString()+"BoundSetFilter: eod ");
}
return false;
}
if (set.contains(searchChannel.get()) ^ excludeMatch)
{
if (debugFine)
{ log.fine(toString()+"BoundSetFilter: passed "+t);
}
dataAvailable(t);
return true;
}
else
{
if (debugFine)
{ log.fine(toString()+"BoundSetFilter: filtered "+t);
}
return false;
}
}
@Override
public Type<?> getResultType()
{
Type<?> ret=sourceCursor.getResultType();
if (ret!=null)
{ return ret;
}
else
{
log.fine("Source cursor result type is null "+sourceCursor);
return null;
}
}
}
protected class SelectionScrollableCursor
extends UnaryBoundQueryScrollableCursor
{
protected final Collection<Ti> set;
public SelectionScrollableCursor(ScrollableCursor<Tt> source)
throws DataException
{
super(source);
set=new HashSet<Ti>();
Iterator<Ti> iterator=decorator.iterator();
if (iterator!=null)
{
while (iterator.hasNext())
{ set.add(iterator.next());
}
}
}
@Override
protected boolean integrate()
{
Tt t=sourceChannel.get();
if (t==null)
{
if (debugFine)
{ log.fine("BoundSetFilter: eod ");
}
return false;
}
if (set.contains(searchChannel.get()) ^ excludeMatch)
{
if (debugFine)
{ log.fine("BoundSetFilter: passed "+t);
}
dataAvailable(t);
return true;
}
else
{
if (debugFine)
{ log.fine("BoundSetFilter: filtered "+t);
}
return false;
}
}
@Override
public Type<?> getResultType()
{
Type<?> ret=scrollableSourceCursor.getResultType();
if (ret!=null)
{ return ret;
}
else
{
log.fine("Source cursor result type is null "+scrollableSourceCursor);
return null;
}
}
}
} | [
""
] | |
66270287fcfce6b170cc99985685d3c3a4b2f4be | a0a2c3f0e1c9445a28382cceb9a031c6627c7976 | /chap04/src/chap04_Exercise/Exercise05.java | c0ea3acabe784edbac74754ab89726079c53f527 | [] | no_license | yuhn126/Java | b8cb303d7e4e52bb83654b4f13eddd9be60aa258 | d5c9e74f71ef118535d701bf280136ddf0151551 | refs/heads/master | 2020-04-11T21:47:09.170244 | 2020-01-20T09:54:26 | 2020-01-20T09:54:26 | 162,115,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | package chap04_Exercise;
public class Exercise05 {
public static void main(String[] args) {
//중첩 for문을 이용하여 방정식 4x+5y=60의 모든 해를 구해 (x,y)형태로 출력
int x = 0;
int y = 0;
for(x=1; x<=10; x++) {
for(y=1; y<=10; y++) {
if((4*x)+(5*y) == 60) {
System.out.println("(" + x + "," + y + ")");
}
}
}
}
}
| [
"[email protected]"
] | |
21f9e43a969dff7cb019362d1a0d58934ec3f716 | 7cfddad05e763d6cc9ba4bb85f90035962544ecb | /src/Entities/Jaime.java | 55bb3c31340642a2d2d842b238b077f836c164af | [] | no_license | CharfeddineMohamedAli/GestionEcole | ad4dfdd47a0641084076b86f619007a117aae07c | 94ffa8a9a52422c50bf65ec69abb1b91121dc286 | refs/heads/master | 2022-04-06T13:23:52.793121 | 2020-02-27T03:16:56 | 2020-02-27T03:16:56 | 240,025,460 | 0 | 7 | null | null | null | null | UTF-8 | Java | false | false | 1,004 | 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 Entities;
/**
*
* @author hp
*/
public class Jaime {
private int Id_User;
private int Id_Sujet;
private int valeur_jaime;
public Jaime() {
}
public Jaime(int Id_user, int Id_Sujet, int valeur_jaime) {
this.Id_User = Id_user;
this.Id_Sujet = Id_Sujet;
this.valeur_jaime = valeur_jaime;
}
public int getId_user() {
return Id_User;
}
public void setId_user(int Id_user) {
this.Id_User = Id_user;
}
public int getId_Sujet() {
return Id_Sujet;
}
public void setId_Sujet(int Id_Sujet) {
this.Id_Sujet = Id_Sujet;
}
public int getValeur_jaime() {
return valeur_jaime;
}
public void setValeur_jaime(int valeur_jaime) {
this.valeur_jaime = valeur_jaime;
}
}
| [
"[email protected]"
] | |
8d59adfa58b27de943aaaecad70a3b928c2af40e | f4752d31b625ba484a585402070f77d79a12b165 | /player.java | 1329f330b8e70141b8d59abaeec78f2fb3d9e32b | [] | no_license | bilalmalik4321/School-Work | 6393657d908202b1a08cd313e1b4f918a3635e95 | daf5b2b7f3c822c8614bff32f01252f14af0cd2d | refs/heads/master | 2021-06-25T06:04:01.353851 | 2021-06-14T02:57:42 | 2021-06-14T02:57:42 | 224,910,453 | 0 | 2 | null | 2020-06-24T23:04:26 | 2019-11-29T19:18:19 | Java | UTF-8 | Java | false | false | 405 | java | abstract class player {
public int playerSymbol;
public board gameBoard;
public String playerName;
public abstract void play(board var1);
public player(board var1, int var2, String var3) {
this.gameBoard = var1;
this.playerSymbol = var2;
this.playerName = var3;
}
public String toString() {
return this.playerName;
}
}
| [
"[email protected]"
] | |
5ca801d843d3b8dbcd66b1e07f3e84002a21d031 | f017d7635e4f6f40b9c50fb94033d9919b33a0d3 | /X_and_O/src/logic_x_o_server/Game.java | 700ccd3603322562af428ce39b55826c2d685185 | [] | no_license | sokolenko100/Study | 2da776b8bcfbfd9a39cc5c15151bd22d4a281994 | 80b88f7cf4257a824ed2fbcfa52cc313cf286eb1 | refs/heads/master | 2020-06-14T08:55:33.268217 | 2017-06-09T14:43:25 | 2017-06-09T14:43:25 | 75,208,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,228 | java | package logic_x_o_server;
public class Game extends Thread
{
static final int SIZE=3;
String[] field;
SClient client_1 =null;
SClient client_2 =null;
int x = 1;
int O = 2;
public Game(SClient client_1,SClient client_2)
{
field=new String[SIZE*SIZE];
for(int i=0;i<field.length;i++)
{
field[i]="";
}
this.client_1= client_1;
this.client_2 =client_2;
this.start();
}
@Override
public void run()
{
while (true)
{
if(client_1.rdsrv.answerFromClient.size()>0)
{
String str = client_1.rdsrv.answerFromClient.get(0);
client_2.wrtServ.sentResult(str);
client_1.rdsrv.answerFromClient.clear();
chouse(str);
}
if(client_2.rdsrv.answerFromClient.size()>0)
{
String str = client_2.rdsrv.answerFromClient.get(0);
client_1.wrtServ.sentResult(str);
client_2.rdsrv.answerFromClient.clear();
chouse(str);
}
try
{
Thread.sleep(100);
} catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
public void chouse(String result)
{
String [] resultArray = result.split(":");
switch (resultArray[0])
{
case "push":
{
String nameP = resultArray[1];
String idButtonP = resultArray[2];
String type_x_or_o = resultArray[3];
if(!setFild( nameP, idButtonP, type_x_or_o ))
{
if(client_1.login.equals(nameP))
{
String play = "play:"+client_2.login;
//String push ="push:"+client_2.login+":"+resultArray[2]+":"+resultArray[3];
client_2.wrtServ.sentResult(play);
String wait = "wait:"+client_1.login;
client_1.wrtServ.sentResult(wait);
}
if(client_2.login.equals(nameP))
{
String play = "play:"+client_1.login;
// String push ="push:"+client_1.login+":"+resultArray[2]+":"+resultArray[3];
client_1.wrtServ.sentResult(play);
String wait = "wait:"+client_2.login;
client_2.wrtServ.sentResult(wait);
}
break;
}
}
}
}
public Boolean setFild(String nameP,String idButtonP,String type_x_or_o )
{
Boolean flag = true;
int id = Integer.parseInt(idButtonP);
if(type_x_or_o.equals("x"))
{
field[id]="X";
}
else
{
field[id]="O";
}
if(checkWin())
{
if(client_1.login.equals(nameP))
{
flag= false;
String win = "win:"+client_1.login;
client_1.wrtServ.sentResult(win);
String lost = "lost:"+client_2.login;
client_2.wrtServ.sentResult(lost);
}
if(client_2.login.equals(nameP))
{
flag= false;
String win = "win:"+client_2.login;
client_2.wrtServ.sentResult(win);
String lost = "lost:"+client_1.login;
client_1.wrtServ.sentResult(lost);
}
}
else if(checkDraw())
{
flag= false;
String draw = "draw:"+client_2.login;
client_2.wrtServ.sentResult(draw);
String draw2 = "draw:"+client_1.login;
client_1.wrtServ.sentResult(draw2);
}
return flag;
}
public Boolean checkDraw()
{
Boolean res = false;
int iter = 0;
for (int i = 0; i < field.length; i++)
{
if(!field[i].equals(""))
{
iter++;
}
}
if(iter==9)
{
res = true;
}
return res;
}
public Boolean checkWin()
{
Boolean res = false;
if( (field[0] + field[1] + field[2]).compareTo("XXX") == 0 || (field[0] + field[1] + field[2]).compareTo("OOO") == 0 )
res = true;
if( (field[3] + field[4] + field[5]).compareTo("XXX") == 0 || (field[3] + field[4] + field[5]).compareTo("OOO") == 0 )
res = true;
if( (field[6] + field[7] + field[8]).compareTo("XXX") == 0 || (field[6] + field[7] + field[8]).compareTo("OOO") == 0 )
res = true;
if( (field[0] + field[3] + field[6]).compareTo("XXX") == 0 || (field[0] + field[3] + field[6]).compareTo("OOO") == 0 )
res = true;
if( (field[1] + field[4] + field[7]).compareTo("XXX") == 0 || (field[1] + field[4] + field[7]).compareTo("OOO") == 0 )
res = true;
if( (field[2] + field[5] + field[8]).compareTo("XXX") == 0 || (field[2] + field[5] + field[8]).compareTo("OOO") == 0 )
res = true;
if( (field[0] + field[4] + field[8]).compareTo("XXX") == 0 || (field[0] + field[4] + field[8]).compareTo("OOO") == 0 )
res = true;
if( (field[2] + field[4] + field[6]).compareTo("XXX") == 0 || (field[2] + field[4] + field[6]).compareTo("OOO") == 0 )
res = true;
return res;
}
}
| [
"[email protected]"
] | |
0073e492731984db8eb834f78a63fddf60542585 | 982461e1befc08adb70dd870cf326eed07ba1375 | /app/src/main/java/com/example/recipe_app/executors/AppExecutors.java | 328c327d3294e15be13d8626c8e9e3adbb38a592 | [] | no_license | younes778/Recipe_App | 1fb4b01077a6e3d603f9a2e6541025781e65c7ad | 811579529f767b235bd3919c33549c0f5a194fc3 | refs/heads/master | 2020-05-02T22:18:00.422910 | 2019-04-02T22:42:06 | 2019-04-02T22:42:06 | 178,247,895 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 533 | java | package com.example.recipe_app.executors;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
public class AppExecutors {
private static AppExecutors instance;
public static AppExecutors getInstance(){
if (instance==null)
instance = new AppExecutors();
return instance;
}
private final ScheduledExecutorService networkIO = Executors.newScheduledThreadPool(3);
public ScheduledExecutorService networkIO(){
return networkIO;
}
}
| [
"[email protected]"
] | |
f94ce65d7c104e841540e444d613b4d21dc9efdf | 99c832d838d78825a41e7b919cc1acbd8552ec97 | /tcc/src/main/java/br/com/sgce/repository/CidadeRepository.java | 23e8ba60ae37f3c69ade961f52819bf8053211e7 | [] | no_license | alberlan/tcc | 898e72928ad04d9d032d0d4564459e93f38e2807 | 20058e98438c0b5ed9b12a6ca3879f86342cca81 | refs/heads/master | 2016-09-01T17:21:23.615075 | 2014-10-08T00:53:41 | 2014-10-08T00:53:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | package br.com.sgce.repository;
import br.com.sgce.entity.Cidade;
import java.io.Serializable;
import java.util.List;
import javax.inject.Inject;
import javax.persistence.EntityManager;
public class CidadeRepository implements Serializable {
private static final long serialVersionUID = 1L;
@Inject
private EntityManager manager;
public Cidade guardar(Cidade cidade) {
return manager.merge(cidade);
}
public List<Cidade> buscarCidade() {
return manager.createQuery("from Cidade", Cidade.class).getResultList();
}
public Cidade porId(Long id) {
return manager.find(Cidade.class, id);
}
}
| [
"[email protected]"
] | |
effd0a49c720164033e8a1c2882383093a39ccf4 | 1bc191fa50b0dd534c647fa00d81d240b52d1597 | /src/main/java/com/highfi/sys/collections/list/Shipment.java | 20afada43c0a7ce7b9db9ce4accb2f3639a78141 | [] | no_license | alimslimani/Java | fc3aaef4e33adcd6e817732ab14ad1386eaf7ee6 | d71b6b116b14fbaef0e2e64a7e2ee0a23fd914e2 | refs/heads/master | 2021-07-18T20:53:01.418173 | 2019-12-11T09:26:49 | 2019-12-11T09:26:49 | 223,439,290 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,999 | java | package com.highfi.sys.collections.list;
import com.highfi.sys.collections.Product;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Spliterator;
import java.util.function.Consumer;
public class Shipment implements Iterable<Product> {
private static final int LIGHT_VAN_MAX_WEIGHT = 20;
public static final int PRODUCT_NOT_PRESENT = -1;
private final List<Product> products = new ArrayList<>();
private List<Product> lightVanProducts;
private List<Product> heavyVanProducts;
@Override
public Iterator<Product> iterator() {
return products.iterator();
}
@Override
public void forEach(Consumer<? super Product> action) {
}
@Override
public Spliterator<Product> spliterator() {
return null;
}
public void add(Product product) {
products.add(product);
}
public void replace(Product oldProduct, Product newProduct) {
final int index = products.indexOf(oldProduct);
if (index != PRODUCT_NOT_PRESENT) {
products.set(index, newProduct);
}
}
public void prepare() {
// Sort our list of products by weight
products.sort(Product.BY_WEIGHT);
// find the product index that needs the heavy van
int splitPoint = findSplitPoint();
// assign views of the products list for heavy and light vans
lightVanProducts = products.subList(0, splitPoint);
heavyVanProducts = products.subList(splitPoint, products.size());
}
private int findSplitPoint() {
for (int i = 0; i < products.size(); i++) {
final Product product = products.get(i);
if (product.getWeight() > LIGHT_VAN_MAX_WEIGHT) {
return i;
}
}
return 0;
}
public List<Product> getLightVanProducts() {
return lightVanProducts;
}
public List<Product> getHeavyVanProducts() {
return heavyVanProducts;
}
}
| [
"[email protected]"
] | |
07af367ca93e7cd0a271ec149b9d1447d405264f | 36fca6ee6e3d27b8568f3999fae89a443937ba6c | /daydream/com/google/vr/sdk/widgets/video/nano/SphericalMetadataOuterClass$StereoMeshConfig$Mesh$Vertex.java | ea103f03417021e9fa5661761d57e564060a2d63 | [] | no_license | wjfsanhe/ddwangjf | c2a9e61e5e1b22ec65b095dc2c5b4e9a5d1fe6ef | 95ee031abf532d837061e952683a71a500a2302c | refs/heads/master | 2021-01-11T14:26:54.481864 | 2017-02-09T06:08:44 | 2017-02-09T06:08:44 | 81,415,471 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,014 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: SphericalMetadataOuterClass.java
package com.google.vr.sdk.widgets.video.nano;
import com.google.protobuf.nano.*;
import java.io.IOException;
// Referenced classes of package com.google.vr.sdk.widgets.video.nano:
// SphericalMetadataOuterClass
public static final class clear extends MessageNano
{
public static clear[] emptyArray()
{
if(_emptyArray == null)
synchronized(InternalNano.LAZY_INIT_LOCK)
{
if(_emptyArray == null)
_emptyArray = new _emptyArray[0];
}
return _emptyArray;
}
public _emptyArray clear()
{
x = 0.0F;
y = 0.0F;
z = 0.0F;
u = 0.0F;
v = 0.0F;
cachedSize = -1;
return this;
}
public void writeTo(CodedOutputByteBufferNano output)
throws IOException
{
if(Float.floatToIntBits(x) != Float.floatToIntBits(0.0F))
output.writeFloat(1, x);
if(Float.floatToIntBits(y) != Float.floatToIntBits(0.0F))
output.writeFloat(2, y);
if(Float.floatToIntBits(z) != Float.floatToIntBits(0.0F))
output.writeFloat(3, z);
if(Float.floatToIntBits(u) != Float.floatToIntBits(0.0F))
output.writeFloat(4, u);
if(Float.floatToIntBits(v) != Float.floatToIntBits(0.0F))
output.writeFloat(5, v);
super.writeTo(output);
}
protected int computeSerializedSize()
{
int size = super.computeSerializedSize();
if(Float.floatToIntBits(x) != Float.floatToIntBits(0.0F))
size += CodedOutputByteBufferNano.computeFloatSize(1, x);
if(Float.floatToIntBits(y) != Float.floatToIntBits(0.0F))
size += CodedOutputByteBufferNano.computeFloatSize(2, y);
if(Float.floatToIntBits(z) != Float.floatToIntBits(0.0F))
size += CodedOutputByteBufferNano.computeFloatSize(3, z);
if(Float.floatToIntBits(u) != Float.floatToIntBits(0.0F))
size += CodedOutputByteBufferNano.computeFloatSize(4, u);
if(Float.floatToIntBits(v) != Float.floatToIntBits(0.0F))
size += CodedOutputByteBufferNano.computeFloatSize(5, v);
return size;
}
public v mergeFrom(CodedInputByteBufferNano input)
throws IOException
{
do
{
int tag = input.readTag();
switch(tag)
{
case 0: // '\0'
return this;
default:
if(!WireFormatNano.parseUnknownField(input, tag))
return this;
break;
case 13: // '\r'
x = input.readFloat();
break;
case 21: // '\025'
y = input.readFloat();
break;
case 29: // '\035'
z = input.readFloat();
break;
case 37: // '%'
u = input.readFloat();
break;
case 45: // '-'
v = input.readFloat();
break;
}
} while(true);
}
public static v parseFrom(byte data[])
throws InvalidProtocolBufferNanoException
{
return (v)MessageNano.mergeFrom(new <init>(), data);
}
public static <init> parseFrom(CodedInputByteBufferNano input)
throws IOException
{
return (new <init>()).mergeFrom(input);
}
public volatile MessageNano mergeFrom(CodedInputByteBufferNano codedinputbytebuffernano)
throws IOException
{
return mergeFrom(codedinputbytebuffernano);
}
private static volatile mergeFrom _emptyArray[];
public float x;
public float y;
public float z;
public float u;
public float v;
public ()
{
clear();
}
}
| [
"[email protected]"
] | |
40803af0e3599d63f45a98e5a63313398e56e8f1 | a63cfadef259275e4344c101d08379a77c656e64 | /iOSScrolling.java | 74622aa951e9922676820f9dc526f65ee4ba0a0f | [] | no_license | Solijons/appium | 725ea1c59a3bb08ed0bf3911d9ff90f4a23f0d6b | 212451f62eba05648e0acf3e082404836e5327d8 | refs/heads/master | 2020-08-28T18:07:41.859692 | 2019-10-26T22:56:27 | 2019-10-26T22:56:27 | 217,778,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | public void ScrollView () {
new TouchAction(driver).press(PointOption.point(500, 596)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(1000))).
moveTo(PointOption.point(518, 478)).release().perform();
driver.findElementByAccessibilityId("Steppers").click();
}
| [
"[email protected]"
] | |
9c996015bcbe87eec39a58df7b38f8975c9f7280 | c151381a914d65ab637b40d2a0d824b21854036e | /src/test/java/edu/brown/cs/rfameli1_sdiwan2_tfernan4_tzaw/APIHandlers/dialectTranslation/TranslationsAPIHandlerTest.java | b081eb08bda56fbe7a96486358d3267b3b49e9c2 | [] | no_license | r-fameli/journaltexter | 5685d9804b3f9fc11620fcfc1e8b8dc8fc542829 | 5cd64b8914aaec59be4904f7cd797208c7544325 | refs/heads/backend-testing | 2023-05-31T15:57:09.227291 | 2021-04-15T15:19:04 | 2021-04-15T15:19:04 | 375,487,476 | 0 | 0 | null | 2021-06-09T21:03:13 | 2021-06-09T20:57:49 | Java | UTF-8 | Java | false | false | 1,226 | java | //package edu.brown.cs.rfameli1_sdiwan2_tfernan4_tzaw.APIHandlers.dialectTranslation;
//
//import edu.brown.cs.rfameli1_sdiwan2_tfernan4_tzaw.APIHandlers.wordSyonyms.WordnikAPIHandler;
//import org.junit.Test;
//
//import java.util.HashSet;
//import java.util.Set;
//
//import static org.junit.Assert.assertEquals;
//
//public class TranslationsAPIHandlerTest {
// @Test
// public void convertToDialect_OriginalText() {
// TranslationsAPIHandler trans = new TranslationsAPIHandler();
// String text = "Hello there everybody I'm really happy because haha yup I don't know why please help";
// String translated = trans.convertToDialect(text, DialectType.AMERICAN);
//
// assertEquals(text, translated);
// }
//
// @Test
// public void convertToDialect_PirateText() {
// TranslationsAPIHandler trans = new TranslationsAPIHandler();
// String text = "Hello there everybody I'm really happy because haha yup I don't know why please help";
// String translated = trans.convertToDialect(text, DialectType.PIRATE);
//
// String expectedTranslation = "Ahoy thar everybody I be mighty happy 'cause har har har aye I dunno why please help";
//
// assertEquals(expectedTranslation, translated);
// }
//}
| [
"[email protected]"
] | |
91f768b07c23bf3efabcb917df94c827ea614d97 | d06c35f0197cdb10aed87bd3af0c6e4ffcc54550 | /src/com/hdc/mycasino/model/MyObj.java | 746e2aa405ab37b3ee51f1f73eff32feac33a397 | [] | no_license | canh7antt8a/thanbai-giaodienmoi | f4f354d12db90c614553aa94ee87a7edb1811303 | d51db185dfd6058f28da53d5caed6df9dce29e4f | refs/heads/master | 2020-04-26T07:37:05.522123 | 2012-11-03T04:50:41 | 2012-11-03T04:50:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,034 | java | package com.hdc.mycasino.model;
import com.danh.standard.Graphics;
import com.hdc.mycasino.utilities.FrameImage;
public abstract class MyObj {
public String itemName = "";
public int itemId;
public abstract void paintIcon(Graphics g, int x, int y);
public abstract void paintInRow(Graphics g, int x, int y, int width, int height);
public abstract void paintInfo(Graphics g, int x, int y);
public abstract void paintInfo_Item(Graphics g, int x, int y, int width, int height,
MyObj myObj, int type, int m_widthItem);
public abstract void focusItem();
public abstract void paintItem(Graphics g, float x, float y, int m_IdFrame, int select,
FrameImage m_frame);
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final MyObj other = (MyObj) obj;
if (this.itemId != other.itemId) {
return false;
}
return true;
}
public int hashCode() {
int hash = 7;
return hash;
}
}
| [
"[email protected]@aec43717-8996-1c64-2573-041b0b196689"
] | [email protected]@aec43717-8996-1c64-2573-041b0b196689 |
461a1412b22468d5cffcb761ee0b20ffa72f9a85 | 23604ffacfa0fd0cfaa1cae86946427199ca6593 | /src/main/java/utils/ThrottleCountBatcher.java | 05893e3ecf3c20a67eb9d7aafab06a2e5f54593a | [] | no_license | kleingomes-zz/throttle | 718615a3d788f341f5d39e968c8c4199b84b84eb | f02e8ab084f56c40c35e216e7ee32b6a2e4f5a75 | refs/heads/master | 2023-01-21T00:04:04.051636 | 2019-03-16T22:06:28 | 2019-03-16T22:06:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 528 | java | package utils;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.List;
public class ThrottleCountBatcher<T> {
private List<T> batchList;
private int batchCount;
public ThrottleCountBatcher(int batchCount) {
this.batchCount = batchCount;
this.batchList = new ArrayList<>();
}
public void append(T event) {
batchList.add(event);
}
public List<List<T>> getBatches() {
return Lists.partition(this.batchList, batchCount);
}
}
| [
"[email protected]"
] | |
c0b3b5ec4717d7fe6223055bbc2dfe047e7ef0dc | 32d27ea3a6edf4d9f772e6b5c23bf392d043f7ce | /java/src/main/java/codeforces/problem/old/dec/Task1359_C.java | 57907640eb61f0b07f2a3e83cd8a72cb51ae5033 | [] | no_license | 1ou/code_tasks | 1c6de938c55275bec8b06f4199d297c76a29ef34 | c0b9c90c9adb56424fdd2b9fc5f6f7a7a65c1cea | refs/heads/master | 2023-06-01T03:11:02.977210 | 2021-06-18T19:53:15 | 2021-06-18T19:53:15 | 202,960,601 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,509 | java | package codeforces.problem.old.dec;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.StringTokenizer;
/*
https://codeforces.com/problemset/problem/1359/B
1
41 15 30
*/
public class Task1359_C {
static void solve() {
long h = FS.nextLong();
long c = FS.nextLong();
long t = FS.nextLong();
if (h + c - 2 * t >= 0)
FS.pt.println("2");
else {
long a = h - t;
long b = 2 * t - c - h;
long k = 2 * (a / b) + 1;
long val1 = Math.abs(k / 2 * c + (k + 1) / 2 * h - t * k);
long val2 = Math.abs((k + 2) / 2 * c + (k + 3) / 2 * h - t * (k + 2));
FS.pt.println(val1 * (k + 2) <= val2 * k ? k : k + 2);
}
}
public static void main(String[] args) {
int T = FS.nextInt();
for (int tt = 0; tt < T; tt++) {
solve();
}
FS.pt.close();
}
static class FS {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static StringTokenizer st = new StringTokenizer("");
static PrintWriter pt = new PrintWriter(System.out);
static String next() {
while (!st.hasMoreTokens())
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
return st.nextToken();
}
static int nextInt() {
return Integer.parseInt(next());
}
static int[] readArray(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++) a[i] = nextInt();
return a;
}
static double nextDouble() {
return Double.parseDouble(next());
}
static int[][] read2Array(int n, int m) {
int[][] a = new int[n][m];
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = nextInt();
}
}
return a;
}
static long[][] read2ArrayL(int n, int m) {
long[][] a = new long[n][m];
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = nextLong();
}
}
return a;
}
void printArr(long[] arr) {
for (long value : arr) {
pt.print(value);
pt.print(" ");
}
pt.println();
}
static long[] readArrayL(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++) a[i] = nextLong();
return a;
}
static void printArr(int[] arr) {
for (int value : arr) {
pt.print(value);
pt.print(" ");
}
pt.println();
}
static void printArrL(int[] arr) {
for (int value : arr) {
pt.print(value);
pt.print(" ");
}
pt.println();
}
static void print2Arr(int[][] arr, int n, int m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
pt.print(arr[i][j]);
pt.print(" ");
}
pt.println();
}
pt.println();
}
static void print2Arr(long[][] arr, int n, int m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
pt.print(arr[i][j]);
pt.print(" ");
}
pt.println();
}
pt.println();
}
static List<Long> readListLong(int n) {
List<Long> list = new ArrayList<>(n);
for (int i = 0; i < n; i++) {
list.add(nextLong());
}
return list;
}
static List<Integer> readListInt(int n) {
List<Integer> list = new ArrayList<>(n);
for (int i = 0; i < n; i++) {
list.add(nextInt());
}
return list;
}
static <T> void printList(List<T> list) {
for (T value : list) {
pt.print(value);
pt.print(" ");
}
pt.println();
}
static void close() {
pt.close();
}
static long nextLong() {
return Long.parseLong(next());
}
}
static class NumberTheory {
public static long gcd(long a, long b) {
while (b != 0) {
long tmp = a % b;
a = b;
b = tmp;
}
return a;
}
public static long lcm(long a, long b) {
return a * b / gcd(a, b);
}
public static List<Long> primeFactors(long n) {
List<Long> ans = new ArrayList<>();
while (n % 2 == 0) {
ans.add(2L);
n /= 2;
}
// n must be odd at this point. So we can
// skip one element (Note i = i + 2)
for (long i = 3; i <= Math.sqrt(n); i += 2) {
// While i divides n, print i and divide n
while (n % i == 0) {
ans.add(i);
n /= i;
}
}
// This condition is to handle the case when
// n is a prime number greater than 2
if (n > 2) {
ans.add(n);
}
return ans;
}
}
static class Pair<T, K> {
T first;
K second;
public Pair(T first, K second) {
this.first = first;
this.second = second;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Pair<?, ?> pair = (Pair<?, ?>) o;
return Objects.equals(first, pair.first) &&
Objects.equals(second, pair.second);
}
@Override
public int hashCode() {
return Objects.hash(first, second);
}
}
}
| [
"[email protected]"
] | |
257af3bdef5c404ec16905edd96c673d42094d30 | 65ce55309ddac51f8044b9378854e6312084542d | /gmall-manage-service/src/main/java/com/yuan/gmall/manage/mapper/PmsBaseCatalog1Mapper.java | 53223ed33d4119972e26593fe5ff558c8833c831 | [] | no_license | Daydream50/MyItem | cdb0614566e9c4ebed7ae239eb3efc3966db4001 | 79c3dd6a0510187ead067424de0cd6a0abe03227 | refs/heads/master | 2022-11-22T08:25:24.910111 | 2020-02-28T01:50:05 | 2020-02-28T01:50:05 | 227,843,394 | 0 | 0 | null | 2022-11-15T23:55:01 | 2019-12-13T13:12:47 | CSS | UTF-8 | Java | false | false | 199 | java | package com.yuan.gmall.manage.mapper;
import com.yuan.gmall.bean.PmsBaseCatalog1;
import tk.mybatis.mapper.common.Mapper;
public interface PmsBaseCatalog1Mapper extends Mapper<PmsBaseCatalog1> {
}
| [
"[email protected]"
] | |
5569b5650142fec75f1b1e3d495e41de240f4f3a | 410a6f10185526c56f3b299287e366d282d49b2a | /net.solarnetwork.external.ocpp/src/ocpp/domain/SchemaValidationException.java | 2ca8b3c6e6f4a45bb7a39691dd5b99d81d2d2ef9 | [] | no_license | SolarNetwork/solarnetwork-external | 9d9c1e30de6bf2f977da61c51175abada37766ad | 82e67fa18035f2448785609df73212f09d9c94b0 | refs/heads/master | 2023-08-18T07:54:31.164740 | 2023-08-11T20:14:03 | 2023-08-11T20:14:03 | 6,083,749 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,541 | java | /* ==================================================================
* SchemaValidationException.java - 3/02/2020 3:14:12 pm
*
* Copyright 2020 SolarNetwork.net Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
* ==================================================================
*/
package ocpp.domain;
/**
* Exception for when schema validation fails for an object or message.
*
* @author matt
* @version 1.0
*/
public class SchemaValidationException extends RuntimeException {
private static final long serialVersionUID = 5519379160853548931L;
private final Object source;
/**
* Default constructor.
*/
public SchemaValidationException(Object source) {
super();
this.source = source;
}
/**
* Constructor.
*
* @param source
* the source of the validation failure, for example the message
* object
* @param message
* the message
*/
public SchemaValidationException(Object source, String message) {
super(message);
this.source = source;
}
/**
* Constructor.
*
* @param source
* the source of the validation failure, for example the message
* object
* @param cause
* the cause
*/
public SchemaValidationException(Object source, Throwable cause) {
super(cause);
this.source = source;
}
/**
* Constructor.
*
* @param source
* the source of the validation failure, for example the message
* object
* @param message
* the message
* @param cause
* the cause
*/
public SchemaValidationException(Object source, String message, Throwable cause) {
super(message, cause);
this.source = source;
}
/**
* Get the source of the validation failure, for example the original
* message object.
*
* @return the source object
*/
public Object getSource() {
return source;
}
}
| [
"[email protected]"
] | |
8da5abe192ba787b3f7452c584e71a74bcd965e9 | cd1f70fcb84e82667f4969093feed9138a94499a | /java8-streams/map/jbr/java8/streams/map/StreamsMapMapExample.java | 74961d08c46c33c5f04eb3b45158971169a9ad19 | [] | no_license | javabyranjith/java8 | e866d743b9f9acb6c59bfd45c08fcddbd2280b44 | 01bc66f40629714bff12c81c252cc52f77d2884e | refs/heads/master | 2021-06-18T17:59:17.539222 | 2020-02-20T17:34:28 | 2020-02-20T17:34:28 | 89,729,670 | 1 | 3 | null | 2020-10-13T02:44:44 | 2017-04-28T17:33:44 | Java | UTF-8 | Java | false | false | 1,544 | java | package jbr.java8.streams.map;
import java.util.HashMap;
import java.util.Map;
public class StreamsMapMapExample {
public static void main(String[] args) {
Map<String, Object> input = new HashMap<>();
input.put("A", "Anbu");
input.put("C", "Chandru");
input.put("B", "Bala");
Map<String, String> innerMap = new HashMap<>();
innerMap.put("E", "Edward");
innerMap.put("D", "Dinesh");
input.put("G", innerMap);
// print the map
System.out.println("===Original Map");
for (Map.Entry<String, Object> map : input.entrySet()) {
System.out.println("Key: " + map.getKey() + ", Value: " + map.getValue());
}
System.out.println("\n===Print Map Keys");
input.entrySet()
.stream()
.map(p -> p.getKey())
.forEach(System.out::println);
System.out.println("\n===Print Map Values");
input.entrySet()
.stream()
.map(p -> p.getValue())
.forEach(System.out::println);
System.out.println("\n===Print Inner Map Keys");
input.entrySet()
.stream()
.filter(v -> v.getKey()
.equals("G"))
// .flatMap(a -> a.) TODO
.forEach(System.out::println);
System.out.println("\n===Print Inner Map Values");
input.entrySet()
.stream()
.filter(v -> v.getKey()
.equals("G"))
.flatMap(a -> ((Map<String, String>) a.getValue()).values()
.stream())
.forEach(System.out::println);
}
}
| [
"[email protected]"
] | |
fdb421f65894d325d99b536769312e94e7600fbc | 74f723bee36229fa9d447e63d99c70d2a62dc193 | /roncoo-education-course/roncoo-education-course-common/src/main/java/com/roncoo/education/course/common/bean/qo/AdvQO.java | dcbf6da42b5ea7fcf58882664b4199b80ac1b1ee | [
"MIT"
] | permissive | Arronzheng/roncoo-education | 714568d864d5098052c44b34d9c4f730fc551af9 | 1afb481d4269597e1cebc339a8d257caaad9279a | refs/heads/master | 2022-09-13T13:45:22.315597 | 2020-07-29T01:52:22 | 2020-07-29T01:52:22 | 220,367,025 | 1 | 0 | MIT | 2022-09-01T23:15:24 | 2019-11-08T02:05:26 | Java | UTF-8 | Java | false | false | 1,207 | java | package com.roncoo.education.course.common.bean.qo;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 广告信息
*/
@Data
@Accessors(chain = true)
public class AdvQO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当前页
*/
private int pageCurrent;
/**
* 每页记录数
*/
private int pageSize;
/**
* 主键
*/
private Long id;
/**
* 创建时间
*/
private Date gmtCreate;
/**
* 修改时间
*/
private Date gmtModified;
/**
* 状态(1:正常,0:禁用)
*/
private Integer statusId;
/**
* 排序
*/
private Integer sort;
/**
* 广告标题
*/
private String advTitle;
/**
* 广告图片
*/
private String advImg;
/**
* 广告链接
*/
private String advUrl;
/**
* 广告跳转方式
*/
private String advTarget;
/**
* 广告位置(1首页轮播)
*/
private Integer advLocation;
/**
* 开始时间
*/
private Date beginTime;
/**
* 结束时间
*/
private Date endTime;
/**
* 位置(0电脑端,1微信端)
*/
private Integer platShow;
private String beginTimeString;
private String endTimeString;
}
| [
"[email protected]"
] | |
0568dc2558bea2f9da50a7c0b5d3e5fd7ded86ad | 1187e7ada271f51ed2e7f7c3cf97bfe86fee67b4 | /src/inf-polyfills/src/main/java/com/syncprem/uprising/infrastructure/polyfills/ProcessingCallback.java | 6461bbdd922fc59c42676899663c6a1e6c88df4f | [
"MIT"
] | permissive | wellengineered-us/archive-uprising-java | ac27896c8b6445bd325b18fa15a7e871376f445a | 490d02dd9ec98dc06d4fe7522abc66a178aa8f30 | refs/heads/master | 2023-04-12T17:09:40.575871 | 2021-05-06T04:07:31 | 2021-05-06T04:07:31 | 364,781,631 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | /*
Copyright ©2017-2019 SyncPrem, all rights reserved.
Distributed under the MIT license: https://opensource.org/licenses/MIT
*/
package com.syncprem.uprising.infrastructure.polyfills;
public interface ProcessingCallback
{
void onProgress(long punctuateModulo, String sourceLabel, long itemIndex, boolean isCompleted, double rollingTiming);
}
| [
"[email protected]"
] | |
0f85def9ca239298ec2ddddcd0ba6df21ba4a1fb | e6314f59dba1aaac8fe11ed36fcd2ab5c97dbf35 | /src/Player/RealTimePlayer.java | ecb78b0094bacdba8d1d914be610a3a1aa72d6d6 | [] | no_license | akashgarg98/Risk-game | 7794c03d60a4c76e6d85028c7cd9667c94978975 | 06e3859ab1a090d349b7e5b3e0e6009a2d0fe971 | refs/heads/master | 2022-01-22T15:19:38.848835 | 2019-08-02T13:24:04 | 2019-08-02T13:24:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,299 | 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 Player;
import State.State;
import java.awt.Color;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
import javax.swing.ImageIcon;
import static risk.game.RiskGame.currentPlayer;
import static risk.game.RiskGame.gameTerritory;
import static risk.game.RiskGame.getIcon;
import static risk.game.RiskGame.players;
import risk.game.Territory;
/**
*
* @author Ahmed
*/
public class RealTimePlayer extends AbstractPlayer {
public static ImageIcon AStarSearchIcon = getIcon("AStar Search.jpg");
private State nextState;
private boolean attackerSelected = false;
private boolean startAdding1 = true;
public RealTimePlayer(Color color) {
super(color);
}
@Override
public ImageIcon Icon() {
return AStarSearchIcon;
}
@Override
public String getName() {
return "realtime";
}
private void realTimeSearch(State initalState,boolean attacking)
{
PriorityQueue<State> frontier = new PriorityQueue(Collections.reverseOrder());
frontier.add(initalState);
Set<int[][]> explored = new HashSet<>();
explored.add(initalState.id);
State state = frontier.remove();
for(State neighbor:state.neighbors(attacking,true,1))
{
frontier.add(neighbor);
explored.add(neighbor.id);
}
while(!frontier.isEmpty())
{
this.T++;
state = frontier.remove();
if(state.enemyTerritories.isEmpty() || state.heuristic >= initalState.heuristic+10000)
{
setPath(state);
break;
}
for(State neighbor:state.neighbors(!state.endAttack,true,state.depth+1))
{
if(!explored.contains(neighbor.id))
{
frontier.add(neighbor);
explored.add(neighbor.id);
}
}
}
}
@Override
protected Territory getTerritoryToAdd() {
if(nextState != null &&nextState.noBounsArmies())
startAdding1 = true;
if(this.startAdding1)
{
realTimeSearch(new State(territories,players[(currentPlayer+1)%2].getTerritories(),gameTerritory,noOfAdditionalArmies),false);
startAdding1 = false;
}
return gameTerritory[nextState.getNextTerritoryToAdd().id];
}
@Override
public Territory getAttacker() {
if(!attackerSelected)
{
realTimeSearch(new State(territories,players[(currentPlayer+1)%2].getTerritories(),gameTerritory,noOfAdditionalArmies),true);
}
attackerSelected = false;
if(nextState.attacker != null)
return gameTerritory[nextState.attacker.id];
else
return null;
}
@Override
public Territory getDefender() {
return gameTerritory[nextState.defender.id];
}
private void setPath(State finalState)
{
State[] path = new State[finalState.depth+1];
State state= finalState;
while(state != null)
{
path[state.depth] = state;
state = state.parent;
}
nextState = path[1];
}
@Override
protected void setNOofAttackingArmies() {
attacker.noOfFightingArmies = nextState.attacker.noOfFightingArmies;
}
@Override
public boolean continueAttacking()
{
if(this.canAttack())
{
realTimeSearch(new State(territories,players[(currentPlayer+1)%2].getTerritories(),gameTerritory,noOfAdditionalArmies),true);
if(nextState.attacker != null && gameTerritory[nextState.attacker.id] == attacker && gameTerritory[nextState.defender.id] == defender)
return true;
attackerSelected = true;
}
return false;
}
}
| [
"Ahmed@DESKTOP-98381DK"
] | Ahmed@DESKTOP-98381DK |
3a1dd48adf42bff98131c1c7c0a1647aa2ec7e5a | 71d4e35ecaa46867c08957c2c5cfc5498bc88930 | /app/src/main/java/com/function/demo/dao/TBagFunctionItem.java | a447da78f8301d4064ba10663e641bc2dc648f9f | [] | no_license | xiaoyinliuyun/TBagAdapterDemo | afc1ce4bee8f042e6029176c0600436dd006f3ef | 76a3ae9c893a23ff12852041514ee5fc95844e85 | refs/heads/master | 2020-06-14T03:54:08.344074 | 2016-12-28T11:49:00 | 2016-12-28T11:49:00 | 75,520,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package com.function.demo.dao;
/**
* Created by yangkunjian on 2016/12/4.
*/
public class TBagFunctionItem {
String tv;
public TBagFunctionItem(String tv) {
this.tv = tv;
}
public String getTv() {
return tv;
}
public void setTv(String tv) {
this.tv = tv;
}
}
| [
"[email protected]"
] | |
c4760b0ef33b22485131b213ce3436cdf1e0447e | dfd84b268cb1d852cd35d5b40d22e9dac341bb63 | /src/test/java/maven/data/MarkLabelData/AreaLabelData/AreaLabelDataImplTest.java | 1cce6a0308f768581a0ceeec4c384ef719e2907c | [] | no_license | 161250092/SECIII_Phase_III | 8f8ee9e696e6b2549503f78c8551e1ee3075ffb9 | 6ff03e62394dec5fc78d46f0b7abadd8a4aa2faa | refs/heads/master | 2020-05-20T11:52:11.752376 | 2019-05-09T07:27:09 | 2019-05-09T07:27:11 | 185,555,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,467 | java | package maven.data.MarkLabelData.AreaLabelData;
import maven.data.TableInitializer;
import maven.model.label.areaLabel.Area;
import maven.model.label.areaLabel.AreaLabel;
import maven.model.label.areaLabel.Pixel;
import maven.model.primitiveType.TaskId;
import maven.model.primitiveType.UserId;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
public class AreaLabelDataImplTest {
private AreaLabelDataImpl impl = new AreaLabelDataImpl();
public AreaLabelDataImplTest() {
TableInitializer initializer = new TableInitializer();
initializer.cleanAllTable();
List<AreaLabel> l = new ArrayList<>();
List<Area> s1 = new ArrayList<>();
List<Pixel> p1 = new ArrayList<>();
p1.add(new Pixel(100, 100));
p1.add(new Pixel(200, 100));
p1.add(new Pixel(200, 200));
p1.add(new Pixel(100, 200));
p1.add(new Pixel(100, 100));
s1.add(new Area("tag0-1", p1));
List<Pixel> p2 = new ArrayList<>();
p2.add(new Pixel(400, 400));
p2.add(new Pixel(500, 600));
p2.add(new Pixel(400, 600));
p2.add(new Pixel(400, 400));
s1.add(new Area("tag0-2", p2));
l.add(new AreaLabel(s1));
List<Area> s2 = new ArrayList<>();
List<Pixel> p3 = new ArrayList<>();
p3.add(new Pixel(4000, 4000));
p3.add(new Pixel(5000, 6000));
p3.add(new Pixel(4000, 7000));
p3.add(new Pixel(3000, 5000));
s2.add(new Area("tag1-1", p3));
l.add(new AreaLabel(s2));
impl.saveLabelList(new UserId("wo1"), new TaskId("task1"), l);
List<AreaLabel> l2 = new ArrayList<>();
List<Area> s21 = new ArrayList<>();
List<Pixel> p21 = new ArrayList<>();
p21.add(new Pixel(10, 10));
p21.add(new Pixel(20, 10));
p21.add(new Pixel(20, 20));
p21.add(new Pixel(10, 20));
p21.add(new Pixel(10, 10));
s21.add(new Area("tag21-1", p21));
l2.add(new AreaLabel(s21));
impl.saveLabelList(new UserId("wo2"), new TaskId("task1"), l2);
}
@Test
public void deleteLabel() {
impl.deleteLabel(new UserId("wo1"), new TaskId("task1"));
List<AreaLabel> l1 = impl.getLabelList(new UserId("wo1"), new TaskId("task1"));
List<AreaLabel> l2 = impl.getLabelList(new UserId("wo2"), new TaskId("task1"));
assertEquals(0, l1.size());
assertEquals(1, l2.size());
}
@Test
public void getLabelList() {
double[][][][] i1 = {
{
{{100,100},{200,100},{200,200},{100,200},{100,100}}, {{400,400},{500,600},{400,600},{400,400}},
},
{
{{4000,4000},{5000,6000},{4000,7000},{3000,5000}}
}
};
String[][] s1 = {
{"tag0-1","tag0-2"},
{"tag1-1"}
};
List<AreaLabel> l1 = impl.getLabelList(new UserId("wo1"), new TaskId("task1"));
for (int i = 0; i < l1.size(); i++){
for (int j = 0; j < l1.get(i).getAreaList().size(); j++){
assertEquals(s1[i][j], l1.get(i).getAreaList().get(j).getTag());
for (int k = 0; k < l1.get(i).getAreaList().get(j).getAreaBorder().size(); k++){
assertEquals(i1[i][j][k][0], l1.get(i).getAreaList().get(j).getAreaBorder().get(k).x, 0.001);
assertEquals(i1[i][j][k][1], l1.get(i).getAreaList().get(j).getAreaBorder().get(k).y, 0.001);
}
}
}
double[][][][] i2 = {
{
{{10,10},{20,10},{20,20},{10,20},{10,10}}
}
};
String[][] s2 ={
{"tag21-1"}
};
List<AreaLabel> l2 = impl.getLabelList(new UserId("wo2"), new TaskId("task1"));
for (int i = 0; i < l2.size(); i++){
for (int j = 0; j < l2.get(i).getAreaList().size(); j++){
assertEquals(s2[i][j], l2.get(i).getAreaList().get(j).getTag());
for (int k = 0; k < l2.get(i).getAreaList().get(j).getAreaBorder().size(); k++){
assertEquals(i2[i][j][k][0], l2.get(i).getAreaList().get(j).getAreaBorder().get(k).x, 0.001);
assertEquals(i2[i][j][k][1], l2.get(i).getAreaList().get(j).getAreaBorder().get(k).y, 0.001);
}
}
}
}
} | [
"[email protected]"
] | |
b1965cf381be000c7eeeab2ce817de72877e76ce | 6e5ea80e37dd92267a4fb4ca6b813d0b17f218d7 | /app/src/main/java/com/savare/funcoes/rotinas/LogRotinas.java | c66f0e089465b2b347f02878541aaf5d4116f5f3 | [] | no_license | ns-bruno/SAVARE | c01d1c189657bd0d4404dd5a9c2a48594822587d | 32477d85392a4790ef5837ddeebcf190840e4d14 | refs/heads/master | 2023-03-02T22:29:36.125345 | 2018-12-04T21:43:23 | 2018-12-04T21:43:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,939 | java | package com.savare.funcoes.rotinas;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.database.Cursor;
import com.savare.banco.funcoesSql.LogSql;
import com.savare.beans.LogBeans;
import com.savare.funcoes.Rotinas;
public class LogRotinas extends Rotinas {
public LogRotinas(Context context) {
super(context);
}
public List<LogBeans> listaTabela(String where, String[] listaTabelaRequerida){
List<LogBeans> listaTabela = new ArrayList<LogBeans>();
LogSql logSql = new LogSql(context);
String sql = "SELECT * FROM LOG ";
if(where != null){
sql += "WHERE (" + where + ") ";
}
if( (where != null) && (listaTabelaRequerida.length > 0)){
sql += " AND (LOG.TABELA = '";
int controle = 0;
for (String tabela : listaTabelaRequerida) {
controle ++;
sql += tabela;
if(controle < tabela.length()){
sql += "' OR LOG.TABELA = '";
} else {
sql += "')";
}
}
} else if(listaTabelaRequerida != null){
sql += " WHERE (LOG.TABELA = '";
int controle = 0;
for (String tabela : listaTabelaRequerida) {
controle ++;
sql += tabela;
if(controle < listaTabelaRequerida.length){
sql += "' OR LOG.TABELA = '";
} else {
sql += "') ";
}
}
}
// Adiciona um agrupador
sql += "GROUP BY TABELA ";
Cursor dadosLog = logSql.sqlSelect(sql);
if(dadosLog != null && dadosLog.getCount()> 0){
// Move para o primeiro
//dadosLog.moveToFirst();
while (dadosLog.moveToNext()) {
LogBeans log = new LogBeans();
log.setIdLog(dadosLog.getInt(dadosLog.getColumnIndex("ID_LOG")));
log.setIdTabela(dadosLog.getInt(dadosLog.getColumnIndex("ID_TABELA")));
log.setTabela(dadosLog.getString(dadosLog.getColumnIndex("TABELA")));
listaTabela.add(log);
}
}
return listaTabela;
}
public List<LogBeans> listaLogPorTabela(String where){
List<LogBeans> listaLog = new ArrayList<LogBeans>();
LogSql logSql = new LogSql(context);
String sql = "SELECT * FROM LOG ";
if(where != null){
sql += "WHERE (" + where + ") ";
}
sql += "ORDER BY DT_CAD ";
Cursor dadosLog = logSql.sqlSelect(sql);
if(dadosLog != null){
while (dadosLog.moveToNext()) {
LogBeans log = new LogBeans();
log.setIdLog(dadosLog.getInt(dadosLog.getColumnIndex("ID_LOG")));
log.setIdTabela(dadosLog.getInt(dadosLog.getColumnIndex("ID_TABELA")));
log.setDataCadastro(dadosLog.getString(dadosLog.getColumnIndex("DT_CAD")));
log.setTabela(dadosLog.getString(dadosLog.getColumnIndex("TABELA")));
log.setOperacao(dadosLog.getString(dadosLog.getColumnIndex("OPERACAO")));
log.setUsuario(dadosLog.getString(dadosLog.getColumnIndex("USUARIO")));
log.setValores(dadosLog.getString(dadosLog.getColumnIndex("VALORES")));
listaLog.add(log);
}
}
return listaLog;
}
}
| [
"[email protected]"
] | |
1f449db87dce1727c429b0beed47e50befe492bf | d72c4c1ec969e9ef5092b2301c04741bc8198ee7 | /ssh/src/com/ssh/dao/StudentDao.java | 0ac39cd3c4fa267a0391dbf3ae32d2adc65122a4 | [] | no_license | Antlion1996/Student_sys | dc5feebce7193963328254bf1c08bbe5f3bb0a44 | e358fc2c953273d149c9b922b53e65b3e61a7eaa | refs/heads/master | 2020-03-21T15:07:17.590776 | 2018-06-26T07:06:54 | 2018-06-26T07:06:54 | 138,695,503 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 643 | java | package com.ssh.dao;
import java.util.List;
import com.ssh.model.Student;
/**
*
* 有关对学生信息CRUD管理的接口
*
*/
public interface StudentDao {
//添加学生信息
public Integer save(Student student);
//学号是否存在的验证
public boolean exists(int id);
//通过id获取学生信息
public Student getById(int id);
//获取学生信息列表
public List<Student> getStudents();
//修改学生信息
public void update(Student student);
//删除学生信息
public void delete(int id);
//修改登录密码
public void updatePwd(int id, String password);
}
| [
"[email protected]"
] | |
fc618353304723cb20ccd8d25c2ffa1e498bd34b | 4d1a438ee0c80053e33431d10683ce4872118957 | /dumbhippo/branches/linux-client-1-1-32-bugfix/taste/src/main/com/planetj/taste/recommender/ItemFilter.java | 081333eea1e3f90c476d6f842aed38ad9f3792e9 | [
"Apache-2.0"
] | permissive | nihed/magnetism | 7a5223e7dd0ae172937358c1b72df7e9ec5f28b8 | c64dfb9b221862e81c9e77bb055f65dcee422027 | refs/heads/master | 2016-09-05T20:01:07.262277 | 2009-04-29T06:48:39 | 2009-04-29T06:48:39 | 39,454,577 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,164 | java | /*
* Copyright 2005 Sean Owen
*
* 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.planetj.taste.recommender;
import com.planetj.taste.model.Item;
/**
* <p>A simple interface whose implementations define "item filters", some
* logic which accepts some items and rejects others. For example, an application
* might define an implementation that only accepts items in a certain category
* of items.</p>
*
* @author Sean Owen
* @see Recommender#recommend(Object, int, ItemFilter)
*/
public interface ItemFilter {
/**
* @param item
* @return true iff this filter accepts the {@link Item}
*/
boolean isAccepted(Item item);
}
| [
"otaylor@69951b7c-304f-11de-8daa-cfecb5f7ff5b"
] | otaylor@69951b7c-304f-11de-8daa-cfecb5f7ff5b |
7b375edb9cb7586c5508a61cb478be5ec5a5e980 | d86e10c0924b4b329b7e2b6bc34ee1aec17258df | /Java-Sequence/part6/Pair.java | fcc8faceef5635b7d9fdcab06e9a4402c1033c4d | [] | no_license | chauvincent/ProgrammingLanguages | 117896fa4db14e5dfe4c0a4b8b796dcb9f264b08 | a963ceb1f9338a2e2352fef8a86710a90a9b5515 | refs/heads/master | 2021-01-18T12:33:13.938016 | 2015-12-15T23:30:00 | 2015-12-15T23:30:00 | 48,074,723 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | public class Pair extends Element{
private MyChar key;
private Element value;
public Pair (MyChar c, Element d){ key = c; value = d;}
public MyChar getKey(){ return key; }
public Element getVal(){ return value; }
public void Print(){
System.out.print("(");
key.Print();
System.out.print(" ");
value.Print();
System.out.print(")");
}
}
| [
"[email protected]"
] | |
72a8cd36f869e29a8d68bf52a888b5d1ee91113f | 30900a71d5a0dd8d1757b027355084ab3f84576c | /src/Connection/ConnectionManager.java | 06e183f3bc5ead1ca6f10dc799a0c08418a68c20 | [] | no_license | WangCrash/PirateTransmission | 6a0a5402b41cf4c787ad6d571073b633d255fd5c | 0a8fcc81f01b39fe8dc3dd14b7f9925f888ac8c4 | refs/heads/master | 2020-05-30T01:13:30.235816 | 2014-07-13T19:55:53 | 2014-07-13T19:55:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,173 | java | package Connection;
import java.util.List;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import error.ErrorDescription;
import Codification.Base64;
public class ConnectionManager {
public static final String METHOD_GET = "GET";
public static final String METHOD_POST = "POST";
public static final String TOKEN_NAME_BASIC_AUTH_KEY = "TOKEN_NAME";
public static final String TOKEN_ID_BASIC_AUTH_KEY = "TOKEN_ID";
public static final String USER_BASIC_AUTH_KEY = "USER";
public static final String PASSWORD_BASIC_AUTH_KEY = "PASSWORD";
public static final String BODY_TEXT_RESPONSE_KEY = "ResponseBody";
public static final String STATUS_CODE_RESPONSE_KEY = "ResponseCode";
public static final String USER_AGENT = "continental_1.0";//"orphean_navigator_2.0";
private List<String> cookiesList;
private Map<String, String> responseHeaders;
private int TIMEOUT_MILLI = 10000;
private String charset;
public ConnectionManager(){
this(10000, "ISO-8859-1");
}
public ConnectionManager(int timeout){
this(timeout, "ISO-8859-1");
}
public ConnectionManager(String charset){
this(10000, charset);
}
public ConnectionManager(int timeout, String charset){
this.TIMEOUT_MILLI = timeout;
this.charset = charset;
}
public Map<String, String> sendRequest(URL url, String method, boolean getBodyResponse, boolean watchCookies, boolean sendCookies){
return sendRequest(url, null, false, null, method, getBodyResponse, watchCookies, sendCookies, null);
}
public Map<String, String> sendRequest(URL url, String parameters, boolean encodeParams, Map<String, String> httpAuth, String method, boolean getBodyResponse, boolean watchCookies, boolean sendCookies){
return sendRequest(url, parameters, encodeParams, httpAuth, method, getBodyResponse, watchCookies, sendCookies, null);
}
public Map<String, String> sendRequest(URL url, String parameters, boolean encodeParams, Map<String, String> httpAuth, String method, boolean getBodyResponse, boolean watchCookies, boolean sendCookies, Map<String, String> addHeaders){
String cookieChain = "";
if(sendCookies){
if(cookiesList != null){
for (int i = 0; i < cookiesList.size(); i++) {
String[] cookieParts = cookiesList.get(i).split(";");
cookieChain += cookieParts[0] + ";";
}
cookieChain = cookieChain.substring(0, cookieChain.length() - 1);
}
}
/*if(encodeParams){
//encodeparams pero Fa no hace esas cosas
}*/
HttpURLConnection.setFollowRedirects(false);
HttpURLConnection con;
try {
con = (HttpURLConnection)url.openConnection();
} catch (IOException e) {
e.printStackTrace();
return null;
}
con.setReadTimeout(TIMEOUT_MILLI);
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "es-ES,es;q=0.8,en;q=0.6");
if(addHeaders != null){
for (Map.Entry<String, String> newHeader : addHeaders.entrySet()){
con.setRequestProperty(newHeader.getKey(), newHeader.getValue());
}
}
if(encodeParams){
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
}
if(!cookieChain.isEmpty()){
con.setRequestProperty("Cookie", cookieChain);
}
try {
con.setRequestMethod(method);
} catch (ProtocolException e) {
return null;
}
if(httpAuth != null){
if(httpAuth.containsKey(TOKEN_NAME_BASIC_AUTH_KEY)){
con.setRequestProperty(httpAuth.get(TOKEN_NAME_BASIC_AUTH_KEY), httpAuth.get(TOKEN_ID_BASIC_AUTH_KEY));
}
String authString = httpAuth.get(USER_BASIC_AUTH_KEY) + ":" + httpAuth.get(PASSWORD_BASIC_AUTH_KEY);
String authStringEnc = Base64.encodeBytes(authString.getBytes());
con.setRequestProperty("Authorization", "Basic " + authStringEnc);
}
con.setUseCaches (false);
con.setDoInput(true);
if(parameters != null){
con.setDoOutput(true);
try {
con.getOutputStream().write(parameters.getBytes());
con.getOutputStream().flush();
con.getOutputStream().close();
} catch (IOException e) {
return null;
}
}
int responseCode;
try {
responseCode = con.getResponseCode();
} catch (IOException e) {
responseCode = ErrorDescription.NO_INTERNET_CONNECTION;
}
Map<String, String> result = new HashMap<String, String>();
result.put(STATUS_CODE_RESPONSE_KEY, String.valueOf(responseCode));
catchHeadersResponse(con);
if((responseCode == HttpURLConnection.HTTP_OK) || (responseCode == HttpURLConnection.HTTP_MOVED_TEMP) || responseCode == HttpURLConnection.HTTP_MOVED_PERM){
if(responseCode == HttpURLConnection.HTTP_MOVED_TEMP || responseCode == HttpURLConnection.HTTP_MOVED_PERM){
result.put("Location", con.getHeaderField("Location"));
}
if((watchCookies) && con.getHeaderField("Set-Cookie") != null){
if(cookiesList != null){
cookiesList.clear();
}else{
cookiesList = new ArrayList<String>();
}
for (Map.Entry<String, List<String>> responseHeader : con.getHeaderFields().entrySet()){
if(responseHeader.getKey() == null){
continue;
}
List<String> value = responseHeader.getValue();
System.out.print("\n" + responseHeader.getKey() + ": ");
for (String valueElement : value) {
System.out.print(valueElement);
if(responseHeader.getKey().equals("Set-Cookie")){
cookiesList.add(valueElement);
}
}
}
}
}
if(getBodyResponse){
result.put(BODY_TEXT_RESPONSE_KEY, (retrieveBodyResponse(con, responseCode)));
}
con.disconnect();
return result;
}
private String retrieveBodyResponse(HttpURLConnection con, int responseCode){
BufferedReader in;
try {
if(responseCode >= 400){
try{
in = new BufferedReader(new InputStreamReader(con.getErrorStream()));
}catch(NullPointerException e){
try{
in = new BufferedReader(new InputStreamReader(con.getInputStream()));
}catch(NullPointerException e2){
return null;
}
}
}else{
in = new BufferedReader(new InputStreamReader(con.getInputStream()));
}
} catch (IOException e) {
return null;
}
String inputLine;
StringBuffer response = new StringBuffer();
try {
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
} catch (IOException e) {
return null;
}
try {
return new String(response.toString().getBytes(), this.charset);
} catch (UnsupportedEncodingException e) {
return null;
}
}
private void catchHeadersResponse(HttpURLConnection con){
responseHeaders = new HashMap<String, String>();
for (Map.Entry<String, List<String>> responseHeader : con.getHeaderFields().entrySet()){
if(responseHeader.getKey() == null || responseHeader.getKey().equals("Set-Cookie")){
continue;
}
List<String> value = responseHeader.getValue();
int i = 0;
for (String valueElement : value) {
if(i == 0){
responseHeaders.put(responseHeader.getKey(), valueElement);
}else{
responseHeaders.put(responseHeader.getKey(), responseHeaders.get(responseHeader.getKey()) + ";" + valueElement);
}
i++;
}
}
}
public Map<String, String> getResonseHeaders() {
return responseHeaders;
}
public void setResonseHeaders(Map<String, String> resonseHeaders) {
this.responseHeaders = resonseHeaders;
}
public static void main(String[] args){
URL url;
try {
url = new URL("http://thepiratebay.org");
} catch (MalformedURLException e) {
e.printStackTrace();
return;
}
ConnectionManager cm = new ConnectionManager();
Map<String, String> response = cm.sendRequest(url, ConnectionManager.METHOD_GET, true, false, false);
System.out.println(response);
}
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
}
| [
"[email protected]"
] | |
50bc8b4d5e823c950665330db68a29226e4b4039 | ab1d3be9f0a3233feaa67e350b0d4b25a766cc90 | /app/src/main/java/nigel/com/werfleider/ui/document/LocationDetailDimensionsView.java | ec26edefd87f2d275dfeb418e329ac4ea02e2557 | [] | no_license | NigelHeylen/werfleider | c2182c891c96a06f750e8c0018e703231727ea00 | bf644aceb45ff15cb948dbb992407757e94fd8e4 | refs/heads/master | 2020-12-22T08:16:17.774270 | 2016-10-11T14:43:35 | 2016-10-11T14:43:35 | 30,886,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,404 | java | package nigel.com.werfleider.ui.document;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import butterknife.Bind;
import butterknife.OnTextChanged;
import com.rengwuxian.materialedittext.MaterialEditText;
import java.util.List;
import javax.inject.Inject;
import butterknife.ButterKnife;
import mortar.Mortar;
import nigel.com.werfleider.R;
/**
* Created by nigel on 26/12/15.
*/
public class LocationDetailDimensionsView extends RelativeLayout {
@Inject LocationDetailDimensionsPresenter presenter;
@Bind(R.id.document_length) MaterialEditText length;
@Bind(R.id.document_height) MaterialEditText height;
@Bind(R.id.document_width) MaterialEditText width;
@Bind(R.id.document_quantity) MaterialEditText quantity;
@Bind(R.id.document_ms) MaterialEditText ms;
@Bind(R.id.document_measuring_units) Spinner measuringUnits;
@Bind({ R.id.document_length, R.id.document_width, R.id.document_height}) List<MaterialEditText>
editTexts;
public LocationDetailDimensionsView(final Context context, final AttributeSet attrs) {
super(context, attrs);
if (!isInEditMode()) {
Mortar.inject(context, this);
}
}
@Override protected void onFinishInflate() {
super.onFinishInflate();
if (!isInEditMode()) {
ButterKnife.bind(this);
presenter.takeView(this);
}
}
@Override protected void onAttachedToWindow() {
super.onAttachedToWindow();
if(!isInEditMode()){
ButterKnife.bind(this);
presenter.takeView(this);
}
}
@Override protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
presenter.dropView(this);
ButterKnife.unbind(this);
}
@OnTextChanged(R.id.document_width)
public void changeWidth(){
presenter.changeWidth(width.getText().toString());
}
@OnTextChanged(R.id.document_height)
public void changeHeight(){
presenter.changeHeight(height.getText().toString());
}
@OnTextChanged(R.id.document_length)
public void changeLength(){
presenter.changeLength(length.getText().toString());
}
@OnTextChanged(R.id.document_quantity)
public void changeQuantity(){
presenter.changeQuantity(quantity.getText().toString());
}
@OnTextChanged(R.id.document_ms)
public void changeMS(){
presenter.changeMS(ms.getText().toString());
}
}
| [
"[email protected]"
] | |
2bb0edff7d79c679b0a08ba4f414f648e0ccccbb | 56522f4280d3c5c69e0af95f32e354c5c820a066 | /src/main/java/de/mprengemann/intellij/plugin/androidicons/model/Resolution.java | 56c2a894187499d5948f3904d92f9a909155b4e9 | [
"Apache-2.0"
] | permissive | ligi/android-drawable-importer-intellij-plugin | ba61a05f4cb8243964261e376ac7d7f71ffecf34 | 5bb2363eea9d4c5bd19a1ba0e8457c0fee0672eb | refs/heads/develop | 2020-11-30T16:21:40.287785 | 2015-12-29T19:14:22 | 2015-12-29T19:14:22 | 52,488,365 | 0 | 0 | null | 2016-02-25T01:48:33 | 2016-02-25T01:48:32 | null | UTF-8 | Java | false | false | 2,231 | java | /*
* Copyright 2015 Marc Prengemann
*
* 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 de.mprengemann.intellij.plugin.androidicons.model;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import de.mprengemann.intellij.plugin.androidicons.util.TextUtils;
import java.lang.reflect.Type;
public enum Resolution {
LDPI,
MDPI,
HDPI,
XHDPI,
XXHDPI,
XXXHDPI,
TVDPI;
public static Resolution from(String value) {
if (TextUtils.isEmpty(value)) {
throw new IllegalArgumentException();
}
if (value.equalsIgnoreCase(LDPI.toString())) {
return LDPI;
} else if (value.equalsIgnoreCase(MDPI.toString())) {
return MDPI;
} else if (value.equalsIgnoreCase(HDPI.toString())) {
return HDPI;
} else if (value.equalsIgnoreCase(XHDPI.toString())) {
return XHDPI;
} else if (value.equalsIgnoreCase(XXHDPI.toString())) {
return XXHDPI;
} else if (value.equalsIgnoreCase(XXXHDPI.toString())) {
return XXXHDPI;
} else if (value.equalsIgnoreCase(TVDPI.toString())) {
return TVDPI;
}
return null;
}
public static class Deserializer implements JsonDeserializer<Resolution> {
@Override
public Resolution deserialize(JsonElement jsonElement,
Type type,
JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
return Resolution.from(jsonElement.getAsString());
}
}
}
| [
"[email protected]"
] | |
198a2b4bf323923e86686b48b3d1f73d1a5fd07d | 59fbd8c304b28db7b18972468de6d8364a888a59 | /SoftwareYard/src/com/chillax/softwareyard/activity/LoginActivity.java | 44ca75833c3c318044259453f8e67c7a7f779eba | [] | no_license | wxdut/Duters | 1b0a5ab5cadbceff8b2fd55f03d50e69f25bfa34 | c60b04c39c7bc593c04333ee33ae6db59ae86a1c | refs/heads/master | 2021-01-19T00:57:44.653502 | 2016-06-20T13:23:26 | 2016-06-20T13:23:26 | 61,549,172 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,048 | java | package com.chillax.softwareyard.activity;
import android.app.Dialog;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.widget.TextView;
import android.widget.Toast;
import com.chillax.config.Constant;
import com.chillax.softwareyard.R;
import com.chillax.softwareyard.network.TableDataLoader;
import com.chillax.softwareyard.utils.CusDialog;
import com.chillax.softwareyard.utils.StatesUtils;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
@EActivity(R.layout.login_layout)
public class LoginActivity extends BaseActivity {
private StatesUtils mUtils;
public static final int LOGIN_SUCESS = 0;//登陆成功
public static final int DATA_ERROR = 1;//用户名或者密码错误
public static final int NET_ERROR = 2;//网络不通
public static final int NET_ERROR_2 = 3;//网络正常,但是没有连接校园网
private String userNameStr;
private String userPwdStr;
@ViewById(R.id.stuId)
TextView userName;
@ViewById(R.id.stuPwd)
TextView userPwd;
@ViewById
TextView login;
private Dialog dialog;
@AfterViews
void initViews() {
mUtils = new StatesUtils(this);
mUtils.setFirstUse(false);
userNameStr = mUtils.getUserName();
if (!TextUtils.isEmpty(userNameStr)) {
userName.setText(userNameStr);
}
userPwdStr = mUtils.getUserPwd();
if (!TextUtils.isEmpty(userPwdStr)) {
userPwd.setText(userPwdStr);
}
initLoadingDialog();
}
private void initLoadingDialog() {
dialog = CusDialog.create(this, "登陆中...");
}
private Handler mHandler = new Handler(Looper.myLooper()) {
public void handleMessage(Message msg) {
switch (msg.what) {
case LOGIN_SUCESS:
// loginBmob();
dialog.cancel();
Toast.makeText(LoginActivity.this, "登陆成功~", Toast.LENGTH_SHORT).show();
mUtils.setLoginStates(true);
mUtils.setUserName(userNameStr);
mUtils.setUserPwd(userPwdStr);
MainActivity_.intent(LoginActivity.this).start();
LoginActivity.this.finish();
break;
case DATA_ERROR:
Toast.makeText(LoginActivity.this, "用户名或密码错误~", Toast.LENGTH_SHORT).show();
dialog.cancel();
break;
case NET_ERROR:
Toast.makeText(LoginActivity.this, "网络不可用~", Toast.LENGTH_SHORT).show();
dialog.cancel();
break;
case NET_ERROR_2:
showToast("请确保正确连接到校园网");
dialog.cancel();
break;
}
}
};
@Click
void login() {
userNameStr = userName.getText().toString();
userPwdStr = userPwd.getText().toString();
if (TextUtils.isEmpty(userNameStr) || TextUtils.isEmpty(userPwdStr)) {
Toast.makeText(this, "账号密码不可为空~", Toast.LENGTH_SHORT).show();
} else if (!checkLegal(userNameStr, userPwdStr)) {
Toast.makeText(this, "账号输入不合法~", Toast.LENGTH_SHORT).show();
} else {
mUtils.setUserName(userNameStr);
mUtils.setUserPwd(userPwdStr);
dialog.show();
new TableDataLoader(this, mHandler).execute(userNameStr, userPwdStr);
}
}
private boolean checkLegal(String userNameStr, String userPwdStr) {
boolean b1 = userNameStr.length() == Constant.userNameLength ? true : false;
boolean b2 = userNameStr.replaceAll("\\d", "").length() == 0 ? true : false;
return b1 && b2;
}
}
| [
"[email protected]"
] | |
4eb31447cf2aa7fed40fed41cff0d93ba1bd1912 | 46eee222f55faca8877f8653ec343dde8a634ec2 | /src/main/java/com/rms/leetcode/Leetcode_148.java | e361c6379cc935a99643435888df50365cbd407c | [] | no_license | RanMaosong/LeetCode | db5e139abd029af3257f134e8a107aeda8824ace | cc99ba7099446ee4e6c0e0e838fa9754ea619ea0 | refs/heads/master | 2021-07-09T16:35:16.014480 | 2019-03-21T02:35:32 | 2019-03-21T02:35:32 | 151,026,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,285 | java | package com.rms.leetcode;
public class Leetcode_148 {
public ListNode sortList(ListNode head) {
return operation(head, null);
}
private ListNode operation(ListNode start, ListNode end) {
if (start == end || start.next == end)
return start;
ListNode l = start, r = start, mid = start, cur = start.next;
while (cur != end) {
ListNode pre = cur;
cur = cur.next;
if (pre.val < mid.val) {
pre.next = l;
l = pre;
} else {
r.next = pre;
r = pre;
}
}
r.next = end;
l = operation(l, mid);
mid.next = operation(mid.next, r.next);
return l;
}
public ListNode sortList1(ListNode head) {
if (head == null || head.next == null)
return head;
ListNode slow = head, fast = head, pre=null;
while (fast != null && fast.next != null) {
pre = slow;
slow = slow.next;
fast = fast.next.next;
}
fast = pre.next;
pre.next = null;
return merge(sortList1(head), sortList1(fast));
}
private ListNode merge(ListNode l1, ListNode l2) {
ListNode head=null, tail=null;
while (l1 != null && l2 != null) {
if (l1.val < l2.val) {
if (head == null) {
head = l1;
tail = l1;
} else {
tail.next = l1;
tail = l1;
}
l1 = l1.next;
} else {
if (head == null) {
head = l2;
tail = l2;
} else {
tail.next = l2;
tail = l2;
}
l2 = l2.next;
}
}
if (l2 != null)
l1 = l2;
tail.next = l1;
return head;
}
public static void main(String[] args) {
ListNode list = new ListNode(4);
list.next = new ListNode(2);
list.next.next = new ListNode(1);
list.next.next.next = new ListNode(3);
System.out.println(new Leetcode_148().sortList1(list).show());
}
}
| [
"[email protected]"
] | |
8be2b0282b5a59cb1e103db8c8884b0d7fd20be1 | df0d612d8d37f888af427adda5cc5a1502e48b0b | /app/src/main/java/com/example/myapplication/StringUtils.java | 9cdec03bf561336ee4c21c91e149c195ee6e4324 | [] | no_license | galibujianbusana/edit | f25109a5cbf6b642d5371af4c5ac0e6e767f8c6a | 03f4273b532fd9f88a0fa8ae03c4a284c2e3d47d | refs/heads/master | 2023-01-08T13:12:47.573259 | 2020-11-04T13:52:01 | 2020-11-04T13:52:01 | 310,017,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,134 | java | package com.example.myapplication;
import android.widget.EditText;
class StringUtils {
public static String touzi_ed_values22 = "";
/**
* 在数字型字符串千分位加逗号
*
* @param str
* @param edtext
* @return sb.toString()
*/
public static String addComma(String str, EditText edtext) {
touzi_ed_values22 = edtext.getText().toString().trim().replaceAll(",", "");
boolean neg = false;
if (str.startsWith("-")) { //处理负数
str = str.substring(1);
neg = true;
}
String tail = null;
if (str.indexOf('.') != -1) { //处理小数点
tail = str.substring(str.indexOf('.'));
str = str.substring(0, str.indexOf('.'));
}
StringBuilder sb = new StringBuilder(str);
sb.reverse();
for (int i = 3; i < sb.length(); i += 4) {
sb.insert(i, ',');
}
sb.reverse();
if (neg) {
sb.insert(0, '-');
}
if (tail != null) {
sb.append(tail);
}
return sb.toString();
}
}
| [
"[email protected]"
] | |
5f197cd20fad398307d0e3ac1c9e01026c740173 | 024d9ae1a4aed9a550554e64b3e1b8fa61e46ccc | /Server/src/server/ServerThread.java | 174a2d2676ac832b31995f1bb7f9eaeefbf54974 | [] | no_license | QuietOne/FONup | 37b44298a0cbad09551bb1b3c390d433000753c5 | 16c0e3a40ff9dcdf229e69d890287819a6890676 | refs/heads/master | 2016-09-06T20:00:24.169243 | 2014-11-04T12:03:19 | 2014-11-04T12:03:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,815 | java | package server;
import game.protocol.GameProtocol;
import game.protocol.Status;
import game.protocol.objects.ClientRequest;
import game.protocol.objects.ServerResponse;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Class for threading.
*
* @author Tihomir Radosavljevic
* @author Jelena Tabas
* @version 1.0
*/
public class ServerThread extends Thread {
Socket socket;
public ServerThread(Socket socket) {
this.socket = socket;
}
@Override
public void run() {
try {
startCommunication();
} catch (IOException | ClassNotFoundException ex) {
Logger.getLogger(ServerThread.class.getName()).log(Level.SEVERE, null, ex);
}
}
private void startCommunication() throws IOException, ClassNotFoundException {
while (true) {
ObjectInputStream inputStream
= new ObjectInputStream(socket.getInputStream());
ClientRequest clientRequest
= (ClientRequest) inputStream.readObject();
processRequest(clientRequest);
}
}
private synchronized void processRequest(ClientRequest clientRequest) throws IOException {
GameProtocol protocol = clientRequest.getGameProtocol();
ServerResponse serverResponse = new ServerResponse();
serverResponse.setStatus(Status.NOT_COMPLETE);
System.out.println(clientRequest.getGameProtocol());
switch (protocol) {
case VALIDATION_CLIENT:
serverResponse.setObject(ServerController.getInstance().validationClient(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case LOGIN_CLIENT:
serverResponse.setObject(ServerController.getInstance().loadClient(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case LOAD_HIGHSCORES:
serverResponse.setObject(ServerController.getInstance().loadHighScores(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case LOAD_TOP_HIGHSCORES:
serverResponse.setObject(ServerController.getInstance().loadTopHighScores(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case ADD_RESULT:
serverResponse.setObject(ServerController.getInstance().addResult(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case PREPARE_REGISTER:
serverResponse = ServerController.getInstance().prepareRegister(clientRequest);
break;
case REGISTER:
ServerController.getInstance().register(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case LOAD_CATEGORY_TREE:
serverResponse.setObject(ServerController.getInstance().loadCategoryTree(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case CHANGE_CLIENT_INFO:
ServerController.getInstance().changeClientInformation(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case DELETE_CATEGORY:
ServerController.getInstance().deleteCategory(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case CHANGE_CATEGORY:
ServerController.getInstance().changeCategory(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case ADD_CATEGORY:
ServerController.getInstance().addCategory(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case AUTOCOMPLETE_CLIENT:
serverResponse.setObject(ServerController.getInstance().autocompleteClient(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case DELETE_CLIENT:
ServerController.getInstance().deleteClient(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case DELETE_CLIENTS:
ServerController.getInstance().deleteClients(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case APPROVE_CATEGORY:
ServerController.getInstance().approveCategory(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case APPROVE_CLIENT:
ServerController.getInstance().approveClient(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case APPROVE_QUESTION:
ServerController.getInstance().approveQuestion(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case ADD_QUESTION:
ServerController.getInstance().addQuestion(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case CHANGE_QUESTION:
ServerController.getInstance().changeQuestion(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case GET_QUESTIONS:
serverResponse.setObject(ServerController.getInstance().getQuestions(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case GET_ANSWERS:
serverResponse.setObject(ServerController.getInstance().getAnswers(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case SAVE_TEST:
ServerController.getInstance().saveTest(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case GET_CATEGORY:
serverResponse.setObject(ServerController.getInstance().getCategory(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case AUTOCOMPLETE_QUESTION:
serverResponse.setObject(ServerController.getInstance().autocompleteQuestion(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case GET_QUESTION:
serverResponse.setObject(ServerController.getInstance().getQuestion(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case AUTOCOMPLETE_CATEGORY:
serverResponse.setObject(ServerController.getInstance().autocompleteCategory(clientRequest));
serverResponse.setStatus(Status.COMPLETE);
break;
case CHANGE_QUESTIONS:
ServerController.getInstance().changeQuestions(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
case DELETE_QUESTION:
ServerController.getInstance().deleteQuestion(clientRequest);
serverResponse.setStatus(Status.COMPLETE);
break;
default:
serverResponse.setStatus(Status.PROTOCOL_UNKNOWN);
}
ObjectOutputStream outputStream = new ObjectOutputStream(socket.getOutputStream());
outputStream.writeObject(serverResponse);
System.out.println(serverResponse.getStatus());
}
}
| [
"[email protected]"
] | |
dd8ff0db4939cdbc628c89436bb4946ed000b70d | ea5aa123f6e02b67349ddbea975eaa077c15dbd6 | /src/main/java/com/example/demo/Controller.java | 3848dc53eb769784aa1d22741727fc95d6b2077f | [] | no_license | hariom-sinha58/SpringBootInterceptor | bf3ece123dec41cf7a01e5d3e7a645307805a976 | 96f9592b0ded64112342dd4bff3a976100180a05 | refs/heads/master | 2022-11-27T14:16:20.747241 | 2020-07-30T15:48:09 | 2020-07-30T15:48:09 | 283,815,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Controller {
@RequestMapping(value="/intercept", method=RequestMethod.GET)
public String intercept() {
return "Interceptor Works";
}
}
| [
"[email protected]"
] | |
2458dd7c27655d57fd60782df598dcfb1ec057e8 | 46894f87ec762c35ea9284198a3d130de8586760 | /src/das/list/ExceptionPositionInvalid.java | 4b0eb8b76221650e47f23dbe078927a641a71f8d | [] | no_license | dllen/dsa | d187902d7d9a84691829156bdd4785749d0f5582 | adbddca387679d1c3242efbddfaa1ec3ffb630f7 | refs/heads/master | 2021-01-13T06:36:09.685577 | 2017-02-24T14:32:43 | 2017-02-24T14:32:43 | 81,219,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | package das.list;
public class ExceptionPositionInvalid extends RuntimeException{
/**
*
*/
private static final long serialVersionUID = 7929490452693013786L;
public ExceptionPositionInvalid(String msg) {
super(msg);
}
}
| [
"[email protected]"
] | |
2cf538385a12f7ebc07783e290c195a091b227f5 | 09c12d179be0ddd27311820dcbc5dc0190b0e1b2 | /jonix-common/src/main/java/com/tectonica/jonix/common/struct/JonixFundingIdentifier.java | 49331c79b88fa8ce6a82746b2f37c07c68083c92 | [
"Apache-2.0"
] | permissive | zach-m/jonix | 3a2053309d8df96f406b0eca93de6b25b4aa3e98 | c7586ed7669ced7f26e937d98b4b437513ec1ea9 | refs/heads/master | 2023-08-23T19:42:15.570453 | 2023-07-31T19:02:35 | 2023-07-31T19:02:35 | 32,450,400 | 67 | 23 | Apache-2.0 | 2023-06-01T03:43:12 | 2015-03-18T09:47:36 | Java | UTF-8 | Java | false | false | 1,997 | java | /*
* Copyright (C) 2012-2023 Zach Melamed
*
* Latest version available online at https://github.com/zach-m/jonix
* Contact me at [email protected]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tectonica.jonix.common.struct;
import com.tectonica.jonix.common.JonixKeyedStruct;
import com.tectonica.jonix.common.JonixStruct;
import com.tectonica.jonix.common.codelist.GrantIdentifierTypes;
import java.io.Serializable;
/*
* NOTE: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT MANUALLY
*/
/**
* This class is a {@link JonixStruct} that represents Onix3 <code><FundingIdentifier></code>.
* <p>
* It can be retrieved from the composite by invoking its <code>asStruct()</code> method.
*/
@SuppressWarnings("serial")
public class JonixFundingIdentifier implements JonixKeyedStruct<GrantIdentifierTypes>, Serializable {
public static final JonixFundingIdentifier EMPTY = new JonixFundingIdentifier();
/**
* the key of this struct (by which it can be looked up)
*/
public GrantIdentifierTypes fundingIDType;
/**
* Raw Format: Variable length text, suggested maximum 100 characters
* <p>
* (type: dt.NonEmptyString)
*/
public String idTypeName;
/**
* Raw Format: According to the identifier type specified in <SenderIDType>
* <p>
* (type: dt.NonEmptyString)
*/
public String idValue;
@Override
public GrantIdentifierTypes key() {
return fundingIDType;
}
}
| [
"[email protected]"
] | |
501e7993a3c352cc6818b983c43c3edc232cf9d8 | bead5c9388e0d70156a08dfe86d48f52cb245502 | /MyNotes/thread/c3/c_3_1/c_3_1_3/a11/T1.java | 370c2d65ca832b73bdd634ee5d9b31f260d9b75c | [] | no_license | LinZiYU1996/Learning-Java | bd96e2af798c09bc52a56bf21e13f5763bb7a63d | a0d9f538c9d373c3a93ccd890006ce0e5e1f2d5d | refs/heads/master | 2020-11-28T22:22:56.135760 | 2020-05-03T01:24:57 | 2020-05-03T01:24:57 | 229,930,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,059 | java | package thread.c3.c_3_1.c_3_1_3.a11;
/**
* \* Created with IntelliJ IDEA.
* \* User: LinZiYu
* \* Date: 2020/1/18
* \* Time: 18:12
* \* Description:
* \
*/
public class T1 {
public static void main(String[] args) {
System.out.println("使用关键字静态synchronized");
SyncThread syncThread = new SyncThread();
Thread thread1 = new Thread(syncThread, "SyncThread1");
Thread thread2 = new Thread(syncThread, "SyncThread2");
thread1.start();
thread2.start();
}
}
class SyncThread implements Runnable {
private static int count;
public SyncThread() {
count = 0;
}
public synchronized static void method() {
for (int i = 0; i < 5; i ++) {
try {
System.out.println(Thread.currentThread().getName() + ":" + (count++));
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public synchronized void run() {
method();
}
}
| [
"[email protected]"
] | |
152e98bd9a3f4e041046c226f9b1fa4102f88ece | 3b133789e2dc649f5e3c018f4d521504f8f2a654 | /org.xtext.sdu.iot/src-gen/org/xtext/sdu/ioT/impl/SensorTypeImpl.java | 70c3b99a22703f334db73a00619dceae1343a6c1 | [
"MS-PL"
] | permissive | zdndk/iot-portfolio | b140f785136766d7d9d33d6ca098f4480e39a8ab | adb40a0af17fc5c9b79adb71247656f1ebd93c90 | refs/heads/master | 2020-05-24T08:10:22.421309 | 2019-05-27T17:08:01 | 2019-05-27T17:08:01 | 187,178,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,675 | java | /**
* generated by Xtext 2.16.0
*/
package org.xtext.sdu.ioT.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.xtext.sdu.ioT.IoTPackage;
import org.xtext.sdu.ioT.SensorType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Sensor Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.xtext.sdu.ioT.impl.SensorTypeImpl#getName <em>Name</em>}</li>
* </ul>
*
* @generated
*/
public class SensorTypeImpl extends MinimalEObjectImpl.Container implements SensorType
{
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SensorTypeImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return IoTPackage.Literals.SENSOR_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, IoTPackage.SENSOR_TYPE__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case IoTPackage.SENSOR_TYPE__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case IoTPackage.SENSOR_TYPE__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case IoTPackage.SENSOR_TYPE__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case IoTPackage.SENSOR_TYPE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //SensorTypeImpl
| [
"[email protected]"
] | |
b135bf45b706250a2a5e22793ec812ed41cfc84b | 41bac86d728e5f900e3d60b5a384e7f00c966f5b | /communote/plugins/rest-api/3.0/implementation/src/main/java/com/communote/plugins/api/rest/v30/resource/lastmodificationdate/LastModificationDateResourceHandler.java | 7dabbaee0079fe0fdc3653d2cde2116fc5163a95 | [
"Apache-2.0"
] | permissive | Communote/communote-server | f6698853aa382a53d43513ecc9f7f2c39f527724 | e6a3541054baa7ad26a4eccbbdd7fb8937dead0c | refs/heads/master | 2021-01-20T19:13:11.466831 | 2019-02-02T18:29:16 | 2019-02-02T18:29:16 | 61,822,650 | 27 | 4 | Apache-2.0 | 2018-12-08T19:19:06 | 2016-06-23T17:06:40 | Java | UTF-8 | Java | false | false | 3,308 | java | package com.communote.plugins.api.rest.v30.resource.lastmodificationdate;
import java.util.List;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import com.communote.plugins.api.rest.v30.resource.DefaultParameter;
import com.communote.plugins.api.rest.v30.resource.DefaultResourceHandler;
import com.communote.plugins.api.rest.v30.resource.user.UserResource;
import com.communote.plugins.api.rest.v30.response.ResponseHelper;
import com.communote.plugins.api.rest.v30.service.IllegalRequestParameterException;
import com.communote.server.api.ServiceLocator;
import com.communote.server.api.core.security.AuthorizationException;
import com.communote.server.core.lastmodifieddate.LastModificationDateManagement;
/**
* Handler for {@link UserResource}
*
* @author Communote GmbH - <a href="http://www.communote.com/">http://www.communote.com/</a>
*/
public class LastModificationDateResourceHandler
extends
DefaultResourceHandler<DefaultParameter, DefaultParameter, DefaultParameter, DefaultParameter,
GetCollectionLastModificationDateParameter> {
private final LastModificationDateResourceFactory lastModificationDateResourceFactory = new LastModificationDateResourceFactory();
private final LastModificationDateManagement lastModificationDateManagement = ServiceLocator
.findService(LastModificationDateManagement.class);
private List<LastModificationDateResource> getAttachmentLastModificationDates()
throws AuthorizationException {
return lastModificationDateManagement
.getAttachmentCrawlLastModificationDates(lastModificationDateResourceFactory);
}
private List<LastModificationDateResource> getNoteLastModificationDates()
throws AuthorizationException {
return lastModificationDateManagement
.getNoteCrawlLastModificationDates(lastModificationDateResourceFactory);
}
private List<LastModificationDateResource> getTopicLastModificationDates()
throws AuthorizationException {
return lastModificationDateManagement
.getTopicCrawlLastModificationDates(lastModificationDateResourceFactory);
}
@Override
protected Response handleListInternally(
GetCollectionLastModificationDateParameter listParameter, String requestedMimeType,
UriInfo uriInfo, String requestSessionId, Request request) throws Exception {
List<LastModificationDateResource> dates;
if (listParameter.getType() == null) {
throw new IllegalRequestParameterException("type", "null", "Invalid value.");
}
switch (listParameter.getType()) {
case ATTACHMENT:
dates = getAttachmentLastModificationDates();
break;
case NOTE:
dates = getNoteLastModificationDates();
break;
case TOPIC:
dates = getTopicLastModificationDates();
break;
default:
throw new IllegalRequestParameterException("type", String.valueOf(listParameter
.getType()), "Unknown type.");
}
return ResponseHelper.buildSuccessResponse(dates, request);
}
}
| [
"[email protected]"
] | |
c6f9b1a07f3dc74cee4c37e1dd9ffa603f007b52 | cf33668481cb8215b2bdbf82f39c0952f6159225 | /postgreSQL/postgresql-demo/src/main/java/com/postgresql/demo/util/CodeGenerator.java | e5334ebdef92b0b857d3c9b9efbef8b4ac761c86 | [] | no_license | malin1994515/my-learn-document | 0e63353cb3942262ea72bd320b531052b312f6c1 | fb9c4f1453f7445c2c70fd8a392582feac6c4996 | refs/heads/master | 2023-03-29T10:03:39.201576 | 2021-04-05T01:38:12 | 2021-04-05T01:38:12 | 312,979,704 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 6,269 | java | package com.postgresql.demo.util;
import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.FileOutConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.TemplateConfig;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.VelocityTemplateEngine;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class CodeGenerator {
/**
* <p>
* 读取控制台内容
* </p>
*/
public static String scanner(String tip) {
Scanner scanner = new Scanner(System.in);
StringBuilder help = new StringBuilder();
help.append("请输入" + tip + ":");
System.out.println(help.toString());
if (scanner.hasNext()) {
String ipt = scanner.next();
if (StringUtils.isNotBlank(ipt)) {
return ipt;
}
}
throw new MybatisPlusException("请输入正确的" + tip + "!");
}
// 全局配置
private final static String projectPath = System.getProperty("user.dir");
private final static String outputDir = projectPath + "/src/main/java";
private final static String author = "malin";
// 数据源配置
private final static String url = "jdbc:postgresql://192.168.248.4:5432/postgres";
private final static String schemaName = "public";
private final static String driverName = "org.postgresql.Driver";
private final static String username = "postgres";
private final static String password = "123456";
// 包配置
private final static String parent = "com.postgresql.demo";
public static void main(String[] args) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
gc.setFileOverride(true);
gc.setOutputDir(outputDir);
gc.setAuthor(author);
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl(url);
dsc.setSchemaName(schemaName);
dsc.setDriverName(driverName);
dsc.setUsername(username);
dsc.setPassword(password);
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setModuleName(scanner("模块名"));
pc.setParent(parent);
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
//String templatePath = "/templates/mapper.xml.ftl";
// 如果模板引擎是 velocity
String templatePath = "/templates/mapper.xml.vm";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
/*
cfg.setFileCreate(new IFileCreate() {
@Override
public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
// 判断自定义文件夹是否需要创建
checkDir("调用默认方法创建的目录,自定义目录用");
if (fileType == FileType.MAPPER) {
// 已经生成 mapper 文件判断存在,不想重新生成返回 false
return !new File(filePath).exists();
}
// 允许生成模板文件
return true;
}
});
*/
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
// 配置自定义输出模板
//指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
// templateConfig.setEntity("templates/entity2.java");
// templateConfig.setService();
// templateConfig.setController();
templateConfig.setXml(null);
templateConfig.setController(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
//strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
// 公共父类
//strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// 写于父类中的公共字段
// strategy.setSuperEntityColumns("id");
strategy.setInclude(scanner("表名,多个英文逗号分割").split(","));
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(pc.getModuleName() + "_");
mpg.setStrategy(strategy);
mpg.execute();
}
}
| [
"[email protected]"
] | |
5afcd6cf3b3f24abf1acb5f10c0f368e30111c33 | 990e614aff76621bc65881a6cd41447ff41da09e | /MULE/src/MuleModelPeterTest.java | e3483f4efba7b4f79c573585abdfa5bbe1547b76 | [] | no_license | jtrimm3/repository | 47519ce495c540c98d03cabbe17ef301e3d2892f | 340bab82211d2c69aeb1bed0b7ee5d243316771d | refs/heads/master | 2020-04-08T23:07:23.878935 | 2015-12-04T14:40:51 | 2015-12-04T14:40:51 | 41,610,124 | 0 | 1 | null | 2015-09-16T19:50:01 | 2015-08-29T23:08:23 | Java | UTF-8 | Java | false | false | 1,798 | java | import static org.junit.Assert.*;
import javafx.embed.swing.JFXPanel;
import javafx.stage.Stage;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.junit.Before;
import org.junit.Test;
import javafx.scene.paint.Color;
import java.util.ArrayList;
import java.util.HashMap;
import javafx.scene.control.Button;
import javafx.scene.text.Text;
/**
* Created by Peter on 11/2/2015.
*/
public class MuleModelPeterTest extends TestCase {
MuleModel m;
@Before
public void setup() {
m = new MuleModel(new Stage());
}
// @Test
// public void testBuy() {
// m = new MuleModel(null);
// m = new MuleModel(null);
// HashMap<String, Integer> resources = new HashMap<String, Integer>();
// Player p1 = new Player("Michael", 1, "Human", Color.RED, resources);
// Player p2 = new Player("Peter", 2, "Human", Color.BLUE, resources);
// ArrayList<Player> listOfPlayers = new ArrayList<>();
// listOfPlayers.add(p1);
// m.playerList = listOfPlayers;
// new JFXPanel();
// Button aButton = new Button();
// Text errText = new Text();
// m.setTurningPlayer(p1);
// m.validateBuy(aButton, "2","Mule", errText);
// assertEquals("Can't buy more than one mule", errText.getText(),"Can't buy more than one mule at a time");
// m.validateBuy(aButton, "1","Mule", errText);
// assertEquals("Buying one mule", errText.getText(), "");
// m.validateBuy(aButton, "100","Energy", errText);
// assertEquals("Not enough money: ", errText.getText(), "Not enough money!");
// m.validateBuy(aButton, "a","Energy", errText);
// assertEquals("Need a valid Quantity: ", errText.getText(), "Enter a valid quantity");
// }
} | [
"[email protected]"
] | |
d4f13f3ad1049b9c38de99f11c17aa73c302050b | f841dc4362e616ab60cc8e6ba550f05fe5529ddd | /src/main/java/com/terraforged/api/material/state/States.java | 623c01e00b6a3ffd5a7f93b8ca3dc5c48a91f9eb | [
"MIT"
] | permissive | Sejjaa290/TerraForged | c3ff03bb781d557de056e4bf56123437ac6c7a4c | cf722a369253657664ef2689a33d92a49e6fa0b8 | refs/heads/0.1.x | 2023-02-17T11:52:24.047668 | 2020-12-18T10:46:15 | 2020-12-18T10:46:15 | 331,132,429 | 0 | 0 | MIT | 2021-01-19T23:00:30 | 2021-01-19T23:00:29 | null | UTF-8 | Java | false | false | 2,734 | java | /*
*
* MIT License
*
* Copyright (c) 2020 TerraForged
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.terraforged.api.material.state;
public class States {
public static final StateSupplier BEDROCK = DefaultState.of("minecraft:bedrock").cache();
public static final StateSupplier COARSE_DIRT = DefaultState.of("minecraft:coarse_dirt").cache();
public static final StateSupplier DIRT = DefaultState.of("minecraft:dirt").cache();
public static final StateSupplier GRASS_BLOCK = DefaultState.of("minecraft:grass_block").cache();
public static final StateSupplier PODZOL = DefaultState.of("minecraft:podzol").cache();
public static final StateSupplier CLAY = DefaultState.of("minecraft:clay").cache();
public static final StateSupplier GRAVEL = DefaultState.of("minecraft:gravel").cache();
public static final StateSupplier LAVA = DefaultState.of("minecraft:lava").cache();
public static final StateSupplier PACKED_ICE = DefaultState.of("minecraft:packed_ice").cache();
public static final StateSupplier SAND = DefaultState.of("minecraft:sand").cache();
public static final StateSupplier SMOOTH_SANDSTONE = DefaultState.of("minecraft:smooth_sandstone").cache();
public static final StateSupplier SMOOTH_RED_SANDSTONE = DefaultState.of("minecraft:smooth_red_sandstone").cache();
public static final StateSupplier SNOW_BLOCK = DefaultState.of("minecraft:snow_block").cache();
public static final StateSupplier STONE = DefaultState.of("minecraft:stone").cache();
public static final StateSupplier WATER = DefaultState.of("minecraft:water").cache();
public static void invalidate() {
CachedState.clearAll();
}
}
| [
"[email protected]"
] | |
d1c35d9c9cacd611daec8c12989babc65178c263 | ac97058c3a9dceab0e2173aafa6ce0caa69d1c07 | /javaSE/src/main/java/com.silinx/source/effectivejava/chapter2/item9/trywithresources/TopLine.java | b5c307043388a1fb5c616cfaf851a9ff38dd51b7 | [
"Apache-2.0"
] | permissive | Swagger-Ranger/JavaSrc | 069d9ff800813df9b1000c2181027b956f6afd7c | 4ea91254e4910f67e322a941c81939196b0ea106 | refs/heads/master | 2023-05-26T18:30:08.714889 | 2022-04-23T15:14:41 | 2022-04-23T15:14:41 | 252,048,639 | 1 | 1 | Apache-2.0 | 2023-05-17T17:02:27 | 2020-04-01T02:14:31 | Java | UTF-8 | Java | false | false | 628 | java | package com.silinx.source.effectivejava.chapter2.item9.trywithresources;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class TopLine {
// try-with-resources - the the best way to close resources! (Page 35)
static String firstLineOfFile(String path) throws IOException {
try (BufferedReader br = new BufferedReader(
new FileReader(path))) {
return br.readLine();
}
}
public static void main(String[] args) throws IOException {
String path = args[0];
System.out.println(firstLineOfFile(path));
}
}
| [
"[email protected]"
] | |
78bdf8af3e94fb06b8995873a912f3ee003da1d4 | 482fe32082940c1c2b6b78fedfcf967022564c6e | /Object_Oriented_Software_Construction/Assignment3/report/answers/a3_q1_samples/a.java | 323b4f2f785fee96129f6fa0972cf43a00c010cd | [] | no_license | ulfet/RWTH-Informatik | 9f33b3b8afca8d738119c25a6341b4707f3d8b32 | 38ae6779f97287b838d20caac1706ac3a1e8a183 | refs/heads/main | 2023-02-11T14:05:18.356824 | 2021-01-16T17:55:26 | 2021-01-16T17:55:26 | 330,211,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 170 | java | public class Singleton<T> {
public T getInstance() {
if (instance == null)
instance = new Singleton<T>();
return instance;
}
private T instance = null;
}
| [
"[email protected]"
] | |
00d6416ae4f489721ed06c60c799e29056b8aec4 | e6fc814a76190683f758eb163ece6eab363cc40d | /src/main/java/com/hilti/recommendation/controller/AccountMasterController.java | 81eadc9ad05ec07bd569798a15b2c7a1bae69bdb | [] | no_license | vippujain/HiltiR | d55c20f94eddc8580795091d673f6522f7c046ba | c478f574f28c75a80430bfde8d7ae43d5cf48a7a | refs/heads/master | 2021-05-14T20:55:12.314414 | 2017-11-22T09:06:10 | 2017-11-22T09:06:10 | 111,660,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,212 | java | package com.hilti.recommendation.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.hilti.recommendation.model.AccountMaster;
import com.hilti.recommendation.service.AccountMasterService;
@RestController
@RequestMapping(value = "hilti/account/master", produces = "application/json")
public class AccountMasterController {
@Autowired
private AccountMasterService accountMasterService ;
@RequestMapping(value = "/save", method = RequestMethod.POST)
public List<AccountMaster> save(@RequestBody List<AccountMaster> accountMasters) {
return accountMasterService.save(accountMasters);
}
@RequestMapping(value = "/config", method = RequestMethod.POST)
public List<AccountMaster> config() {
return accountMasterService.config();
}
@RequestMapping(value = "/data", method = RequestMethod.POST)
public List<AccountMaster> getData() {
return accountMasterService.getData();
}
}
| [
"[email protected]"
] | |
1a017b8f4fbd2cbe8c4031d6294ce4b64ae70cb4 | bd8a4a7516591030a04959360c8ce656408958f6 | /editor/Sprite Editor Source/thetaeditor/SpriteFrame.java | 77ccedbdcf569f93f4a8d5f333b6bb110f0f0331 | [] | no_license | impiaaa/theta-12 | 9cdec34ca2c510f1c0d7b20b96d8363215065a35 | 5d886334c9562bc0554be8fa01576e46ca965723 | refs/heads/master | 2020-05-16T23:16:11.824641 | 2013-06-18T04:56:27 | 2013-06-18T04:56:27 | 32,187,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,329 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* SpriteFrame.java
*
* Created on Apr 14, 2010, 7:11:25 PM
*/
package thetaeditor;
import java.util.LinkedList;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JOptionPane;
import javax.swing.JFrame;
import java.util.Enumeration;
/**
*
* @author garrett
*/
public class SpriteFrame extends JFrame {
private LinkedList<SeqPanel> seqPanels = new LinkedList<SeqPanel>();
private Sprite editing;
public SpriteFrame() {
this(null);
}
/** Creates new form SpriteFrame */
public SpriteFrame(Sprite editing) {
initComponents();
if (editing == null) {
editing = new Sprite();
} else {
Enumeration<String> keys = editing.sequences.keys();
while (keys.hasMoreElements()) {
String k = keys.nextElement();
System.out.println("Loading Sequence " + k);
SeqPanel sp = new SeqPanel(
defaultSequenceGroup, editing.sequences.get(k));
if (k.equals(editing.defaultSequence))
sp.setDefault(true);
seqPanels.add(sp);
}
nameField.setText(editing.name);
}
this.editing = editing;
if (seqPanels.size() == 0)
addSequence(null);
sequencesPanel.setLayout(new GridBagLayout());
Listener l = new Listener();
addSeqButton.addActionListener(l);
removeSeqButton.addActionListener(l);
okayButton.addActionListener(l);
cancelButton.addActionListener(l);
layoutSequences();
}
/** 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() {
defaultSequenceGroup = new javax.swing.ButtonGroup();
jLabel1 = new javax.swing.JLabel();
nameField = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
sequencesPanel = new javax.swing.JPanel();
okayButton = new javax.swing.JButton();
cancelButton = new javax.swing.JButton();
addSeqButton = new javax.swing.JButton();
removeSeqButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Sprite");
jLabel1.setText("Name");
nameField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
nameFieldActionPerformed(evt);
}
});
javax.swing.GroupLayout sequencesPanelLayout = new javax.swing.GroupLayout(sequencesPanel);
sequencesPanel.setLayout(sequencesPanelLayout);
sequencesPanelLayout.setHorizontalGroup(
sequencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 372, Short.MAX_VALUE)
);
sequencesPanelLayout.setVerticalGroup(
sequencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 215, Short.MAX_VALUE)
);
jScrollPane1.setViewportView(sequencesPanel);
okayButton.setText("Okay");
cancelButton.setText("Cancel");
addSeqButton.setText("Add Sequence");
removeSeqButton.setText("Remove Sequence");
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)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(nameField, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(okayButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cancelButton))
.addGroup(layout.createSequentialGroup()
.addComponent(addSeqButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(removeSeqButton)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(addSeqButton)
.addComponent(removeSeqButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(okayButton)
.addComponent(cancelButton)))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void nameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nameFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_nameFieldActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
SpriteFrame sf = new SpriteFrame();
sf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
sf.setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton addSeqButton;
private javax.swing.JButton cancelButton;
private javax.swing.ButtonGroup defaultSequenceGroup;
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextField nameField;
private javax.swing.JButton okayButton;
private javax.swing.JButton removeSeqButton;
private javax.swing.JPanel sequencesPanel;
// End of variables declaration//GEN-END:variables
public Sprite getSprite() {
Sprite sprite = new Sprite();
sprite.name = nameField.getText();
for (SeqPanel sp : seqPanels) {
if (sp.isSequenceDefault())
sprite.defaultSequence = sp.getSequenceName();
sprite.sequences.put(sp.getSequenceName(), sp.getSequence());
}
return sprite;
}
private void layoutSequences() {
sequencesPanel.removeAll();
for (int i = 0; i < seqPanels.size(); i++) {
SeqPanel sp = seqPanels.get(i);
GridBagConstraints gc = new GridBagConstraints();
gc.gridx = 0;
gc.gridy = i;
gc.gridwidth = 1;
gc.gridheight = 1;
gc.insets = new Insets(0, 0, 0, 0);
gc.ipadx = gc.ipadx= 0;
sequencesPanel.add(sp, gc);
}
sequencesPanel.setVisible(false);
sequencesPanel.setVisible(true);
}
private void addSequence(Sequence seq) {
if (seq == null) seq = new Sequence();
SeqPanel sp = new SeqPanel(defaultSequenceGroup, seq);
seqPanels.add(sp);
layoutSequences();
}
private SpriteFrame getSelf() {
return this;
}
class Listener implements ActionListener {
public void actionPerformed(ActionEvent e) {
if (e.getSource() == addSeqButton) {
addSequence(null);
} else if (e.getSource() == removeSeqButton) {
int total = 0;
for (SeqPanel sp : seqPanels)
if (sp.isSelected())
total++;
if (total == 0) return;
if (total > 1) {
int confirm = JOptionPane.showConfirmDialog(getSelf(),
"Delete " + total + " frames?");
if (confirm != JOptionPane.YES_OPTION) return;
}
for (int i = 0; i < seqPanels.size(); i++) {
if (seqPanels.get(i).isSelected()) {
seqPanels.remove(i);
i--; // order may have changed
}
}
layoutSequences();
} else if (e.getSource() == okayButton) {
editing.read(getSprite().store());
setVisible(false);
dispose();
} else if (e.getSource() == cancelButton) {
setVisible(false);
dispose();
}
}
}
}
| [
"garrett.malmquist@9bc04876-1b4d-11df-8bc4-a52d3ea79963"
] | garrett.malmquist@9bc04876-1b4d-11df-8bc4-a52d3ea79963 |
de22016909aed0584f4569959dc5626b1ee79d19 | f62a0abc0ce79ca822b8653dc764d6ae113ea4bd | /initializr-generator/src/main/java/eu/xenit/alfred/initializr/generator/buildsystem/gradle/IGradleBuild.java | 5caf43a0f8c2b62d325fdbe45bcf8e70d04887e4 | [
"Apache-2.0"
] | permissive | xenit-eu/start.xenit.eu | b6ec6ffd4183a1d9e44184f11824a29b05d0ea1a | 4d4a8881a0f54337c7583e80f162ebe4a5c916b0 | refs/heads/master | 2023-06-11T18:16:42.781143 | 2021-07-15T12:42:02 | 2021-07-15T12:42:02 | 185,811,312 | 3 | 0 | Apache-2.0 | 2021-07-15T12:42:03 | 2019-05-09T14:06:37 | Java | UTF-8 | Java | false | false | 491 | java | package eu.xenit.alfred.initializr.generator.buildsystem.gradle;
import eu.xenit.alfred.initializr.generator.buildsystem.Build;
import io.spring.initializr.generator.buildsystem.gradle.GradlePluginContainer;
import io.spring.initializr.generator.buildsystem.gradle.GradleTaskContainer;
public interface IGradleBuild extends Build {
GradlePluginContainer plugins();
GradleTaskContainer tasks();
//void customizeTask(String taskName, Consumer<TaskCustomization> customizer);
}
| [
"[email protected]"
] | |
a4e2ff16881a880a0401435213454d7a06292882 | c0d1f639768a0d6dcc607fe1d721bab44b2cdb2c | /windingapp/app/src/main/java/app/winding/com/windingapp/util/CProgressDialogUtils.java | fa967e1a01defe2c66d8aa8ee37a16a31a8f5f30 | [] | no_license | weijiaqi/-windingapp | 87f2e9f834422271b4cc25214c6a5c0ad651dffd | 45c22d29b75503e5d8c172faaff72f7e3a4b6532 | refs/heads/master | 2022-12-07T14:17:50.857021 | 2020-08-26T12:15:31 | 2020-08-26T12:15:31 | 290,486,308 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,155 | java | package app.winding.com.windingapp.util;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
/**
* Created by Vector on 2016/8/12 0012.
*/
public class CProgressDialogUtils {
private static final String TAG = CProgressDialogUtils.class.getSimpleName();
private static ProgressDialog sCircleProgressDialog;
private CProgressDialogUtils() {
throw new UnsupportedOperationException("cannot be instantiated");
}
public static void showProgressDialog(Activity activity) {
showProgressDialog(activity, "加载中", false, null);
}
public static void showProgressDialog(Activity activity, DialogInterface.OnCancelListener listener) {
showProgressDialog(activity, "加载中", true, listener);
}
public static void showProgressDialog(Activity activity, String msg) {
showProgressDialog(activity, msg, false, null);
}
public static void showProgressDialog(Activity activity, String msg, DialogInterface.OnCancelListener listener) {
showProgressDialog(activity, msg, true, listener);
}
public static void showProgressDialog(final Activity activity, String msg, boolean cancelable, DialogInterface.OnCancelListener listener) {
if (activity == null || activity.isFinishing()) {
return;
}
if (sCircleProgressDialog == null) {
sCircleProgressDialog = new ProgressDialog(activity);
sCircleProgressDialog.setMessage(msg);
sCircleProgressDialog.setOwnerActivity(activity);
sCircleProgressDialog.setOnCancelListener(listener);
sCircleProgressDialog.setCancelable(cancelable);
} else {
if (activity.equals(sCircleProgressDialog.getOwnerActivity())) {
sCircleProgressDialog.setMessage(msg);
sCircleProgressDialog.setCancelable(cancelable);
sCircleProgressDialog.setOnCancelListener(listener);
} else {
//不相等,所以取消任何ProgressDialog
cancelProgressDialog();
sCircleProgressDialog = new ProgressDialog(activity);
sCircleProgressDialog.setMessage(msg);
sCircleProgressDialog.setCancelable(cancelable);
sCircleProgressDialog.setOwnerActivity(activity);
sCircleProgressDialog.setOnCancelListener(listener);
}
}
if (!sCircleProgressDialog.isShowing()) {
sCircleProgressDialog.show();
}
}
public static void cancelProgressDialog(Activity activity) {
if (sCircleProgressDialog != null && sCircleProgressDialog.isShowing()) {
if (sCircleProgressDialog.getOwnerActivity() == activity) {
sCircleProgressDialog.cancel();
sCircleProgressDialog = null;
}
}
}
public static void cancelProgressDialog() {
if (sCircleProgressDialog != null && sCircleProgressDialog.isShowing()) {
sCircleProgressDialog.cancel();
sCircleProgressDialog = null;
}
}
}
| [
"[email protected]"
] | |
48afb812eb7030f87a699b9a080b3af200173635 | fe8d5b6d9232a26e7003733e3d6c717bbde5a71a | /BeyondAR_Framework/src/com/beyondar/android/opengl/renderable/Renderable.java | 033329a113a99f4237c90a6143d549dbe2133972 | [] | no_license | mblancomu/mercappdillos | be6c909bf5b9cda7cf46fde52eacf3238af30914 | bf44c3e3d62459514b85631e24f24478b0a4a805 | refs/heads/master | 2021-01-23T22:06:19.727898 | 2015-09-23T15:56:19 | 2015-09-23T15:56:19 | 21,873,007 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,958 | java | /*
* Copyright (C) 2013 BeyondAR
*
* 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.beyondar.android.opengl.renderable;
import javax.microedition.khronos.opengles.GL10;
import com.beyondar.android.opengl.renderer.ARRenderer;
import com.beyondar.android.opengl.texture.Texture;
import com.beyondar.android.util.math.geom.Plane;
import com.beyondar.android.util.math.geom.Point3;
import com.beyondar.android.world.BeyondarObject;
public interface Renderable {
/** The draw method to be used by OpenGL */
public void draw(GL10 gl, Texture defaultTexture);
/**
* Update the renderer before the draw method is called.
*
* @param time
* The time mark.
* @param distance
* The distance form the camera in meters.
* @return True to force to paint the object, false otherwise. If false, the
* {@link ARRenderer} will draw it if it close enough to the camera
*/
public boolean update(long time, double distance,
BeyondarObject beyondarObject);
/**
* This method is called when the renderable is not painted because is too
* far
*/
public void onNotRendered(double dst);
public Texture getTexture();
public Plane getPlane();
public void setPosition(float x, float y, float z);
public Point3 getPosition();
public void setAngle(float x, float y, float z);
public Point3 getAngle();
public long getTimeFlag();
// public void setGeoObject(GeoObject object);
}
| [
"[email protected]"
] | |
9d59f38e40a342c8e3dce9fe9445d8b6177df466 | 4106c7799052b9bf1031095485602bdfa74f9b49 | /Java/Recursion-1/changePi.java | 7e01b745474601bfe3e2d4aa1225eb5635f70893 | [] | no_license | EfeOzG/CodingBatSolutions | d6a1b2affec3892434f538831afb5feb4248b86a | 56bf12c52d33817573cf6652cbcb745d73abf986 | refs/heads/main | 2023-08-17T05:44:10.931241 | 2021-09-19T21:29:21 | 2021-09-19T21:29:21 | 397,823,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 376 | java | // Given a string, compute recursively (no loops) a new string where all appearances of "pi"
// have been replaced by "3.14".
public String changePi(String str) {
if (str.length() <= 1) return str;
if (str.substring(0, 2).equals("pi")) {
return "3.14" + changePi(str.substring(2));
} else {
return str.charAt(0) + changePi(str.substring(1));
}
} | [
"[email protected]"
] | |
233aafaedb6df0de71adaf19e4e47907066f2815 | 8793801186f24e31d3421724bd671d5d3793515b | /eclipse/Collection_and_generic/src/Application.java | d2394109c124aa76771f7331857ac65cbfcaf8d2 | [] | no_license | mindsparker2158/Code_dump_yard | 2424a5b310109adcfed4ede5225f0ee35538e78b | f045be35ac606fb22b8094dccf1738c59115aac8 | refs/heads/master | 2023-08-21T14:53:12.313952 | 2021-09-08T17:24:57 | 2021-09-08T17:24:57 | 404,412,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 509 | java | import java.util.ArrayList;
import java.util.Scanner;
public class Application {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter First number : ");
int first= scan.nextInt();
System.out.println("Enter second number : ");
int second = scan.nextInt();
ArrayList<Integer> number = new ArrayList<Integer>();
number.add(first);
number.add(second);
int num1 = number.get(0);
int num2 = number.get(1);
System.out.println(num1 + num2);
}
}
| [
"[email protected]"
] | |
57337ecaaad325ad6843492ec392099e545f95fe | bb31ca75f982feab5b0c44911e525a3f9de74f3f | /src/com/hanyu/desheng/db/GroupDao.java | 1151082dd346d737f18c13c3e91f803481bd597d | [] | no_license | zhangshiqiang/desheng | 6b95045b2c19bf888cfa5cfe962281b48c5f9b6f | ced5a54916143f051421eaf7250753edb409e15e | refs/heads/master | 2021-01-10T01:44:08.533745 | 2015-12-23T06:29:21 | 2015-12-23T06:29:21 | 47,814,768 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 920 | java | package com.hanyu.desheng.db;
import java.util.List;
import com.hanyu.desheng.bean.GroupBean;
import com.hanyu.desheng.util.ShUtils;
import com.leaf.library.db.TemplateDAO;
public class GroupDao extends TemplateDAO<GroupBean,String>{
public GroupDao() {
super(ShUtils.getDbhelper());
}
private static GroupDao dao;
private static GroupDao getDao(){
if(dao==null){
dao=new GroupDao();
}
return dao;
}
public static void saveGroup(GroupBean gb){
getDao().insert(gb);
}
/**
* 是否已存在
* @param groupid
* @param hxusername
* @return
*/
public static boolean getGroup(String groupid,String hxusername){
String selection="groupid=? and hxusername=?";
String selectionArgs[]=new String[]{groupid,hxusername};
List<GroupBean> list=getDao().find(null, selection, selectionArgs,null,null,null,null);
if(list.size()>0){
return true;
}else{
return false;
}
}
}
| [
"[email protected]"
] | |
94c1601549b6d916e28dadb3dc4fc4e0b6b1269f | 1a5950f64c53669c9dd0d9e903fbfd79829c6e6a | /src/main/java/com/clsaa/janus/admin/entity/vo/v1/RequestParamV1.java | 1ee8067b8835fd4366ab91568f8db93a62a47c3f | [
"Apache-2.0"
] | permissive | sdtm1016/janus-admin-server | 160df6185ba31e70b2217f62a0c80fa2d99e2bc9 | b17abb70e92b08f2f18a2eadd8cb835b522f4bab | refs/heads/master | 2020-04-07T15:46:50.337160 | 2018-05-29T20:05:57 | 2018-05-29T20:05:57 | 158,500,598 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 929 | java | package com.clsaa.janus.admin.entity.vo.v1;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* 客户端到网关的请求参数视图层对象
*
* @author 任贵杰 [email protected]
* @since 2018-05-17
*/
@Getter
@Setter
public class RequestParamV1 implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private String id;
/**
* 参数名
*/
private String name;
/**
* 参数位置,1为path,2为query,3为head,4为body
*/
private Integer location;
/**
* 参数描述
*/
private String description;
/**
* 参数类型,1为String,2为Int,3为Long,4为Float,5为Double,6为Boolean
*/
private Integer type;
/**
* 是否必填,0为非必填,1为必填
*/
private Integer required;
/**
* 参数顺序
*/
private Integer sort;
}
| [
"[email protected]"
] | |
9ec60f8d9fd8ee90957666da22a5b0306f80e6ce | 8a49281e6921eec5e558bcb0e3959380c0ebe231 | /jimapp-core/captcha/src/main/java/com.jim.captcha/core/predefined/DiffuseRippleFilterFactory.java | 1d3f7213054e4a102aa2ae4e0b282db95d9755d7 | [] | no_license | liu1084/jim-app | 3daf3bbc86c27d5d0784784f19a13d6f51ad0e06 | 7d7088fc8615946986d12cb8c470ecd6b11d22e4 | refs/heads/master | 2020-12-24T11:46:57.297241 | 2017-04-05T19:25:17 | 2017-04-05T19:25:17 | 85,742,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,576 | java | /*
* Copyright © 2016 JIM liu
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.jim.captcha.core.predefined;
import com.jim.captcha.core.library.DiffuseImageOp;
import java.awt.image.BufferedImageOp;
import java.util.ArrayList;
import java.util.List;
public class DiffuseRippleFilterFactory extends RippleFilterFactory {
protected DiffuseImageOp diffuse = new DiffuseImageOp();
@Override
protected List<BufferedImageOp> getPreRippleFilters() {
List<BufferedImageOp> list = new ArrayList<BufferedImageOp>();
list.add(diffuse);
return list;
}
}
| [
"[email protected]"
] | |
d452f4338530faa0843fb0e3d20ff6ca4e263e6c | 608c604e3eb1aae31d622a206e2ac0e7fd95020c | /SnapShoot/app/src/main/java/com/dal_a/snapshoot/card/SelectableCardView.java | b62c768e2b00d65c5f89ac3f158ac5799a7133d5 | [] | no_license | JiaYoon/SweetProject | f9e39a14e1d0a82511d3b28a8efcd014b3ce30a8 | 24744357814bd869d6d92ec387eb4864b915fd2e | refs/heads/master | 2021-01-20T18:47:54.185148 | 2016-06-09T13:17:03 | 2016-06-09T13:17:03 | 60,775,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,065 | java | package com.dal_a.snapshoot.card;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
import com.dal_a.snapshoot.R;
import com.dal_a.snapshoot.model.SquareImageCardView;
/**
* Created by GA on 2015. 9. 20..
*/
public class SelectableCardView extends SquareImageCardView<SelectableCard> {
public SelectableCardView(Context context) {
super(context);
}
public SelectableCardView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SelectableCardView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void build(SelectableCard card) {
super.build(card);
TextView name = (TextView)findViewById(R.id.name);
name.setText(card.getName());
if(card.isSelecting()) setSelected(true);
else setSelected(false);
}
@Override
public void setSelected(boolean selected) {
super.setSelected(selected);
}
}
| [
"[email protected]"
] | |
46b27c6d0074d176b96ad1ce8b6c74addd4b2e72 | ef044f30543e4e7f36b15f9763a779e866e7c246 | /src/com/kh/cool/purchase/model/vo/CartIngredient.java | 752fc97d6086f9bdedc2fd42170140f130f31523 | [] | no_license | juhS/semipjtsjh | 89732bcee7fa0ff06eda08bf3613ef1c49d51dfe | 2dda1e636710be971582eebee39c23a18d322339 | refs/heads/master | 2023-04-21T06:48:20.346993 | 2021-05-21T15:51:40 | 2021-05-21T15:51:40 | 369,580,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | package com.kh.cool.purchase.model.vo;
public class CartIngredient implements java.io.Serializable{
private String iCode;
private int num;
public CartIngredient() {}
public CartIngredient(String iCode, int num) {
super();
this.iCode = iCode;
this.num = num;
}
public String getiCode() {
return iCode;
}
public void setiCode(String iCode) {
this.iCode = iCode;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
@Override
public String toString() {
return "CartIngredient [iCode=" + iCode + ", num=" + num + "]";
}
}
| [
"ju_hy@DESKTOP-1OR0E3A"
] | ju_hy@DESKTOP-1OR0E3A |
c238730ca06e97cb4e8b07c04956a8b6154033d8 | 2b71e49c38aa7196396a28612b269baa500ca474 | /signcar/signcar-service/src/main/java/com/yy/ent/platform/signcar/service/yyp/ActivityHandler.java | fba14ddf9fec121bf88d53b2654e6cbe15a7ed68 | [] | no_license | renmeng8875/java-yy | 055f01694b614518c332f4d2387857b3676c7b44 | 52f8d2e5c86e2ff04875ed95b9a5f8c00f4a468c | refs/heads/master | 2021-05-12T06:22:40.180490 | 2018-01-12T09:40:45 | 2018-01-12T09:40:45 | 117,217,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,071 | java | package com.yy.ent.platform.signcar.service.yyp;
import com.yy.ent.commons.protopack.util.Uint;
import com.yy.ent.platform.core.spring.SpringHolder;
import com.yy.ent.platform.signcar.common.constant.YYPConstant;
import com.yy.ent.platform.signcar.common.mongodb.ActivityConfig;
import com.yy.ent.platform.signcar.service.activity.ActivityConfigService;
import com.yy.ent.platform.signcar.service.car.ActivityService;
import com.yy.ent.platform.signcar.service.car.NotifyService;
import com.yy.ent.srv.builder.Dispatch;
import com.yy.ent.srv.protocol.Constants;
import org.apache.commons.lang3.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* ActivityHandler
*
* @author suzhihua
* @date 2015/11/11.
*/
public class ActivityHandler extends BaseYYPHandler {
ActivityConfigService activityConfigService = SpringHolder.getBean(ActivityConfigService.class);
NotifyService notifyService = SpringHolder.getBean(NotifyService.class);
ActivityService activityService = SpringHolder.getBean(ActivityService.class);
/**
* 活动是否进行中
*
* @throws Exception
*/
@Dispatch(uri = Constants.MSG_MAX_RECV_SERVER_PROXY_PC, max = YYPConstant.PC.MAX, min = YYPConstant.PC.REQUEST_CAR_IS_OPEN)
public void isOpenActivity() throws Exception {
getPublicComboYYHeaderPC("isOpenActivity");
Long activityId = activityConfigService.getCurrentActivityId();
Map<String, Object> result = new HashMap<String, Object>();
ActivityConfig activityConfig = activityConfigService.getActivityConfig(activityId);
if (activityId >= 0 && activityConfigService.isActivityOpen(activityId)) {
String url = activityConfig.getUrl();
if (StringUtils.isNotBlank(url)) result.put("url", url);
}
if (activityId < 0) {
result.put("isOpen", false);
responsePC(result);
return;
}
String clazz = activityConfig.getClazz();
if ("car".equals(clazz)) {
if (!isLivingRoom(getComboYYHeader().getTopCh().toString(), getComboYYHeader().getSubCh().toString())) {
result.put("isOpen", false);
responsePC(result);
return;
}
//正常流程
String chid = getChidPC();
Map<String, Object> result2 = activityService.getActivityResult(activityId, chid);
result.putAll(result2);
responsePC(result);
//广播用户进来
Uint uid = getComboYYHeader().getUid();
notifyService.addNotifyUserEntry(activityId, chid, uid.longValue());
} else {
result.put("isOpen", false);
responsePC(result);
}
}
/**
* 检测是否直播间
*
* @return
* @throws Exception
*/
private boolean isLivingRoom(String topCh, String subCh) throws Exception {
if (!topCh.equals(subCh)) {
return false;
}
return activityService.isLivingRoom(topCh, subCh);
}
}
| [
"[email protected]"
] | |
fe6d43329eeac97e05d7726e48ae07b80a82e0d2 | 9151c663c6057949196f4a378b9a922d94b7dac6 | /app/src/main/java/com/example/fragmentindepthapp/Constant.java | 2ee8ad47a9eb7c195c2060598a3e08314cd2458e | [] | no_license | rajpoot-shikha/Fragment_AddToBackStack | 5f36264ed6c5193e853cc230cac054c7e6332376 | 442e3683cfb8f1b876873b2b5b25a858224c4277 | refs/heads/master | 2020-09-18T18:38:20.925089 | 2019-11-26T10:52:55 | 2019-11-26T10:52:55 | 224,166,541 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | package com.example.fragmentindepthapp;
//contains the constants used in application
class Constant {
static final String FRAGMENT_ONE = "fragmentOne";
static final String FRAGMENT_TWO = "fragmentTwo";
}
| [
"[email protected]"
] | |
490338aabb9b45103e807895d0b162605f6f3ab3 | 951455c29450e65e23d7718bb75bd2448c2fc2fe | /test/com/app/junit/MyMathTest.java | 4a03ef858ab7a52d01ce9bc359ddc477c87fc5fd | [] | no_license | shivam6898/JunitTesting | 06bb9f0dd96a8a44a02c4b35d869fe8292efe396 | 1310146ef0c9c67b93dad473988ba27be08b4e58 | refs/heads/master | 2022-12-26T21:37:24.602398 | 2020-10-08T10:10:47 | 2020-10-08T10:10:47 | 302,301,747 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 763 | java | package com.app.junit;
import static org.junit.Assert.assertEquals;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.jupiter.api.Test;
//Absence if failure is success.
class MyMathTest {
@Test
public void sum_With3Number() {
MyMath myMath= new MyMath();
assertEquals(6, myMath.sum(new int[] {1,2,3})); //alt+shift+i to inline
}
//some of the anotations are
@Before
public void before() {
System.out.println("before...");
}
@After
public void after() {
System.out.println("after");
}
@BeforeClass
public static void beforeClass() {
System.out.println("before class");
}
@AfterClass
public void AfterClass() {
System.out.println("after class");
}
}
| [
"[email protected]"
] | |
c33dabf75eed3cd8315f3ffea434d3c6f18fd649 | 6cc2595fb4fce1646d623a702ff37a20598da7a4 | /schema/ab-products/solutions/common/src/test/org/springframework/security/providers/ldap/ad/AllTestsRealServer.java | 7268ce2c294b300a2612203386414f4f7b50b70f | [] | no_license | ShyLee/gcu | 31581b4ff583c04edc64ed78132c0505b4820b89 | 21a3f9a0fc6e4902ea835707a1ec01823901bfc3 | refs/heads/master | 2020-03-13T11:43:41.450995 | 2018-04-27T04:51:27 | 2018-04-27T04:51:27 | 131,106,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package org.springframework.security.providers.ldap.ad;
import junit.framework.*;
/**
*
* <p>
* Uses real LDAP/ActiveDirectory server. {See AbstractLdapIntegrationTests}
*
* @author Valery Tydykov
*
*/
public class AllTestsRealServer extends TestCase {
public AllTestsRealServer(String s) {
super(s);
}
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(org.springframework.security.providers.ldap.ad.populator.AllTestsRealServer
.suite());
suite
.addTest(org.springframework.security.providers.ldap.ad.authenticator.AllTestsRealServer
.suite());
return suite;
}
}
| [
"[email protected]"
] | |
d4858e296f14fa46fb0dd0e99bdb8d2101f059d8 | c45813bc216e4646caa5d654e7a6dd3cf0cdaeb7 | /engine/src/main/java/com/kinglloy/album/engine/video/VideoWallpaper.java | b69054b3c9a4e56dbc1d58a8a9c67cd4aab74ea8 | [] | no_license | paijwar/LWA | 732f5d0e44b3316bd538c0442cd4440fc12fd215 | 550ec5b6389ffee4a4b8e621970d7ebe4db89dc7 | refs/heads/master | 2022-03-24T04:57:39.346402 | 2019-09-30T07:40:54 | 2019-09-30T07:40:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 930 | java | package com.kinglloy.album.engine.video;
import android.content.Context;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.badlogic.gdx.backends.android.AndroidLiveWallpaperService;
import com.yalin.style.engine.GDXWallpaperServiceProxy;
import org.jetbrains.annotations.NotNull;
/**
* @author jinyalin
* @since 2017/11/8.
*/
public class VideoWallpaper extends GDXWallpaperServiceProxy {
private String filePath;
public VideoWallpaper(@NotNull Context host, String filePath) {
super(host);
this.filePath = filePath;
}
@Override
public void onCreateApplication() {
super.onCreateApplication();
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useGLSurfaceView20API18 = true;
config.useAccelerometer = false;
initialize(new VideoRenderer(this, filePath), config);
}
}
| [
"[email protected]"
] | |
bf3c7b7fa38cf0524d1820405ce13631dcb0f795 | 7653e008384de73b57411b7748dab52b561d51e6 | /SrcGame/dwo/gameserver/handler/bypasses/ManorManager.java | 1381ff729b1fbcf85653db124df4d2cc656be204 | [] | no_license | BloodyDawn/Ertheia | 14520ecd79c38acf079de05c316766280ae6c0e8 | d90d7f079aa370b57999d483c8309ce833ff8af0 | refs/heads/master | 2021-01-11T22:10:19.455110 | 2017-01-14T12:15:56 | 2017-01-14T12:15:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,648 | java | package dwo.gameserver.handler.bypasses;
import dwo.gameserver.handler.BypassHandlerParams;
import dwo.gameserver.handler.CommandHandler;
import dwo.gameserver.handler.TextCommand;
import dwo.gameserver.instancemanager.castle.CastleManager;
import dwo.gameserver.instancemanager.castle.CastleManorManager;
import dwo.gameserver.model.actor.L2Npc;
import dwo.gameserver.model.actor.instance.L2PcInstance;
import dwo.gameserver.model.world.residence.castle.Castle;
import dwo.gameserver.network.game.components.SystemMessageId;
import dwo.gameserver.network.game.serverpackets.BuyListSeed;
import dwo.gameserver.network.game.serverpackets.SystemMessage;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowCropInfo;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowCropSetting;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowManorDefaultInfo;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowProcureCropDetail;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowSeedInfo;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowSeedSetting;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowSellCropList;
import org.apache.log4j.Level;
/**
* Manor functions handler.
*
* @author L2J
* @author GODWORLD
* @author Yorie
*/
public class ManorManager extends CommandHandler<String>
{
@TextCommand("manor_menu_select")
public boolean manorMenu(BypassHandlerParams params)
{
L2PcInstance activeChar = params.getPlayer();
L2Npc manager = activeChar.getLastFolkNPC();
if(!activeChar.isInsideRadius(manager, L2Npc.INTERACTION_DISTANCE, true, false))
{
return false;
}
try
{
Castle castle = manager.getCastle();
if(CastleManorManager.getInstance().isUnderMaintenance())
{
activeChar.sendActionFailed();
activeChar.sendPacket(SystemMessageId.THE_MANOR_SYSTEM_IS_CURRENTLY_UNDER_MAINTENANCE);
return true;
}
int ask = Integer.parseInt(params.getQueryArgs().get("ask"));
int state = Integer.parseInt(params.getQueryArgs().get("state"));
int time = Integer.parseInt(params.getQueryArgs().get("time"));
int castleId;
castleId = state < 0 ? castle.getCastleId() : state;
switch(ask)
{
case 1: // Seed purchase
if(castleId == castle.getCastleId())
{
activeChar.sendPacket(new BuyListSeed(activeChar.getAdenaCount(), castleId, castle.getSeedProduction(CastleManorManager.PERIOD_CURRENT)));
}
else
{
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.HERE_YOU_CAN_BUY_ONLY_SEEDS_OF_S1_MANOR).addString(manager.getCastle().getName()));
}
break;
case 2: // Crop sales
activeChar.sendPacket(new ExShowSellCropList(activeChar, castleId, castle.getCropProcure(CastleManorManager.PERIOD_CURRENT)));
break;
case 3: // Current seeds (Manor info)
if(time == 1 && !CastleManager.getInstance().getCastleById(castleId).isNextPeriodApproved())
{
activeChar.sendPacket(new ExShowSeedInfo(castleId, null));
}
else
{
activeChar.sendPacket(new ExShowSeedInfo(castleId, CastleManager.getInstance().getCastleById(castleId).getSeedProduction(time)));
}
break;
case 4: // Current crops (Manor info)
if(time == 1 && !CastleManager.getInstance().getCastleById(castleId).isNextPeriodApproved())
{
activeChar.sendPacket(new ExShowCropInfo(castleId, null));
}
else
{
activeChar.sendPacket(new ExShowCropInfo(castleId, CastleManager.getInstance().getCastleById(castleId).getCropProcure(time)));
}
break;
case 5: // Basic info (Manor info)
activeChar.sendPacket(new ExShowManorDefaultInfo());
break;
case 6: // Buy harvester
manager.showBuyList(activeChar, 0);
break;
case 7: // Edit seed setup
if(castle.isNextPeriodApproved())
{
activeChar.sendPacket(SystemMessageId.A_MANOR_CANNOT_BE_SET_UP_BETWEEN_6_AM_AND_8_PM);
}
else
{
activeChar.sendPacket(new ExShowSeedSetting(castle.getCastleId()));
}
break;
case 8: // Edit crop setup
if(castle.isNextPeriodApproved())
{
activeChar.sendPacket(SystemMessageId.A_MANOR_CANNOT_BE_SET_UP_BETWEEN_6_AM_AND_8_PM);
}
else
{
activeChar.sendPacket(new ExShowCropSetting(castle.getCastleId()));
}
break;
case 9: // Edit sales (Crop sales)
activeChar.sendPacket(new ExShowProcureCropDetail(state));
break;
default:
return false;
}
return true;
}
catch(Exception e)
{
log.log(Level.ERROR, e);
}
return false;
}
} | [
"[email protected]"
] | |
ce9787b9d063ca12a03b4a93e336c11871710b1e | a2569cea7506488ee17d89a0f671bd30fb1ebdab | /ecsite-licca/src/com/internousdev/ecsite/dao/BuyItemCompleteDAO.java | 147ea02cc0566da3009b0f13a159f755aa42acc4 | [] | no_license | licca375/MyECsite | a7ff323bd126309a11b2c6444999c45fb2be3b0c | 419c932e6b4939275ef268097fff6df49b632b23 | refs/heads/master | 2020-03-10T10:20:49.555667 | 2018-06-01T04:44:19 | 2018-06-01T04:44:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,258 | java | package com.internousdev.ecsite.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import com.internousdev.ecsite.util.DBConnector;
import com.internousdev.ecsite.util.DateUtil;
public class BuyItemCompleteDAO {
private DBConnector dbConnector = new DBConnector();
private Connection connection = dbConnector.getConnection();
private DateUtil dateUtil = new DateUtil();
private String sql = "INSERT INTO user_buy_item_transaction (item_transaction_id, total_price, total_count, user_master_id, pay, insert_date)VALUES(?, ?, ?, ?, ?, ?)";
public void buyItemeInfo(String item_transaction_id, String user_master_id,
String total_price, String total_count, String pay) throws SQLException {
try {
PreparedStatement preparedStatement = connection.prepareStatement(sql);
preparedStatement.setString(1, item_transaction_id);
preparedStatement.setString(2, total_price);
preparedStatement.setString(3, total_count);
preparedStatement.setString(4, user_master_id);
preparedStatement.setString(5, pay);
preparedStatement.setString(6, dateUtil.getDate());
preparedStatement.execute();
} catch(Exception e) {
e.printStackTrace();
} finally {
connection.close();
}
}
}
| [
"[email protected]"
] | |
511d5d21a677a6e3c320a62c47f683d7906ada55 | 1c67c9d2da9fedb9e38d604cf08f7decf50fce31 | /pbn-app/src/main/java/pl/wat/inz/pbn/app/Application.java | 4313bd4fb907666b15c501b0f0c7e2a89f25e8fb | [] | no_license | kubazrb/PBN-APP | 06a0e65bf481f2390fc555dc442ff50ea426b27a | 50816279b117a2ce65a9635cb51840f9588fcbca | refs/heads/master | 2020-03-27T13:49:31.282293 | 2019-01-15T09:36:43 | 2019-01-15T09:36:43 | 146,629,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package pl.wat.inz.pbn.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| [
"[email protected]"
] | |
0a652562b3f9c095ddb72afab9fdc6c6c3f00530 | 05f593414e0deed21dbf8cccdad2b9e3fe0eaec8 | /app/src/main/java/com/dakshpokar/asn/notes.java | a58d73af16d3f2cab727afb0bf541b81d5d73cbe | [] | no_license | dakshpokar/AndroidSecureNotes | 3deb4d635938d34fd0a22362fdbbb26b6a99e34c | e10c2d613ee4c6f47c59bb7efdb1a48d9bb8d88b | refs/heads/master | 2020-03-26T11:19:27.217076 | 2018-08-15T10:17:09 | 2018-08-15T10:17:09 | 144,838,122 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,124 | java | package com.dakshpokar.asn;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.app.Fragment;
import android.support.design.widget.FloatingActionButton;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.Toast;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import static android.content.ContentValues.TAG;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* to handle interaction events.
* Use the {@link notes#newInstance} factory method to
* create an instance of this fragment.
*/
public class notes 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";
public static boolean open = false;
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
MotionEvent event;
DatabaseHelper mDatabaseHelper;
EditText title_text;
EditText note_text;
int ID;
String titleString, dateString, noteString;
boolean already = false;
public notes() {
titleString = "";
dateString = "";
noteString = "";
// Required empty public constructor
}
public void setCods(int cx, int cy)
{
this.cx = cx;
this.cy = cy;
}
public void setArgs(int ID, String title, String note, String date)
{
already = true;
this.ID = ID;
titleString = title;
noteString = note;
dateString = date;
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment notes.
*/
// TODO: Rename and change types and number of parameters
public static notes newInstance(String param1, String param2) {
notes fragment = new notes();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
int cx,cy;
@Override
public void onAttach(Context context) {
FloatingActionButton fab_add = ((Activity)context).getWindow().getDecorView().findViewById(R.id.fab_add);
View v = ((Activity)context).getWindow().getDecorView().getRootView();
int finalRadius = Math.max(v.getWidth(), v.getHeight());
Animator anim = ViewAnimationUtils.createCircularReveal(v, cx, cy, 0, finalRadius);
v.setBackgroundColor(getResources().getColor(R.color.noteback));
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
}
});
anim.setDuration(400);
anim.start();
super.onAttach(context);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
private void AddData(String title, String note, String date)
{
boolean insertData = mDatabaseHelper.addData(title, note, date);
}
private void ModifyData(int ID, String title, String note, String date)
{
mDatabaseHelper.modifyData(ID, title, note, date);
Toast.makeText(getActivity(), "Saved!", Toast.LENGTH_SHORT).show();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
final View v = inflater.inflate(R.layout.fragment_notes, container, false);
FloatingActionButton fab_save;
mDatabaseHelper = new DatabaseHelper(getActivity());
fab_save = (FloatingActionButton)v.findViewById(R.id.fab_save);
title_text = (EditText)v.findViewById(R.id.note_title);
note_text = (EditText)v.findViewById(R.id.note_info);
if(!titleString.equals(""))
{
title_text.setText(titleString);
}
if(!noteString.equals("")){
note_text.setText(noteString);
}
fab_save.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String title = title_text.getText().toString();
String note = note_text.getText().toString();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Date date;
String currentDateTime;
if(dateString.equals("")) {
date = new Date();
currentDateTime = formatter.format(date);
}
if (title.equals("") && note.equals("")) {
Toast.makeText(getActivity(), "Can`t save empty Note", Toast.LENGTH_SHORT).show();
} else {
if(already == false) {
currentDateTime = dateString;
AddData(title, note, currentDateTime);
title_text.setText("");
note_text.setText("");
}
else
{
date = new Date();
title = title_text.getText().toString();
note = note_text.getText().toString();
currentDateTime = formatter.format(date);
ModifyData(ID, title, note, currentDateTime);
}
}
}
});
return v;
}
// TODO: Rename method, update argument and hook method into UI event
public boolean saveNote(View v)
{
title_text = (EditText)v.findViewById(R.id.note_title);
note_text = (EditText)v.findViewById(R.id.note_info);
String title = title_text.getText().toString();
String note = note_text.getText().toString();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Date date = new Date();
String currentDateTime = formatter.format(date);
if(title.equals("") && note.equals(""))
{
return true;
}
else {
if(already == false){
AddData(title, note, currentDateTime);
title_text.setText("");
note_text.setText("");
return false;
}
else if(already == true)
{
ModifyData(ID, title, note, currentDateTime);
return true;
}
}
return true;
}
@Override
public void onDetach() {
super.onDetach();
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
}
| [
"[email protected]"
] | |
8d903c925c9b40d34e319958a6d4eb7f48fe5cb3 | 682bfd40c3cc651a6196e8e368696e930370a618 | /kartoteks-service/src/main/java/ekol/kartoteks/domain/dto/CustomerServiceRepAuthorizedCompany.java | 423bb791360c307384c1f57992d4f0dd8f3e47f3 | [] | no_license | seerdaryilmazz/OOB | 3b27b67ce1cbf3f411f7c672d0bed0d71bc9b127 | 199f0c18b82d04569d26a08a1a4cd8ee8c7ba42d | refs/heads/master | 2022-12-30T09:23:25.061974 | 2020-10-09T13:14:39 | 2020-10-09T13:14:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,480 | java | package ekol.kartoteks.domain.dto;
import ekol.hibernate5.domain.embeddable.DateWindow;
import ekol.kartoteks.domain.Company;
import ekol.kartoteks.domain.CompanyEmployeeRelation;
/**
* Created by kilimci on 23/09/16.
*/
public class CustomerServiceRepAuthorizedCompany {
private Long relationId;
private Company company;
private DateWindow validDates;
public static CustomerServiceRepAuthorizedCompany withCompanyEmployeeRelation(CompanyEmployeeRelation relation){
CustomerServiceRepAuthorizedCompany authorizedCompany = new CustomerServiceRepAuthorizedCompany();
authorizedCompany.setCompany(relation.getCompanyRole().getCompany());
authorizedCompany.setRelationId(relation.getId());
DateWindow validDates = relation.getValidDates();
if(validDates == null){
validDates = relation.getCompanyRole().getDateRange();
}
authorizedCompany.setValidDates(validDates);
return authorizedCompany;
}
public Long getRelationId() {
return relationId;
}
public void setRelationId(Long relationId) {
this.relationId = relationId;
}
public Company getCompany() {
return company;
}
public void setCompany(Company company) {
this.company = company;
}
public DateWindow getValidDates() {
return validDates;
}
public void setValidDates(DateWindow validDates) {
this.validDates = validDates;
}
}
| [
"[email protected]"
] | |
c6bd2a73684c6ae746bd3176b078a6bf68fd7c99 | ba34cc3648cbfe8b4a0bf8814879463a50c7fd3a | /src/main/java/com/dillos/dillobot/annotations/Server.java | b8f6ef116ead12d2a3d9d2b09c3cdea8a747f58a | [] | no_license | jarrettkenny/dillo-bot | 18246848f400d180d63ec6e0c17980e7d58fb035 | c0fdd0f67b65ac99d10052ebd3b38ba088fd607c | refs/heads/master | 2022-12-04T18:23:02.519047 | 2020-08-29T20:39:20 | 2020-08-29T20:39:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | package com.dillos.dillobot.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface Server {}
| [
"[email protected]"
] | |
1b08dab2183a5f886c578ddfa1e69a5fd17aebb3 | 9d65a11c38247d9aed6ca47afc37b3b169affe8d | /HTMCEJB/ejbModule/SessionBeans/UnidadDependenciaFacadeLocal.java | 8ec760e3534ceea2bf9f9d99af50e8ebeaea4c2b | [] | no_license | lcevallo/HTMC | 2644c8a1306e08939ebed915949b2907e4e52496 | 13fc47e72384faae5755ab63eb688f71c6e7fbd8 | refs/heads/master | 2021-06-03T02:24:43.641973 | 2020-01-16T02:44:09 | 2020-01-16T02:44:09 | 96,184,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 698 | 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 SessionBeans;
import java.util.List;
import javax.ejb.Local;
import Entities.UnidadDependencia;
/**
*
* @author Bryan
*/
@Local
public interface UnidadDependenciaFacadeLocal {
void create(UnidadDependencia UnidadDependencia);
void edit(UnidadDependencia UnidadDependencia);
void remove(UnidadDependencia UnidadDependencia);
UnidadDependencia find(Object id);
List<UnidadDependencia> findAll();
List<UnidadDependencia> findRange(int[] range);
int count();
}
| [
"[email protected]"
] | |
3b992b71f2f9fb620eff80917dd98c0b3520beff | e8ee01c0f6baf20249347b023a1a8784de4e984f | /src/Praktikum9/src/tugas2/Manusia.java | 938064ddba1bd79a3ca49512c6a91a39c41cc740 | [] | no_license | titaw1/Praktikum-PBO-2020 | 5cdd6431e7381296d849774efef2560836ba467d | 5bf1fd3e1f39d5d7626b632490ea0606501d537a | refs/heads/master | 2023-02-08T13:01:59.150180 | 2020-12-29T13:00:43 | 2020-12-29T13:00:43 | 293,171,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | 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 tugas2;
/**
*
* @author tita
*/
public class Manusia {
public void bernafas(){
System.out.println("Manusia Bernafas");
}
public void makan(){
System.out.println("Manusia Makan");
}
}
| [
"[email protected]"
] | |
19865209db697717f70d688298d5d546a3f4914a | ca9bf5b3437ff9ae1000b34bac8df6391b2dc766 | /app/src/main/java/com/example/cloudypedia/fawrysurveillanceapp/Activites/PhotoActivity.java | ce63f43e547a4db4d446ffd41bad005a619bd2a6 | [] | no_license | ahmedelkashef/fawryfinal | 607b57e892f7c60a4e93b48ae90138d5994d216c | b58fc61198625d5dbbac29035f35e46999bcf869 | refs/heads/master | 2021-01-12T06:36:13.655474 | 2017-03-05T21:32:48 | 2017-03-05T21:32:48 | 77,392,587 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,293 | java | package com.example.cloudypedia.fawrysurveillanceapp.Activites;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.cloudypedia.fawrysurveillanceapp.R;
import com.example.cloudypedia.fawrysurveillanceapp.Utility;
import com.squareup.picasso.Picasso;
public class PhotoActivity extends AppCompatActivity {
ImageView photoimageview;
TextView nophototxt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_photo);
Utility.setActionBar(getSupportActionBar(),this, "home");
photoimageview = (ImageView) findViewById(R.id.photoimageView);
nophototxt = (TextView) findViewById(R.id.phototxt);
Bundle extras = getIntent().getExtras();
String photoUrl = extras.getString("photoUrl");
if(!photoUrl.equals("null")) {
Picasso.with(this).load(photoUrl).into(photoimageview);
nophototxt.setVisibility(View.INVISIBLE);
}
else
{
nophototxt.setVisibility(View.VISIBLE);
//nophototxt.setText("لا يوجد صورة");
}
}
}
| [
"[email protected]"
] | |
076058ddacfef6bb9afa419d82b044ea26990733 | a2132ba9271ca1096bb2f82db6aa52ab3ec18d95 | /src/com/gmail/erofeev/st/alexei/controlTwo/model/PurchaseOrder.java | 7a84da91e6f867f5d1f784e45b1489678e1a4e73 | [] | no_license | ErofeevAS/itacademy | a64c076c584e53cc008b16adab2957ea5e109d10 | 459f86fe4ed597671c0a19e7a8e45aad7acf2304 | refs/heads/master | 2020-04-12T04:39:30.367780 | 2019-02-14T16:08:15 | 2019-02-14T16:08:15 | 162,301,929 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | package com.gmail.erofeev.st.alexei.controlTwo.model;
import javax.xml.bind.annotation.*;
import java.util.List;
@XmlRootElement(name = "PurchaseOrder", namespace = "http://www.it-academy.by")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = {"orderDate", "item"})
public class PurchaseOrder {
@XmlAttribute(name = "OrderDate", required = true)
private String orderDate;
@XmlElement(name = "item", required = true)
private List<Item> item;
public PurchaseOrder() {
}
public String getOrderDate() {
return orderDate;
}
public void setOrderDate(String orderDate) {
this.orderDate = orderDate;
}
public List<Item> getItem() {
return item;
}
public void setItem(List<Item> items) {
this.item = item;
}
}
| [
"[email protected]"
] | |
93a5e1fc6d24047f81665c28c145f8ac5956e256 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-new-fitness/results/TIME-7b-3-1-Single_Objective_GGA-WeightedSum-BasicBlockCoverage/org/joda/time/format/DateTimeParserBucket$SavedField_ESTest.java | 9d1977ec27a535e8f0dc63bde90eb0c1564a68ec | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,428 | java | /*
* This file was automatically generated by EvoSuite
* Fri May 15 12:20:30 UTC 2020
*/
package org.joda.time.format;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.joda.time.DateTimeField;
import org.joda.time.chrono.BuddhistChronology;
import org.joda.time.field.DelegatedDateTimeField;
import org.joda.time.format.DateTimeParserBucket;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class DateTimeParserBucket$SavedField_ESTest extends DateTimeParserBucket$SavedField_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstance();
buddhistChronology0.getZone();
BuddhistChronology buddhistChronology1 = BuddhistChronology.getInstance();
DateTimeField dateTimeField0 = buddhistChronology1.dayOfMonth();
DelegatedDateTimeField delegatedDateTimeField0 = new DelegatedDateTimeField(dateTimeField0);
DateTimeParserBucket.SavedField dateTimeParserBucket_SavedField0 = new DateTimeParserBucket.SavedField(dateTimeField0, 4152);
boolean boolean0 = true;
// Undeclared exception!
dateTimeParserBucket_SavedField0.set((-1765L), true);
}
}
| [
"[email protected]"
] | |
d243ac7ada08f4da49b5c278a8995934d5c02307 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/29/org/apache/commons/math3/geometry/partitioning/utilities/AVLTree_insert_61.java | 4536b1890f1f14c25272759dc6c3f17c6e251542 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 1,246 | java |
org apach common math3 geometri partit util
avl tree
purpos sort element allow
duplic element code equal
code sort set sortedset
specif need null element allow
code equal method suffici
differenti element link delet delet method
implement equal oper
order mark method provid
semant
code sort set sortedset name
code add replac link insert insert
code remov replac link delet
delet
base implement georg kraml put
domain
href www purist org georg avltre index html page
exist
param type element
version
avl tree avltre compar
insert element tree
param element element insert silent
insert element
element
top
top node element
top insert element
| [
"[email protected]"
] | |
9818c3778256cfba7c549169a9527dfccddaaab3 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/java-undertow-server/generated/src/main/java/org/openapitools/model/ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.java | a67975fdf4c5fe85d0e63f58d13962d258d073b2 | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | Java | false | false | 4,160 | java | package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen", date = "2019-08-05T00:56:20.785Z[GMT]")
public class ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo {
private String pid = null;
private String title = null;
private String description = null;
private ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties properties = null;
/**
**/
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo pid(String pid) {
this.pid = pid;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("pid")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
/**
**/
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo title(String title) {
this.title = title;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("title")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
**/
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo description(String description) {
this.description = description;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
**/
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo properties(ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties properties) {
this.properties = properties;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("properties")
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties getProperties() {
return properties;
}
public void setProperties(ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo = (ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo) o;
return Objects.equals(pid, comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.pid) &&
Objects.equals(title, comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.title) &&
Objects.equals(description, comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.description) &&
Objects.equals(properties, comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"[email protected]"
] | |
87ae9c50e52730c71e8c1ae6e0347427a81f9d11 | a10cb748c5597851ed6cf9d04cafac6eb6c8f377 | /week-01/day-4-5/src/Variables/FavouriteNumber.java | 08cba827af90f3b1167c7bec4c1ede8c95923222 | [] | no_license | green-fox-academy/szbarna-asd | 9dba837c9186c9cde100c03b4d98018a32128473 | 8c85e747644e66a11a69f7efed789d6055653dbd | refs/heads/master | 2020-09-25T02:45:20.176555 | 2020-03-03T20:54:49 | 2020-03-03T20:54:49 | 225,899,785 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 209 | java | package Variables;
public class FavouriteNumber {
public static void main(String[] args) {
int favouriteNumber=7;
System.out.println("My favourite number is: " + favouriteNumber);
}
}
| [
"[email protected]"
] | |
1a9e1ad7048305c05bb9d04a2491c8c97297eb22 | 8f4dc6d22e28bedfce0bc9478abecdcba7e396f6 | /app/src/main/java/com/dg/designstudy/Factory/StaticFactory.java | bfc5ca3b6ce3e535096a28a308fb84f7d6721bc3 | [] | no_license | dugdugang/DesignStudy | 7ec12329112d6d0d57b1e4a38b534130fe697e60 | 5d2b02fe51ab08137127d890b3eaae8dc39a7dcc | refs/heads/master | 2021-04-27T05:06:55.774978 | 2018-03-05T09:54:24 | 2018-03-05T09:54:24 | 122,591,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package com.dg.designstudy.Factory;
/**
* Created by Administrator on 2018/2/27 0027.
* 静态工厂模 式
*/
public class StaticFactory {
public static Product createProduct() {
return new ProductA();
}
}
| [
"[email protected]"
] | |
00d094bfa369ab3dc3017a814a9f2ac72c24cf69 | a6689bfcb181f6cb5fbab367e6b6f48738f239fc | /src/main/java/com/dropbox/core/v2/team/ListMemberDevicesArg.java | df05b8d5e99acead00bcd116f9b3dd3a8dcd2ca7 | [
"MIT"
] | permissive | VDenis/dropbox-sdk-java | 0df0fd0c3e225d26eaa7b27c52c1dc8bb38abc2e | d64515a8c6285c12dffd3d0bf0f2548d046125b6 | refs/heads/master | 2021-01-21T00:21:41.171499 | 2016-02-24T23:19:19 | 2016-02-24T23:19:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,460 | java | /* DO NOT EDIT */
/* This file was generated from team_devices.babel */
package com.dropbox.core.v2.team;
import com.dropbox.core.json.JsonReadException;
import com.dropbox.core.json.JsonReader;
import com.dropbox.core.json.JsonWriter;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import java.io.IOException;
public class ListMemberDevicesArg {
// struct ListMemberDevicesArg
private final String teamMemberId;
private final boolean includeWebSessions;
private final boolean includeDesktopClients;
private final boolean includeMobileClients;
/**
* Use {@link newBuilder} to create instances of this class without
* specifying values for all optional fields.
*
* @param teamMemberId The team's member id. Must not be {@code null}.
* @param includeWebSessions Whether to list web sessions of the team's
* member.
* @param includeDesktopClients Whether to list linked desktop devices of
* the team's member.
* @param includeMobileClients Whether to list linked mobile devices of the
* team's member.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public ListMemberDevicesArg(String teamMemberId, boolean includeWebSessions, boolean includeDesktopClients, boolean includeMobileClients) {
if (teamMemberId == null) {
throw new IllegalArgumentException("Required value for 'teamMemberId' is null");
}
this.teamMemberId = teamMemberId;
this.includeWebSessions = includeWebSessions;
this.includeDesktopClients = includeDesktopClients;
this.includeMobileClients = includeMobileClients;
}
/**
* The default values for unset fields will be used.
*
* @param teamMemberId The team's member id. Must not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public ListMemberDevicesArg(String teamMemberId) {
this(teamMemberId, true, true, true);
}
/**
* The team's member id
*
* @return value for this field, never {@code null}.
*/
public String getTeamMemberId() {
return teamMemberId;
}
/**
* Whether to list web sessions of the team's member
*
* @return value for this field, or {@code null} if not present. Defaults to
* true.
*/
public boolean getIncludeWebSessions() {
return includeWebSessions;
}
/**
* Whether to list linked desktop devices of the team's member
*
* @return value for this field, or {@code null} if not present. Defaults to
* true.
*/
public boolean getIncludeDesktopClients() {
return includeDesktopClients;
}
/**
* Whether to list linked mobile devices of the team's member
*
* @return value for this field, or {@code null} if not present. Defaults to
* true.
*/
public boolean getIncludeMobileClients() {
return includeMobileClients;
}
/**
* Returns a new builder for creating an instance of this class.
*
* @param teamMemberId The team's member id. Must not be {@code null}.
*
* @return builder for this class.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public static Builder newBuilder(String teamMemberId) {
return new Builder(teamMemberId);
}
/**
* Builder for {@link ListMemberDevicesArg}.
*/
public static class Builder {
protected final String teamMemberId;
protected boolean includeWebSessions;
protected boolean includeDesktopClients;
protected boolean includeMobileClients;
protected Builder(String teamMemberId) {
if (teamMemberId == null) {
throw new IllegalArgumentException("Required value for 'teamMemberId' is null");
}
this.teamMemberId = teamMemberId;
this.includeWebSessions = true;
this.includeDesktopClients = true;
this.includeMobileClients = true;
}
/**
* Set value for optional field.
*
* <p> If left unset or set to {@code null}, defaults to {@code true}.
* </p>
*
* @param includeWebSessions Whether to list web sessions of the team's
* member. Defaults to {@code true} when set to {@code null}.
*
* @return this builder
*/
public Builder withIncludeWebSessions(Boolean includeWebSessions) {
if (includeWebSessions != null) {
this.includeWebSessions = includeWebSessions;
}
else {
this.includeWebSessions = true;
}
return this;
}
/**
* Set value for optional field.
*
* <p> If left unset or set to {@code null}, defaults to {@code true}.
* </p>
*
* @param includeDesktopClients Whether to list linked desktop devices
* of the team's member. Defaults to {@code true} when set to {@code
* null}.
*
* @return this builder
*/
public Builder withIncludeDesktopClients(Boolean includeDesktopClients) {
if (includeDesktopClients != null) {
this.includeDesktopClients = includeDesktopClients;
}
else {
this.includeDesktopClients = true;
}
return this;
}
/**
* Set value for optional field.
*
* <p> If left unset or set to {@code null}, defaults to {@code true}.
* </p>
*
* @param includeMobileClients Whether to list linked mobile devices of
* the team's member. Defaults to {@code true} when set to {@code
* null}.
*
* @return this builder
*/
public Builder withIncludeMobileClients(Boolean includeMobileClients) {
if (includeMobileClients != null) {
this.includeMobileClients = includeMobileClients;
}
else {
this.includeMobileClients = true;
}
return this;
}
/**
* Builds an instance of {@link ListMemberDevicesArg} configured with
* this builder's values
*
* @return new instance of {@link ListMemberDevicesArg}
*/
public ListMemberDevicesArg build() {
return new ListMemberDevicesArg(teamMemberId, includeWebSessions, includeDesktopClients, includeMobileClients);
}
}
@Override
public int hashCode() {
int hash = java.util.Arrays.hashCode(new Object [] {
teamMemberId,
includeWebSessions,
includeDesktopClients,
includeMobileClients
});
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
// be careful with inheritance
else if (obj.getClass().equals(this.getClass())) {
ListMemberDevicesArg other = (ListMemberDevicesArg) obj;
return ((this.teamMemberId == other.teamMemberId) || (this.teamMemberId.equals(other.teamMemberId)))
&& (this.includeWebSessions == other.includeWebSessions)
&& (this.includeDesktopClients == other.includeDesktopClients)
&& (this.includeMobileClients == other.includeMobileClients)
;
}
else {
return false;
}
}
@Override
public String toString() {
return _JSON_WRITER.writeToString(this, false);
}
public String toStringMultiline() {
return _JSON_WRITER.writeToString(this, true);
}
public String toJson(Boolean longForm) {
return _JSON_WRITER.writeToString(this, longForm);
}
public static ListMemberDevicesArg fromJson(String s) throws JsonReadException {
return _JSON_READER.readFully(s);
}
public static final JsonWriter<ListMemberDevicesArg> _JSON_WRITER = new JsonWriter<ListMemberDevicesArg>() {
public final void write(ListMemberDevicesArg x, JsonGenerator g) throws IOException {
g.writeStartObject();
ListMemberDevicesArg._JSON_WRITER.writeFields(x, g);
g.writeEndObject();
}
public final void writeFields(ListMemberDevicesArg x, JsonGenerator g) throws IOException {
g.writeFieldName("team_member_id");
g.writeString(x.teamMemberId);
g.writeFieldName("include_web_sessions");
g.writeBoolean(x.includeWebSessions);
g.writeFieldName("include_desktop_clients");
g.writeBoolean(x.includeDesktopClients);
g.writeFieldName("include_mobile_clients");
g.writeBoolean(x.includeMobileClients);
}
};
public static final JsonReader<ListMemberDevicesArg> _JSON_READER = new JsonReader<ListMemberDevicesArg>() {
public final ListMemberDevicesArg read(JsonParser parser) throws IOException, JsonReadException {
ListMemberDevicesArg result;
JsonReader.expectObjectStart(parser);
result = readFields(parser);
JsonReader.expectObjectEnd(parser);
return result;
}
public final ListMemberDevicesArg readFields(JsonParser parser) throws IOException, JsonReadException {
String teamMemberId = null;
Boolean includeWebSessions = null;
Boolean includeDesktopClients = null;
Boolean includeMobileClients = null;
while (parser.getCurrentToken() == JsonToken.FIELD_NAME) {
String fieldName = parser.getCurrentName();
parser.nextToken();
if ("team_member_id".equals(fieldName)) {
teamMemberId = JsonReader.StringReader
.readField(parser, "team_member_id", teamMemberId);
}
else if ("include_web_sessions".equals(fieldName)) {
includeWebSessions = JsonReader.BooleanReader
.readField(parser, "include_web_sessions", includeWebSessions);
}
else if ("include_desktop_clients".equals(fieldName)) {
includeDesktopClients = JsonReader.BooleanReader
.readField(parser, "include_desktop_clients", includeDesktopClients);
}
else if ("include_mobile_clients".equals(fieldName)) {
includeMobileClients = JsonReader.BooleanReader
.readField(parser, "include_mobile_clients", includeMobileClients);
}
else {
JsonReader.skipValue(parser);
}
}
if (teamMemberId == null) {
throw new JsonReadException("Required field \"team_member_id\" is missing.", parser.getTokenLocation());
}
return new ListMemberDevicesArg(teamMemberId, includeWebSessions, includeDesktopClients, includeMobileClients);
}
};
}
| [
"[email protected]"
] | |
1b3bfcf159f9a22e346b83eb045e0fef67cea1cf | ea7278a4bf5ae7602e0a98db96a82b84779d446c | /src/main/java/com/xiaoke/controller/web/RoleController.java | 29b8083f17945acd5c7dbac32cf9ad41f65b856f | [] | no_license | darkrain1990/xiaoke_sever | 9b32e7e7a1e2bfd906bb654bb2b076395c423978 | 53ca0dacb212f102418585a53e152c91292fa695 | refs/heads/master | 2016-09-12T18:15:03.000830 | 2016-05-15T03:28:14 | 2016-05-15T03:28:14 | 58,799,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,467 | java | package com.xiaoke.controller.web;
import com.xiaoke.entity.Role;
import com.xiaoke.entity.vo.SysAuthorities;
import com.xiaoke.entity.SysRoleAuthorities;
import com.xiaoke.entity.qo.SysRoleQO;
import com.xiaoke.entity.vo.PageBean;
import com.xiaoke.service.RoleService;
import com.xiaoke.service.SysRoleAuthoritiesService;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/role")
public class RoleController {
@Autowired
private RoleService roleService;
@Autowired
private SysRoleAuthoritiesService service;
Logger logger = LoggerFactory.getLogger(SysUsersController.class);
/**
* 显示角色分页对象
* @author wwh
* @throws UnsupportedEncodingException
* @Date 2016年3月17日
*/
@RequestMapping("/searchRole")
@ResponseBody
public String seacheRole(int index,int pageSize,String roleName, int systemId) throws UnsupportedEncodingException {
/*
* index:当前页面索引
* pagesize:页面大小 所显示的总条数
* roleName:角色名称
* systemId:所属系统id
* */
//解决编码格式问题
String ro=new String(roleName.getBytes("iso-8859-1"),"utf-8");
SysRoleQO sq=new SysRoleQO(index,pageSize,ro,systemId);
PageBean<Role> page=roleService.searchRoleByCondition(sq);
Map<String, Object> map = new HashMap<String, Object>();
map.put("pageTotal", page.getPageTotal());
map.put("index", index);
//页面只显示flag=1的角色 除去roles中flag为0的角色
List<Role> roles=page.getList();
map.put("roles", roles);
JSONObject json = JSONObject.fromObject(map);
return json.toString();
}
/**
* 添加角色
* @author wwh
* @throws UnsupportedEncodingException
* @Date 2016年3月16日 下午2:20:34
*/
@ResponseBody
@RequestMapping("/add")
public String addRole(String roleName,String roleDesc,Integer systemId,Integer enabled,Integer issys) throws UnsupportedEncodingException {
//设置可能出现中文字段 存入数据库的编码格式
String ro=new String(roleName.getBytes("iso-8859-1"),"utf-8");
String des=new String(roleDesc.getBytes("iso-8859-1"),"utf-8");
Role role=new Role(ro,des,enabled,issys,systemId);
JSONObject json = roleService.addRoles(role);
return json.toString();
}
/**
* 删除角色
* @author wwh
* @Date 2016年3月17日
*/
@ResponseBody
@RequestMapping("/dele/{id}")
public String deleteRole(@PathVariable String id){
JSONObject json = new JSONObject();
//System.out.println(id);
try {
json=roleService.delRoelById(id);
} catch (Exception e) {
logger.error(e.getMessage());
json.put("ERROR", "服务器异常 error_code(500)");
}
return json.toString();
}
/**
* 修改角色
* @author wwh
* @throws UnsupportedEncodingException
* @Date 2016年3月22日
*/
@RequestMapping("/update")
@ResponseBody
public String updateRole(int id,String roleName,String roleDesc,Integer systemId,Integer enabled,Integer issys) throws UnsupportedEncodingException{
JSONObject json = new JSONObject();
String ro=new String(roleName.getBytes("iso-8859-1"),"utf-8");
String des=new String(roleDesc.getBytes("iso-8859-1"),"utf-8");
Role role=new Role(ro,des,enabled,issys,1,systemId);
try {
json=roleService.updateRoleById(role);
} catch (Exception e) {
json.put("ERROR", "服务器异常 error_code(500)");
}
return json.toString();
}
/**
* 给角色添加或者删除权限
* @author wwh
* */
@RequestMapping("/addordel")
@ResponseBody
public String addordelAuthorities(int roleId,int authorityId,String flag){
JSONObject json = new JSONObject();
JSONObject str = new JSONObject();
str=service.selrole(new SysRoleAuthorities(roleId, authorityId) );
Boolean bool=(Boolean) str.get("result");
try {
if(flag.equalsIgnoreCase("del")){//给角色删除权限操作
if(bool){//判断数据库中该角色是否有对应的权限 有 就删除
json = service.delRoleAuthorities(new SysRoleAuthorities(roleId, authorityId));
}else{
}
}else{//给角色添加权限操作
if(bool){
}else{
json = service.addRoleAuthorities(new SysRoleAuthorities(roleId, authorityId));
}
}
} catch (Exception e) {
logger.error(e.getMessage());
json.put("ERROR", "服务器异常 error_code(500)");
}
return json.toString();
}
/**
* 显示系统所有的权限
* */
@RequestMapping("/show/{systemId}")
@ResponseBody
public String showAuthorities(@PathVariable int systemId){
JSONObject json = new JSONObject();
List<SysAuthorities> list=service.findAuthorities(systemId);
json.put("result", list);
return json.toString();
}
/**
* 查询角色所拥有的权限
* */
@RequestMapping("/sel")
@ResponseBody
public String selRole(int roleId,int authorityId){
JSONObject json = new JSONObject();
SysRoleAuthorities sys=new SysRoleAuthorities(roleId, authorityId);
json = service.selrole(sys);
return json.toString();
}
}
| [
"[email protected]"
] | |
e60710d4402ab923e072320c43fd9a68fb8a5df5 | 3bab81792c722411c542596fedc8e4b1d086c1a9 | /src/main/java/com/gome/maven/analysis/AnalysisScopeUtil.java | aea76c9bdc99be4502f5da0dca5467a649dfb56c | [] | no_license | nicholas879110/maven-code-check-plugin | 80d6810cc3c12a3b6c22e3eada331136e3d9a03e | 8162834e19ed0a06ae5240b5e11a365c0f80d0a0 | refs/heads/master | 2021-04-30T07:09:42.455482 | 2018-03-01T03:21:21 | 2018-03-01T03:21:21 | 121,457,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 809 | java | /*
* Copyright 2000-2013 JetBrains s.r.o.
*
* 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.gome.maven.analysis;
import com.gome.maven.openapi.actionSystem.DataKey;
public class AnalysisScopeUtil {
public static final DataKey<AnalysisScope> KEY = DataKey.create("analysisScope");
}
| [
"[email protected]"
] | |
0e3aec4397c2af513025b242a580392e0f832061 | be1df0979b508c13acaf706489026771161ce56c | /Uley/uley/src/main/java/com/example/julia/uley/common/PackageType.java | 2fd3ea16e9cba87dde0c09c3f2d4f0b7047e2120 | [] | no_license | Pochatkin/MyRep | 84e6bda44190e8f60c3a174597e36ab6bceaa36e | a1e716703383adb39b71249f79ac70c042b91432 | refs/heads/master | 2020-05-21T14:06:45.249271 | 2017-06-05T12:56:43 | 2017-06-05T12:56:43 | 46,584,151 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 607 | java | package com.example.julia.uley.common;
/**
* Created by Julia on 23.11.2015.
*/
public enum PackageType {
//server client req
REQ_SEARCH,
REQ_SIGN_IN,
REQ_SIGN_OUT,
REQ_SIGN_UP,
REQ_SEND_MESSAGE,
//server response
RESP_SIGN_IN_OK,
RESP_SIGN_IN_FAILED,
RESP_SIGN_UP_OK,
RESP_SIGN_UP_USER_ALREADY_EXIST,
RESP_SIGN_UP_LOGIN_FILTER_FAILED,
RESP_SIGN_UP_PASS_FILTER_FAILED,
RESP_SIGN_OUT_OK,
RESP_MESSAGE_DELIVERED, // client response too
RESP_MESSAGE_IN_QUEUE,
RESP_MESSAGE_USER_NOT_FOUND,
RESP_SEARCH_ANSWER,
RESP_SERVER_ERROR;
}
| [
"[email protected]"
] | |
c205a3b0657d6e3eacd356ee3969c56b2a3534b6 | 20919e14e453932ca10bf95e8fd40b46b5219e90 | /src/com/ansorgit/plugins/bash/editor/highlighting/codeHighlighting/PostHighlightingPass.java | 697fc2dbc2751540acfd9f06f586654f797a2053 | [
"Apache-2.0"
] | permissive | stefano-garzarella/BashSupport | 69c38429471401528d6f361c8b62d4433ddee401 | 7b487e023dd05a6b9ed5a429d421103f524b1598 | refs/heads/master | 2020-12-01T01:18:22.263323 | 2015-03-14T14:12:25 | 2015-03-14T14:12:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,472 | java | package com.ansorgit.plugins.bash.editor.highlighting.codeHighlighting;
import com.ansorgit.plugins.bash.editor.inspections.inspections.UnusedFunctionDefInspection;
import com.ansorgit.plugins.bash.lang.psi.BashVisitor;
import com.ansorgit.plugins.bash.lang.psi.api.BashFunctionDefName;
import com.ansorgit.plugins.bash.lang.psi.api.function.BashFunctionDef;
import com.intellij.codeHighlighting.Pass;
import com.intellij.codeHighlighting.TextEditorHighlightingPass;
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
import com.intellij.codeInsight.daemon.impl.UpdateHighlightersUtil;
import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInspection.InspectionProfile;
import com.intellij.codeInspection.reference.UnusedDeclarationFixProvider;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiRecursiveElementWalkingVisitor;
import com.intellij.psi.PsiReference;
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.util.Query;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class PostHighlightingPass extends TextEditorHighlightingPass {
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.PostHighlightingPass");
@NotNull
private final Project project;
@NotNull
private final PsiFile file;
@Nullable
private final Editor editor;
@NotNull
private final Document document;
private HighlightDisplayKey unusedSymbolInspection;
private int startOffset;
private int endOffset;
private Collection<HighlightInfo> highlights;
PostHighlightingPass(@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull Document document) {
super(project, document, true);
this.project = project;
this.file = file;
this.editor = editor;
this.document = document;
startOffset = 0;
endOffset = file.getTextLength();
}
@Override
public List<HighlightInfo> getInfos() {
return highlights == null ? null : new ArrayList<HighlightInfo>(highlights);
}
public static HighlightInfo createUnusedSymbolInfo(@NotNull PsiElement element, @NotNull String message, @NotNull final HighlightInfoType highlightInfoType) {
HighlightInfo info = HighlightInfo.newHighlightInfo(highlightInfoType).range(element).descriptionAndTooltip(message).create();
UnusedDeclarationFixProvider[] fixProviders = Extensions.getExtensions(UnusedDeclarationFixProvider.EP_NAME);
for (UnusedDeclarationFixProvider provider : fixProviders) {
IntentionAction[] fixes = provider.getQuickFixes(element);
for (IntentionAction fix : fixes) {
QuickFixAction.registerQuickFixAction(info, fix);
}
}
return info;
}
@Override
public void doCollectInformation(@NotNull final ProgressIndicator progress) {
final List<HighlightInfo> highlights = new ArrayList<HighlightInfo>();
collectHighlights(highlights, progress);
this.highlights = highlights;
}
private void collectHighlights(@NotNull final List<HighlightInfo> result, @NotNull final ProgressIndicator progress) {
ApplicationManager.getApplication().assertReadAccessAllowed();
InspectionProfile profile = InspectionProjectProfileManager.getInstance(myProject).getInspectionProfile();
unusedSymbolInspection = HighlightDisplayKey.findById(UnusedFunctionDefInspection.ID);
boolean findUnusedFunctions = profile.isToolEnabled(unusedSymbolInspection, file);
if (findUnusedFunctions) {
final BashVisitor bashVisitor = new BashVisitor() {
@Override
public void visitFunctionDef(BashFunctionDef functionDef) {
HighlightingKeys.IS_UNUSED.set(functionDef, null);
if (!PsiUtilCore.hasErrorElementChild(functionDef)) {
HighlightInfo highlightInfo = processFunctionDef(functionDef, progress);
if (highlightInfo != null) {
result.add(highlightInfo);
}
}
}
};
file.accept(new PsiRecursiveElementWalkingVisitor() {
@Override
public void visitElement(PsiElement element) {
element.accept(bashVisitor);
super.visitElement(element);
}
});
}
}
private static HighlightInfo processFunctionDef(BashFunctionDef functionDef, ProgressIndicator progress) {
BashFunctionDefName nameSymbol = functionDef.getNameSymbol();
if (nameSymbol != null) {
Query<PsiReference> search = ReferencesSearch.search(functionDef, functionDef.getUseScope(), true);
progress.checkCanceled();
PsiReference first = search.findFirst();
progress.checkCanceled();
if (first == null) {
HighlightingKeys.IS_UNUSED.set(functionDef, Boolean.TRUE);
return createUnusedSymbolInfo(nameSymbol, "Unused function definition", HighlightInfoType.UNUSED_SYMBOL);
}
}
return null;
}
@Override
public void doApplyInformationToEditor() {
if (highlights == null || highlights.isEmpty()) {
return;
}
UpdateHighlightersUtil.setHighlightersToEditor(myProject, myDocument, startOffset, endOffset, highlights, getColorsScheme(), Pass.POST_UPDATE_ALL);
BashPostHighlightingPassFactory.markFileUpToDate(file);
}
}
| [
"[email protected]"
] | |
40c29c06abb3fc3491642430a9c61afc7dbb719a | 80cd5720fedb1af3d9179009c5e78f7b14bd3bd3 | /src/main/java/com/bridgelabz/MyBinaryTree.java | 118d5cf4c189a306823b85de9a4852e6086027cf | [] | no_license | rinkeshdubey22/HashTable_BinarySearchTree_DS_Java | 05522e8f6d8e17f7aa3d875d539f121024ebc790 | aa57c6cd2955ff5ab77f58926fb83a8eff04b86f | refs/heads/master | 2023-04-02T10:12:21.373346 | 2021-04-01T09:06:22 | 2021-04-01T09:06:22 | 352,743,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,572 | java | package com.bridgelabz;
public class MyBinaryTree<K extends Comparable<K>> {
MyBinaryNode<K> root;
public void add(K key) {
this.root = this.addRecursively(root, key);
}
private MyBinaryNode<K> addRecursively(MyBinaryNode<K> current, K key) {
if (current == null)
return new MyBinaryNode<>(key);
int compareResult;
compareResult = key.compareTo(current.key);
if (compareResult == 0) return current;
if (compareResult < 0) {
current.left = addRecursively(current.left, key);
} else {
current.right = addRecursively(current.right, key);
}
return current;
}
public int getSize() {
return this.getSizeRecursive(root);
}
private int getSizeRecursive(MyBinaryNode<K> current) {
return current == null ? 0 : 1 + this.getSizeRecursive(current.left)
+ this.getSizeRecursive(current.right);
}
public MyBinaryNode<K> SearchRecursively(MyBinaryNode<K> current, K key) {
if (current == null) {
return null;
}
int compareResult = key.compareTo(current.key);
if (compareResult == 0) {
return current;
} else if (compareResult < 0) {
return SearchRecursively(current.left, key);
} else {
return SearchRecursively(current.right, key);
}
}
public boolean search(K key) {
if (SearchRecursively(root, key) != null) {
return true;
}
return false;
}
}
| [
"[email protected]"
] | |
10c0b1b54113aac5ce2515c2713f80e83fa39e33 | da181f89e0b26ffb3fc5f9670a3a5f8f1ccf0884 | /CoreGestionTextilLevel/src/ar/com/textillevel/modulos/personal/entidades/contratos/Contrato.java | 0916688a82fee4c7f4f81c4eaffb511f35d6cad7 | [] | no_license | nacho270/GTL | a1b14b5c95f14ee758e6b458de28eae3890c60e1 | 7909ed10fb14e24b1536e433546399afb9891467 | refs/heads/master | 2021-01-23T15:04:13.971161 | 2020-09-18T00:58:24 | 2020-09-18T00:58:24 | 34,962,369 | 2 | 1 | null | 2016-08-22T22:12:57 | 2015-05-02T20:31:49 | Java | UTF-8 | Java | false | false | 2,358 | java | package ar.com.textillevel.modulos.personal.entidades.contratos;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Transient;
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "TIPO", discriminatorType = DiscriminatorType.STRING)
@Table(name = "T_PERS_CONTRATO")
public abstract class Contrato implements Serializable {
private static final long serialVersionUID = -5568165283881971480L;
private Integer id;
private String pathArchivoContrato;
private Integer idTipoContrato;
@Id
@Column(name="P_ID")
@GeneratedValue(strategy=GenerationType.AUTO)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Transient
public ETipoContrato getTipoContrato() {
return ETipoContrato.getById(getIdTipoContrato());
}
@Override
@Transient
public String toString(){
return getTipoContrato().getDescripcion();
}
@Column(name="A_PATH_ARCHIVO",nullable=true)
public String getPathArchivoContrato() {
return pathArchivoContrato;
}
public void setPathArchivoContrato(String pathArchivoContrato) {
this.pathArchivoContrato = pathArchivoContrato;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Contrato other = (Contrato) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Column(name="A_ID_TIPO_CONTRATO",nullable=false)
protected Integer getIdTipoContrato() {
return idTipoContrato;
}
protected void setIdTipoContrato(Integer idTipoContrato) {
this.idTipoContrato = idTipoContrato;
}
}
| [
"[email protected]@9de48aec-ec99-11dd-b2d9-215335d0b316"
] | [email protected]@9de48aec-ec99-11dd-b2d9-215335d0b316 |
6ff8580224ebb8a29ce201e727b90fc5a0ebead6 | 6b23d8ae464de075ad006c204bd7e946971b0570 | /WEB-INF/plugin/api/src/jp/groupsession/v2/api/schedule/prefarence/worktime/ApiSchPrefWorkTimeForm.java | b5b3e313fd8277cc1c7499b8186bcf15c0aff1da | [] | no_license | kosuke8/gsession | a259c71857ed36811bd8eeac19c456aa8f96c61e | edd22517a22d1fb2c9339fc7f2a52e4122fc1992 | refs/heads/master | 2021-08-20T05:43:09.431268 | 2017-11-28T07:10:08 | 2017-11-28T07:10:08 | 112,293,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,267 | java | package jp.groupsession.v2.api.schedule.prefarence.worktime;
import jp.groupsession.v2.api.AbstractApiForm;
import jp.groupsession.v2.api.GSValidateApi;
import jp.groupsession.v2.struts.msg.GsMessage;
import org.apache.struts.action.ActionErrors;
/**
*
* <br>[機 能] スケジュール日間表示時間帯設定取得WEBAPIフォーム
* <br>[解 説]
* <br>[備 考]
*
* @author JTS
*/
public class ApiSchPrefWorkTimeForm extends AbstractApiForm {
/** ユーザSID*/
private String usrSid__;
/**
* <p>usrSid を取得します。
* @return usrSid
*/
public String getUsrSid() {
return usrSid__;
}
/**
* <p>usrSid をセットします。
* @param usrSid usrSid
*/
public void setUsrSid(String usrSid) {
usrSid__ = usrSid;
}
/**
*
* <br>[機 能] 入力チェック
* <br>[解 説]
* <br>[備 考]
* @param gsMsg GsMessage
* @return errors
*/
public ActionErrors validateCheck(
GsMessage gsMsg) {
ActionErrors errors = new ActionErrors();
GSValidateApi.validateSid(errors, usrSid__, "usrSid",
"usrSid", false);
return errors;
}
}
| [
"PK140601-29@PK140601-29"
] | PK140601-29@PK140601-29 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.