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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
97693c682d40d5eb97057ccda971462cc5dc4be6 | bb993b12a4a295ee876e1b5a54e82fc309c6f646 | /Spring_Demo_Annotations-3/src/org/jay/springannotations/CircleEvent.java | f12a6573e66d7c7a8c66f98c2423567c43641247 | [] | no_license | Jayvardhan-Reddy/Spring-Kaushik | e4c55b2c2c407886b61a1663250e013a56ec93f8 | 52a79f2d28e9a77276aa224c3cd5e0ee0e6f6274 | refs/heads/master | 2020-03-27T12:23:58.302748 | 2018-08-29T06:07:58 | 2018-08-29T06:07:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,049 | java | package org.jay.springannotations;
import javax.annotation.Resource;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;
@Component
public class CircleEvent implements ShapeAnnotations,ApplicationEventPublisherAware{
private PointAnnotaion center;
private ApplicationEventPublisher publish;
public PointAnnotaion getCenter() {
return center;
}
@Resource
public void setCenter(PointAnnotaion center) {
this.center = center;
}
public void draw() {
System.out.println("In draw method Component circle ");
System.out.println("Circle = ("+getCenter().getX() + "," + getCenter().getY() +")");
DrawEvent draweve = new DrawEvent(this);
publish.publishEvent(draweve);
}
@Override
public void setApplicationEventPublisher(ApplicationEventPublisher publish) {
this.publish=publish;
}
}
| [
"[email protected]"
] | |
df824a111af126cf6e1a8cbb2a34d0808736ea7b | 4cd934d823612a89c1340f0bfc1ae31a964a5204 | /bedrock261/src/main/java/soupply/bedrock261/protocol/play/WSConnect.java | dfcdece342c3a9fac28222978700802110b6ee5f | [
"MIT"
] | permissive | DaMatrix/java | 307d9b426efd1086efc4466e7bd9528b103e68a3 | e94bcca06efe16eaab8d1cfb4e349df9715da4cf | refs/heads/master | 2020-03-21T05:21:32.137602 | 2018-06-18T14:50:44 | 2018-06-18T14:50:44 | 138,156,892 | 1 | 0 | null | 2018-06-21T10:40:33 | 2018-06-21T10:40:32 | null | UTF-8 | Java | false | false | 990 | java | package soupply.bedrock261.protocol.play;
import java.util.*;
import soupply.util.*;
public class WSConnect extends soupply.bedrock261.Packet
{
public static final int ID = 95;
public String unknown0;
public WSConnect()
{
}
public WSConnect(String unknown0)
{
this.unknown0 = unknown0;
}
@Override
public int getId()
{
return ID;
}
@Override
public void encodeBody(Buffer _buffer)
{
byte[] d5b9ba = _buffer.convertString(unknown0);
_buffer.writeVaruint((int)d5b9ba.length);
_buffer.writeBytes(d5b9ba);
}
@Override
public void decodeBody(Buffer _buffer) throws BufferOverflowException
{
final int bvd5b9ba = _buffer.readVaruint();
unknown0 = _buffer.readString(bvd5b9ba);
}
public static WSConnect fromBuffer(byte[] buffer)
{
WSConnect packet = new WSConnect();
packet.safeDecode(buffer);
return packet;
}
}
| [
"[email protected]"
] | |
b26691188f988348f7d614407717a8aaa9fe8f91 | 2ca93846ab8f638a7d8cd80f91566ee3632cf186 | /Entire Dataset/1-45/memory/StoringMeaninglessProviso.java | c9c92e61d3650d1ed530e67e8a32ab71861b5f94 | [
"MIT"
] | permissive | hjc851/SourceCodePlagiarismDetectionDataset | 729483c3b823c455ffa947fc18d6177b8a78a21f | f67bc79576a8df85e8a7b4f5d012346e3a76db37 | refs/heads/master | 2020-07-05T10:48:29.980984 | 2019-08-15T23:51:55 | 2019-08-15T23:51:55 | 202,626,196 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 223 | java | package memory;
public class StoringMeaninglessProviso extends java.lang.Exception {
public StoringMeaninglessProviso(String letters) {
super(letters);
}
public StoringMeaninglessProviso() {
super();
}
}
| [
"[email protected]"
] | |
d136ddf3ddd9aea253a46318df77b7beeea4b249 | 9171804e211213c3e8dd6ac67f089374a765553d | /src/generator/objects/procedure_creator.java | 5a4928e8928ee075033ab901711185bc07609fb8 | [] | no_license | isparthama/KOPKAR | 62b09c318e8d869ae61c58b7805ada7aeff6161a | badd79acf15fcc8f359303ffd9e10baddaf0888e | refs/heads/master | 2021-05-20T21:15:17.339859 | 2020-04-02T10:04:33 | 2020-04-02T10:04:33 | 252,418,032 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,174 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package generator.objects;
import file.filecls;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import jdbc.DbBean;
import utils.appsettinghandler;
/**
*
* @author solution
*/
public class procedure_creator {
String REMARK_FIELD_LIST="<FIELD_LIST>";
String REMARK_FIELD_LIST_END="<FIELD_LIST_END>";
private tablecls t;
procedure_creator(tablecls t) {
this.t=t;
}
public Boolean createprocedure(filecls o) {
String squery="";
String c;
boolean bskip=false;
tablefieldscls d;
String e;
try {
tablefieldscolcls of=new tablefieldscolcls(t.getdb(),t.getTablename());
if (of.initdata()){
// db.execute("drop procedure sp_"+t.getTablename()+"_get");
// db.execute("drop procedure sp_"+t.getTablename()+"_insert");
// db.execute("drop procedure sp_"+t.getTablename()+"_update");
// db.execute("drop procedure sp_"+t.getTablename()+"_delete");
this.t.setKey(of.getkey());
for (int i=0;i<o.getcontainsize();i++){
c=o.getcontain(i);
String a=c.replace("template", t.getTablename());
String b=a.replace("KEY", of.getkey());
if (c.contains(this.REMARK_FIELD_LIST)){
bskip=true;
} else if (bskip&&c.contains(this.REMARK_FIELD_LIST_END)){
bskip=false;
} else {
squery=squery+"\n "+b;
}
if (bskip){
i++;
String format=o.getcontain(i);
for (int j=0;j<of.size();j++){
d=of.get(j);
if (!d.getField().equalsIgnoreCase("id")&&!d.getField().equalsIgnoreCase("entrydate")&&!d.getField().equalsIgnoreCase("auditdate")){
a=format.replace("FIELD_NAME", d.getField());
b=a.replace("FIELD_TYPE", d.getType());
if (j==of.size()-1){
e=b.replace(",", "");
b=e;
}
squery=squery+"\n "+b;
}
}
}
}
t.getdb().execute(squery);
return true;
}
} catch (SQLException ex) {
Logger.getLogger(procedure_creator.class.getName()).log(Level.SEVERE, null, ex);
}
return false;
}
void dropprocedure(String procedurename) {
try {
t.getdb().execute("drop procedure " + procedurename);
} catch (SQLException ex) {
Logger.getLogger(procedure_creator.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| [
"[email protected]"
] | |
8ba000b76552774bc844dd3fbea10fa7fbba53ad | 095206bf4ba4662184c5a0de4caccec1d3dbce46 | /src/main/java/guru/springframework/springmvcrest/services/CustomerService.java | 2838b2cb3e5c2b55e693b41729b772d24b58f60e | [] | no_license | AustejaKazlauskyte/spring-mvc-rest | 06643b65ad8356cd31a056aa5bf8a9c0ec00dbad | 0b5be2374c89bf2c4f51544b9d59c3bbe28655f9 | refs/heads/master | 2022-08-26T13:39:25.564200 | 2020-05-23T08:54:21 | 2020-05-23T08:54:21 | 266,298,768 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 255 | java | package guru.springframework.springmvcrest.services;
import guru.springframework.springmvcrest.domain.Customer;
import java.util.List;
public interface CustomerService {
Customer findCustomerById(Long id);
List<Customer> findAllCustomers();
}
| [
"[email protected]"
] | |
30e2a94596e94d59a68f94514fed689bceda1b65 | 75d987c1eb5d28889e1abef24784ff60a62599d7 | /com/dream/client/constants/ErrorCode.java | 35cf678147c9e7513bf5a6a03bfd93b816d3e93a | [] | no_license | luxr123/app-client | a45deafac25889130720a5090f700ba6c88eaba5 | 0bfde52f6eceaa747a9982770d310d06dc9dbc7d | refs/heads/master | 2020-04-17T20:11:31.851807 | 2014-03-24T12:30:46 | 2014-03-24T12:30:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,274 | java | package com.dream.client.constants;
import java.util.HashMap;
import java.util.Map;
/**
* User: xiaorui.lu
* Date: 2014年1月2日 下午8:14:44
*/
public class ErrorCode {
public static String DELIM = "--";
// 存储k-v
static Map<String, String> map = new HashMap<String, String>();
// 定义所有的错误码以及对应的信息
public static String CODE_SUCCESS = "0000";
static {
map.put(CODE_SUCCESS, "执行成功");
}
public static String CODE_FAILED = "0001";
static {
map.put(CODE_FAILED, "执行失败");
}
public static String CODE_FILE_NOT_EXIST = "0002";
static {
map.put(CODE_FILE_NOT_EXIST, "文件不存在");
}
public static String CODE_MISSING_PARAM = "0003";
static {
map.put(CODE_MISSING_PARAM, "缺少参数");
}
public static String CODE_STATUS_ERROR = "0004";
static {
map.put(CODE_STATUS_ERROR, "状态错误");
}
public static String CODE_CHECK_ERROR = "0004";
static {
map.put(CODE_CHECK_ERROR, "验证码错误");
}
// 特定的几个错误对象
public static ErrorCode SUCCESS = new ErrorCode(CODE_SUCCESS);
public static ErrorCode FAILED = new ErrorCode(CODE_FAILED);
// 两个属性
private String err;
private String msg;
private boolean succeed;
public ErrorCode() {
}
public ErrorCode(String err) {
this.err = err;
this.msg = map.get(this.err);
this.succeed = isSucceed();
}
public ErrorCode(String err, String msg) {
this.err = err;
this.msg = map.get(this.err) + "--" + msg;
this.succeed = isSucceed();
}
public void setSucceed(boolean succeed) {
this.succeed = succeed;
}
public boolean isSucceed() {
return this.err.equals(CODE_SUCCESS);
}
public String getErr() {
return err;
}
public void setErr(String err) {
this.err = err;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
@Override
public String toString() {
return "ErrorCode [err=" + err + ", msg=" + msg + ", succeed=" + succeed + "]";
}
public static void main(String[] args) {
ErrorCode errorCode = new ErrorCode("0000");
System.out.println(errorCode);
System.out.println(ErrorCode.SUCCESS);
}
}
| [
"[email protected]"
] | |
b9e3af9663a25cfa3b313337236c88ab11f8e1cf | 5e37161bc4eba92e02237235ad4a2dfd8b4188b7 | /jinshuo-core/src/main/java/com/jinshuo/core/model/BaseEntity.java | 86524124799bf27cb82f8ed11d63b6cd4085444f | [] | no_license | dyhimos/jinshuo-mall | f4400cc41ca6a57b7512832209eea6d1a8c3b101 | b1cc18c8445a46abd35796bfdad55824f0f4a5a8 | refs/heads/master | 2022-07-12T23:16:16.872664 | 2020-05-14T13:09:27 | 2020-05-14T13:09:27 | 260,648,942 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,092 | java | package com.jinshuo.core.model;
import lombok.Data;
import java.io.Serializable;
/**
* @Classname BaseEntity
* @Description TODO
* @Date 2019/7/9 18:50
* @Created by dyh
*/
@Data
public abstract class BaseEntity extends AssertionConcern implements Serializable {
private static final long serialVersionUID = 1L;
/** 实体编号(唯一标识) **/
private Long id = -1L;
/**
* 是否是新记录(默认:false),调用setIsNewRecord()设置新记录,使用自定义ID。
* 设置为true后强制执行插入语句,ID不会自动生成,需从手动传入。
*/
protected boolean isNewRecord = true;
public BaseEntity() {
}
public BaseEntity(long id) {
this();
this.id = id;
}
public Long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
/**
* 插入之前执行方法,子类实现
*/
public abstract void preInsert();
/**
* 更新之前执行方法,子类实现
*/
public abstract void preUpdate();
}
| [
"1"
] | 1 |
fa463587677376d182fd3a6ad84c2bd12fd08e1e | 74b6018e594e5cba71d3e26ef70884c92abde0c0 | /mmstudio/src/main/java/org/micromanager/internal/utils/GUIUpdater.java | 478a821ef9f19c8b48cd65026d2086bff4083520 | [
"BSD-3-Clause"
] | permissive | lwxGitHub123/micro-manager | 4b5caec8f25de2b7a9e92e7883eecc026fdc08b9 | a945fdf550ba880744b5b3695fa2c559505f735b | refs/heads/main | 2023-06-24T13:00:29.082165 | 2021-07-29T07:24:13 | 2021-07-29T07:24:13 | 382,203,845 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,802 | java | ///////////////////////////////////////////////////////////////////////////////
//PROJECT: Micro-Manager
//SUBSYSTEM: mmstudio
//-----------------------------------------------------------------------------
//
// AUTHOR: Arthur Edelstein and Henry Pinkard, 2011
//
// COPYRIGHT: University of California, San Francisco, 2011
//
// LICENSE: This file is distributed under the BSD license.
// License text is included with the source distribution.
//
// This file 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.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
package org.micromanager.internal.utils;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.SwingUtilities;
/**
*
* @author arthur and henry
* DO NOT USE. This code is only here so that the DataBrowser plugin can still
* compile. Remove after this dependency in the DataBrowser has been removed.
*
* @deprecated
*/
@Deprecated
public final class GUIUpdater {
final AtomicReference<Runnable> latestTask = new AtomicReference<Runnable>();
/*
* Post a task for running on the EDT thread. If multiple
* tasks pile up, only the most recent will run.
*/
public void post(Runnable task) {
if (latestTask.getAndSet(task) == null) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
latestTask.getAndSet(null).run();
}
});
}
}
}
| [
"[email protected]"
] | |
a8446fc949694b77f5d5024d9ae46f2dea41ec5d | 68f4e4aa9b8c0295a06f5201fdb0c682d2a2f521 | /app/build/generated/source/r/androidTest/debug/com/dq/xindai/test/R.java | 74705f5200298bcba8b31057e61ea9c00671fb22 | [] | no_license | jingangdan/DQ_XinDai | 11b596f62e258e577b54e27228b8ddec1c8202e2 | 7777784c83c439513fdb3e123867b93a3b0bc01d | refs/heads/master | 2020-04-22T02:41:39.903367 | 2019-02-11T03:13:15 | 2019-02-11T03:13:15 | 170,059,894 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.dq.xindai.test;
public final class R {
public static final class attr {
}
public static final class string {
public static final int app_name=0x7f020000;
}
}
| [
"[email protected]"
] | |
6bc7bc1035633cbd60c7a7c0404c25a412697645 | 4baf89bd510be82afb3746df973efdad69251df9 | /Lab2/src/Main.java | 43ad5f27cd9097474cc4adb6bdf1993582af979f | [] | no_license | EgorBa/Math_Logic | d5eec8a6d1f99b35dc13b8b0806b9efa06f55990 | b8c3ee42ddf4e0463410f861fa0e0d090dfbce8b | refs/heads/main | 2023-02-20T13:43:26.784852 | 2021-01-18T17:36:46 | 2021-01-18T17:36:46 | 330,738,563 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,980 | java | import java.io.*;
import java.util.*;
public class Main {
public static class Pair {
public Expression expression;
public int number;
Pair(Expression exp, int n) {
expression = exp;
number = n;
}
}
public static class AnyExpression {
public Expression expression;
public int numberHypothesise = 0;
public int numberAxiom = 0;
public int numberModusPonensFirst, numberModusPonensPSecond;
public boolean isHypothesise = false;
public boolean isAxiom = false;
public boolean isMP = false;
public boolean isResultProof = false;
public AnyExpression(Expression expression) {
this.expression = expression;
}
}
private static final String COMMA = ",";
private static final String EMPTY = "";
private static final String TUR = "\\|-";
private static Expression finalExpression;
private static List<Pair> hypotheses;
private static HashMap<Expression, Integer> numberProofs;
private static HashMap<Expression, LinkedList<Expression>> modusPonensRightPart;
private static List<AnyExpression> proofs;
public static int count;
public static boolean flag;
public static void main(String[] args) throws IOException
{
flag = false;
hypotheses = new ArrayList<>();
numberProofs = new HashMap<>();
modusPonensRightPart = new HashMap<>();
proofs = new ArrayList<>();
count = 0;
//BufferedReader bufferedReader = new BufferedReader(new FileReader("C:\\Users\\Egor Bazhenov\\IdeaProjects\\ProofChecker\\test3.in"));
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in))) {
String statement;
while ((statement = bufferedReader.readLine()) != null) {
addString(statement);
flag = true;
}
} catch (IllegalArgumentException e) {
System.out.println("Proof is incorrect");
return;
}
checkProofs();
writeProofs();
}
private static void parseFirstLine(String statement) {
String[] split = statement.split(TUR);
int i = 1;
for (String s : split[0].split(COMMA)) {
if (s.equals(EMPTY)) {
continue;
}
hypotheses.add(new Pair(parse(s), i));
i++;
}
finalExpression = parse(split[1]);
count++;
}
private static boolean checkHypothesise(Expression hypothesise) {
for (Pair pair : hypotheses) {
if (pair.expression.equals(hypothesise)) {
AnyExpression expression = new AnyExpression(hypothesise);
expression.isHypothesise = true;
expression.numberHypothesise = pair.number;
addExpression(expression);
return true;
}
}
return false;
}
private static boolean checkAxiom(Expression axiom) {
int axiomNumber = getNumberAxiom(axiom);
if (axiomNumber == 0) {
return false;
}
AnyExpression expression = new AnyExpression(axiom);
expression.isAxiom = true;
expression.numberAxiom = axiomNumber;
addExpression(expression);
return true;
}
private static boolean checkModusPonens(Expression modusPonens) {
if (!modusPonensRightPart.containsKey(modusPonens)) {
return false;
}
for (Expression expr : modusPonensRightPart.get(modusPonens)) {
if (expr.getType() == 1 && numberProofs.containsKey(expr.getLeftPart())) {
AnyExpression expression = new AnyExpression(modusPonens);
expression.isMP = true;
expression.numberModusPonensFirst = numberProofs.get(expr.getLeftPart());
expression.numberModusPonensPSecond = numberProofs.get(expr);
addExpression(expression);
return true;
}
}
return false;
}
private static void addExpression(AnyExpression expression) {
proofs.add(expression);
if (expression.expression.getType() == 1) {
modusPonensRightPart.putIfAbsent(expression.expression.getRightPart(), new LinkedList<>());
modusPonensRightPart.get(expression.expression.getRightPart()).addFirst(expression.expression);
}
numberProofs.putIfAbsent(expression.expression, count);
count++;
}
public static void checkProofs() {
if (proofs.get(proofs.size() - 1).expression.equals(finalExpression)) {
for (int i = 0; i <= proofs.size(); i++) {
if (proofs.get(i).expression.equals(finalExpression)) {
checkProof(proofs.get(i));
return;
}
}
}
System.out.println("Proof is incorrect");
System.exit(0);
}
private static void checkProof(AnyExpression expression) {
expression.isResultProof = true;
if (expression.isMP) {
checkProof(proofs.get(expression.numberModusPonensFirst - 1));
checkProof(proofs.get(expression.numberModusPonensPSecond - 1));
}
}
public static void writeProofs() {
StringBuilder stringBuilder = new StringBuilder();
for (Pair hypothesis : hypotheses) {
stringBuilder.append(hypothesis.expression.printExpresion()).append(", ");
}
if (hypotheses.size() > 0) {
stringBuilder = new StringBuilder(stringBuilder.substring(0, stringBuilder.length() - 2));
stringBuilder.append(" ");
}
PrintWriter out = new PrintWriter(System.out);
stringBuilder.append("|- ").append(finalExpression.printExpresion()).append(System.lineSeparator());
out.print(stringBuilder.toString());
int counter = 1;
Map<Integer, Integer> indexes = new HashMap<>();
for (AnyExpression expression : proofs) {
if (expression.isResultProof) {
out.print("[" + counter + ". ");
indexes.put(numberProofs.get(expression.expression), counter);
counter++;
if (expression.isHypothesise) {
out.println("Hypothesis " + expression.numberHypothesise + "] " + expression.expression.printExpresion());
}
if (expression.isAxiom) {
out.println("Ax. sch. " + expression.numberAxiom + "] " + expression.expression.printExpresion());
}
if (expression.isMP) {
out.println("M.P. " + indexes.get(expression.numberModusPonensPSecond) + ", " + indexes.get(expression.numberModusPonensFirst) + "] " + expression.expression.printExpresion());
}
}
}
out.close();
}
public static void addString(String str) {
if (!flag) {
parseFirstLine(str);
} else {
Expression expression = parse(str);
if (checkHypothesise(expression)) return;
if (checkAxiom(expression)) return;
if (checkModusPonens(expression)) return;
throw new IllegalArgumentException();
}
}
private static boolean check1Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getRightPart().getType() == 1)
&& (expression.getRightPart().getRightPart().equals(expression.getLeftPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check2Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getLeftPart().getType() == 1)
&& (expression.getRightPart().getType() == 1)
&& (expression.getRightPart().getLeftPart().getType() == 1)
&& (expression.getRightPart().getLeftPart().getRightPart().getType() == 1)
&& (expression.getRightPart().getRightPart().getType() == 1)
&& (expression.getLeftPart().getLeftPart().equals(expression.getRightPart().getLeftPart().getLeftPart()))
&& (expression.getRightPart().getLeftPart().getLeftPart().equals(expression.getRightPart().getRightPart().getLeftPart()))
&& (expression.getLeftPart().getRightPart().equals(expression.getRightPart().getLeftPart().getRightPart().getLeftPart()))
&& (expression.getRightPart().getLeftPart().getRightPart().getRightPart().equals(expression.getRightPart().getRightPart().getRightPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check3Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getRightPart().getType() == 1)
&& (expression.getRightPart().getRightPart().getType() == 2)
&& (expression.getLeftPart().equals(expression.getRightPart().getRightPart().getLeftPart()))
&& (expression.getRightPart().getLeftPart().equals(expression.getRightPart().getRightPart().getRightPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check4Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getLeftPart().getType() == 2)
&& (expression.getLeftPart().getLeftPart().equals(expression.getRightPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check5Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getLeftPart().getType() == 2)
&& (expression.getLeftPart().getRightPart().equals(expression.getRightPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check6Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getRightPart().getType() == 3)
&& (expression.getLeftPart().equals(expression.getRightPart().getLeftPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check7Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getRightPart().getType() == 3)
&& (expression.getLeftPart().equals(expression.getRightPart().getRightPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check8Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getLeftPart().getType() == 1)
&& (expression.getRightPart().getType() == 1)
&& (expression.getRightPart().getLeftPart().getType() == 1)
&& (expression.getRightPart().getRightPart().getType() == 1)
&& (expression.getRightPart().getRightPart().getLeftPart().getType() == 3)
&& (expression.getLeftPart().getLeftPart().equals(expression.getRightPart().getRightPart().getLeftPart().getLeftPart()))
&& (expression.getRightPart().getLeftPart().getLeftPart().equals(expression.getRightPart().getRightPart().getLeftPart().getRightPart()))
&& (expression.getLeftPart().getRightPart().equals(expression.getRightPart().getLeftPart().getRightPart()))
&& (expression.getRightPart().getLeftPart().getRightPart().equals(expression.getRightPart().getRightPart().getRightPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check9Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getLeftPart().getType() == 1)
&& (expression.getRightPart().getType() == 1)
&& (expression.getRightPart().getLeftPart().getType() == 1)
&& (expression.getRightPart().getRightPart().getType() == 4)
&& (expression.getRightPart().getLeftPart().getRightPart().getType() == 4)
&& (expression.getLeftPart().getLeftPart().equals(expression.getRightPart().getLeftPart().getLeftPart()))
&& (expression.getRightPart().getLeftPart().getLeftPart().equals(expression.getRightPart().getRightPart().getLeftPart()))
&& (expression.getLeftPart().getRightPart().equals(expression.getRightPart().getLeftPart().getRightPart().getLeftPart()))
);
} catch (Exception e) {
return false;
}
}
private static boolean check10Axiom(Expression expression) {
try {
return ((expression.getType() == 1)
&& (expression.getLeftPart().getType() == 4)
&& (expression.getLeftPart().getLeftPart().getType() == 4)
&& (expression.getLeftPart().getLeftPart().getLeftPart().equals(expression.getRightPart()))
);
} catch (Exception e) {
return false;
}
}
static public int getNumberAxiom(Expression expression) {
if (check1Axiom(expression)) return 1;
if (check2Axiom(expression)) return 2;
if (check3Axiom(expression)) return 3;
if (check4Axiom(expression)) return 4;
if (check5Axiom(expression)) return 5;
if (check6Axiom(expression)) return 6;
if (check7Axiom(expression)) return 7;
if (check8Axiom(expression)) return 8;
if (check9Axiom(expression)) return 9;
if (check10Axiom(expression)) return 10;
return 0;
}
public static Expression parse(String expression) {
return parseImpl(normalise(expression));
}
public static Expression parseImpl(String expression) {
int balance = 0;
char chr;
StringBuilder str = new StringBuilder();
for (int i = 0; i < expression.length(); i++) {
switch (chr = expression.charAt(i)) {
case ')':
balance--;
str.insert(0, chr);
continue;
case '(':
balance++;
str.insert(0, chr);
continue;
default:
if (chr == '-' && balance == 0) {
return new Implication(parseDis(str.toString()), parseImpl(expression.substring(i + 2)));
} else {
str.insert(0, chr);
}
}
}
return parseDis(str.toString());
}
public static Expression parseDis(String expression) {
int balance = 0;
char chr;
StringBuilder str = new StringBuilder();
for (int i = 0; i < expression.length(); i++) {
switch (chr = expression.charAt(i)) {
case ')':
balance--;
str.insert(0, chr);
continue;
case '(':
balance++;
str.insert(0, chr);
continue;
default:
if (chr == '|' && balance == 0) {
return new Or(parseDis(expression.substring(i + 1)), parseCon(str.toString()));
} else {
str.insert(0, chr);
}
}
}
return parseCon(str.toString());
}
public static String recursiveReverse(String s) {
StringBuilder str = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
str.insert(0, s.charAt(i));
}
return str.toString();
}
public static Expression parseCon(String expression) {
expression = recursiveReverse(expression);
int balance = 0;
char chr;
StringBuilder str = new StringBuilder();
for (int i = 0; i < expression.length(); i++) {
switch (chr = expression.charAt(i)) {
case ')':
balance--;
str.insert(0, chr);
continue;
case '(':
balance++;
str.insert(0, chr);
continue;
default:
if (chr == '&' && balance == 0) {
return new And(parseCon(recursiveReverse(expression.substring(i + 1))), parseNeg(str.toString()));
} else {
str.insert(0, chr);
}
}
}
return parseNeg(str.toString());
}
public static Expression parseNeg(String expression) {
char chr = expression.charAt(0);
if (chr == '!') {
return new Not(parseNeg(expression.substring(1)));
} else {
if (chr == '(') {
return parseImpl(expression.substring(1, expression.length() - 1));
} else {
return new Const(expression);
}
}
}
public static String normalise(String s) {
StringBuilder str = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) != ' ') {
str.append(s.charAt(i));
}
}
return str.toString();
}
} | [
"[email protected]"
] | |
e55aa7d1bfb6db976ad307f86ef1c9fa2d66053f | 8eb1de597a5e205a254816ccd088708765f292af | /app/src/main/java/com/example/uasrizki/out_datakeluarga.java | daa29cc6bc56c1029784229092824013fccfb699 | [] | no_license | rizki20h/UasPemogramanBergerakRizki | 3de2f0293c6b1fd7972fe1b43e07cfbab172d2c2 | e620bde37a4056c6ecf225d5813177f01aad4683 | refs/heads/master | 2023-06-11T05:32:18.646106 | 2021-07-05T04:25:13 | 2021-07-05T04:25:13 | 383,011,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,783 | java | package com.example.uasrizki;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class out_datakeluarga extends AppCompatActivity {
TextView nama_ayah,pekerjaan_ayah,nama_ibu,pekerjaan_ibu,alamat;
ImageButton home_ortu;
String nama_a,pekerjaan_a,nama_i,pekerjaan_i,alamat_o;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_out_datakeluarga);
nama_ayah = findViewById(R.id.out_namaBapak);
pekerjaan_ayah = findViewById(R.id.out_pekerjaanAyah);
nama_ibu = findViewById(R.id.out_namaIbu);
pekerjaan_ibu = findViewById(R.id.out_pekerjaanIbu);
alamat = findViewById(R.id.out_alamat);
Intent intent = getIntent();
nama_a = intent.getStringExtra("NAMAA");
pekerjaan_a = intent.getStringExtra("PEKERJAANA");
nama_i = intent.getStringExtra("NAMAI");
pekerjaan_i = intent.getStringExtra("PEKERJAANI");
alamat_o = intent.getStringExtra("ALAMAT");
nama_ayah.setText("Nama Ayah = " +nama_a);
pekerjaan_ayah.setText("Pekerjaan Ayah = " +pekerjaan_a);
nama_ibu.setText("Nama Ibu = " + nama_i);
pekerjaan_ibu.setText("Pekerjaan Ibu = " + pekerjaan_i);
alamat.setText("Alamat = " +alamat_o);
home_ortu = findViewById(R.id.btn_homeOrtu);
home_ortu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(out_datakeluarga.this,content1.class));
}
});
}
} | [
"[email protected]"
] | |
b64216b005e3ca4caca539cd430697ced3e1a660 | 2cd64269df4137e0a39e8e67063ff3bd44d72f1b | /commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/ShippingQueryBuilderDsl.java | c9ae68d92bd690771433e20160b03d419ec004c7 | [
"Apache-2.0",
"GPL-2.0-only",
"EPL-2.0",
"CDDL-1.0",
"MIT",
"BSD-3-Clause",
"Classpath-exception-2.0"
] | permissive | commercetools/commercetools-sdk-java-v2 | a8703f5f8c5dde6cc3ebe4619c892cccfcf71cb8 | 76d5065566ff37d365c28829b8137cbc48f14df1 | refs/heads/main | 2023-08-14T16:16:38.709763 | 2023-08-14T11:58:19 | 2023-08-14T11:58:19 | 206,558,937 | 29 | 13 | Apache-2.0 | 2023-09-14T12:30:00 | 2019-09-05T12:30:27 | Java | UTF-8 | Java | false | false | 3,134 | java |
package com.commercetools.api.predicates.query.cart;
import java.util.function.Function;
import com.commercetools.api.predicates.query.*;
public class ShippingQueryBuilderDsl {
public ShippingQueryBuilderDsl() {
}
public static ShippingQueryBuilderDsl of() {
return new ShippingQueryBuilderDsl();
}
public StringComparisonPredicateBuilder<ShippingQueryBuilderDsl> shippingKey() {
return new StringComparisonPredicateBuilder<>(
BinaryQueryPredicate.of().left(new ConstantQueryPredicate("shippingKey")),
p -> new CombinationQueryPredicate<>(p, ShippingQueryBuilderDsl::of));
}
public CombinationQueryPredicate<ShippingQueryBuilderDsl> shippingInfo(
Function<com.commercetools.api.predicates.query.cart.ShippingInfoQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.cart.ShippingInfoQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(
ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("shippingInfo"))
.inner(fn.apply(com.commercetools.api.predicates.query.cart.ShippingInfoQueryBuilderDsl.of())),
ShippingQueryBuilderDsl::of);
}
public CombinationQueryPredicate<ShippingQueryBuilderDsl> shippingAddress(
Function<com.commercetools.api.predicates.query.common.AddressQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.common.AddressQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(
ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("shippingAddress"))
.inner(fn.apply(com.commercetools.api.predicates.query.common.AddressQueryBuilderDsl.of())),
ShippingQueryBuilderDsl::of);
}
public CombinationQueryPredicate<ShippingQueryBuilderDsl> shippingRateInput(
Function<com.commercetools.api.predicates.query.cart.ShippingRateInputQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.cart.ShippingRateInputQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(
ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("shippingRateInput"))
.inner(fn.apply(com.commercetools.api.predicates.query.cart.ShippingRateInputQueryBuilderDsl.of())),
ShippingQueryBuilderDsl::of);
}
public CombinationQueryPredicate<ShippingQueryBuilderDsl> shippingCustomFields(
Function<com.commercetools.api.predicates.query.type.CustomFieldsQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.type.CustomFieldsQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(
ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("shippingCustomFields"))
.inner(fn.apply(com.commercetools.api.predicates.query.type.CustomFieldsQueryBuilderDsl.of())),
ShippingQueryBuilderDsl::of);
}
}
| [
"[email protected]"
] | |
9caa6ceed13cbae4bd888f8178c23497f6c2a7ba | 2f4c04aa4eb03d2c4b2247f0847cd07834020d3a | /src/main/java/br/com/restfull/exception/ResourceNotFoundException.java | f6013b42f5982719e4e70d5daae5328a1d61a587 | [] | no_license | miguelmlima/Rest_full_API | aa04158a725eb15f34dbcda697af836fbf230f11 | 66328c51729bdbac361e28036d05ef875f9e50b3 | refs/heads/master | 2022-12-31T21:31:39.733054 | 2020-07-17T23:59:06 | 2020-07-17T23:59:06 | 280,548,113 | 0 | 0 | null | 2020-10-13T23:40:12 | 2020-07-18T00:02:36 | TSQL | UTF-8 | Java | false | false | 392 | java | package br.com.restfull.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.NOT_FOUND)
public class ResourceNotFoundException extends RuntimeException{
private static final long serialVersionUID = 1L;
public ResourceNotFoundException(String exception) {
super(exception);
}
} | [
"[email protected]"
] | |
e0ad63fd3f7275328a937589c0a36f964abf45ac | 5a0df3f19a9b20e5ac945d3dc21ab72a2e5bb405 | /hw2/src/edu/iastate/cs228/hw2/InsertionSorter.java | 53ec8c75cfebbcb4317ccffeeb58a9bcb4e035f8 | [] | no_license | emciastate/CS228 | e7476c1158ddcf5b261cc08eb694ba1cbaadf7f1 | 1d1c5f0de7bd08aa39c301d7c05e6d01601223a8 | refs/heads/master | 2023-02-04T10:16:31.328730 | 2020-12-22T21:03:30 | 2020-12-22T21:03:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,330 | java | package edu.iastate.cs228.hw2;
import java.io.FileNotFoundException;
import java.lang.NumberFormatException;
import java.lang.IllegalArgumentException;
import java.util.InputMismatchException;
/**
*
* @author jakeg
*
*/
/**
*
* This class implements insertion sort.
*
*/
public class InsertionSorter extends AbstractSorter
{
// Other private instance variables if you need ...
/**
* Constructor takes an array of points. It invokes the superclass constructor, and also
* set the instance variables algorithm in the superclass.
*
* @param pts
*/
public InsertionSorter(Point[] pts)
{
super(pts);
algorithm = "insertion sort";
}
/**
* Perform insertion sort on the array points[] of the parent class AbstractSorter.
*/
@Override
public void sort()
{
int i, j;
Point key;
for (i = 1; i < points.length; i++)
{
key = new Point(points[i].getX(),points[i].getY());
j = i - 1;
while (j >= 0 && pointComparator.compare(points[j], key)>0)
{
points[j + 1] = new Point(points[j].getX(),points[j].getY()); //if element in point is greater than key, move ahead of current position
j = j - 1;
}
points[j + 1] = new Point(key.getX(),key.getY());
}
}
}
| [
"[email protected]"
] | |
7e770868de8d9891a47efa67e3d81b191b6dc540 | e09b548dd204038924bba2a94fc05fc959f5a696 | /sources/androidx/lifecycle/AndroidViewModel.java | d07f116c32911390069973479ccd270f39dca29c | [
"Unlicense"
] | permissive | Li-amK/School-Chemie-App | 9472ac787be3658d0dc3a32a2787b98c34711c18 | 0b747e08e46d43e44849d6c59fd254f9466a4003 | refs/heads/main | 2022-07-29T13:51:33.064078 | 2022-02-06T18:21:34 | 2022-02-06T18:21:34 | 456,215,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | package androidx.lifecycle;
import android.annotation.SuppressLint;
import android.app.Application;
import androidx.annotation.NonNull;
/* loaded from: classes.dex */
public class AndroidViewModel extends ViewModel {
@SuppressLint({"StaticFieldLeak"})
private Application mApplication;
public AndroidViewModel(@NonNull Application application) {
this.mApplication = application;
}
@NonNull
public <T extends Application> T getApplication() {
return (T) this.mApplication;
}
}
| [
"[email protected]"
] | |
c6922adf2974fa6fd1db3c71a34977c7181bd85c | 7c32a5a88fc41c1abb6f1f66e5658ed476bd139a | /community-api/src/main/java/com/nagarro/models/Contacts.java | f4f04717b3402251848b6df966b259c7724eee93 | [] | no_license | bhumikaarora711/Community-QForum | 616c1addcab6bf01c6adf515cf85f01a045c408b | 0b2c72c75d1aa1d5609bb7b5a6615d1023b5792c | refs/heads/main | 2023-07-11T22:34:39.269771 | 2021-08-24T16:50:03 | 2021-08-24T16:50:03 | 399,489,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,159 | java | package com.nagarro.models;
/*
* @author Bhumika_arora
*/
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
public class Contacts {
@Id @GeneratedValue(strategy=GenerationType.AUTO)
int id;
@Column @NotNull
String name;
@Column @NotNull
String email;
@Column @NotNull
String comment;
public Contacts(final int id, @NotNull final String name, @NotNull final String email, @NotNull final String comment) {
super();
this.id = id;
this.name = name;
this.email = email;
this.comment = comment;
}
public Contacts() {
super();
// TODO Auto-generated constructor stub
}
public int getId() {
return id;
}
public void setId(final int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(final String email) {
this.email = email;
}
public String getComment() {
return comment;
}
public void setComment(final String comment) {
this.comment = comment;
}
}
| [
"[email protected]"
] | |
c9a057e21e6919d16b8dbf42f61fd881ff5469ea | 392c495f826569a91f7d4055987295fab58e79fa | /src/main/java/com/github/osvaldopina/signedcontract/enforcer/Clause.java | b4ab950551dca81ce1b1ea9ecbc17f23c2d1fe3c | [] | no_license | osvaldopina/hamcrest-jsonhal | 18ea45bd70c0234b8b5f87dd930d097551ac5038 | 78791c3dc3e8b9d68f875d53d3fc3be96d2d3da4 | refs/heads/master | 2020-04-06T07:02:21.918207 | 2016-08-26T20:48:01 | 2016-08-26T20:48:01 | 57,413,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 811 | java | package com.github.osvaldopina.signedcontract.enforcer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Clause<T> {
private T documentClause;
private List<Error> errors = new ArrayList<Error>();
private List<Clause<T>> subClauses = new ArrayList<Clause<T>>();
public Clause(T documentClause, List<Error> errors, List<Clause<T>> subClauses) {
this.documentClause = documentClause;
this.errors = errors;
this.subClauses = subClauses;
}
public T getDocumentClause() {
return documentClause;
}
public List<Error> getErrors() {
return Collections.unmodifiableList(errors);
}
public List<Clause<T>> getSubClauses() {
return Collections.unmodifiableList(subClauses);
}
}
| [
"[email protected]"
] | |
bbc8f7c875bc2a692ae5f2273aa59acb71583467 | ef0952749946e230110b4e5b9055094398c0a01e | /JAVA/WebExample/統計文章中每個單詞出現的次數.java | 8755f44c980d4a81106a38b1e8df43d7cf13d84f | [] | no_license | lees86209/Tatung_High_School-Coding | f3f6c31fa3ef25a7a3757d4a42cd219261d36d5f | f6601bd915d084ddbe8c341e50b71903108e2c1e | refs/heads/master | 2022-03-27T09:27:09.106731 | 2019-12-12T08:41:11 | 2019-12-12T08:41:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,681 | java |
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
public class splitWords
{
public static void main(String[] args) throws FileNotFoundException
{
File file=new File("C:\\Users\\Administrator\\Desktop\\English.txt");
if(!file.exists())
{
System.out.println("文件不存在");
return;
}
Scanner scanner=new Scanner(file);
//单词和数量映射表
HashMap<String, Integer > hashMap=new HashMap<String,Integer>();
System.out.println("文章-----------------------------------");
while(scanner.hasNextLine())
{
String line=scanner.nextLine();
System.out.println(line);
//\w+ : 匹配所有的单词
//\W+ : 匹配所有非单词
String[] lineWords=line.split("\\W+");//用非单词符来做分割,分割出来的就是一个个单词
Set<String> wordSet=hashMap.keySet();
for(int i=0;i<lineWords.length;i++)
{
//如果已经有这个单词了,
if(wordSet.contains(lineWords[i]))
{
Integer number=hashMap.get(lineWords[i]);
number++;
hashMap.put(lineWords[i], number);
}
else
{
hashMap.put(lineWords[i], 1);
}
}
}
System.out.println("统计单词:------------------------------");
Iterator<String> iterator=hashMap.keySet().iterator();
while(iterator.hasNext())
{
String word=iterator.next();
// System.out.printf("单词: "+word+"出现次数:"+hashMap.get(word));
System.out.printf("单词:%-12s 出现次数:%d\n",word,hashMap.get(word));
}
System.out.println("程序结束--------------------------------");
}
}
| [
"[email protected]"
] | |
21fb8c420f5a14931f7a8900e544800db13512ae | aaf38fd091ba5cc26c39fc5f89478f4613feedcd | /src/main/java/com/java/spring/demo1/config/UserConfig.java | d29fc704459471d428ce6a29581d5fa85382b7cb | [] | no_license | LuDarwin/spring-source-1 | 25e9427aebd8966c8ad5c192987be4c82701b20f | 9c4fbdc0ee974e5bf53bde5a322d31be57088105 | refs/heads/master | 2022-12-27T07:28:47.350069 | 2019-10-03T07:56:07 | 2019-10-03T07:56:07 | 212,524,591 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package com.java.spring.demo1.config;
import com.java.spring.demo1.domain.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
// 建立了一个配置类,这个配置类等于与applicationContext.xml
@Configuration
public class UserConfig {
/**
* 向Spring容器注入了一个Bean,返回值类型就是Bean的类型
* 方法名就是Bean的id(名称)
*
*
* <bean id="user" class="User"></>
*
* @return
*/
@Bean
public User user() {
User user = new User();
user.setId(1000);
user.setName("lisi");
user.setPassword("123456");
user.setSalary(12.34F);
return user;
}
}
| [
"[email protected]"
] | |
228bce8638f15d7cf1520b0f7c474a8bb8bc7c19 | e15d7d0a2dc15998ba32de8ba0dbb2e515068f92 | /SIG_HDP_Master/SIG_HDP_Master-war/src/java/managedBean/rhbean/RhSubsidioBean.java | 0baf693e989e72d792d9fc2438a3332923d67745 | [] | no_license | Projecto2/PFII | 2e004c9010478edb64aa9192dcb060d1f46d8a4a | d21eb80fde87340c8ce34459966e0b8c0d2b6fa2 | refs/heads/master | 2021-09-09T14:00:07.955077 | 2018-03-16T19:09:58 | 2018-03-16T19:09:58 | 125,555,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,048 | 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 managedBean.rhbean;
import entidade.RhSubsidio;
import java.io.Serializable;
import java.util.List;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
import sessao.RhSubsidioFacade;
import util.Mensagem;
/**
*
* @author Ornela F. Boaventura
*/
@ManagedBean
@SessionScoped
public class RhSubsidioBean implements Serializable
{
@Resource
private UserTransaction userTransaction;
@EJB
private RhSubsidioFacade subsidioFacade;
/**
*
* Entidades
*/
private RhSubsidio subsidio, subsidioRemover;
/**
* Creates a new instance of SubsidioBean
*/
public RhSubsidioBean ()
{
}
public RhSubsidio getSubsidio ()
{
if (this.subsidio == null)
{
this.subsidio = new RhSubsidio();
}
return subsidio;
}
public void setSubsidio (RhSubsidio subsidio)
{
this.subsidio = subsidio;
}
public RhSubsidio getSubsidioRemover ()
{
return subsidioRemover;
}
public void setSubsidioRemover (RhSubsidio subsidioRemover)
{
this.subsidioRemover = subsidioRemover;
}
public String create ()
{
try
{
userTransaction.begin();
subsidioFacade.create(subsidio);
userTransaction.commit();
subsidio = null;
Mensagem.sucessoMsg("Subsídio guardado com sucesso!");
}
catch (Exception e)
{
try
{
userTransaction.rollback();
Mensagem.erroMsg(e.toString());
}
catch (IllegalStateException | SecurityException | SystemException ex)
{
Mensagem.erroMsg("Rollback: " + ex.toString());
}
}
return null;
}
public String edit ()
{
try
{
userTransaction.begin();
if (subsidio.getPkIdSubsidio() == null)
{
throw new NullPointerException("PK -> NULL");
}
subsidioFacade.edit(subsidio);
userTransaction.commit();
subsidio = null;
Mensagem.sucessoMsg("Subsídio editado com sucesso!");
}
catch (Exception e)
{
try
{
userTransaction.rollback();
Mensagem.erroMsg(e.toString());
}
catch (IllegalStateException | SecurityException | SystemException ex)
{
Mensagem.erroMsg("Rollback: " + ex.toString());
}
}
return null;
}
public String remove ()
{
try
{
userTransaction.begin();
subsidioFacade.remove(subsidioRemover);
userTransaction.commit();
Mensagem.sucessoMsg("Subsídio removido com sucesso!");
subsidioRemover = null;
}
catch (Exception e)
{
try
{
e.printStackTrace();
Mensagem.erroMsg("Este subsídio possui registro de actividades, impossível remover !");
Mensagem.erroMsg(e.toString());
userTransaction.rollback();
}
catch (IllegalStateException | SecurityException | SystemException ex)
{
e.printStackTrace();
Mensagem.erroMsg("Rollback: " + ex.toString());
}
}
return null;
}
public List<RhSubsidio> findAll ()
{
return subsidioFacade.findAll();
}
public String limpar ()
{
subsidio = null;
return "subsidioRh?faces-redirect=true";
}
}
| [
"amed@AMED-PC"
] | amed@AMED-PC |
51cf172111c342673d394d879fdc041f7f82140b | df463264f609c7ec11aa3916ac94cb59fbcafe71 | /boot-oauth/src/main/java/com/boot/core/BootListener/MyServletContextListener.java | f81484296c1a9037d0cf54bc4437fb532f184acb | [] | no_license | yangjava/boot | 8abdc539c4a1334d7906ae3a00d3e977f065b205 | 2ac7efd9c4545b22011d9ab81250e302d02d7f40 | refs/heads/master | 2022-06-24T04:59:35.738218 | 2020-01-15T02:52:39 | 2020-01-15T02:52:39 | 233,982,471 | 1 | 0 | null | 2022-06-21T02:38:35 | 2020-01-15T02:39:02 | JavaScript | UTF-8 | Java | false | false | 644 | java | package com.boot.core.BootListener;
import org.springframework.stereotype.Component;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
* @author zhuxiaomeng
* @date 2018/1/6.
* @email [email protected]
*/
@Component
public class MyServletContextListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
System.out.println("-------contextInitialized-----------");
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
System.out.println("------------contextDestroyed-------------");
}
}
| [
"qjd123456"
] | qjd123456 |
cad4bf0446219e7a901d67290a13581e7b42fc2b | dda451542581b0ffa2684590f5eaca7cc90c7ec7 | /src/section_4/playing_cat/Main.java | 7aeb303cd2fa1063240b202528fc81d8a67d5395 | [] | no_license | StefanStoynov/udemy_java_master_class | 2c7d25134c238b70bcb9b12ce71ed141a26eac16 | 488a08672d1de4119689f11c4cca665029ce484a | refs/heads/master | 2023-04-13T16:07:31.279254 | 2021-04-29T09:16:20 | 2021-04-29T09:16:20 | 362,751,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 251 | java | package section_4.playing_cat;
public class Main {
public static void main(String[] args) {
PlayingCat playingCat = new PlayingCat();
boolean result = playingCat.isCatPlaying(false,35);
System.out.println(result);
}
}
| [
"[email protected]"
] | |
2ab3997ee22efc3b50a0ae697b79a0aa6fba0d7b | 788f3b947e48e9d92c996510d248a556f8202495 | /gateway/src/main/java/com/tyron/configuration/GatewayRoutesConfiguration.java | b87ebac8d17d6afbe931573b4927366a1edf9bf4 | [] | no_license | tyronczt/spring-cloud-alibaba-learning | 6676ac5df11213bc985250ed1c31f9e2fb04a0b2 | 117a5c29600e9b6858506f4432cec1a1865b7784 | refs/heads/master | 2023-06-01T04:03:07.753145 | 2021-07-01T15:18:47 | 2021-07-01T15:18:47 | 329,313,129 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,499 | java | //package com.tyron.configuration;
//import com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayFlowRule;
//import com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayRuleManager;
//import com.alibaba.csp.sentinel.adapter.gateway.sc.SentinelGatewayFilter;
//import com.alibaba.csp.sentinel.adapter.gateway.sc.callback.BlockRequestHandler;
//import com.alibaba.csp.sentinel.adapter.gateway.sc.callback.GatewayCallbackManager;
//import com.alibaba.csp.sentinel.adapter.gateway.sc.exception.SentinelGatewayBlockExceptionHandler;
//import org.springframework.beans.factory.ObjectProvider;
//import org.springframework.cloud.gateway.filter.GlobalFilter;
//import org.springframework.context.annotation.Bean;
//import org.springframework.core.Ordered;
//import org.springframework.core.annotation.Order;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.MediaType;
//import org.springframework.http.codec.ServerCodecConfigurer;
//import org.springframework.web.reactive.function.BodyInserters;
//import org.springframework.web.reactive.function.server.ServerResponse;
//import org.springframework.web.reactive.result.view.ViewResolver;
//import org.springframework.web.server.ServerWebExchange;
//import reactor.core.publisher.Mono;
//
//import javax.annotation.PostConstruct;
//import java.util.*;
//
////@Configuration
//public class GatewayRoutesConfiguration {
// private final List<ViewResolver> viewResolvers;
// private final ServerCodecConfigurer serverCodecConfigurer;
//
//
// public GatewayRoutesConfiguration(ObjectProvider<List<ViewResolver>> viewResolversProvider,
// ServerCodecConfigurer serverCodecConfigurer) {
// this.viewResolvers = viewResolversProvider.getIfAvailable(Collections::emptyList);
// this.serverCodecConfigurer = serverCodecConfigurer;
// }
//
// //配置限流的异常处理
// @Bean
// @Order(Ordered.HIGHEST_PRECEDENCE)
// public SentinelGatewayBlockExceptionHandler sentinelGatewayBlockExceptionHandler() {
// return new SentinelGatewayBlockExceptionHandler(viewResolvers, serverCodecConfigurer);
// }
//
// //配置初始化的限流参数
// @PostConstruct
// public void initGatewayRules(){
// Set<GatewayFlowRule> rules = new HashSet<>();
// rules.add(
// new GatewayFlowRule("provider_route")
// .setCount(1)
// .setIntervalSec(1)
// );
// GatewayRuleManager.loadRules(rules);
// }
//
// //初始化限流过滤器
// @Bean
// @Order(Ordered.HIGHEST_PRECEDENCE)
// public GlobalFilter sentinelGatewayFilter() {
// return new SentinelGatewayFilter();
// }
//
// //自定义限流异常页面
// @PostConstruct
// public void initBlockHandlers(){
// BlockRequestHandler blockRequestHandler = new BlockRequestHandler() {
// @Override
// public Mono<ServerResponse> handleRequest(ServerWebExchange serverWebExchange, Throwable throwable) {
// Map map = new HashMap();
// map.put("code",0);
// map.put("msg","被限流了");
// return ServerResponse.status(HttpStatus.OK)
// .contentType(MediaType.APPLICATION_JSON)
// .body(BodyInserters.fromObject(map));
// }
// };
// GatewayCallbackManager.setBlockHandler(blockRequestHandler);
// }
//} | [
"[email protected]"
] | |
c9d583bb00bb63c3e7bf60bb76d35d406b2ad010 | 2fe2adf9dc66028de281e62a2e49eea4189ae5c5 | /HomeWorks/Task7/Program.java | 5bfe20776448da6b4bbb80387428e8eee244461c | [] | no_license | MichaelChirkov/JAVA_IT_PARK_WORK | 28ec66d39556275df2ccc6ccee4b8eeb3a52897f | 5e2288a1dfae4bf2ff501c0a9480252472169362 | refs/heads/master | 2021-01-17T08:26:54.036821 | 2017-07-13T23:36:32 | 2017-07-13T23:36:32 | 83,919,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 272 | java | class Program{
public static void main(String[] args) {
int a[] = {4,1,7,3,9,4,2,3,4,7,8,5,4,7};
int m = 0;
for (int i = 1; i < a.length - 2; i++){
if((a[i-1] < a[i]) && (a[i] > a[i+1])){
m++;
}
}
System.out.println("Kol-vo maksimumov = " + m);
}
}
| [
"[email protected]"
] | |
a506a0cbb85e781332d61ce6a9eececab33c75f2 | 7fce9eae0b9b2acf08deeb1fb7feb8ea624b63ab | /app/src/test/java/com/kumar/user/intentservice/ExampleUnitTest.java | 78d129d9767e174ab8838d069d1e2bcdf713d191 | [] | no_license | kumar245/Handlers | fc615dd582c936a6dd7e1836e4d609b4fa980b5a | 854424bc26a965aeb627daf2b204c3bd718c5548 | refs/heads/master | 2021-01-17T17:09:35.580840 | 2017-06-26T20:47:52 | 2017-06-26T20:47:52 | 95,488,177 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.kumar.user.intentservice;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
e270ac15a3acc50c52d148ffc67e9acce4e708b2 | 622f02c92d2a3dba682a7bf527224472e1dd7533 | /src/main/java/cn/test/service/PrescriptionDetailService.java | bc57924e1641b1fe67d1a50d7c858edea3737892 | [] | no_license | w1073378859/school | 58c89b31e8e24bdc9d8fd2b98961c695577ff0bc | 6a3a290cac30611858ae402ee2666c579dea7340 | refs/heads/master | 2023-04-23T07:16:55.086200 | 2021-05-10T02:39:49 | 2021-05-10T02:39:49 | 365,899,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package cn.test.service;
import cn.test.pojo.PrescriptionDetail;
/**
* @Package: impl
* @Description: ${description}
* @Author JC
* @Create 2021年03月19日 16时33分46秒
*/
public interface PrescriptionDetailService{
int deleteByPrimaryKey(Long id);
int insert(PrescriptionDetail record);
int insertSelective(PrescriptionDetail record);
PrescriptionDetail selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(PrescriptionDetail record);
int updateByPrimaryKey(PrescriptionDetail record);
}
| [
"[email protected]"
] | |
7048f6956652961511086b933301f355d474dd4a | 8acc437f73bcc3cdf465ae1be9f62b320bfd082e | /src/main/java/se/lexicon/jpa_workshop/entity/AppUser.java | ae0baf95bd2c3d5962b83a803ba3d4df317b932f | [] | no_license | ashajo/jpa_workshop | e487e2b48887b804c27a3d11b5c2c7b4be41582c | c1534e5e0a88e47fae28defa8360bff9901d2873 | refs/heads/master | 2023-03-29T12:28:01.226587 | 2021-03-05T21:12:44 | 2021-03-05T21:12:44 | 344,807,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,465 | java | package se.lexicon.jpa_workshop.entity;
import javax.persistence.*;
import java.util.Objects;
@Entity
public class AppUser {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(nullable = false,length = 255)
private String firstName;
@Column(nullable = false,length = 255)
private String lastName;
@Column(nullable = false,unique = true)
private String email;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AppUser appUser = (AppUser) o;
return id == appUser.id && Objects.equals(firstName, appUser.firstName) && Objects.equals(lastName, appUser.lastName) && Objects.equals(email, appUser.email);
}
@Override
public int hashCode() {
return Objects.hash(id, firstName, lastName, email);
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"[email protected]"
] | |
b84909ecf8987c32c5fbd42ec190dfbeb2357187 | e3180085f545a4a1910388ca3870833dd6d98bf4 | /src/main/java/com/br/sfb/crcjud/services/VaraService.java | 00349909df7fa6980570dbc0cd902019abd641b1 | [] | no_license | joeypinto/crcjud | 23ff1e66d8102dab127e86a951334d28c33198dc | 02d4217274cdb03b60e0de8a8c9a5daa21cfba06 | refs/heads/main | 2023-04-03T02:26:12.292931 | 2021-04-03T21:49:09 | 2021-04-03T21:49:09 | 349,516,059 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 945 | java | package com.br.sfb.crcjud.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import com.br.sfb.crcjud.entities.Vara;
import com.br.sfb.crcjud.repository.VaraRepository;
@Service
public class VaraService {
@Autowired
private VaraRepository varaRepository;
public Vara save(Vara vara) {
varaRepository.save(vara);
return null;
}
public List<Vara> findByCidade(long cidadeId) {
return varaRepository.findByCidadeId(cidadeId);
}
public Iterable<Vara> findAllPageable(Pageable pageable) {
return varaRepository.findAll(pageable);
}
public Iterable<Vara> findNamePageable(String nome, Pageable pageable) {
return varaRepository.findByNome(nome, pageable);
}
public Vara findId(long id) {
return varaRepository.findById(id).get();
}
}
| [
"[email protected]"
] | |
c871830e84d1e411faac0e94e771ab0472987224 | a6610b2e933b7e20953ad9faaa96e95ac10f016a | /src/Lab3encapsul/AnimalRescue/Dog.java | b7a21abb5321a0c9222f9f69060a23c3c3043bd8 | [] | no_license | Gherghina/Tema1Java | 21921c0a2d7b918aa20347b5176a67df415c5d48 | 0b5378213d4ff5b4941e48c96e8af9a7a8d48e5b | refs/heads/master | 2020-07-27T17:46:00.017831 | 2019-10-30T16:12:33 | 2019-10-30T16:12:33 | 209,176,792 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,555 | java | package Lab3encapsul.AnimalRescue;
public class Dog {
String name = "Labus";
char gender = 'm';
int sanatate = 8;
int foame = 9;
int spirit = 10;
String mancare = "Royal Canin";
String recreere = "mingea";
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public char getGender() {
return gender;
}
public void setGender(char gender) {
this.gender = gender;
}
public int getSanatate() {
return sanatate;
}
public void setSanatate(int sanatate) {
this.sanatate = sanatate;
}
public int getFoame() {
return foame;
}
public void setFoame(int foame) {
this.foame = foame;
}
public int getSpirit() {
return spirit;
}
public void setSpirit(int spirit) {
this.spirit = spirit;
}
public String getMancare() {
return mancare;
}
public void setMancare(String mancare) {
this.mancare = mancare;
}
public String getRecreere() {
return recreere;
}
public void setRecreere(String recreere) {
this.recreere = recreere;
}
String colour = "maro";
String breed = "Corcitura";
float weight = 8.6f;
float age = 10.2f;
public void barking() {
System.out.println("ham ham");
}
public void run() {
System.out.println("Running");
}
public void sleeping() {
System.out.println("zzzZZZZzzzzz");
}
}
| [
"[email protected]"
] | |
3bb66fd0308c08584da957e2a27814fc8dca3123 | 1f3355ecb9a7258dd37163a74d695e4b6cbe87c3 | /Custom_Annotation/src/main/java/org/Custom_Annotation/annotations/BankStatementValidator.java | 1550041aa434f08c88d7260e18c6180961b39f87 | [] | no_license | pmadala/Java_Learning | a5d598d525f97571db51744616fccaa95748401e | 4eb0277580e350d5e4cf679cbbe792fb5fe2949a | refs/heads/master | 2021-05-04T16:40:46.865662 | 2018-02-27T06:58:38 | 2018-02-27T06:58:38 | 120,257,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 985 | java | package org.Custom_Annotation.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.eclipse.jdt.annotation.NonNull;
/**
* Custom annotation for entire class level annotation for Bank Statement class
*
* @author priyambadam
*
*/
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
public @interface BankStatementValidator {
Severity Severity() default Severity.MEDIUM;
@NonNull
String customerName();
@NotNull
@Pattern(regexp = "^[A-Za-z0-9]*$")
String mobileNumber();
@NotNull
@Email
String email();
Class<?> transactions() default Object.class;
@NonNull
@Pattern(regexp = "^[A-Za-z0-9]*$")
String accountNumber();
@NonNull
String address();
}
| [
"[email protected]"
] | |
d14ca1bdc536fe25389467e1f85b0773efa72728 | 491000a62fc08d55316e3da14d73696d3f1a580d | /mysqljdbc/src/org/gjt/mm/mysql/jdbc2/Connection.java | 2b6b3ce269249a8e5e3cadea9e73fdf24cf9c4d0 | [] | no_license | weimingtom/jython_playground | 4271471ea0329aa4d69ede3a9a79372990370243 | 7a9fb459cf586a8b32b28fe8ebd5ae35e194a436 | refs/heads/master | 2020-09-20T07:31:45.236787 | 2016-09-10T06:10:44 | 2016-09-10T06:10:44 | 67,728,808 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 44,412 | java | /*
* MM JDBC Drivers for MySQL
*
* $Id: Connection.java,v 1.3 2002/04/21 03:03:46 mark_matthews Exp $
*
* Copyright (C) 1998 Mark Matthews <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* See the COPYING file located in the top-level-directory of
* the archive of this library for complete text of license.
*
* Some portions:
*
* Copyright (c) 1996 Bradley McLean / Jeffrey Medeiros
* Modifications Copyright (c) 1996/1997 Martin Rode
* Copyright (c) 1997 Peter T Mount
*/
/**
* A Connection represents a session with a specific database. Within the
* context of a Connection, SQL statements are executed and results are
* returned.
*
* <P>A Connection's database is able to provide information describing
* its tables, its supported SQL grammar, its stored procedures, the
* capabilities of this connection, etc. This information is obtained
* with the getMetaData method.
*
* <p><B>Note:</B> MySQL does not support transactions, so all queries
* are committed as they are executed.
*
* @see java.sql.Connection
* @author Mark Matthews <[email protected]>
* @version $Id: Connection.java,v 1.3 2002/04/21 03:03:46 mark_matthews Exp $
*/
package org.gjt.mm.mysql.jdbc2;
import java.io.InputStream;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.*;
import java.sql.Blob;
import java.sql.ResultSet;
import java.util.Calendar;
import java.util.Map;
import java.util.Properties;
public class Connection extends org.gjt.mm.mysql.Connection implements java.sql.Connection
{
/**
* Connect to a MySQL Server.
*
* <p><b>Important Notice</b>
*
* <br>Although this will connect to the database, user code should open
* the connection via the DriverManager.getConnection() methods only.
*
* <br>This should only be called from the org.gjt.mm.mysql.Driver class.
*
* @param Host the hostname of the database server
* @param port the port number the server is listening on
* @param Info a Properties[] list holding the user and password
* @param Database the database to connect to
* @param Url the URL of the connection
* @param D the Driver instantation of the connection
* @return a valid connection profile
* @exception java.sql.SQLException if a database access error occurs
*/
public void connectionInit(String host,
int port,
Properties info,
String database,
String url,
org.gjt.mm.mysql.Driver d)
throws java.sql.SQLException
{
super.connectionInit(host, port, info, database, url, d);
}
public java.sql.CallableStatement prepareCall(String sql) throws java.sql.SQLException
{
if (_useUltraDevWorkAround) {
return new UltraDevWorkAround(prepareStatement(sql));
}
else {
throw new java.sql.SQLException("Callable statments not supported.", "S1C00");
}
}
/**
* A connection's database is able to provide information describing
* its tables, its supported SQL grammar, its stored procedures, the
* capabilities of this connection, etc. This information is made
* available through a DatabaseMetaData object.
*
* @return a DatabaseMetaData object for this connection
* @exception java.sql.SQLException if a database access error occurs
*/
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
{
return new DatabaseMetaData(this, _database);
}
protected org.gjt.mm.mysql.MysqlIO createNewIO(String host, int port) throws Exception
{
return new IO(host, port, this);
}
//--------------------------JDBC 2.0-----------------------------
/**
* JDBC 2.0
*
* Same as createStatement() above, but allows the default result set
* type and result set concurrency type to be overridden.
*
* @param resultSetType a result set type, see ResultSet.TYPE_XXX
* @param resultSetConcurrency a concurrency type, see ResultSet.CONCUR_XXX
* @return a new Statement object
* @exception SQLException if a database-access error occurs.
*/
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency)
throws SQLException
{
Statement stmt = new org.gjt.mm.mysql.jdbc2.Statement(this, _database);
stmt.setResultSetType(resultSetType);
stmt.setResultSetConcurrency(resultSetConcurrency);
return stmt;
}
/**
* SQL statements without parameters are normally executed using
* Statement objects. If the same SQL statement is executed many
* times, it is more efficient to use a PreparedStatement
*
* @return a new Statement object
* @exception java.sql.SQLException passed through from the constructor
*/
public java.sql.Statement createStatement() throws SQLException
{
return createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,
java.sql.ResultSet.CONCUR_READ_ONLY);
}
/**
* A SQL statement with or without IN parameters can be pre-compiled
* and stored in a PreparedStatement object. This object can then
* be used to efficiently execute this statement multiple times.
*
* <p>
* <B>Note:</B> This method is optimized for handling parametric
* SQL statements that benefit from precompilation if the driver
* supports precompilation.
*
* In this case, the statement is not sent to the database until the
* PreparedStatement is executed. This has no direct effect on users;
* however it does affect which method throws
* certain java.sql.SQLExceptions
*
* <p>
* MySQL does not support precompilation of statements, so they
* are handled by the driver.
*
* @param sql a SQL statement that may contain one or more '?' IN
* parameter placeholders
* @return a new PreparedStatement object containing the pre-compiled
* statement.
* @exception java.sql.SQLException if a database access error occurs.
*/
public java.sql.PreparedStatement prepareStatement(String sql)
throws java.sql.SQLException
{
return prepareStatement(sql, java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,
java.sql.ResultSet.CONCUR_READ_ONLY);
}
/**
* JDBC 2.0
*
* Same as prepareStatement() above, but allows the default result set
* type and result set concurrency type to be overridden.
*
* @param resultSetType a result set type, see ResultSet.TYPE_XXX
* @param resultSetConcurrency a concurrency type, see ResultSet.CONCUR_XXX
* @return a new PreparedStatement object containing the
* pre-compiled SQL statement
* @exception SQLException if a database-access error occurs.
*/
public java.sql.PreparedStatement prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
{
//
// FIXME: Create warnings if can't create results of the given
// type or concurrency
//
PreparedStatement pStmt = new org.gjt.mm.mysql.jdbc2.PreparedStatement(this,
sql,
_database);
pStmt.setResultSetType(resultSetType);
pStmt.setResultSetConcurrency(resultSetConcurrency);
return pStmt;
}
/**
* JDBC 2.0
*
* Same as prepareCall() above, but allows the default result set
* type and result set concurrency type to be overridden.
*
* @param resultSetType a result set type, see ResultSet.TYPE_XXX
* @param resultSetConcurrency a concurrency type, see ResultSet.CONCUR_XXX
* @return a new CallableStatement object containing the
* pre-compiled SQL statement
* @exception SQLException if a database-access error occurs.
*/
public java.sql.CallableStatement prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
{
return prepareCall(sql);
}
/**
* JDBC 2.0
*
� * Get the type-map object associated with this connection.
� * By default, the map returned is empty.
�*/
public java.util.Map getTypeMap() throws SQLException
{
throw new NotImplemented();
}
/**
* JDBC 2.0
*
�* Install a type-map object as the default type-map for
�* this connection
�*/
/* public void setTypeMap(java.util.Map<K, V> map) throws SQLException
{
throw new NotImplemented();
}*/
/**
* Wrapper class for UltraDev CallableStatements that
* are really PreparedStatments.
*
* Nice going, macromedia!
*/
class UltraDevWorkAround implements java.sql.CallableStatement {
java.sql.PreparedStatement delegate = null;
UltraDevWorkAround(java.sql.PreparedStatement pstmt) {
delegate = pstmt;
}
public void addBatch() throws java.sql.SQLException {
delegate.addBatch();
}
public void addBatch(java.lang.String p1) throws java.sql.SQLException {
delegate.addBatch(p1);
}
public void cancel() throws java.sql.SQLException {
delegate.cancel();
}
public void clearBatch() throws java.sql.SQLException {
delegate.clearBatch();
}
public void clearParameters() throws java.sql.SQLException {
delegate.clearParameters();
}
public void clearWarnings() throws java.sql.SQLException {
delegate.clearWarnings();
}
public void close() throws java.sql.SQLException {
delegate.close();
}
public boolean execute() throws java.sql.SQLException {
return delegate.execute();
}
public boolean execute(java.lang.String p1) throws java.sql.SQLException {
return delegate.execute(p1);
}
public int[] executeBatch() throws java.sql.SQLException {
return delegate.executeBatch();
}
public java.sql.ResultSet executeQuery() throws java.sql.SQLException {
return delegate.executeQuery();
}
public java.sql.ResultSet executeQuery(java.lang.String p1) throws java.sql.SQLException {
return delegate.executeQuery(p1);
}
public int executeUpdate() throws java.sql.SQLException {
return delegate.executeUpdate();
}
public int executeUpdate(java.lang.String p1) throws java.sql.SQLException {
return delegate.executeUpdate(p1);
}
public java.sql.Array getArray(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.math.BigDecimal getBigDecimal(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.math.BigDecimal getBigDecimal(int p1,int p2) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.Blob getBlob(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public boolean getBoolean(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public byte getByte(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public byte[] getBytes(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.Clob getClob(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.Connection getConnection() throws java.sql.SQLException {
return delegate.getConnection();
}
public java.sql.Date getDate(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.Date getDate(int p1,final java.util.Calendar p2) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public double getDouble(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public int getFetchDirection() throws java.sql.SQLException {
return delegate.getFetchDirection();
}
public int getFetchSize() throws java.sql.SQLException {
return delegate.getFetchSize();
}
public float getFloat(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public int getInt(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public long getLong(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public int getMaxFieldSize() throws java.sql.SQLException {
return delegate.getMaxFieldSize();
}
public int getMaxRows() throws java.sql.SQLException {
return delegate.getMaxRows();
}
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public boolean getMoreResults() throws java.sql.SQLException {
return delegate.getMoreResults();
}
public java.lang.Object getObject(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.lang.Object getObject(int p1,final java.util.Map p2) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public int getQueryTimeout() throws java.sql.SQLException {
return delegate.getQueryTimeout();
}
public java.sql.Ref getRef(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.ResultSet getResultSet() throws java.sql.SQLException {
return delegate.getResultSet();
}
public int getResultSetConcurrency() throws java.sql.SQLException {
return delegate.getResultSetConcurrency();
}
public int getResultSetType() throws java.sql.SQLException {
return delegate.getResultSetType();
}
public short getShort(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.lang.String getString(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.Time getTime(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.Time getTime(int p1,final java.util.Calendar p2) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.Timestamp getTimestamp(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public java.sql.Timestamp getTimestamp(int p1,final java.util.Calendar p2) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public int getUpdateCount() throws java.sql.SQLException {
return delegate.getUpdateCount();
}
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException {
return delegate.getWarnings();
}
public void registerOutParameter(int p1,int p2) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public void registerOutParameter(int p1,int p2,int p3) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public void registerOutParameter(int p1,int p2,java.lang.String p3) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public void setArray(int p1,final java.sql.Array p2) throws java.sql.SQLException {
delegate.setArray(p1, p2);
}
public void setAsciiStream(int p1,final java.io.InputStream p2,int p3) throws java.sql.SQLException {
delegate.setAsciiStream(p1, p2, p3);
}
public void setBigDecimal(int p1,final java.math.BigDecimal p2) throws java.sql.SQLException {
delegate.setBigDecimal(p1, p2);
}
public void setBinaryStream(int p1,final java.io.InputStream p2,int p3) throws java.sql.SQLException {
delegate.setBinaryStream(p1, p2, p3);
}
public void setBlob(int p1,final java.sql.Blob p2) throws java.sql.SQLException {
delegate.setBlob(p1, p2);
}
public void setBoolean(int p1,boolean p2) throws java.sql.SQLException {
delegate.setBoolean(p1, p2);
}
public void setByte(int p1,byte p2) throws java.sql.SQLException {
delegate.setByte(p1, p2);
}
public void setBytes(int p1,byte[] p2) throws java.sql.SQLException {
delegate.setBytes(p1, p2);
}
public void setCharacterStream(int p1,final java.io.Reader p2,int p3) throws java.sql.SQLException {
delegate.setCharacterStream(p1, p2, p3);
}
public void setClob(int p1,final java.sql.Clob p2) throws java.sql.SQLException {
delegate.setClob(p1, p2);
}
public void setCursorName(java.lang.String p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public void setDate(int p1,final java.sql.Date p2) throws java.sql.SQLException {
delegate.setDate(p1, p2);
}
public void setDate(int p1,final java.sql.Date p2,final java.util.Calendar p3) throws java.sql.SQLException {
delegate.setDate(p1, p2, p3);
}
public void setDouble(int p1,double p2) throws java.sql.SQLException {
delegate.setDouble(p1, p2);
}
public void setEscapeProcessing(boolean p1) throws java.sql.SQLException {
delegate.setEscapeProcessing(p1);
}
public void setFetchDirection(int p1) throws java.sql.SQLException {
delegate.setFetchDirection(p1);
}
public void setFetchSize(int p1) throws java.sql.SQLException {
delegate.setFetchSize(p1);
}
public void setFloat(int p1,float p2) throws java.sql.SQLException {
delegate.setFloat(p1, p2);
}
public void setInt(int p1,int p2) throws java.sql.SQLException {
delegate.setInt(p1, p2);
}
public void setLong(int p1,long p2) throws java.sql.SQLException {
delegate.setLong(p1, p2);
}
public void setMaxFieldSize(int p1) throws java.sql.SQLException {
delegate.setMaxFieldSize(p1);
}
public void setMaxRows(int p1) throws java.sql.SQLException {
delegate.setMaxRows(p1);
}
public void setNull(int p1,int p2) throws java.sql.SQLException {
delegate.setNull(p1, p2);
}
public void setNull(int p1,int p2,java.lang.String p3) throws java.sql.SQLException {
delegate.setNull(p1, p2, p3);
}
public void setObject(int p1,final java.lang.Object p2) throws java.sql.SQLException {
delegate.setObject(p1, p2);
}
public void setObject(int p1,final java.lang.Object p2,int p3) throws java.sql.SQLException {
delegate.setObject(p1, p2, p3);
}
public void setObject(int p1,final java.lang.Object p2,int p3,int p4) throws java.sql.SQLException {
delegate.setObject(p1, p2, p3, p4);
}
public void setQueryTimeout(int p1) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public void setRef(int p1,final java.sql.Ref p2) throws java.sql.SQLException {
throw new SQLException("Not supported");
}
public void setShort(int p1,short p2) throws java.sql.SQLException {
delegate.setShort(p1, p2);
}
public void setString(int p1,java.lang.String p2) throws java.sql.SQLException {
delegate.setString(p1, p2);
}
public void setTime(int p1,final java.sql.Time p2) throws java.sql.SQLException {
delegate.setTime(p1, p2);
}
public void setTime(int p1,final java.sql.Time p2,final java.util.Calendar p3) throws java.sql.SQLException {
delegate.setTime(p1, p2, p3);
}
public void setTimestamp(int p1,final java.sql.Timestamp p2) throws java.sql.SQLException {
delegate.setTimestamp(p1, p2);
}
public void setTimestamp(int p1,final java.sql.Timestamp p2,final java.util.Calendar p3) throws java.sql.SQLException {
delegate.setTimestamp(p1, p2, p3);
}
public void setUnicodeStream(int p1,final java.io.InputStream p2,int p3) throws java.sql.SQLException {
delegate.setUnicodeStream(p1, p2, p3);
}
public boolean wasNull() throws java.sql.SQLException {
throw new SQLException("Not supported");
}
@Override
public Array getArray(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public BigDecimal getBigDecimal(String parameterName)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Blob getBlob(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean getBoolean(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public byte getByte(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public byte[] getBytes(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Reader getCharacterStream(int parameterIndex)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Reader getCharacterStream(String parameterName)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Clob getClob(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Date getDate(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Date getDate(String parameterName, Calendar cal)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public double getDouble(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public float getFloat(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getInt(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public long getLong(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public Reader getNCharacterStream(int parameterIndex)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Reader getNCharacterStream(String parameterName)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public NClob getNClob(int parameterIndex) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public NClob getNClob(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getNString(int parameterIndex) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getNString(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Object getObject(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
/*
@Override
public Object getObject(int parameterIndex, Map<String, Class<?>> map)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
*/
@Override
public Object getObject(String parameterName, Map<String, Class<?>> map)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Ref getRef(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public RowId getRowId(int parameterIndex) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public RowId getRowId(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public SQLXML getSQLXML(int parameterIndex) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public SQLXML getSQLXML(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public short getShort(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public String getString(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Time getTime(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Time getTime(String parameterName, Calendar cal)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Timestamp getTimestamp(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Timestamp getTimestamp(String parameterName, Calendar cal)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public URL getURL(int parameterIndex) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public URL getURL(String parameterName) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public void registerOutParameter(String parameterName, int sqlType)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void registerOutParameter(String parameterName, int sqlType,
int scale) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void registerOutParameter(String parameterName, int sqlType,
String typeName) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setAsciiStream(String parameterName, InputStream x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setAsciiStream(String parameterName, InputStream x,
int length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setAsciiStream(String parameterName, InputStream x,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBigDecimal(String parameterName, BigDecimal x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBinaryStream(String parameterName, InputStream x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBinaryStream(String parameterName, InputStream x,
int length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBinaryStream(String parameterName, InputStream x,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBlob(String parameterName, Blob x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBlob(String parameterName, InputStream inputStream)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBlob(String parameterName, InputStream inputStream,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBoolean(String parameterName, boolean x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setByte(String parameterName, byte x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBytes(String parameterName, byte[] x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setCharacterStream(String parameterName, Reader reader)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setCharacterStream(String parameterName, Reader reader,
int length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setCharacterStream(String parameterName, Reader reader,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setClob(String parameterName, Clob x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setClob(String parameterName, Reader reader)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setClob(String parameterName, Reader reader, long length)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setDate(String parameterName, Date x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setDate(String parameterName, Date x, Calendar cal)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setDouble(String parameterName, double x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setFloat(String parameterName, float x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setInt(String parameterName, int x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setLong(String parameterName, long x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNCharacterStream(String parameterName, Reader value)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNCharacterStream(String parameterName, Reader value,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNClob(String parameterName, NClob value)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNClob(String parameterName, Reader reader)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNClob(String parameterName, Reader reader, long length)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNString(String parameterName, String value)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNull(String parameterName, int sqlType)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNull(String parameterName, int sqlType, String typeName)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setObject(String parameterName, Object x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setObject(String parameterName, Object x, int targetSqlType)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setObject(String parameterName, Object x,
int targetSqlType, int scale) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setRowId(String parameterName, RowId x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setSQLXML(String parameterName, SQLXML xmlObject)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setShort(String parameterName, short x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setString(String parameterName, String x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setTime(String parameterName, Time x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setTime(String parameterName, Time x, Calendar cal)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setTimestamp(String parameterName, Timestamp x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setTimestamp(String parameterName, Timestamp x, Calendar cal)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setURL(String parameterName, URL val) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public ParameterMetaData getParameterMetaData() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public void setAsciiStream(int parameterIndex, InputStream x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setAsciiStream(int parameterIndex, InputStream x,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBinaryStream(int parameterIndex, InputStream x)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBinaryStream(int parameterIndex, InputStream x,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBlob(int parameterIndex, InputStream inputStream)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setBlob(int parameterIndex, InputStream inputStream,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setCharacterStream(int parameterIndex, Reader reader)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setCharacterStream(int parameterIndex, Reader reader,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setClob(int parameterIndex, Reader reader)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setClob(int parameterIndex, Reader reader, long length)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNCharacterStream(int parameterIndex, Reader value)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNCharacterStream(int parameterIndex, Reader value,
long length) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNClob(int parameterIndex, NClob value)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNClob(int parameterIndex, Reader reader)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNClob(int parameterIndex, Reader reader, long length)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setNString(int parameterIndex, String value)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setRowId(int parameterIndex, RowId x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setSQLXML(int parameterIndex, SQLXML xmlObject)
throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setURL(int parameterIndex, URL x) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public boolean execute(String sql, int autoGeneratedKeys)
throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean execute(String sql, int[] columnIndexes)
throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean execute(String sql, String[] columnNames)
throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public int executeUpdate(String sql, int autoGeneratedKeys)
throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public int executeUpdate(String sql, int[] columnIndexes)
throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public int executeUpdate(String sql, String[] columnNames)
throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public ResultSet getGeneratedKeys() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean getMoreResults(int current) throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public int getResultSetHoldability() throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean isClosed() throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isPoolable() throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public void setPoolable(boolean poolable) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
// TODO Auto-generated method stub
return null;
}
}
@Override
public Array createArrayOf(String typeName, Object[] elements)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Blob createBlob() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Clob createClob() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public NClob createNClob() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public SQLXML createSQLXML() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Struct createStruct(String typeName, Object[] attributes)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Properties getClientInfo() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getClientInfo(String name) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public int getHoldability() throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean isValid(int timeout) throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public CallableStatement prepareCall(String sql, int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public java.sql.PreparedStatement prepareStatement(String sql,
int autoGeneratedKeys) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public java.sql.PreparedStatement prepareStatement(String sql,
int[] columnIndexes) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public java.sql.PreparedStatement prepareStatement(String sql,
String[] columnNames) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public java.sql.PreparedStatement prepareStatement(String sql,
int resultSetType, int resultSetConcurrency,
int resultSetHoldability) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void rollback(Savepoint savepoint) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void setClientInfo(Properties properties)
throws SQLClientInfoException {
// TODO Auto-generated method stub
}
@Override
public void setClientInfo(String name, String value)
throws SQLClientInfoException {
// TODO Auto-generated method stub
}
@Override
public void setHoldability(int holdability) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public Savepoint setSavepoint() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public Savepoint setSavepoint(String name) throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
// TODO Auto-generated method stub
return null;
}
}
| [
"[email protected]"
] | |
d7a6f3b8dbf7bfbe2a2764f2d0d278f261819dfc | 36ec264c21b26100a23c186889efe1a89fa6b624 | /financeiro/src/br/com/grupoferraz/financeiro/entity/VencimentoCP.java | e3896c17e78c6620d4ad48c8b65e989ca2bf10fc | [] | no_license | MatheusPena/financeiro | 11c394f6df3dd1cb5265f9f566301d04cdc67b84 | c8c63cf1f25f80b9ddc49e4f8b2000e3e2886025 | refs/heads/master | 2020-03-18T04:20:12.751088 | 2018-08-23T13:05:08 | 2018-08-23T13:05:08 | 134,282,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,788 | java | package br.com.grupoferraz.financeiro.entity;
import java.io.Serializable;
import java.util.Date;
import javax.faces.bean.ManagedBean;
@ManagedBean
@SuppressWarnings("serial")
public class VencimentoCP implements Serializable {
private int vencimento_codigo;
private Date vencimento;
private String titulo;
private String valor;
private String desconto;
private String codigoag;
private String nomeag;
private String lancamento;
private String banco;
private String agenciabanco;
private String digagencia;
private String conta;
private String digconta;
private Date agendar;
public VencimentoCP() {
}
public int getVencimento_codigo() {
return vencimento_codigo;
}
public void setVencimento_codigo(int vencimento_codigo) {
this.vencimento_codigo = vencimento_codigo;
}
public Date getVencimento() {
return vencimento;
}
public void setVencimento(Date vencimento) {
this.vencimento = vencimento;
}
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public String getValor() {
return valor;
}
public void setValor(String valor) {
this.valor = valor;
}
public String getDesconto() {
return desconto;
}
public void setDesconto(String desconto) {
this.desconto = desconto;
}
public String getCodigoag() {
return codigoag;
}
public void setCodigoag(String codigoag) {
this.codigoag = codigoag;
}
public String getNomeag() {
return nomeag;
}
public void setNomeag(String nomeag) {
this.nomeag = nomeag;
}
public String getLancamento() {
return lancamento;
}
public void setLancamento(String lancamento) {
this.lancamento = lancamento;
}
public String getBanco() {
return banco;
}
public void setBanco(String banco) {
this.banco = banco;
}
public String getAgenciabanco() {
return agenciabanco;
}
public void setAgenciabanco(String agenciabanco) {
this.agenciabanco = agenciabanco;
}
public String getDigagencia() {
return digagencia;
}
public void setDigagencia(String digagencia) {
this.digagencia = digagencia;
}
public String getConta() {
return conta;
}
public void setConta(String conta) {
this.conta = conta;
}
public String getDigconta() {
return digconta;
}
public Date getAgendar() {
return agendar;
}
public void setAgendar(Date agendar) {
this.agendar = agendar;
}
public void setDigconta(String digconta) {
this.digconta = digconta;
}
} | [
"[email protected]"
] | |
985338021a87149a6540828dbf39dd4cae4fa4e6 | 000e9ddd9b77e93ccb8f1e38c1822951bba84fa9 | /java/classes2/com/xiaomi/channel/commonutils/misc/j.java | 52f8bafb94cdb7f85e7e6a8206c0cedae63acd4b | [
"Apache-2.0"
] | permissive | Paladin1412/house | 2bb7d591990c58bd7e8a9bf933481eb46901b3ed | b9e63db1a4975b614c422fed3b5b33ee57ea23fd | refs/heads/master | 2021-09-17T03:37:48.576781 | 2018-06-27T12:39:38 | 2018-06-27T12:41:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.xiaomi.channel.commonutils.misc;
class j
implements Runnable
{
j(h paramh, h.b paramb) {}
public void run()
{
this.b.a(this.a);
}
}
/* Location: /Users/gaoht/Downloads/zirom/classes2-dex2jar.jar!/com/xiaomi/channel/commonutils/misc/j.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
b6d94c0c871b07703f2ce5cd602d0c040bb3518d | 81719679e3d5945def9b7f3a6f638ee274f5d770 | /aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/transform/JobRunJsonUnmarshaller.java | e3e95d5cc4d27b6536de0fede3f7807bf40d894c | [
"Apache-2.0"
] | permissive | ZeevHayat1/aws-sdk-java | 1e3351f2d3f44608fbd3ff987630b320b98dc55c | bd1a89e53384095bea869a4ea064ef0cf6ed7588 | refs/heads/master | 2022-04-10T14:18:43.276970 | 2020-03-07T12:15:44 | 2020-03-07T12:15:44 | 172,681,373 | 1 | 0 | Apache-2.0 | 2019-02-26T09:36:47 | 2019-02-26T09:36:47 | null | UTF-8 | Java | false | false | 7,102 | java | /*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.glue.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.glue.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* JobRun JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class JobRunJsonUnmarshaller implements Unmarshaller<JobRun, JsonUnmarshallerContext> {
public JobRun unmarshall(JsonUnmarshallerContext context) throws Exception {
JobRun jobRun = new JobRun();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("Id", targetDepth)) {
context.nextToken();
jobRun.setId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("Attempt", targetDepth)) {
context.nextToken();
jobRun.setAttempt(context.getUnmarshaller(Integer.class).unmarshall(context));
}
if (context.testExpression("PreviousRunId", targetDepth)) {
context.nextToken();
jobRun.setPreviousRunId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("TriggerName", targetDepth)) {
context.nextToken();
jobRun.setTriggerName(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("JobName", targetDepth)) {
context.nextToken();
jobRun.setJobName(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("StartedOn", targetDepth)) {
context.nextToken();
jobRun.setStartedOn(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));
}
if (context.testExpression("LastModifiedOn", targetDepth)) {
context.nextToken();
jobRun.setLastModifiedOn(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));
}
if (context.testExpression("CompletedOn", targetDepth)) {
context.nextToken();
jobRun.setCompletedOn(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));
}
if (context.testExpression("JobRunState", targetDepth)) {
context.nextToken();
jobRun.setJobRunState(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("Arguments", targetDepth)) {
context.nextToken();
jobRun.setArguments(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context.getUnmarshaller(String.class))
.unmarshall(context));
}
if (context.testExpression("ErrorMessage", targetDepth)) {
context.nextToken();
jobRun.setErrorMessage(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("PredecessorRuns", targetDepth)) {
context.nextToken();
jobRun.setPredecessorRuns(new ListUnmarshaller<Predecessor>(PredecessorJsonUnmarshaller.getInstance()).unmarshall(context));
}
if (context.testExpression("AllocatedCapacity", targetDepth)) {
context.nextToken();
jobRun.setAllocatedCapacity(context.getUnmarshaller(Integer.class).unmarshall(context));
}
if (context.testExpression("ExecutionTime", targetDepth)) {
context.nextToken();
jobRun.setExecutionTime(context.getUnmarshaller(Integer.class).unmarshall(context));
}
if (context.testExpression("Timeout", targetDepth)) {
context.nextToken();
jobRun.setTimeout(context.getUnmarshaller(Integer.class).unmarshall(context));
}
if (context.testExpression("MaxCapacity", targetDepth)) {
context.nextToken();
jobRun.setMaxCapacity(context.getUnmarshaller(Double.class).unmarshall(context));
}
if (context.testExpression("NotificationProperty", targetDepth)) {
context.nextToken();
jobRun.setNotificationProperty(NotificationPropertyJsonUnmarshaller.getInstance().unmarshall(context));
}
if (context.testExpression("SecurityConfiguration", targetDepth)) {
context.nextToken();
jobRun.setSecurityConfiguration(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("LogGroupName", targetDepth)) {
context.nextToken();
jobRun.setLogGroupName(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return jobRun;
}
private static JobRunJsonUnmarshaller instance;
public static JobRunJsonUnmarshaller getInstance() {
if (instance == null)
instance = new JobRunJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
5f86ad82636232f72d5569f37662288623f29c2e | b42348a9bf9d2c2781a2ce94644687d114295726 | /src/test/java/tobi/ye/redisPractice/springDataRedisDemo/AllTest.java | f56f5e1683125973dd8af358f51fbf2bc261e28d | [] | no_license | lazyguy21/redis-practice | 02ba6ed284c0e14d35f67c28e94952ab1968760a | 20bc1731f2d22e9cdc302862616cec532d225a40 | refs/heads/master | 2021-06-07T20:22:41.583098 | 2016-12-08T09:13:14 | 2016-12-08T09:13:14 | 44,300,597 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 775 | java | package tobi.ye.redisPractice.springDataRedisDemo;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import tobi.ye.redisPractice.redisJavaDemo.JedisPoolSingleton;
/**
* Created by ye on 15-7-30.
*/
public class AllTest {
private static JedisPool jedisPool;
private Jedis jedis;
@BeforeClass
public static void beforeClass() {
jedisPool = JedisPoolSingleton.getInstance();
}
@Before
public void getJedis() {
jedis = jedisPool.getResource();
}
@After
public void returnJedis(){
jedisPool.returnResourceObject(jedis);
}
@Test
public void test1(){
// jedis.
}
}
| [
"636590asd"
] | 636590asd |
767b7ec2a34fb1fa5c96a3cd008e515a7d7c833a | 723b83ff65952170fbbad5d91e02942e7fc6a786 | /src/com/dan/dqms/ajax/GetGroupWithDept.java | 7b2e7df72c52fbed78d2e1790527d2d9ee8164b7 | [] | no_license | iteeAgarwal/scbhdvhsvdm | e58a155935b4d9a91374de5c1d635a42e112900b | 6b3d8d0c2c53b4e2370cb7d618acdc2b62c79918 | refs/heads/master | 2020-03-25T06:44:11.058254 | 2018-08-04T11:02:14 | 2018-08-04T11:02:14 | 143,521,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,673 | java | package com.dan.dqms.ajax;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
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 org.dqms.db.Room;
import org.dqms.db.TokenGroup;
import org.dqms.util.Print;
import com.dan.dqms.returnlist.RoomsList;
import com.dan.dqms.returnlist.TokGroupList;
import com.google.gson.Gson;
@WebServlet("/GetRoomsWithDept")
public class GetGroupWithDept extends HttpServlet {
private static final long serialVersionUID = 1L;
public GetGroupWithDept() {
super();
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
Print.logInfo("GetRoomsWithDept:doPost", null);
response.setContentType("application/json");
response.setContentType("text/html");
try {
String deptID = request.getParameter("deptID");
TokGroupList tokenGroupList = new TokGroupList();
List<TokenGroup> roomsList = null;
if ("".equals(deptID)) {
} else {
roomsList = tokenGroupList.getTOGroupListdeptID(deptID);
}
Gson gson = new Gson();
String jsonList = gson.toJson(roomsList);
String jsonListOfInfo = " {\"alert\":" + jsonList + " }";
response.getWriter().write(jsonListOfInfo);
} catch (Exception e) {
Print.logException("Exception in GetGroupWithDept class" ,e);
}
}
}
| [
"[email protected]"
] | |
357b554d04306dd6c2852467a45b6b35ee125b89 | 74e1462bde5418fa4301b92b98c0e911061cf92b | /Example8.java | e9e38dedf8daae2420df599f6c64a283ca1f5ca3 | [] | no_license | Aphrodite000/123 | 580d13c446495edd3abf8b6f9a6e2dbbea0db463 | 1bb08efda7ed69c7836027d9f93d33415557e576 | refs/heads/master | 2020-05-23T20:53:31.116615 | 2019-08-21T12:33:34 | 2019-08-21T12:33:34 | 186,940,696 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 667 | java | //找出两个整型数,三个整型数或四个整型数中的最大值
public class Example8{
public static void main(String[] args){
int a=25,b=-30,c=12,d=45;
int m;
m=max(a,b);
System.out.println("两个数中的最大值是:"+m);
m=max(a,b,c);
System.out.println("三个数中的最大值是:"+m);
m=max(a,b,c,d);
System.out.println("四个数中的最大值是:"+m);
}
static int max(int a,int b) {
if(a>b) {
return a;
}else
return b;
}
static int max(int a,int b,int c) {
int d=max(a,b);
int e=max(c,d);
return e;
}
static int max(int a,int b,int c,int d) {
int e=max(a,b,c);
int f=max(d,e);
return f;
}
} | [
"[email protected]"
] | |
0b884833c23a99d3a8c066ce031d55ef4866341b | d037e29fc996f0e7b5e87c71a22e78874b3a7939 | /PracticaUnidad6/Ejercicio14.java | 6f52ba9225760e37c6fdf7c4106a7a17fac4b5e4 | [] | no_license | Treen7645/Curso-Jatun-Fundamentos | 50d0cab724a1c4f8f99b8089991e5e5ad45cef6c | e03f272f6012b0adc28057bd568fdb8bf1f8632d | refs/heads/main | 2023-04-30T15:45:32.297584 | 2021-05-21T22:55:22 | 2021-05-21T22:55:22 | 351,653,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 566 | java |
/**
* Write a description of class Ejercicio2 here.
*
* @author Victor Sejas-Treen
* @version 1.0
*/
public class Ejercicio14
{
public String sonOnoSonNovios(int num1,int num2){
String res="No pasa nada";
int r1=0,r2=0;
for(int i=num1/2;i>=1;i--){
if(num1%i==0){
r1=r1+i;
}
}
for(int i=num2/2;i>=1;i--){
if(num2%i==0){
r2=r2+i;
}
}
if(r1-1==num2&&r2-1==num1)
res="Son novios";
return res;
}
}
| [
"[email protected]"
] | |
082f1da3f0e9c3490c29d0327a9d2e2b8b8f6595 | f1a4e131a1301419ec1d361139bc43401fb204a4 | /imgselected/src/main/java/com/daqsoft/imgselected/internal/entity/CaptureStrategy.java | f230f3c349f0b55eac86a5b5ecc1fd1e50187ec2 | [] | no_license | 1976222027/BaseAndroid | a18cd1e094ee25343e7872cd4f84b77bf54af23a | ce13d42828b7e06becdbba37f3e54d6ed7c801e4 | refs/heads/master | 2020-07-08T13:07:29.969732 | 2019-08-21T09:56:17 | 2019-08-21T09:56:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | /*
* Copyright 2017 Zhihu Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.daqsoft.imgselected.internal.entity;
public class CaptureStrategy {
public final boolean isPublic;
public final String authority;
public final String directory;
public CaptureStrategy(boolean isPublic, String authority) {
this(isPublic, authority, null);
}
public CaptureStrategy(boolean isPublic, String authority, String directory) {
this.isPublic = isPublic;
this.authority = authority;
this.directory = directory;
}
}
| [
"[email protected]"
] | |
e828c3730e2c20c0ed35332decafd58641d3f626 | 5ef9ec4cd75cfd255b035139865584e1b0909cf9 | /Microservice/Gateway/src/main/java/ru/digitbreak/gateway/web/rest/errors/EmailNotFoundException.java | 9ce561065b67750b16061bc8edd38156687d6cf0 | [] | no_license | Cantinier/DevArtel | 380a9432a5c4b8529debd191aeaf59047505545d | ff5c3b5a099d9faa169a5dde2ff147d8ed61cfe5 | refs/heads/master | 2022-12-24T08:07:00.097576 | 2019-10-02T16:14:32 | 2019-10-02T16:14:32 | 193,212,024 | 0 | 0 | null | 2022-12-16T04:59:50 | 2019-06-22T08:45:20 | Java | UTF-8 | Java | false | false | 413 | java | package ru.digitbreak.gateway.web.rest.errors;
import org.zalando.problem.AbstractThrowableProblem;
import org.zalando.problem.Status;
public class EmailNotFoundException extends AbstractThrowableProblem {
private static final long serialVersionUID = 1L;
public EmailNotFoundException() {
super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST);
}
}
| [
"[email protected]"
] | |
a3a60d048b79a66ecc3166501fa9fc32f777ba7b | ad14fa171751c84495c4b042fe2e14219c8a41ee | /StringCommandGUI/StringBefehle.java | f1b7c558d7d066991833a875b9ddfc84794fa596 | [] | no_license | kuehnert/ITmitSchmiss-StringCommandGUI | 4e74986295858594cf8c07d9d16ee38fc1438024 | 1cc6307644990a70b62fbb37fdf84208b7bad1a5 | refs/heads/main | 2023-04-22T15:58:07.497766 | 2021-04-28T13:42:56 | 2021-04-28T13:42:56 | 358,566,172 | 2 | 2 | null | 2021-04-28T13:50:29 | 2021-04-16T10:44:45 | Java | UTF-8 | Java | false | false | 1,098 | java | public class StringBefehle {
/**
* Die Methode gibt den String verdoppelt, also zweimal hintereinander zurueck
*/
public static String duplicate(String in) {
// Erzeuge einen leeren Ausgabestring
String out = "";
// Haenge zwei Mal den Eingabestring an
out += in + " " + in;
// Gib den Ausgabestring zurueck
return out;
}
/**
* Kopiere einen Eingabestring Zeichen fuer Zeichen mithilfe einer Schleife
*/
public static String copy(String in) {
// Erzeuge einen leeren Ausgabestring
String out = "";
// Manipuliere den String
// Gib den Ausgabestring zurueck
return out;
}
// Aufgaben
/**
* Geben Sie den Eingabestring Zeichen fuer Zeichen rueckwaerts zurueck
*/
/**
* Schreiben Sie eine analoge Methode, die jedes einzelne Zeichen in einen Grossbuchstaben
* wandelt und aneinander gehaengt zurueckgibt. Tipp: Mit Charcter.toUpperCase(char c) kann man
* ein einzelnes Zeichen in einen Grossbuchstaben verwandeln
*/
}
| [
"[email protected]"
] | |
0fee89e54598b477409cbd577fca2b3625d188d0 | 7dc59dc32051121164e58e78ac2992fa7017f33f | /src/main/java/com/social/config/ApplicationSecurity.java | b2af8e19ee2159830471585faa0b67fefa817aad | [] | no_license | Iwk0/SpringBootProject | 02904b29113990cd423d34954786125d07fb8083 | a2825376f36644f240813ebe6c057ee8f4b38e2f | refs/heads/master | 2021-01-17T17:27:03.867984 | 2018-03-21T10:52:49 | 2018-03-21T10:53:03 | 57,973,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,170 | java | package com.social.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import javax.sql.DataSource;
@Configuration
@EnableWebSecurity
public class ApplicationSecurity extends WebSecurityConfigurerAdapter {
@Autowired
private DataSource dataSource;
@Autowired
public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication()
.dataSource(dataSource)
.passwordEncoder(new ShaPasswordEncoder(256))
.usersByUsernameQuery(
"SELECT email AS username, password, TRUE FROM person WHERE email = ? AND status = 'ACTIVE'")
.authoritiesByUsernameQuery(
"SELECT email AS username, role AS authorities FROM person WHERE email = ? AND status = 'ACTIVE'");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/login*", "/registration", "/static/css/**")
.permitAll()
.anyRequest()
.authenticated()
.and()
.formLogin()
.usernameParameter("email")
.loginPage("/login")
.defaultSuccessUrl("/")
.failureUrl("/login?error=1")
.and()
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout", "GET"))
.logoutSuccessUrl("/login");
}
} | [
"[email protected]"
] | |
f328f6313beb6fce7298651c4388128766805c57 | fdfa21331039578b3127c073cd2b62f5c69ed74e | /AbstractClasses/src/com/company/Bird.java | c23b575725ce58cfcd43565e97f298002bc5e21e | [] | no_license | chiranjivi9/AllAboutJava | 9c69b249c41664b6402563fcc0965b22e70324fb | 7aeb25d52db06cbaa30efb67f12f7543211c7752 | refs/heads/master | 2020-04-20T09:59:57.431401 | 2019-02-15T00:56:44 | 2019-02-15T00:56:44 | 168,779,147 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package com.company;
public abstract class Bird extends Animal implements CanFly {
public Bird(String name){
super(name);
}
@Override
public void eat(){
System.out.println(getName() + " is eating...");
}
@Override
public void breathe(){
System.out.println("Breathe in, breathe out, repeat.");
}
@Override
public void Canfly() {
System.out.println(getName() + " is flapping its wings!!!");
}
}
| [
"[email protected]"
] | |
bfbd4a35e32a2b9bfbdc08e2b82364fedef89d75 | 8a6453cd49949798c11f57462d3f64a1fa2fc441 | /aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/BackupType.java | 37734793a39a9ea7a04bb8b4d4cf33d9ae2014d1 | [
"Apache-2.0"
] | permissive | tedyu/aws-sdk-java | 138837a2be45ecb73c14c0d1b5b021e7470520e1 | c97c472fd66d7fc8982cb4cf3c4ae78de590cfe8 | refs/heads/master | 2020-04-14T14:17:28.985045 | 2019-01-02T21:46:53 | 2019-01-02T21:46:53 | 163,892,339 | 0 | 0 | Apache-2.0 | 2019-01-02T21:38:39 | 2019-01-02T21:38:39 | null | UTF-8 | Java | false | false | 1,748 | java | /*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.dynamodbv2.model;
import javax.annotation.Generated;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum BackupType {
USER("USER"),
SYSTEM("SYSTEM");
private String value;
private BackupType(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
/**
* Use this in place of valueOf.
*
* @param value
* real value
* @return BackupType corresponding to the value
*
* @throws IllegalArgumentException
* If the specified value does not map to one of the known values in this enum.
*/
public static BackupType fromValue(String value) {
if (value == null || "".equals(value)) {
throw new IllegalArgumentException("Value cannot be null or empty!");
}
for (BackupType enumEntry : BackupType.values()) {
if (enumEntry.toString().equals(value)) {
return enumEntry;
}
}
throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
}
}
| [
""
] | |
418ff0b6eaf6d49f7c9b1e17352d34cfe7148504 | f16070a9c35d065e2b004eea5c4ad0e09d5a9c74 | /drools-6.0.x/drools-reteoo/src/main/java/org/drools/reteoo/nodes/ReteNotNode.java | 8165ff1816ca689eea4872ea1d68531e152cb7b3 | [
"Apache-2.0"
] | permissive | NoorAshrafi/jpbm668 | c797710b9c011e17c748ca91e6c8fa1e908e3889 | 7dbaeb8df4fb926da354dca75db7bffec8fd9810 | refs/heads/master | 2021-05-31T15:14:53.790959 | 2016-05-23T14:35:36 | 2016-05-23T14:35:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,164 | java | package org.drools.reteoo.nodes;
import org.drools.core.base.DroolsQuery;
import org.drools.core.common.BetaConstraints;
import org.drools.core.common.InternalFactHandle;
import org.drools.core.common.InternalWorkingMemory;
import org.drools.core.reteoo.BetaMemory;
import org.drools.core.reteoo.LeftTuple;
import org.drools.core.reteoo.LeftTupleMemory;
import org.drools.core.reteoo.LeftTupleSink;
import org.drools.core.reteoo.LeftTupleSource;
import org.drools.core.reteoo.LeftTupleSourceUtils;
import org.drools.core.reteoo.ModifyPreviousTuples;
import org.drools.core.reteoo.NodeSet;
import org.drools.core.reteoo.NotNode;
import org.drools.core.reteoo.ObjectSource;
import org.drools.core.reteoo.ReteooBuilder;
import org.drools.core.reteoo.RightTuple;
import org.drools.core.reteoo.RightTupleMemory;
import org.drools.core.reteoo.RuleRemovalContext;
import org.drools.core.reteoo.builder.BuildContext;
import org.drools.core.rule.ContextEntry;
import org.drools.core.spi.PropagationContext;
import org.drools.core.util.FastIterator;
import org.drools.core.util.Iterator;
import org.drools.core.util.index.RightTupleList;
public class ReteNotNode extends NotNode {
public ReteNotNode() {
}
public ReteNotNode(final int id,
final LeftTupleSource leftInput,
final ObjectSource rightInput,
final BetaConstraints joinNodeBinder,
final BuildContext context) {
super( id,
leftInput,
rightInput,
joinNodeBinder,
context );
}
public void attach(BuildContext context) {
ReteBetaNodeUtils.attach(this, context);
}
public void doRemove(RuleRemovalContext context, ReteooBuilder builder, InternalWorkingMemory[] workingMemories) {
ReteBetaNodeUtils.doRemove(this, context, builder, workingMemories);
}
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory) {
ReteBetaNodeUtils.modifyObject(this, factHandle, modifyPreviousTuples, context, workingMemory);
}
public void modifyLeftTuple(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory) {
LeftTupleSourceUtils.doModifyLeftTuple(factHandle, modifyPreviousTuples, context, workingMemory,
(LeftTupleSink) this, getLeftInputOtnId(), getLeftInferredMask());
}
public void assertLeftTuple(final LeftTuple leftTuple,
final PropagationContext context,
final InternalWorkingMemory workingMemory) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
RightTupleMemory rightMemory = memory.getRightTupleMemory();
ContextEntry[] contextEntry = memory.getContext();
boolean useLeftMemory = true;
if ( !this.tupleMemoryEnabled ) {
// This is a hack, to not add closed DroolsQuery objects
Object object = ((InternalFactHandle) leftTuple.get( 0 )).getObject();
if ( !(object instanceof DroolsQuery) || !((DroolsQuery) object).isOpen() ) {
useLeftMemory = false;
}
}
this.constraints.updateFromTuple( contextEntry,
workingMemory,
leftTuple );
FastIterator it = getRightIterator(rightMemory);
for ( RightTuple rightTuple = getFirstRightTuple(leftTuple, rightMemory, (InternalFactHandle) context.getFactHandle(), it); rightTuple != null; rightTuple = (RightTuple) it.next(rightTuple)) {
if ( this.constraints.isAllowedCachedLeft( contextEntry,
rightTuple.getFactHandle() ) ) {
leftTuple.setBlocker( rightTuple );
if ( useLeftMemory ) {
rightTuple.addBlocked( leftTuple );
}
break;
}
}
this.constraints.resetTuple(contextEntry);
if ( leftTuple.getBlocker() == null ) {
// tuple is not blocked, so add to memory so other fact handles can attempt to match
if ( useLeftMemory ) {
memory.getLeftTupleMemory().add( leftTuple );
}
this.sink.propagateAssertLeftTuple( leftTuple,
context,
workingMemory,
useLeftMemory );
}
}
public void assertObject( final InternalFactHandle factHandle,
final PropagationContext pctx,
final InternalWorkingMemory wm ) {
RightTuple rightTuple = createRightTuple( factHandle,
this,
pctx);
rightTuple.setPropagationContext(pctx);
// NotNodes must always propagate, they never get staged.
assertRightTuple(rightTuple, pctx, wm );
}
public void assertRightTuple( final RightTuple rightTuple,
final PropagationContext context,
final InternalWorkingMemory workingMemory ) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
memory.getRightTupleMemory().add( rightTuple );
if ( memory.getLeftTupleMemory() == null || memory.getLeftTupleMemory().size() == 0 ) {
// do nothing here, as no left memory
return;
}
this.constraints.updateFromFactHandle( memory.getContext(),
workingMemory,
rightTuple.getFactHandle() );
LeftTupleMemory leftMemory = memory.getLeftTupleMemory();
FastIterator it = getLeftIterator( leftMemory );
for (LeftTuple leftTuple = getFirstLeftTuple( rightTuple, leftMemory, context, it ); leftTuple != null; ) {
// preserve next now, in case we remove this leftTuple
LeftTuple temp = (LeftTuple) it.next(leftTuple);
// we know that only unblocked LeftTuples are still in the memory
if ( this.constraints.isAllowedCachedRight( memory.getContext(),
leftTuple ) ) {
leftTuple.setBlocker( rightTuple );
rightTuple.addBlocked( leftTuple );
// this is now blocked so remove from memory
memory.getLeftTupleMemory().remove( leftTuple );
// subclasses like ForallNotNode might override this propagation
propagateRetractLeftTuple( context,
workingMemory,
leftTuple );
}
leftTuple = temp;
}
this.constraints.resetFactHandle(memory.getContext());
}
public void retractRightTuple(final RightTuple rightTuple,
final PropagationContext context,
final InternalWorkingMemory workingMemory) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
rightTuple.setPropagationContext( context );
RightTupleMemory rtm = memory.getRightTupleMemory();
if ( rightTuple.getBlocked() != null ) {
updateLeftTupleToNewBlocker(rightTuple, context, workingMemory, memory, memory.getLeftTupleMemory(), rightTuple.getBlocked(), rtm, false);
rightTuple.nullBlocked();
} else {
// it's also removed in the updateLeftTupleToNewBlocker
rtm.remove(rightTuple);
}
this.constraints.resetTuple( memory.getContext() );
}
public void retractLeftTuple(final LeftTuple leftTuple,
final PropagationContext context,
final InternalWorkingMemory workingMemory) {
RightTuple blocker = leftTuple.getBlocker();
if ( blocker == null ) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
memory.getLeftTupleMemory().remove( leftTuple );
this.sink.propagateRetractLeftTuple( leftTuple,
context,
workingMemory );
} else {
blocker.removeBlocked( leftTuple );
}
}
public void modifyLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
RightTupleMemory rightMemory = memory.getRightTupleMemory();
FastIterator rightIt = getRightIterator( rightMemory );
RightTuple firstRightTuple = getFirstRightTuple(leftTuple, rightMemory, (InternalFactHandle) context.getFactHandle(), rightIt);
// If in memory, remove it, because we'll need to add it anyway if it's not blocked, to ensure iteration order
RightTuple blocker = leftTuple.getBlocker();
if ( blocker == null ) {
memory.getLeftTupleMemory().remove( leftTuple );
} else {
// check if we changed bucket
if ( rightMemory.isIndexed() && !rightIt.isFullIterator() ) {
// if newRightTuple is null, we assume there was a bucket change and that bucket is empty
if ( firstRightTuple == null || firstRightTuple.getMemory() != blocker.getMemory() ) {
// we changed bucket, so blocker no longer blocks
blocker.removeBlocked( leftTuple );
blocker = null;
}
}
}
this.constraints.updateFromTuple( memory.getContext(),
workingMemory,
leftTuple );
if ( blocker != null && !isLeftUpdateOptimizationAllowed() ) {
blocker.removeBlocked(leftTuple);
blocker = null;
}
// if we where not blocked before (or changed buckets), or the previous blocker no longer blocks, then find the next blocker
if ( blocker == null || !this.constraints.isAllowedCachedLeft( memory.getContext(),
blocker.getFactHandle() ) ) {
if ( blocker != null ) {
// remove previous blocker if it exists, as we know it doesn't block any more
blocker.removeBlocked( leftTuple );
}
// find first blocker, because it's a modify, we need to start from the beginning again
for ( RightTuple newBlocker = firstRightTuple; newBlocker != null; newBlocker = (RightTuple) rightIt.next(newBlocker) ) {
if ( this.constraints.isAllowedCachedLeft( memory.getContext(),
newBlocker.getFactHandle() ) ) {
leftTuple.setBlocker( newBlocker );
newBlocker.addBlocked( leftTuple );
break;
}
}
if ( leftTuple.getBlocker() != null ) {
// blocked
if ( leftTuple.getFirstChild() != null ) {
// blocked, with previous children, so must have not been previously blocked, so retract
// no need to remove, as we removed at the start
// to be matched against, as it's now blocked
propagateRetractLeftTuple( context,
workingMemory,
leftTuple );
} // else: it's blocked now and no children so blocked before, thus do nothing
} else if ( leftTuple.getFirstChild() == null ) {
// not blocked, with no children, must have been previously blocked so assert
memory.getLeftTupleMemory().add( leftTuple ); // add to memory so other fact handles can attempt to match
propagateAssertLeftTuple( context,
workingMemory,
leftTuple );
} else {
// not blocked, with children, so wasn't previous blocked and still isn't so modify
memory.getLeftTupleMemory().add( leftTuple ); // add to memory so other fact handles can attempt to match
propagateModifyChildLeftTuple( context,
workingMemory,
leftTuple );
}
}
this.constraints.resetTuple( memory.getContext() );
}
public void modifyRightTuple(RightTuple rightTuple,
PropagationContext context,
InternalWorkingMemory workingMemory) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
if ( memory.getLeftTupleMemory() == null || ( memory.getLeftTupleMemory().size() == 0 && rightTuple.getBlocked() == null ) ) {
// do nothing here, as we know there are no left tuples
//normally do this at the end, but as we are exiting early, make sure the buckets are still correct.
memory.getRightTupleMemory().removeAdd( rightTuple );
return;
}
// TODO: wtd with behaviours?
// if ( !behavior.assertRightTuple( memory.getBehaviorContext(),
// rightTuple,
// workingMemory ) ) {
// // destroy right tuple
// rightTuple.unlinkFromRightParent();
// return;
// }
this.constraints.updateFromFactHandle( memory.getContext(),
workingMemory,
rightTuple.getFactHandle() );
LeftTupleMemory leftMemory = memory.getLeftTupleMemory();
FastIterator leftIt = getLeftIterator( leftMemory );
LeftTuple firstLeftTuple = getFirstLeftTuple( rightTuple, leftMemory, context, leftIt );
LeftTuple firstBlocked = rightTuple.getBlocked();
// we now have reference to the first Blocked, so null it in the rightTuple itself, so we can rebuild
rightTuple.nullBlocked();
// first process non-blocked tuples, as we know only those ones are in the left memory.
for ( LeftTuple leftTuple = firstLeftTuple; leftTuple != null; ) {
// preserve next now, in case we remove this leftTuple
LeftTuple temp = (LeftTuple) leftIt.next(leftTuple);
// we know that only unblocked LeftTuples are still in the memory
if ( this.constraints.isAllowedCachedRight( memory.getContext(),
leftTuple ) ) {
leftTuple.setBlocker( rightTuple );
rightTuple.addBlocked( leftTuple );
// this is now blocked so remove from memory
leftMemory.remove( leftTuple );
// subclasses like ForallNotNode might override this propagation
propagateRetractLeftTuple( context,
workingMemory,
leftTuple );
}
leftTuple = temp;
}
RightTupleMemory rightTupleMemory = memory.getRightTupleMemory();
if ( firstBlocked != null ) {
updateLeftTupleToNewBlocker(rightTuple, context, workingMemory, memory, leftMemory, firstBlocked, rightTupleMemory, true);
} else {
// we had to do this at the end, rather than beginning as this 'if' block needs the next memory tuple
rightTupleMemory.removeAdd( rightTuple );
}
this.constraints.resetFactHandle( memory.getContext() );
this.constraints.resetTuple( memory.getContext() );
}
private void updateLeftTupleToNewBlocker(RightTuple rightTuple, PropagationContext context, InternalWorkingMemory workingMemory, BetaMemory memory, LeftTupleMemory leftMemory, LeftTuple firstBlocked, RightTupleMemory rightTupleMemory, boolean removeAdd) {// will attempt to resume from the last blocker, if it's not a comparison or unification index.
boolean resumeFromCurrent = !(indexedUnificationJoin || rightTupleMemory.getIndexType().isComparison());
FastIterator rightIt = null;
RightTuple rootBlocker = null;
if ( resumeFromCurrent ) {
RightTupleList currentRtm = rightTuple.getMemory();
rightIt = currentRtm.fastIterator(); // only needs to iterate the current bucket, works for equality indexed and non indexed.
rootBlocker = (RightTuple) rightTuple.getNext();
if ( removeAdd ) {
// we must do this after we have the next in memory
// We add to the end to give an opportunity to re-match if in same bucket
rightTupleMemory.removeAdd( rightTuple );
} else {
rightTupleMemory.remove( rightTuple );
}
if ( rootBlocker == null && rightTuple.getMemory() == currentRtm) {
// there was no next root blocker, but the current was re-added to same list, so set for re-match attempt.
rootBlocker = rightTuple;
}
} else {
rightIt = getRightIterator( rightTupleMemory );
if ( removeAdd ) {
rightTupleMemory.removeAdd( rightTuple );
} else {
rightTupleMemory.remove( rightTuple );
}
}
// iterate all the existing previous blocked LeftTuples
for ( LeftTuple leftTuple = (LeftTuple) firstBlocked; leftTuple != null; ) {
LeftTuple temp = leftTuple.getBlockedNext();
leftTuple.clearBlocker();
this.constraints.updateFromTuple( memory.getContext(),
workingMemory,
leftTuple );
if (!resumeFromCurrent) {
rootBlocker = getFirstRightTuple( leftTuple, rightTupleMemory, (InternalFactHandle) context.getFactHandle(), rightIt );
}
// we know that older tuples have been checked so continue next
for ( RightTuple newBlocker = rootBlocker; newBlocker != null; newBlocker = (RightTuple) rightIt.next( newBlocker ) ) {
if ( this.constraints.isAllowedCachedLeft( memory.getContext(),
newBlocker.getFactHandle() ) ) {
leftTuple.setBlocker( newBlocker );
newBlocker.addBlocked( leftTuple );
break;
}
}
if ( leftTuple.getBlocker() == null ) {
// was previous blocked and not in memory, so add
leftMemory.add( leftTuple );
// subclasses like ForallNotNode might override this propagation
propagateAssertLeftTuple( context,
workingMemory,
leftTuple );
}
leftTuple = temp;
}
}
protected void propagateAssertLeftTuple(final PropagationContext context,
final InternalWorkingMemory workingMemory,
LeftTuple leftTuple) {
this.sink.propagateAssertLeftTuple(leftTuple,
context,
workingMemory,
true);
}
protected void propagateRetractLeftTuple(final PropagationContext context,
final InternalWorkingMemory workingMemory,
LeftTuple leftTuple) {
this.sink.propagateRetractLeftTuple(leftTuple,
context,
workingMemory);
}
protected void propagateModifyChildLeftTuple(final PropagationContext context,
final InternalWorkingMemory workingMemory,
LeftTuple leftTuple) {
this.sink.propagateModifyChildLeftTuple( leftTuple,
context,
workingMemory,
true );
}
public void updateSink(final LeftTupleSink sink,
final PropagationContext context,
final InternalWorkingMemory workingMemory) {
final BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( this );
final Iterator tupleIter = memory.getLeftTupleMemory().iterator();
for ( LeftTuple leftTuple = (LeftTuple) tupleIter.next(); leftTuple != null; leftTuple = (LeftTuple) tupleIter.next() ) {
sink.assertLeftTuple( sink.createLeftTuple( leftTuple,
sink,
context, true),
context,
workingMemory );
}
}
}
| [
"[email protected]"
] | |
9b3cf8fd2489e9f4ba8fda23475e2e7169bd3ac0 | 7858f7c3a119d58621f324acd61cd76714d3340b | /src/Laborator2/Book.java | 216ebfcdd97604a42f782eaed600bfb829bb4d43 | [] | no_license | domocoscatalin/Design_Pattern | 9977591c999eb14fc62807481e7babce74078857 | 1a9adc016e264b525d171affc90f36ad64be4a27 | refs/heads/master | 2023-03-08T15:24:30.919036 | 2021-02-19T12:20:40 | 2021-02-19T12:20:40 | 301,667,546 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 796 | java | package Laborator2;
import java.util.ArrayList;
public class Book extends Element{
private String title;
private ArrayList<Author> authors = new ArrayList<Author>();
private TableOfContents tableOfContents;
private ArrayList<Chapter> chapters = new ArrayList<Chapter>();
public void print()
{
}
public Book(String title) {
this.title = title;
}
public void addAuthor(Author author)
{
this.authors.add(author);
}
public int createChapter(String chapterName)
{
Chapter createdChapter = new Chapter(chapterName);
this.chapters.add(createdChapter);
return this.chapters.indexOf(createdChapter);
}
public Chapter getChapter(int index)
{
return this.chapters.get(index);
}
} | [
"[email protected]"
] | |
494ce10e081439d89e331327e0c088487a56d402 | 8b0eae1e36d33e34926051ef6e82d84af82e061b | /src/mytest/Login.java | 7772241d0256a31aa1d566543db736d56e5e05e8 | [] | no_license | Gabintree/2019JSP | 14d9cc0b0a3195997667d1d2b831b678bede94f7 | 6fa46e5dde96e17406fd72acb7284179dca451e0 | refs/heads/master | 2020-05-23T21:21:48.732278 | 2019-05-30T07:37:40 | 2019-05-30T07:37:40 | 186,952,745 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,235 | java | package mytest;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/Login")
public class Login extends HttpServlet {
private static final long serialVersionUID = 1L;
public Login() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
String id = request.getParameter("id");
String password = request.getParameter("password");
if(id.equals("admin")) {
if(password.equals("1234")) {
out.println("<h3>로그인을 환영합니다.</h3>");
}else {
out.println("<script>alert('아이디나 비밀번호가 일치하지 않습니다.');history.back();</script>");
}
}
}
}
| [
"[email protected]"
] | |
e2d015cc233fa495816dda83f8493d7b2985c387 | 6582ee8ae6ba3698f5a54fe3b2e0cbe4b37ff1c6 | /app/src/androidTest/java/com/example/ravi/testingmap/ExampleInstrumentedTest.java | 5638cbe530646345828a58babc73cafc16a87a33 | [] | no_license | John0545/Navigator | 6fc6ea39d0226400f6246108e0115c8c0a75697a | ce3bf57bfa9ea55fb4ce2817a1994685f03a221e | refs/heads/master | 2020-03-28T08:11:20.047440 | 2018-09-08T16:27:17 | 2018-09-08T16:27:17 | 147,950,359 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 738 | java | package com.example.ravi.testingmap;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.ravi.testingmap", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
50ae9c262b2f311b4e3874a21a5260b2b9d70f86 | 573a66e4f4753cc0f145de8d60340b4dd6206607 | /JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/362855/quickfix-1.7.0/quickfix-1.7.0/src/java/src/quickfix/field/RFQReqID.java | 9661401d575023210da9cfbcfea251f0542ca8cb | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | mkaouer/Code-Smells-Detection-in-JavaScript | 3919ec0d445637a7f7c5f570c724082d42248e1b | 7130351703e19347884f95ce6d6ab1fb4f5cfbff | refs/heads/master | 2023-03-09T18:04:26.971934 | 2022-03-23T22:04:28 | 2022-03-23T22:04:28 | 73,915,037 | 8 | 3 | null | 2023-02-28T23:00:07 | 2016-11-16T11:47:44 | null | UTF-8 | Java | false | false | 281 | java | package quickfix.field;
import quickfix.StringField;
import java.util.Date;
public class RFQReqID extends StringField
{
public static final int FIELD = 644;
public RFQReqID()
{
super(644);
}
public RFQReqID(String data)
{
super(644, data);
}
}
| [
"[email protected]"
] | |
95d6ba249906bfa1501d789509929c746f9ba4a4 | 35415d9199e073b5be574f6f1c1755445ed3f056 | /src/main/java/com/etc/entity/User.java | 0e8229fc5dfe6292e06eb07935c406f3495070c6 | [] | no_license | zeitlmz/Fairy | 6b4fd98c6651d3b0449338b6f0a5c2d7ea33b0fc | 22e81b822a54b84e7937f2e3215a1a425c85c097 | refs/heads/master | 2022-12-21T15:20:17.443953 | 2020-03-27T03:00:12 | 2020-03-27T03:00:12 | 254,313,930 | 0 | 0 | null | 2022-12-15T23:47:46 | 2020-04-09T08:26:43 | HTML | UTF-8 | Java | false | false | 2,631 | java | package com.etc.entity;
import java.io.Serializable;
/**
* (User)实体类
*
* @author makejava
* @since 2020-03-14 09:08:16
*/
public class User implements Serializable {
private static final long serialVersionUID = 468511237039124245L;
/**
* 用户id
*/
private Integer uid;
/**
* 用户名
*/
private String username;
/**
* 密码
*/
private String password;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String phonenumber;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idnumber;
/**
* 邮箱
*/
private String email;
/**
* 注册时间
*/
private Object joindate;
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getIdnumber() {
return idnumber;
}
public void setIdnumber(String idnumber) {
this.idnumber = idnumber;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Object getJoindate() {
return joindate;
}
public void setJoindate(Object joindate) {
this.joindate = joindate;
}
@Override
public String toString() {
return "User{" +
"uid=" + uid +
", username='" + username + '\'' +
", password='" + password + '\'' +
", name='" + name + '\'' +
", phonenumber='" + phonenumber + '\'' +
", gender='" + gender + '\'' +
", idnumber='" + idnumber + '\'' +
", email='" + email + '\'' +
", joindate=" + joindate +
'}';
}
} | [
"[email protected]"
] | |
1dbe00d694f784c0b2476544028237ea88bf0694 | 760431162a8eb98a8bf4c7ba657a7278a389bc4c | /goods/src/main/java/com/ericshenn/goods/bean/CommentInfo.java | 1604824ef888db1daeb30dd20ee9162290ab112e | [] | no_license | EricQianTW/Android-Component_development | 17aba6c9f6aa53f9c286f54f930dc6dc568123cc | 22957418c6e263706341cecb63aea3e4a98ea5ba | refs/heads/master | 2020-03-30T19:22:27.886413 | 2018-10-04T08:18:26 | 2018-10-04T08:18:26 | 151,539,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,956 | java | package com.ericshenn.goods.bean;
import com.google.gson.annotations.Expose;
import java.util.List;
/**
* Created by pnt_t on 2018/2/9.
*/
public class CommentInfo {
@Expose
private String userName;
@Expose
private String userHeader;
@Expose
private String userRating;
@Expose
private String commentValue;
@Expose
private String goodsAttr;
@Expose
private String evaluateDate;
@Expose
private String buyDate;
@Expose
private List<String> commnetPic;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserHeader() {
return userHeader;
}
public void setUserHeader(String userHeader) {
this.userHeader = userHeader;
}
public String getUserRating() {
return userRating;
}
public void setUserRating(String userRating) {
this.userRating = userRating;
}
public String getCommentValue() {
return commentValue;
}
public void setCommentValue(String commentValue) {
this.commentValue = commentValue;
}
public String getGoodsAttr() {
return goodsAttr;
}
public void setGoodsAttr(String goodsAttr) {
this.goodsAttr = goodsAttr;
}
public List<String> getCommnetPic() {
return commnetPic;
}
public void setCommnetPic(List<String> commnetPic) {
this.commnetPic = commnetPic;
}
public String getEvaluateDate() {
return evaluateDate;
}
public void setEvaluateDate(String evaluateDate) {
this.evaluateDate = evaluateDate;
}
public String getBuyDate() {
return buyDate;
}
public void setBuyDate(String buyDate) {
this.buyDate = buyDate;
}
public CommentInfo(String userName, String userHeader, String userRating, String commentValue, String goodsAttr, List<String> commnetPic) {
this.userName = userName;
this.userHeader = userHeader;
this.userRating = userRating;
this.commentValue = commentValue;
this.goodsAttr = goodsAttr;
this.commnetPic = commnetPic;
}
public CommentInfo(String userName, String userHeader, String commentValue, String goodsAttr,String evaluateDate) {
this.userName = userName;
this.userHeader = userHeader;
this.commentValue = commentValue;
this.goodsAttr = goodsAttr;
this.evaluateDate = evaluateDate;
}
public CommentInfo(String userName, String userHeader, String commentValue, String goodsAttr,String evaluateDate,String buyDate) {
this.userName = userName;
this.userHeader = userHeader;
this.commentValue = commentValue;
this.goodsAttr = goodsAttr;
this.evaluateDate = evaluateDate;
this.buyDate = buyDate;
}
public CommentInfo() {
}
}
| [
"[email protected]"
] | |
3c35b3c74e521e343b5ff3fd527327e340488a29 | fd88eada4d93d943178dd95d522d6e11779d8435 | /app/src/main/java/com/tokeninc/altay/utilities/CurrencyUtility.java | caeb9d6f16b1d543568cfeba18e4d317e131632c | [] | no_license | okanbasar/osy-qr-payment | f67bc631a32db7d0da242d109e3b690ad5c89a75 | 23741555d9c87e5e58415fe6cc63e47388fdeecc | refs/heads/master | 2020-05-15T18:12:56.659031 | 2019-05-10T11:39:55 | 2019-05-10T11:39:55 | 182,420,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package com.tokeninc.altay.utilities;
/**
* Created by Okan Engin Başar on 10.05.2019.
*/
public class CurrencyUtility {
public static String getCurrencyCode(int iso4217) {
switch(iso4217) {
case 978:
return "EUR";
case 840:
return "USD";
case 949:
return "TRY";
default:
return "###";
}
}
}
| [
"[email protected]"
] | |
f81273dd38f022f9c53efa01211d24fbc7c06eb4 | 2c840aa048cfed2854a92f273f5dc25018bf0a6a | /app/src/main/java/com/lib/utils/calendar/utils/ArticleAdapter.java | 29914b0bf35119e24903389c86a9d7efb18e3ef3 | [] | no_license | JustAlva/MyTestDemo | be1c91a520c93f571a856a41828874e4951f15ae | 1692d1557ef9acee1001ab77cbab8e7ac6c69ee8 | refs/heads/master | 2020-03-08T01:19:41.125850 | 2018-06-07T05:38:49 | 2018-06-07T05:38:49 | 127,827,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,783 | java | package com.lib.utils.calendar.utils;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
import com.lib.utils.R;
import com.lib.utils.calendar.group.GroupRecyclerAdapter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
/**
* 适配器
* Created by huanghaibin on 2017/12/4.
*/
public class ArticleAdapter extends GroupRecyclerAdapter<String, Article> {
private RequestManager mLoader;
public ArticleAdapter(Context context) {
super(context);
mLoader = Glide.with(context.getApplicationContext());
LinkedHashMap<String, List<Article>> map = new LinkedHashMap<>();
List<String> titles = new ArrayList<>();
map.put("今日推荐", create(0));
map.put("每周热点", create(1));
map.put("最高评论", create(2));
titles.add("今日推荐");
titles.add("每周热点");
titles.add("最高评论");
resetGroups(map,titles);
}
@Override
protected RecyclerView.ViewHolder onCreateDefaultViewHolder(ViewGroup parent, int type) {
return new ArticleViewHolder(mInflater.inflate(R.layout.item_list_article, parent, false));
}
@Override
protected void onBindViewHolder(RecyclerView.ViewHolder holder, Article item, int position) {
ArticleViewHolder h = (ArticleViewHolder) holder;
h.mTextTitle.setText(item.getTitle());
h.mTextContent.setText(item.getContent());
mLoader.load(item.getImgUrl())
//.asBitmap()
//.centerCrop()
.into(h.mImageView);
}
private static class ArticleViewHolder extends RecyclerView.ViewHolder {
private TextView mTextTitle,
mTextContent;
private ImageView mImageView;
private ArticleViewHolder(View itemView) {
super(itemView);
mTextTitle = (TextView) itemView.findViewById(R.id.tv_title);
mTextContent = (TextView) itemView.findViewById(R.id.tv_content);
mImageView = (ImageView) itemView.findViewById(R.id.imageView);
}
}
private static Article create(String title, String content, String imgUrl) {
Article article = new Article();
article.setTitle(title);
article.setContent(content);
article.setImgUrl(imgUrl);
return article;
}
private static List<Article> create(int p) {
List<Article> list = new ArrayList<>();
if (p == 0) {
list.add(create("新西兰克马德克群岛发生5.7级地震 震源深度10千米",
"#地震快讯#中国地震台网正式测定:12月04日08时08分在克马德克群岛(南纬32.82度,西经178.73度)发生5.7级地震,震源深度10千米。",
"http://cms-bucket.nosdn.127.net/catchpic/2/27/27e2ce7fd02e6c096e21b1689a8a3fe9.jpg?imageView&thumbnail=550x0"));
list.add(create("俄罗斯喊冤不当\"背锅侠\" 俄美陷入\"后真相\"旋涡",
"“差到令人震惊”,但不怪特朗普。俄罗斯总理德米特里·梅德韦杰夫近日在谈到俄美关系时这样说。俄罗斯近来连遭美国“恶毒”指责和西方国家连环出击。一些国际舆论认为,俄罗斯成了“背锅侠”,俄罗斯自己也公开喊冤斥责美国。在俄美你来我往的互掐中,真相似乎变得已不那么重要了。",
"http://cms-bucket.nosdn.127.net/catchpic/c/c8/c8b0685089258b82f3ca1997def78d8d.png?imageView&thumbnail=550x0"));
list.add(create("中企投资巴西获支持 英媒:巴西人感激\"保住饭碗\"",
"参考消息网12月4日报道 英媒称,里约热内卢附近的阿苏港曾被埃克·巴蒂斯塔称为“通往中国的公路”,10多年前,这位现已名誉扫地的巴西前首富创建了这个超级港,大宗商品热潮结束后,他在巴西的商业帝国几乎无一幸存并于2014年破产,但此后至今有一个项目仍蓬勃发展,那就是阿苏港。",
"http://cms-bucket.nosdn.127.net/catchpic/8/8b/8ba2d19b7f63efc5cf714960d5edd2c3.jpg?imageView&thumbnail=550x0"));
list.add(create("美电视台记者因误报有关弗林新闻被停职四周",
"【环球网报道】据俄罗斯卫星网12月3日报道,美国ABC电视台记者布莱恩·罗素因在有关美国总统前国家安全顾问迈克尔·弗林的新闻报道中的失误,临时被停职。",
"http://cms-bucket.nosdn.127.net/5d18566fde70407b9cc3a728822115c320171203133214.jpeg?imageView&thumbnail=550x0"));
list.add(create("预计明年3月上市 曝全新奥迪Q5L无伪谍照",
"随着之前全新一代国产奥迪Q5L在工信部目录亮相,最近曝光的测试车也都基本褪去了伪装,不过正式上市还是要等到2018年3月份。从最新曝光的内饰来看,轴距的加长令后排的空间有着非常明显的提升。",
"http://cms-bucket.nosdn.127.net/eda9ca222352470190c4f0d6b9a8c29420171201160854.jpeg?imageView&thumbnail=550x0"));
} else if (p == 1) {
list.add(create(
"2019年投产 电咖整车生产基地落户浙江绍兴",
"网易汽车11月30日报道 两周前的广州车展上,电咖发布了其首款电动汽车EV10,官方指导价为13.38万-14.18万,扣除补贴后的零售价为5.98万元-6.78万元,性价比很高。抛开车辆本身,引起业界关注的是这家新势力造车企业的几位核心成员,当年上汽大众团队的三位老兵--张海亮、向东平、牛胜福携手用了957天造了一辆可以上市的车。",
"http://cms-bucket.nosdn.127.net/674c392123254bb69bdd9227442965eb20171129203658.jpeg?imageView&thumbnail=550x0"));
list.add(create(
"2017年进入尾声,苹果大笔押注的ARkit还好么?",
"谷歌推出了AR眼镜、ARCore平台和应用在手机上的Project Tango,Facebook也上线了AR开发平台和工具。至于苹果,更是把AR当做发展的重中之重。在新品iPhone8和iPhoneX中,后置摄像头专为AR进行校准,前置摄像头还添加了可以带来更好AR效果的深度传感器。",
"http://cms-bucket.nosdn.127.net/catchpic/7/76/76135ac5d3107a1d5ba11a8ee2fc7e27.jpg?imageView&thumbnail=550x0"));
list.add(create(
"亚马逊CTO:我们要让人类成为机器人的中心!",
"那些相信应用下载会让世界变得更美好的智能手机布道者和应用爱好者们,会在AWS re:Invent大会上感到不自在。亚马逊网络服务首席技术官Werner Vogels表示,所有这些都未能实现信息的民主化。",
"http://cms-bucket.nosdn.127.net/ddb758f16a7d4aa3aa422ec385fc3e5020171204081818.jpeg?imageView&thumbnail=550x0"));
list.add(create(
"有特斯拉车主想用免费的充电桩挖矿,但这可能行不通",
"在社交网络 Facebook 上的一个特斯拉车主群组中,有人开脑洞说可以尝试自己组装矿机放在特斯拉后备箱中,接入车载电池的电源,然后将车停到超级充电桩附近,就能用免费获得的电力挖矿了。",
"http://crawl.nosdn.127.net/nbotreplaceimg/4ce9c743e6c02f6777d22278e2ef8bc3/2b33e32532db204fe207693c82719660.jpg"));
} else if (p == 2) {
list.add(create(
"2017年进入尾声,苹果大笔押注的ARkit还好么?",
"谷歌推出了AR眼镜、ARCore平台和应用在手机上的Project Tango,Facebook也上线了AR开发平台和工具。至于苹果,更是把AR当做发展的重中之重。在新品iPhone8和iPhoneX中,后置摄像头专为AR进行校准,前置摄像头还添加了可以带来更好AR效果的深度传感器。",
"http://cms-bucket.nosdn.127.net/catchpic/7/76/76135ac5d3107a1d5ba11a8ee2fc7e27.jpg?imageView&thumbnail=550x0"));
list.add(create(
"亚马逊CTO:我们要让人类成为机器人的中心!",
"那些相信应用下载会让世界变得更美好的智能手机布道者和应用爱好者们,会在AWS re:Invent大会上感到不自在。亚马逊网络服务首席技术官Werner Vogels表示,所有这些都未能实现信息的民主化。",
"http://cms-bucket.nosdn.127.net/ddb758f16a7d4aa3aa422ec385fc3e5020171204081818.jpeg?imageView&thumbnail=550x0"));
list.add(create("中企投资巴西获支持 英媒:巴西人感激\"保住饭碗\"",
"参考消息网12月4日报道 英媒称,里约热内卢附近的阿苏港曾被埃克·巴蒂斯塔称为“通往中国的公路”,10多年前,这位现已名誉扫地的巴西前首富创建了这个超级港,大宗商品热潮结束后,他在巴西的商业帝国几乎无一幸存并于2014年破产,但此后至今有一个项目仍蓬勃发展,那就是阿苏港。",
"http://cms-bucket.nosdn.127.net/catchpic/8/8b/8ba2d19b7f63efc5cf714960d5edd2c3.jpg?imageView&thumbnail=550x0"));
list.add(create("美电视台记者因误报有关弗林新闻被停职四周",
"【环球网报道】据俄罗斯卫星网12月3日报道,美国ABC电视台记者布莱恩·罗素因在有关美国总统前国家安全顾问迈克尔·弗林的新闻报道中的失误,临时被停职。",
"http://cms-bucket.nosdn.127.net/5d18566fde70407b9cc3a728822115c320171203133214.jpeg?imageView&thumbnail=550x0"));
list.add(create(
"2019年投产 电咖整车生产基地落户浙江绍兴",
"网易汽车11月30日报道 两周前的广州车展上,电咖发布了其首款电动汽车EV10,官方指导价为13.38万-14.18万,扣除补贴后的零售价为5.98万元-6.78万元,性价比很高。抛开车辆本身,引起业界关注的是这家新势力造车企业的几位核心成员,当年上汽大众团队的三位老兵--张海亮、向东平、牛胜福携手用了957天造了一辆可以上市的车。",
"http://cms-bucket.nosdn.127.net/674c392123254bb69bdd9227442965eb20171129203658.jpeg?imageView&thumbnail=550x0"));
}
return list;
}
}
| [
"[email protected]"
] | |
0647e60d2ee054262a0d9df307aeaf97e7e1c1d6 | 1440e401b4e8a26b98f39bb5d3d723d7be105221 | /HarryPotterService/src/test/java/com/mha/harrypotter/service/CharacterServiceTest.java | 30fe90e61ee2d47985dfd29b89a2cef9356e056c | [] | no_license | michel-henri-alves/HarryPotter | 27b9798061db2f4b8909f2e13e211d187ab27f4a | e17a6d6d210f9cb98404fff247ff804b3962f389 | refs/heads/master | 2023-08-12T15:43:10.102618 | 2021-10-04T14:50:03 | 2021-10-04T14:50:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,933 | java | package com.mha.harrypotter.service;
/**
* unit test CharacterService
*
* @author michel
* @version 0.0.1
*
*/
import static io.restassured.module.mockmvc.RestAssuredMockMvc.standaloneSetup;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.HttpStatus;
import com.mha.harrypotter.model.Character;
import com.mha.harrypotter.model.House;
import com.mha.harrypotter.model.dto.CharacterDTO;
import com.mha.harrypotter.repositories.CharacterRepository;
import com.mha.harrypotter.service.impl.CharacterServiceImpl;
import com.mha.harrypotter.util.ConvertEntityToDTO;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {
com.mha.harrypotter.HarryPotterServiceApplication.class })
public class CharacterServiceTest {
@Autowired
private CharacterServiceImpl service;
@MockBean
private CharacterRepository repo;
@MockBean
private HouseService houseService;
@Autowired
private ConvertEntityToDTO entityToDTO;
Optional<House> house = Optional.of(new House("1760529f-6d51-4cb1-bcb1-25087fce5bde", "Gryffindor", "Minerva McGonagall", List.of("courage", "bravery", "nerve", "chivalry"), List.of("scarlet", "gold"), "Hogwarts School of Witchcraft and Wizardry", "lion", "Nearly Headless Nick", "Goderic Gryffindor"));
Optional<Character> character = Optional.of(new Character(1, "TONY STARK", "BILLIONARY", "S.H.I.E.L.D", house.get(), "NICK FURY"));
CharacterDTO characterDTO = new CharacterDTO("1", "peralta", "student", "Hogwarts School of Witchcraft and Wizardry", "1760529f-6d51-4cb1-bcb1-25087fce5bde", "stag");
@BeforeEach
public void setup() {
standaloneSetup(this.service);
}
/**
*
* save success test
*/
@Test
public void saveSuccessTest() {
Character character = entityToDTO.mappingObjects(characterDTO, Character.class);
character.setHouse(house.get());
when(houseService.getById(characterDTO.getHouse())).thenReturn(house);
when(service.getByName(characterDTO.getName())).thenReturn(Optional.empty());
when(repo.save(character)).thenReturn(character);
assertEquals(HttpStatus.OK, service.save(characterDTO).getStatus());
}
/**
* save failure - house not exist
*/
@Test
public void saveHouseNotExistTest() {
Character character = entityToDTO.mappingObjects(characterDTO, Character.class);
character.setHouse(house.get());
when(houseService.getById(characterDTO.getHouse())).thenReturn(Optional.empty());
when(service.getByName(characterDTO.getName())).thenReturn(Optional.empty());
when(repo.save(character)).thenReturn(character);
assertEquals("House not exist", service.save(characterDTO).getMessage());
}
/**
* save failure - register already exist
*/
@Test
public void saveCharacterAlreadyExistTest() {
Character character = entityToDTO.mappingObjects(characterDTO, Character.class);
character.setHouse(house.get());
when(houseService.getById(characterDTO.getHouse())).thenReturn(house);
when(service.getByName(characterDTO.getName())).thenReturn(Optional.of(characterDTO));
when(repo.save(character)).thenReturn(character);
assertEquals("Register already exist", service.save(characterDTO).getMessage());
}
/**
* delete success
*/
@Test
public void deleteSuccessTest() {
when(repo.findById(1)).thenReturn(character);
assertEquals(HttpStatus.OK, service.delete(1L).getStatus());
}
/**
* delete failure - register not present
*/
@Test
public void deleteRegisterNotPresentTest() {
when(repo.findById(1)).thenReturn(Optional.empty());
assertEquals("Register not exist", service.delete(1L).getMessage());
}
/**
* update success
*/
@Test
public void updateSuccess() {
when(houseService.getById(characterDTO.getHouse())).thenReturn(house);
when(repo.findById(1)).thenReturn(character);
assertEquals(HttpStatus.OK, service.update(1L, characterDTO).getStatus());
}
/**
* update failure - register not exist
*/
@Test
public void updateRegisterNotExist() {
when(houseService.getById(characterDTO.getHouse())).thenReturn(house);
when(repo.findById(1)).thenReturn(Optional.empty());
assertEquals("Register not exist", service.update(1L, characterDTO).getMessage());
}
/**
* update failure - house not exist
*/
@Test
public void updateHouseNotExist() {
when(houseService.getById(characterDTO.getHouse())).thenReturn(Optional.empty());
when(repo.findById(1)).thenReturn(character);
assertEquals("House not exist", service.update(1L, characterDTO).getMessage());
}
}
| [
"[email protected]"
] | |
a93544780f66d6b850bddab59575762dcdef0ebb | d982b6dc74f4259e2ebf45ed49154d555eb01ef2 | /app/src/main/java/com/aserbao/androidcustomcamera/blocks/mediaCodec/show/MediaCodecShowOnGlSurfaceView.java | 148d2ebb48862e447eea5ec69b606ebdcbcf3cc8 | [] | no_license | qidiyanlei/AndroidCamera | 944d4c5105f2cc0ecef79257a151143582ace675 | a30790d481b25e78d107b985ae5efd6a1e86bb25 | refs/heads/master | 2021-04-07T09:29:58.043474 | 2020-03-13T02:57:35 | 2020-03-13T02:57:35 | 248,664,898 | 1 | 0 | null | 2020-03-20T04:04:53 | 2020-03-20T04:04:52 | null | UTF-8 | Java | false | false | 10,625 | java | package com.aserbao.androidcustomcamera.blocks.mediaCodec.show;
import android.content.Intent;
import android.media.MediaCodec;
import android.media.MediaExtractor;
import android.media.MediaFormat;
import android.media.MediaMetadataRetriever;
import android.media.MediaPlayer;
import android.net.Uri;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.os.Message;
import android.os.SystemClock;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.widget.Toast;
import com.aserbao.androidcustomcamera.R;
import com.aserbao.androidcustomcamera.base.utils.StaticFinalValues;
import com.aserbao.androidcustomcamera.whole.createVideoByVoice.localEdit.LocalVideoActivity;
import com.aserbao.androidcustomcamera.whole.editVideo.VideoEditActivity;
import com.aserbao.androidcustomcamera.whole.editVideo.mediacodec.VideoClipper;
import com.aserbao.androidcustomcamera.whole.editVideo.view.BaseImageView;
import com.aserbao.androidcustomcamera.whole.pickvideo.VideoPickActivity;
import com.aserbao.androidcustomcamera.whole.pickvideo.beans.VideoFile;
import com.aserbao.androidcustomcamera.whole.record.RecorderActivity;
import com.aserbao.androidcustomcamera.whole.record.other.MagicFilterType;
import com.aserbao.androidcustomcamera.whole.videoPlayer.VideoPlayerActivity2;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import static com.aserbao.androidcustomcamera.base.utils.StaticFinalValues.MAX_NUMBER;
import static com.aserbao.androidcustomcamera.base.utils.StaticFinalValues.STORAGE_TEMP_VIDEO_PATH;
import static com.aserbao.androidcustomcamera.base.utils.StaticFinalValues.STORAGE_TEMP_VIDEO_PATH1;
import static com.aserbao.androidcustomcamera.whole.pickvideo.BaseActivity.IS_NEED_FOLDER_LIST;
import static com.aserbao.androidcustomcamera.whole.pickvideo.VideoPickActivity.IS_NEED_CAMERA;
/**
* MediaCodec解码显示到GlSurfaceView上
*/
public class MediaCodecShowOnGlSurfaceView extends AppCompatActivity implements SurfaceHolder.Callback{
private static final String TAG = "MediaCodecShowOnGlSurfa";
@BindView(R.id.mSurface)
SurfaceView mSurfaceView;
public SurfaceHolder mHolder;
private long mStartTime;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_media_codec_show_on_gl_surface_view);
ButterKnife.bind(this);
mHolder = mSurfaceView.getHolder();
mHolder.addCallback(this);
}
@OnClick({R.id.sel_btn, R.id.decode_show_btn,R.id.detail_video_btn})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.sel_btn:
Intent intent2 = new Intent(this, VideoPickActivity.class);
intent2.putExtra(IS_NEED_CAMERA, false);
intent2.putExtra(MAX_NUMBER, 1);
intent2.putExtra(IS_NEED_FOLDER_LIST, true);
startActivityForResult(intent2, StaticFinalValues.REQUEST_CODE_PICK_VIDEO);
break;
case R.id.decode_show_btn:
/*MediaCodecUtil1 mediaCodecUtil1 = new MediaCodecUtil1(videoFileName, mHolder.getSurface());
mediaCodecUtil1.start();*/
break;
case R.id.detail_video_btn:
new Thread(new Runnable() {
@Override
public void run() {
final String outputPath1 = STORAGE_TEMP_VIDEO_PATH1;
videoClipper(videoFileName1,outputPath1);
final String outputPath = STORAGE_TEMP_VIDEO_PATH;
videoClipper(videoFileName,outputPath);
}
}).start();
break;
}
}
// String videoFileName = "/storage/emulated/0/12345.mp4";
String videoFileName1 = "/storage/emulated/0/DCIM/Camera/VIDEO_2019122719_06011577444761071.mp4";
String videoFileName = "/storage/emulated/0/DCIM/Camera/VIDEO_2019122622_50551577371855425.mp4";
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case StaticFinalValues.REQUEST_CODE_PICK_VIDEO:
if (resultCode == RESULT_OK) {
ArrayList<VideoFile> list = data.getParcelableArrayListExtra(StaticFinalValues.RESULT_PICK_VIDEO);
for (VideoFile file : list) {
videoFileName = file.getPath();
}
Toast.makeText(this, "视频已选择成功\n" + videoFileName, Toast.LENGTH_SHORT).show();
break;
}
}
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
}
public class MediaCodecUtil1 {
private String mFilePath;
private MediaCodec mMediaCodec;
private MediaExtractor mMediaExtractor;
private Surface mSurface;
private boolean mIsAvailable;
private ByteBuffer[] mInputBuffers;
private ByteBuffer[] mOutputBuffers;
public MediaCodecUtil1(String filePath, Surface surface) {
mFilePath = filePath;
mSurface = surface;
}
private void init() {
mIsAvailable = false;
mMediaExtractor = new MediaExtractor();
try {
mMediaExtractor.setDataSource(mFilePath);
int trackCount = mMediaExtractor.getTrackCount();
for (int i = 0; i < trackCount; i++) {
MediaFormat mediaFormat = mMediaExtractor.getTrackFormat(i);
String mime = mediaFormat.getString(MediaFormat.KEY_MIME);
if (mime.startsWith("video/")) {
mMediaExtractor.selectTrack(i);
mMediaCodec = MediaCodec.createDecoderByType(mime);
mMediaCodec.configure(mediaFormat, mSurface, null, 0);
mIsAvailable = true;
break;
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
public void start() {
init();
if (mIsAvailable) {
mMediaCodec.start();
mInputBuffers = mMediaCodec.getInputBuffers();
mOutputBuffers = mMediaCodec.getOutputBuffers();
new Thread(new EncoderThread()).start();
}
}
private class EncoderThread implements Runnable {
@Override
public void run() {
MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo(); //每个缓冲区元数据包括指定相关编解码器(输出)缓冲区中有效数据范围的偏移量和大小。
long startTime = System.currentTimeMillis();
while (mIsAvailable) {
int inputBufferIndex = mMediaCodec.dequeueInputBuffer(-1);//获取输入队列中有效数据的索引
if (inputBufferIndex >= 0) {
ByteBuffer inputBuffer = mInputBuffers[inputBufferIndex];
inputBuffer.clear();
int sampleSize = mMediaExtractor.readSampleData(inputBuffer, 0); //检索当前已编码的示例并将其存储到字节缓冲区中,从给定的偏移量开始。
if (sampleSize > 0) {
mMediaExtractor.advance();
mMediaCodec.queueInputBuffer(inputBufferIndex, 0, sampleSize, mMediaExtractor.getSampleTime(), 0);// 通知MediaDecode解码刚刚传入的数据
}
}
int outputBufferIndex = mMediaCodec.dequeueOutputBuffer(bufferInfo, 0);//返回已成功解码的输出缓冲区的索引
if (outputBufferIndex >= 0) {
long sleepTime = bufferInfo.presentationTimeUs / 1000 - (System.currentTimeMillis() - startTime);
if (sleepTime > 0) {
SystemClock.sleep(sleepTime);
}
// ByteBuffer outBuffer = mOutputBuffers[outputBufferIndex];
mMediaCodec.releaseOutputBuffer(outputBufferIndex, true);
}
}
mMediaExtractor.release();
mMediaCodec.stop();
mMediaCodec.release();
Log.i("==", "播放完成");
}
}
public void stop() {
mIsAvailable = false;
}
}
public void videoClipper(String videoFileName,final String outputPath){
mStartTime = System.currentTimeMillis();
VideoClipper clipper = new VideoClipper();
clipper.setInputVideoPath(videoFileName);
clipper.setFilterType(MagicFilterType.NONE);
clipper.setOutputVideoPath(outputPath);
clipper.setOnVideoCutFinishListener(new VideoClipper.OnVideoCutFinishListener() {
@Override
public void onFinish() {
Log.e(TAG, "onFinish: 生成完成耗时" + ((System.currentTimeMillis() - mStartTime) / 1000));
VideoPlayerActivity2.launch(MediaCodecShowOnGlSurfaceView.this,outputPath);
}
@Override
public void onProgress(float percent) {
Log.e(TAG, "onProgress: " +percent );
}
});
try {
final MediaMetadataRetriever mediaMetadata = new MediaMetadataRetriever();
mediaMetadata.setDataSource(this, Uri.parse(videoFileName));
int clipDur = Integer.parseInt(mediaMetadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION));
Log.e(TAG, "onViewClicked: 时长 " + clipDur);
// int clipDur = 5032000;
clipper.clipVideo(0, clipDur * 1000,new ArrayList<BaseImageView>(), getResources());
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
0658620171885ad4827b70aa62f990ea1bec71de | 81edb41c7ce0a8b5774262e639f12fbdea69dd95 | /src/Rectangle.java | 16205fd65409ea8d5158591225b38ff99714a018 | [] | no_license | neustroev2001/Practice6 | 824b1bd161f976d524f3e2c419bae525eb8345e3 | 01648209b8c6e6eb0bac1593f4fa9e6069bf5a92 | refs/heads/master | 2022-12-19T12:33:22.733944 | 2020-09-24T11:55:18 | 2020-09-24T11:55:18 | 298,263,983 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 729 | java | public class Rectangle {
private Point rightTop;
private Point leftBottom;
public Rectangle(Point rightTop, Point leftBottom) {
this.rightTop = rightTop;
this.leftBottom = leftBottom;
}
public Point getRightTop() {
return rightTop;
}
public Point getLeftBottom() {
return leftBottom;
}
public void setRightTop(Point rightTop) {
this.rightTop = rightTop;
}
public void setLeftBottom(Point leftBottom) {
this.leftBottom = leftBottom;
}
@Override
public String toString() {
return "Rectangle{" +
"rightTop=" + rightTop +
", leftBottom=" + leftBottom +
'}';
}
}
| [
"[email protected]"
] | |
eb54b8bb9e2e70d52b10a689fd8187cf6d6c94d4 | e2e995efda07077a45d9f47fd873c2547fbace52 | /mp/src/Parser/Analysis.java | bc8eed09db6bbd22b9a0205ddf711e4a3b363e74 | [] | no_license | Ardonam/Pascal-Compiler | 691ea2c8b9a80640527b6c48952bc487150d7eb9 | 09491b34951c7b1a3354d1b2bfc70feef17a4796 | refs/heads/master | 2021-01-23T04:09:14.134009 | 2015-04-29T18:50:37 | 2015-04-29T18:50:37 | 29,883,490 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 5,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 Parser;
/**
*
* @author Erigon
*/
public class Analysis {
public Analysis() {
}
public void genWriteStmt() {
System.out.print("wrts\n");
}
/**
* Generates code to write newline
*/
public void genWriteLnStmt() {
System.out.print("wrtln #\"\"\n");
}
/*
public void genArithmetic(Symbol leftRec, Symbol opRec, Symbol rightRec, Symbol resultRec) {
String operation = null;
boolean integerDiv = false,
floatDiv = false,
booleanOp = false,
relOp = false; // if relational op, set resulting type to boolean
switch(opRec.lexeme.toLowerCase()) {
case "+":
operation = "adds";
break;
case "-":
operation = "subs";
break;
case "*":
operation = "muls";
break;
case "div":
integerDiv = true;
operation = "divs";
break;
case "/":
floatDiv = true;
operation = "divs"; // 'f' added below
break;
case "mod":
if(leftRec.type == Symbol.Type.FLOAT || rightRec.type == Symbol.Type.FLOAT)
semanticError("Modulo operator cannot be applied to float type");
operation = "mods";
break;
case "=":
operation = "cmpeqs";
booleanOp = true; // = allowed for booleans
relOp = true;
break;
case ">=":
operation = "cmpges";
relOp = true;
break;
case ">":
operation = "cmpgts";
relOp = true;
break;
case "<=":
operation = "cmples";
relOp = true;
break;
case "<":
operation = "cmplts";
relOp = true;
break;
case "<>":
operation = "cmpnes";
booleanOp = true; // <> allowed for booleans
relOp = true;
break;
case "and":
if(leftRec.type != Symbol.Type.BOOLEAN || rightRec.type != Symbol.Type.BOOLEAN)
semanticError("Logical operations not allowed on non-boolean types");
operation = "ands";
booleanOp = true;
break;
case "or":
if(leftRec.type != Symbol.Type.BOOLEAN || rightRec.type != Symbol.Type.BOOLEAN)
semanticError("Logical operations not allowed on non-boolean types");
operation = "ors";
booleanOp = true;
break;
}
if(booleanOp && leftRec.type == Symbol.Type.BOOLEAN && rightRec.type == Symbol.Type.BOOLEAN) {
output.append(operation+"\n");
resultRec.type = leftRec.type;
}
// disallow arithmetic/compare operations on boolean and string types
else if(leftRec.type != Symbol.Type.BOOLEAN && leftRec.type != Symbol.Type.STRING) {
if(leftRec.type == rightRec.type) {
resultRec.type = relOp ? Symbol.Type.BOOLEAN : leftRec.type;
// Check for integer division operator on floats
if(leftRec.type == Symbol.Type.FLOAT) {
if(integerDiv) {
// I'm not sure exactly what the semantics are for int division
// on floats, I assume you just truncate values, then divide
output.append("castsi\n"); // cast RHS to integer
genCastLeftHandSide(Symbol.Type.INTEGER); // cast LHS to integer
resultRec.type = Symbol.Type.INTEGER; // set expression result to integer
}
else // not integer div
operation = operation + "f"; // use float operation if LHS and RHS both float
}
// Check for float division operator on integers
else if(leftRec.type == Symbol.Type.INTEGER && floatDiv) {
output.append("castsf\n"); // cast RHS to float
genCastLeftHandSide(Symbol.Type.FLOAT); // cast LHS to float
resultRec.type = Symbol.Type.FLOAT; // set expression result to float
operation = operation + "f"; // use float operation
}
output.append(operation + "\n");
}
// Stack top needs to be casted to float:
else if(leftRec.type == Symbol.Type.FLOAT && rightRec.type == Symbol.Type.INTEGER) {
resultRec.type = relOp ? Symbol.Type.BOOLEAN : Symbol.Type.FLOAT;
// unless integer div, then cast LHS to integer
if(integerDiv) {
genCastLeftHandSide(Symbol.Type.INTEGER); // cast LHS to integer
resultRec.type = Symbol.Type.INTEGER; // set expression result to integer
}
else { // not integer div
output.append("castsf\n"); // cast RHS to float
operation = operation + "f";// use float operation
}
output.append(operation + "\n");
}
// Second in from top of stack needs to be casted to float:
else if(leftRec.type == Symbol.Type.INTEGER && rightRec.type == Symbol.Type.FLOAT) {
resultRec.type = relOp ? Symbol.Type.BOOLEAN : Symbol.Type.FLOAT;
// unless integer div, then cast RHS to integer
if(integerDiv) {
output.append("castsi\n"); // cast RHS to integer
resultRec.type = Symbol.Type.INTEGER; // set expression result to integer
}
else { // not integer div
genCastLeftHandSide(Symbol.Type.FLOAT); // cast LHS to float
operation = operation + "f"; // use float operation
}
output.append(operation + "\n");
}
else if(leftRec.type != rightRec.type)
this.semanticError("Incompatible types encountered for expression: " + leftRec.type + " " + opRec.lexeme + " " + rightRec.type);
}
else
this.semanticError("Incompatible types encountered for expression: " + leftRec.type + " " + opRec.lexeme + " " + rightRec.type);
}
private void semanticError(String errorMsg) {
parser.semanticError(errorMsg);
error = true;
}
*/
} | [
"[email protected]"
] | |
1949e89d5f210dc82115178edfeafb8934c49b0f | ce059a5dd3f8a89d78566fefb4fe04a1dd06e965 | /web-common/src/main/java/com/xuanwu/web/common/utils/Delimiters.java | a7739ff0224efe63d8a238647b9a659408081c07 | [] | no_license | lizongxian2008/blog | 1fc6c1f98fe3331316a77ec0c4e559d4cbfbb3fe | 492d8fc020f6844da2de4208ec13db1725f7b36d | refs/heads/master | 2021-01-10T08:10:35.270618 | 2015-05-29T03:49:46 | 2015-05-29T03:49:46 | 36,475,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | /*
* Copyright (c) 2012 by XUANWU INFORMATION TECHNOLOGY CO.
* All rights reserved
*/
package com.xuanwu.web.common.utils;
/**
* @Description: 系统分隔符常量接口
* @Author <a href="[email protected]">Wei.Huang</a>
* @Date 2012-10-8
* @Version 1.0.0
*/
public interface Delimiters {
/** '@'符号 */
public static final String AT = "@";
/** 点号 '.'字符*/
public static final char CH_DOT = '.';
/** 点号 '.'*/
public static final String DOT = ".";
/** 逗号 ','*/
public static final String COMMA = ",";
/** 冒号 ':'*/
public static final String COLON = ":";
/** 英文分号 ';' */
public static final String SICOLON = ";";
/** 中文分号 ';' */
public static final String SICOLON_ZH_CN = ";";
}
| [
"[email protected]"
] | |
d0b6eda6589fdf8f6b73a38570df1ca5b25678b7 | 144a2ebd1fdf460ee73fc40b8612f85b679d9baf | /app/src/main/java/com/example/admin/tp9_cycleapplication/Texte.java | fe992edb8c1b82fb9652302420d5429e98fc2b19 | [] | no_license | Air-Oine/TP9-Cycleapplication | 1106eeebeafca67662c53251228c2739d315ad74 | d1835b10e692d35968c9ba3dfa2aec4d40e473f6 | refs/heads/master | 2020-06-21T03:09:33.241852 | 2017-06-13T14:57:51 | 2017-06-13T14:57:51 | 94,201,217 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 909 | java | package com.example.admin.tp9_cycleapplication;
import android.os.Parcel;
import android.os.Parcelable;
/**
* Created by admin on 13/06/2017.
*/
public class Texte implements Parcelable {
private String texte;
protected Texte(Parcel in) {
texte = in.readString();
}
public static final Creator<Texte> CREATOR = new Creator<Texte>() {
@Override
public Texte createFromParcel(Parcel in) {
return new Texte(in);
}
@Override
public Texte[] newArray(int size) {
return new Texte[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(texte);
}
public Texte(String texte) {
this.texte = texte;
}
public String getTexte() {
return texte;
}
}
| [
"[email protected]"
] | |
fb4725486b6c4037d29e9a74bd9d8a7c722c8e72 | 77623d6dd90f2d1a401ee720adb41c3c0c264715 | /DiffTGen-result/output/Chart_9_1_jaid/target/0/4/evosuite-tests/org/jfree/data/time/TimeSeries_ESTest.java | 99b5bce21ddf3adbdb9c383386050741193ef928 | [] | no_license | wuhongjun15/overfitting-study | 40be0f062bbd6716d8de6b06454b8c73bae3438d | 5093979e861cda6575242d92ca12355a26ca55e0 | refs/heads/master | 2021-04-17T05:37:48.393527 | 2020-04-11T01:53:53 | 2020-04-11T01:53:53 | 249,413,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,743 | java | /*
* This file was automatically generated by EvoSuite
* Fri Mar 27 13:06:16 GMT 2020
*/
package org.jfree.data.time;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.chrono.ChronoLocalDate;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.SimpleTimeZone;
import java.util.TimeZone;
import javax.swing.JLayeredPane;
import javax.swing.JMenu;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.time.MockInstant;
import org.evosuite.runtime.mock.java.util.MockDate;
import org.jfree.data.time.Day;
import org.jfree.data.time.FixedMillisecond;
import org.jfree.data.time.Hour;
import org.jfree.data.time.Millisecond;
import org.jfree.data.time.Minute;
import org.jfree.data.time.Month;
import org.jfree.data.time.Quarter;
import org.jfree.data.time.RegularTimePeriod;
import org.jfree.data.time.Second;
import org.jfree.data.time.SerialDate;
import org.jfree.data.time.SimpleTimePeriod;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesDataItem;
import org.jfree.data.time.Week;
import org.jfree.data.time.Year;
import org.jfree.data.xy.XYDataItem;
import org.jfree.data.xy.XYDatasetTableModel;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class TimeSeries_ESTest extends TimeSeries_ESTest_scaffolding {
@Test(timeout = 4000)
public void test00() throws Throwable {
MockDate mockDate0 = new MockDate();
SimpleTimeZone simpleTimeZone0 = new SimpleTimeZone(3665, "J>}^B[R[\">j;gmpAz\"");
Hour hour0 = new Hour(mockDate0, simpleTimeZone0);
Class<TimeZone> class0 = TimeZone.class;
TimeSeries timeSeries0 = new TimeSeries(hour0, class0);
// Undeclared exception!
try {
timeSeries0.update(3742, (Number) 0);
} catch(IndexOutOfBoundsException e) {
//
// Index: 3742, Size: 0
//
verifyException("java.util.ArrayList", e);
}
}
@Test(timeout = 4000)
public void test01() throws Throwable {
Year year0 = new Year();
Class<ChronoLocalDate> class0 = ChronoLocalDate.class;
TimeSeries timeSeries0 = new TimeSeries(year0, "H-pH?Cty5#`N", "H-pH?Cty5#`N", class0);
// Undeclared exception!
try {
timeSeries0.removeAgedItems((-1026L), false);
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test02() throws Throwable {
MockDate mockDate0 = new MockDate((-581L));
Millisecond millisecond0 = new Millisecond(mockDate0);
Class<Quarter> class0 = Quarter.class;
TimeSeries timeSeries0 = new TimeSeries(millisecond0, "}DU#UA5(2@T{OY", "Range", class0);
// Undeclared exception!
try {
timeSeries0.getTimePeriodsUniqueToOtherSeries((TimeSeries) null);
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test03() throws Throwable {
MockDate mockDate0 = new MockDate((-1277), (-1277), 531);
FixedMillisecond fixedMillisecond0 = new FixedMillisecond(mockDate0);
Class<FixedMillisecond> class0 = FixedMillisecond.class;
TimeSeries timeSeries0 = new TimeSeries(fixedMillisecond0, class0);
// Undeclared exception!
try {
timeSeries0.getTimePeriod((-1277));
} catch(ArrayIndexOutOfBoundsException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test04() throws Throwable {
MockDate mockDate0 = new MockDate(1560, 1560, (-60));
SimpleTimePeriod simpleTimePeriod0 = new SimpleTimePeriod(mockDate0, mockDate0);
Class<FixedMillisecond> class0 = FixedMillisecond.class;
TimeSeries timeSeries0 = new TimeSeries(simpleTimePeriod0, "No observation for x = ", "No observation for x = ", class0);
// Undeclared exception!
try {
timeSeries0.getDataItem((-60));
} catch(ArrayIndexOutOfBoundsException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test05() throws Throwable {
XYDataItem xYDataItem0 = new XYDataItem(409.53818, 409.53818);
Class<RegularTimePeriod> class0 = RegularTimePeriod.class;
TimeSeries timeSeries0 = new TimeSeries(xYDataItem0, "The number of category keys does not match the number of categories in the data.", "createInstance", class0);
// Undeclared exception!
try {
timeSeries0.delete(0, 0);
} catch(IndexOutOfBoundsException e) {
//
// Index: 0, Size: 0
//
verifyException("java.util.ArrayList", e);
}
}
@Test(timeout = 4000)
public void test06() throws Throwable {
Hour hour0 = new Hour();
Class<XYDatasetTableModel> class0 = XYDatasetTableModel.class;
TimeSeries timeSeries0 = new TimeSeries(hour0, " ^$", " ^$", class0);
// Undeclared exception!
try {
timeSeries0.addAndOrUpdate((TimeSeries) null);
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test07() throws Throwable {
Millisecond millisecond0 = new Millisecond();
Quarter quarter0 = new Quarter();
TimeSeries timeSeries0 = new TimeSeries(quarter0);
// Undeclared exception!
try {
timeSeries0.add((RegularTimePeriod) millisecond0, (Number) 4, true);
} catch(RuntimeException e) {
//
// You are trying to add data where the time period class is org.jfree.data.time.Millisecond, but the TimeSeries is expecting an instance of org.jfree.data.time.Day.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test08() throws Throwable {
Class<Year> class0 = Year.class;
TimeSeries timeSeries0 = null;
try {
timeSeries0 = new TimeSeries((Comparable) null, "RVxBGDRu5wR%wz3]<", "RVxBGDRu5wR%wz3]<", class0);
} catch(IllegalArgumentException e) {
//
// Null 'key' argument.
//
verifyException("org.jfree.data.general.Series", e);
}
}
@Test(timeout = 4000)
public void test09() throws Throwable {
Class<RegularTimePeriod> class0 = RegularTimePeriod.class;
TimeSeries timeSeries0 = null;
try {
timeSeries0 = new TimeSeries((Comparable) null, class0);
} catch(IllegalArgumentException e) {
//
// Null 'key' argument.
//
verifyException("org.jfree.data.general.Series", e);
}
}
@Test(timeout = 4000)
public void test10() throws Throwable {
TimeSeries timeSeries0 = null;
try {
timeSeries0 = new TimeSeries((Comparable) null);
} catch(IllegalArgumentException e) {
//
// Null 'key' argument.
//
verifyException("org.jfree.data.general.Series", e);
}
}
@Test(timeout = 4000)
public void test11() throws Throwable {
Day day0 = new Day();
TimeSeries timeSeries0 = new TimeSeries(day0);
timeSeries0.removeAgedItems(true);
}
@Test(timeout = 4000)
public void test12() throws Throwable {
Instant instant0 = MockInstant.ofEpochMilli(0L);
Date date0 = Date.from(instant0);
TimeZone timeZone0 = TimeZone.getDefault();
Second second0 = new Second(date0, timeZone0);
Class<TimeZone> class0 = TimeZone.class;
TimeSeries timeSeries0 = new TimeSeries(second0, class0);
TimeSeriesDataItem timeSeriesDataItem0 = new TimeSeriesDataItem((RegularTimePeriod) second0, (double) 0L);
// Undeclared exception!
try {
timeSeries0.add(timeSeriesDataItem0, false);
} catch(RuntimeException e) {
//
// You are trying to add data where the time period class is org.jfree.data.time.Second, but the TimeSeries is expecting an instance of java.util.TimeZone.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test13() throws Throwable {
Year year0 = new Year();
Class<Object> class0 = Object.class;
TimeSeries timeSeries0 = new TimeSeries(year0, "", "", class0);
// Undeclared exception!
try {
timeSeries0.add((TimeSeriesDataItem) null, false);
} catch(IllegalArgumentException e) {
//
// Null 'item' argument.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test14() throws Throwable {
Millisecond millisecond0 = new Millisecond();
Class<RegularTimePeriod> class0 = RegularTimePeriod.class;
TimeSeries timeSeries0 = new TimeSeries(millisecond0, "", "O", class0);
int int0 = timeSeries0.getIndex(millisecond0);
}
@Test(timeout = 4000)
public void test15() throws Throwable {
MockDate mockDate0 = new MockDate();
ZoneId zoneId0 = ZoneId.systemDefault();
TimeZone timeZone0 = TimeZone.getTimeZone(zoneId0);
Quarter quarter0 = new Quarter(mockDate0, timeZone0);
Class<XYDatasetTableModel> class0 = XYDatasetTableModel.class;
TimeSeries timeSeries0 = new TimeSeries(quarter0, class0);
Class class1 = timeSeries0.getTimePeriodClass();
}
@Test(timeout = 4000)
public void test16() throws Throwable {
Integer integer0 = JLayeredPane.DEFAULT_LAYER;
XYDataItem xYDataItem0 = new XYDataItem((Number) integer0, (Number) integer0);
Class<Date> class0 = Date.class;
TimeSeries timeSeries0 = new TimeSeries(xYDataItem0, class0);
Day day0 = new Day();
// Undeclared exception!
try {
timeSeries0.add((RegularTimePeriod) day0, (-841.3178461903559), true);
} catch(RuntimeException e) {
//
// You are trying to add data where the time period class is org.jfree.data.time.Day, but the TimeSeries is expecting an instance of java.util.Date.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test17() throws Throwable {
MockDate mockDate0 = new MockDate();
Class<SimpleTimeZone> class0 = SimpleTimeZone.class;
TimeSeries timeSeries0 = new TimeSeries(mockDate0, class0);
// Undeclared exception!
try {
timeSeries0.getTimePeriod(Integer.MAX_VALUE);
} catch(IndexOutOfBoundsException e) {
//
// Index: 2147483647, Size: 0
//
verifyException("java.util.ArrayList", e);
}
}
@Test(timeout = 4000)
public void test18() throws Throwable {
Millisecond millisecond0 = new Millisecond();
Class<RegularTimePeriod> class0 = RegularTimePeriod.class;
TimeSeries timeSeries0 = new TimeSeries(millisecond0, "", "O", class0);
// Undeclared exception!
try {
timeSeries0.getDataItem(23);
} catch(IndexOutOfBoundsException e) {
//
// Index: 23, Size: 0
//
verifyException("java.util.ArrayList", e);
}
}
@Test(timeout = 4000)
public void test19() throws Throwable {
Week week0 = new Week();
Class<Day> class0 = Day.class;
TimeSeries timeSeries0 = new TimeSeries(week0, class0);
int int0 = timeSeries0.getItemCount();
}
@Test(timeout = 4000)
public void test20() throws Throwable {
MockDate mockDate0 = new MockDate((-1916), (-673), (-1562));
FixedMillisecond fixedMillisecond0 = new FixedMillisecond(mockDate0);
Class<String> class0 = String.class;
TimeSeries timeSeries0 = new TimeSeries(fixedMillisecond0, class0);
Integer integer0 = JLayeredPane.FRAME_CONTENT_LAYER;
TimeSeriesDataItem timeSeriesDataItem0 = timeSeries0.addOrUpdate((RegularTimePeriod) fixedMillisecond0, (Number) integer0);
int int0 = timeSeries0.hashCode();
}
@Test(timeout = 4000)
public void test21() throws Throwable {
MockDate mockDate0 = new MockDate((-1916), (-673), (-1562));
FixedMillisecond fixedMillisecond0 = new FixedMillisecond(mockDate0);
Class<String> class0 = String.class;
TimeSeries timeSeries0 = new TimeSeries(fixedMillisecond0, class0);
int int0 = timeSeries0.hashCode();
}
@Test(timeout = 4000)
public void test22() throws Throwable {
Minute minute0 = new Minute();
TimeSeries timeSeries0 = new TimeSeries(minute0);
boolean boolean0 = timeSeries0.equals(minute0);
}
@Test(timeout = 4000)
public void test23() throws Throwable {
Week week0 = new Week();
Class<Day> class0 = Day.class;
TimeSeries timeSeries0 = new TimeSeries(week0, class0);
TimeSeries timeSeries1 = timeSeries0.createCopy((RegularTimePeriod) week0, (RegularTimePeriod) week0);
}
@Test(timeout = 4000)
public void test24() throws Throwable {
Millisecond millisecond0 = new Millisecond();
Class<RegularTimePeriod> class0 = RegularTimePeriod.class;
TimeSeries timeSeries0 = new TimeSeries(millisecond0, "", "O", class0);
TimeSeries timeSeries1 = timeSeries0.createCopy(999, 999);
}
@Test(timeout = 4000)
public void test25() throws Throwable {
FixedMillisecond fixedMillisecond0 = new FixedMillisecond(0L);
Class<SimpleTimeZone> class0 = SimpleTimeZone.class;
TimeSeries timeSeries0 = new TimeSeries(fixedMillisecond0, class0);
// Undeclared exception!
try {
timeSeries0.createCopy((-4835), 0);
} catch(IllegalArgumentException e) {
//
// Requires start >= 0.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test26() throws Throwable {
Class<String> class0 = String.class;
TimeSeries timeSeries0 = new TimeSeries("Domain", class0);
// Undeclared exception!
try {
timeSeries0.createCopy(4, 1);
} catch(IllegalArgumentException e) {
//
// Requires start <= end.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test27() throws Throwable {
Day day0 = new Day();
Class<Second> class0 = Second.class;
TimeSeries timeSeries0 = new TimeSeries(day0, "\"^6\"}1VJWnL~PrD<r", "\"^6\"}1VJWnL~PrD<r", class0);
// Undeclared exception!
try {
timeSeries0.delete(1896, 0);
} catch(IllegalArgumentException e) {
//
// Requires start <= end.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test28() throws Throwable {
MockDate mockDate0 = new MockDate(11, 1815, 11, (-1516), (-1516));
Minute minute0 = new Minute(mockDate0);
Class<Year> class0 = Year.class;
TimeSeries timeSeries0 = new TimeSeries(minute0, class0);
// Undeclared exception!
try {
timeSeries0.delete((-1516), 0);
} catch(ArrayIndexOutOfBoundsException e) {
//
// -1516
//
verifyException("java.util.ArrayList", e);
}
}
@Test(timeout = 4000)
public void test29() throws Throwable {
Second second0 = new Second();
TimeSeries timeSeries0 = new TimeSeries(second0);
timeSeries0.delete((RegularTimePeriod) second0);
}
@Test(timeout = 4000)
public void test30() throws Throwable {
FixedMillisecond fixedMillisecond0 = new FixedMillisecond();
TimeSeries timeSeries0 = new TimeSeries(fixedMillisecond0);
timeSeries0.clear();
}
@Test(timeout = 4000)
public void test31() throws Throwable {
MockDate mockDate0 = new MockDate((-581L));
Millisecond millisecond0 = new Millisecond(mockDate0);
Class<Quarter> class0 = Quarter.class;
TimeSeries timeSeries0 = new TimeSeries(millisecond0, "}DU#UA5(2@T{OY", "Range", class0);
timeSeries0.removeAgedItems((long) 0, true);
}
@Test(timeout = 4000)
public void test32() throws Throwable {
Millisecond millisecond0 = new Millisecond();
TimeSeries timeSeries0 = new TimeSeries(millisecond0);
// Undeclared exception!
try {
timeSeries0.update((RegularTimePeriod) millisecond0, (Number) 0);
} catch(RuntimeException e) {
//
// TimeSeries.update(TimePeriod, Number): period does not exist.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test33() throws Throwable {
Week week0 = new Week();
Class<Day> class0 = Day.class;
TimeSeries timeSeries0 = new TimeSeries(week0, class0);
Number number0 = timeSeries0.getValue((RegularTimePeriod) week0);
}
@Test(timeout = 4000)
public void test34() throws Throwable {
SerialDate serialDate0 = SerialDate.createInstance(170);
TimeSeries timeSeries0 = new TimeSeries(serialDate0);
// Undeclared exception!
try {
timeSeries0.getIndex((RegularTimePeriod) null);
} catch(IllegalArgumentException e) {
//
// Null 'period' argument.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test35() throws Throwable {
FixedMillisecond fixedMillisecond0 = new FixedMillisecond();
TimeSeries timeSeries0 = new TimeSeries(fixedMillisecond0);
Collection collection0 = timeSeries0.getTimePeriodsUniqueToOtherSeries(timeSeries0);
}
@Test(timeout = 4000)
public void test36() throws Throwable {
Hour hour0 = new Hour();
Class<XYDatasetTableModel> class0 = XYDatasetTableModel.class;
TimeSeries timeSeries0 = new TimeSeries(hour0, " ^$", " ^$", class0);
Collection collection0 = timeSeries0.getTimePeriods();
}
@Test(timeout = 4000)
public void test37() throws Throwable {
Day day0 = new Day();
TimeSeries timeSeries0 = new TimeSeries(day0);
TimeSeriesDataItem timeSeriesDataItem0 = new TimeSeriesDataItem((RegularTimePeriod) day0, (-1.0));
timeSeries0.add(timeSeriesDataItem0, false);
TimeSeriesDataItem timeSeriesDataItem1 = timeSeries0.getDataItem((RegularTimePeriod) day0);
}
@Test(timeout = 4000)
public void test38() throws Throwable {
Week week0 = new Week();
Class<Day> class0 = Day.class;
TimeSeries timeSeries0 = new TimeSeries(week0, class0);
TimeSeriesDataItem timeSeriesDataItem0 = timeSeries0.getDataItem((RegularTimePeriod) week0);
}
@Test(timeout = 4000)
public void test39() throws Throwable {
Second second0 = new Second();
Class<Hour> class0 = Hour.class;
TimeSeries timeSeries0 = new TimeSeries(second0, class0);
timeSeries0.setMaximumItemAge(1392409281819L);
}
@Test(timeout = 4000)
public void test40() throws Throwable {
FixedMillisecond fixedMillisecond0 = new FixedMillisecond();
TimeSeries timeSeries0 = new TimeSeries(fixedMillisecond0);
// Undeclared exception!
try {
timeSeries0.setMaximumItemCount((-1));
} catch(IllegalArgumentException e) {
//
// Negative 'maximum' argument.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test41() throws Throwable {
Day day0 = new Day();
TimeSeries timeSeries0 = new TimeSeries(day0);
timeSeries0.setMaximumItemCount(507);
}
@Test(timeout = 4000)
public void test42() throws Throwable {
Week week0 = new Week();
Class<Day> class0 = Day.class;
TimeSeries timeSeries0 = new TimeSeries(week0, class0);
String string0 = timeSeries0.getRangeDescription();
}
@Test(timeout = 4000)
public void test43() throws Throwable {
Week week0 = new Week();
TimeSeries timeSeries0 = new TimeSeries(week0);
long long0 = timeSeries0.getMaximumItemAge();
}
@Test(timeout = 4000)
public void test44() throws Throwable {
Minute minute0 = new Minute();
TimeSeries timeSeries0 = new TimeSeries(minute0);
// Undeclared exception!
try {
timeSeries0.add((RegularTimePeriod) minute0, (Number) 59);
} catch(RuntimeException e) {
//
// You are trying to add data where the time period class is org.jfree.data.time.Minute, but the TimeSeries is expecting an instance of org.jfree.data.time.Day.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test45() throws Throwable {
Week week0 = new Week();
Class<TimeSeries> class0 = TimeSeries.class;
TimeSeries timeSeries0 = new TimeSeries(week0, class0);
timeSeries0.setRangeDescription("org.jfree.data.DefaultKeyedValue");
}
@Test(timeout = 4000)
public void test46() throws Throwable {
SimpleTimePeriod simpleTimePeriod0 = new SimpleTimePeriod(0L, 1697L);
Class<Month> class0 = Month.class;
TimeSeries timeSeries0 = new TimeSeries(simpleTimePeriod0, class0);
// Undeclared exception!
try {
timeSeries0.add((RegularTimePeriod) null, (Number) 59, false);
} catch(IllegalArgumentException e) {
//
// Null 'period' argument.
//
verifyException("org.jfree.data.time.TimeSeriesDataItem", e);
}
}
@Test(timeout = 4000)
public void test47() throws Throwable {
Day day0 = new Day();
TimeSeries timeSeries0 = new TimeSeries(day0);
Object object0 = timeSeries0.clone();
}
@Test(timeout = 4000)
public void test48() throws Throwable {
Week week0 = new Week();
Class<Day> class0 = Day.class;
TimeSeries timeSeries0 = new TimeSeries(week0, class0);
// Undeclared exception!
try {
timeSeries0.add((RegularTimePeriod) week0, (double) 53);
} catch(RuntimeException e) {
//
// You are trying to add data where the time period class is org.jfree.data.time.Week, but the TimeSeries is expecting an instance of org.jfree.data.time.Day.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test49() throws Throwable {
Second second0 = new Second();
Class<Hour> class0 = Hour.class;
TimeSeries timeSeries0 = new TimeSeries(second0, class0);
// Undeclared exception!
try {
timeSeries0.getValue(59);
} catch(IndexOutOfBoundsException e) {
//
// Index: 59, Size: 0
//
verifyException("java.util.ArrayList", e);
}
}
@Test(timeout = 4000)
public void test50() throws Throwable {
FixedMillisecond fixedMillisecond0 = new FixedMillisecond();
TimeSeries timeSeries0 = new TimeSeries(fixedMillisecond0);
// Undeclared exception!
try {
timeSeries0.getNextTimePeriod();
} catch(ArrayIndexOutOfBoundsException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test51() throws Throwable {
Day day0 = new Day();
Class<Millisecond> class0 = Millisecond.class;
TimeSeries timeSeries0 = new TimeSeries(day0, class0);
TimeSeries timeSeries1 = timeSeries0.addAndOrUpdate(timeSeries0);
}
@Test(timeout = 4000)
public void test52() throws Throwable {
Day day0 = new Day();
TimeSeries timeSeries0 = new TimeSeries(day0);
List list0 = timeSeries0.getItems();
}
@Test(timeout = 4000)
public void test53() throws Throwable {
Class<Day> class0 = Day.class;
MockDate mockDate0 = new MockDate();
ZoneOffset zoneOffset0 = ZoneOffset.ofHours(0);
TimeZone timeZone0 = TimeZone.getTimeZone((ZoneId) zoneOffset0);
RegularTimePeriod regularTimePeriod0 = RegularTimePeriod.createInstance(class0, mockDate0, timeZone0);
TimeSeries timeSeries0 = new TimeSeries(regularTimePeriod0, "X=I7,`|Ct^*X", "GFxS", class0);
TimeSeriesDataItem timeSeriesDataItem0 = timeSeries0.addOrUpdate(regularTimePeriod0, (double) 0);
}
@Test(timeout = 4000)
public void test54() throws Throwable {
XYDataItem xYDataItem0 = new XYDataItem((-341.3327553507), (-341.3327553507));
TimeSeries timeSeries0 = new TimeSeries(xYDataItem0);
int int0 = timeSeries0.getMaximumItemCount();
}
@Test(timeout = 4000)
public void test55() throws Throwable {
Day day0 = new Day();
Hour hour0 = new Hour((-2622), day0);
Class<Integer> class0 = Integer.class;
TimeSeries timeSeries0 = new TimeSeries(hour0, "3#9F.gc(L+,}I ", "3#9F.gc(L+,}I ", class0);
// Undeclared exception!
try {
timeSeries0.update((-2622), (Number) 0);
} catch(ArrayIndexOutOfBoundsException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test56() throws Throwable {
Minute minute0 = new Minute();
TimeSeries timeSeries0 = new TimeSeries(minute0);
// Undeclared exception!
try {
timeSeries0.add((TimeSeriesDataItem) null);
} catch(IllegalArgumentException e) {
//
// Null 'item' argument.
//
verifyException("org.jfree.data.time.TimeSeries", e);
}
}
@Test(timeout = 4000)
public void test57() throws Throwable {
Minute minute0 = new Minute();
TimeSeries timeSeries0 = new TimeSeries(minute0);
timeSeries0.setDomainDescription("Requires start on or before end.");
}
@Test(timeout = 4000)
public void test58() throws Throwable {
Year year0 = new Year(3858);
Class<JMenu> class0 = JMenu.class;
TimeSeries timeSeries0 = new TimeSeries(year0, "L(0os.tX=", "", class0);
String string0 = timeSeries0.getDomainDescription();
}
}
| [
"[email protected]"
] | |
0500a3cb0815417d4b3f3d5649575ffec6001d47 | de53ed844803d0e1f04eee2b2080a1a0ed330101 | /src/main/java/com/stalary/usercenter/exception/ExceptionHandle.java | ca8a8be5d46483f83aa1bc3a0183d4d396e16554 | [
"MIT"
] | permissive | stalary/UserCenter | 6a55000e08509760575a769a9adcb2ebc67c2aa7 | f803afcd7bb1fa0f871ed2e7839f00839bf82e92 | refs/heads/master | 2023-07-22T15:54:57.033686 | 2022-06-02T15:42:24 | 2022-06-02T15:42:24 | 126,578,426 | 35 | 14 | MIT | 2023-07-16T18:14:34 | 2018-03-24T08:05:08 | Java | UTF-8 | Java | false | false | 896 | java | package com.stalary.usercenter.exception;
import com.stalary.usercenter.data.dto.ResponseMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author Stalary
* @description
* @date 2018/01/04
*/
@ControllerAdvice
@Slf4j
public class ExceptionHandle {
@ExceptionHandler(value = Exception.class)
@ResponseBody
public ResponseMessage handle(Exception e) {
if (e instanceof MyException) {
MyException myException = (MyException) e;
return ResponseMessage.error(myException.getCode(), myException.getMessage());
} else {
log.error("[系统异常] {}", e);
return ResponseMessage.error(666, "运行时异常!");
}
}
}
| [
"[email protected]"
] | |
e3fba07e391e94d476cd28ebe9aa2cad25588ff5 | a7b245185c901c44b0665c6d786f4233c809fe47 | /XmSc/src/com/lsp/website/service/WebsiteService.java | 2fae5e650b043d830fe21731f254e652f43f4509 | [] | no_license | yexiecool/silver-journey | 801ee94b0bba4c4355f9eecbab96e9f33bd072d8 | 559bab22fe2a5f0515913859f64775f60e45dc16 | refs/heads/master | 2020-03-28T15:41:14.335440 | 2018-09-14T11:18:59 | 2018-09-14T11:18:59 | 148,616,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,012 | java | package com.lsp.website.service;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.lsp.pub.dao.BaseDao;
import com.lsp.pub.db.MongoSequence;
import com.lsp.pub.entity.GetAllFunc;
import com.lsp.pub.entity.PubConstants;
import com.lsp.pub.util.UniObject;
import com.lsp.user.entity.UserInfo;
import com.lsp.website.entity.Readinginfo;
import com.lsp.website.entity.WebsiteFlowInfo;
import com.mongodb.BasicDBList;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
@Component
@Transactional
public class WebsiteService {
@Autowired
private BaseDao baseDao;
/**
* 网站流量
* @param toUser
* @param type
*/
public int flow(String toUser,String type){
DBObject wwz=baseDao.getMessage(PubConstants.WEBSITEFLOW_INFO, toUser+type);
int count=1;
if(wwz!=null){
count=Integer.parseInt(wwz.get("count").toString())+1;
}
WebsiteFlowInfo flow=new WebsiteFlowInfo();
flow.set_id(toUser+type);
flow.setToUser(toUser);
flow.setType(type);
flow.setCount(count);
baseDao.insert(PubConstants.WEBSITEFLOW_INFO, flow);
return count;
}
/**
* 获取模块流量
* @param toUser
* @param type
*/
public int getFlow(String toUser,String type){
DBObject wwz=baseDao.getMessage(PubConstants.WEBSITEFLOW_INFO, toUser+type);
int count=1;
if(wwz!=null){
count=Integer.parseInt(wwz.get("count").toString());
}
return count;
}
/**
* 广告位显示
* @param toUser
* @param type
*/
public List<DBObject> advertisement(String toUser,String type){
HashMap<String, Object> sortMap =new HashMap<String, Object>();
HashMap<String, Object> whereMap =new HashMap<String, Object>();
whereMap.put("toUser", toUser);
whereMap.put("type", type);
sortMap.put("sort", 1);
List<DBObject> list=baseDao.getList(PubConstants.ADVERT_INFO,whereMap, sortMap);
return list;
}
/**
* 广告位显示
* @param toUser
* @param type
*/
public List<DBObject> advertising(String toUser,String type){
HashMap<String, Object> sortMap =new HashMap<String, Object>();
HashMap<String, Object> whereMap =new HashMap<String, Object>();
whereMap.put("toUser", toUser);
whereMap.put("type", type);
sortMap.put("sort", 1);
List<DBObject> list=baseDao.getList(PubConstants.ADVERTISEMENT,whereMap, sortMap);
return list;
}
/**
* 广告位显示
* @param toUser
* @param type
*/
public List<DBObject> slide(String toUser,String type){
HashMap<String, Object> sortMap =new HashMap<String, Object>();
HashMap<String, Object> whereMap =new HashMap<String, Object>();
whereMap.put("toUser", toUser);
whereMap.put("type", type);
sortMap.put("sort", 1);
List<DBObject> list=baseDao.getList(PubConstants.SUC_SLIDE,whereMap, sortMap);
return list;
}
/**
* 广告位显示
* @param toUser
* @param type
*/
public List<DBObject> noadvertisement(String toUser,String type){
HashMap<String, Object> sortMap =new HashMap<String, Object>();
HashMap<String, Object> whereMap =new HashMap<String, Object>();
whereMap.put("toUser", toUser);
whereMap.put("type", type);
sortMap.put("sort", 1);
List<DBObject> list=baseDao.getList(PubConstants.ADVERT_INFO,whereMap, sortMap);
return list;
}
/**
*滚动显示
* @param toUser
* @param type
*/
public List<DBObject> roll(String toUser,String type){
HashMap<String, Object> sortMap =new HashMap<String, Object>();
HashMap<String, Object> whereMap =new HashMap<String, Object>();
whereMap.put("toUser", toUser);
whereMap.put("type", type);
sortMap.put("sort", 1);
List<DBObject> list=baseDao.getList(PubConstants.ADVERT_INFO,whereMap, sortMap);
return list;
}
/**
* 广告位显示
* @param toUser
* @param type
*/
public List<DBObject> advertisement(String toUser,String type,int num){
HashMap<String, Object> sortMap =new HashMap<String, Object>();
HashMap<String, Object> whereMap =new HashMap<String, Object>();
whereMap.put("toUser", toUser);
whereMap.put("type", type);
sortMap.put("sort", 1);
List<DBObject> list=baseDao.getList(PubConstants.ADVERT_INFO,whereMap,0,num, sortMap);
if(list.size()==0){
whereMap.clear();
whereMap.put("toUser", null);
list=baseDao.getList(PubConstants.ADVERT_INFO,whereMap, sortMap);
}
return list;
}
// /**
// * 获取分享说明
// * @param toUser
// * @param type
// */
// public DBObject getShareFx(String toUser,WxToken token,String type){
//
// DBObject fx=baseDao.getMessage(PubConstants.WEIXIN_SHAREFX, toUser+"-"+type);
// if(fx==null){
// fx=new BasicDBObject();
// DBObject userdb=baseDao.getMessage(PubConstants.DATA_WXTOUSER, toUser);
// if(userdb==null){
// fx.put("fxtitle", "");
// fx.put("fxsummary", "");
// fx.put("fximg", "");
// if(token!=null){
// fx.put("fxurl", token.getUrl());
// }
//
// return fx;
// }
// if(userdb.get("title")==null){
// fx.put("fxtitle","");
// }else{
// fx.put("fxtitle", userdb.get("title"));
// }
// if(userdb.get("summary")==null){
// fx.put("fxsummary","");
// }else{
// fx.put("fxsummary", userdb.get("summary"));
// }
// if(userdb.get("bj3")==null){
// fx.put("fximg","");
// }else{
// fx.put("fximg", userdb.get("bj3"));
// }
//
// if(token!=null){
// fx.put("fxurl", token.getUrl());
// }
// return fx;
// }
// if(fx.get("fxurl")==null||StringUtils.isEmpty(fx.get("fxurl").toString())){
// if(token==null||token.getUrl()==null){
// fx.put("fxurl", "");
// }else{
// fx.put("fxurl", token.getUrl());
// }
//
// }
// if(fx.get("fxtitle")==null){
// fx.put("fxtitle", "");
//
// }
// return fx;
//
// }
/**
* 获取用户昵称
* @param toUser
* @param type
*/
public String getUserName(String fromUser){
DBObject db = baseDao.getMessage(PubConstants.USER_INFO, fromUser);
String name="游客";
if (db != null && db.get("nickname") != null) {
name=db.get("nickname").toString();
}
return name;
}
/**
* 获取是否管理员
* @param toUser
* @param type
*/
public boolean isAdmin(String fromUser,String wid){
boolean re=false;
DBObject user=baseDao.getMessage(PubConstants.USER_INFO, fromUser);
if(user.get("toUser")!=null){
re=true;
}
return re;
}
/**
* 获取是否管理员
* @param toUser
* @param type
*/
public boolean getComUser(String fromUser,String toUser,String url){
// HashMap<String, Object> whereMap =new HashMap<String, Object>();
// UserInfo commain=GetAllFunc.comToUser.get(toUser);
// if(commain==null){//主账号
// return false;
// }
// whereMap.put("comUser", fromUser);
// whereMap.put("toUser", toUser);
// if(baseDao.getCount(PubConstants.USER_INFO, whereMap)>0){
// return false;
// }
// WxToUser wxtoUser=GetAllFunc.wxTouser.get(toUser);
// if(wxtoUser.getZhlx()!=2){
// return false;
// }
// String dlurl=SysConfig.getProperty("ip")+"/wwz/wwz!combd.action?fromUser="+fromUser+"&toUser="+toUser+"&method="+URLEncoder.encode(url);
// String tzurl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+wxtoUser.getAppid()+"&redirect_uri="+URLEncoder.encode(dlurl)+"&response_type=code&scope=snsapi_base&state=123#wechat_redirect";
// Struts2Utils.getRequest().setAttribute("method", tzurl);
return true;
}
/**
* 检测会员
* @return
*/
public String getFromUser(String toUser,String fromUser){
HashMap<String, Object>whereMap=new HashMap<String, Object>();
whereMap.put("toUser", toUser);
whereMap.put("fromUser",fromUser);
DBObject db=baseDao.getMessage(PubConstants.CUSTOMER_INFO, whereMap);
if(db!=null){
return db.get("fromUser").toString();
}
return null;
}
public void getComment(){
}
public Long getReading(String toUser,String wid,String type){
String id=toUser+wid+type;
DBObject db=baseDao.getMessage(PubConstants.READING_INFO, id);
if(db!=null){
Readinginfo readinginfo=(Readinginfo) UniObject.DBObjectToObject(db, Readinginfo.class);
if(readinginfo.getCount()==null){
readinginfo.setCount(1L);
}
readinginfo.setCount(readinginfo.getCount()+1);
baseDao.insert(PubConstants.READING_INFO, readinginfo);
return readinginfo.getCount();
}else{
Readinginfo readinginfo=new Readinginfo();
readinginfo.setCount(1L);
readinginfo.set_id(id);
baseDao.insert(PubConstants.READING_INFO, readinginfo);
return readinginfo.getCount();
}
}
}
| [
"[email protected]"
] | |
cb61df3592c7b0eb517bf0970f80af91f373cb18 | a5f052021d18a40b3b7bb403f13015d252d0a05e | /src/test/java/uk/ac/ebi/ena/webin/cli/context/taxrefset/TaxRefSetManifestReaderFileSuffixTest.java | dad5778fd33c7cc2044139207ecfb94e4b3eb808 | [
"Apache-2.0"
] | permissive | ditag/webin-cli | 671f730b98b807c2c57ff77e29dd7bb73914ee7c | 0d34c7ab610bc239698a4c502fbda51f4bd68e79 | refs/heads/master | 2023-08-19T10:11:42.925305 | 2021-10-13T08:41:39 | 2021-10-13T08:41:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,988 | java | /*
* Copyright 2018-2021 EMBL - European Bioinformatics Institute
* 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 uk.ac.ebi.ena.webin.cli.context.taxrefset;
import static uk.ac.ebi.ena.webin.cli.manifest.ManifestReaderFileSuffixTester.invalid;
import static uk.ac.ebi.ena.webin.cli.manifest.ManifestReaderFileSuffixTester.valid;
import org.junit.Test;
import uk.ac.ebi.ena.webin.cli.validator.manifest.TaxRefSetManifest;
public class TaxRefSetManifestReaderFileSuffixTest {
@Test
public void testValidFileSuffix() {
Class<TaxRefSetManifestReader> manifestReader = TaxRefSetManifestReader.class;
valid(manifestReader, TaxRefSetManifest.FileType.TAB, ".tsv.gz");
valid(manifestReader, TaxRefSetManifest.FileType.TAB, ".tab.gz");
valid(manifestReader, TaxRefSetManifest.FileType.FASTA, ".fasta.gz");
valid(manifestReader, TaxRefSetManifest.FileType.FASTA, ".fa.gz");
}
@Test
public void testInvalidFileSuffix() {
Class<TaxRefSetManifestReader> manifestReader = TaxRefSetManifestReader.class;
// Invalid suffix before .gz
invalid(manifestReader, TaxRefSetManifest.FileType.TAB, ".INVALID.gz");
// No .gz
invalid(manifestReader, TaxRefSetManifest.FileType.TAB, ".tsv");
invalid(manifestReader, TaxRefSetManifest.FileType.TAB, ".tab");
invalid(manifestReader, TaxRefSetManifest.FileType.FASTA, ".txt");
invalid(manifestReader, TaxRefSetManifest.FileType.FASTA, ".fasta");
}
}
| [
"[email protected]"
] | |
acc0245659494deb350babc6fbdeaaa6fd3095d4 | 29737aeba3c338855d0fa25d1287a86efdb661ef | /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/store/WordCache.java | 2734c8ac041a09bb74deb13a05d1b89ab8a35c01 | [
"Apache-2.0"
] | permissive | Synex-wh/sofa-registry | 5642d053fe240fc417a202bcc907bb70a8c51e80 | 003e4877754f0be291603ccb265783ee09dca10f | refs/heads/master | 2020-05-01T15:49:17.937798 | 2019-08-09T08:39:45 | 2019-08-09T08:39:45 | 177,555,695 | 0 | 1 | Apache-2.0 | 2019-12-30T03:32:56 | 2019-03-25T09:33:59 | Java | UTF-8 | Java | false | false | 1,816 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.registry.common.model.store;
import java.util.concurrent.ConcurrentHashMap;
/**
*
* @author shangyu.wh
* @version $Id: WordCache.java, v 0.1 2018-11-06 12:01 shangyu.wh Exp $
*/
public class WordCache {
private static volatile WordCache instance;
/**
* get WordCache instance
* @return
*/
public static WordCache getInstance() {
if (instance == null) {
synchronized (WordCache.class) {
if (instance == null) {
instance = new WordCache();
}
}
}
return instance;
}
/**
* word cache map
*/
private ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
/**
*
* @param s
* @return String
*/
public String getWordCache(String s) {
if (s == null) {
return null;
}
String oldValue = map.putIfAbsent(s, s);
return oldValue == null ? s : oldValue;
}
} | [
"[email protected]"
] | |
0ce1c41445d78b78f5010764b4857631948ab83a | ef71b8fb3e21ce570015b20d317c35007da06ef2 | /Dbms/src/delivery.java | 7eb0f016e8c0a4332012ed15f4735407c32400ac | [] | no_license | SaiKrishnaD/DBMS | abbe8c6c153c415a3dd6ac7a37531a9dbaae08ba | 1f56b35a2af1b8795e1346b445399d05af881975 | refs/heads/main | 2023-07-15T07:22:29.298901 | 2021-08-11T15:28:45 | 2021-08-11T15:28:45 | 326,140,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,082 | java | import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
public class delivery extends JFrame
{
static JLabel l0,l1,l2,l3,l4,l5;
static JTextField t1,t2,t3,t4,t5;
static JButton b1,b2,b3,b4,b5;
static Connection con1;
delivery(Connection con)
{
delivery.con1=con;
}
void AddItems()
{
l0=new JLabel("DELIVERY AGENT DETAILS");
l1=new JLabel("Delivery ID");
l2=new JLabel("Courier ID");
l3=new JLabel("Name");
l4=new JLabel("Phone Number");
l5=new JLabel("Health Condition");
t1=new JTextField();
t2=new JTextField();
t3=new JTextField();
t4=new JTextField();
t5=new JTextField();
b1=new JButton("Insert");
b2=new JButton("Update");
b3=new JButton("Delete");
b4=new JButton("Display");
b5=new JButton("Back");
setLayout(null);
l0.setBounds(150,-20,300,100);
l1.setBounds(50,40,80,40);
l2.setBounds(50,70,120,40);
l3.setBounds(50,100,80,40);
l4.setBounds(50,130,120,40);
l5.setBounds(50,160,100,40);
t1.setBounds(250,50,160,28);
t2.setBounds(250,80,160,28);
t3.setBounds(250,110,160,28);
t4.setBounds(250,140,160,28);
t5.setBounds(250,170,160,28);
b1.setBounds(90,210,135,45);
b2.setBounds(240,210,135,45);
b3.setBounds(90,260,135,45);
b4.setBounds(240,260,135,45);
b5.setBounds(170,310,135,45);
add(l0);add(l1);add(l2);add(l3);add(l4);add(l5);
add(t1);add(t2);add(t3);add(t4);add(t5);
add(b1);add(b2);add(b3);add(b4);add(b5);
}
public static void create(delivery da)
{ //System.out.println("SAI");
// demodelivery_agent frm=new demodelivery_agent(con);
da.setTitle("Delivery Agent");
da.AddItems();
da.setVisible(true);
da.setSize(500,400);
da.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
b5.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent f)
{
da.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
});
}
} | [
"[email protected]"
] | |
f7b7c69beb36d3af7c892becd8c663261d8d26dd | 761ec7bd8bd6ddbe5ad80cfb1b0895dceddc520d | /app/src/main/java/com/hencoder/hencoderpracticedraw2/practice/Practice05ComposeShaderView.java | 47593f5e8ce68c8d63e934f9159144f043ace0c8 | [] | no_license | weiranqiaobo/paintDemo1 | af77c232536f1988da5cbbcd65dde9f14ee59e30 | cb3ba2c3a610732f04c18ad65064e033854ff5d1 | refs/heads/master | 2020-03-12T14:04:10.075514 | 2018-04-23T07:40:31 | 2018-04-23T07:40:31 | 130,658,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,988 | java | package com.hencoder.hencoderpracticedraw2.practice;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.ComposeShader;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.Shader;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import com.hencoder.hencoderpracticedraw2.R;
public class Practice05ComposeShaderView extends View {
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
Bitmap bitmap1;
Bitmap bitmap2;
public Practice05ComposeShaderView(Context context) {
this(context,null);
}
public Practice05ComposeShaderView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs,-1);
}
public Practice05ComposeShaderView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
bitmap1= BitmapFactory.decodeResource(getResources(), R.drawable.batman);
bitmap2=BitmapFactory.decodeResource(getResources(), R.drawable.batman_logo);
}
{
setLayerType(LAYER_TYPE_SOFTWARE, null); // 硬件加速下 ComposeShader 不能使用两个同类型的 Shader
// 用 Paint.setShader(shader) 设置一个 ComposeShader
// Shader 1: BitmapShader 图片:R.drawable.batman
// Shader 2: BitmapShader 图片:R.drawable.batman_logo
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Shader shader1=new BitmapShader(bitmap1, Shader.TileMode.CLAMP,Shader.TileMode.CLAMP);
Shader shader2=new BitmapShader(bitmap2, Shader.TileMode.CLAMP,Shader.TileMode.CLAMP);
Shader shader=new ComposeShader(shader1,shader2, PorterDuff.Mode.DST_IN);
paint.setShader(shader);
canvas.drawCircle(200, 200, 200, paint);
}
}
| [
"[email protected]"
] | |
44d054e188e073bf25ca4a2ea31cc080576e6e19 | 13b9ce118bf15756d2f5543c46a14a084d3a760b | /quora-api/target/generated-sources/com/upgrad/quora/api/model/SigninResponse.java | 53ff9e9126d339399c8da240ffea7d3f09090fb9 | [] | no_license | komal1204/Course-5-Group-Project | 9cccfc7fa69e4288c06fe194d45abad0d728e56e | 5dc2b1a4a99adfcb13b616f96dafb6ae8acfb80a | refs/heads/master | 2020-04-03T06:01:49.013679 | 2018-10-28T13:34:08 | 2018-10-28T13:34:08 | 154,483,598 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,555 | java | package com.upgrad.quora.api.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.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* SigninResponse
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2018-10-26T15:53:18.586+05:30")
public class SigninResponse {
@JsonProperty("id")
private String id = null;
@JsonProperty("message")
private String message = null;
public SigninResponse id(String id) {
this.id = id;
return this;
}
/**
* uuid for the user authentication after he signs in.
* @return id
**/
@ApiModelProperty(required = true, value = "uuid for the user authentication after he signs in.")
@NotNull
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public SigninResponse message(String message) {
this.message = message;
return this;
}
/**
* message to show the status of the signed in user
* @return message
**/
@ApiModelProperty(required = true, value = "message to show the status of the signed in user")
@NotNull
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SigninResponse signinResponse = (SigninResponse) o;
return Objects.equals(this.id, signinResponse.id) &&
Objects.equals(this.message, signinResponse.message);
}
@Override
public int hashCode() {
return Objects.hash(id, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SigninResponse {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
}
| [
"prerna.pardhy@gmailcom"
] | prerna.pardhy@gmailcom |
5a2180d66b8f68fed8af637907b7851d1697eda6 | fb375149f042a50c59601ed45e39a4760115c578 | /Temperature/src/ru/courses/morozov/model/TemperatureConverterK.java | 9c5730d5950fdefc4b36568cce3ffc0112914fdf | [] | no_license | Veyron154/academit | 6b0dbb3c08d5d62f5837ea93d105a85250be8455 | 29c401ae8d428ea05d6e40153fc0e9dcd2d7fb38 | refs/heads/master | 2021-01-18T21:17:03.211730 | 2016-05-15T13:59:39 | 2016-05-15T13:59:39 | 44,862,772 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | java | package ru.courses.morozov.model;
public class TemperatureConverterK implements TemperatureConverter {
private final double KELVIN_COEFFICIENT = 273.15;
public double convertFromCelsius(double inputTemperature) {
return inputTemperature + KELVIN_COEFFICIENT;
}
public double convertToCelsius(double inputTemperature) {
return inputTemperature - KELVIN_COEFFICIENT;
}
}
| [
"[email protected]"
] | |
595e44159df94980f1541ee337b79e00707fddfd | d734d40367acefd911703f38509512037e28bc39 | /Kemin Yolk Sensor/obj/Release/android/src/md56c4a981664770318148aa9fcf9f6f371/CameraStateListener.java | 2d9b0f6d4d940e58a65affa6a6a0814bb8a76e54 | [] | no_license | ayushkhare/freelance | be8ea236dda4b16a61de9f23a09022721e4a6504 | 6dda35f1e1bafd8df33c02db5d4049acc8741ee1 | refs/heads/master | 2022-12-10T10:13:04.269986 | 2020-01-23T06:39:57 | 2020-01-23T06:39:57 | 184,971,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,044 | java | package md56c4a981664770318148aa9fcf9f6f371;
public class CameraStateListener
extends android.hardware.camera2.CameraDevice.StateCallback
implements
mono.android.IGCUserPeer
{
/** @hide */
public static final String __md_methods;
static {
__md_methods =
"n_onOpened:(Landroid/hardware/camera2/CameraDevice;)V:GetOnOpened_Landroid_hardware_camera2_CameraDevice_Handler\n" +
"n_onDisconnected:(Landroid/hardware/camera2/CameraDevice;)V:GetOnDisconnected_Landroid_hardware_camera2_CameraDevice_Handler\n" +
"n_onError:(Landroid/hardware/camera2/CameraDevice;I)V:GetOnError_Landroid_hardware_camera2_CameraDevice_IHandler\n" +
"";
mono.android.Runtime.register ("Kemin_Yolk_Sensor.Listeners.CameraStateListener, Kemin Yolk Sensor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", CameraStateListener.class, __md_methods);
}
public CameraStateListener ()
{
super ();
if (getClass () == CameraStateListener.class)
mono.android.TypeManager.Activate ("Kemin_Yolk_Sensor.Listeners.CameraStateListener, Kemin Yolk Sensor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { });
}
public void onOpened (android.hardware.camera2.CameraDevice p0)
{
n_onOpened (p0);
}
private native void n_onOpened (android.hardware.camera2.CameraDevice p0);
public void onDisconnected (android.hardware.camera2.CameraDevice p0)
{
n_onDisconnected (p0);
}
private native void n_onDisconnected (android.hardware.camera2.CameraDevice p0);
public void onError (android.hardware.camera2.CameraDevice p0, int p1)
{
n_onError (p0, p1);
}
private native void n_onError (android.hardware.camera2.CameraDevice p0, int p1);
private java.util.ArrayList refList;
public void monodroidAddReference (java.lang.Object obj)
{
if (refList == null)
refList = new java.util.ArrayList ();
refList.add (obj);
}
public void monodroidClearReferences ()
{
if (refList != null)
refList.clear ();
}
}
| [
"[email protected]"
] | |
7054cd91b52102d8ca169d8f014fca6f30add050 | de5cbd15794958bbdf32018cc56018c059a8caa7 | /src/pda/datas/dames/PartieHumainvsHumain.java | ee26bcbc07f3948d4093777e7e9250b3b0023a56 | [] | no_license | maher94/Jeux-Dames-Java | 45c7f22b9aa3bd294450b083d69541c1689fd6c5 | 39bd985aa13393a5fdd85d794e1a1abe0766f132 | refs/heads/master | 2021-01-15T12:31:11.555253 | 2014-04-20T21:09:52 | 2014-04-20T21:09:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,050 | java | package pda.datas.dames;
import pda.datas.dames.exception.InvalidPlateauSizeException;
/**
* <strong>Projet IUT Vannes 2013 - Jeu de dames</strong><br>
* Cette classe représente une partie entre deux joueurs humains.<br>
* Le jeu se fait tour à tour sur la même machine.
* @author Mathieu THEBAUD
* @author Nathan VILLIOT
* @version 1.00
* @since 1.00
*/
public class PartieHumainvsHumain extends Partie{
//============================================ATTRIBUT(S)============================================
/**
* Numéro de sérialisation
*/
private static final long serialVersionUID = 1L;
//====================================================================================================
//==========================================CONSTRUCTEUR(S)==========================================
/**
* Constructeur d'une partie humain contre humain
* @param largeurPlateauP la largeur du plateau de jeux
* @param nombrePionsP le nombre de pions par joueur au lancement de la partie
* @param premierJoueurP la couleur qui doit commencer à jouer
* @param nomHumain1 le nom du joueur humain 1
* @param couleurHumain1 la couleur que le joueur humain 1 a choisi
* @param nomHumain2 le nom du joueur humain 2
* @param couleurHumain2 la couleur que le joueur humain 2 a choisi
* @throws IllegalArgumentException si les paramètres de création du plateau sont incorrects
* @throws InvalidPlateauSizeException si il y a un problème avec les joueurs
*/
public PartieHumainvsHumain(int largeurPlateauP, int nombrePionsP,int premierJoueurP,String nomHumain1,int couleurHumain1,String nomHumain2,int couleurHumain2) throws InvalidPlateauSizeException,IllegalArgumentException {
super(largeurPlateauP, nombrePionsP, premierJoueurP);
//Création joueurs
Joueur j1 = new Joueur(nomHumain1,couleurHumain1);
Joueur j2 = new Joueur(nomHumain2,couleurHumain2);
this.setJ1(j1);
this.setJ2(j2);
}
//====================================================================================================
} | [
"[email protected]"
] | |
f8743bb0ede409ef9f0d5c9ffdd9455b7c61b210 | 02010402af94f8bc6f1183a30bea9bc3137e6187 | /Chapter07/Lesson31/after/app/src/main/java/com/yokmama/learn10/chapter07/lesson31/MainActivity.java | de73dfe55ac147b07ce5714ff1a21a1f31640c82 | [
"Apache-2.0"
] | permissive | yokmama/honki_android | 9cf8468439b0bb53fa33a389e15cb1f0d3b971e8 | 932887221d1d137e747a16649137380c02058c56 | refs/heads/master | 2021-01-09T21:50:49.432576 | 2016-03-31T02:52:10 | 2016-03-31T02:52:10 | 36,923,735 | 21 | 3 | null | null | null | null | UTF-8 | Java | false | false | 5,156 | java | package com.yokmama.learn10.chapter07.lesson31;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private static final String TAG = MainActivity.class.getSimpleName();
private Toolbar mToolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Toolbarのインスタンスを取得
mToolbar = (Toolbar) findViewById(R.id.toolbar);
//ToolbarをActionbarとして設定
setSupportActionBar(mToolbar);
//Toolbarのアイコンを設定
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
//Toolbarのタイトルを設定
getSupportActionBar().setTitle("タイトル名");
//Toolbarのサブタイトルを設定
getSupportActionBar().setSubtitle("サブタイトル名");
//検索による画面呼び出しかどうか判定
if (getIntent() != null) {
if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
//検索なので検索処理を実施
doSearch(getIntent());
return;
}
}
//画面のリストを作成
updateList(null);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
//SearchViewがMenuにあるかどうか判定し、あるならSearchViewの設定を行う
SearchView searchView = null;
if (searchItem != null) {
searchView = (SearchView) searchItem.getActionView();
if (searchView != null) {
//システムからSearchManagerを取得
SearchManager searchManager = (SearchManager) MainActivity.this.getSystemService(Context.SEARCH_SERVICE);
//SearchViewに検索情報を設定
searchView.setSearchableInfo(searchManager.getSearchableInfo(MainActivity.this.getComponentName()));
//SearchViewのクローズ時の処理を設定
searchView.setOnCloseListener(new SearchView.OnCloseListener() {
@Override
public boolean onClose() {
updateList(null);
return false;
}
});
}
}
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onNewIntent(Intent intent) {
doSearch(intent);
}
/**
* 検索処理
*
* @param intent
*/
private void doSearch(Intent intent) {
String queryString = intent.getStringExtra(SearchManager.QUERY);
Log.d(TAG, "search value:" + queryString);
//画面のリストを作成
updateList(queryString);
}
/**
* パラメータに一致する画像、あるいはNULLの場合は全ての画像を一覧に追加
*
* @param searchName
*/
private void updateList(String searchName) {
Log.d(TAG, "updateList value:" + searchName);
LinearLayout contents = (LinearLayout) findViewById(R.id.contents);
//一旦全てのアイテムを削除
contents.removeAllViews();
//21個の画像をScrollViewのItemとして追加
for (int i = 1; i <= 21; i++) {
String resName = "dog" + i;
if (TextUtils.isEmpty(searchName) || resName.contains(searchName)) {
View itemView = getLayoutInflater().inflate(R.layout.scroll_item, contents, false);
ImageView imageView = (ImageView) itemView.findViewById(R.id.imageView);
TextView textView = (TextView) itemView.findViewById(R.id.textView);
//名前をTextViewに設定
textView.setText(resName);
//文字列からリソースのIDを取得
int imageId = getResources().getIdentifier(resName, "drawable", getPackageName());
//画像をImageViewに設定
imageView.setImageResource(imageId);
contents.addView(itemView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
}
}
}
}
| [
"[email protected]"
] | |
3dc3a21f9b7e5f575ec2efb5ce5e679f8636f96b | 1a1da381128602a207b83a6fcbc03f8960cdbc50 | /src/bracuclassroom/LoginForm.java | 271b8088315a3ab8f0149f0d02ad907e6c3ced44 | [] | no_license | USmaniHamza/BRACU_Classroom.github.io | 33529d38c2c15e33e5212596332ca88826fc5bf5 | 91e8619938570552df100371731708135a3f607f | refs/heads/master | 2022-11-07T01:11:14.396631 | 2020-06-14T21:38:29 | 2020-06-14T21:38:29 | 272,286,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,565 | java |
package bracuclassroom;
//import com.mysql.cj.xdevapi.Result;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
//import java.awt.*;
//import javax.swing.*;
public class LoginForm extends javax.swing.JFrame {
String userid;
String password;
public LoginForm() {
initComponents();
this.setLocationRelativeTo(null);//center form
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jPasswordField1 = new javax.swing.JPasswordField();
jButton_LOGIN = new javax.swing.JButton();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(75, 119, 190));
jLabel3.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 24)); // NOI18N
jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("BRACU Classroom");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jLabel3)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(35, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12))
);
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
jLabel4.setFont(new java.awt.Font("Yu Gothic", 0, 18)); // NOI18N
jLabel4.setForeground(new java.awt.Color(90, 150, 191));
jLabel4.setText("Password:");
jLabel5.setFont(new java.awt.Font("Yu Gothic", 0, 18)); // NOI18N
jLabel5.setForeground(new java.awt.Color(90, 150, 191));
jLabel5.setText("User ID:");
jTextField1.setBackground(new java.awt.Color(90, 150, 191));
jTextField1.setFont(new java.awt.Font("Verdana", 0, 18)); // NOI18N
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
jPasswordField1.setBackground(new java.awt.Color(90, 150, 191));
jPasswordField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jPasswordField1ActionPerformed(evt);
}
});
jButton_LOGIN.setBackground(new java.awt.Color(90, 150, 191));
jButton_LOGIN.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N
jButton_LOGIN.setText("Log in");
jButton_LOGIN.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton_LOGINActionPerformed(evt);
}
});
jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel6.setText("create a new account");
jLabel6.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jLabel6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel6MouseClicked(evt);
}
});
jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel7.setText("forgot password");
jLabel7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jLabel7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel7MouseClicked(evt);
}
});
jButton1.setBackground(new java.awt.Color(90, 150, 191));
jButton1.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N
jButton1.setText("Log in as a student");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField1)
.addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(66, 66, 66))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jButton1)
.addGap(18, 18, 18)))
.addGap(65, 65, 65)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton_LOGIN)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(15, 15, 15)))
.addGap(92, 92, 92))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(61, 61, 61)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton_LOGIN))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(jLabel6))
.addGap(24, 24, 24))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField1ActionPerformed
private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jPasswordField1ActionPerformed
private void jButton_LOGINActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_LOGINActionPerformed
PreparedStatement ps;
ResultSet rs; ///what is happening over here
String userid=jTextField1.getText();
String password=String.valueOf(jPasswordField1.getPassword());
String query="SELECT * FROM mydb.`faculty table` WHERE `userid`=? AND `password`=MD5(?)";
ResetPassword reset=new ResetPassword();
///create an object of the frame that u want the variable to be in to
try{
///verification of the userid and password for login
ps = MyConnection.getConnection().prepareStatement(query);
ps.setString(1, userid);
ps.setString(2, password);
rs = ps.executeQuery(); //kono value ashle then true or false based on the info received
System.out.println(rs);
if(rs.next()){
//result ashle
HomePageFacultyOntheGo.FacultyID=userid;// session variable is thrown
HomePageFacultyOntheGo rgf = new HomePageFacultyOntheGo();
rgf.setVisible(true);
rgf.pack();
rgf.setLocationRelativeTo(null);
this.dispose(); ///setting my sail to the homepage
rgf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JOptionPane.showMessageDialog(null,"YES faculty logged in ");
//SESSIONS left
}else{
JOptionPane.showMessageDialog(null,"Incorrect username or password");
}
}catch(SQLException ex){
Logger.getLogger(LoginForm.class.getName()).log(Level.SEVERE,null,ex);
}
}//GEN-LAST:event_jButton_LOGINActionPerformed
private void jLabel6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel6MouseClicked
Register rgf = new Register();
rgf.setVisible(true);
rgf.pack();
rgf.setLocationRelativeTo(null);
this.dispose();
rgf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}//GEN-LAST:event_jLabel6MouseClicked
private void jLabel7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel7MouseClicked
///create an object of the frame that u want the variable to be in to
ResetPassword rgf = new ResetPassword();
rgf.setVisible(true);
rgf.pack();
rgf.setLocationRelativeTo(null);
this.dispose();;
rgf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}//GEN-LAST:event_jLabel7MouseClicked
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
LoginStudent log=new LoginStudent();
log.setVisible(true);
log.pack();
log.setLocationRelativeTo(null);
this.dispose();
}//GEN-LAST:event_jButton1ActionPerformed
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LoginForm().setVisible(true);
}
});
}
// public boolean checkPreviousPass(String password)
// {
// PreparedStatement ps;
// ResultSet rs;
// boolean checkUser = false;
// String query = "SELECT * FROM mydb.`faculty table` WHERE `userid`=?";
//
// try {
// ps = MyConnection.getConnection().prepareStatement(query);
// ps.setString(1, userid);
//
// rs = ps.executeQuery();
//
// if(rs.next())
// {
// checkUser = true;
// }
// } catch (SQLException ex) {
// Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);
// }
// return checkUser;
// }
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton_LOGIN;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
70a9dfcf7435f32ab21949f980ff271a5553bebf | eb527d75147c3eac74031786e6f322fd8c07efbf | /TestPlugin/src/main/java/com/github/ysl3000/twitchapi/impl/StreamResponseImpl.java | ea8135106dcadd409a2422b14e2ce37bdd6a9d94 | [
"MIT"
] | permissive | PluginSystems/Java-Plugin-System | 7a0fb5ddee132f9ffd5751e9b9d6f4d68f11e191 | 7f1cb5eefaa4d96bb97d08cfc4477c37af3c7398 | refs/heads/master | 2021-07-13T08:49:46.847441 | 2021-06-05T14:52:47 | 2021-06-05T14:52:47 | 86,347,523 | 1 | 0 | MIT | 2021-06-05T14:52:48 | 2017-03-27T14:47:35 | Java | UTF-8 | Java | false | false | 1,280 | java | package com.github.ysl3000.twitchapi.impl;
import com.github.ysl3000.twitchapi.api.Stream;
import com.github.ysl3000.twitchapi.api.StreamResponse;
import org.apache.http.HttpResponse;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by ysl3000 on 30.12.16.
*/
public class StreamResponseImpl implements StreamResponse {
private JSONObject jsonObject;
private Stream stream = null;
private HttpResponse httpResponse;
public StreamResponseImpl(HttpResponse httpResponse) throws IOException, ParseException {
this.httpResponse = httpResponse;
if (getConnectionStatus() == 200) {
JSONParser parser = new JSONParser();
Object ob = parser.parse(new InputStreamReader(httpResponse.getEntity().getContent()));
this.jsonObject = (JSONObject) ob;
if(StreamImpl.isAvailable(jsonObject)){
this.stream = new StreamImpl(jsonObject);
}
}
}
public Stream getStream() {
return stream;
}
public int getConnectionStatus() {
return httpResponse.getStatusLine().getStatusCode();
}
}
| [
"[email protected]"
] | |
033be0e9c6314121c803d9fb5ae4cda2826d4fd8 | 9e9a8a2afd91c44acbf0b4062be90caf31a73752 | /src/main/java/com/offcn/control/GoodsController.java | 123f38a609ea1b29499445a8c4fac24a056f9d55 | [] | no_license | Manshengfeng/Web | 6e41291fa8ed04ce1ed9b9d24749fd60df99dd8d | 5b552920f30d584a21813cb66715b0747cf51739 | refs/heads/master | 2020-03-27T13:12:12.808843 | 2018-08-29T15:08:55 | 2018-08-29T15:08:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,844 | java | package com.offcn.control;
import java.io.File;
import java.util.UUID;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.alibaba.dubbo.config.annotation.Reference;
import com.offcn.po.Goods;
import com.offcn.service.GoodsService;
@Controller
@RequestMapping("/goods")
public class GoodsController {
/*@Reference*/
@Autowired
GoodsService goodsService;
/*
* 产品列表与分页Action
*/
@RequestMapping("/list")
public String list(Model model,@RequestParam(required=false,defaultValue="1") int pageNO){
int size=5;
model.addAttribute("size",size);
model.addAttribute("pageNO",pageNO);
model.addAttribute("count",goodsService.getGoodsCount());
model.addAttribute("goods", goodsService.getGoodsPager(pageNO, size));
return "goods/list";
}
/*
* 删除单个产品对象Action
*/
@RequestMapping("/delete/{id}")
public String delete(Model model,@PathVariable int id,@RequestParam(required=false,defaultValue="1") int pageNO,RedirectAttributes redirectAttributes){
if(goodsService.delete(id)>0)
{
redirectAttributes.addFlashAttribute("message", "删除成功!");
}else{
redirectAttributes.addFlashAttribute("message", "删除成功!");
}
return "redirect:/goods/list?pageNO="+pageNO;
}
/*
* 删除多个产品对象Action
*/
@RequestMapping("/deletes")
public String deletes(Model model,@RequestParam int[] id,@RequestParam(required=false,defaultValue="1") int pageNO,RedirectAttributes redirectAttributes){
//执行删除
int rows=goodsService.deletes(id);
if(rows>0)
{
redirectAttributes.addFlashAttribute("message", "删除"+rows+"行记录成功!");
}else{
redirectAttributes.addFlashAttribute("message", "删除成功!");
}
return "redirect:/goods/list?pageNO="+pageNO;
}
/*
* 添加商品
*/
@RequestMapping("/add")
public String add(Model model){
model.addAttribute("entity", new Goods());
return "goods/add";
}
/*
* 添加商品保存
*/
@RequestMapping("/addSave")
public String addSave(Model model,@ModelAttribute("entity") @Valid Goods entity,BindingResult bindingResult){
//如果模型中存在错误
if(bindingResult.hasErrors()){
model.addAttribute("entity", entity);
return "goods/add";
}else{
goodsService.insert(entity);
return "redirect:/goods/list";
}
// return "redirect:/goods/list";
}
/*
* 编辑商品
*/
@RequestMapping("/edit/{id}")
public String edit(Model model,@PathVariable int id){
model.addAttribute("entity", goodsService.getGoodsById(id));
return "goods/edit";
}
/*
* 编辑商品保存
*/
@RequestMapping("/editSave")
public String editSave(Model model,@ModelAttribute("entity") @Valid Goods entity,BindingResult bindingResult){
//如果模型中存在错误
if(bindingResult.hasErrors()){
model.addAttribute("entity", entity);
return "/goods/edit";
}else{
goodsService.update(entity);
return "redirect:list";
}
}
/**
* 上传图片
*/
@RequestMapping("/upPicture/{id}")
public String upPicture(Model model,@PathVariable int id){
model.addAttribute("entity", goodsService.getGoodsById(id));
return "goods/upfile";
}
/*
* 上传图片保存
*/
@RequestMapping("/upPictureSave/{id}")
public String upPictureSave(Model model,@PathVariable int id,MultipartFile picFile,HttpServletRequest request){
Goods entity=goodsService.getGoodsById(id);
//如果选择了文件
if(picFile!=null){
//如果文件大小不为0
if(picFile.getSize()>0){
//获得上传位置
String path=request.getServletContext().getRealPath("/images");
//生成文件名
String filename=UUID.randomUUID().toString()+picFile.getOriginalFilename().substring(picFile.getOriginalFilename().lastIndexOf("."));
File tempFile=new File(path, filename);
try {
//保存文件
picFile.transferTo(tempFile);
//更新数据
entity.setPicture(filename);
goodsService.update(entity);
//转向列表页
return "redirect:/goods/list";
} catch (Exception e) {
e.printStackTrace();
}
}
}
model.addAttribute("entity", entity);
return "goods/upfile";
}
}
| [
"[email protected]"
] | |
e77e7dbdf2b80e8b378e63f7fb60c4c088057d47 | ef28db47362d680d7928ca1d77863af944ea77f8 | /app/src/test/java/com/shareware/saregama/ExampleUnitTest.java | fc3fa2b35501aac57c3c1f41a86cca036fa50774 | [] | no_license | Parth8733/Saregama_Mobile_App | 00bd966a3033cd7ec396432a152417c2d221b9d9 | b9873ad73a0780bf30888cc95aab3faa62c3015d | refs/heads/main | 2023-08-11T03:43:05.556455 | 2021-09-17T04:44:09 | 2021-09-17T04:44:09 | 406,065,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.shareware.saregama;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
5ea600a6b4a1ed441166ba62b1432bc16a821f79 | 602110241170b12d57fa4bee28e68c62000f7033 | /src/nsbm_course_enrollment_system/AddMarks.java | fa8a89a7fc527d2ed852ed3b4c4552ebe624c028 | [] | no_license | haseeAmarathunga/Course-Enrollment-System | 65d23402da90919446e19535f936da8a6698e548 | f5c68523d7946a4e5486be3eeddbf3ab99b96ba6 | refs/heads/master | 2020-03-18T14:16:22.568581 | 2018-08-27T02:18:57 | 2018-08-27T02:18:57 | 134,839,441 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 59,755 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nsbm_course_enrollment_system;
import java.awt.Color;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
*
* @author ClashHacker
*/
public class AddMarks extends javax.swing.JFrame {
/**
* Creates new form AddMarks
*/
public AddMarks() {
initComponents();
this.getContentPane().setBackground(Color.white);
}
public Connection getConnection()
{
Connection con =null;
try {
con = DriverManager.getConnection("jdbc:mysql://localhost/nsbm","root","");
return con;
} catch (SQLException ex) {
Logger.getLogger(AddStuDetails.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(null,"Not Connected");
return null;
}
}
public void getFac(){
String fac=(String) faculty.getSelectedItem();
course.removeAllItems();
if(fac.equals("School Of Computing")){
course.addItem("Computer Science");
course.addItem("Information System");
}
else if(fac.equals("School Of Business")){
course.addItem("Business Management");
course.addItem("Business Analysis");
}
else{
course.addItem("Civil Engineering");
course.addItem("Electronic Engineering");
}
}
public void viewSub(){
subject.setText("");
String cou=(String) course.getSelectedItem();
if(sem.getSelectedItem().equals("1st")){
if(year.getSelectedItem().equals("1st")){
if (cou.equals("Computer Science")){
subject.setText("\tSubjects\n\n"
+ " CS1001 - Data Structures & Algorithm"
+ "\n CS1002 - Programming"
+ "\n CS1003 - Database"
+ "\n CS1004 - Networking"
+ "\n CS1005 - Labouratory"
+ "\n CS1006 - Computer System"
+ "\n CS1007 - Software Engineering");
}
else if (cou.equals("Information System")){
subject.setText("\tSubjects\n\n"
+ " IS1001 - Programming"
+ "\n IS1002 - System Analysis"
+ "\n IS1003 - Database"
+ "\n IS1004 - Business Studies"
+ "\n IS1005 - Labouratory"
+ "\n IS1006 - Computer System"
+ "\n IS1007 - Software Engineering");
}
else if (cou.equals("Business Management")){
subject.setText("\tSubjects\n\n" +
" BM1001 - Business Studies\n" +
" BM1002 - System Analysis\n" +
" BM1003 - Computer System\n" +
" BM1004 - Programming Concept\n" +
" BM1005 - Presentation Studies\n" +
" BM1006 - Networking\n" +
" BM1007 - Web Analysing");
}
else if (cou.equals("Business Analysis")){
subject.setText("\tSubjects\n\n" +
" BA1001 - Business Concepts\n" +
" BA1002 - System Analysis\n" +
" BA1003 - Computer System\n" +
" BA1004 - Programming Concept\n" +
" BA1005 - Presentation Studies\n" +
" BA1006 - Problem Solving\n" +
" BA1007 - Web Analysing");
}
else if (cou.equals("Civil Engineering")){
subject.setText("\tSubjects\n\n" +
" CE1001 - Statistics\n" +
" CE1002 - Matrix\n" +
" CE1003 - Computer Science\n" +
" CE1004 - Physics\n" +
" CE1005 - Mathematical Equations\n" +
" CE1006 - Relative Maths\n" +
" CE1007 - Calculus");
}
else if (cou.equals("Electronic Engineering")){
subject.setText("\tSubjects\n\n" +
" EE1001 - Statistics\n" +
" EE1002 - Matrix\n" +
" EE1003 - Computer Science\n" +
" EE1004 - Arduino\n" +
" EE1005 - Programming\n" +
" EE1006 - Networking\n" +
" EE1007 - Robotics");
}
}
else if(year.getSelectedItem().equals("2nd")){
if (cou.equals("Computer Science")){
subject.setText("\tSubjects\n\n"
+ " CS2001 - Data Structures & Algorithm II"
+ "\n CS2002 - Programming II"
+ "\n CS2003 - FCS I"
+ "\n CS2004 - Networking II"
+ "\n CS2005 - Enhancement I"
+ "\n CS2006 - Computer System II"
+ "\n CS2007 - Software Engineering II");
}
else if (cou.equals("Information System")){
subject.setText("\tSubjects\n\n"
+ " IS2001 - Business Studies II"
+ "\n IS2002 - System Analysis II"
+ "\n IS2003 - Database II"
+ "\n IS2004 - Enhancement I"
+ "\n IS2005 - Presentation Studies"
+ "\n IS2006 - Computer System II"
+ "\n IS2007 - Software Engineering II");
}
else if (cou.equals("Business Management")){
subject.setText("\tSubjects\n\n" +
" BM2001 - Business Studies II\n" +
" BM2002 - System Analysis II\n" +
" BM2003 - Charted Acounting\n" +
" BM2004 - Economics\n" +
" BM2005 - Mathematical methods\n" +
" BM2006 - Statics\n" +
" BM2007 - Web Analysing II");
}
else if (cou.equals("Business Analysis")){
subject.setText("\tSubjects\n\n" +
" BA2001 - Business Concepts II\n" +
" BA2002 - System Analysis II\n" +
" BA2003 - Computer System II\n" +
" BA2004 - Programming II\n" +
" BA2005 - Statics\n" +
" BA2006 - Mathematical Methods\n" +
" BA2007 - Web Analysing II");
}
else if (cou.equals("Civil Engineering")){
subject.setText("\tSubjects\n\n" +
" CE2001 - Relative Velocity\n" +
" CE2002 - Robotics\n" +
" CE2003 - Computer Science II\n" +
" CE2004 - Chemical\n" +
" CE2005 - Mathematical Equations II\n" +
" CE2006 - Matrix II\n" +
" CE2007 - Calculus II");
}
else if (cou.equals("Electronic Engineering")){
subject.setText("\tSubjects\n\n" +
" EE2001 - Statistics II\n" +
" EE2002 - Matrix II\n" +
" EE2003 - Computer Science II\n" +
" EE2004 - Arduino Circuits\n" +
" EE2005 - Programming\n" +
" EE2006 - Networking II\n" +
" EE2007 - Robotics II");
}
}
else if(year.getSelectedItem().equals("3rd")){
if (cou.equals("Computer Science")){
subject.setText("\tSubjects\n\n"
+ " CS3001 - Data Structures & Algorithm III"
+ "\n CS3002 - Programming III"
+ "\n CS3003 - FCS II"
+ "\n CS3004 - Networking III"
+ "\n CS3005 - Enhancement II"
+ "\n CS3006 - Game Development"
+ "\n CS3007 - Software Engineering III");
}
else if (cou.equals("Information System")){
subject.setText("\tSubjects\n\n"
+ " IS3001 - Business Studies III"
+ "\n IS3002 - System Analysis III"
+ "\n IS3003 - Database III"
+ "\n IS3004 - Enhancement II"
+ "\n IS3005 - SAD"
+ "\n IS3006 - Computer System III"
+ "\n IS3007 - Software Engineering III");
}
else if (cou.equals("Business Management")){
subject.setText("\tSubjects\n\n" +
" BM3001 - Business Studies III\n" +
" BM3002 - System Analysis III\n" +
" BM3003 - Charted Acounting II\n" +
" BM3004 - Economics II\n" +
" BM3005 - Mathematical methods II\n" +
" BM3006 - Statics II\n" +
" BM3007 - Web Analysing III");
}
else if (cou.equals("Business Analysis")){
subject.setText("\tSubjects\n\n" +
" BA3001 - Business Concepts III\n" +
" BA3002 - System Analysis III\n" +
" BA3003 - Computer System III\n" +
" BA3004 - Programming III\n" +
" BA3005 - Statics II\n" +
" BA3006 - Mathematical Methods II\n" +
" BA3007 - Web Analysing III");
}
else if (cou.equals("Civil Engineering")){
subject.setText("\tSubjects\n\n" +
" CE3001 - Relative Velocity II\n" +
" CE3002 - Robotics II\n" +
" CE3003 - Computer Science III\n" +
" CE3004 - Chemical II\n" +
" CE3005 - Mathematical Equations III\n" +
" CE3006 - Matrix III\n" +
" CE3007 - Differentation");
}
else if (cou.equals("Electronic Engineering")){
subject.setText("\tSubjects\n\n" +
" EE3001 - Statistics III\n" +
" EE3002 - Matrix III\n" +
" EE3003 - Computer Science III\n" +
" EE3004 - Arduino Circuits II\n" +
" EE3005 - Programming II\n" +
" EE3006 - Electrone\n" +
" EE3007 - Differentation");
}
}
}
else if(sem.getSelectedItem().equals("2nd")){
if(year.getSelectedItem().equals("1st")){
if (cou.equals("Computer Science")){
subject.setText("\tSubjects\n\n"
+ " CS1008 - Data Structures & Algorithm II"
+ "\n CS1009 - Programming II"
+ "\n CS1010 - Database II"
+ "\n CS1011 - Networking II"
+ "\n CS1012 - Labouratory II"
+ "\n CS1013 - Computer System II"
+ "\n CS1001 - Software Engineering II");
}
else if (cou.equals("Information System")){
subject.setText("\tSubjects\n\n"
+ " IS1008 - Programming II"
+ "\n IS1009 - System Analysis II"
+ "\n IS1010 - Database II"
+ "\n IS1011 - Business Studies II"
+ "\n IS1012 - Labouratory II"
+ "\n IS1013 - Computer System II"
+ "\n IS1014 - Software Engineering II");
}
else if (cou.equals("Business Management")){
subject.setText("\tSubjects\n\n" +
" BM1008 - Business Studies II\n" +
" BM1009 - System Analysis II\n" +
" BM1010 - Computer System II\n" +
" BM1011 - Programming Concept II\n" +
" BM1012 - Presentation Studies II\n" +
" BM1013 - Networking II\n" +
" BM1014 - Web Analysing II");
}
else if (cou.equals("Business Analysis")){
subject.setText("\tSubjects\n\n" +
" BA1008 - Business Concepts II\n" +
" BA1009 - System Analysis II\n" +
" BA1010 - Computer System II\n" +
" BA1011 - Programming Concept II\n" +
" BA1012 - Presentation Studies II\n" +
" BA1013 - Problem Solving II\n" +
" BA1014 - Web Analysing II");
}
else if (cou.equals("Civil Engineering")){
subject.setText("\tSubjects\n\n" +
" CE1008 - Statistics II\n" +
" CE1009 - Matrix II\n" +
" CE1010 - Computer Science II\n" +
" CE1011 - Physics II\n" +
" CE1012 - Mathematical Equations II\n" +
" CE1013 - Relative Maths II\n" +
" CE1014 - Calculus II");
}
else if (cou.equals("Electronic Engineering")){
subject.setText("\tSubjects\n\n" +
" EE1009 - Statistics II\n" +
" EE1010 - Matrix II\n" +
" EE1011 - Computer Science II\n" +
" EE1012 - Arduino II\n" +
" EE1013 - Programming II\n" +
" EE1014 - Networking II\n" +
" EE1015 - Robotics II");
}
}
else if(year.getSelectedItem().equals("2nd")){
if (cou.equals("Computer Science")){
subject.setText("\tSubjects\n\n"
+ " CS2008 - Data Structures & Algorithm III"
+ "\n CS2009 - Programming III"
+ "\n CS2010 - FCS II"
+ "\n CS2011 - Networking III"
+ "\n CS2012 - Enhancement II"
+ "\n CS2013 - Computer System III"
+ "\n CS2014 - Software Engineering III");
}
else if (cou.equals("Information System")){
subject.setText("\tSubjects\n\n"
+ " IS2001 - Business Studies III"
+ "\n IS2009 - System Analysis III"
+ "\n IS2010 - Database III"
+ "\n IS2011 - Enhancement II"
+ "\n IS2012 - Presentation Studies"
+ "\n IS2013 - Computer System III"
+ "\n IS2014 - Software Engineering III");
}
else if (cou.equals("Business Management")){
subject.setText("\tSubjects\n\n" +
" BM2008 - Business Studies III\n" +
" BM2009 - System Analysis III\n" +
" BM2010 - Charted Acounting II\n" +
" BM2011 - Economics II\n" +
" BM2012 - Mathematical methods II\n" +
" BM2013 - Statics II\n" +
" BM2014 - Web Analysing III");
}
else if (cou.equals("Business Analysis")){
subject.setText("\tSubjects\n\n" +
" BA2008 - Business Concepts III\n" +
" BA2009 - System Analysis III\n" +
" BA2010 - Computer System III\n" +
" BA2011 - Programming III\n" +
" BA2012 - Statics II\n" +
" BA2013 - Mathematical Methods II\n" +
" BA2014 - Web Analysing III");
}
else if (cou.equals("Civil Engineering")){
subject.setText("\tSubjects\n\n" +
" CE2008 - Relative Velocity II\n" +
" CE2009 - Robotics II\n" +
" CE2010 - Computer Science III\n" +
" CE2011 - Chemical II\n" +
" CE2012 - Mathematical Equations III\n" +
" CE2013 - Matrix III\n" +
" CE2014 - Calculus III");
}
else if (cou.equals("Electronic Engineering")){
subject.setText("\tSubjects\n\n" +
" EE2009 - Statistics III\n" +
" EE2010 - Matrix III\n" +
" EE2011 - Computer Science III\n" +
" EE2012 - Arduino Circuits II\n" +
" EE2013 - Programming II\n" +
" EE2014 - Networking III\n" +
" EE2015 - Robotics III");
}
}
else if(year.getSelectedItem().equals("3rd")){
if (cou.equals("Computer Science")){
subject.setText("\tSubjects\n\n"
+ " CS3008 - Data Structures & Algorithm IV"
+ "\n CS3009 - Programming IV"
+ "\n CS3010 - FCS III"
+ "\n CS3011 - Networking IV"
+ "\n CS3012 - Enhancement III"
+ "\n CS3013 - Game Development II"
+ "\n CS3014 - Software Engineering IV");
}
else if (cou.equals("Information System")){
subject.setText("\tSubjects\n\n"
+ " IS3008 - Business Studies IV"
+ "\n IS3009 - System Analysis IV"
+ "\n IS3010 - Database IV"
+ "\n IS3011 - Enhancement III"
+ "\n IS3012 - SAD II"
+ "\n IS3013 - Computer System IV"
+ "\n IS3014 - Software Engineering IV");
}
else if (cou.equals("Business Management")){
subject.setText("\tSubjects\n\n" +
" BM3008 - Business Studies IV\n" +
" BM3009 - System Analysis IV\n" +
" BM3010 - Charted Acounting III\n" +
" BM3011 - Economics III\n" +
" BM3012 - Mathematical methods III\n" +
" BM3013 - Statics III\n" +
" BM3014 - Web Analysing IV");
}
else if (cou.equals("Business Analysis")){
subject.setText("\tSubjects\n\n" +
" BA3008 - Business Concepts IV\n" +
" BA3009 - System Analysis IV\n" +
" BA3010 - Computer System IV\n" +
" BA3011 - Programming IV\n" +
" BA3012 - Statics III\n" +
" BA3013 - Mathematical Methods III\n" +
" BA3014 - Web Analysing IV");
}
else if (cou.equals("Civil Engineering")){
subject.setText("\tSubjects\n\n" +
" CE3008 - Relative Velocity III\n" +
" CE3009 - Robotics III\n" +
" CE3010 - Computer Science IV\n" +
" CE3011 - Chemical III\n" +
" CE3012 - Mathematical Equations IV\n" +
" CE3013 - Matrix IV\n" +
" CE3014 - Differentation");
}
else if (cou.equals("Electronic Engineering")){
subject.setText("\tSubjects\n\n" +
" EE3008 - Statistics IV\n" +
" EE3009 - Matrix IV\n" +
" EE3010 - Computer Science IV\n" +
" EE3011 - Arduino Circuits III\n" +
" EE3012 - Programming III\n" +
" EE3013 - Electrone II\n" +
" EE3014 - Differentation II");
}
}
}
}
public void getStuId()
{
String ac="";
if(year.getSelectedItem().equals("1st")){
ac="2018";
}
if(year.getSelectedItem().equals("2nd")){
ac="2017";
}
if(year.getSelectedItem().equals("3rd")){
ac="2016";
}
String cou=(String) course.getSelectedItem();
if(cou.equals("Computer Science")){
stu_id.setText(ac+"/CS/");
}
else if(cou.equals("Information System")){
stu_id.setText(ac+"/IS/");
}
else if(cou.equals("Business Management")){
stu_id.setText(ac+"/BM/");
}
else if(cou.equals("Business Analysis")){
stu_id.setText(ac+"/BA/");
}
else if(cou.equals("Civil Engineering")){
stu_id.setText(ac+"/CE/");
}
else if(cou.equals("Electronic Engineering")){
stu_id.setText(ac+"/EE/");
}
}
public void loadSub(){
String stuId=stu_id.getText();
Connection con=getConnection();
PreparedStatement ps=null;
ResultSet res=null;
sub.removeAllItems();
String yea=(String) year.getSelectedItem();
String seme=(String) sem.getSelectedItem();
if(!stuId.equals("")){
try {
ps = con.prepareStatement("Select Sub1,Sub2,Sub3,Sub4 from subjectssem1 WHERE Stu_id='"+stuId+"' AND Year='"+
yea+"' AND sem='"+seme+"'");
res=ps.executeQuery();
while(res.next()){
sub.addItem(res.getString(1));
sub.addItem(res.getString(2));
sub.addItem(res.getString(3));
sub.addItem(res.getString(4));
}
res.close();
} catch (SQLException ex) {
Logger.getLogger(ViewDetails.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
public void ClickMarks(){
String stuId=stu_id.getText();
String Stmark=marks.getText();
Float mark=Float.parseFloat(Stmark);
PreparedStatement ps=null;
String subj=(String) sub.getSelectedItem();
if (!(agree.isSelected())){
JOptionPane.showMessageDialog(null, "Please agree.");
}
else{
Connection con=getConnection();
try {
//Set database names from Year and Sem
String db="";
if(year.getSelectedItem().equals("1st") && sem.getSelectedItem().equals("1st")){
db="11";
}
else if(year.getSelectedItem().equals("1st") && sem.getSelectedItem().equals("2nd")){
db="12";
}
else if(year.getSelectedItem().equals("2nd") && sem.getSelectedItem().equals("1st")){
db="21";
}
else if(year.getSelectedItem().equals("2nd") && sem.getSelectedItem().equals("2nd")){
db="22";
}
else if(year.getSelectedItem().equals("3rd") && sem.getSelectedItem().equals("1st")){
db="31";
}
else if(year.getSelectedItem().equals("3rd") && sem.getSelectedItem().equals("2nd")){
db="32";
}
//---end
if (course.getSelectedItem().equals("Computer Science")){
ps = con.prepareStatement("UPDATE markscs"+db+" SET "+subj+"="+mark+" WHERE Stu_id='"+stuId+"'");
}
else if (course.getSelectedItem().equals("Information System")){
ps = con.prepareStatement("UPDATE marksis"+db+" SET "+subj+"="+mark+" WHERE Stu_id='"+stuId+"'");
}
else if (course.getSelectedItem().equals("Business Management")){
ps = con.prepareStatement("UPDATE marksbm"+db+" SET "+subj+"="+mark+" WHERE Stu_id='"+stuId+"'");
}
else if (course.getSelectedItem().equals("Business Analysis")){
ps = con.prepareStatement("UPDATE marksba"+db+" SET "+subj+"="+mark+" WHERE Stu_id='"+stuId+"'");
}
else if (course.getSelectedItem().equals("Civil Engineering")){
ps = con.prepareStatement("UPDATE marksce"+db+" SET "+subj+"="+mark+" WHERE Stu_id='"+stuId+"'");
}
else if (course.getSelectedItem().equals("Electronic Engineering")){
ps = con.prepareStatement("UPDATE marksee"+db+" SET "+subj+"="+mark+" WHERE Stu_id='"+stuId+"'");
}
//ps= con.prepareStatement("Insert INTO markscs11("+subj+") VALUES(?) WHERE Stu_id='"+stuId+"'");
//System.out.println(ps);
//ps.setFloat(1, mark);
try{
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Marks Added Succesfully.");
//clear();
}catch(Exception e){
JOptionPane.showMessageDialog(null,"Something went wrong.");
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null,ex);
}
}
}
/**
* 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() {
jPanel2 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
subject = new javax.swing.JTextArea();
sub = new javax.swing.JComboBox<>();
jLabel12 = new javax.swing.JLabel();
agree = new javax.swing.JCheckBox();
exit = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel4 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
adds = new javax.swing.JLabel();
year = new javax.swing.JComboBox<>();
yea = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
course = new javax.swing.JComboBox<>();
stu_id = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
faculty = new javax.swing.JComboBox<>();
jLabel11 = new javax.swing.JLabel();
addMarks = new javax.swing.JButton();
marks = new javax.swing.JTextField();
jLabel13 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel16 = new javax.swing.JLabel();
jLabel20 = new javax.swing.JLabel();
sem = new javax.swing.JComboBox<>();
yea1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setResizable(false);
jPanel2.setBackground(new java.awt.Color(44, 62, 80));
jPanel2.setToolTipText("");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 10, Short.MAX_VALUE)
);
subject.setEditable(false);
subject.setBackground(new java.awt.Color(255, 255, 210));
subject.setColumns(20);
subject.setFont(new java.awt.Font("Monospaced", 0, 18)); // NOI18N
subject.setRows(5);
subject.setBorder(null);
jScrollPane3.setViewportView(subject);
sub.setBackground(new java.awt.Color(153, 153, 255));
sub.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
sub.setForeground(new java.awt.Color(255, 255, 255));
sub.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
subMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
subMouseEntered(evt);
}
});
sub.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
subActionPerformed(evt);
}
});
jLabel12.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel12.setForeground(new java.awt.Color(102, 102, 102));
jLabel12.setText("SUB :");
agree.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
agree.setText("I agree above Marks are Correct.");
agree.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
agreeActionPerformed(evt);
}
});
exit.setBackground(new java.awt.Color(255, 51, 51));
exit.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
exit.setForeground(new java.awt.Color(255, 255, 255));
exit.setText("Exit");
exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitActionPerformed(evt);
}
});
jPanel1.setBackground(new java.awt.Color(44, 62, 80));
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setText("ADD Marks");
jPanel4.setBackground(new java.awt.Color(44, 62, 80));
jPanel4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel4MouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
jPanel4MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
jPanel4MouseExited(evt);
}
});
jLabel2.setBackground(new java.awt.Color(255, 255, 255));
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel2.setForeground(new java.awt.Color(255, 255, 255));
jLabel2.setText("< BACK");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap(19, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(23, 23, 23))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
adds.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbm_course_enrollment_system/Images/add marks.png"))); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(36, 36, 36)
.addComponent(adds, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 574, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(adds, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
year.setBackground(new java.awt.Color(153, 153, 255));
year.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
year.setForeground(new java.awt.Color(255, 255, 255));
year.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "1st", "2nd", "3rd" }));
year.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
yearMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
yearMouseEntered(evt);
}
});
year.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
yearActionPerformed(evt);
}
});
yea.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
yea.setForeground(new java.awt.Color(102, 102, 102));
yea.setText("Semester :");
jLabel10.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel10.setForeground(new java.awt.Color(102, 102, 102));
jLabel10.setText("Course :");
course.setBackground(new java.awt.Color(153, 153, 255));
course.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
course.setForeground(new java.awt.Color(255, 255, 255));
course.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Business Management", "Business Analysis" }));
course.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
courseMouseClicked(evt);
}
});
course.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
courseActionPerformed(evt);
}
});
stu_id.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
stu_id.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
stu_idMouseClicked(evt);
}
});
jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel4.setForeground(new java.awt.Color(102, 102, 102));
jLabel4.setText("Stu_ID :");
faculty.setBackground(new java.awt.Color(153, 153, 255));
faculty.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
faculty.setForeground(new java.awt.Color(255, 255, 255));
faculty.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "School Of Business", "School Of Computing", "School Of Engineering" }));
faculty.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
facultyMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
facultyMouseEntered(evt);
}
});
faculty.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
facultyActionPerformed(evt);
}
});
jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel11.setForeground(new java.awt.Color(102, 102, 102));
jLabel11.setText("Faculty :");
addMarks.setBackground(new java.awt.Color(44, 62, 80));
addMarks.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
addMarks.setForeground(new java.awt.Color(255, 255, 255));
addMarks.setText("Add Mark");
addMarks.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addMarksActionPerformed(evt);
}
});
marks.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
marks.setHorizontalAlignment(javax.swing.JTextField.CENTER);
jLabel13.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel13.setForeground(new java.awt.Color(44, 62, 80));
jLabel13.setText("Mark :");
jPanel3.setBackground(new java.awt.Color(255, 255, 210));
jPanel3.setToolTipText("");
jLabel16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbm_course_enrollment_system/Images/nsbmla.png"))); // NOI18N
jLabel20.setText("© 2018 Hasitha Amarathunga");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(41, 41, 41)
.addComponent(jLabel20)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(165, 165, 165)
.addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel20)
.addContainerGap())
);
sem.setBackground(new java.awt.Color(153, 153, 255));
sem.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
sem.setForeground(new java.awt.Color(255, 255, 255));
sem.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "1st", "2nd" }));
sem.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
semMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
semMouseEntered(evt);
}
});
sem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
semActionPerformed(evt);
}
});
yea1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
yea1.setForeground(new java.awt.Color(102, 102, 102));
yea1.setText("Year :");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel11)
.addComponent(yea))
.addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(yea1, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(course, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(year, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(faculty, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sem, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(stu_id, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(19, 19, 19))
.addGroup(layout.createSequentialGroup()
.addGap(16, 16, 16)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel12)
.addComponent(jLabel13))
.addGap(69, 69, 69)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sub, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(marks, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 466, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(exit, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(28, 28, 28)
.addComponent(addMarks, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(agree))
.addGap(358, 358, 358))))
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(17, 17, 17)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(year, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(yea1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(sem, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(7, 7, 7)
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(faculty, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(course, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(stu_id, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addComponent(yea, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sub, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(marks, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 5, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(agree)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(addMarks, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(2, 2, 2)
.addComponent(exit, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1))
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 0, 0)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void subMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_subMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_subMouseClicked
private void subActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_subActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_subActionPerformed
private void agreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_agreeActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_agreeActionPerformed
private void exitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitActionPerformed
// TODO add your handling code here:
System.exit(0);
}//GEN-LAST:event_exitActionPerformed
private void jPanel4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel4MouseClicked
// TODO add your handling code here:
new Student().show();
this.setVisible(false);
}//GEN-LAST:event_jPanel4MouseClicked
private void jPanel4MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel4MouseEntered
// TODO add your handling code here:
setColor(jPanel4);
}//GEN-LAST:event_jPanel4MouseEntered
private void jPanel4MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel4MouseExited
// TODO add your handling code here:
resetColor(jPanel4);
}//GEN-LAST:event_jPanel4MouseExited
private void yearMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_yearMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_yearMouseClicked
private void yearMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_yearMouseEntered
// TODO add your handling code here:
}//GEN-LAST:event_yearMouseEntered
private void yearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yearActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_yearActionPerformed
private void courseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_courseMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_courseMouseClicked
private void courseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_courseActionPerformed
// TODO add your handling code here:
try{
viewSub();
}catch(Exception e){
}
}//GEN-LAST:event_courseActionPerformed
private void stu_idMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_stu_idMouseClicked
// TODO add your handling code here:
try{
getStuId();
//SelectedSub();
}catch(Exception e){
}
}//GEN-LAST:event_stu_idMouseClicked
private void facultyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_facultyMouseClicked
// TODO add your handling code here:
try{
getFac();
}catch(Exception e){
}
}//GEN-LAST:event_facultyMouseClicked
private void facultyMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_facultyMouseEntered
// TODO add your handling code here:
}//GEN-LAST:event_facultyMouseEntered
private void facultyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_facultyActionPerformed
// TODO add your handling code here:
String fac=(String) faculty.getSelectedItem();
course.removeAllItems();
if(fac.equals("School Of Computing")){
course.addItem("Computer Science");
course.addItem("Information System");
}
else if(fac.equals("School Of Business")){
course.addItem("Business Management");
course.addItem("Business Analysis");
}
else{
course.addItem("Civil Engineering");
course.addItem("Electronic Engineering");
}
}//GEN-LAST:event_facultyActionPerformed
private void addMarksActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addMarksActionPerformed
// TODO add your handling code here:
//System.out.println(checkInput
try{
ClickMarks();
}catch(Exception e){
JOptionPane.showMessageDialog(null,"Something went wrong");
}
}//GEN-LAST:event_addMarksActionPerformed
private void subMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_subMouseEntered
// TODO add your handling code here
loadSub();
}//GEN-LAST:event_subMouseEntered
private void semMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_semMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_semMouseClicked
private void semMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_semMouseEntered
// TODO add your handling code here:
}//GEN-LAST:event_semMouseEntered
private void semActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_semActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_semActionPerformed
public void setColor(JPanel panel){
panel.setBackground(new java.awt.Color(44,100,98));
}
public void resetColor(JPanel panel){
panel.setBackground(new java.awt.Color(44,62,80));
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(AddMarks.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(AddMarks.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(AddMarks.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(AddMarks.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new AddMarks().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton addMarks;
private javax.swing.JLabel adds;
private javax.swing.JCheckBox agree;
private javax.swing.JComboBox<String> course;
private javax.swing.JButton exit;
private javax.swing.JComboBox<String> faculty;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JTextField marks;
private javax.swing.JComboBox<String> sem;
private javax.swing.JTextField stu_id;
private javax.swing.JComboBox<String> sub;
private javax.swing.JTextArea subject;
private javax.swing.JLabel yea;
private javax.swing.JLabel yea1;
private javax.swing.JComboBox<String> year;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
da5bc019287ce43c2cb0b6780b69515d654736f8 | 2c38378de8fb0f08a9a8e7ec4297593709ab16e6 | /src/arrayList/PositionOfParticularElement.java | eff8b6097721d27fd84c01b0ff0fba7819a573b8 | [] | no_license | loke4042/Java-Collections | 28da6df04c1faf495f8b882703d91d9ce016827d | 3961ea82bf639fddd1784253333afd3ebe57e4d9 | refs/heads/master | 2020-07-28T08:02:37.315293 | 2019-09-18T16:50:50 | 2019-09-18T16:50:50 | 209,349,884 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 916 | java | package arrayList;
import java.util.ArrayList;
public class PositionOfParticularElement {
public static void main(String[] args) {
ArrayList<String> list = new ArrayList<String>(3);
list.add("Lokesh");
list.add("subhash");
list.add("shayam");
list.add("sai");
list.add("Lokesh");
indexof(list,"subhash");
lastindexof(list,"Lokesh");
}
//indexOf()
public static void indexof(ArrayList<String> l,String element) {
int index = l.indexOf(element);
if(index>=1) {
System.out.println("index of the given element :"+index);
}
else System.out.println("List doesnt contain the given element");
}
//lastindexOf()
public static void lastindexof(ArrayList<String> l,String element) {
int index = l.lastIndexOf(element);
if(index>=1) {
System.out.println("index of the given element :"+index);
}
else System.out.println("List doesnt contain the given element");
}
}
| [
"[email protected]"
] | |
a20270233ce29fe2df0dfb58061e79f2fce9d278 | 7653e008384de73b57411b7748dab52b561d51e6 | /SrcLogin/dwo/dao/queries/Account.java | 125537e664442a5b33793119725e0a35e58d69b6 | [] | 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 | 460 | java | package dwo.dao.queries;
/**
* @author Yorie
* Date: 17.03.12
*/
public class Account
{
public static final String ACCOUNT_EXISTS = "SELECT COUNT(*) FROM `accounts` WHERE `login` = ? LIMIT 1";
public static final String ADD_ACCOUNT = "INSERT INTO `accounts` (`login`, `password`, `lastactive`, `accessLevel`, `lastIP`) VALUES (?,?,?,?,?)";
public static final String CHANGE_PASSWORD = "UPDATE `accounts` SET `password` = ? WHERE `login` = ?";
}
| [
"[email protected]"
] | |
4529a0ae713f0f99225b7c677eb221d151114d9d | ccf468c66c8950d327697e8960c41949f4699447 | /Part2/src/TetrisL2.java | 1c1bc5995b636fd962b248b7112542866e39ad3e | [] | no_license | nikkiwei/Tetris_Game | 39d7cc379dc882d3168a5287731a6011314a79a6 | f9b1ec0704624218ad7ef591841e44a5e800aada | refs/heads/master | 2020-03-31T18:54:11.050349 | 2018-10-10T19:42:04 | 2018-10-10T19:42:04 | 152,477,323 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 910 | java | /**
* TetrisL2 represents Tetris L shape.
*
* @author Nikki Wei
* @version 1
*/
public class TetrisL2 extends TetrisPiece {
/**
* Constructor for L-shaped tetris piece
*/
public TetrisL2() {
super();
// the state of 0 degree rotation
filledSquares[0][0][0] = true;
filledSquares[0][1][0] = true;
filledSquares[0][0][1] = true;
filledSquares[0][0][2] = true;
// the state of 90 degree rotation
filledSquares[1][0][0] = true;
filledSquares[1][0][1] = true;
filledSquares[1][1][1] = true;
filledSquares[1][2][1] = true;
// the state of 180 degree rotation
filledSquares[2][1][0] = true;
filledSquares[2][1][1] = true;
filledSquares[2][0][2] = true;
filledSquares[2][1][2] = true;
// the state of 270 degree rotation
filledSquares[3][0][0] = true;
filledSquares[3][1][0] = true;
filledSquares[3][2][1] = true;
filledSquares[3][2][0] = true;
}
}
| [
"[email protected]"
] | |
b6bc2427b15fa6fe7e1f2fd12cc7f26e73810065 | 4ae6ed2d1b8add1a526b918bf63f161d511f4774 | /src/test/java/com/exorath/service/treasurehunt/dynamodb/LocalDynamoDBCreationRule.java | ca5c188011223e2ce1712ce36d5a374633dd975f | [
"Apache-2.0"
] | permissive | Exorath/TreasureHuntService | 3603abd5c0c299b0ee8040cbce652ae6dccc4e92 | fa57f99ab2f1180b0a29d6cc62acd16ec1a96186 | refs/heads/master | 2021-01-13T05:48:53.685048 | 2016-11-08T18:34:53 | 2016-11-08T18:34:53 | 72,551,991 | 1 | 0 | null | 2016-11-05T00:45:26 | 2016-11-01T15:56:28 | Java | UTF-8 | Java | false | false | 2,546 | java | /*
* Copyright 2016 Exorath
*
* 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.exorath.service.treasurehunt.dynamodb;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.dynamodbv2.local.main.ServerRunner;
import com.amazonaws.services.dynamodbv2.local.server.DynamoDBProxyServer;
import org.junit.rules.ExternalResource;
import java.io.IOException;
import java.net.ServerSocket;
/**
* Creates a local DynamoDB instance for testing.
* See http://stackoverflow.com/a/37780083/1807588
*/
public class LocalDynamoDBCreationRule extends ExternalResource {
private DynamoDBProxyServer server;
private AmazonDynamoDB amazonDynamoDB;
public LocalDynamoDBCreationRule() {
// This one should be copied during test-compile time. If project's basedir does not contains a folder
// named 'native-libs' please try '$ mvn clean install' from command line first
System.setProperty("sqlite4java.library.path", "native-libs");
}
@Override
protected void before() throws Throwable {
try {
final String port = getAvailablePort();
this.server = ServerRunner.createServerFromCommandLineArgs(new String[]{"-inMemory", "-port", port});
server.start();
amazonDynamoDB = new AmazonDynamoDBClient(new BasicAWSCredentials("access", "secret"));
amazonDynamoDB.setEndpoint("http://localhost:" + port);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
protected void after() {
if (server != null) {
try {
server.stop();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
public AmazonDynamoDB getAmazonDynamoDB() {
return amazonDynamoDB;
}
private String getAvailablePort() {
try (final ServerSocket serverSocket = new ServerSocket(0)) {
return String.valueOf(serverSocket.getLocalPort());
} catch (IOException e) {
throw new RuntimeException("Available port was not found", e);
}
}
}
| [
"[email protected]"
] | |
948856329c835a8e7a731434aa9ba4f8f336e3c8 | a384f6eb040456114ab389b030434106f0dcfd8a | /src/main/java/com/bishe/tmp/ApplyUsers.java | 401b8e13204bb7f1d727941650246875c659b9d8 | [] | no_license | Pissssofshit/bishe | dd5a78f5f2afbe204fcd8e5484db8f25fd65b800 | b0f0734f2d2bfcc9c63210be612e57ab40469abd | refs/heads/master | 2020-04-27T23:28:59.127661 | 2019-05-17T22:52:02 | 2019-05-17T22:52:02 | 174,778,068 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 937 | java | package com.bishe.tmp;
import com.bishe.model.Friendships;
import com.bishe.model.Groups;
import com.bishe.model.GroupsUsers;
import com.bishe.model.User;
public class ApplyUsers {
public User user;
public Friendships friendships;
public GroupsUsers groupsUsers;
public Groups groups;
public Groups getGroups() {
return groups;
}
public void setGroups(Groups groups) {
this.groups = groups;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Friendships getFriendships() {
return friendships;
}
public void setFriendships(Friendships friendships) {
this.friendships = friendships;
}
public GroupsUsers getGroupsUsers() {
return groupsUsers;
}
public void setGroupsUsers(GroupsUsers groupsUsers) {
this.groupsUsers = groupsUsers;
}
}
| [
"[email protected]"
] | |
2b40e5bad23df474e15e8325724c36fe9d20f50d | bd12d1aa48d21952d7ad004059a093f10e8426bf | /Main7568.java | 1fdfb0a8745ef4463d689ae0a3d920934fa3de05 | [] | no_license | Nahyun-K/Baekjoon | 009f622bed201d43515a017e071e813713680c31 | 08e11bbe581a60d0b5a5c4c97e89bb9a3e66faa2 | refs/heads/main | 2023-07-05T09:27:46.243796 | 2021-08-28T11:22:30 | 2021-08-28T11:22:30 | 345,337,581 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 668 | java | import java.util.Scanner;
public class Main7568 {
public static void main(String[] args) {
// 몸무게 x kg
// 키 y cm
Scanner sc = new Scanner(System.in);
int T = sc.nextInt(); // Test case
int[][] big = new int[T][2];
for(int i=0; i<T; i++) {
for(int j=0; j < 2; j++) {
big[i][j] = sc.nextInt();
}
}
int[] sum = new int[T];
for(int i=0; i<T; i++) {
for(int j = 0; j < T; j++) {
if(big[i][0] > big[j][0]) {
if(big[i][1] > big[j][1]) {
sum[i]++;
}
}else {
}
}
System.out.print(sum[i] + " "); // 제일 큰 수 덩치 큰 사람
}
}
}
| [
"[email protected]"
] | |
bd3df9a32e3118bb9df8f072667b8fb7b3b0d041 | 5479e441b1430b5301298119b3ad637b5e9a9a9a | /openapi-sdk-message/src/main/java/com/yiji/openapi/message/common/core/info/GrQueryRecordResultInfo.java | 39a4e993df9d9d6c3ee4c6282fa41692ebacfec3 | [] | no_license | weichk/yiji-sdk | 4e3c0252a10eec91c6f14220994e9be903b68317 | 7715e3feabb3aef32ea8ee0103cafa774204d928 | refs/heads/master | 2022-12-22T12:47:16.898108 | 2019-06-20T07:56:23 | 2019-06-20T07:56:23 | 192,875,193 | 0 | 0 | null | 2022-12-15T23:31:31 | 2019-06-20T07:53:07 | Java | UTF-8 | Java | false | false | 2,543 | java | /*
* www.yiji.com Inc.
* Copyright (c) 2014 All Rights Reserved
*/
/*
* 修订记录:
* [email protected] 2015-02-28 16:39 创建
*
*/
package com.yiji.openapi.message.common.core.info;
import java.io.Serializable;
import java.util.Date;
/**
* @author [email protected]
*/
public class GrQueryRecordResultInfo implements Serializable {
/** 订单号 */
private String orderNo;
/** 汇付申请时间 */
private Date applyTime;
/** 交易流水号 */
private String tradeNo;
/** 汇款帐户ID */
private String userId;
/** 收款账户名 */
private String cardName;
/** 收款证件号码 */
private String certNo;
/** 收款银行帐户卡号 */
private String cardNo;
/** 银行名称 */
private String bankName;
/** 银行代码 */
private String bankCode;
/** 金额 */
private String remittanceAmount;
/** 手续费 */
private String charge;
/** 状态 */
private String status;
public String getOrderNo() {
return this.orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public Date getApplyTime() {
return this.applyTime;
}
public void setApplyTime(Date applyTime) {
this.applyTime = applyTime;
}
public String getTradeNo() {
return this.tradeNo;
}
public void setTradeNo(String tradeNo) {
this.tradeNo = tradeNo;
}
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getCardName() {
return this.cardName;
}
public void setCardName(String cardName) {
this.cardName = cardName;
}
public String getCertNo() {
return this.certNo;
}
public void setCertNo(String certNo) {
this.certNo = certNo;
}
public String getCardNo() {
return this.cardNo;
}
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public String getBankName() {
return this.bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBankCode() {
return this.bankCode;
}
public void setBankCode(String bankCode) {
this.bankCode = bankCode;
}
public String getRemittanceAmount() {
return this.remittanceAmount;
}
public void setRemittanceAmount(String remittanceAmount) {
this.remittanceAmount = remittanceAmount;
}
public String getCharge() {
return this.charge;
}
public void setCharge(String charge) {
this.charge = charge;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
}
| [
"[email protected]"
] | |
b6013af97739613d612fdef5a6591ee1d0f80dc6 | 69dd13f6b27070c24114ad406ea9cc150a012a11 | /PracticeIt/BPJ4/variables/PromptMultiplyBy2.java | 53386bae94164d68ae14f279fb5e8e030afbfb13 | [] | no_license | yakobiz/PracticeIt | fc5d932f9cdc8b4cc0d314b2a638449ee2d259fd | 77926866770ed6c29368c1f91d6c778881da233b | refs/heads/master | 2021-01-24T03:11:39.191943 | 2018-03-08T19:34:32 | 2018-03-08T19:34:32 | 122,878,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 381 | java | package variables;
import java.util.Scanner;
public class PromptMultiplyBy2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Type an integer: ");
int var = sc.nextInt();
MultiplyBy2(var);
sc.close();
}
public static int MultiplyBy2(int a){
int result = 2*a;
System.out.println(a +" times 2 = "+result);
return result;
}
}
| [
"[email protected]"
] | |
f9cefcb7a437e3b8ab3d7257149cea9a1fe18736 | df06aafd67c02d692cef6a42587e7c142bf9a4a2 | /Krecorder_170512/android/app/src/main/java/com/knowrecorder/Listeners/ImageTouchUpListener.java | 1040b32c1b9876fb0bdcc17f2ccf780318657c11 | [] | no_license | kei9327/kl | 9c278d7424d5670ea35b736933558085ee1899c2 | c66b1f3e6af43cf19f3f4103e02212a17c02d9e9 | refs/heads/master | 2020-03-25T20:22:09.589153 | 2017-07-17T15:07:05 | 2017-07-17T15:07:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 145 | java | package com.knowrecorder.Listeners;
/**
* Created by ssyou on 2016-10-28.
*/
public interface ImageTouchUpListener {
void onTouchUp();
}
| [
"[email protected]"
] | |
1aeac0268913480a553a9ea5b9387929d70f34ec | d868a6f732403095537d4bda46ccb6d6f232bd12 | /app/src/main/java/com/tasmim/a7afalaty/model/LoginModel.java | 0e256463d24d44527cd4793cdf36d50694d66cd4 | [] | no_license | mg120/7afalaty | 9cfdbde3bea514c330ad0bca6391079795fd159c | c85d98c82366a94dc33d7874188b637853a39b2a | refs/heads/master | 2020-04-08T19:30:17.366865 | 2018-11-29T11:51:11 | 2018-11-29T11:51:11 | 159,658,271 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,232 | java | package com.tasmim.a7afalaty.model;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* Created by Ma7MouD on 10/10/2018.
*/
public class LoginModel {
@SerializedName("status")
@Expose
private String status;
@SerializedName("code")
@Expose
private Integer code;
@SerializedName("data")
@Expose
private List<Data> data;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public List<Data> getData() {
return data;
}
public void setData(List<Data> data) {
this.data = data;
}
///////////////////////////////////
public static class Data implements Parcelable{
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("name")
@Expose
private String name;
@SerializedName("email")
@Expose
private String email;
@SerializedName("phone")
@Expose
private String phone;
@SerializedName("code")
@Expose
private Object code;
@SerializedName("avatar")
@Expose
private String avatar;
@SerializedName("active")
@Expose
private Integer active;
@SerializedName("checked")
@Expose
private Integer checked;
@SerializedName("banned")
@Expose
private Integer banned;
@SerializedName("type")
@Expose
private Integer type;
@SerializedName("role")
@Expose
private Integer role;
@SerializedName("lat")
@Expose
private String lat;
@SerializedName("long")
@Expose
private String _long;
@SerializedName("remember_token")
@Expose
private String rememberToken;
@SerializedName("created_at")
@Expose
private String createdAt;
@SerializedName("updated_at")
@Expose
private String updatedAt;
protected Data(Parcel in) {
if (in.readByte() == 0) {
id = null;
} else {
id = in.readInt();
}
name = in.readString();
email = in.readString();
phone = in.readString();
avatar = in.readString();
if (in.readByte() == 0) {
active = null;
} else {
active = in.readInt();
}
if (in.readByte() == 0) {
checked = null;
} else {
checked = in.readInt();
}
if (in.readByte() == 0) {
banned = null;
} else {
banned = in.readInt();
}
if (in.readByte() == 0) {
type = null;
} else {
type = in.readInt();
}
if (in.readByte() == 0) {
role = null;
} else {
role = in.readInt();
}
lat = in.readString();
_long = in.readString();
rememberToken = in.readString();
createdAt = in.readString();
updatedAt = in.readString();
}
public static final Creator<Data> CREATOR = new Creator<Data>() {
@Override
public Data createFromParcel(Parcel in) {
return new Data(in);
}
@Override
public Data[] newArray(int size) {
return new Data[size];
}
};
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Object getCode() {
return code;
}
public void setCode(Object code) {
this.code = code;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public Integer getActive() {
return active;
}
public void setActive(Integer active) {
this.active = active;
}
public Integer getChecked() {
return checked;
}
public void setChecked(Integer checked) {
this.checked = checked;
}
public Integer getBanned() {
return banned;
}
public void setBanned(Integer banned) {
this.banned = banned;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getRole() {
return role;
}
public void setRole(Integer role) {
this.role = role;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getLong() {
return _long;
}
public void setLong(String _long) {
this._long = _long;
}
public String getRememberToken() {
return rememberToken;
}
public void setRememberToken(String rememberToken) {
this.rememberToken = rememberToken;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public String getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(String updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
if (id == null) {
parcel.writeByte((byte) 0);
} else {
parcel.writeByte((byte) 1);
parcel.writeInt(id);
}
parcel.writeString(name);
parcel.writeString(email);
parcel.writeString(phone);
parcel.writeString(avatar);
if (active == null) {
parcel.writeByte((byte) 0);
} else {
parcel.writeByte((byte) 1);
parcel.writeInt(active);
}
if (checked == null) {
parcel.writeByte((byte) 0);
} else {
parcel.writeByte((byte) 1);
parcel.writeInt(checked);
}
if (banned == null) {
parcel.writeByte((byte) 0);
} else {
parcel.writeByte((byte) 1);
parcel.writeInt(banned);
}
if (type == null) {
parcel.writeByte((byte) 0);
} else {
parcel.writeByte((byte) 1);
parcel.writeInt(type);
}
if (role == null) {
parcel.writeByte((byte) 0);
} else {
parcel.writeByte((byte) 1);
parcel.writeInt(role);
}
parcel.writeString(lat);
parcel.writeString(_long);
parcel.writeString(rememberToken);
parcel.writeString(createdAt);
parcel.writeString(updatedAt);
}
}
}
| [
"[email protected]"
] | |
c1fa80346f4a0fdef111fea1fc0236c01a8a826e | 681848940e457d68137044ecdddfa2864be16c1a | /app/src/main/java/com/dmariani/mvp/presenter/MainPresenter.java | 920b72035b881f99d02ddf13e547e5d3d2c7e864 | [] | no_license | daniellemariani/android-mvp | 2fc027ea3318a02f732546f7c4d611957f0234d2 | 410db749f6a1e580de1d5b0f2bfd7bd4c02c241a | refs/heads/master | 2021-05-04T11:18:43.743462 | 2016-12-21T22:20:20 | 2016-12-21T22:20:20 | 52,398,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 267 | java | package com.dmariani.mvp.presenter;
import com.dmariani.mvp.ui.view.MainView;
/**
* Presenter which provides MainView actions
*
* @author danielle.mariani
*/
public interface MainPresenter extends BasePresenter<MainView> {
void onClickMenuItem(int id);
}
| [
"[email protected]"
] | |
8d781143adac63e51409f2534b1c4b2982ba1a4d | ebe0fd81a7bf9184bc5e52387dc046b21a96dd87 | /solar-web/src/main/java/com/solar/web/controller/ObservableMediaController.java | 59f10ae72ad46fde36e9f40d5b83ecdf8f9c207e | [] | no_license | solong1980/solar | 09ea21d325e25e9b74c8c61f20b3bf4417f45648 | 007b881d417875b98aa0e8f96d59e774c9552826 | refs/heads/master | 2021-09-23T22:26:16.899532 | 2018-09-28T11:50:36 | 2018-09-28T11:50:36 | 110,505,544 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,035 | java | package com.solar.web.controller;
import java.util.List;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.solar.common.context.Consts.AuditResult;
import com.solar.entity.SoAccount;
import com.solar.entity.SoAccountFind;
import com.solar.entity.SoAppVersion;
import com.solar.entity.SoDevices;
import com.solar.entity.SoPage;
import com.solar.entity.SoProject;
import com.solar.entity.SoProjectWorkingMode;
import com.solar.entity.SoRunningData;
import com.solar.entity.SoVCode;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
public class ObservableMediaController {
@ApiOperation(value = "登录", httpMethod = "POST", notes = "通过帐号,密码登陆")
@RequestMapping("/solar/login")
public String login(@ApiParam(required = true, name = "account", value = "帐户对象") SoAccount account) {
String jsonString = "";
return jsonString;
}
@ApiOperation(value = "查询最新版本", httpMethod = "POST", notes = "启动时查询版本对象")
@RequestMapping("/solar/appVersion")
public String queryAppVersion(
@ApiParam(required = true, name = "appVersion", value = "客户端类型:APK(10), IPA(50), RPM(100);") SoAppVersion appVersion) {
String jsonString = "";
return jsonString;
}
@ApiOperation(value = "添加项目信息", httpMethod = "POST", notes = "保存项目")
@RequestMapping("/solar/addProject")
public String saveProject(@ApiParam(required = true, name = "project", value = "项目信息") SoProject project) {
String jsonString = "";
return jsonString;
}
@ApiOperation(value = "用户注册", httpMethod = "POST", notes = "用户提交注册信息")
@RequestMapping("/solar/regiest")
public String regiest(@ApiParam(required = true, name = "account", value = "注册信息") SoAccount account) {
String jsonString = "";
return jsonString;
}
public void getVCode(SoVCode soVCode) {
}
public void findBack(SoAccountFind accountFind) {
}
public void accountFindQuery(SoAccountFind soAccountFind) {
}
public void accountFindAgree(Long id) {
SoAccountFind accountFind = new SoAccountFind();
accountFind.setId(id);
accountFind.setStatus(AuditResult.AGREE.getStatus());
}
public void accountFindReject(Long id) {
SoAccountFind accountFind = new SoAccountFind();
accountFind.setId(id);
accountFind.setStatus(AuditResult.REJECT.getStatus());
}
public void accountQuery(SoPage<SoAccount, List<SoAccount>> page) {
}
public void accountSelect(Long id) {
SoAccount account = new SoAccount();
account.setId(id);
}
public void accountUpdate(SoAccount account) {
}
public void regiestAgree(SoAccount account) {
account.setStatus(AuditResult.AGREE.getStatus());
}
public void regiestReject(Long id) {
SoAccount account = new SoAccount();
account.setId(id);
account.setStatus(AuditResult.REJECT.getStatus());
}
public void checkAccountProject(Long id) {
SoAccount account = new SoAccount();
account.setId(id);
}
public void queryProjects(SoPage<SoProject, List<SoProject>> soPage) {
SoProject c = soPage.getC();
if (c == null)
soPage.setC(new SoProject());
}
public void selectProject(Long id) {
SoProject project = new SoProject();
project.setId(id);
}
public void deleteProject(Long id) {
SoProject project = new SoProject();
project.setId(id);
}
public void getRunningData(String devNo) {
SoRunningData runningData = new SoRunningData();
runningData.setUuid(devNo);
}
public void getProjectWorkingMode(Long projectId) {
SoProjectWorkingMode projectWorkingMode = new SoProjectWorkingMode();
projectWorkingMode.setProjectId(projectId);
}
public void updateProjectWorkingMode(SoProjectWorkingMode mode) {
}
public void addDevice(SoDevices device) {
}
public void updateDevice(SoDevices device) {
}
}
| [
"[email protected]"
] | |
f8bdaf4a9cb46754fb82fdaa46455cbef81e31c5 | 138ab6b45596ed38190bae6033bd94460add2099 | /subscriber-verify/src/vn/metech/dto/response/data/Combo01Advance.java | 33704fcbbcde85ed003e4fe7750c13cf45b40df5 | [] | no_license | hanhls1/subscriber-verify-proj | 6f5b98c850077269988ddfcfac72a94220899f26 | 0b1bccc6d36151f958d2a5d155ecbaab00677fe5 | refs/heads/master | 2023-02-18T10:40:01.411555 | 2021-01-06T00:51:24 | 2021-01-06T00:51:24 | 327,039,402 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,719 | java | package vn.metech.dto.response.data;
import java.util.ArrayList;
import java.util.List;
public class Combo01Advance {
private List<MostVisitLocation> mostVisitLocations;
private List<RegularlyLocation> regularlyLocations;
private List<CallBase> referenceReports;
private List<CallBase> frequencyReports;
public Combo01Advance() {
this.mostVisitLocations = new ArrayList<>();
this.regularlyLocations = new ArrayList<>();
this.referenceReports = new ArrayList<>();
this.frequencyReports = new ArrayList<>();
}
public Combo01Advance(LocationAdvance locationAdvance, CallReference callReference) {
this.mostVisitLocations = locationAdvance.getMostVisitLocations();
this.regularlyLocations = locationAdvance.getRegularlyLocations();
this.referenceReports = callReference.getReferenceReports();
this.frequencyReports = callReference.getFrequencyReports();
}
public List<MostVisitLocation> getMostVisitLocations() {
return mostVisitLocations;
}
public void setMostVisitLocations(List<MostVisitLocation> mostVisitLocations) {
this.mostVisitLocations = mostVisitLocations;
}
public List<RegularlyLocation> getRegularlyLocations() {
return regularlyLocations;
}
public void setRegularlyLocations(List<RegularlyLocation> regularlyLocations) {
this.regularlyLocations = regularlyLocations;
}
public List<CallBase> getReferenceReports() {
return referenceReports;
}
public void setReferenceReports(List<CallBase> referenceReports) {
this.referenceReports = referenceReports;
}
public List<CallBase> getFrequencyReports() {
return frequencyReports;
}
public void setFrequencyReports(List<CallBase> frequencyReports) {
this.frequencyReports = frequencyReports;
}
}
| [
"[email protected]"
] | |
c6782f7278e36644fe0a6fa1eb2b3addfde5ded1 | a00f917452df3722fdfbc24ce5144c6cbe4d4179 | /src/GetModel/No_Honesto.java | f9e9b55daac36ad92b9fc4b3f524af1d517d3b4b | [] | no_license | MikelAbad/TextMining | bbfaadc92ec129faa50dbe2f3546c9a11c87d06c | 5be8adcbd747b7011954e0f62d1d73c68736621f | refs/heads/master | 2020-03-30T06:33:43.507433 | 2018-09-29T14:16:32 | 2018-09-29T14:16:32 | 150,870,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 460 | java | package GetModel;
import weka.classifiers.Evaluation;
import weka.classifiers.trees.RandomForest;
import weka.core.Instances;
public class No_Honesto {
public Evaluation evalNoHon(RandomForest rf, Instances dataSet) throws Exception {
RandomForest forest = rf;
// Sistema no honesto
Evaluation evaluadorNoHon = new Evaluation(dataSet);
forest.buildClassifier(dataSet);
evaluadorNoHon.evaluateModel(forest, dataSet);
return evaluadorNoHon;
}
} | [
"[email protected]"
] | |
a1b413f6d67f2e876bf60c9ffef5a6fd7e3907cc | 16557a30437f7d01619233f6a4b486e6615f1c9d | /BigWork/src/main/java/com/shana/service/impl/ReconsiderationServiceImpl.java | 1d55451a973990041eb7daf21b71fe40d5ad75ed | [] | no_license | lwj1/lwj | 5b13ede3573218a5f6f4fcedccb00fd030ec3b64 | 22e3ff796a1c0c87ab18fc9eeedb094bb76c0559 | refs/heads/master | 2021-07-10T14:50:10.853833 | 2019-03-21T07:33:32 | 2019-03-21T07:33:32 | 153,588,596 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,327 | java | package com.shana.service.impl;
import com.shana.dao.ReconsiderationDao;
import com.shana.model.Reconsideration;
import com.shana.service.ReconsiderationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by Administrator on 2018/11/2.
*/
@Service
public class ReconsiderationServiceImpl implements ReconsiderationService{
@Autowired
private ReconsiderationDao reconsiderationDao;
public boolean addreconsideration(Reconsideration reconsideration) {
if(reconsiderationDao.addreconsideration(reconsideration)!=0){
return true;
}else {
return false;
}
}
public boolean updatereconsideration(int id) {
if(reconsiderationDao.updatereconsideration(id)!=0){
return true;
}else {
return false;
}
}
public Reconsideration getByRewid(int rewid) {
return reconsiderationDao.getByRewid(rewid);
}
public List<Reconsideration> getAll() {
return reconsiderationDao.getAll();
}
public boolean updatereconsideration2(int id) {
if(reconsiderationDao.updatereconsideration2(id)!=0){
return true;
}else {
return false;
}
}
}
| [
"[email protected]"
] | |
2c07b1912110bbb07b14142334f1fbbdaa3b545a | 007e2d75a44cc8a8f1491881a88e1b2d1a84aa0a | /src/main/java/com/takahirofujii/condominium/Condominium.java | 2a95d3bbb125eef701105b3cc2bcc931e4266537 | [] | no_license | taka66/sample-data-creator | 9bf04819979cc808430f5e4d46ce627e52228a5c | 87d8fb73f95ea3d2d5f04822c7974ec1baa8c0ac | refs/heads/master | 2021-01-10T02:46:59.336010 | 2016-01-17T07:37:01 | 2016-01-17T07:37:01 | 49,201,546 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package com.takahirofujii.condominium;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Store master information of condominium.
* @author fujiitakahiro
*/
@Getter
@AllArgsConstructor
public class Condominium {
private final long id;
private final String name;
private final String prefecture;
}
| [
"[email protected]"
] | |
2ddcdb4ca3e04ef70a2e2ac8f84eeeb792307f52 | 71b8dae53cd17f1bb8222afee9f05cc387913a08 | /src/Biblioteca/Artigo.java | 50efb2a638f2852a17f71b2b2c206b5fe345f4a1 | [] | no_license | jessmelo/biblioteca | 7681c0c19faa5c8b7d2f8c894386b91e2ee045d4 | 39f83a8150da0883731f9591223305214ae7ada5 | refs/heads/master | 2020-09-28T12:25:51.098506 | 2020-03-10T02:24:02 | 2020-03-10T02:24:02 | 226,778,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package Biblioteca;
public class Artigo {
private String titulo_artigo;
public String getTituloArtigo() {
return this.titulo_artigo;
}
public void setTituloArtigo(String novo) {
this.titulo_artigo = novo;
}
}
| [
"[email protected]"
] | |
158e8df7e0c79ee94483647269d33a27fced09ca | fe2e7d87290b0d4d5cf44d523386e4b1e7c11249 | /src/test/java/GridSetupTest/GridSetupTest/ChromeGridTest.java | 8a5e006e90bc5a89cbbeca3c10f6d2d7c74f7904 | [] | no_license | zalenahomsi/seleniumGridTest | baaccdf4d08620f37d342e1ba12ad9fee078321e | 04c47fc8b86c7cf6ad14a604344d9437f91291bb | refs/heads/master | 2020-04-26T19:03:18.166730 | 2019-03-04T15:42:41 | 2019-03-04T15:42:41 | 173,762,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,193 | java | package GridSetupTest.GridSetupTest;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class ChromeGridTest {
WebDriver driver;
String baseURL, nodeURL;
// define desired capabilities
// platform=WIN10, browser name=chrome
@BeforeTest
public void setUp() throws MalformedURLException {
baseURL = "http://newtours.demoaut.com/";
nodeURL = "http://192.168.137.1:5566/wd/hub";
DesiredCapabilities capability = DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
capability.setPlatform(Platform.WIN10);
driver = new RemoteWebDriver(new URL(nodeURL), capability);
}
@AfterTest
public void afterTest() {
driver.quit();
}
@Test
public void getTitleTest() {
driver.get(baseURL);
Assert.assertEquals("Welcome: Mercury Tours", driver.getTitle());
System.out.println("Title: " + driver.getTitle());
}
}
| [
"[email protected]"
] | |
cb2d5701d5679e3cdd01312783b367c98b0c31c3 | 81494fd5556f0829f20e97309a636d3f3f76dfe6 | /FirstStronghold/src/frclib/FrcCANTalon.java | 85575f1bfde6714070194b9a54e120b89ea4e644 | [
"MIT"
] | permissive | trc492/Frc2016FirstStronghold | 2748962808d9ad617c7984c4736f42a6e8618af2 | 2e3be99b384cba774f235e287bd782239e6a8225 | refs/heads/master | 2021-01-10T01:59:15.333028 | 2016-10-05T04:21:54 | 2016-10-05T04:21:54 | 49,347,422 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,413 | java | /*
* Titan Robotics Framework Library
* Copyright (c) 2015 Titan Robotics Club (http://www.titanrobotics.net)
*
* 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 frclib;
import edu.wpi.first.wpilibj.CANTalon;
import hallib.HalMotorController;
public class FrcCANTalon extends CANTalon implements HalMotorController
{
private boolean feedbackDeviceIsPot = false;
private boolean limitSwitchesSwapped = false;
private boolean revLimitSwitchNormalOpen = false;
private boolean fwdLimitSwitchNormalOpen = false;
private double zeroPosition = 0.0;
private boolean softLowerLimitEnabled = false;
private boolean softUpperLimitEnabled = false;
private double softLowerLimit = 0.0;
private double softUpperLimit = 0.0;
/**
* Constructor: Create an instance of the object.
*
* @param deviceNumber specifies the CAN ID of the device.
* @param controlPeriodMs specifies the period in msec to send the CAN control frame.
* Period is bounded to 1 msec to 95 msec.
* @param enablePeriodMs specifies the period in msec to send the enable control frame.
* Period is bounded to 1 msec to 95 msec. This typically is not
* required to specify, however, this could be used to minimize the
* time between robot-enable and talon-motor-drive.
*/
public FrcCANTalon(int deviceNumber, int controlPeriodMs, int enablePeriodMs)
{
super(deviceNumber, controlPeriodMs, enablePeriodMs);
resetPosition();
} //FrcCANTalon
/**
* Constructor: Create an instance of the object.
*
* @param deviceNumber specifies the CAN ID of the device.
* @param controlPeriodMs specifies the period in msec to send the CAN control frame.
* Period is bounded to 1 msec to 95 msec.
*/
public FrcCANTalon(int deviceNumber, int controlPeriodMs)
{
super(deviceNumber, controlPeriodMs);
resetPosition();
} //FrcCANTalon
/**
* Constructor: Create an instance of the object.
*
* @param deviceNumber specifies the CAN ID of the device.
*/
public FrcCANTalon(int deviceNumber)
{
super(deviceNumber);
resetPosition();
} //FrcCANTalon
public void setLimitSwitchesSwapped(boolean swapped)
{
limitSwitchesSwapped = swapped;
} //setLimitSwitchesSwapped
@Override
public void ConfigFwdLimitSwitchNormallyOpen(boolean normalOpen)
{
super.ConfigFwdLimitSwitchNormallyOpen(normalOpen);
fwdLimitSwitchNormalOpen = normalOpen;
}
@Override
public void ConfigRevLimitSwitchNormallyOpen(boolean normalOpen)
{
super.ConfigRevLimitSwitchNormallyOpen(normalOpen);
revLimitSwitchNormalOpen = normalOpen;
}
@Override
public void setFeedbackDevice(FeedbackDevice devType)
{
super.setFeedbackDevice(devType);
feedbackDeviceIsPot = devType == FeedbackDevice.AnalogPot;
}
//
// Implements HalMotorController interface.
//
/**
* This method returns the state of the motor controller direction.
*
* @return true if the motor direction is inverted, false otherwise.
*/
@Override
public boolean getInverted()
{
return super.getInverted();
} //getInverted
/**
* This method returns the motor position by reading the position sensor. The position
* sensor can be an encoder or a potentiometer.
*
* @return current motor position.
*/
@Override
public double getPosition()
{
double pos = super.getPosition();
if (feedbackDeviceIsPot)
{
pos -= zeroPosition;
}
return pos;
} //getPosition
/**
* This method returns the speed of the motor rotation.
*
* @return motor rotation speed.
*/
@Override
public double getSpeed()
{
return super.getSpeed();
} //getSpeed
/**
* This method returns the state of the lower limit switch.
*
* @return true if lower limit switch is active, false otherwise.
*/
@Override
public boolean isLowerLimitSwitchActive()
{
return limitSwitchesSwapped? !(fwdLimitSwitchNormalOpen^isFwdLimitSwitchClosed()):
!(revLimitSwitchNormalOpen^isRevLimitSwitchClosed());
} //isLowerLimitSwitchClosed
/**
* This method returns the state of the upper limit switch.
*
* @return true if upper limit switch is active, false otherwise.
*/
@Override
public boolean isUpperLimitSwitchActive()
{
return limitSwitchesSwapped? !(revLimitSwitchNormalOpen^isRevLimitSwitchClosed()):
!(fwdLimitSwitchNormalOpen^isFwdLimitSwitchClosed());
} //isUpperLimitSwitchActive
/**
* This method resets the motor position sensor, typically an encoder.
*/
public void resetPosition()
{
if (feedbackDeviceIsPot)
{
zeroPosition = super.getPosition();
}
else
{
super.setPosition(0.0);
}
} //resetPosition
/**
* This method enables/disables motor brake mode. In motor brake mode, set power to 0 would
* stop the motor very abruptly by shorting the motor wires together using the generated
* back EMF to stop the motor. When brakMode is false (i.e. float/coast mode), the motor wires
* are just disconnected from the motor controller so the motor will stop gradually.
*
* @param brakeMode specifies true to enable brake mode, false otherwise.
*/
public void setBrakeModeEnabled(boolean enabled)
{
super.enableBrakeMode(enabled);
} //setBrakeModeEnabled
/**
* This method inverts the motor direction.
*
* @param inverted specifies true to invert motor direction, false otherwise.
*/
@Override
public void setInverted(boolean inverted)
{
super.setInverted(inverted);
} //setInverted
/**
* This method sets the output power of the motor controller.
*
* @param output specifies the output power for the motor controller in the range of
* -1.0 to 1.0.
*/
public void setPower(double power)
{
if (softLowerLimitEnabled && power < 0.0 && getPosition() <= softLowerLimit ||
softUpperLimitEnabled && power > 0.0 && getPosition() >= softUpperLimit)
{
power = 0.0;
}
super.set(power);
} //setPower
/**
* This method inverts the position sensor direction. This may be rare but
* there are scenarios where the motor encoder may be mounted somewhere in
* the power train that it rotates opposite to the motor rotation. This will
* cause the encoder reading to go down when the motor is receiving positive
* power. This method can correct this situation.
*
* @param inverted specifies true to invert position sensor direction,
* false otherwise.
*/
public void setPositionSensorInverted(boolean inverted)
{
super.reverseSensor(inverted);
} //setPositionSensorInverted
/**
* This method enables/disables soft limit switches.
*
* @param lowerLimitEnabled specifies true to enable lower soft limit switch, false otherwise.
* @param upperLimitEnabled specifies true to enable upper soft limit switch, false otherwise.
*/
public void setSoftLimitEnabled(boolean lowerLimitEnabled, boolean upperLimitEnabled)
{
softLowerLimitEnabled = lowerLimitEnabled;
softUpperLimitEnabled = upperLimitEnabled;
} //setSoftLimitEnabled
/**
* This method sets the lower soft limit.
*
* @param position specifies the position of the lower limit.
*/
public void setSoftLowerLimit(double position)
{
softLowerLimit = position;
} //setSoftLowerLimit
/**
* This method sets the upper soft limit.
*
* @param position specifies the position of the upper limit.
*/
public void setSoftUpperLimit(double position)
{
softUpperLimit = position;
} //setSoftUpperLimit
} //class FrcCANTalon
| [
"[email protected]"
] | |
ed203a000d196057c4757be9ace593b3c7cc2f6e | 9b61b768c9d00823cf418017c53ead8e5b610bd6 | /mingrui-shop-commons/mingrui-shop-common-core/src/main/java/com/baidu/shop/base/BaseApiService.java | e4843196f0ee09cfcce69e02b64728cf3f647709 | [] | no_license | yangyongqi123/mingrui-shop-parent | a444b8c323368d9c1e96cca0373f6e3eb9ac1522 | e43cac53951960df7ba955ef5dfaae7b4f90dbfb | refs/heads/master | 2023-02-16T04:27:19.923676 | 2021-01-08T11:37:32 | 2021-01-08T11:37:32 | 323,906,315 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,368 | java | package com.baidu.shop.base;
import com.baidu.shop.status.HTTPStatus;
import com.baidu.shop.utils.JSONUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @ClassName BaseApiService
* @Description: TODO
* @Author yyq
* @Date 2020/12/22
* @Version V1.0
**/
@Data
@Component
@Slf4j
public class BaseApiService<T>{
public Result<T> setResultError(Integer code, String msg) {
return setResult(code, msg, null);
}
// 返回错误,可以传msg
public Result<T> setResultError(String msg) {
return setResult(HTTPStatus.ERROR, msg, null);
}
// 返回成功,可以传data值
public Result<T> setResultSuccess(T data) {
return setResult(HTTPStatus.OK, HTTPStatus.OK + "", data);
}
// 返回成功,沒有data值
public Result<T> setResultSuccess() {
return setResult(HTTPStatus.OK, HTTPStatus.OK + "", null);
}
// 返回成功,沒有data值
public Result<T> setResultSuccess(String msg) {
return setResult(HTTPStatus.OK, msg, null);
}
// 通用封装
public Result<T> setResult(Integer code, String msg, T data) {
log.info(String.format("{code : %s , message : %s , data : %s}",code,msg,
JSONUtil.toJsonString(data)));
return new Result<T>(code, msg, data);
}
}
| [
"[email protected]"
] | |
39b4357205509be0add19d1d5605095c722f94ac | 9f639a2e616eb40305702ec20b766d085cc9995c | /app/src/main/java/com/kys26/webthings/util/ToastHelper.java | c79a32f385e855e66e6b6b0dacabffaa5bd8a8ad | [] | no_license | jianhuidev/WebThings | 6af11bb66fa63a4a66c7f9345d18e68865cc708c | 426c65b5a8c26b4ccf1ad2bb88446484f5df6212 | refs/heads/master | 2021-08-08T00:55:59.516067 | 2017-11-07T12:42:08 | 2017-11-07T12:42:08 | 106,410,642 | 0 | 1 | null | 2017-11-07T12:42:09 | 2017-10-10T11:53:48 | Java | UTF-8 | Java | false | false | 629 | java | package com.kys26.webthings.util;
import android.content.Context;
import android.text.TextUtils;
import android.widget.Toast;
/***
* Toast 提示工具
* @author Admin-徐建强
* create at 2014-9-23 下午2:42:03
*/
public class ToastHelper {
private static Toast toast;
public static void show(Context ctx, String message) {
if (ctx == null || TextUtils.isEmpty(message)) {
return;
}
if (null == toast) {
toast = Toast.makeText(ctx, message, Toast.LENGTH_SHORT);
} else {
toast.setText(message);
}
toast.show();
}
public static void hide() {
if (null != toast) {
toast.cancel();
}
}
}
| [
"“[email protected]"
] | |
612b2bcf498322ea896de504b8f457097055dd12 | 2cfc94f3ddb540d2c3d248d68949104a46fabd6a | /myweb/src/main/java/com/janus/myweb/sys/service/SysDictionaryService.java | 3c32d72a49330f6a295f2ea2325c0718148e9013 | [] | no_license | JanusHuang/myapp | 47f3b18857829ab259e6aba708bf4f5bd7ab0ff1 | dd1d05e92efb0e9b0f7d3a308cd00478dc3b7cf0 | refs/heads/master | 2020-04-28T13:00:45.462516 | 2014-07-30T01:39:13 | 2014-07-30T01:39:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package com.janus.myweb.sys.service;
import com.janus.myapp.frame.core.service.BaseService;
import com.janus.myweb.sys.domain.SysDictionary;
public interface SysDictionaryService extends BaseService<SysDictionary> {
} | [
"[email protected]"
] | |
348d0c98e2d3c9c40de79a5a4ff902da0967a4c8 | 534e88cb1d99b28dc1b9b759677e171229c05287 | /prudhvi raj (min max sum)(easy)13.java | f25cdf711df2e947bd27f0e33a3ebde566646f39 | [] | no_license | Pavithra-cpu/CDERankBridgeProgram | 8644f07d294458971ed6bc6bebfff5fe31da07cf | 9c7992ac667d65312e34dc52a27a33ccca79a956 | refs/heads/master | 2022-04-26T09:58:56.557275 | 2020-04-23T06:06:00 | 2020-04-23T06:06:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 747 | java | import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long min = Long.MAX_VALUE;
long max = 0;
long sum = 0;
for(int i=0; i<5; i++)
{
long current = in.nextLong();
if(max < current)
{
max = current;
}
if(min > current)
{
min = current;
}
sum += current;
}
long minSum = sum - max;
long maxSum = sum - min;
System.out.println(minSum + " " + maxSum);
}
}
| [
"[email protected]"
] | |
04dcfae845153d34b0b29eec37a69e74324efb6c | 4331ee5877faea1c3a8220b03d1d3c5b29e1e8ff | /app/src/main/java/projekpati/com/projekpati/Model/Pariwisata/DetilPariwisataModel.java | 2db93d34c86a94ef3f0a1f6e56c5bb25ba64528c | [] | no_license | Setiawan98/patiprojek | 1695b659a94302f20205abd75dc0d8dfd3548fb7 | 32fb25d6a6081bf8e82a770487ba64e20659f61a | refs/heads/master | 2020-08-11T14:56:23.168871 | 2020-06-10T09:42:02 | 2020-06-10T09:42:02 | 214,583,404 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,286 | java | package projekpati.com.projekpati.Model.Pariwisata;
public class DetilPariwisataModel {
String status, judul, key, waktu, icon;
DetilPariwisataBaru data;
public DetilPariwisataModel(String status, String judul, String key, String waktu, String icon, DetilPariwisataBaru data) {
this.status = status;
this.judul = judul;
this.key = key;
this.waktu = waktu;
this.icon = icon;
this.data = data;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getJudul() {
return judul;
}
public void setJudul(String judul) {
this.judul = judul;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getWaktu() {
return waktu;
}
public void setWaktu(String waktu) {
this.waktu = waktu;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public DetilPariwisataBaru getData() {
return data;
}
public void setData(DetilPariwisataBaru data) {
this.data = data;
}
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.