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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fd342f478c1d41af07ca3e36754d881f30f2a2b4 | 550b8d4ad05b663af287be0ece488fab333da402 | /src/main/java/com/buy/together/util/MailSend.java | fe519df449bc981aa070b0fc9fee307ba4a47be3 | [] | no_license | qjsrodkfhd/finalProjectBuyTogether | 951bc0c5a381cc8eaf8dd20859691ef1542ac160 | 7457608b41ff1a34ff82200e09969dcbbcb45333 | refs/heads/master | 2022-12-23T10:25:46.537815 | 2017-08-05T13:29:19 | 2017-08-05T13:29:19 | 75,138,775 | 0 | 12 | null | 2022-12-16T05:49:11 | 2016-11-30T01:32:14 | CSS | UTF-8 | Java | false | false | 2,281 | java | package com.buy.together.util;
import java.util.Date;
import java.util.Properties;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class MailSend {
public String sendMail(String toEmail, String randomKey) throws Exception {
//인증번호(4자리) 생성
Properties p = System.getProperties();
p.put("mail.smtp.starttls.enable", "true");// gmail은 무조건 true 고정
p.put("mail.smtp.host", "smtp.gmail.com");// smtp 서버 주소
p.put("mail.smtp.auth", "true");// gmail은 무조건 true 고정
p.put("mail.smtp.port", "587");// gmail 포트
Authenticator auth = new MyAuthentication();
// session 생성 및 MimeMessage생성
Session session = Session.getDefaultInstance(p, auth);
MimeMessage msg = new MimeMessage(session);
// 편지보낸시간
msg.setSentDate(new Date());
InternetAddress from = new InternetAddress();
from = new InternetAddress("[email protected]");
// 이메일 발신자
msg.setFrom(from);
// 이메일 내용
String message = "같이 사냥의 임시 비밀번호는 " + "[" + randomKey + "]" + "입니다.";
// 이메일 수신자
InternetAddress to = new InternetAddress(toEmail);
msg.setRecipient(Message.RecipientType.TO, to);
// 이메일 제목
msg.setSubject("같이 사냥의 임시 비밀번호 발송입니다.", "UTF-8");
// 이메일 내용
msg.setText(message, "UTF-8");
// 이메일 헤더
msg.setHeader("content-Type", "text/html");
// 메일보내기
javax.mail.Transport.send(msg);
System.out.println("메일 전송 완료");
System.out.println(message);
return randomKey;
}
}
class MyAuthentication extends Authenticator {
PasswordAuthentication pa;
public MyAuthentication() {
String id = "[email protected]";// 구글 ID
String pw = "a2164527";// 구글 비밀번호
// ID와 비밀번호를 입력한다.
pa = new PasswordAuthentication(id, pw);
}
// 시스템에서 사용하는 인증정보
public PasswordAuthentication getPasswordAuthentication() {
return pa;
}
} | [
"[email protected]"
] | |
19055505ad692938509058acfd43310eb895bff3 | 771c18a45d0faf10dfb440e4fcff4c317e09a0a2 | /src/main/java/dev/paie/util/PaieUtils.java | 55fc21d09dac2a5874a35b0c9acfb64437e9e12d | [] | no_license | AlexisVernay/sirh-gestion-paie | eb4d835f0e9ba5de6e38712ef96106c33d9cec4c | 747da89c2bc304a49a8dd2964202702c74ddbb4a | refs/heads/master | 2020-03-12T14:21:08.438207 | 2018-04-30T10:26:15 | 2018-04-30T10:26:15 | 130,665,176 | 0 | 0 | null | 2018-04-23T08:30:32 | 2018-04-23T08:30:32 | null | UTF-8 | Java | false | false | 896 | java | package dev.paie.util;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
import org.springframework.stereotype.Component;
@Component
public class PaieUtils {
/**
* Formate un nombre sous la forme xx.xx (exemple : 2.00, 1.90). L'arrondi
* se fait en mode "UP" => 1.904 devient 1.91
*
* @param decimal
* nombre à formater
* @return le nombre formaté
*/
public String formaterBigDecimal(BigDecimal decimal) {
DecimalFormat df = new DecimalFormat();
// forcer le séparateur "." même sur un poste en français
df.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.UK));
df.setMaximumFractionDigits(2);
df.setRoundingMode(RoundingMode.UP);
df.setMinimumFractionDigits(2);
df.setGroupingUsed(false);
return df.format(decimal);
}
}
| [
"[email protected]"
] | |
7b47b7e4aa28cb6f686b15a7eac4c8baebc2a1ec | 1671d87c2e414de8186570983c65c220888f20b1 | /第一阶段/day08/src/com/atguigu/lgl/ArrayUtils_Luo2.java | 1517e240c3050d69b7dec6c27d31af52de4fb77b | [] | no_license | qisirendexudoudou/BigData_0722 | 4f25b508b4c20088d4155abb2d52e1d39c8b0e81 | e474e6ebcbbfedd12f859f0198238f58b73e5bec | refs/heads/master | 2022-07-21T17:41:47.611707 | 2019-11-16T05:59:11 | 2019-11-16T05:59:11 | 221,875,869 | 0 | 0 | null | 2022-06-21T02:14:43 | 2019-11-15T08:10:07 | Java | UTF-8 | Java | false | false | 2,279 | java | package com.atguigu.lgl;
import java.util.Arrays;
public class ArrayUtils_Luo2 {
public static void main(String[] args) {
int[] numbers1 = {3,1,7,9,5,11};
ArrayUtils_Luo run2 = new ArrayUtils_Luo();
System.out.println(run2.maxNumber(numbers1));
System.out.println(run2.minNumber(numbers1));
System.out.println(run2.sum(numbers1));
System.out.println(run2.ever(numbers1));
System.out.println(Arrays.toString(run2.copyNumber(numbers1)));
System.out.println(Arrays.toString(run2.fanzhuan(numbers1)));
System.out.println(run2.findNumber(numbers1,9));
System.out.println(Arrays.toString(run2.sort(numbers1,true)));
System.out.println(Arrays.toString(run2.sort(numbers1,false)));
}
//排序
public int[] sort(int[] a,boolean boo){
if (boo){
for (int i = 0; i < a.length-1; i++) {
for (int j = 0; j < a.length-i-1; j++) {
if (a[j] > a[j+1]) {
int tmpe = a[j];
a[j] = a[j+1];
a[j+1] = tmpe;
}
}
}
}else {
for (int i = 0; i < a.length-1; i++) {
for (int j = 0; j < a.length-i-1; j++) {
if (a[j] < a[j+1]) {
int tmpe = a[j];
a[j] = a[j+1];
a[j+1] = tmpe;
}
}
}
}
return a;
}
//查找
public int findNumber(int[] a,int b){
int index = -1;
for (int i = 0; i < a.length; i++) {
if ( a[i] == b) {
index = i;
}
}
return index;
}
//反转
public int[] fanzhuan(int[] a){
for (int i = 0,j=a.length-1; i < a.length/2; i++,j--) {
int tmpe = a[i];
a[i] = a[j];
a[j] = tmpe;
}
return a;
}
//复制
public int[] copyNumber(int[] a){
int[] copyNumber = new int[a.length];
for (int i = 0; i < copyNumber.length; i++) {
copyNumber[i] = a[i];
}
return copyNumber;
}
//求平均值
public int ever(int[] a){
return sum(a)/a.length;
}
//求和
public int sum(int[] a){
int sum = 0;
for (int i = 0; i < a.length; i++) {
sum += a[i];
}
return sum;
}
//最小值
public int minNumber(int[] a){
int minNum = a[0];
for (int i = 0; i < a.length; i++) {
if (a[i] < minNum) {
minNum = a[i];
}
}
return minNum;
}
//最大值
public int maxNumber(int[] a){
int maxNum = a[0];
for (int i = 0; i < a.length; i++) {
if (a[i] > maxNum) {
maxNum = a[i];
}
}
return maxNum;
}
}
| [
"[email protected]"
] | |
697ef96cba1ac3c970bca27e85362479400a5f03 | 710e1d895802347f9bdd21542ec263ae3504fdef | /Project0408/src/GameManager.java | b3e4ad5df6be70fcbf1df0037674fdf499164957 | [] | no_license | jammmm91/JAVA | c1b63bd63fed750282b6fb1cebc7e19d9e01eb9b | 212b24caca6ceb38b640825256ecdcd0f23911a2 | refs/heads/master | 2023-07-09T00:58:06.847519 | 2021-08-14T09:15:24 | 2021-08-14T09:15:24 | 353,534,968 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,743 | java | import java.util.Random;
public class GameManager {
public void play() {
Player[] player = {new PlayerType1("피카츄"), new PlayerType1("꼬부기"), new PlayerType1("파이리"), new PlayerType1("이상해씨"), new PlayerType1("미뇽")};
Enemy[] enemy = {new EnemyType1("피죤"), new EnemyType1("꼬렛"), new EnemyType1("냐옹"), new EnemyType1("야돈"), new EnemyType1("뮤")};
Random r = new Random();
for (int i = 0; i < 999999; i++) {
System.out.println("\n" + (i + 1) + "턴\n");
// 플레이어 턴
for (int playerIndex = 0; playerIndex < player.length; playerIndex++) {
int attackTarget = r.nextInt(enemy.length);
if (player[playerIndex].isLive() && enemy[attackTarget].isLive()) {
player[playerIndex].attack(enemy[attackTarget]);
}
}
// 적 턴
for (int enemyIndex = 0; enemyIndex < enemy.length; enemyIndex++) {
int attackTarget = r.nextInt(player.length);
if (enemy[enemyIndex].isLive() && player[attackTarget].isLive()) {
enemy[enemyIndex].attack(player[attackTarget]);
}
}
// 게임 종료 여부 확인
boolean isPlayerLive = false;
for (int playerIndex = 0; playerIndex < player.length; playerIndex++) {
if (player[playerIndex].isLive()) {
isPlayerLive = true;
}
}
boolean isEnemyLive = false;
for (int enemyIndex = 0; enemyIndex < enemy.length; enemyIndex++) {
if (enemy[enemyIndex].isLive()) {
isEnemyLive = true;
}
}
if (isPlayerLive && !isEnemyLive) {
System.out.println("플레이어 승리");
break;
} else if (!isPlayerLive && isEnemyLive) {
System.out.println("적 승리");
break;
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
}
}
}
| [
"[email protected]"
] | |
d0f3f1930fe0c89b338a272a1d175dc2771010b1 | e71f59f506c1ff59b7399ffbcd072a76e64700e0 | /ConnectintWhitTeacher.java | 78a8a3d27d270b4a4eb28a361a2edeca1ce3c6b0 | [] | no_license | ashkaneghdam/USSDIslamicazad | e49b2b4a590ea5fb6422cac85bc442ce9dba6a01 | 1e048588842ab637c6bfcfcd4a610f440df58810 | refs/heads/master | 2021-04-27T07:51:44.830136 | 2018-02-23T15:46:20 | 2018-02-23T15:46:20 | 122,640,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,144 | java | import java.util.ArrayList;
public class ConnectintWhitTeacher {
private String name;
private ArrayList<Comment> comments;
public ConnectintWhitTeacher(String name) {
this.name = name;
this.comments = new ArrayList<>();
}
public boolean addComment(Comment comment) {
if (findComment(comment.getStudentNumber()) >= 0) {
System.out.println("شما قبلا نظر اضافه کرده اید! لطفا از منوی ویرایش استفاده کنید");
return false;
}
comments.add(comment);
return true;
}
public boolean removeComment(String studentNumber) {
int position = findComment(studentNumber);
if (position >= 0) {
comments.remove(position);
System.out.println("نظر حذف شد!");
return true;
}
System.out.println("نظر پیدا نشد!");
return false;
}
public boolean updateComment(Comment oldComent, Comment newComment) {
int position = findComment(oldComent.getStudentNumber());
if (position >= 0) {
comments.set(position, newComment);
System.out.println("نظر تغییر کید");
return true;
}
System.out.println("نظر تغییر نکرد");
return false;
}
public void printComment() {
for (int i = 0; i < comments.size(); i++) {
System.out.println(comments.get(i).getStudentNumber() + " --> " + comments.get(i).getStudentComment());
}
}
public String getName() {
return name;
}
public ArrayList<Comment> getComments() {
return comments;
}
private int findComment(String studentNumber) {
for (int i = 0; i < comments.size(); i++) {
if (comments.get(i).getStudentNumber().equals(studentNumber)) {
return i;
}
}
return -1;
}
private int findComment(Comment comment) {
return comments.indexOf(comment);
}
}
| [
"[email protected]"
] | |
25aa18628509051b0dc9a01576e4a9c628fc6e49 | e4bbfca751cab3ae300734bc5563304fa5b7ab8c | /src/main/java/com/leospiritlee/base/collections/AddingGroups.java | 8e0d7a061c33144626e63ce96a0be1233f758c7e | [] | no_license | leospiritlee/JavaStudyDemo | 7fe59a44f988f49a668d7443a0fb1549f5c802fc | b6ea657c2670cdd2eb0d32c37e8373a539ee7687 | refs/heads/master | 2021-01-05T14:36:03.697926 | 2020-04-12T06:53:18 | 2020-04-12T06:53:18 | 241,051,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,143 | java | package com.leospiritlee.base.collections;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* @Project: JavaStudyDemo
* @ClassName AddingGroups
* @description: TODO
* @author: leospiritlee
* @create: 2020-02-28 18:59
**/
public class AddingGroups {
public static void main(String[] args) {
Collection<Integer> collection =
new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5));
Integer[] moreInts = { 6, 7, 8, 9, 10 };
collection.addAll(Arrays.asList(moreInts));
// Runs significantly faster, but you can't
// construct a Collection this way:
Collections.addAll(collection, 11, 12, 13, 14, 15);
Collections.addAll(collection, moreInts);
// Produces a list "backed by" an array:
List<Integer> list = Arrays.asList(16,17,18,19,20);
list.set(1, 99); // OK -- modify an element
// list.add(21); // Runtime error; the underlying
// array cannot be resized.
System.out.println(collection);
System.out.println(list);
}
}
| [
"[email protected]"
] | |
d2690e99ae41ccf4f84b95cac40aa768f62cc2de | 6b0cc0c8f9619c24a8ca30606d2fb41fc8fb9dc7 | /fabric/fabric-commands/src/main/java/io/fabric8/commands/ProfileRefreshAction.java | 534f5a5a1db318c8ef7ddedc9133d1d4259ff87a | [
"Apache-2.0"
] | permissive | brozow/fabric8 | ae52aa1270bd21eed48b82f724ddb70213e6de50 | 82ecd4d0493e704c6a3de27d22437b2b2009472a | refs/heads/master | 2020-12-25T10:42:27.785835 | 2014-07-11T07:42:28 | 2014-07-11T13:22:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,409 | java | /**
* Copyright 2005-2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.fabric8.commands;
import io.fabric8.api.FabricService;
import io.fabric8.api.Profile;
import io.fabric8.api.Version;
import io.fabric8.utils.FabricValidations;
import io.fabric8.zookeeper.ZkDefs;
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.karaf.shell.console.AbstractAction;
@Command(name = "profile-refresh", scope = "fabric", description = "Performs a change to the profile, that triggers the deployment agent. It's intended to be used for scanning for snapshot changes", detailedDescription = "classpath:profileRefresh.txt")
public class ProfileRefreshAction extends AbstractAction {
@Argument(index = 0, name = "profile", description = "The target profile to edit", required = true, multiValued = false)
private String profileName;
@Argument(index = 1, name = "version", description = "The version of the profile to edit. Defaults to the current default version.", required = false, multiValued = false)
private String versionName = ZkDefs.DEFAULT_VERSION;
private final FabricService fabricService;
ProfileRefreshAction(FabricService fabricService) {
this.fabricService = fabricService;
}
public FabricService getFabricService() {
return fabricService;
}
@Override
protected Object doExecute() throws Exception {
FabricValidations.validateProfileName(profileName);
Version version = versionName != null ? fabricService.getVersion(versionName) : fabricService.getDefaultVersion();
Profile profile = version.getProfile(profileName);
if (profile == null) {
throw new IllegalArgumentException("No profile found with name:" + profileName + " and version:" + version.getId());
}
profile.refresh();
return null;
}
}
| [
"[email protected]"
] | |
c7db4299aab2fc8ef426f42e4561fb41bca6f268 | 297096090165fdc3bd77db64cccf63c9d32dea99 | /src/main/java/com/example/filedown/service/FileService.java | 7c5b5a93a01d61d1974fc86415142724c9f5e3cb | [] | no_license | XDFHTY/filedown | b5ba863ce39b6455546445c1a50f45e24ed8cac5 | ed007b41a36ffc79f88179c372408d8eaa49d4ab | refs/heads/master | 2021-03-31T02:17:36.386009 | 2018-03-11T10:04:54 | 2018-03-11T10:04:54 | 124,743,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 454 | java | package com.example.filedown.service;
import com.example.filedown.entity.DownWx;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public interface FileService {
//添加微信助手下载记录
public int addDownWX(DownWx downWx);
//文件下载
public void downLoad(HttpServletRequest request, HttpServletResponse response, String name) throws IOException;
}
| [
"[email protected]"
] | |
43942433f8210c67711f98980d01859d728abf36 | 9a62169ace507c0be95adf3f86c849b0dc144c3e | /tests/softtest/test/c/gcc/regression/UFM_PRE.java | bcb1404fe72d4c33bbeec1f0b59bc03b37ff741c | [] | no_license | 13001090108/DTSEmbed_LSC | 84b2e7edbf1c7f5162b19f06c892a5b42d3ad88e | 38cc44c10304458e923a1a834faa6b0ca216c0e2 | refs/heads/master | 2020-04-02T05:27:57.577850 | 2018-10-22T06:28:28 | 2018-10-22T06:28:28 | 154,078,761 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 22,435 | java | package softtest.test.c.gcc.regression;
import java.util.Arrays;
import java.util.Collection;
import java.util.Set;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import softtest.fsm.c.FSMLoader;
import softtest.fsm.c.FSMMachine;
import softtest.fsmanalysis.c.FSMAnalysisVisitor;
import softtest.interpro.c.InterContext;
import softtest.symboltable.c.MethodNameDeclaration;
import softtest.test.c.rules.ModelTestBase;
@RunWith(Parameterized.class)
public class UFM_PRE extends ModelTestBase {
public UFM_PRE(String source,String compiletype, String result)
{
super(source, compiletype, result);
}
@BeforeClass
public static void setUpBaseChild()
{
fsmPath="softtest/rules/gcc/fault/UFM_PRE-0.1.xml";
FSMMachine fsm = FSMLoader.loadXML(fsmPath);
fsm.setType("fault");
//每次加入自动机前都清空一下原来的fsms
FSMAnalysisVisitor.clearFSMS();
FSMAnalysisVisitor.addFSMS(fsm);
//加载库函数摘要
LIB_SUMMARYS_PATH="gcc_lib/npd_summary.xml";
libManager.loadSingleLibFile(LIB_SUMMARYS_PATH);
Set<MethodNameDeclaration> libDecls = libManager.compileLib(pre.getLibIncludes());
interContext = InterContext.getInstance();
interContext.addLibMethodDecl(libDecls);
}
@Parameters
public static Collection<Object[]> testcaseAndResults()
{
return Arrays.asList(new Object[][] {
///////////////// 0 ///////////////////
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"void func2(int*);" +"\n"+
"int func3(int*);" +"\n"+
"" +"\n"+
"void func1()" +"\n"+
"{" +"\n"+
" int *ptr;" +"\n"+
"" +"\n"+
" ptr = (int*)malloc(sizeof(int));" +"\n"+
" func2(ptr);" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int *ptr)" +"\n"+
"{" +"\n"+
"" +"\n"+
" free(ptr);" +"\n"+
" func3(ptr); //DEFECT" +"\n"+
"}" +"\n"+
"" +"\n"+
"int func3(int *ptr)" +"\n"+
"{" +"\n"+
" return *ptr;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 1 ///////////////////
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"void func2(int, int*);" +"\n"+
"int func3(int*);" +"\n"+
"" +"\n"+
"void func1(int flag)" +"\n"+
"{" +"\n"+
" int *ptr;" +"\n"+
"" +"\n"+
" ptr = (int*)malloc(sizeof(int));" +"\n"+
" if (flag > 0) {" +"\n"+
" free(ptr);" +"\n"+
" }" +"\n"+
" func2(ptr,0); //DEFECT" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int *ptr,int n)" +"\n"+
"{" +"\n"+
" func3(ptr);" +"\n"+
"}" +"\n"+
"" +"\n"+
"int func3(int *ptr)" +"\n"+
"{" +"\n"+
" return *ptr;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 2 ///////////////////
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"#define SIZE 5" +"\n"+
"" +"\n"+
"void func2(int, int*);" +"\n"+
"int func3(int*);" +"\n"+
"" +"\n"+
"void func1(int flag)" +"\n"+
"{" +"\n"+
" int *ptr;" +"\n"+
"" +"\n"+
" ptr = (int*)malloc(SIZE*sizeof(int));" +"\n"+
" if (flag > 0) {" +"\n"+
" free(ptr);" +"\n"+
" }" +"\n"+
" func2(0, ptr); //DEFECT" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int n, int *ptr)" +"\n"+
"{" +"\n"+
" func3(ptr);" +"\n"+
"}" +"\n"+
"" +"\n"+
"int func3(int *ptr)" +"\n"+
"{" +"\n"+
" return ptr[SIZE-1];" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 3 ///////////////////
//hcj函数摘要问题,待改进
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"int *g_ptr = NULL;" +"\n"+
"" +"\n"+
"void func2(int);" +"\n"+
"void func3();" +"\n"+
"" +"\n"+
"void func1(int flag)" +"\n"+
"{" +"\n"+
" g_ptr = (int*)malloc(sizeof(int));" +"\n"+
" func2(flag);" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int flag)" +"\n"+
"{" +"\n"+
" if (flag > 0) {" +"\n"+
" free(g_ptr);" +"\n"+
" func3(); //DEFECT" +"\n"+
" } else {" +"\n"+
" func3(); //FP" +"\n"+
" return;" +"\n"+
" }" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func3()" +"\n"+
"{" +"\n"+
" (*g_ptr)++;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 4 ///////////////////
//hcj函数摘要问题,待改进
{
"#include <stdlib.h>" +"\n"+
"" +"\n"+
"#define SIZE 5" +"\n"+
"" +"\n"+
"int *g_ptr = NULL;" +"\n"+
"" +"\n"+
"void func2(int);" +"\n"+
"void func3();" +"\n"+
"" +"\n"+
"void func1(int flag)" +"\n"+
"{" +"\n"+
" g_ptr = (int*)malloc(SIZE*sizeof(int));" +"\n"+
" func2(flag);" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func2(int flag)" +"\n"+
"{" +"\n"+
" if (flag > 0) {" +"\n"+
" free(g_ptr);" +"\n"+
" func3(); //DEFECT" +"\n"+
" } else {" +"\n"+
" func3(); //FP" +"\n"+
" return;" +"\n"+
" }" +"\n"+
"}" +"\n"+
"" +"\n"+
"void func3()" +"\n"+
"{" +"\n"+
" g_ptr[SIZE-1]++;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 5 ///////////////////
{
"#include <stdio.h>" +"\n"+
"#include <stdlib.h>" +"\n"+
"typedef struct{" +"\n"+
" char* p;" +"\n"+
"}S;" +"\n"+
"S s;" +"\n"+
"char* p;" +"\n"+
"void f(){" +"\n"+
" *(s.p)='a';" +"\n"+
"}" +"\n"+
"" +"\n"+
"void f1(){" +"\n"+
" f();" +"\n"+
"}" +"\n"+
"void f2(){" +"\n"+
" free(s.p);" +"\n"+
"}" +"\n"+
"void f3(){" +"\n"+
" s.p=malloc(11);" +"\n"+
" f2();" +"\n"+
" f1();" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 6 ///////////////////
{
"#include <stdio.h>" +"\n"+
"#include <malloc.h>" +"\n"+
"typedef struct{" +"\n"+
" char* p;" +"\n"+
"}S;" +"\n"+
"S s;" +"\n"+
"char* p;" +"\n"+
"void f(){" +"\n"+
" *p='a';" +"\n"+
"}" +"\n"+
"" +"\n"+
"void f1(){" +"\n"+
" f();" +"\n"+
"}" +"\n"+
"void f2(){" +"\n"+
" free(p);" +"\n"+
"}" +"\n"+
"void f3(){" +"\n"+
" p=malloc(11);" +"\n"+
" f2();" +"\n"+
" f1();" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 7 ///////////////////
{
" #include <stdlib.h>" +"\n"+
" struct s{" +"\n"+
" int *j;" +"\n"+
" };" +"\n"+
" struct e{" +"\n"+
" struct s * x; " +"\n"+
" }g;" +"\n"+
" " +"\n"+
" void func() {" +"\n"+
" *g.x =1;" +"\n"+
" " +"\n"+
" }" +"\n"+
" " +"\n"+
" int *foo(int t) {" +"\n"+
" " +"\n"+
" (g.x)->j = (int *)malloc(1);" +"\n"+
" if (!t) {" +"\n"+
" free(g.x);" +"\n"+
" }" +"\n"+
" func();" +"\n"+
" return 0;" +"\n"+
" }"
,
"gcc"
,
"UFM_PRE"
,
},
///////////////// 0 ///////////////////
{
"#include <stdlib.h>" +"\n"+
"char *p[10];" +"\n"+
"void foo_6_5() {" +"\n"+
" *p[0] = 'a';" +"\n"+
"}" +"\n"+
"int bar_6_5() {" +"\n"+
" p[0] = (char *)malloc(sizeof(char));" +"\n"+
" free(p[0]);" +"\n"+
" foo_6_5();" +"\n"+
" return 0;" +"\n"+
"}"
,
"gcc"
,
"UFM_PRE"
,
},
});
}
}
| [
"[email protected]"
] | |
67c59c3f69ed7b4b583db86b79a0496b49181a95 | 42aa3166508e973c881086aa411b7b61e447b3ab | /HerbertSchildtWork/src/Chapter1/IfDemo.java | 07b9206fc3a8d7181f04f4c0a7e4110c5a25f93e | [] | no_license | JadenTurnbull/JavaBeginner | 1eb7708d03c8fd24eb3c2c462cde0ac4ee65f073 | 0658328b1db049ed26d3f0d0e4b035acfd6a1862 | refs/heads/main | 2023-08-02T15:09:17.856672 | 2021-09-29T08:38:19 | 2021-09-29T08:38:19 | 389,636,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 867 | 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 Chapter1;
/**
*
* @author jaden
*/
public class IfDemo {
public static void main(String args[]) {
int a, b, c;
a = 2;
b = 3;
if(a < b) System.out.println("a is less than b");
if(a == b) System.out.println("won't display");
System.out.println();
c = a - b;
System.out.println("c contains -1");
if(c >= 0) System.out.println("c is non-negative");
if(c < 0) System.out.println("c is negative");
System.out.println();
c = b - a;
System.out.println("c contains 1");
if(c >= 0) System.out.println("c is non-negative");
if(c < 0) System.out.println("c is negative");
}
}
| [
"[email protected]"
] | |
f15bcdba9d0fddbed848140ec6374977465ca4db | 91693332d08bd19e3722c1e4b11f023ea5bf80a4 | /src/main/java/pages/InterestedInPage.java | 230e8d347464c9a6d9b82bb7860e8979a7f1fc7a | [] | no_license | stritenko/AngelList | 358f6f7d7eb44e697ec3da8d1b2a0aa94a5b151c | 475e68767a006acde535708fa6f3e15e59231429 | refs/heads/master | 2021-08-23T06:30:44.894295 | 2017-12-03T22:37:44 | 2017-12-03T22:37:44 | 112,968,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 522 | java | package pages;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
/**
* Created by Marina on 12/3/2017.
*/
public class InterestedInPage extends ParentPage {
@FindBy(xpath=".//*[@id='root']/div[4]/div/form/div/div[6]/a")
WebElement skipButton;
public InterestedInPage(WebDriver webDriver) {
super(webDriver);
}
public void clickOnskipButton(){
actionWithOurElements.clickOnElement(skipButton);
}
}
| [
"[email protected]"
] | |
702c98e76c0441e3fc12522c951aed8400431396 | d8759216411241a72c669012661b092deb0b0ffc | /sources/gnu/expr/Language.java | d7650e057b997e3481ac2440549b92786f0843e4 | [] | no_license | indraja95/SmartParkingSystem | eba63c2d6d8f36860edbd4d1f09f37749d2302df | dc5c868a1d74794108a16d69cea606845f96080d | refs/heads/master | 2023-04-01T18:58:15.337029 | 2021-04-02T22:48:53 | 2021-04-02T22:48:53 | 313,754,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,585 | java | package gnu.expr;
import gnu.bytecode.ArrayType;
import gnu.bytecode.ClassType;
import gnu.bytecode.CodeAttr;
import gnu.bytecode.PrimType;
import gnu.bytecode.Type;
import gnu.kawa.lispexpr.ClassNamespace;
import gnu.kawa.reflect.ClassMemberLocation;
import gnu.kawa.reflect.StaticFieldLocation;
import gnu.lists.AbstractFormat;
import gnu.lists.CharSeq;
import gnu.lists.Consumer;
import gnu.lists.Convert;
import gnu.lists.FString;
import gnu.lists.PrintConsumer;
import gnu.mapping.CallContext;
import gnu.mapping.CharArrayInPort;
import gnu.mapping.Environment;
import gnu.mapping.EnvironmentKey;
import gnu.mapping.InPort;
import gnu.mapping.Location;
import gnu.mapping.Named;
import gnu.mapping.NamedLocation;
import gnu.mapping.Namespace;
import gnu.mapping.OutPort;
import gnu.mapping.Procedure;
import gnu.mapping.SimpleSymbol;
import gnu.mapping.Symbol;
import gnu.mapping.Values;
import gnu.mapping.WrappedException;
import gnu.text.Lexer;
import gnu.text.SourceMessages;
import gnu.text.SyntaxException;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.Writer;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import kawa.repl;
import org.shaded.apache.http.HttpStatus;
public abstract class Language {
public static final int FUNCTION_NAMESPACE = 2;
public static final int NAMESPACE_PREFIX_NAMESPACE = 4;
public static final int PARSE_CURRENT_NAMES = 2;
public static final int PARSE_EXPLICIT = 64;
public static final int PARSE_FOR_APPLET = 16;
public static final int PARSE_FOR_EVAL = 3;
public static final int PARSE_FOR_SERVLET = 32;
public static final int PARSE_IMMEDIATE = 1;
public static final int PARSE_ONE_LINE = 4;
public static final int PARSE_PROLOG = 8;
public static final int VALUE_NAMESPACE = 1;
protected static final InheritableThreadLocal<Language> current = new InheritableThreadLocal<>();
static int envCounter;
protected static int env_counter = 0;
protected static Language global;
static String[][] languages = {new String[]{"scheme", ".scm", ".sc", "kawa.standard.Scheme"}, new String[]{"krl", ".krl", "gnu.kawa.brl.BRL"}, new String[]{"brl", ".brl", "gnu.kawa.brl.BRL"}, new String[]{"emacs", "elisp", "emacs-lisp", ".el", "gnu.jemacs.lang.ELisp"}, new String[]{"xquery", ".xquery", ".xq", ".xql", "gnu.xquery.lang.XQuery"}, new String[]{"q2", ".q2", "gnu.q2.lang.Q2"}, new String[]{"xslt", "xsl", ".xsl", "gnu.kawa.xslt.XSLT"}, new String[]{"commonlisp", "common-lisp", "clisp", "lisp", ".lisp", ".lsp", ".cl", "gnu.commonlisp.lang.CommonLisp"}};
public static boolean requirePedantic;
protected Environment environ;
protected Environment userEnv;
public abstract Lexer getLexer(InPort inPort, SourceMessages sourceMessages);
public abstract boolean parse(Compilation compilation, int i) throws IOException, SyntaxException;
static {
Environment.setGlobal(BuiltinEnvironment.getInstance());
}
public static Language getDefaultLanguage() {
Language lang = (Language) current.get();
return lang != null ? lang : global;
}
public static void setCurrentLanguage(Language language) {
current.set(language);
}
public static Language setSaveCurrent(Language language) {
Language save = (Language) current.get();
current.set(language);
return save;
}
public static void restoreCurrent(Language saved) {
current.set(saved);
}
public static String[][] getLanguages() {
return languages;
}
public static void registerLanguage(String[] langMapping) {
String[][] newLangs = new String[(languages.length + 1)][];
System.arraycopy(languages, 0, newLangs, 0, languages.length);
newLangs[newLangs.length - 1] = langMapping;
languages = newLangs;
}
public static Language detect(InputStream in) throws IOException {
if (!in.markSupported()) {
return null;
}
StringBuffer sbuf = new StringBuffer();
in.mark(200);
while (sbuf.length() < 200) {
int c = in.read();
if (c < 0 || c == 10 || c == 13) {
break;
}
sbuf.append((char) c);
}
in.reset();
return detect(sbuf.toString());
}
public static Language detect(InPort port) throws IOException {
StringBuffer sbuf = new StringBuffer();
port.mark(HttpStatus.SC_MULTIPLE_CHOICES);
port.readLine(sbuf, 'P');
port.reset();
return detect(sbuf.toString());
}
public static Language detect(String line) {
String str = line.trim();
int k = str.indexOf("kawa:");
if (k >= 0) {
int i = k + 5;
int j = i;
while (j < str.length() && Character.isJavaIdentifierPart(str.charAt(j))) {
j++;
}
if (j > i) {
Language lang = getInstance(str.substring(i, j));
if (lang != null) {
return lang;
}
}
}
if (str.indexOf("-*- scheme -*-") >= 0) {
return getInstance("scheme");
}
if (str.indexOf("-*- xquery -*-") >= 0) {
return getInstance("xquery");
}
if (str.indexOf("-*- emacs-lisp -*-") >= 0) {
return getInstance("elisp");
}
if (str.indexOf("-*- common-lisp -*-") >= 0 || str.indexOf("-*- lisp -*-") >= 0) {
return getInstance("common-lisp");
}
if ((str.charAt(0) == '(' && str.charAt(1) == ':') || (str.length() >= 7 && str.substring(0, 7).equals("xquery "))) {
return getInstance("xquery");
}
if (str.charAt(0) == ';' && str.charAt(1) == ';') {
return getInstance("scheme");
}
return null;
}
public static Language getInstanceFromFilenameExtension(String filename) {
int dot = filename.lastIndexOf(46);
if (dot > 0) {
Language lang = getInstance(filename.substring(dot));
if (lang != null) {
return lang;
}
}
return null;
}
public static Language getInstance(String name) {
int langCount = languages.length;
int i = 0;
while (i < langCount) {
String[] names = languages[i];
int nameCount = names.length - 1;
int j = nameCount;
do {
j--;
if (j >= 0) {
if (name != null) {
}
break;
}
i++;
} while (!names[j].equalsIgnoreCase(name));
try {
break;
return getInstance(names[0], Class.forName(names[nameCount]));
} catch (ClassNotFoundException e) {
}
}
return null;
}
protected Language() {
Convert.setInstance(KawaConvert.getInstance());
}
public static Language getInstance(String langName, Class langClass) {
Throwable th;
Method method;
try {
Class[] args = new Class[0];
try {
method = langClass.getDeclaredMethod("get" + (Character.toTitleCase(langName.charAt(0)) + langName.substring(1).toLowerCase()) + "Instance", args);
} catch (Exception e) {
method = langClass.getDeclaredMethod("getInstance", args);
}
return (Language) method.invoke(null, Values.noArgs);
} catch (Exception e2) {
String langName2 = langClass.getName();
if (e2 instanceof InvocationTargetException) {
th = ((InvocationTargetException) e2).getTargetException();
} else {
th = e2;
}
throw new WrappedException("getInstance for '" + langName2 + "' failed", th);
}
}
public boolean isTrue(Object value) {
return value != Boolean.FALSE;
}
public Object booleanObject(boolean b) {
return b ? Boolean.TRUE : Boolean.FALSE;
}
public Object noValue() {
return Values.empty;
}
public boolean hasSeparateFunctionNamespace() {
return false;
}
public final Environment getEnvironment() {
return this.userEnv != null ? this.userEnv : Environment.getCurrent();
}
public final Environment getNewEnvironment() {
StringBuilder append = new StringBuilder().append("environment-");
int i = envCounter + 1;
envCounter = i;
return Environment.make(append.append(i).toString(), this.environ);
}
public Environment getLangEnvironment() {
return this.environ;
}
public NamedLocation lookupBuiltin(Symbol name, Object property, int hash) {
if (this.environ == null) {
return null;
}
return this.environ.lookup(name, property, hash);
}
public void define(String sym, Object p) {
this.environ.define(getSymbol(sym), null, p);
}
/* access modifiers changed from: protected */
public void defAliasStFld(String name, String cname, String fname) {
StaticFieldLocation.define(this.environ, getSymbol(name), null, cname, fname);
}
/* access modifiers changed from: protected */
public void defProcStFld(String name, String cname, String fname) {
StaticFieldLocation.define(this.environ, getSymbol(name), hasSeparateFunctionNamespace() ? EnvironmentKey.FUNCTION : null, cname, fname).setProcedure();
}
/* access modifiers changed from: protected */
public void defProcStFld(String name, String cname) {
defProcStFld(name, cname, Compilation.mangleNameIfNeeded(name));
}
public final void defineFunction(Named proc) {
Object name = proc.getSymbol();
this.environ.define(name instanceof Symbol ? (Symbol) name : getSymbol(name.toString()), hasSeparateFunctionNamespace() ? EnvironmentKey.FUNCTION : null, proc);
}
public void defineFunction(String name, Object proc) {
this.environ.define(getSymbol(name), hasSeparateFunctionNamespace() ? EnvironmentKey.FUNCTION : null, proc);
}
public Object getEnvPropertyFor(Field fld, Object value) {
if (hasSeparateFunctionNamespace() && Compilation.typeProcedure.getReflectClass().isAssignableFrom(fld.getType())) {
return EnvironmentKey.FUNCTION;
}
return null;
}
public Object getEnvPropertyFor(Declaration decl) {
if (!hasSeparateFunctionNamespace() || !decl.isProcedureDecl()) {
return null;
}
return EnvironmentKey.FUNCTION;
}
public void loadClass(String name) throws ClassNotFoundException {
try {
try {
Object inst = Class.forName(name).newInstance();
ClassMemberLocation.defineAll(inst, this, Environment.getCurrent());
if (inst instanceof ModuleBody) {
((ModuleBody) inst).run();
}
} catch (Exception ex) {
throw new WrappedException("cannot load " + name, ex);
}
} catch (ClassNotFoundException ex2) {
throw ex2;
}
}
public Symbol getSymbol(String name) {
return this.environ.getSymbol(name);
}
public Object lookup(String name) {
return this.environ.get((Object) name);
}
public AbstractFormat getFormat(boolean readable) {
return null;
}
public Consumer getOutputConsumer(Writer out) {
OutPort oport = out instanceof OutPort ? (OutPort) out : new OutPort(out);
oport.objectFormat = getFormat(false);
return oport;
}
public String getName() {
String name = getClass().getName();
int dot = name.lastIndexOf(46);
if (dot >= 0) {
return name.substring(dot + 1);
}
return name;
}
public Compilation getCompilation(Lexer lexer, SourceMessages messages, NameLookup lexical) {
return new Compilation(this, messages, lexical);
}
public final Compilation parse(InPort port, SourceMessages messages, int options) throws IOException, SyntaxException {
return parse(getLexer(port, messages), options, (ModuleInfo) null);
}
public final Compilation parse(InPort port, SourceMessages messages, ModuleInfo info) throws IOException, SyntaxException {
return parse(getLexer(port, messages), 8, info);
}
public final Compilation parse(InPort port, SourceMessages messages, int options, ModuleInfo info) throws IOException, SyntaxException {
return parse(getLexer(port, messages), options, info);
}
public final Compilation parse(Lexer lexer, int options, ModuleInfo info) throws IOException, SyntaxException {
SourceMessages messages = lexer.getMessages();
NameLookup lexical = (options & 2) != 0 ? NameLookup.getInstance(getEnvironment(), this) : new NameLookup(this);
boolean immediate = (options & 1) != 0;
Compilation tr = getCompilation(lexer, messages, lexical);
if (requirePedantic) {
tr.pedantic = true;
}
if (!immediate) {
tr.mustCompile = true;
}
tr.immediate = immediate;
tr.langOptions = options;
if ((options & 64) != 0) {
tr.explicit = true;
}
if ((options & 8) != 0) {
tr.setState(1);
}
tr.pushNewModule(lexer);
if (info != null) {
info.setCompilation(tr);
}
if (!parse(tr, options)) {
return null;
}
if (tr.getState() != 1) {
return tr;
}
tr.setState(2);
return tr;
}
public void resolve(Compilation comp) {
}
public Type getTypeFor(Class clas) {
return Type.make(clas);
}
public final Type getLangTypeFor(Type type) {
if (!type.isExisting()) {
return type;
}
Class clas = type.getReflectClass();
if (clas != null) {
return getTypeFor(clas);
}
return type;
}
public String formatType(Type type) {
return type.getName();
}
public static Type string2Type(String name) {
if (name.endsWith("[]")) {
Type t = string2Type(name.substring(0, name.length() - 2));
if (t == null) {
return null;
}
return ArrayType.make(t);
} else if (Type.isValidJavaTypeName(name)) {
return Type.getType(name);
} else {
return null;
}
}
public Type getTypeFor(String name) {
return string2Type(name);
}
public final Type getTypeFor(Object spec, boolean lenient) {
if (spec instanceof Type) {
return (Type) spec;
}
if (spec instanceof Class) {
return getTypeFor((Class) spec);
}
if (lenient && ((spec instanceof FString) || (spec instanceof String) || (((spec instanceof Symbol) && ((Symbol) spec).hasEmptyNamespace()) || (spec instanceof CharSeq)))) {
return getTypeFor(spec.toString());
}
if (spec instanceof Namespace) {
String uri = ((Namespace) spec).getName();
if (uri != null && uri.startsWith("class:")) {
return getLangTypeFor(string2Type(uri.substring(6)));
}
}
return null;
}
public final Type asType(Object spec) {
Type type = getTypeFor(spec, true);
return type == null ? (Type) spec : type;
}
public final Type getTypeFor(Expression exp) {
return getTypeFor(exp, true);
}
public Type getTypeFor(Expression exp, boolean lenient) {
if (exp instanceof QuoteExp) {
Object value = ((QuoteExp) exp).getValue();
if (value instanceof Type) {
return (Type) value;
}
if (value instanceof Class) {
return Type.make((Class) value);
}
return getTypeFor(value, lenient);
} else if (exp instanceof ReferenceExp) {
ReferenceExp rexp = (ReferenceExp) exp;
Declaration decl = Declaration.followAliases(rexp.getBinding());
String name = rexp.getName();
if (decl != null) {
Expression exp2 = decl.getValue();
if ((exp2 instanceof QuoteExp) && decl.getFlag(16384) && !decl.isIndirectBinding()) {
return getTypeFor(((QuoteExp) exp2).getValue(), lenient);
}
if ((exp2 instanceof ClassExp) || (exp2 instanceof ModuleExp)) {
decl.setCanRead(true);
return ((LambdaExp) exp2).getClassType();
} else if (decl.isAlias() && (exp2 instanceof QuoteExp)) {
Object val = ((QuoteExp) exp2).getValue();
if (val instanceof Location) {
Location loc = (Location) val;
if (loc.isBound()) {
return getTypeFor(loc.get(), lenient);
}
if (!(loc instanceof Named)) {
return null;
}
name = ((Named) loc).getName();
}
} else if (!decl.getFlag(65536)) {
return getTypeFor(exp2, lenient);
}
}
Object val2 = getEnvironment().get((Object) name);
if (val2 instanceof Type) {
return (Type) val2;
}
if (val2 instanceof ClassNamespace) {
return ((ClassNamespace) val2).getClassType();
}
int len = name.length();
if (len > 2 && name.charAt(0) == '<' && name.charAt(len - 1) == '>') {
return getTypeFor(name.substring(1, len - 1));
}
return null;
} else if ((exp instanceof ClassExp) || (exp instanceof ModuleExp)) {
return ((LambdaExp) exp).getClassType();
} else {
return null;
}
}
public static Type unionType(Type t1, Type t2) {
if (t1 == Type.toStringType) {
t1 = Type.javalangStringType;
}
if (t2 == Type.toStringType) {
t2 = Type.javalangStringType;
}
if (t1 == t2) {
return t1;
}
if (!(t1 instanceof PrimType) || !(t2 instanceof PrimType)) {
return Type.objectType;
}
char sig1 = t1.getSignature().charAt(0);
char sig2 = t2.getSignature().charAt(0);
if (sig1 == sig2) {
return t1;
}
if ((sig1 == 'B' || sig1 == 'S' || sig1 == 'I') && (sig2 == 'I' || sig2 == 'J')) {
return t2;
}
if ((sig2 == 'B' || sig2 == 'S' || sig2 == 'I') && (sig1 == 'I' || sig1 == 'J')) {
return t1;
}
if (sig1 == 'F' && sig2 == 'D') {
return t2;
}
if (sig2 == 'F' && sig1 == 'D') {
return t1;
}
return Type.objectType;
}
public Declaration declFromField(ModuleExp mod, Object fvalue, gnu.bytecode.Field fld) {
Object obj;
Object make;
String fname = fld.getName();
Type ftype = fld.getType();
boolean isAlias = ftype.isSubtype(Compilation.typeLocation);
boolean externalAccess = false;
boolean isFinal = (fld.getModifiers() & 16) != 0;
boolean isImportedInstance = fname.endsWith("$instance");
if (isImportedInstance) {
make = fname;
} else if (!isFinal || !(fvalue instanceof Named)) {
if (fname.startsWith(Declaration.PRIVATE_PREFIX)) {
externalAccess = true;
fname = fname.substring(Declaration.PRIVATE_PREFIX.length());
}
make = Compilation.demangleName(fname, true).intern();
} else {
make = ((Named) fvalue).getSymbol();
}
if (obj instanceof String) {
String uri = mod.getNamespaceUri();
String sname = (String) obj;
if (uri == null) {
obj = SimpleSymbol.valueOf(sname);
} else {
obj = Symbol.make(uri, sname);
}
}
Declaration fdecl = mod.addDeclaration(obj, isAlias ? Type.objectType : getTypeFor(ftype.getReflectClass()));
boolean isStatic = (fld.getModifiers() & 8) != 0;
if (isAlias) {
fdecl.setIndirectBinding(true);
if ((ftype instanceof ClassType) && ((ClassType) ftype).isSubclass("gnu.mapping.ThreadLocation")) {
fdecl.setFlag(268435456);
}
} else if (isFinal && (ftype instanceof ClassType)) {
if (ftype.isSubtype(Compilation.typeProcedure)) {
fdecl.setProcedureDecl(true);
} else if (((ClassType) ftype).isSubclass("gnu.mapping.Namespace")) {
fdecl.setFlag(2097152);
}
}
if (isStatic) {
fdecl.setFlag(2048);
}
fdecl.field = fld;
if (isFinal && !isAlias) {
fdecl.setFlag(16384);
}
if (isImportedInstance) {
fdecl.setFlag(1073741824);
}
fdecl.setSimple(false);
if (externalAccess) {
fdecl.setFlag(524320);
}
return fdecl;
}
public int getNamespaceOf(Declaration decl) {
return 1;
}
public boolean hasNamespace(Declaration decl, int namespace) {
return (getNamespaceOf(decl) & namespace) != 0;
}
public void emitPushBoolean(boolean value, CodeAttr code) {
code.emitGetStatic(value ? Compilation.trueConstant : Compilation.falseConstant);
}
public void emitCoerceToBoolean(CodeAttr code) {
emitPushBoolean(false, code);
code.emitIfNEq();
code.emitPushInt(1);
code.emitElse();
code.emitPushInt(0);
code.emitFi();
}
public Object coerceFromObject(Class clas, Object obj) {
return getTypeFor(clas).coerceFromObject(obj);
}
public Object coerceToObject(Class clas, Object obj) {
return getTypeFor(clas).coerceToObject(obj);
}
public static synchronized void setDefaults(Language lang) {
synchronized (Language.class) {
setCurrentLanguage(lang);
global = lang;
if (Environment.getGlobal() == BuiltinEnvironment.getInstance()) {
Environment.setGlobal(Environment.getCurrent());
}
}
}
public Procedure getPrompter() {
Object property = null;
if (hasSeparateFunctionNamespace()) {
property = EnvironmentKey.FUNCTION;
}
Procedure prompter = (Procedure) getEnvironment().get(getSymbol("default-prompter"), property, null);
return prompter != null ? prompter : new SimplePrompter();
}
public final Object eval(String string) throws Throwable {
return eval((InPort) new CharArrayInPort(string));
}
public final Object eval(Reader in) throws Throwable {
return eval(in instanceof InPort ? (InPort) in : new InPort(in));
}
public final Object eval(InPort port) throws Throwable {
CallContext ctx = CallContext.getInstance();
int oldIndex = ctx.startFromContext();
try {
eval(port, ctx);
return ctx.getFromContext(oldIndex);
} catch (Throwable ex) {
ctx.cleanupFromContext(oldIndex);
throw ex;
}
}
public final void eval(String string, Writer out) throws Throwable {
eval((Reader) new CharArrayInPort(string), out);
}
public final void eval(String string, PrintConsumer out) throws Throwable {
eval(string, getOutputConsumer(out));
}
public final void eval(String string, Consumer out) throws Throwable {
eval((Reader) new CharArrayInPort(string), out);
}
public final void eval(Reader in, Writer out) throws Throwable {
eval(in, getOutputConsumer(out));
}
public void eval(Reader in, Consumer out) throws Throwable {
InPort port = in instanceof InPort ? (InPort) in : new InPort(in);
CallContext ctx = CallContext.getInstance();
Consumer save = ctx.consumer;
try {
ctx.consumer = out;
eval(port, ctx);
} finally {
ctx.consumer = save;
}
}
/* JADX INFO: finally extract failed */
public void eval(InPort port, CallContext ctx) throws Throwable {
SourceMessages messages = new SourceMessages();
Language saveLang = setSaveCurrent(this);
try {
ModuleExp.evalModule(getEnvironment(), ctx, parse(port, messages, 3), null, null);
restoreCurrent(saveLang);
if (messages.seenErrors()) {
throw new RuntimeException("invalid syntax in eval form:\n" + messages.toString(20));
}
} catch (Throwable th) {
restoreCurrent(saveLang);
throw th;
}
}
public void runAsApplication(String[] args) {
setDefaults(this);
repl.main(args);
}
}
| [
"[email protected]"
] | |
f2a5c6a484b70f03671998e177028177917588a9 | ebbefa670b78d837b27a5cc2c128d8fc46b6e4c7 | /app/src/main/java/com/example/arcgis_for_android/ui/tools/ToolsViewModel.java | f57de3e0b5f0964b02d6955b634771cf263d3a19 | [] | no_license | lichuan1984/GIS | 23eaffcc7dd1e3cae54a00da252ebca998fe6f82 | f98afaf58673443c424d90bf82259e09925255a8 | refs/heads/master | 2020-12-27T13:14:05.206762 | 2020-02-03T13:38:11 | 2020-02-03T13:38:11 | 237,914,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | package com.example.arcgis_for_android.ui.tools;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class ToolsViewModel extends ViewModel {
private MutableLiveData<String> mText;
public ToolsViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is tools fragment");
}
public LiveData<String> getText() {
return mText;
}
} | [
"[email protected]"
] | |
94df8f9d86eecf28e46b476bc51e4c915af7a896 | edea1336b3d7d6337b942b8771d72de23a487454 | /lzrdm1000/Generated JUIC files/trolltech/examples/Ui_ValueControls.java | 344b1828bc2044b5c242dd2fed46dc553fe58fcb | [] | no_license | lodsb/lzrdm1000 | 0ef3eff1e3a451cba22838ee88b9d1b516f267c7 | 72e2c8f45369734a7f29c2367f96e375195cb508 | refs/heads/master | 2020-07-05T03:20:15.639857 | 2011-05-04T15:18:42 | 2011-05-04T15:18:42 | 1,701,728 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 12,341 | java | /********************************************************************************
** Form generated from reading ui file 'valuecontrols.jui'
**
** Created: Di Apr 14 23:02:41 2009
** by: Qt User Interface Compiler version 4.4.2
**
** WARNING! All changes made in this file will be lost when recompiling ui file!
********************************************************************************/
package trolltech.examples;
import com.trolltech.qt.core.*;
import com.trolltech.qt.gui.*;
public class Ui_ValueControls
{
public QVBoxLayout verticalLayout;
public QWidget ColorizeControlWidget;
public QFormLayout formLayout;
public QLabel label;
public QSlider colorizeRedSlider;
public QLabel label_2;
public QSlider colorizeGreenSlider;
public QLabel label_3;
public QSlider colorizeBlueSlider;
public QWidget DropShadowControlWidget;
public QFormLayout formLayout_2;
public QLabel label_4;
public QSlider dropShadowRedSlider;
public QLabel label_5;
public QSlider dropShadowGreenSlider;
public QLabel label_6;
public QSlider dropShadowBlueSlider;
public QLabel label_7;
public QSlider dropShadowXSlider;
public QLabel label_8;
public QSlider dropShadowYSlider;
public QLabel label_9;
public QSlider dropShadowRadiusSlider;
public QLabel label_10;
public QSlider dropShadowAlphaSlider;
public QWidget ConvolutionControlWidget;
public QGridLayout gridLayout;
public QLineEdit kernel_1x1;
public QLineEdit kernel_2x1;
public QLineEdit kernel_3x1;
public QLineEdit kernel_1x2;
public QLineEdit kernel_2x2;
public QLineEdit kernel_3x2;
public QLineEdit kernel_1x3;
public QLineEdit kernel_2x3;
public QLineEdit kernel_3x3;
public Ui_ValueControls() { super(); }
public void setupUi(QWidget ValueControls)
{
ValueControls.setObjectName("ValueControls");
ValueControls.setEnabled(true);
ValueControls.resize(new QSize(321, 420).expandedTo(ValueControls.minimumSizeHint()));
QSizePolicy sizePolicy = new QSizePolicy(com.trolltech.qt.gui.QSizePolicy.Policy.Preferred, com.trolltech.qt.gui.QSizePolicy.Policy.Preferred);
sizePolicy.setHorizontalStretch((byte)0);
sizePolicy.setVerticalStretch((byte)0);
sizePolicy.setHeightForWidth(ValueControls.sizePolicy().hasHeightForWidth());
ValueControls.setSizePolicy(sizePolicy);
verticalLayout = new QVBoxLayout(ValueControls);
verticalLayout.setObjectName("verticalLayout");
ColorizeControlWidget = new QWidget(ValueControls);
ColorizeControlWidget.setObjectName("ColorizeControlWidget");
formLayout = new QFormLayout(ColorizeControlWidget);
formLayout.setObjectName("formLayout");
label = new QLabel(ColorizeControlWidget);
label.setObjectName("label");
formLayout.addWidget(label);
colorizeRedSlider = new QSlider(ColorizeControlWidget);
colorizeRedSlider.setObjectName("colorizeRedSlider");
colorizeRedSlider.setValue(64);
colorizeRedSlider.setMaximum(255);
colorizeRedSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout.addWidget(colorizeRedSlider);
label_2 = new QLabel(ColorizeControlWidget);
label_2.setObjectName("label_2");
formLayout.addWidget(label_2);
colorizeGreenSlider = new QSlider(ColorizeControlWidget);
colorizeGreenSlider.setObjectName("colorizeGreenSlider");
colorizeGreenSlider.setValue(32);
colorizeGreenSlider.setMaximum(255);
colorizeGreenSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout.addWidget(colorizeGreenSlider);
label_3 = new QLabel(ColorizeControlWidget);
label_3.setObjectName("label_3");
formLayout.addWidget(label_3);
colorizeBlueSlider = new QSlider(ColorizeControlWidget);
colorizeBlueSlider.setObjectName("colorizeBlueSlider");
colorizeBlueSlider.setValue(99);
colorizeBlueSlider.setMaximum(255);
colorizeBlueSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout.addWidget(colorizeBlueSlider);
verticalLayout.addWidget(ColorizeControlWidget);
DropShadowControlWidget = new QWidget(ValueControls);
DropShadowControlWidget.setObjectName("DropShadowControlWidget");
formLayout_2 = new QFormLayout(DropShadowControlWidget);
formLayout_2.setObjectName("formLayout_2");
formLayout_2.setFieldGrowthPolicy(com.trolltech.qt.gui.QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow);
label_4 = new QLabel(DropShadowControlWidget);
label_4.setObjectName("label_4");
formLayout_2.addWidget(label_4);
dropShadowRedSlider = new QSlider(DropShadowControlWidget);
dropShadowRedSlider.setObjectName("dropShadowRedSlider");
dropShadowRedSlider.setMaximum(255);
dropShadowRedSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowRedSlider);
label_5 = new QLabel(DropShadowControlWidget);
label_5.setObjectName("label_5");
formLayout_2.addWidget(label_5);
dropShadowGreenSlider = new QSlider(DropShadowControlWidget);
dropShadowGreenSlider.setObjectName("dropShadowGreenSlider");
dropShadowGreenSlider.setMaximum(255);
dropShadowGreenSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowGreenSlider);
label_6 = new QLabel(DropShadowControlWidget);
label_6.setObjectName("label_6");
formLayout_2.addWidget(label_6);
dropShadowBlueSlider = new QSlider(DropShadowControlWidget);
dropShadowBlueSlider.setObjectName("dropShadowBlueSlider");
dropShadowBlueSlider.setMaximum(255);
dropShadowBlueSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowBlueSlider);
label_7 = new QLabel(DropShadowControlWidget);
label_7.setObjectName("label_7");
formLayout_2.addWidget(label_7);
dropShadowXSlider = new QSlider(DropShadowControlWidget);
dropShadowXSlider.setObjectName("dropShadowXSlider");
dropShadowXSlider.setMaximum(999);
dropShadowXSlider.setValue(600);
dropShadowXSlider.setMinimum(0);
dropShadowXSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowXSlider);
label_8 = new QLabel(DropShadowControlWidget);
label_8.setObjectName("label_8");
formLayout_2.addWidget(label_8);
dropShadowYSlider = new QSlider(DropShadowControlWidget);
dropShadowYSlider.setObjectName("dropShadowYSlider");
dropShadowYSlider.setValue(99);
dropShadowYSlider.setMaximum(999);
dropShadowYSlider.setValue(600);
dropShadowYSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowYSlider);
label_9 = new QLabel(DropShadowControlWidget);
label_9.setObjectName("label_9");
formLayout_2.addWidget(label_9);
dropShadowRadiusSlider = new QSlider(DropShadowControlWidget);
dropShadowRadiusSlider.setObjectName("dropShadowRadiusSlider");
dropShadowRadiusSlider.setMaximum(299);
dropShadowRadiusSlider.setValue(30);
dropShadowRadiusSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowRadiusSlider);
label_10 = new QLabel(DropShadowControlWidget);
label_10.setObjectName("label_10");
formLayout_2.addWidget(label_10);
dropShadowAlphaSlider = new QSlider(DropShadowControlWidget);
dropShadowAlphaSlider.setObjectName("dropShadowAlphaSlider");
dropShadowAlphaSlider.setValue(99);
dropShadowAlphaSlider.setMaximum(255);
dropShadowAlphaSlider.setOrientation(com.trolltech.qt.core.Qt.Orientation.Horizontal);
formLayout_2.addWidget(dropShadowAlphaSlider);
verticalLayout.addWidget(DropShadowControlWidget);
ConvolutionControlWidget = new QWidget(ValueControls);
ConvolutionControlWidget.setObjectName("ConvolutionControlWidget");
gridLayout = new QGridLayout(ConvolutionControlWidget);
gridLayout.setObjectName("gridLayout");
kernel_1x1 = new QLineEdit(ConvolutionControlWidget);
kernel_1x1.setObjectName("kernel_1x1");
gridLayout.addWidget(kernel_1x1, 0, 0, 1, 1);
kernel_2x1 = new QLineEdit(ConvolutionControlWidget);
kernel_2x1.setObjectName("kernel_2x1");
gridLayout.addWidget(kernel_2x1, 0, 1, 1, 1);
kernel_3x1 = new QLineEdit(ConvolutionControlWidget);
kernel_3x1.setObjectName("kernel_3x1");
gridLayout.addWidget(kernel_3x1, 0, 2, 1, 1);
kernel_1x2 = new QLineEdit(ConvolutionControlWidget);
kernel_1x2.setObjectName("kernel_1x2");
gridLayout.addWidget(kernel_1x2, 1, 0, 1, 1);
kernel_2x2 = new QLineEdit(ConvolutionControlWidget);
kernel_2x2.setObjectName("kernel_2x2");
gridLayout.addWidget(kernel_2x2, 1, 1, 1, 1);
kernel_3x2 = new QLineEdit(ConvolutionControlWidget);
kernel_3x2.setObjectName("kernel_3x2");
gridLayout.addWidget(kernel_3x2, 1, 2, 1, 1);
kernel_1x3 = new QLineEdit(ConvolutionControlWidget);
kernel_1x3.setObjectName("kernel_1x3");
gridLayout.addWidget(kernel_1x3, 2, 0, 1, 1);
kernel_2x3 = new QLineEdit(ConvolutionControlWidget);
kernel_2x3.setObjectName("kernel_2x3");
gridLayout.addWidget(kernel_2x3, 2, 1, 1, 1);
kernel_3x3 = new QLineEdit(ConvolutionControlWidget);
kernel_3x3.setObjectName("kernel_3x3");
gridLayout.addWidget(kernel_3x3, 2, 2, 1, 1);
verticalLayout.addWidget(ConvolutionControlWidget);
retranslateUi(ValueControls);
ValueControls.connectSlotsByName();
} // setupUi
void retranslateUi(QWidget ValueControls)
{
ValueControls.setWindowTitle(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Form"));
label.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Red"));
label_2.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Green"));
label_3.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Blue"));
label_4.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Red"));
label_5.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Green"));
label_6.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Blue"));
label_7.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "X Distance"));
label_8.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Y Distance"));
label_9.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Blur Radius"));
label_10.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "Alpha"));
kernel_1x1.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_2x1.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_3x1.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_1x2.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_2x2.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.2"));
kernel_3x2.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_1x3.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_2x3.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
kernel_3x3.setText(com.trolltech.qt.core.QCoreApplication.translate("ValueControls", "0.1"));
} // retranslateUi
}
| [
"nonomonomusic@fd5aab1e-e55a-11dd-9ba5-89a75009fd5d"
] | nonomonomusic@fd5aab1e-e55a-11dd-9ba5-89a75009fd5d |
07057b9e076df1dd91548f2a544ce9307d524eb2 | 6fe96d24fd53fdd2da34abacda174a1ebf5cf36b | /gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageXmlDataReview.java | 19ee86e5191030dcca79c3c8a1bccf7bdf7a758a | [
"Apache-2.0",
"GPL-1.0-or-later",
"MPL-2.0",
"EPL-1.0",
"LicenseRef-scancode-proprietary-license",
"LGPL-2.0-or-later",
"CDDL-1.0",
"MIT"
] | permissive | msucil/midpoint | 05ffd33d0c909bc7d564c9db8a0407ef42efb726 | 3200d31730a49d53c73b35c90a89fbe1c034183b | refs/heads/master | 2020-06-11T09:16:43.152507 | 2019-06-26T12:02:50 | 2019-06-26T12:02:50 | 193,911,474 | 1 | 0 | Apache-2.0 | 2019-06-26T13:37:31 | 2019-06-26T13:37:30 | null | UTF-8 | Java | false | false | 2,858 | java | /*
* Copyright (c) 2010-2018 Evolveum
*
* 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.evolveum.midpoint.web.page.admin.users;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.web.application.AuthorizationAction;
import com.evolveum.midpoint.web.application.PageDescriptor;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.page.admin.PageAdmin;
import com.evolveum.midpoint.web.page.admin.reports.component.AceEditorPanel;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
/**
* Created by honchar.
*/
@PageDescriptor(url = "/admin/xmlDataReview", action = {
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_USERS_ALL_URL,
label = "PageAdminUsers.auth.usersAll.label",
description = "PageAdminUsers.auth.usersAll.description"),
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_USER_HISTORY_XML_REVIEW_URL,
label = "PageUser.auth.userHistoryXmlReview.label",
description = "PageUser.auth.userHistoryXmlReview.description")})
public class PageXmlDataReview extends PageAdmin {
private static final String ID_ACE_EDITOR_CONTAINER = "aceEditorContainer";
private static final String ID_ACE_EDITOR_PANEL = "aceEditorPanel";
private static final String ID_BUTTON_BACK = "back";
public PageXmlDataReview(IModel<String> title, IModel<String> data){
initLayout(title, data);
}
private void initLayout(IModel<String> title, IModel<String> data){
WebMarkupContainer container = new WebMarkupContainer(ID_ACE_EDITOR_CONTAINER);
container.setOutputMarkupId(true);
add(container);
AceEditorPanel aceEditorPanel = new AceEditorPanel(ID_ACE_EDITOR_PANEL, title, data);
aceEditorPanel.getEditor().setReadonly(true);
aceEditorPanel.setOutputMarkupId(true);
container.add(aceEditorPanel);
AjaxButton back = new AjaxButton(ID_BUTTON_BACK, createStringResource("PageBase.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
add(back);
}
}
| [
"[email protected]"
] | |
ff861cc4e49adf78c9deb62398e7b11ef1e5c104 | 5431875a111b1a17045a7e1b337dd1b23e95139c | /src/main/java/com/vg/eventmanagement/requests/AddEvent.java | 755919665985c4b764268b285cccb7277823b37b | [] | no_license | viraag/event-management-backend | e5db9ded93618a1dbaea3b3ad4b16b2c4c216169 | 9ce78828c525d55ef9dd1d52314266668bd8894b | refs/heads/master | 2022-11-28T07:13:52.089870 | 2020-08-16T06:05:14 | 2020-08-16T06:05:14 | 286,762,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,523 | java | package com.vg.eventmanagement.requests;
import java.io.Serializable;
import java.time.ZoneId;
import java.time.ZonedDateTime;
public class AddEvent implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private long organizerId;
private String eventName;
private String description;
private ZonedDateTime startTime;
private ZonedDateTime endTime;
private ZoneId zoneId;
private Boolean started;
private String venuename;
private String streetAddress;
private String streetAddress2;
private String city;
private String state;
private String country;
private String postalCode;
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ZonedDateTime getStartTime() {
return startTime;
}
public void setStartTime(ZonedDateTime startTime) {
this.startTime = startTime;
}
public ZonedDateTime getEndTime() {
return endTime;
}
public void setEndTime(ZonedDateTime endTime) {
this.endTime = endTime;
}
public ZoneId getZoneId() {
return zoneId;
}
public void setZoneId(ZoneId zoneId) {
this.zoneId = zoneId;
}
public Boolean getStarted() {
return started;
}
public void setStarted(Boolean started) {
this.started = started;
}
public long getOrganizerId() {
return organizerId;
}
public void setOrganizerId(long organizerId) {
this.organizerId = organizerId;
}
public String getVenuename() {
return venuename;
}
public void setVenuename(String venuename) {
this.venuename = venuename;
}
public String getStreetAddress() {
return streetAddress;
}
public void setStreetAddress(String streetAddress) {
this.streetAddress = streetAddress;
}
public String getStreetAddress2() {
return streetAddress2;
}
public void setStreetAddress2(String streetAddress2) {
this.streetAddress2 = streetAddress2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
}
| [
"[email protected]"
] | |
48917aa4432bd82611a4919bd105e0e36422c615 | c5dd9e8ad4c17aeb469b26c9cf70932de76d3467 | /src/co/unal/sm/test/TestPersona.java | 2cec3702536661603a45bcc1fd9aab546510815c | [] | no_license | ApoyosMovilidadUNAL/ProyectoArquitectura | e87541e44df7185b3ae42fd9a86bd272ab6652e8 | b02ae7e761fda657afb90418df206af5f1dacccc | refs/heads/master | 2021-08-16T11:26:56.354599 | 2017-11-19T18:08:10 | 2017-11-19T18:08:10 | 104,141,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 739 | java | package co.unal.sm.test;
import co.unal.sm.servicios.ConsumoServicio;
public class TestPersona {
public static void main(String[] args) {
// Persona persona = new Persona();
//
// persona.setNombre("Jhader");
// persona.setApellido("Hurtado");
// persona.setCorreo("[email protected]");
// persona.setIdentificacion("1016054188");
//
// Boolean creacion = ClienteServicio.crearCliente(persona);
// System.out.println(creacion);
// @SuppressWarnings("unused")
// PruebaServicio pruebaServicio = new PruebaServicio();
//
// PruebaServicio.prueba();
@SuppressWarnings("unused")
ConsumoServicio consumoServicio = new ConsumoServicio();
ConsumoServicio.obtenerConsumo("[email protected]");
}
}
| [
"[email protected]"
] | |
f94ca9b4d5c053904ac3ae63d8e87129c21ff3ff | df74cc468248274f5427303b76803d786897f40f | /Team_project/src/test/java/stepDefenetion/BIT_About_stepDef.java | c78fca003cf59cc592e5d82f905043e8a7177edb | [] | no_license | JavidNasib/test_project | 4af575a88c7fa356a5630f6a903f6c85bee12a17 | 30d23311b8f281d26685354ef0be68b025328ccb | refs/heads/master | 2022-12-28T10:08:41.146509 | 2020-01-18T16:37:23 | 2020-01-18T16:37:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,449 | java | package stepDefenetion;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.*;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import pages.BIT_About_page;
import pages.BIT_HomePage_page;
import utils.SingletonBrowser;
import utils.Utility;
public class BIT_About_stepDef {
SingletonBrowser sb = SingletonBrowser.getSingletonBrowser();
WebDriver driver = sb.getDriver();
BIT_About_page about = new BIT_About_page(driver);
@Given("User clicks on About")
public void user_clicks_on_About() {
about.clickAbout.click();
}
// @Then("User verifies head title of page {string}")
public void user_verifies_head_title_of_page(String expectedHeader) {
String actualHeader = about.aboutHeadTitle.getText();
System.out.println(expectedHeader);
System.out.println(actualHeader);
assertEquals(expectedHeader, actualHeader);
}
// @Then("User verifies headlines of page like About us and Background")
public void user_verifies_headlines_of_page_like_About_us_and_Background(io.cucumber.datatable.DataTable dataTable) throws InterruptedException {
Thread.sleep(4000);
List<String> actualTopMenus=Utility.webElementToStringList(about.aboutHeadlines) ;
List<String> expectedTopMenus1=dataTable.asList();
List<String> expectedTopMenus=new ArrayList<String>();
for (String string : expectedTopMenus1) {
expectedTopMenus.add(string);
}
Collections.sort(actualTopMenus);
Collections.sort(expectedTopMenus);
System.out.println(actualTopMenus);
System.out.println(expectedTopMenus);
assertTrue(actualTopMenus.equals(expectedTopMenus));
}
// @Then("User check article of About and Background")
public void user_check_article_of_About_and_Background(io.cucumber.datatable.DataTable dataTable) throws InterruptedException {
Thread.sleep(4000);
List<String> actualTopMenus=Utility.webElementToStringList(about.aboutArticles) ;
List<String> expectedTopMenus1=dataTable.asList();
List<String> expectedTopMenus=new ArrayList<String>();
for (String string : expectedTopMenus1) {
expectedTopMenus.add(string);
}
Collections.sort(actualTopMenus);
Collections.sort(expectedTopMenus);
System.out.println(actualTopMenus);
System.out.println(expectedTopMenus);
assertTrue(actualTopMenus.equals(expectedTopMenus));
}
@Given("User verifies footer section")
public void user_verifies_footer_section(io.cucumber.datatable.DataTable dataTable) throws InterruptedException {
Thread.sleep(4000);
List<String> actualTopMenus=Utility.webElementToStringList(about.footerSections) ;
List<String> expectedTopMenus1=dataTable.asList();
List<String> expectedTopMenus=new ArrayList<String>();
for (String string : expectedTopMenus1) {
expectedTopMenus.add(string);
}
Collections.sort(actualTopMenus);
Collections.sort(expectedTopMenus);
System.out.println(actualTopMenus);
System.out.println(expectedTopMenus);
assertTrue(actualTopMenus.equals(expectedTopMenus));
}
}
| [
"[email protected]"
] | |
15ce5193b2ec3b7ff26508efff7e24456fa41164 | 07ae17e3daf4245fe1c66e7d3c0a8cba1c583b32 | /providers/ecc-s3/src/test/java/org/jclouds/ecc/ECCWalrusAsyncClientTestDisabled.java | cb9236cdaea5ede56cdaa7389bb0a7e480e9b61a | [
"Apache-2.0"
] | permissive | PradyumnaNagendra/jclouds | 0a14535e8c135702341453fc059e74db7a3c8b62 | f7576dfc697e54a68baf09967bccc8f708735992 | refs/heads/master | 2020-04-12T10:02:21.260099 | 2011-01-19T01:56:24 | 2011-01-19T01:56:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,335 | java | /**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <[email protected]>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.jclouds.ecc;
import org.testng.annotations.Test;
/**
* @author Adrian Cole
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(enabled = false, groups = "unit", testName = "ECCWalrusAsyncClientTest")
public class ECCWalrusAsyncClientTestDisabled extends org.jclouds.walrus.WalrusAsyncClientTestDisabled {
public ECCWalrusAsyncClientTestDisabled() {
this.provider = "ecc";
this.url = "commondatastorage.googleapis.com";
}
// TODO parameterize this test so that it can pass
}
| [
"[email protected]"
] | |
b1dda52964fb0f308a7c856e134cfcd23d159cef | 69bc25110a86af77c6f18e92eded56d19ce0fe0f | /src/com/eyoubika/spider/web/action/EpianhongSpiderAction.java | 13fabf8d4015785b90dd2a0ab6f4ec29c9a09a2b | [] | no_license | ljx728/eyoubika | 1ee14ab22b0989410f6a8d5452619c595e0ebf2b | d356e1f8c0107f2e7d9984cd25d9415aa792d452 | refs/heads/master | 2020-04-11T18:26:25.224214 | 2018-12-16T12:33:18 | 2018-12-16T12:33:18 | 161,998,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,221 | java | package com.eyoubika.spider.web.action;
import java.io.UnsupportedEncodingException;
import java.util.Properties;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.eyoubika.common.BaseAction;
import com.eyoubika.common.YbkException;
import com.eyoubika.util.ConverterUtil;
import com.eyoubika.spider.web.VO.FetchVO;
import com.eyoubika.spider.service.IEpianhongSpiderService;
import com.eyoubika.spider.service.INjwjsSpiderService;
/*==========================================================================================*
* Description: 定义了用户控制器
* Class: UserAction
* Author: lijiaxuan
* Copyright: CaiDan (c) 2015 [email protected]
* History: 1.0 created by lijiaxuan at 2015-5-21 14:17:33
*==========================================================================================*/
public class EpianhongSpiderAction extends BaseAction {
private FetchVO fetchVO;
private IEpianhongSpiderService epianhongSpiderService;
public FetchVO getFetchVO() {
return fetchVO;
}
public void setFetchVO(FetchVO fetchVO) {
this.fetchVO = fetchVO;
}
public IEpianhongSpiderService getEpianhongSpiderService() {
return epianhongSpiderService;
}
public void setEpianhongSpiderService(
IEpianhongSpiderService epianhongSpiderService) {
this.epianhongSpiderService = epianhongSpiderService;
}
/*--------------------------------------------------------------------------------------*
* Description: 用户注册
* Method: register
* Parameters: void
* History: 1.0 created by lijiaxuan at 2015-5-21 14:22:16
*--------------------------------------------------------------------------------------*/
public String fetchQuotations(){
HttpServletRequest request = ServletActionContext.getRequest();
ConverterUtil.RequestToVO(request, fetchVO);
this.jsonData = epianhongSpiderService.fetchQuotations(fetchVO);
return SUCCESS;
}
public String fetchSbcs(){
HttpServletRequest request = ServletActionContext.getRequest();
ConverterUtil.RequestToVO(request, fetchVO);
this.jsonData = epianhongSpiderService.fetchSbcs(fetchVO);
return SUCCESS;
}
} | [
"[email protected]"
] | |
6d9a941dad411d7385c9db85f984f06cc4c8edb6 | 6e0f1b371d5f4c35ce4845b03f7273533cc9f0bc | /src/main/java/com/ivo/mrp/entity/packaging/SupplierPackage.java | c389e3970472004a0fc61aa25bdb618102f2cb8f | [] | no_license | badby001/mrp | 4067068a00989ffa713d0e501e59ef456625bd43 | 0e8e6c0601023f4087afc0575515eeba8eecced9 | refs/heads/master | 2022-12-17T14:53:19.114740 | 2020-09-27T03:32:49 | 2020-09-27T03:32:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,607 | java | package com.ivo.mrp.entity.packaging;
import com.ivo.common.model.AutoIncreaseEntityModel;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 包材的供应商
* @author wj
* @version 1.0
*/
@Setter
@Getter
@Entity
@Table(name = "MRP3_Supplier_Package")
public class SupplierPackage extends AutoIncreaseEntityModel {
/**
* 月份
*/
private String month;
/**
* 机种
*/
private String project;
/**
* 单片/连片类型
*/
private String linkType;
/**
* 连片数
*/
private Double linkQty;
/**
* 包装数量
*/
private Double panelQty;
/**
* 厂别类型
*/
private String type;
/**
* MODEL
*/
private String model;
/**
* 切片数
*/
private Double cut;
@OneToMany(mappedBy="supplierPackage", cascade= CascadeType.ALL)
private List<SupplierPackageDetail> supplierList = new ArrayList<>();
/**
* 有效性标识
*/
private boolean validFlag = true;
/**
* 备注
*/
private String memo = "";
/**
* 创建者
*/
private String creator = "";
/**
* 创建时间
*/
private Date createDate = new Date();
/**
* 修改者
*/
private String updater = "";
/**
* 修改时间
*/
private Date updateDate = new Date();
}
| [
"[email protected]"
] | |
db74e8ca8572747c39bd11b7b0c26c9d279bfefa | fca014e12b71d5ba73ac01f5e9b2439a41fdee94 | /app/src/main/java/babiy/reminder/Thursday_Activity.java | bf16a8e6e147533d3bc9a5b848def8d281f10de5 | [] | no_license | Inhorn/Planner | 8faddbbd3cc48dd5ccaf5ed8d743c3215d78f61f | b2fe5e49263895b3b110275451dc9e65184a2286 | refs/heads/master | 2021-06-15T00:30:26.330030 | 2017-03-23T17:08:02 | 2017-03-23T17:08:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,271 | java | package babiy.reminder;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import java.util.List;
public class Thursday_Activity extends AppCompatActivity implements View.OnClickListener{
Button btnCrete;
DatabaseHandler db;
ListView lvTasks;
List<Task> listTask;
static int ID = 0;
static final int REQUEST_ADD_TASK = 1;
static final int REQUEST_EDIT_TASK = 2;
static final int REQUEST_DELL_ALL = 3;
@Override
protected void onCreate(Bundle savedInstanceState) {
setTitle(MainActivity.DAY);
super.onCreate(savedInstanceState);
setTitle(getString(R.string.labelThursday));
setContentView(R.layout.activity_thursday);
btnCrete = (Button) findViewById(R.id.btnCreate);
btnCrete.setOnClickListener(this);
db = new DatabaseHandler(this);
showTasks();
}
public void showTasks() {
listTask = db.getAllTasks(MainActivity.DAY);
lvTasks = (ListView) findViewById(R.id.lvList);
ArrayAdapter<Task> adapter = new ArrayAdapter<>(this, R.layout.item, listTask);
registerForContextMenu(lvTasks);
lvTasks.setAdapter(adapter);
lvTasks.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
ID = position;
return false;
}
});
}
@Override
public void onClick(View v) {
Intent intent = new Intent(this, Edit_Activity.class);
startActivityForResult(intent, REQUEST_ADD_TASK);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_day, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
Intent intent;
switch (id) {
case R.id.deleteAllInDay:
intent = new Intent(this, DeleteAll.class);
startActivityForResult(intent, REQUEST_DELL_ALL);
break;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (data == null) {
return;
}
if (resultCode == RESULT_OK) {
String task;
switch (requestCode) {
case REQUEST_ADD_TASK:
task = data.getStringExtra("task");
db.addTask(new Task(task, MainActivity.DAY));
showTasks();
break;
case REQUEST_EDIT_TASK:
Task newTask = listTask.get(ID);
task = data.getStringExtra("task");
newTask.setTask(task);
db.editTask(newTask);
showTasks();
break;
case REQUEST_DELL_ALL:
db.delAllDay(MainActivity.DAY);
finish();
startActivity(getIntent());
break;
}
}
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
getMenuInflater().inflate(R.menu.context_menu, menu);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.itemDelete:
db.deleteTask(listTask.get(ID));
showTasks();
break;
case R.id.itemEdit:
Intent intent = new Intent(this, Edit_Activity.class);
startActivityForResult(intent, REQUEST_EDIT_TASK);
break;
}
return super.onContextItemSelected(item);
}
}
| [
"[email protected]"
] | |
20bdf77b91d35a7435e2a9df684add6fad5911f4 | ebe222e23b4022e29c95ea5823ff7b646ef51d5a | /zxingScan/src/main/java/com/runtai/zxinglib/zxing/decode/DecodeFormatManager.java | d2a3f144712a192bd6504eb2cb8d10a4a5af764c | [] | no_license | hailinliu/Dexintong | 902a0875bc6060b9031235e7af1d2cff2c062930 | abacf20126b79d0f42a67c626634a2c73b97fbf3 | refs/heads/master | 2021-05-15T04:18:45.814739 | 2018-02-04T14:53:35 | 2018-02-04T14:53:35 | 114,599,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,699 | java | /*
* Copyright (C) 2010 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.runtai.zxinglib.zxing.decode;
import com.google.zxing.BarcodeFormat;
import java.util.Collection;
import java.util.EnumSet;
import java.util.Set;
public class DecodeFormatManager {
// 1D解码
static final Set<BarcodeFormat> PRODUCT_FORMATS;
static final Set<BarcodeFormat> INDUSTRIAL_FORMATS;
static final Set<BarcodeFormat> ONE_D_FORMATS;
// 二维码解码
static final Set<BarcodeFormat> QR_CODE_FORMATS;
static {
PRODUCT_FORMATS = EnumSet.of(BarcodeFormat.UPC_A, BarcodeFormat.UPC_E, BarcodeFormat.EAN_13, BarcodeFormat.EAN_8, BarcodeFormat.RSS_14, BarcodeFormat.RSS_EXPANDED);
INDUSTRIAL_FORMATS = EnumSet.of(BarcodeFormat.CODE_39, BarcodeFormat.CODE_93, BarcodeFormat.CODE_128, BarcodeFormat.ITF, BarcodeFormat.CODABAR);
ONE_D_FORMATS = EnumSet.copyOf(PRODUCT_FORMATS);
ONE_D_FORMATS.addAll(INDUSTRIAL_FORMATS);
QR_CODE_FORMATS = EnumSet.of(BarcodeFormat.QR_CODE);
}
public static Collection<BarcodeFormat> getQrCodeFormats() {
return QR_CODE_FORMATS;
}
public static Collection<BarcodeFormat> getBarCodeFormats() {
return ONE_D_FORMATS;
}
}
| [
"[email protected]"
] | |
8a1966cc75ec3a9de6853839b1456a37d4b63c6f | daa6543d35cc0e0aa27cd02a8e97c2a94de46660 | /src/DataStructures/MultiTreeNode.java | c0f34a21deefe93baf582842667b0e8f174e5d00 | [] | no_license | Se213/DS_Library_Spring2019 | 397ed0e7a46e7abf1112eb67e199acdb55b16f18 | 476475b80e92cb4bba1e327a8507469f36563fc4 | refs/heads/master | 2021-02-19T02:51:25.898919 | 2020-03-05T21:18:54 | 2020-03-05T21:18:54 | 245,269,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,950 | java |
package DataStructures;
import java.util.ArrayList;
/**
* A MultiTreeNode is a tree node that can have any number of children
* @author clatulip
*/
public class MultiTreeNode<T> {
/**
* Stores the element that is of type <generic>
*/
private T element;
/**
* Stores links to other MultiTreeNodes in an indexed list
*/
private ArrayList<MultiTreeNode<T>> children;
/**
* Default constructor creates an empty node
*/
public MultiTreeNode() {
children = new ArrayList<>();
element = null;
}
/**
* Creates a node containing element
* @param elem element to be stored
*/
public MultiTreeNode(T elem) {
children = new ArrayList<>();
element = elem;
}
/**
* Add a child node to this node, by adding it to the list
* @param child
*/
public void addChild(MultiTreeNode<T> child) {
children.add(child);
}
/**
* Remove a child node from this node, by removing it from the list
* @param child
*/
public void removeChild(MultiTreeNode<T> child) {
children.remove(child);
}
/**
* Find out how many child nodes this node has
* @return size (int) of the arrayList of MultiTreeNodes
*/
public int getNumChildren() {
return children.size();
}
/**
* Get the child node at index specified. Note that if the index isn't valid
* then null is returned. No exception is thrown.
* @param index int
* @return MultiTreeNode that was at specified index
*/
public MultiTreeNode<T> getChild(int index) {
if (index >= children.size()) return null;
return children.get(index);
}
/**
* Returns an ArrayList of all the child nodes
* @return arrayList that contains all the children of this node
*/
public ArrayList<MultiTreeNode<T>> getChildren() {
return children;
}
/**
* Returns the element stored in this node
* @return element stored in the node
*/
public T getElement() {
return element;
}
/**
* Sets the element in this node to the passed in element
* @param elem of generic type
*/
public void setElement(T elem) {
element = elem;
}
/**
* Creates a string out of the element, the number of children, and each child
* @return a string representing this node and it's offspring
*/
@Override
public String toString() {
/*String temp = "MultiTreeNode{" + "element=" + element + ", num_children=" + children.size() + ", children=";
for (int i = 0; i < children.size(); i++) {
temp = temp.concat("\t child " + i + ": " + children.get(i).toString() + ", ");
}
temp = temp.concat("}");
return temp;*/
return element.toString();
}
}
| [
"[email protected]"
] | |
009c32574217b1c1dc7cd6a142785b879059ba50 | c99cdda169f47ee571739260988b7de581a7e6e8 | /common/network-common/src/main/java/org/apache/spark/network/TransportContext.java | 8b31e44422079dc6e3de677a8026ed60225fcad1 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"Python-2.0",
"MIT",
"CC0-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"CDDL-1.0",
"MPL-1.1",
"BSD-2-Clause",
"CDDL-1.1",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"NAIST-2003",
"GCC-exception-3.1",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-other-copyleft",
"CC-BY-SA-3.0",
"LGPL-2.0-or-later",
"GPL-2.0-only",
"EPL-1.0",
"Classpath-exception-2.0",
"LicenseRef-scancode-unicode",
"CPL-1.0",
"CC-PDDC",
"LicenseRef-scancode-unknown"
] | permissive | Lorraine318/spark2.1.0 | 3790ef6ed077c02ec23dc23dcd6fb214aefe6f0b | 7d9b87569d5a5c6dfe32802fa9e8015a0e9e23fe | refs/heads/master | 2022-12-08T04:05:42.825345 | 2020-04-09T08:39:14 | 2020-04-09T08:39:14 | 252,354,284 | 0 | 0 | Apache-2.0 | 2022-12-05T23:45:33 | 2020-04-02T04:21:58 | Scala | UTF-8 | Java | false | false | 9,617 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.network;
import java.util.ArrayList;
import java.util.List;
import io.netty.channel.Channel;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.timeout.IdleStateHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.spark.network.client.TransportClient;
import org.apache.spark.network.client.TransportClientBootstrap;
import org.apache.spark.network.client.TransportClientFactory;
import org.apache.spark.network.client.TransportResponseHandler;
import org.apache.spark.network.protocol.MessageDecoder;
import org.apache.spark.network.protocol.MessageEncoder;
import org.apache.spark.network.server.RpcHandler;
import org.apache.spark.network.server.TransportChannelHandler;
import org.apache.spark.network.server.TransportRequestHandler;
import org.apache.spark.network.server.TransportServer;
import org.apache.spark.network.server.TransportServerBootstrap;
import org.apache.spark.network.util.NettyUtils;
import org.apache.spark.network.util.TransportConf;
import org.apache.spark.network.util.TransportFrameDecoder;
/**
* Contains the context to create a {@link TransportServer}, {@link TransportClientFactory}, and to
* setup Netty Channel pipelines with a
* {@link org.apache.spark.network.server.TransportChannelHandler}.
*
* There are two communication protocols that the TransportClient provides, control-plane RPCs and
* data-plane "chunk fetching". The handling of the RPCs is performed outside of the scope of the
* TransportContext (i.e., by a user-provided handler), and it is responsible for setting up streams
* which can be streamed through the data plane in chunks using zero-copy IO.
*
* The TransportServer and TransportClientFactory both create a TransportChannelHandler for each
* channel. As each TransportChannelHandler contains a TransportClient, this enables server
* processes to send messages back to the client on an existing channel.
*/
//传输上下文
public class TransportContext {
private static final Logger logger = LoggerFactory.getLogger(TransportContext.class);
//传输上下文的配置信息 transportConf
private final TransportConf conf;
//对客户端请求消息进行处理的rpcHandler,对调用传输客户端transportClient的sendRPC方法发送的消息进行处理的程序。
private final RpcHandler rpcHandler;
private final boolean closeIdleConnections;
/**
* Force to create MessageEncoder and MessageDecoder so that we can make sure they will be created
* before switching the current context class loader to ExecutorClassLoader.
*
* Netty's MessageToMessageEncoder uses Javassist to generate a matcher class and the
* implementation calls "Class.forName" to check if this calls is already generated. If the
* following two objects are created in "ExecutorClassLoader.findClass", it will cause
* "ClassCircularityError". This is because loading this Netty generated class will call
* "ExecutorClassLoader.findClass" to search this class, and "ExecutorClassLoader" will try to use
* RPC to load it and cause to load the non-exist matcher class again. JVM will report
* `ClassCircularityError` to prevent such infinite recursion. (See SPARK-17714)
*/
//在消息放入管道前,先对消息内容进行编码,防止管道另一端读取时丢包和解析错误。
private static final MessageEncoder ENCODER = MessageEncoder.INSTANCE;
//对从管道中读取的ByteBuf进行解析,防止丢包和解析错误。
private static final MessageDecoder DECODER = MessageDecoder.INSTANCE;
public TransportContext(TransportConf conf, RpcHandler rpcHandler) {
this(conf, rpcHandler, false);
}
public TransportContext(
TransportConf conf,
RpcHandler rpcHandler,
boolean closeIdleConnections) {
this.conf = conf;
this.rpcHandler = rpcHandler;
this.closeIdleConnections = closeIdleConnections;
}
/**
* Initializes a ClientFactory which runs the given TransportClientBootstraps prior to returning
* a new Client. Bootstraps will be executed synchronously, and must run successfully in order
* to create a Client.
*
* 初始化一个ClientFactory,该ClientFactory在返回之前运行给定的TransportClientBootstraps
* 一个新客户。 引导程序将同步执行,并且必须按顺序成功运行
* 创建一个客户端。
*/
public TransportClientFactory createClientFactory(List<TransportClientBootstrap> bootstraps) {
//参数传递的transportContext的引用
return new TransportClientFactory(this, bootstraps);
}
public TransportClientFactory createClientFactory() {
return createClientFactory(new ArrayList<>());
}
/** Create a server which will attempt to bind to a specific port.
* 创建将尝试绑定到特定端口的服务器
* */
//创建传输服务端transportServer的实例。
public TransportServer createServer(int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, null, port, rpcHandler, bootstraps);
}
/** Create a server which will attempt to bind to a specific host and port. */
public TransportServer createServer(
String host, int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, host, port, rpcHandler, bootstraps);
}
/** Creates a new server, binding to any available ephemeral port. */
public TransportServer createServer(List<TransportServerBootstrap> bootstraps) {
return createServer(0, bootstraps);
}
public TransportServer createServer() {
return createServer(0, new ArrayList<>());
}
public TransportChannelHandler initializePipeline(SocketChannel channel) {
return initializePipeline(channel, rpcHandler);
}
/**
* Initializes a client or server Netty Channel Pipeline which encodes/decodes messages and
* has a {@link org.apache.spark.network.server.TransportChannelHandler} to handle request or
* response messages.
*
* @param channel The channel to initialize.
* @param channelRpcHandler The RPC handler to use for the channel.
*
* @return Returns the created TransportChannelHandler, which includes a TransportClient that can
* be used to communicate on this channel. The TransportClient is directly associated with a
* ChannelHandler to ensure all users of the same channel get the same TransportClient object.
*/
//管道初始化 无论客户端和服务端都可以走这
public TransportChannelHandler initializePipeline(
SocketChannel channel,
RpcHandler channelRpcHandler) {
try {
TransportChannelHandler channelHandler = createChannelHandler(channel, channelRpcHandler);
channel.pipeline()
.addLast("encoder", ENCODER)
//对从管道中读取的ByteBuf按照数据帧进行解析
.addLast(TransportFrameDecoder.HANDLER_NAME, NettyUtils.createFrameDecoder())
.addLast("decoder", DECODER)
//心跳handler 读 写 读或者写 如果超出,触发自定义里面的事件
.addLast("idleStateHandler", new IdleStateHandler(0, 0, conf.connectionTimeoutMs() / 1000))
// NOTE: Chunks are currently guaranteed to be returned in the order of request, but this
// would require more logic to guarantee if this were not part of the same event loop.
.addLast("handler", channelHandler);
return channelHandler;
} catch (RuntimeException e) {
logger.error("Error while initializing Netty pipeline", e);
throw e;
}
}
/**
* Creates the server- and client-side handler which is used to handle both RequestMessages and
* ResponseMessages. The channel is expected to have been successfully created, though certain
* properties (such as the remoteAddress()) may not be available yet.
*/
//真正创建了TransportClient
private TransportChannelHandler createChannelHandler(Channel channel, RpcHandler rpcHandler) {
//用于处理服务端的响应,并且对发出请求的客户端进行响应的处理程序
TransportResponseHandler responseHandler = new TransportResponseHandler(channel);
//RPC客户端
TransportClient client = new TransportClient(channel, responseHandler);
//用于处理客户端的请求并在写完块数据后返回的处理程序
TransportRequestHandler requestHandler = new TransportRequestHandler(channel, client,
rpcHandler, conf.maxChunksBeingTransferred());
//代理由TransportRequestHandler处理的请求和由TransportResponseHandler处理的响应,并加入传输层的处理
return new TransportChannelHandler(client, responseHandler, requestHandler,
conf.connectionTimeoutMs(), closeIdleConnections);
}
public TransportConf getConf() { return conf; }
}
| [
"[email protected]"
] | |
35720715e152837b8bff3a81ccc230498a3089f3 | 61f80445c43d45203d0852deed9fa926813df89f | /examples/featuremodeling/org.eclipselabs.spray.featuremodeling.domain/src/ca/uwaterloo/gp/fmp/util/FmpSwitch.java | 8fc9c0bbd7a8bd56502f85b5daf1db90dc5acdcc | [] | no_license | joergreichert/spray | c19319d2795caa7198633073915ab6feedf15ffd | f07afb5a39d908dc5e02f455f90db9cfccbcfba1 | refs/heads/master | 2021-01-15T23:45:46.239393 | 2017-01-14T12:42:06 | 2017-01-14T12:42:06 | 34,267,449 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 9,310 | java | /**
*/
package ca.uwaterloo.gp.fmp.util;
import ca.uwaterloo.gp.fmp.*;
import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* The <b>Switch</b> for the model's inheritance hierarchy.
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
* to invoke the <code>caseXXX</code> method for each class of the model,
* starting with the actual class of the object
* and proceeding up the inheritance hierarchy
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
* @see ca.uwaterloo.gp.fmp.FmpPackage
* @generated
*/
public class FmpSwitch {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static FmpPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FmpSwitch() {
if (modelPackage == null) {
modelPackage = FmpPackage.eINSTANCE;
}
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
public Object doSwitch(EObject theEObject) {
return doSwitch(theEObject.eClass(), theEObject);
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
protected Object doSwitch(EClass theEClass, EObject theEObject) {
if (theEClass.eContainer() == modelPackage) {
return doSwitch(theEClass.getClassifierID(), theEObject);
}
else {
List eSuperTypes = theEClass.getESuperTypes();
return
eSuperTypes.isEmpty() ?
defaultCase(theEObject) :
doSwitch((EClass)eSuperTypes.get(0), theEObject);
}
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
protected Object doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case FmpPackage.FEATURE: {
Feature feature = (Feature)theEObject;
Object result = caseFeature(feature);
if (result == null) result = caseClonable(feature);
if (result == null) result = caseNode(feature);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.FEATURE_GROUP: {
FeatureGroup featureGroup = (FeatureGroup)theEObject;
Object result = caseFeatureGroup(featureGroup);
if (result == null) result = caseNode(featureGroup);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.NODE: {
Node node = (Node)theEObject;
Object result = caseNode(node);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.REFERENCE: {
Reference reference = (Reference)theEObject;
Object result = caseReference(reference);
if (result == null) result = caseClonable(reference);
if (result == null) result = caseNode(reference);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.PROJECT: {
Project project = (Project)theEObject;
Object result = caseProject(project);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.TYPED_VALUE: {
TypedValue typedValue = (TypedValue)theEObject;
Object result = caseTypedValue(typedValue);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.CLONABLE: {
Clonable clonable = (Clonable)theEObject;
Object result = caseClonable(clonable);
if (result == null) result = caseNode(clonable);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FmpPackage.CONSTRAINT: {
Constraint constraint = (Constraint)theEObject;
Object result = caseConstraint(constraint);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseFeature(Feature object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature Group</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature Group</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseFeatureGroup(FeatureGroup object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Node</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseNode(Node object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Reference</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Reference</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseReference(Reference object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Project</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Project</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseProject(Project object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Typed Value</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Typed Value</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseTypedValue(TypedValue object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Clonable</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Clonable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseClonable(Clonable object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Constraint</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Constraint</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public Object caseConstraint(Constraint object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch, but this is the last case anyway.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
public Object defaultCase(EObject object) {
return null;
}
} //FmpSwitch
| [
"[email protected]"
] | |
f5808a6deabee5fe7adbad6943581d2f44443484 | 32b9d8cc999aa1e2c7b4075ed32727e772a3ae1c | /morning-product/morning-product-service/src/main/java/org/pussinboots/morning/product/service/impl/RecommendServiceImpl.java | f728147a6d794af214c63c3ce86fc2a839ceb8b6 | [] | no_license | HinsYang/Morning | 33b6706901fd92bd891d260403ff551dfa68fbae | cd115ac3a2b0bfcadd7305abf2b520d0e7290f33 | refs/heads/master | 2021-05-11T23:59:28.069375 | 2019-02-19T17:53:05 | 2019-02-19T17:53:05 | 171,512,823 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 725 | java | package org.pussinboots.morning.product.service.impl;
import org.pussinboots.morning.product.entity.Recommend;
import org.pussinboots.morning.product.mapper.RecommendMapper;
import org.pussinboots.morning.product.service.IRecommendService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
*
* 项目名称:morning-product-service
* 类名称:RecommendServiceImpl
* 类描述:Recommend / 推荐位表 业务逻辑层接口实现
* 创建人:yeungchihang
* 创建时间:2017年4月11日 下午3:17:47
*
*/
@Service
public class RecommendServiceImpl extends ServiceImpl<RecommendMapper, Recommend> implements IRecommendService {
}
| [
"[email protected]"
] | |
0ef21552c40b93f2becabc2f367e0285b66a6430 | dbb5eeb30acb0cf24dd47cfb8533697af9164c25 | /Java file/chap03/src/sec02/verify/exam10/Exam10.java | 319b9ed4ccb7da9795ff33ab146aca5402e03e1e | [] | no_license | eunjoo-ny/Jenny_Eunjoo_2020 | 4377d248e438855ba9f15b910b95e64318e8ebb6 | f4b25a00adc10823642d63126ea22141b6f40d25 | refs/heads/master | 2023-02-10T09:08:24.204399 | 2021-01-11T11:52:28 | 2021-01-11T11:52:28 | 317,743,136 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 280 | java | package sec02.verify.exam10;
public class Exam10 {
public static void main(String[] args) {
int var1 = 10;
int var2 = 3;
int var3 = 14;
double var4 = var1 * var1 * Double.parseDouble(var2 + "." + var3);
System.out.println("¿øÀÇ ³ÐÀÌ:" + var4);
}
}
| [
"[email protected]"
] | |
384a82eda079de9cbed3e83c36ff89955d56b059 | 28042a70f18edda4df9d14eb7335ca544564c923 | /src/main/java/com/kazuki43zoo/jpetstore/ui/controller/OrderForm.java | c4091b789e86ca0d925b442fcd884617288e9022 | [] | no_license | jiangjj/mybatis-spring-boot-jpetstore | aadb8887bf09431189251f9b947f6e40347dee94 | dcaa49ed4ce8a5a7972b2a2d6a8c8902e6259343 | refs/heads/master | 2021-01-18T22:37:35.314723 | 2017-04-02T13:05:26 | 2017-04-02T13:05:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,402 | java | /**
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.kazuki43zoo.jpetstore.ui.controller;
import com.kazuki43zoo.jpetstore.component.validation.NumericCharacters;
import com.kazuki43zoo.jpetstore.domain.Account;
import com.kazuki43zoo.jpetstore.domain.Order;
import lombok.Getter;
import lombok.Setter;
import com.kazuki43zoo.jpetstore.ui.Cart;
import org.springframework.beans.BeanUtils;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* @author Kazuki Shimizu
*/
@Getter
@Setter
public class OrderForm implements Serializable {
private static final long serialVersionUID = 6321792448424424931L;
@NotNull
@Size(max = 40)
private String cardType;
@NotNull
@Size(max = 80)
@NumericCharacters
private String creditCard;
@NotNull
@Pattern(regexp = "^\\d{2}/\\d{4}$")
private String expiryDate;
@NotNull
@Size(max = 40)
private String billToFirstName;
@NotNull
@Size(max = 40)
private String billToLastName;
@Size(max = 40)
private String billAddress1;
@Size(max = 40)
private String billAddress2;
@Size(max = 40)
private String billCity;
@Size(max = 40)
private String billState;
@Size(max = 20)
@NumericCharacters
private String billZip;
@Size(max = 20)
private String billCountry;
private boolean shippingAddressRequired;
@NotNull
@Size(max = 40)
private String shipToFirstName;
@NotNull
@Size(max = 40)
private String shipToLastName;
@NotNull
@Size(max = 40)
private String shipAddress1;
@Size(max = 40)
private String shipAddress2;
@NotNull
@Size(max = 40)
private String shipCity;
@Size(max = 40)
private String shipState;
@NotNull
@Size(max = 20)
@NumericCharacters
private String shipZip;
@NotNull
@Size(max = 20)
private String shipCountry;
void initialize(Account account) {
this.billToFirstName = account.getFirstName();
this.billToLastName = account.getLastName();
this.billAddress1 = account.getAddress1();
this.billAddress2 = account.getAddress2();
this.billCity = account.getCity();
this.billState = account.getState();
this.billZip = account.getZip();
this.billCountry = account.getCountry();
this.shipToFirstName = account.getFirstName();
this.shipToLastName = account.getLastName();
this.shipAddress1 = account.getAddress1();
this.shipAddress2 = account.getAddress2();
this.shipCity = account.getCity();
this.shipState = account.getState();
this.shipZip = account.getZip();
this.shipCountry = account.getCountry();
}
Order toOrder(Cart cart) {
Order order = new Order();
BeanUtils.copyProperties(this, order);
order.setTotalPrice(cart.getSubTotal());
cart.getCartItems().forEach(x -> order.addLine(x.toOrderLine()));
return order;
}
}
| [
"[email protected]"
] | |
71940c3fbf1b9928e40f66fae8a6d930c1368a52 | b701a2f316441d59906d4341b8c7c235d2a62f3e | /src/main/java/org/apache/xmlbeans/impl/values/XmlLanguageImpl.java | e2c500886bba7c12d8a93ae64af797f8e61ad704 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.0-or-later",
"LGPL-3.0-only",
"LGPL-2.1-or-later",
"MPL-1.1",
"MPL-2.0",
"MIT"
] | permissive | apache/xmlbeans | 826547e0f386481cbfd4319a0dee537a98aa7cba | 99d86814497f29a5ae7aa8e85d4db04a23eaae06 | refs/heads/trunk | 2023-08-22T08:16:22.853301 | 2023-08-18T09:55:35 | 2023-08-18T09:55:35 | 270,479 | 39 | 58 | Apache-2.0 | 2023-05-26T18:52:27 | 2009-08-06T08:06:50 | Java | UTF-8 | Java | false | false | 1,004 | java | /* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.xmlbeans.impl.values;
import org.apache.xmlbeans.XmlLanguage;
import org.apache.xmlbeans.SchemaType;
public class XmlLanguageImpl extends JavaStringHolderEx implements XmlLanguage
{
public XmlLanguageImpl()
{ super(XmlLanguage.type, false); }
public XmlLanguageImpl(SchemaType type, boolean complex)
{ super(type, complex); }
}
| [
"[email protected]"
] | |
946d2fc763df2300c641da0d40ab2f2135aaaafd | ea34626c69071ee4a158650d97bd0be7c1199d42 | /src/jmetal/problems/LIRCMOP/LIRCMOP7.java | ded0b86266b0fc4668ac5ec427edbac851c307f3 | [] | no_license | gzhuxiangyi/ToM | 6bf2efc22458239ac821e1c97e18a3d2d6162047 | 2b942fd66c5dd22cb46de37589c5c3aa949eab85 | refs/heads/main | 2023-03-18T12:34:52.300404 | 2021-03-11T01:45:33 | 2021-03-11T01:45:33 | 346,389,711 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,104 | java | // LIRCMOP7.java
//
// Author:
// wenji li Email: [email protected]
package jmetal.problems.LIRCMOP;
import jmetal.core.Problem;
import jmetal.core.Solution;
import jmetal.core.Variable;
import jmetal.encodings.solutionType.BinaryRealSolutionType;
import jmetal.encodings.solutionType.RealSolutionType;
import jmetal.util.JMException;
/**
* Class representing problem LIRCMOP7
*/
public class LIRCMOP7 extends Problem {
/**
* Creates an LIRCMOP7 problem (30 variables and 2 objectives)
*
* @param solutionType
* The solution type must "Real" or "BinaryReal".
*/
public LIRCMOP7(String solutionType) throws ClassNotFoundException {
this(solutionType, 30, 2);
} // LIRCMOP7
/**
* Creates an LIRCMOP7 problem instance
*
* @param numberOfVariables
* Number of variables
* @param numberOfObjectives
* Number of objective functions
* @param solutionType
* The solution type must "Real" or "BinaryReal".
*/
public LIRCMOP7(String solutionType, Integer numberOfVariables,
Integer numberOfObjectives) throws ClassNotFoundException {
numberOfVariables_ = numberOfVariables.intValue();
numberOfObjectives_ = numberOfObjectives.intValue();
numberOfConstraints_ = 3;
problemName_ = "LIRCMOP7";
lowerLimit_ = new double[numberOfVariables_];
upperLimit_ = new double[numberOfVariables_];
for (int var = 0; var < numberOfVariables; var++) {
lowerLimit_[var] = 0.0;
upperLimit_[var] = 1.0;
} // for
if (solutionType.compareTo("BinaryReal") == 0)
solutionType_ = new BinaryRealSolutionType(this);
else if (solutionType.compareTo("Real") == 0)
solutionType_ = new RealSolutionType(this);
else {
System.out.println("Error: solution type " + solutionType
+ " invalid");
System.exit(-1);
}
}
/**
* Evaluates a solution
*
* @param solution
* The solution to evaluate
* @throws JMException
*/
public void evaluate(Solution solution) throws JMException {
double sum1, sum2, yj;
int j;
sum1 = sum2 = 0.0;
int nx = numberOfVariables_;
double[] x = new double[numberOfVariables_];
double[] f = new double[numberOfObjectives_];
Variable[] gen = solution.getDecisionVariables();
for (int i = 0; i < numberOfVariables_; i++)
x[i] = gen[i].getValue();
for (j = 2; j <= nx; j++) {
if (j % 2 == 1) {
yj = x[j-1] - Math.sin(0.5 * j / nx * Math.PI * x[0]);
sum1 += yj * yj;
} else {
yj = x[j-1] - Math.cos(0.5 * j / nx * Math.PI * x[0]);
sum2 += yj * yj;
}
}
//double gx = 2.0 - Math.exp(- Math.pow((x[1] - 0.2) / 0.004,2)) - 0.8 * Math.exp(- Math.pow((x[1] - 0.6) / 0.4,2));
double gx = 0.7057;
f[0] = x[0] + 10 * sum1 + gx ;
f[1] = 1.0 - Math.sqrt(x[0]) + 10 * sum2 + gx;
for (int i = 0; i < numberOfObjectives_; i++)
solution.setObjective(i, f[i]);
} // evaluate
/**
* Evaluates the constraint overhead of a solution
*
* @param solution
* The solution
* @throws JMException
*/
public void evaluateConstraints(Solution solution) throws JMException {
double r = 0.1, theta = -0.25 * Math.PI;
double[] a_array = new double[]{2.0,2.5,2.5};
double[] b_array = new double[]{6.0,12.0,10.0};
double[] xOffset = new double[]{1.2,2.25,3.5};
double[] yOffset = new double[]{1.2,2.25,3.5};
double f1 = solution.getObjective(0);
double f2 = solution.getObjective(1);
double[] constraint = new double[numberOfConstraints_];
for(int i = 0; i < xOffset.length; i++){
constraint[i] = Math.pow(((f1 - xOffset[i]) * Math.cos(theta) - (f2 - yOffset[i]) * Math.sin(theta))/a_array[i] ,2)
+ Math.pow(((f1 - xOffset[i]) * Math.sin(theta) + (f2 - yOffset[i]) * Math.cos(theta))/b_array[i],2)
- r;
}
double total = 0.0;
int number = 0;
for(int i = 0 ; i < numberOfConstraints_; i++){
if (constraint[i] < 0.0){
total+=constraint[i] ;
number++;
solution.setConstraint(i,constraint[i]);
}
}
solution.setOverallConstraintViolation(total);
solution.setNumberOfViolatedConstraint(number);
} // evaluateConstraints
}
| [
"[email protected]"
] | |
051ad196d8516f4c43d0d6e6c320f26cac4fca51 | b07642404c4f50a8dd4dcf6d523604777d64c8c8 | /2020-04-30/chap13/sec01/exam09/MapExample.java | 4def72c79278a671d95d68947dfd98cb298fc57f | [] | no_license | khh2hoya/JAVAStudy | 99ed61e1ae49084cdb1bd2da9a835115d98a1eb0 | 990f531bd9213b72d8d9af830fdc49e4d23cf917 | refs/heads/master | 2021-05-23T16:47:57.592426 | 2020-06-08T07:20:06 | 2020-06-08T07:20:06 | 253,387,208 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package sec01.exam09;
import java.util.*;
public class MapExample {
public static void main(String[] args) {
// TODO Auto-generated method stub
Map<String,Integer> map = new HashMap<String,Integer>();
map.put("blue",96);
map.put("hong",99);
map.put("white",92);
map.put("khh",42);
String name = null;
int maxScore = 0;
int totalScore = 0;
Set<Map.Entry<String, Integer>> entrySet = map.entrySet();
Iterator<Map.Entry<String,Integer>> entryIterator = entrySet.iterator();
while(entryIterator.hasNext()) {
Map.Entry<String,Integer> entry = entryIterator.next();
int value = entry.getValue();
totalScore += value;
if( value > maxScore ) {
maxScore = value;
name = entry.getKey();
}
}
System.out.println("이름:" + name);
System.out.println("최고정수:" + maxScore);
System.out.println("총점:" + totalScore);
}
}
| [
"[email protected]"
] | |
4a3f21877803b36f8a7dda2039d38428d0c26c8e | bbfcba3e764e86784239a616949735d3cf681fd2 | /src/model/Time.java | 2a6eee9a9d339ea6904704d00ed45cfe7b878b5b | [
"MIT"
] | permissive | MaelChemeque/pizza-rescue | 45b8ffa5dc5d8c36e1f7289dde0edeb3e7ebde2f | 0a765a74ec3806d2c6b0dfea2b8a560d2382bace | refs/heads/main | 2023-02-16T14:42:59.428188 | 2021-01-06T03:04:45 | 2021-01-06T03:04:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,304 | java | package model;
import java.io.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class Time {
static String currentTime;
static String lastTime;
static {
lastTime = "2000/10/10 10/10/10";
}
public static void calcNow() {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
currentTime = dtf.format(now);
}
public static int calcAddableLife() {
// if (lastTime.equals("2000/10/10 10/10/10")) {
String tmp = deserializeLastTime();
if (tmp != null)
lastTime = tmp;
// }
// System.out.println(lastTime);
calcNow();
for (int i = 0; i < 13; i++) {
if (currentTime.charAt(i) > lastTime.charAt(i))
return 5;
}
int lastTimeMinutes = Integer.parseInt(lastTime.substring(14, 16));
int currentTimeMinutes = Integer.parseInt(currentTime.substring(14, 16));
int lastTimeSeconds = Integer.parseInt(lastTime.substring(17));
int currentTimeSeconds = Integer.parseInt(currentTime.substring(17));
if (currentTimeSeconds < lastTimeSeconds) {
currentTimeSeconds += 60;
currentTimeMinutes--;
}
int distance = (currentTimeMinutes - lastTimeMinutes) * 60 + currentTimeSeconds - lastTimeSeconds;
return Math.min(5, distance / 30);
// return 0;
}
public static void serializeTime() {
File directory = new File("../user");
// System.out.println(currentTime);
if (!directory.exists()) {
directory.mkdir();
// System.out.println("user directory created");
}
calcNow();
try (FileOutputStream fos = new FileOutputStream("../user/last_time_played");
ObjectOutputStream oos = new ObjectOutputStream(fos)) {
oos.writeObject(currentTime);
// System.out.println("The file user/last_time_played has been serialized in
// user directory");
} catch (IOException e) {
e.printStackTrace();
}
}
private static void init() {
lastTime = "2000/10/10 10/10/10";
}
public static String deserializeLastTime() {
String path = "../user/last_time_played";
File file = new File(path);
if (file.length() == 0) {
return null;
}
String lastTime = null;
try (FileInputStream fis = new FileInputStream(path); ObjectInputStream ois = new ObjectInputStream(fis)) {
// if(fis.available())
lastTime = (String) ois.readObject();
// System.out.println("user's last time played has been deserialized");
} catch (FileNotFoundException e) {
System.err.println("The file : " + path + " cannot be found.");
e.printStackTrace();
} catch (IOException e) {
System.err.println("The file : " + path + " cannot be read.");
e.printStackTrace();
} catch (ClassNotFoundException e) {
System.err.println("The object class you have tried to deserialize doesn't exist");
e.printStackTrace();
}
return lastTime;
}
}
| [
"[email protected]"
] | |
8fa561c3facb880c6ccce3f9875073fd5f358aeb | 40e5c87ec4351dfbb6f9d13a44ce9df86b9e7dc4 | /app/src/main/java/edu/miracosta/finalprojecttest/view_learn_more/PlantsListActivity.java | c094609564745f431a4c4b4afcbe7b4e7b2114db | [] | no_license | jacobv25/Final_Project_Test | 2571c538590c175ff9ae35070918095e708debe5 | 12999180febc97d5db41474258d17a3148cf8ddb | refs/heads/master | 2020-05-17T04:48:29.984410 | 2019-05-14T22:07:35 | 2019-05-14T22:07:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,760 | java | package edu.miracosta.finalprojecttest.view_learn_more;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ListView;
import java.io.IOException;
import java.util.List;
import edu.miracosta.finalprojecttest.R;
import edu.miracosta.finalprojecttest.model.JSONLoader;
import edu.miracosta.finalprojecttest.model.enviroment.Plant;
public class PlantsListActivity extends ListActivity {
//TODO: Create a custom list adapter.
//TODO: This one should be easier than the inventory list adapter.
//TODO: See Pet Protector for help.
private List<Plant> allPlants;
private ListView plantsListView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
allPlants = JSONLoader.loadJSONFromAssetPlant(this);
} catch (IOException e) {
Log.e("Final Project", "Error loading JSON" + e.getMessage());
}
plantsListView = findViewById(R.id.plantsListView);
setListAdapter(new PlantsListAdapter(this, R.layout.plant_list_item, allPlants));
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
Intent detailsIntent = new Intent(this, ActivityDetails.class);
// ListItems correspond to the List entries by position
Plant selectedPlant = allPlants.get(position);
detailsIntent.putExtra("Name", selectedPlant.getPlantName());
detailsIntent.putExtra("Description", selectedPlant.getPlantDetails());
detailsIntent.putExtra("ImageName", selectedPlant.getPlantImage());
startActivity(detailsIntent);
}
}
| [
"[email protected]"
] | |
4043b17f5f30a479fe2ea4254e835e3d790e5d38 | bf7ff3400b21429843b37769a8623d1e43113c33 | /src/net/fornwall/eclipsecoder/archive/ProblemFetcherJob.java | e5d96579a790d2fc7e990c0fb05796e544f4a478 | [] | no_license | fornwall/eclipsecoder-archive | 50934db743cfb8d1cfd8c0587cf672f3cba6f4e6 | ce9d2476eb32eba23fd12e8615ee8ea30cf64d72 | refs/heads/master | 2021-01-21T04:26:50.862673 | 2016-08-02T13:10:42 | 2016-08-02T13:10:42 | 2,284,707 | 2 | 5 | null | 2016-07-31T19:32:20 | 2011-08-28T19:34:52 | Java | UTF-8 | Java | false | false | 3,426 | java | package net.fornwall.eclipsecoder.archive;
import java.net.UnknownHostException;
import java.util.List;
import javax.security.auth.login.LoginException;
import net.fornwall.eclipsecoder.languages.LanguageSupport;
import net.fornwall.eclipsecoder.languages.LanguageSupportFactory;
import net.fornwall.eclipsecoder.preferences.EclipseCoderPlugin;
import net.fornwall.eclipsecoder.stats.ProblemStatement;
import net.fornwall.eclipsecoder.util.Utilities;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
/**
* A job to fetch a problem description from the online TopCoder problem
* archive.
*/
public class ProblemFetcherJob extends Job {
private ProblemStats stats;
public ProblemFetcherJob(ProblemStats stats) {
super(Messages.checkingOutProblem);
this.stats = stats;
setUser(true);
}
@Override
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask(Messages.checkingOutProblem, 100);
try {
String language = EclipseCoderPlugin.getDefault().getPreferenceStore()
.getString(EclipseCoderPlugin.PREFERENCE_LANGUAGE);
List<String> availabe = LanguageSupportFactory.supportedLanguages();
if (language == null || !availabe.contains(language)) {
if (availabe.isEmpty()) {
return new Status(IStatus.ERROR, EclipseCoderPlugin.PLUGIN_ID, IStatus.OK,
Messages.noLanguageSupportFound, null);
}
// fall back to first available if it exists
language = availabe.get(0);
}
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
final String finalLanguage = language;
monitor.subTask(Messages.loggingIntoProblemArchive);
monitor.worked(10);
ProblemScraper scraper = null;
try {
scraper = new ProblemScraper(EclipseCoderPlugin.tcUserName(), EclipseCoderPlugin.tcPassword());
} catch (LoginException loginProblem) {
return ProblemScraper.createLoginFailedStatus(loginProblem);
} catch (UnknownHostException e) {
return new Status(IStatus.ERROR, EclipseCoderPlugin.PLUGIN_ID, IStatus.OK,
Messages.unableToConnectToTopCoder, e);
}
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
monitor.worked(20);
monitor.subTask(Messages.downloadingProblem);
String html = scraper.getHtmlProblemStatement(stats);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
monitor.worked(30);
monitor.subTask(Messages.downloadingTestCases);
List<ProblemScraper.StringPair> testCasesStrings = scraper.getExamples(stats);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
monitor.worked(15);
monitor.subTask(Messages.parsingProblem);
final ProblemStatement problemStatement = ProblemParser.parseProblem(html, testCasesStrings);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
monitor.worked(15);
monitor.subTask(Messages.creatingLanguageSupport);
final LanguageSupport languageSupport = LanguageSupportFactory.createLanguageSupport(finalLanguage);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
Utilities.runInDisplayThread(new Runnable() {
@Override
public void run() {
languageSupport.createProject(problemStatement).openSourceFileInEditor();
}
});
return Status.OK_STATUS;
} catch (Exception exc) {
Utilities.showException(exc);
return Status.CANCEL_STATUS;
}
}
}
| [
"[email protected]"
] | |
d7fe3ba6e6b426e1a09e2566f107376aed815ceb | eb39f5c1fadc317b9bf0cc0cbaeeba04f41c9757 | /src/main/java/com/hack/dao/GroupDao.java | 64b81dbebc75a4a23a56c22c1c48ab32b88b89a9 | [] | no_license | Moonergfp/hackthon | 17dbd62bc9e4af7243899c36dd1284272dfac598 | e956db60b0d8a40277f26b2859b16706d78ccb2c | refs/heads/master | 2021-01-12T08:24:00.209674 | 2017-08-31T02:55:05 | 2017-08-31T02:55:05 | 76,563,974 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,789 | java | package com.hack.dao;
import com.hack.cons.TableCons;
import com.hack.domain.GroupDb;
import com.hack.domain.UserDb;
import com.hack.vo.GroupMem;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.jdbc.core.SqlProvider;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.*;
import java.util.List;
import java.util.Map;
import static org.apache.ibatis.jdbc.SelectBuilder.*;
public interface GroupDao {
String INSERT_FILEDS = "group_name,remark,des,group_pic";
String SELECT_FIELDS = "id," + INSERT_FILEDS;
String INSERT_VALUES = "#{groupName},#{remark},#{des},#{groupPic}";
@Insert("insert into " + TableCons.GROUP_TABLE + "(" + INSERT_FILEDS + ") values (" + INSERT_VALUES + ")")
@Options(useGeneratedKeys = true)
int insert(GroupDb groupDb);
@Select("select " + SELECT_FIELDS + " from " + TableCons.GROUP_TABLE + " where id=#{id}")
GroupDb getById(int id);
@SelectProvider(type = SqlProvider.class, method = "getByIds")
List<GroupDb> getByIds(@Param("groupIdList") List<Integer> groupIdList);
// @SelectProvider(type = SqlProvider.class, method = "getUserGroupAndMems")
// List<GroupMem> getUserGroupAndMems(int userId);
class SqlProvider {
public String getByIds(Map<String,Object> param) {
List<Integer> ids = ( List<Integer>) param.get("groupIdList");
BEGIN();
SELECT(SELECT_FIELDS);
FROM(TableCons.GROUP_TABLE);
WHERE("id in ("+ StringUtils.join(ids,",")+")");
return SQL();
}
}
}
| [
"[email protected]"
] | |
9b7a14f3acf54ad4c76057e16919ad9daaad3fd9 | ef5e32a99d0c07cf367615c347ec23600f131557 | /QA-JC-FilesFIOGenerator/src/HumanEntity.java | 045f87e879ae8c155f6d100138870c58cb9457aa | [] | no_license | Dronan13/QA-JC-01 | 08b6598a862e8718d4cc76c6b94d5bd55b778b0d | ff50ffc5f9a3d0ef334d6b3f4921cfd78c875115 | refs/heads/master | 2016-08-13T00:22:48.358365 | 2016-05-04T17:23:22 | 2016-05-04T17:23:22 | 51,141,221 | 0 | 0 | null | null | null | null | WINDOWS-1251 | Java | false | false | 1,243 | java | public class HumanEntity {
//параметры класса
private String sex;
private String surname;
private String name;
private String fathersname;
private String birthday;
//пустой коструктор
HumanEntity(){
}
//параметризированный коструктор
HumanEntity(String sex,String surname,String name,String fathersname,String birthday){
this.sex = sex;
this.surname = surname;
this.name = name;
this.fathersname = fathersname;
this.birthday = birthday;
}
// Геттеры и сеттеры для параметров
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getFathersname() {
return fathersname;
}
public void setFathersname(String fathersname) {
this.fathersname = fathersname;
}
}
| [
"Dronan13@DESKTOP-6E2GV0F"
] | Dronan13@DESKTOP-6E2GV0F |
655e737a7e8c3a38f713d482c1f86baff785761c | ccaf260884a5b378a4b4178a5489d18f022eaac0 | /Group15_AI3/src/CombinedModel.java | 971fce69dc09cf67fa612d3ff9f848c5edb73697 | [] | no_license | mmolignano/ai3 | ac650a27434eeb74c5988217091dac458e72485a | 0a2e9789ad268e06b7ceb0c627504d3e308e643d | refs/heads/master | 2021-01-20T15:49:22.643334 | 2010-02-22T22:51:48 | 2010-02-22T22:51:48 | 33,311,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,127 | java | /**
* Class keeps track of a unigram, bigram, and trigram model. When predicting
* it takes a look at all three, if unigram and bigram match, it uses that,
* otherwise it uses trigram.
*
* @author Michael Molignano, Chris Pardy, Rich Pavis, John Sandbrook
*
*/
public class CombinedModel implements Model {
private UnigramModel um;
private BigramModel bm;
private TrigramModel tm;
public CombinedModel(){
this.um = new UnigramModel();
this.bm = new BigramModel();
this.tm = new TrigramModel();
}
@Override
public String predict(String previousChars, boolean peek) {
String up = this.um.predict(previousChars, peek);
String bp = this.bm.predict(previousChars, peek);
String tp = this.tm.predict(previousChars, peek);
// Return tp unless up and bp are the same
if (up.equals(bp)) {
return up;
}
return tp;
}
@Override
public void train(String trainFile) {
this.um.train(trainFile);
this.bm.train(trainFile);
this.tm.train(trainFile);
}
@Override
public void peek(String testFile) {
this.um.peek(testFile);
this.bm.peek(testFile);
this.tm.peek(testFile);
}
}
| [
"Emuking@c842427a-1736-11df-914e-2594af177612"
] | Emuking@c842427a-1736-11df-914e-2594af177612 |
9107182a85f107aa11f1ac0509b515855663e075 | d241d1cb2391a9e685732a18ccf50e44d0a47305 | /backend/src/main/java/com/sidiq/fullstackjava/controller/StudentController.java | 350b71d6bd4288eb15ccac4ce476434952caff6c | [] | no_license | muhammadashshiddiqi/springreact_restapi | e22bbcb90fd401a3cf7d5102afb87fa56aaa14db | 33359d1af571294aabdc46ed2f9d726561068be5 | refs/heads/main | 2023-09-03T23:28:09.613457 | 2021-11-01T02:10:46 | 2021-11-01T02:10:46 | 423,304,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 729 | java | package com.sidiq.fullstackjava.controller;
import com.sidiq.fullstackjava.model.Student;
import com.sidiq.fullstackjava.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/student")
@CrossOrigin
public class StudentController {
@Autowired
private StudentService studentService;
@PostMapping("/add")
public String add(@RequestBody Student student){
studentService.saveStudent(student);
return "new student is added";
}
@GetMapping("/getAll")
public List<Student> getAllStudents(){
return studentService.getAllStudents();
}
}
| [
"[email protected]"
] | |
7b828c1afb5a7bcf3750290a1cbee284b00ce25e | 80dbe293f549c773d3e227e90c01833213b99ab5 | /chapter7_8/KiloConverterWindowPhase2/KilometerConverterDemo.java | af3c29073854b8de665048f1f7e76e8354f01c84 | [] | no_license | htankhai/Org.StartingoutwithJava | 9174cf162481c7edb628a62602e7ceba8ee48a10 | 215c96f55e92829d0b29119b739a56ebec653055 | refs/heads/master | 2020-04-15T00:45:45.784385 | 2015-06-20T22:08:59 | 2015-06-20T22:08:59 | 37,787,735 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java | package KiloConverterWindowPhase2;
import KiloConverterWindowPhase2.KiloConverterWindow;
/**
This program creates an instance of the
KiloConverterWindow class, which displays
a window on the screen.
*/
public class KilometerConverterDemo{
public static void main(String[] args)
{
KiloConverterWindow kc = new KiloConverterWindow();
}
}
| [
"[email protected]"
] | |
b66fde54558a52b450117d52c1a1fcbeac902ace | 593279007695e43b4c3b03eb7b6e74f791f15cca | /Server.java | 3c84455cac0641327c637c05fe15b5f9ddcc52fe | [
"MIT"
] | permissive | haniano/dandyhacks-2021 | f4b238eec6e977e80e1d5aff8750145a01b71742 | 23c2dbff51d397058cf6320b3d6caba27ca4ad15 | refs/heads/master | 2023-09-01T12:54:15.605352 | 2021-11-03T18:58:59 | 2021-11-03T18:58:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,588 | java | import java.net.*;
import java.io.*;
public class Server extends Player{
private InetAddress ip;
private ServerSocket server;
public Server(String name) {
super(name, false);
try {
this.ip = InetAddress.getLocalHost();
this.server = new ServerSocket(0, 1, ip);
System.out.printf("You have created a server at %s on port %d\n", ip.getHostAddress(), server.getLocalPort());
System.out.println("Waiting for connection...");
this.socket = server.accept();
updatePlayerDataStreams(); //this must be called here so that in and out are correctly initialized
String oppName = in.readUTF();
System.out.println(oppName + " connected from " + this.socket.getInetAddress() + ":" + this.socket.getPort());
out.writeUTF(name);
} catch (IOException e) {
e.printStackTrace();
}
while (!isOver) {
if(myTurn) {
sendMove();
game.board.printBothBoards(game.oppBoard);
}else {
receiveMove();
game.board.printBothBoards(game.oppBoard);
}
}
if (this.winner) {
System.out.println("Congrats! You Win!");
} else {
System.out.println(this.oppName + " Wins. Better luck next time");
}
try {
server.close();
} catch (IOException e) {
e.printStackTrace();
}
closeConnection();
}
}
| [
"[email protected]"
] | |
87be30c1681af38435b33810eac04113d364454b | 47b38aab1bfab49ae78242c9e4db547abd9eb333 | /src/main/java/com/gamification/domain/BadgeCard.java | de903d10e137405981341297d5e81e9428cb6490 | [] | no_license | sbsromero/Microservicios-MultiplicationProject | 46798cbbb578186d3d61770b7b5b477853640351 | 92ca1c73f18bdcfc11a16eae34fe6ff4dcfe173f | refs/heads/master | 2020-05-30T10:44:54.188804 | 2019-06-01T02:08:28 | 2019-06-01T02:08:28 | 189,679,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package com.gamification.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
@RequiredArgsConstructor
@ToString
@EqualsAndHashCode
@Getter
@Entity
public class BadgeCard {
@Id
@GeneratedValue
@Column(name = "BADGE_ID")
private final Long badgeId;
private final Long userId;
private final long badgeTimestap;
private final Badge badge;
public BadgeCard() {
this(null, null, 0, null);
}
public BadgeCard(Long userId, Badge badge) {
this(null, userId, System.currentTimeMillis(), badge);
}
}
| [
"[email protected]"
] | |
f7fbae17131dc30d701c34c2a791ac8745e21a89 | 7b00734dbc373b51cdf86e43126641c1d47c0256 | /test12Thread/src/test/com/Test01ThreadEx.java | 59d2f4f167293f00b91de27b4a4e354dd95cde2c | [] | no_license | Ehyunnn/javaProject | 72273bb1b10b9d6cf2921dc0510f372bdb87b94b | 6dba501a449c3e7b53a3b5e3ae010e8fbc44ed54 | refs/heads/master | 2020-03-22T09:05:56.897929 | 2018-07-06T08:05:48 | 2018-07-06T08:05:48 | 139,814,309 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 314 | java | package test.com;
public class Test01ThreadEx extends Thread {
@Override
public void run() {
for (int i = 10; i < 20; i++) {
System.out.println("run" + i);
try {
Thread.sleep(1000); // 1초간 잠깐 쉬엇다가 해라 ~
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
| [
"[email protected]"
] | |
8ec499cf167d30f8f790add437c62d5586dc9609 | c01ce12554baa70ee1538abbc5dfa7b4dd1b1c0a | /app/src/main/java/com/example/StaggeredGridLayoutManager/CustomRecyclerviewAdapter.java | 9dbda3f6c9d8c4ef3481096209aa8807ce72aedd | [] | no_license | suvojitd79/StaggeredGridLayoutManager- | d69054f37569c0fd60a9bc40b51f36e5b203ae20 | a30bc3f79c93f7b22f019cf4c0f00ed3ec83f1fe | refs/heads/master | 2020-05-24T09:18:15.894821 | 2019-05-17T16:41:05 | 2019-05-17T16:41:05 | 187,202,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,053 | java | package com.example.StaggeredGridLayoutManager;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import java.util.List;
class CustomRecyclerViewAdapter extends RecyclerView.Adapter<CustomRecyclerViewAdapter.CustomRecyclerViewHolder>{
private List<Data> imageModels = new ArrayList<>();
public void setImageModels(List<Data> imageModels){
Log.d("99",imageModels.size()+"");
this.imageModels = imageModels;
notifyDataSetChanged();
}
@NonNull
@Override
public CustomRecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.image_layout,viewGroup,false);
return new CustomRecyclerViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull CustomRecyclerViewHolder customRecyclerViewHolder, int i) {
customRecyclerViewHolder.setImageView(imageModels.get(i).getImageModel().getSmall());
customRecyclerViewHolder.setTextView(imageModels.get(i).getAlt_description());
}
@Override
public int getItemCount() {
return imageModels.size();
}
class CustomRecyclerViewHolder extends RecyclerView.ViewHolder{
ImageView imageView;
TextView textView;
public CustomRecyclerViewHolder(@NonNull View itemView) {
super(itemView);
imageView = itemView.findViewById(R.id.image);
textView = itemView.findViewById(R.id.textView);
}
public void setImageView(String uri) {
Picasso.get().load(uri)
.into(imageView);
}
public void setTextView(String text) {
this.textView.setText(text);
}
}
}
| [
"[email protected]"
] | |
8c652b99e7853e7a69d3ef327e116cb8a744e8cb | 3a764e4dcc5e704a077410b3b10db460e0acf922 | /Lab2/Lab1-redux/src/main/java/Default/MyApplication.java | 0268fbfe41d1eb9e545c1b9b144952250030d49b | [] | no_license | KACHANIX/SOA_Labs | 46d1596a0d309f7357e4bbf291ef00df02b2235a | b01501a481243aade53386e7f9a616567b0c2395 | refs/heads/master | 2023-02-11T05:15:12.865544 | 2021-01-10T17:20:42 | 2021-01-10T17:20:42 | 315,382,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 165 | java | package Default;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath("/")
public class MyApplication extends Application {
}
| [
"[email protected]"
] | |
2a02bb5540d1d46580174f1795ef4ec61363d4b0 | a1a51aad102f9f82647bb4624940bf1fd0486def | /engines/dyn4j/src/org/dyn4j/collision/manifold/ManifoldSolver.java | 0a90d8833cefc1c923e2e64f811d56481d140000 | [] | no_license | Madzi/featurea | 337c187b19c69e82956a4b8d711eb40dbbf07f7a | 4ee44d5910617c1233a77e0787d85717ee5347a0 | refs/heads/master | 2020-12-11T05:58:44.584623 | 2016-07-25T20:54:07 | 2016-07-25T20:54:07 | 64,206,389 | 0 | 1 | null | 2016-07-26T09:00:15 | 2016-07-26T09:00:15 | null | UTF-8 | Java | false | false | 3,675 | java | /*
* Copyright (c) 2010-2016 William Bittle http://www.dyn4j.org/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions
* and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
* and the following disclaimer in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of dyn4j nor the names of its contributors may be used to endorse or
* promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.dyn4j.collision.manifold;
import org.dyn4j.collision.narrowphase.NarrowphaseDetector;
import org.dyn4j.collision.narrowphase.Penetration;
import org.dyn4j.geometry.Convex;
import org.dyn4j.geometry.Shape;
import org.dyn4j.geometry.Transform;
/**
* Finds a contact {@link Manifold} for two given {@link Convex} {@link Shape}s that are in collision.
* <p>
* A contact {@link Manifold} is a collection of contact points for a collision. For two dimensions, this will never
* be more than two contacts.
* <p>
* A {@link ManifoldSolver} relies on the {@link Penetration} object returned from a {@link NarrowphaseDetector} to
* determine the contact {@link Manifold}. The {@link Manifold}s have ids to facilitate caching of contact information.
* <p>
* It's possible that no contact points are returned, in which case the {@link #getManifold(Penetration, Convex, Transform, Convex, Transform, Manifold)}
* method will return false.
* @author William Bittle
* @version 3.2.0
* @since 1.0.0
* @see Manifold
*/
public interface ManifoldSolver {
/**
* Returns true if there exists a valid contact manifold between the two {@link Convex} {@link Shape}s.
* <p>
* When returning true, this method fills in the {@link Manifold} object with the points, depth, and normal.
* <p>
* The given {@link Manifold} object will be cleared using the {@link Manifold#clear()} method. This allows reuse of the
* {@link Manifold} if desired.
* <p>
* The {@link Penetration} object will be left unchanged by this method.
* @param penetration the {@link Penetration}
* @param convex1 the first {@link Convex} {@link Shape}
* @param transform1 the first {@link Shape}'s {@link Transform}
* @param convex2 the second {@link Convex} {@link Shape}
* @param transform2 the second {@link Shape}'s {@link Transform}
* @param manifold the {@link Manifold} object to fill
* @return boolean
*/
public abstract boolean getManifold(Penetration penetration, Convex convex1, Transform transform1, Convex convex2, Transform transform2, Manifold manifold);
}
| [
"[email protected]"
] | |
42639437b5d3d893fddee2493e23cd618a87eeba | 07d7c849331b6535ee64ead7c89eaf48a7eacca7 | /src/abstract$factory/demo2/Cpu.java | 6fd128c7f7f52994d11f3f55382bf8fee3afb2bc | [] | no_license | PhilosophyBuns/design-pattern | de5c0bd9ff1befa8bcf7de58d791b5c32323365c | c497f033139a4646466c2933d3b29183f794bbb7 | refs/heads/master | 2020-04-03T11:57:42.515620 | 2018-10-29T15:43:55 | 2018-10-29T15:43:55 | 155,236,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 86 | java | package abstract$factory.demo2;
public interface Cpu {
public void calculate();
} | [
"[email protected]"
] | |
bfb1dc2e85b12f250cec7bd6e4b5585f65074086 | c86269a24ae3d97262af2a154a8cf859bcc5766d | /travel-ui/src/main/java/vchrisb/spring/TravelUiApplication.java | aeac76f62576997e1d1f5b9b3a8754db663c9029 | [
"MIT"
] | permissive | KumareshBabuNS/cf-scs-demo | 4657e5c0a7b264a9bf617e3467cb6fcbf9693f2d | dad63f97790068077fd7a73c64d517959855ee6b | refs/heads/master | 2021-01-01T17:34:34.214913 | 2017-07-21T21:13:28 | 2017-07-21T21:13:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package vchrisb.spring;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public class TravelUiApplication {
public static void main(String[] args) {
SpringApplication.run(TravelUiApplication.class, args);
}
}
| [
"[email protected]"
] | |
96ecc93b8e77cf8d7506a1b847167e36aa81a867 | c36be0750ef91e4ffb1f7a70a2d4e83a11efc766 | /app/src/main/java/com/example/qiangxu/qsbk/adapters/DetailAdapter.java | 659e622a60dc806f0c2ce12b622a7becab6be4c0 | [] | no_license | xiaoqiangchongchongchong/QSBK | 6aea1d97156a9faf48ffd1c0e83ba3465a6b00c8 | 3442ce026e494121d3a072c320b1820bb0f47c72 | refs/heads/master | 2021-01-10T01:18:52.602378 | 2016-01-03T15:36:19 | 2016-01-03T15:36:19 | 48,689,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,067 | java | package com.example.qiangxu.qsbk.adapters;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.example.qiangxu.qsbk.domain.LeftMenuTitle;
import com.example.qiangxu.qsbk.fragments.BlankFragment;
import com.example.qiangxu.qsbk.fragments.DetailFragment;
import java.util.List;
/**
* Created by QiangXu on 2015/12/30.
*/
public class DetailAdapter extends FragmentPagerAdapter {
private List<LeftMenuTitle> list;
private long suggestId;
public DetailAdapter(FragmentManager fm, List<LeftMenuTitle> list, long suggestId ) {
super(fm);
this.list = list;
this.suggestId = suggestId;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Fragment getItem(int position) {
return DetailFragment.newInstance(list.get(position), suggestId);
}
@Override
public CharSequence getPageTitle(int position) {
return list.get(position).getTitle();
}
}
| [
"[email protected]"
] | |
c36ebc5dafd1e6412e83a9f19a6b2c3c2e1d14a0 | 026dc1e1b86e6ddab0ac0ceba5ebb7502157865c | /src/test/java/com/razvan/kafka/springkafkaintegration/SpringKafkaIntegrationApplicationTests.java | d1c1e38fa752d4b733392ded161da99cf40322b9 | [] | no_license | razvanistoica/spring-kafka-integration | 8ae4c364916942fe43944ac1ef012cbc2464c9f4 | 9487adda1b7aa686c5089a9903bbac7c99293946 | refs/heads/master | 2021-05-23T13:59:39.805832 | 2020-04-05T20:23:49 | 2020-04-05T20:23:49 | 253,325,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 247 | java | package com.razvan.kafka.springkafkaintegration;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringKafkaIntegrationApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
70ab61b1c8ec4552e966f0c7c2674ad8d38aa6b6 | 22b1fe6a0af8ab3c662551185967bf2a6034a5d2 | /experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_0306.java | 1d70dcf2116cd16a2718b2f2f47b4247744ff752 | [
"Apache-2.0"
] | permissive | lesaint/experimenting-annotation-processing | b64ed2182570007cb65e9b62bb2b1b3f69d168d6 | 1e9692ceb0d3d2cda709e06ccc13290262f51b39 | refs/heads/master | 2021-01-23T11:20:19.836331 | 2014-11-13T10:37:14 | 2014-11-13T10:37:14 | 26,336,984 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 151 | java | package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_0306 {
}
| [
"[email protected]"
] | |
84ca3bbe99473f1ed53002931108efc2637c88ab | 7e33f5cf58aa9691451afe533f2fac5c87af4fd9 | /ENSF409FinalProject-Final-Client/views/SearchToolView.java | 57d5413e5506e635cf1882dbcd209d5ef8cf31f9 | [] | no_license | youup99/ENSF-409-Final-Project | 1479fa53cf090b00fcd95bf4d5bed07050e9b462 | c47e8db616ea45ffbf3ae54a68fef023c2f55c71 | refs/heads/master | 2020-05-14T21:19:16.403448 | 2019-09-14T19:59:26 | 2019-09-14T19:59:26 | 181,961,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 990 | java | package views;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
/**
* This is the view responsible for searching for a tool.
* @author Kiernan McGuigan
*
*/
public class SearchToolView extends JFrame {
/**
* Serial ID for the view.
*/
private static final long serialVersionUID = 1L;
private JLabel searchLabel = new JLabel("Search For Tool: ");
private JTextField searchField = new JTextField("Name or ID", 15);
private JButton search = new JButton("Search");
public SearchToolView() {
super("Search for Tool");
this.setSize(400,100);
this.setResizable(false);
this.setLayout(new FlowLayout());
this.add(searchLabel);
this.add(searchField);
this.add(search);
}
public void setSearchListener(ActionListener al) {
search.addActionListener(al);
}
public String getSearchFeild() {
return searchField.getText();
}
}
| [
"[email protected]"
] | |
93f0da86196219b4712b1f6a073255aaf5c6cd08 | 48a1d78dc6ea566dddd9a9fe9599b2167beab779 | /DragPin/app/src/main/java/com/hendalqett/dragpin/GData.java | 8288d603d0d2dda0a492b1a87b866f616928be09 | [] | no_license | HendAlQett/Drag-Pin | 2e3e4be7b1696d5245226162f51c4d4a011ac736 | ce924e267a8f0bbb323f14272faf969d9abc4973 | refs/heads/master | 2021-01-10T17:50:12.455193 | 2015-11-03T10:27:23 | 2015-11-03T10:27:23 | 44,746,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 740 | java | package com.hendalqett.dragpin;
/**
* Created by apple on 10/22/15.
*/
public class GData {
// Milliseconds per second
public static final int MILLISECONDS_PER_SECOND = 1000;
// The update interval
public static final int UPDATE_INTERVAL_IN_SECONDS = 5;
// A fast interval ceiling
public static final int FAST_CEILING_IN_SECONDS = 1;
// Update interval in milliseconds
public static final long UPDATE_INTERVAL_IN_MILLISECONDS = MILLISECONDS_PER_SECOND
* UPDATE_INTERVAL_IN_SECONDS;
// A fast ceiling of update intervals, used when the app is visible
public static final long FAST_INTERVAL_CEILING_IN_MILLISECONDS = MILLISECONDS_PER_SECOND
* FAST_CEILING_IN_SECONDS;
} | [
"[email protected]"
] | |
17dc63c9b754690181566070bcbd550a33d27ab7 | 2988c60069eb65977fd300470cf0ecaa2ac04e9b | /spring-boot-poi/src/main/java/controller/StartPoiApplication.java | 83c90ab570c16a50c087dba4f5645144918f30dc | [] | no_license | xiaoliutong/springbootstudy | f5cf149f5ef633ffc1c93b4500147b3b588fe789 | 73294573d54ec09d6229b709cf2ce4108f523fcf | refs/heads/master | 2022-12-18T15:06:19.323956 | 2020-09-16T01:20:38 | 2020-09-16T01:20:38 | 285,487,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package controller;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class StartPoiApplication {
public static void main(String[] args) {
SpringApplication.run(StartPoiApplication.class, args);
}
}
| [
"[email protected]"
] | |
b5c7a6b3a93a12e3dc19f943582b01cb5763f50a | 69cf1cc2818b26046a8bbbf979e252105b20d523 | /src/evilp0s/Bean/PropertyFilter.java | 6841b1e86c3ce3f748838c1e88a4c3e8badb0400 | [] | no_license | Kuner/utils | 0babf9d9b7cdcf1cebcd18b8c819a08279059f29 | e537601fe3bb6fd3b07f6a4ab030cc2d61aad92c | refs/heads/master | 2020-12-27T20:37:46.131671 | 2015-10-08T01:20:54 | 2015-10-08T01:20:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 139 | java | package evilp0s.Bean;
/**
* 属性过滤接口
*/
public interface PropertyFilter {
public String Properties(String pro);
}
| [
"[email protected]"
] | |
2b49e988c963cda99498c952ae57e763a3a2d3c8 | d49bd87b96b80e5bfa1e269fd19639ee3e3bcc54 | /a-bourse-societe-service/src/main/java/com/example/demo/entities/User.java | acdb95ad46fd4dc1dbed099b540bbbcb21ee2698 | [] | no_license | khaoulaAbdelli/springBoot-Microservice-SpringCloud | 98d32e5830abef4703efddea3bb845fc9a6d3b34 | 7619610cbc9b2adf5adb4eeff91162410d79bb87 | refs/heads/master | 2020-04-05T07:41:01.962980 | 2018-11-08T11:14:01 | 2018-11-08T11:14:01 | 156,684,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 98 | java | package com.example.demo.entities;
public class User {
private Long id ;
//private S
}
| [
"[email protected]"
] | |
46f4743d01246f6b615efeb659180662afb14c75 | 8f674b33da34c436336b8fd2dc9a7388b03e01b3 | /xarql.com/src/com/xarql/auth/GoogleHandler.java | d1be762354254d1b98649c6bd88b9dcf3a8b0902 | [
"MIT"
] | permissive | ArnobChowdhury/xarql | e22601c5fbe3f4b91cc2fe938a094b71bf1420c3 | 1b42993e1c7d4de3faa29261a9ff4c0b11fca2ca | refs/heads/master | 2020-04-10T21:56:26.278512 | 2019-01-06T23:29:15 | 2019-01-06T23:29:15 | 161,311,210 | 0 | 0 | null | 2018-12-11T09:41:02 | 2018-12-11T09:41:02 | null | UTF-8 | Java | false | false | 2,073 | java | /*
* MIT License http://g.xarql.com Copyright (c) 2018 Bryan Christopher Johnson
*/
package com.xarql.auth;
import java.io.IOException;
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 com.xarql.main.DeveloperOptions;
/**
* Servlet implementation class GoogleHandler
*/
@WebServlet ("/GoogleHandler")
public class GoogleHandler extends HttpServlet
{
private static final long serialVersionUID = 1L;
private static final String DOMAIN = DeveloperOptions.getDomain();
/**
* @see HttpServlet#HttpServlet()
*/
public GoogleHandler()
{
super();
// TODO Auto-generated constructor stub
} // GoogleHandler()
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* response)
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
// request.setAttribute("domain", DOMAIN);
response.sendRedirect(DOMAIN + "/auth");
} // doGet()
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* response)
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String idToken;
request.setAttribute("id_token", request.getParameter("id_token"));
if(request.getAttribute("id_token") == null)
idToken = "";
else
idToken = request.getAttribute("id_token").toString();
request.setAttribute("id_token", idToken);
String tomcatSession = request.getRequestedSessionId();
new AuthSession(tomcatSession, idToken, "google");
if(AuthTable.contains(tomcatSession))
response.setStatus(200);
else
response.sendError(400);
} // doPost()
} // GoogleHandler
| [
"[email protected]"
] | |
37b47365b2b85e66e96c1344943ab9b4fd54006e | c53e86e923350b94b71e1dcab967a7c7239de7cf | /陈涵/第五周/po/ch/AddPage.java | 5fa4bcd6635331d69de07a1169cd39eb85ba595a | [] | no_license | Saber-Nemsis/The-Second-Practical-Training | 114b42179650b196c11cad410a2d0984ccdd2438 | 81abd50fe9edd424470f3f922b760da2ce76a3fa | refs/heads/main | 2023-05-14T23:14:44.817998 | 2021-06-09T08:42:14 | 2021-06-09T08:42:14 | 359,279,415 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | package com.uiautomator_plus.po.ch;
public class AddPage {
//导航栏添加的text和index
private String addPageText="添加";
private int addPageIndex=0;
//物品名称的text和index
private String goodsNameText="物品名称";
private int goodsNameIndex=0;
//保质期的class和index
private String EXPClassName="android.widget.EditText";
private int EXPIndex=4;
//确认添加的text和index
private String confirmAddText="确认添加";
private int confirmAddIndex=0;
public String getAddPageText() {
return addPageText;
}
public int getAddPageIndex() {
return addPageIndex;
}
public String getGoodsNameText() {
return goodsNameText;
}
public int getGoodsNameIndex() {
return goodsNameIndex;
}
public String getEXPClassName() {
return EXPClassName;
}
public int getEXPIndex() {
return EXPIndex;
}
public String getConfirmAddText() {
return confirmAddText;
}
public int getConfirmAddIndex() {
return confirmAddIndex;
}
}
| [
"[email protected]"
] | |
85b789808bde71c2cad24cefcf89c3dc72caebdb | a327fc80c0967e7bdb892f05dcbd856c49863386 | /src/main/java/net/clomie/jsonsmith/parser/PathScanners.java | 303d861070a1b759928e1b0cd9fc0d558f38dafc | [
"MIT"
] | permissive | clomie/jsonsmith | 1603cc09bf562dd7e5ccc5f5b417cd436a03ee7b | f17c30aad03711bdab499c59cbb18a07c4700ba0 | refs/heads/master | 2020-03-23T03:27:15.365447 | 2018-12-24T13:43:36 | 2018-12-24T13:43:36 | 141,031,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,698 | java | package net.clomie.jsonsmith.parser;
import static org.jparsec.Parsers.*;
import static org.jparsec.Scanners.*;
import org.jparsec.Parser;
import org.jparsec.Parser.Reference;
import org.jparsec.Scanners;
import net.clomie.jsonsmith.ast.ArrayIndex;
import net.clomie.jsonsmith.ast.ObjectKey;
import net.clomie.jsonsmith.ast.Property;
import net.clomie.jsonsmith.ast.PropertyPath;
/**
* Grammer
*
* <pre>
* ArrayIndex ::= [ INTEGER ]
* ObjectKey ::= . IDENTIFIER | [' STRING ']
* Property ::= ListIndex | ObjectKey
* Path ::= Property Path | Property
* </pre>
*/
class PathScanners {
static final Parser<Integer> INDEX = Scanners.INTEGER.map(Integer::valueOf);
static final Parser<ArrayIndex> ARRAY_NOTATION = inBrackets(INDEX).map(ArrayIndex::new);
static final Parser<String> DOT_IDENTIFIER = isChar('.').next(Scanners.IDENTIFIER);
static final Parser<String> STRING_IN_BRACKET = inBrackets(StringLiterals.SINGLE_QUOTED_STRING);
static final Parser<ObjectKey> OBJECT_NOTATION = or(DOT_IDENTIFIER, STRING_IN_BRACKET).map(ObjectKey::new);
static final Parser<Property> PROPERTY_NOTATION = or(ARRAY_NOTATION, OBJECT_NOTATION);
static <T> Parser<T> inBrackets(Parser<T> parser) {
return parser.between(isChar('['), isChar(']'));
}
static Parser<PropertyPath> propertyPath() {
Reference<PropertyPath> ref = Parser.newReference();
Parser<PropertyPath> multiple = sequence(PROPERTY_NOTATION, ref.lazy(), PropertyPath::new);
Parser<PropertyPath> single = PROPERTY_NOTATION.map(PropertyPath::new);
Parser<PropertyPath> parser = multiple.or(single);
ref.set(parser);
return parser;
}
}
| [
"[email protected]"
] | |
76025eb4635611621f044df2727f087da9a311e9 | b2986a7916527aa3c79e768f23b8bea77b523cb6 | /src/main/java/controller/CollectController.java | 8d9df876bbf4efc5132bba5cea2b1577585e2626 | [] | no_license | ShawyerPeng/SharedCampus | ff4d42a2d7254212febc90c9e889a1539c5b8d59 | 076e95dea5451f7f152a4336bd288f484bcbd9dd | refs/heads/master | 2021-08-28T21:28:30.955360 | 2017-12-13T06:04:51 | 2017-12-13T06:04:51 | 104,431,178 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,275 | java | package controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import po.Collect;
import po.Order;
import po.PagedResult;
import service.CollectService;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping("/collect")
public class CollectController {
@Autowired
private CollectService collectService;
@RequestMapping("/insert")
@ResponseBody
public Map<String, Object> insert(@RequestBody Collect collect) {
Map<String, Object> map = new HashMap<>();
Map<String, Object> data = new HashMap<>();
int success = collectService.insertCollect(collect);
if (success == 1) {
map.put("data", data);
map.put("statusCode", "200");
map.put("message", "收藏添加成功");
return map;
} else {
map.put("data", data);
map.put("statusCode", "400");
map.put("message", "收藏添加失败");
return map;
}
}
@RequestMapping("/delete")
@ResponseBody
public Map<String, Object> delete(@RequestBody Collect collect) {
Map<String, Object> map = new HashMap<>();
Map<String, Object> data = new HashMap<>();
Integer collectId = collect.getCollectId();
int success = collectService.deleteCollect(collectId);
if (success == 1) {
map.put("data", data);
map.put("statusCode", "200");
map.put("message", "收藏删除成功");
return map;
} else {
map.put("data", data);
map.put("statusCode", "400");
map.put("message", "收藏删除失败");
return map;
}
}
@RequestMapping("/getAllCollects")
@ResponseBody
public PagedResult<Collect> getAllCollects(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageNo") Integer pageSize) {
return collectService.getAllCollects(pageNo, pageSize);
}
}
| [
"[email protected]"
] | |
20611f35795c8301442f9b836a73206bbd3c363f | e14813c8216dcaafe3338b571d02004ed756c803 | /app/src/main/java/com/example/root/fragmentbackstacktask/FifthFragment.java | cccf866611dda65a028e38e7f9368312a6c29c9e | [] | no_license | naveenshekar3/Fragment-backstack-task | 90cc4e8d1dbcf385014a367036b6cbc37a53abe1 | 428a9be340c59efee7e3b95b2ba099c4fadb9bd0 | refs/heads/master | 2020-03-13T11:23:00.159988 | 2018-04-26T04:40:01 | 2018-04-26T04:40:01 | 131,100,585 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 657 | java | package com.example.root.fragmentbackstacktask;
import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
*/
public class FifthFragment extends Fragment {
public FifthFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_fifth, container, false);
}
}
| [
"[email protected]"
] | |
58abf593b00d30e4296bc4e8e5d29c94646ca574 | 88ff225a733c25dc4b10499746c2fa6657541b00 | /cloud-alibaba-consumer-nacos-order93/src/main/java/com/jxkj/springcloud/AlibabaOrderApplication93.java | 7e92c829a59dc7ac967ba7cf6cd937e89ef831bf | [] | no_license | yysimple/cloud-study-gitee | c2a72f76ef11c7c733f63475c7e814bbf2c2e853 | 89014c98186fea369281bbffeb5dd4a57547b48d | refs/heads/master | 2023-06-08T14:12:09.510405 | 2020-07-19T08:32:14 | 2020-07-19T08:32:14 | 382,404,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 496 | java | package com.jxkj.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* 功能描述:
*
* @author wcx
* @version 1.0
*/
@SpringBootApplication
@EnableDiscoveryClient
public class AlibabaOrderApplication93 {
public static void main(String[] args) {
SpringApplication.run(AlibabaOrderApplication93.class, args);
}
}
| [
"[email protected]"
] | |
33f2fcffb58dc6c02f89f28e1184ac9d68037580 | c712cf888376b9702a6eb2d2cd190b91b803168c | /src/main/java/nhom7/shopgiay/configuration/RegisterSecurityFilter.java | 1416e17474d6320285c0d307c43853f264a172c5 | [] | no_license | FOSS-TEAM7-CNTT2-K11/ShopGiay | 75909234205dfcb5d53b9b22d9f4f63078ec18e6 | 426c901adee8565906d41f1d27b2578bd01af9c2 | refs/heads/master | 2022-12-27T01:37:17.679197 | 2019-12-15T01:21:00 | 2019-12-15T01:21:00 | 219,970,107 | 0 | 0 | null | 2022-12-15T23:50:14 | 2019-11-06T10:23:40 | HTML | UTF-8 | Java | false | false | 222 | java | package nhom7.shopgiay.configuration;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
public class RegisterSecurityFilter extends AbstractSecurityWebApplicationInitializer {
}
| [
"[email protected]"
] | |
d1ace6a9fa2141b64bbb9013cf2ccd76863e9717 | 6829a76a72e1d13e53da18d267771f44139778a9 | /src/java/com/yz/demo/domain/Permission.java | 7a78d71a6f55a42167e3471554ccc99d3534d65c | [] | no_license | SuphieLiang/ssm_shiro_demo | 936f9bb6d3413676339da2967a2f45cc730a843f | fe40d188f5ba361ca6a3adfdcef68c35bf9c2254 | refs/heads/master | 2021-01-19T14:49:29.384900 | 2017-08-23T06:12:05 | 2017-08-23T06:12:05 | 100,919,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,749 | java | package com.yz.demo.domain;
import java.io.Serializable;
public class Permission implements Serializable{
private Long id;
private String permission;
private String description;
private Boolean available=Boolean.FALSE;
public Permission() {
}
public Permission(String permission, String description, Boolean available) {
this.permission = permission;
this.description = description;
this.available = available;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPermission() {
return permission;
}
public void setPermission(String permission) {
this.permission = permission;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Boolean getAvailable() {
return available;
}
public void setAvailable(Boolean available) {
this.available = available;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Permission that = (Permission) o;
return id != null ? id.equals(that.id) : that.id == null;
}
@Override
public int hashCode() {
return id != null ? id.hashCode() : 0;
}
@Override
public String toString() {
return "Permission{" +
"id=" + id +
", permission='" + permission + '\'' +
", description='" + description + '\'' +
", available=" + available +
'}';
}
}
| [
"[email protected]"
] | |
ee14d84a7d1aeb57191d0dadaac5901705638c2e | 46e326b35fcc9b8637e0faaa4bf624ec60f95326 | /src/main/java/org/tdwg/rs/ubif/_2006/QuantitativeCharMapping.java | fee92485b8fbbb67d06338f98b641d6d2e7f3541 | [] | no_license | biosemantics/matrix-generation | f3bfaf1678672f2110beeb38813c5b0534a61aba | 7f21c575b1656913ba7f886978a61e870634d26b | refs/heads/master | 2021-01-17T15:18:16.915550 | 2019-04-24T23:33:22 | 2019-04-24T23:33:22 | 21,761,012 | 1 | 0 | null | 2017-09-26T21:31:43 | 2014-07-12T06:17:36 | Java | UTF-8 | Java | false | false | 3,341 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-147
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.07.18 at 10:21:36 AM MST
//
package org.tdwg.rs.ubif._2006;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Inner class, used only within QuantitativeCharacter
*
* <p>Java class for QuantitativeCharMapping complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="QuantitativeCharMapping">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="From" type="{http://rs.tdwg.org/UBIF/2006/}ValueRangeWithClass"/>
* <element name="ToState" type="{http://rs.tdwg.org/UBIF/2006/}CharacterStateRef" minOccurs="0"/>
* <group ref="{http://rs.tdwg.org/UBIF/2006/}SpecificExtension" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "QuantitativeCharMapping", propOrder = {
"from",
"toState",
"nextVersion"
})
public class QuantitativeCharMapping {
@XmlElement(name = "From", required = true)
protected ValueRangeWithClass from;
@XmlElement(name = "ToState")
protected CharacterStateRef toState;
@XmlElement(name = "NextVersion")
protected VersionExtension nextVersion;
/**
* Gets the value of the from property.
*
* @return
* possible object is
* {@link ValueRangeWithClass }
*
*/
public ValueRangeWithClass getFrom() {
return from;
}
/**
* Sets the value of the from property.
*
* @param value
* allowed object is
* {@link ValueRangeWithClass }
*
*/
public void setFrom(ValueRangeWithClass value) {
this.from = value;
}
/**
* Gets the value of the toState property.
*
* @return
* possible object is
* {@link CharacterStateRef }
*
*/
public CharacterStateRef getToState() {
return toState;
}
/**
* Sets the value of the toState property.
*
* @param value
* allowed object is
* {@link CharacterStateRef }
*
*/
public void setToState(CharacterStateRef value) {
this.toState = value;
}
/**
* Gets the value of the nextVersion property.
*
* @return
* possible object is
* {@link VersionExtension }
*
*/
public VersionExtension getNextVersion() {
return nextVersion;
}
/**
* Sets the value of the nextVersion property.
*
* @param value
* allowed object is
* {@link VersionExtension }
*
*/
public void setNextVersion(VersionExtension value) {
this.nextVersion = value;
}
}
| [
"[email protected]"
] | |
2674f23a6494bad7cd2b45daac38936f45b65de4 | ec324a8cf7da1024fb703f9d0157335df1d1b0b3 | /src/main/java/com/crm/qa/Utils/TestUtil.java | 4b734ceb52306ca85bd31db7cf325bc7dc002824 | [] | no_license | shivasrivastava1/SeleniumPageObjectModel | 9363f21f2dcbefef47035ce147355313783832b5 | 927a452d142a177faf01ed12d4496c71315a8d6b | refs/heads/master | 2022-07-12T11:21:14.833761 | 2019-06-05T18:49:06 | 2019-06-05T18:49:06 | 135,194,347 | 0 | 0 | null | 2022-06-29T17:25:29 | 2018-05-28T18:10:37 | HTML | UTF-8 | Java | false | false | 148 | java | package com.crm.qa.Utils;
public class TestUtil {
public static long PAGE_LOAD_TIMEOUT = 20;
public static long IMPLICIT_WAIT = 10;
}
| [
"[email protected]"
] | |
57707a8c0639ca9fa856debeb71d26c8daa5b83d | be521ce62870252c0145bbadd502ad8a67d2d94b | /SocialAppBackend/src/main/java/com/niit/dao/PersonDao.java | 45439215a00f7e01ecac1de33e1867f9df4214bc | [] | no_license | shweta129/Social-app | 528906f084e25710eab61573651bc98c73de4423 | b2da42f3781e80615ea31f38a17aaf261b0ba452 | refs/heads/master | 2021-09-04T09:08:34.284990 | 2018-01-17T15:09:55 | 2018-01-17T15:09:55 | 111,788,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package com.niit.dao;
import java.util.List;
import com.niit.dto.Person;
public interface PersonDao {
public List<Person> getAllPersons();
public void savePerson(Person person);
public void deletePerson(int id);
public Person getPerson(int id);
public void updatePerson(Person person);
}
| [
"[email protected]"
] | |
90ee220589412aa68337d9ad0696ad1202a23973 | 1d04f6f24054aab4e3a705b275b32c5ea56c42be | /src/test/java/com/epam/drozdyk/consoleshop/command/impl/application/ShowLastFiveCommandTest.java | 1b99739e4b6dfc99094d7fcb3d803f875d2323f6 | [] | no_license | YevheniiDrozdyk/Console-Shop | 6eaa0a8d13f66cd2875520e836625b3c1dcc4781 | 9be9b274b18072eacf22386673b7f425446f5e4d | refs/heads/master | 2021-01-01T15:22:25.544972 | 2017-07-18T14:07:06 | 2017-07-18T14:07:06 | 97,605,829 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,116 | java | package com.epam.drozdyk.consoleshop.command.impl.application;
import com.epam.drozdyk.consoleshop.constant.GuitarType;
import com.epam.drozdyk.consoleshop.constant.ViolinCategory;
import com.epam.drozdyk.consoleshop.model.Guitar;
import com.epam.drozdyk.consoleshop.model.Instrument;
import com.epam.drozdyk.consoleshop.model.Violin;
import com.epam.drozdyk.consoleshop.service.LastFiveService;
import com.epam.drozdyk.consoleshop.view.LastFiveView;
import com.epam.drozdyk.consoleshop.view.View;
import com.epam.drozdyk.consoleshop.wrapper.LastFive;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class ShowLastFiveCommandTest {
@InjectMocks
private ShowLastFiveCommand command;
@Mock
private LastFiveService lastFiveService;
private LastFive lastFive;
@Before
public void setUp() {
Instrument guitar1 = new Guitar(1, "F-100", "ua", 100, 3, GuitarType.ACOUSTIC);
Instrument violin1 = new Violin(2, "F-200", "ru", 200, 4, ViolinCategory.ARTISANS);
Instrument guitar2 = new Guitar(3, "F-300", "usa", 300, 5, GuitarType.ACOUSTIC);
Instrument violin2 = new Violin(4, "F-400", "de", 400, 6, ViolinCategory.ARTISANS);
Instrument guitar3 = new Guitar(5, "F-500", "fr", 500, 7, GuitarType.ACOUSTIC);
lastFive = new LastFive();
lastFive.getLastFiveMap().put("F-100", guitar1);
lastFive.getLastFiveMap().put("F-200", violin1);
lastFive.getLastFiveMap().put("F-300", guitar2);
lastFive.getLastFiveMap().put("F-400", violin2);
lastFive.getLastFiveMap().put("F-500", guitar3);
}
@Test
public void execute() {
when(lastFiveService.getLastFive()).thenReturn(lastFive);
final View expected = new LastFiveView(lastFive);
final View actual = command.execute();
assertEquals(expected, actual);
}
} | [
"[email protected]"
] | |
3596e9d502ca992e22e4a05a721b4abe9206f52b | 4a45ba900b5849c40dbdd6dd78c3b051b7ed8836 | /rpcserver/rpcserver-api/src/main/java/com/aladin/play/RpcRequest.java | 05e38e5ad4dfe6db41214ec71e5a5c625ccb1ddb | [] | no_license | shanuo0312/yangRpc | 81102ff2c4be2b50cd3426452eda44319fd439c6 | 3c9e43f0172ef589ed1ea637ac47f509015a8d7e | refs/heads/master | 2021-07-07T11:56:46.285442 | 2019-06-23T23:07:14 | 2019-06-23T23:07:14 | 193,210,095 | 0 | 0 | null | 2020-10-13T14:06:53 | 2019-06-22T08:24:55 | Java | UTF-8 | Java | false | false | 698 | java | package com.aladin.play;
import java.io.Serializable;
public class RpcRequest implements Serializable {
private String className;
private String methodName;
private Object[] parameters;
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public Object[] getParameters() {
return parameters;
}
public void setParameters(Object[] parameters) {
this.parameters = parameters;
}
}
| [
"[email protected]"
] | |
bf6ccb41ad8d79cafb2873eee9a6dd102ac8d430 | 1bee697871facc92afaaee16d2f793e21564590b | /src/main/java/io/github/externschool/planner/repository/schedule/ScheduleTemplateRepository.java | 8d54d13cc5cace9139f45edf5e6bd9a99f7f1404 | [
"MIT"
] | permissive | Benkoff/planner | 54c0a7fb6f6bdecf8b0f32c28fd6060d140405ea | fd52cd623d2016784bdf283abf8485c74d160852 | refs/heads/develop | 2021-06-10T20:48:58.728665 | 2019-03-19T07:47:21 | 2019-03-19T07:47:21 | 128,563,352 | 0 | 0 | MIT | 2018-04-07T19:58:17 | 2018-04-07T19:58:17 | null | UTF-8 | Java | false | false | 420 | java | package io.github.externschool.planner.repository.schedule;
import io.github.externschool.planner.entity.User;
import io.github.externschool.planner.entity.schedule.ScheduleTemplate;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface ScheduleTemplateRepository extends JpaRepository<ScheduleTemplate, Long> {
List<ScheduleTemplate> findAllByOwner(User owner);
}
| [
"[email protected]"
] | |
b4acef1d629bec925f5dd72a56bc5a868ea8ec7b | 5f03ff781dead5207da856a78af34899520568e3 | /src/main/java/com/gupaoedu/vip/pattern/proxy/dynamicproxy/gpproxy/proxy/GPProxy.java | f38b5c7c77b4891a5a68265437e2fcf6be398210 | [] | no_license | foxInfly/gupaoedu-vip-design-principle-openclose | 311eace9c58b29ceec02c626315474c8734078da | 9fead5270df05d1f3bcfb9e5e99fad632b46018d | refs/heads/master | 2022-12-10T13:59:56.144643 | 2020-08-18T23:01:40 | 2020-08-18T23:01:40 | 288,581,674 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,734 | java | package com.gupaoedu.vip.pattern.proxy.dynamicproxy.gpproxy.proxy;
import javax.tools.JavaCompiler;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
import java.io.File;
import java.io.FileWriter;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
/**
* 用来生成源代码的工具类
* Created by Tom.
*/
public class GPProxy {
public static final String ln = "\r\n";
public static Object newProxyInstance(GPClassLoader classLoader, Class<?> [] interfaces, GPInvocationHandler h){
try {
//1、动态生成源代码.java文件
String src = generateSrc(interfaces);
// System.out.println(src);
//2、Java文件输出磁盘,保存文件$Proxy0.java
String filePath = GPProxy.class.getResource("").getPath();
// System.out.println(filePath);
File f = new File(filePath + "$Proxy0.java");
FileWriter fw = new FileWriter(f);
fw.write(src);
fw.flush();
fw.close();
//3、把生成的.java文件编译成.class文件
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
StandardJavaFileManager manage = compiler.getStandardFileManager(null,null,null);
Iterable iterable = manage.getJavaFileObjects(f);
JavaCompiler.CompilationTask task = compiler.getTask(null,manage,null,null,null,iterable);
task.call();
manage.close();
//4、编译生成的.class文件加载到JVM中来
Class proxyClass = classLoader.findClass("$Proxy0");
Constructor c = proxyClass.getConstructor(GPInvocationHandler.class);
f.delete();
//5、返回字节码重组以后的新的代理对象
return c.newInstance(h);
}catch (Exception e){
e.printStackTrace();
}
return null;
}
/**动态生成源代码.java文件,就是一个String
* @author lipu
* @since 2020/4/12 22:21
*/
private static String generateSrc(Class<?>[] interfaces){
StringBuffer sb = new StringBuffer();
sb.append(GPProxy.class.getPackage() + ";" + ln);
sb.append("import " + interfaces[0].getName() + ";" + ln);
sb.append("import java.lang.reflect.*;" + ln);
sb.append("public class $Proxy0 implements " + interfaces[0].getName() + "{" + ln);
sb.append("GPInvocationHandler h;" + ln);
sb.append("public $Proxy0(GPInvocationHandler h) { " + ln);
sb.append("this.h = h;");
sb.append("}" + ln);
for (Method m : interfaces[0].getMethods()){
Class<?>[] params = m.getParameterTypes();
StringBuffer paramNames = new StringBuffer();
StringBuffer paramValues = new StringBuffer();
StringBuffer paramClasses = new StringBuffer();
for (int i = 0; i < params.length; i++) {
Class clazz = params[i];
String type = clazz.getName();
String paramName = toLowerFirstCase(clazz.getSimpleName());
paramNames.append(type + " " + paramName);
paramValues.append(paramName);
paramClasses.append(clazz.getName() + ".class");
if(i > 0 && i < params.length-1){
paramNames.append(",");
paramClasses.append(",");
paramValues.append(",");
}
}
sb.append("public " + m.getReturnType().getName() + " " + m.getName() + "(" + paramNames.toString() + ") {" + ln);
sb.append("try{" + ln);
sb.append("Method m = " + interfaces[0].getName() + ".class.getMethod(\"" + m.getName() + "\",new Class[]{" + paramClasses.toString() + "});" + ln);
sb.append((hasReturnValue(m.getReturnType()) ? "return " : "") + getCaseCode("this.h.invoke(this,m,new Object[]{" + paramValues + "})",m.getReturnType()) + ";" + ln);
sb.append("}catch(Error _ex) { }");
sb.append("catch(Throwable e){" + ln);
sb.append("throw new UndeclaredThrowableException(e);" + ln);
sb.append("}");
sb.append(getReturnEmptyCode(m.getReturnType()));
sb.append("}");
}
sb.append("}" + ln);
return sb.toString();
}
private static Map<Class,Class> mappings = new HashMap<Class, Class>();
static {
mappings.put(int.class,Integer.class);
}
private static String getReturnEmptyCode(Class<?> returnClass){
if(mappings.containsKey(returnClass)){
return "return 0;";
}else if(returnClass == void.class){
return "";
}else {
return "return null;";
}
}
private static String getCaseCode(String code,Class<?> returnClass){
if(mappings.containsKey(returnClass)){
return "((" + mappings.get(returnClass).getName() + ")" + code + ")." + returnClass.getSimpleName() + "Value()";
}
return code;
}
private static boolean hasReturnValue(Class<?> clazz){
return clazz != void.class;
}
private static String toLowerFirstCase(String src){
char [] chars = src.toCharArray();
chars[0] += 32;
return String.valueOf(chars);
}
}
| [
"[email protected]"
] | |
a20818e7bae567553ee3ba029d1eee6ce0ddb4b5 | 1f29f7842e30d6265fb9dbb302fe9414755e7403 | /src/main/java/com/eurodyn/okstra/FahrzeugartPropertyType.java | f359d6c22860ded60008282b015819a4a2a3bc54 | [] | no_license | dpapageo/okstra-2018-classes | b4165aea3c84ffafaa434a3a1f8cf0fff58de599 | fb908eabc183725be01c9f93d39268bb8e630f59 | refs/heads/master | 2021-03-26T00:22:28.205974 | 2020-03-16T09:16:31 | 2020-03-16T09:16:31 | 247,657,881 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,746 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2020.03.09 at 04:49:50 PM EET
//
package com.eurodyn.okstra;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for FahrzeugartPropertyType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="FahrzeugartPropertyType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence minOccurs="0">
* <element ref="{http://www.okstra.de/okstra/2.018.2}Fahrzeugart"/>
* </sequence>
* <attGroup ref="{http://www.opengis.net/gml/3.2}OwnershipAttributeGroup"/>
* <attGroup ref="{http://www.opengis.net/gml/3.2}AssociationAttributeGroup"/>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FahrzeugartPropertyType", propOrder = {
"fahrzeugart"
})
public class FahrzeugartPropertyType {
@XmlElement(name = "Fahrzeugart")
protected FahrzeugartType fahrzeugart;
@XmlAttribute(name = "owns")
protected Boolean owns;
@XmlAttribute(name = "nilReason")
protected List<String> nilReason;
@XmlAttribute(name = "remoteSchema", namespace = "http://www.opengis.net/gml/3.2")
@XmlSchemaType(name = "anyURI")
protected String remoteSchema;
@XmlAttribute(name = "type", namespace = "http://www.w3.org/1999/xlink")
protected TypeType type;
@XmlAttribute(name = "href", namespace = "http://www.w3.org/1999/xlink")
protected String href;
@XmlAttribute(name = "role", namespace = "http://www.w3.org/1999/xlink")
protected String role;
@XmlAttribute(name = "arcrole", namespace = "http://www.w3.org/1999/xlink")
protected String arcrole;
@XmlAttribute(name = "title", namespace = "http://www.w3.org/1999/xlink")
protected String attibuteTitle;
@XmlAttribute(name = "show", namespace = "http://www.w3.org/1999/xlink")
protected ShowType show;
@XmlAttribute(name = "actuate", namespace = "http://www.w3.org/1999/xlink")
protected ActuateType actuate;
/**
* Gets the value of the fahrzeugart property.
*
* @return
* possible object is
* {@link FahrzeugartType }
*
*/
public FahrzeugartType getFahrzeugart() {
return fahrzeugart;
}
/**
* Sets the value of the fahrzeugart property.
*
* @param value
* allowed object is
* {@link FahrzeugartType }
*
*/
public void setFahrzeugart(FahrzeugartType value) {
this.fahrzeugart = value;
}
/**
* Gets the value of the owns property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public boolean isOwns() {
if (owns == null) {
return false;
} else {
return owns;
}
}
/**
* Sets the value of the owns property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setOwns(Boolean value) {
this.owns = value;
}
/**
* Gets the value of the nilReason property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the nilReason property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNilReason().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getNilReason() {
if (nilReason == null) {
nilReason = new ArrayList<String>();
}
return this.nilReason;
}
/**
* Gets the value of the remoteSchema property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRemoteSchema() {
return remoteSchema;
}
/**
* Sets the value of the remoteSchema property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRemoteSchema(String value) {
this.remoteSchema = value;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link TypeType }
*
*/
public TypeType getType() {
if (type == null) {
return TypeType.SIMPLE;
} else {
return type;
}
}
/**
* Sets the value of the type property.
*
* @param value
* allowed object is
* {@link TypeType }
*
*/
public void setType(TypeType value) {
this.type = value;
}
/**
* Gets the value of the href property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getHref() {
return href;
}
/**
* Sets the value of the href property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setHref(String value) {
this.href = value;
}
/**
* Gets the value of the role property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRole() {
return role;
}
/**
* Sets the value of the role property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRole(String value) {
this.role = value;
}
/**
* Gets the value of the arcrole property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getArcrole() {
return arcrole;
}
/**
* Sets the value of the arcrole property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setArcrole(String value) {
this.arcrole = value;
}
/**
* Gets the value of the attibuteTitle property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAttibuteTitle() {
return attibuteTitle;
}
/**
* Sets the value of the attibuteTitle property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAttibuteTitle(String value) {
this.attibuteTitle = value;
}
/**
* Gets the value of the show property.
*
* @return
* possible object is
* {@link ShowType }
*
*/
public ShowType getShow() {
return show;
}
/**
* Sets the value of the show property.
*
* @param value
* allowed object is
* {@link ShowType }
*
*/
public void setShow(ShowType value) {
this.show = value;
}
/**
* Gets the value of the actuate property.
*
* @return
* possible object is
* {@link ActuateType }
*
*/
public ActuateType getActuate() {
return actuate;
}
/**
* Sets the value of the actuate property.
*
* @param value
* allowed object is
* {@link ActuateType }
*
*/
public void setActuate(ActuateType value) {
this.actuate = value;
}
}
| [
"[email protected]"
] | |
3fa60f076682c751becc3bfe8b78ce730b744ea4 | a255f86131cb976455569edb49ddededb299be6d | /src/main/java/com/example/utils/DateUtils.java | 0401bf5ffe06fba7c0c972fa1c4715c73fe14d90 | [] | no_license | xiaoguozi218/springboot | e59ee8cdf7bcba52cfd80abb8c2b4c348851a435 | 37be177946b4d9629656d9310cdcc1fd2b254b5d | refs/heads/master | 2022-07-19T11:50:48.355520 | 2021-03-12T08:51:06 | 2021-03-12T08:51:06 | 127,492,258 | 0 | 0 | null | 2022-06-17T01:52:54 | 2018-03-31T02:35:04 | Java | UTF-8 | Java | false | false | 4,753 | java | package com.example.utils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.MonthDay;
import java.util.Calendar;
import java.util.Date;
/**
* JDK8 时间日期库
* Instant——它代表的是时间戳
LocalDate——不包含具体时间的日期,比如2014-01-14。它可以用来存储生日,周年纪念日,入职日期等。
LocalTime——它代表的是不含日期的时间
LocalDateTime——它包含了日期及时间,不过还是没有偏移信息或者说时区。
ZonedDateTime——这是一个包含时区的完整的日期时间,偏移量是以UTC/格林威治时间为基准的。
*
*
*
*
*/
public class DateUtils {
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
private static SimpleDateFormat sdf3 = new SimpleDateFormat("yyyyMMdd");
/**
* @Author shGuo
* @Date 2017年3月13日下午3:54:16
* @return
* @return String
* @Desc 获取当前日期(20170313)
*/
public static String getCurDate(Date d){
return sdf3.format(d);
}
public static String getCurDate(){
return sdf3.format(new Date());
}
/**
* @Author shGuo
* @Date 2017年3月13日下午3:54:16
* @return
* @return String
* @Desc 获取当前日期(2017-03-13)
*/
public static String getNowDate(){
return sdf2.format(new Date());
}
public static String getDateStr(Date d){
return sdf2.format(d);
}
/**
* @Author shGuo
* @Date 2017年3月13日下午4:03:24
* @return
* @return String
* @Desc 获取昨天日期(20170312)
*/
public static String getYesterday(){
Calendar now = Calendar.getInstance();
now.setTime(new Date());
now.add(Calendar.DAY_OF_MONTH, -1);
return sdf3.format(now.getTime());
}
public static Date parse(String date, SimpleDateFormat sdf){
try{
return sdf.parse(date);
}catch (ParseException e) {
e.printStackTrace();
return null;
}
}
/**
* @Author shGuo
* @Date 2017年4月6日下午3:43:10
* @param d
* @param day
* @return
* @return Date
* @Desc 获取day天前的日期
*/
public static Date getDateBefore(Date d, int day) {
Calendar now = Calendar.getInstance();
now.setTime(d);
now.add(Calendar.DAY_OF_MONTH, 0-day);
return now.getTime();
}
public static Date getDateAfter(Date d, int day) {
Calendar now = Calendar.getInstance();
now.setTime(d);
now.add(Calendar.DAY_OF_MONTH, day);
return now.getTime();
}
public static Date resetHMS(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
return calendar.getTime();
}
/**
* @param args
*
*
*/
public static void main(String[] args) {
//示例1 如何 在Java 8中获取当天的日期 2018-06-21
// LocalDate today = LocalDate.now();
// System.out.println("Today's Local date : " + today);
//示例2 如何在Java 8中获取当前的年月日
// LocalDate today = LocalDate.now();
// int year = today.getYear();
// int month = today.getMonthValue();
// int day = today.getDayOfMonth();
// System.out.printf("Year : %d Month : %d day : %d \t %n", year, month, day);
//示例3 在Java 8中如何获取某个特定的日期
// LocalDate dateOfBirth = LocalDate.of(2010, 01, 14);
// System.out.println("Your Date of birth is : " + dateOfBirth);
//示例4 在Java 8中如何检查两个日期是否相等
// LocalDate date1 = LocalDate.of(2018, 06, 21);
// if(date1.equals(today)){
// System.out.printf("Today %s and date1 %s are same date %n", today, date1);
// }
//示例5 在Java 8中如何检查重复事件,比如说生日
// LocalDate dateOfBirth = LocalDate.of(2010, 01, 14);
// MonthDay birthday = MonthDay.of(dateOfBirth.getMonth(), dateOfBirth.getDayOfMonth());
// MonthDay currentMonthDay = MonthDay.from(today);
// if(currentMonthDay.equals(birthday)){
// System.out.println("Many Many happy returns of the day !!");
// }else{
// System.out.println("Sorry, today is not your birthday");
// }
}
}
| [
"[email protected]"
] | |
49485203a984e6f085054f9f0c419527ec415b8a | 5a88a7c54c382e972d0136a6393d96ac3c5f350e | /src/main/java/br/com/zupedu/transactions/security/SecurityConfiguration.java | 5e727a51d8aa7a2b251f2631ff943a3dbec20c36 | [
"Apache-2.0"
] | permissive | GleydsonMS/orange-talents-05-template-transacao | bf7a0ca4abc2677c2c053941550d5928e00bd9a6 | 86d65d13ec6d06ecc513ffb966071e93862655b6 | refs/heads/main | 2023-06-05T00:12:11.311808 | 2021-06-25T12:46:15 | 2021-06-25T12:46:15 | 379,752,175 | 0 | 0 | Apache-2.0 | 2021-06-23T23:26:06 | 2021-06-23T23:26:05 | null | UTF-8 | Java | false | false | 1,180 | java | package br.com.zupedu.transactions.security;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy;
@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests(authorizeRequests ->
authorizeRequests
.antMatchers(HttpMethod.GET, "/cards/{id}/transactions")
.hasAuthority("SCOPE_transaction-scope")
.anyRequest().authenticated()
).csrf().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
}
}
| [
"[email protected]"
] | |
d87705a94db73432c2c934140cc2e0f6dba08d03 | db74b7d1057976d46b473f9d947913bd37c164c8 | /src/main/java/roguetutorial/creatures/Creature.java | d7aca43a34fd0214e3735b49fdb7822e3ee36028 | [] | no_license | dewshick/roguelike_tutor | 1cb2b16d57cc64155d5f8088fe055fd2e106569e | 253ef92da907b53b80159b8c7098c436f6620756 | refs/heads/master | 2021-01-10T12:03:26.111901 | 2016-02-24T13:49:45 | 2016-02-24T13:49:45 | 52,378,597 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,444 | java | package roguetutorial.creatures;
import roguetutorial.Drawable;
import roguetutorial.world.Point3D;
import roguetutorial.world.Tile;
import roguetutorial.world.World;
import roguetutorial.creatures.ai.CreatureAi;
import java.awt.*;
import java.util.Optional;
/**
* Created by avyatkin on 21/02/16.
*/
public class Creature implements Drawable {
private World world;
public Point3D coords;
private char glyph;
private Color color;
private CreatureAi ai;
private int maxHp;
private int hp;
private int attackValue;
private int defenseValue;
public int getMaxHp() {
return maxHp;
}
public int getHp() {
return hp;
}
public int getAttackValue() {
return attackValue;
}
public int getDefenseValue() {
return defenseValue;
}
public Color getColor() { return color; }
public char getGlyph() { return glyph; }
public void setAi(CreatureAi ai) { this.ai = ai; }
public Creature(World world, char glyph, Color color, int maxHp, int attackValue, int defenseValue) {
this.world = world;
this.glyph = glyph;
this.color = color;
this.maxHp = maxHp;
this.hp = maxHp;
this.attackValue = attackValue;
this.defenseValue = defenseValue;
}
public void dig(Point3D point3D) {
world.dig(point3D);
}
public void moveBy(Point3D vector) {
Point3D newCoords = new Point3D(vector.x + coords.x, vector.y + coords.y, vector.z + coords.z);
Optional<Creature> enemy = world.creatureAt(newCoords);
Tile targetTile = world.getTile(newCoords);
if (vector.z == -1)
if (targetTile == Tile.STAIRS_DOWN)
logAction("walk upstairs, moved to level " + newCoords.z);
else {
logAction("fail to walk upstairs cause there's no ladder here");
return;
}
else if (vector.z == 1)
if (targetTile == Tile.STAIRS_UP)
logAction("walk downstairs, moved to level " + newCoords.z);
else {
logAction("fail to walk downstairs cause there's no ladder here");
return;
}
if (enemy.isPresent())
attack(enemy.get());
else
ai.onEnter(newCoords, targetTile);
}
private void attack(Creature enemy) {
int strikeDamage = Math.max(0, getAttackValue() - enemy.getDefenseValue());
strikeDamage = (int)(strikeDamage * Math.random()) + 1;
notify("You attack the '%s' for %d damage", enemy.getGlyph(), strikeDamage);
enemy.modifyHp(-strikeDamage);
enemy.notify("The '%s' attacks you for %d damage.", glyph, strikeDamage);
}
private void modifyHp(int i) {
hp += i;
if (hp < 1) {
world.remove(this);
logAction("die");
}
}
public void update() {
ai.onUpdate();
}
public boolean canEnter(Point3D point3D) {
return world.getTile(point3D).isGround() &&!world.creatureAt(point3D).isPresent();
}
public void notify(String message, Object ... params) {
ai.onNotify(String.format(message, params));
}
public void logAction(String message, Object ... params) {
int radius = 9;
for(int ox = -radius; ox < radius + 1; ox++)
for(int oy = -radius; oy < radius + 1; oy++) {
if(ox * ox + oy * oy > radius * radius)
continue;
Point3D recieverCoords = new Point3D(coords.x + ox, coords.y + oy, coords.z);
Optional<Creature> maybeReciever = world.creatureAt(recieverCoords);
if (!maybeReciever.isPresent())
continue;
Creature reciever = maybeReciever.get();
if (reciever == this)
reciever.notify("You " + message + ".", params);
else
reciever.notify(String.format("The '%s' %s", glyph, makeSecondPerson(message)), params);
}
}
private String makeSecondPerson(String text){
String[] words = text.split(" ");
words[0] = words[0] + "s";
StringBuilder builder = new StringBuilder();
for (String word : words){
builder.append(" ");
builder.append(word);
}
return builder.toString().trim();
}
}
| [
"[email protected]"
] | |
83e24824848bb2f13bb1027ecf00e479f37ae412 | c9c4659d045c087423d67ff5870d1cce9938a913 | /DesignPattern/src/com/training/stru/decorator/ClientDecor.java | f0e0cdfe545569e1df654ff19018df8de2bc8699 | [] | no_license | Shilpshikha/JavaCode | d7b9d8605178e9e2b3f9933e722aeff58f60e5cf | 535bbca1e8d31a59d4159061c6b48bc9a2120b86 | refs/heads/master | 2021-01-10T15:43:31.606441 | 2016-03-31T09:57:10 | 2016-03-31T09:57:10 | 50,654,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 375 | java | package com.training.stru.decorator;
public class ClientDecor {
public static void main(String[] args) {
OnlineBanking acc = new OnlineBanking(new SavingsAccount());
System.out.println(acc.balanceToMaintain());
BankAccount acc2 = new SocialNetBanking(new OnlineBanking(new SavingsAccount()));
System.out.println(acc2.balanceToMaintain());
}
}
| [
"[email protected]"
] | |
733d1edd4ab7a116631408b4a7d8ce9754a4e8d8 | a1837b9a838352c88fdd92e9bf4181caefa50bd9 | /interfaces/gamingconsole/ChessGame.java | 190876c34760efd6b8df717f04436ab501242c05 | [] | no_license | Archanaprasannan/CoreJava_Programs | 1a76cf6a1e60ee756de57e7f53399d3d8f4be3af | e2f71bf6edab31e3982bf7964b4f2b19d66c6dda | refs/heads/main | 2023-05-30T17:44:35.112729 | 2021-06-27T17:51:42 | 2021-06-27T17:51:42 | 380,320,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | package com.archa.workspace.interfaces.gamingconsole;
public class ChessGame implements GamingConsole {
@Override
public void up() {
System.out.println("Move piece up");
}
@Override
public void down() {
System.out.println("Move piece down");
}
@Override
public void left() {
System.out.println("Move piece left");
}
@Override
public void right() {
System.out.println("Move piece right");
}
}
| [
"archa@Achus_Machine"
] | archa@Achus_Machine |
67de0d89bc9eb53d493d559cf79857340c934133 | b26c294d0691f8e1484be1feb4e437d407172c74 | /mybatis-002/src/main/java/pojo/Customer.java | 24f6ba42c1f19eecab9dd53fe63de109e1d655ec | [] | no_license | BlueProtocolLXC/TheFirstMybatis | bbb09511ea56e23a1fa4f2df6606881ebba19771 | 0d2dfdc0c4910dd16b7db9e7a14327e6030de068 | refs/heads/master | 2023-06-14T02:37:08.525674 | 2021-06-23T09:43:44 | 2021-06-23T09:43:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,155 | java | package pojo;
/*
*
*@Author liu
*@Creat Time 2021/6/11 13:34
*@System Data 2021 06
*
*/
import org.apache.ibatis.type.Alias;
//用注解给这个类起一个别名
@Alias("customer")
public class Customer {
private Integer id;
private String customerName;
private String customerPassword;
public Customer() {
}
public Customer(Integer id, String customerName, String customerPassword) {
this.id = id;
this.customerName = customerName;
this.customerPassword = customerPassword;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerPassword() {
return customerPassword;
}
public void setCustomerPassword(String customerPassword) {
this.customerPassword = customerPassword;
}
@Override
public String toString() {
return "Customer{" +
"id=" + id +
", customerName='" + customerName + '\'' +
", customerPassword='" + customerPassword + '\'' +
'}';
}
}
| [
"[email protected]"
] | |
19330682d2f22611151630065cf5ca6ef8fd7b91 | 3b81e703901852799ecdf25e6c5ec62a31d2221a | /Module3/jsp_servlet/bai_11/thuc_hanh/p1/src/service/CustomerService.java | e299bf88df4ee4dd0b41811bbacafd093745a394 | [] | no_license | kienth211/C1020G1_Tran_Huu_Kien | 1fc43325849b54d917ece4d23108ca15a5e9994d | 4bb1e6ee957a5a43f4b534bb95b226b87020454e | refs/heads/main | 2023-04-16T02:17:22.284829 | 2021-04-19T00:39:07 | 2021-04-19T00:39:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 266 | java | package service;
import bean.Customer;
import java.util.List;
public interface CustomerService {
List<Customer> findAll();
void save(Customer customer);
Customer findById(int id);
void update(int id, Customer customer);
void remove(int id);
}
| [
"[email protected]"
] | |
b2f21d6a1ebc902a8e7ef1edcce84ca49e04705f | f1bc2ba98c5b7c5e9fecf699b92c207c964f9d4c | /esb-monitor/monitor-data/monitor-data-api/src/main/java/com/winning/monitor/data/api/transaction/domain/TransactionMessage.java | c9d7476855dfdf8e76ffdf1dce131b889ff496ba | [] | no_license | Lomad/esb-assistant | dbcba15b9d913247e1fde79f8463f8487b51d0d8 | 0a29ecb9cd08d327a27bfb2fa14f91fda753532d | refs/heads/master | 2020-03-14T00:58:08.139177 | 2018-04-28T04:33:30 | 2018-04-28T04:33:30 | 131,367,759 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,271 | java | package com.winning.monitor.data.api.transaction.domain;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* 事务明细记录
*/
public class TransactionMessage {
private List<TransactionMessage> children = new ArrayList<>();
//开始时间yyyy-MM-dd HH:mm:ss
private String startTime;
//17-11-09 新增long类型时间戳
private long timestamp;
//记录id
private String messageId;
//服务代码
private String transactionTypeName;
//服务名称
private String svcName;
//服务步骤名称
private String transactionName;
//服务对应的系统名称
private String serverAppName;
//服务端IP地址
private String serverIpAddress;
//客户端应用名称
private String clientAppName;
//客户端IP地址
private String clientIpAddress;
//客户端类型
private String clientType;
//耗时(毫秒)
private double useTime;
//状态,成功,失败
private String status;
//错误消息
private String errorMessage;
//记录值
private Map<String, String> datas = new LinkedHashMap<>();
private String group;
public List<TransactionMessage> getChildren() {
return children;
}
public void setChildren(List<TransactionMessage> children) {
this.children = children;
}
public String getStartTime() {
return startTime;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getTransactionTypeName() {
return transactionTypeName;
}
public void setTransactionTypeName(String transactionTypeName) {
this.transactionTypeName = transactionTypeName;
}
public String getSvcName() {
return svcName;
}
public void setSvcName(String svcName) {
this.svcName = svcName;
}
public String getTransactionName() {
return transactionName;
}
public void setTransactionName(String transactionName) {
this.transactionName = transactionName;
}
public String getServerAppName() {
return serverAppName;
}
public void setServerAppName(String serverAppName) {
this.serverAppName = serverAppName;
}
public String getServerIpAddress() {
return serverIpAddress;
}
public void setServerIpAddress(String serverIpAddress) {
this.serverIpAddress = serverIpAddress;
}
public String getClientAppName() {
return clientAppName;
}
public void setClientAppName(String clientAppName) {
this.clientAppName = clientAppName;
}
public String getClientIpAddress() {
return clientIpAddress;
}
public void setClientIpAddress(String clientIpAddress) {
this.clientIpAddress = clientIpAddress;
}
public String getClientType() {
return clientType;
}
public void setClientType(String clientType) {
this.clientType = clientType;
}
public double getUseTime() {
return useTime;
}
public void setUseTime(double useTime) {
this.useTime = useTime;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Map<String, String> getDatas() {
return datas;
}
public void setDatas(Map<String, String> datas) {
this.datas = datas;
}
public void addTransactionMessage(TransactionMessage transactionMessage) {
this.children.add(transactionMessage);
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
}
| [
"[email protected]"
] | |
64f414a30050a8698b5a627592583f03b0af79e7 | 67efd87c6b1d334dd75110f7cabe3411802f8baf | /src/android/support/v7/security/impl/ViewHelper.java | b621124c787ffd1bdf24d61398cc1ade73f2be48 | [] | no_license | pprados/android-keychain-backport-androlib | 2e6572ebee9c8db9354f920de2589550e773a0a9 | 03044e5421336abd4ad50a33162129ae28172948 | refs/heads/master | 2021-01-01T18:48:35.641530 | 2013-02-13T10:43:50 | 2013-02-13T10:43:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,685 | java | /*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.support.v7.security.impl;
import android.support.v7.security.R;
import android.view.View;
import android.widget.TextView;
/**
* A helper class for handling text views in the dialogs.
*/
@Deprecated
class ViewHelper
{
private View mView;
private boolean mHasEmptyError;
void setView(View view)
{
mView = view;
}
void showError(int msgId)
{
TextView v = (TextView) mView.findViewById(R.id.error);
v.setText(msgId);
if (v != null)
v.setVisibility(View.VISIBLE);
}
String getText(int viewId)
{
return ((TextView) mView.findViewById(viewId)).getText().toString();
}
void setText(int viewId, String text)
{
if (text == null)
return;
TextView v = (TextView) mView.findViewById(viewId);
if (v != null)
v.setText(text);
}
void setText(int viewId, int textId)
{
TextView v = (TextView) mView.findViewById(viewId);
if (v != null)
v.setText(textId);
}
void setHasEmptyError(boolean hasEmptyError)
{
mHasEmptyError = hasEmptyError;
}
boolean getHasEmptyError()
{
return mHasEmptyError;
}
}
| [
"[email protected]"
] | |
2cb210190db79aad506c65cd5c36922a714c0a11 | 6de926cff893e6b94ba92340450b1156a4c42b8e | /progmob2020/app/src/main/java/com/example/progmob2020/MahasiswaCrud/MahasiswaGetAllActivity.java | 0eaa35af5f107948fc14331a12884d6ddf7b8701 | [] | no_license | YoseAwanaustusSalawangi1/ProgMob2020 | e96ad17512d9f801668793a8fa306aaae67011fa | 0aae68f5fa87af345fd546b99df357de90e9a763 | refs/heads/master | 2023-01-06T04:33:29.846594 | 2020-10-30T10:14:08 | 2020-10-30T10:14:08 | 295,359,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,195 | java | package com.example.progmob2020.MahasiswaCrud;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.widget.Toast;
import com.example.progmob2020.Adapter.MahasiswaCRUDRecyclerAdapter;
import com.example.progmob2020.Model.Mahasiswa;
import com.example.progmob2020.Network.GetDataService;
import com.example.progmob2020.Network.RetrofitClientInstance;
import com.example.progmob2020.R;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class MahasiswaGetAllActivity extends AppCompatActivity {
RecyclerView rvMhs;
MahasiswaCRUDRecyclerAdapter mhsAdapter;
ProgressDialog pd;
List<Mahasiswa> mahasiswaList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mahasiswa_get_all);
rvMhs =(RecyclerView)findViewById(R.id.rvGetMhsAll);
pd = new ProgressDialog(this);
pd.setTitle("Mohon Bersabar");
pd.show();
GetDataService service = RetrofitClientInstance.getRetrofitInstance().create(GetDataService.class);
Call<List<Mahasiswa>> call = service.getMahasiswa("72180217");
call.enqueue(new Callback<List<Mahasiswa>>() {
@Override
public void onResponse(Call<List<Mahasiswa>> call, Response<List<Mahasiswa>> response) {
pd.dismiss();
mahasiswaList = response.body();
mhsAdapter = new MahasiswaCRUDRecyclerAdapter(mahasiswaList);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(MahasiswaGetAllActivity.this);
rvMhs.setLayoutManager(layoutManager);
rvMhs.setAdapter(mhsAdapter);
}
@Override
public void onFailure(Call<List<Mahasiswa>> call, Throwable t) {
pd.dismiss();
Toast.makeText(MahasiswaGetAllActivity.this, "Error",Toast.LENGTH_LONG);
}
});
}
} | [
"[email protected]"
] | |
b99d70b8cc7bc76a44dae08c126adfb0bc8426ba | 85492c8871864bb3e482d05ac148da984e9c4d3f | /lifangxian20190304/src/main/java/com/example/www/lifangxian20190304/HttpUtil.java | f9ef8440340ea5013055f9045ef16a3ed461acc8 | [] | no_license | lifangxian/work2 | c1f4c740855ca1b6dc991d6499a5e8e88c5d90dd | fb6316f4b34f2918d2d6f32e0c74748ecee9ba5e | refs/heads/master | 2020-04-28T10:29:58.912484 | 2019-03-12T12:09:46 | 2019-03-12T12:09:46 | 175,203,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,280 | java | package com.example.www.lifangxian20190304;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.zip.InflaterInputStream;
public class HttpUtil {
private static ConnectivityManager manager;
public static boolean isNetworkConnected(Context context){
if(context!=null){
manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = manager.getActiveNetworkInfo();
if(networkInfo!=null){
return networkInfo.isConnected();
}
}
return false;
}
public static void httpAsyncTask (final String strURL, final Callbanck callbanck){
new AsyncTask<String, Void, String>() {
@Override
protected String doInBackground(String... strings) {
return requestString(strURL);
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
callbanck.getClass(s);
}
}.execute(strURL);
}
public interface Callbanck{
void getClass(String s);
}
//get请求
public static String requestString(String strURL){
try {
URL url = new URL(strURL);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setConnectTimeout(5000);
connection.setReadTimeout(5000);
connection.setRequestMethod("GET");
InputStream inputStream = connection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
StringBuffer buffer=new StringBuffer();
String str="";
while ((str=reader.readLine())!=null){
buffer.append(str);
}
return buffer.toString();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
| [
"[email protected]"
] | |
2bf012418c233c4e1db708498cbbac2997cec4e8 | 97b600effb31dea7d8f1de44960722e414b6b7ac | /2021.09.14/src/io/byte2.txt | c1b6c94185d0c22d7b46c962610e7cc77ce63c12 | [] | no_license | wpdnjsgh01/javastudy | 1c6fcb16f93df63752b87bb3688bc31546ace315 | 1a0ab7df3d966ac7ef3fd2ed7a536c51b5fbe387 | refs/heads/master | 2023-08-12T07:24:59.974089 | 2021-10-07T05:50:08 | 2021-10-07T05:50:08 | 403,562,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | txt | package io;
import java.io.*;
public class ByteExam01 {
public static void main(String[] args) {
long startTime = System.currentTimeMillis();
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream("src/io/ByteExam01.java");
fos = new FileOutputStream("src/io/byte2.txt");
int readCount = -1;
byte[] buffer = new byte[1024];
while((readCount = fis.read(buffer)) != -1) {
fos.write(buffer, 0, readCount);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
long endTime = System.currentTimeMillis();
System.out.println(endTime - startTime);
}
}
| [
"[email protected]"
] | |
d054f230fcd15f842d7a6ca4ce2ae634d1b7b618 | b0f9ac9e79e253a51940f3ab7e1e8df9cd988f50 | /app/src/main/java/android/example/cs496/ui/main/fragment2/file_upload/ApiInterface.java | c123e773ceb7dd704f1a4d41c34d83d24dc52554 | [] | no_license | dongk-97/CS496-my-application2 | f8c079a7a497bf7112afffe03ee6db5df2854eb8 | 1bd460d8a57d197481469e2b204f2c91209ca617 | refs/heads/master | 2023-01-19T12:30:31.543770 | 2020-11-25T13:41:23 | 2020-11-25T13:41:23 | 195,891,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 582 | java | //package android.example.cs496.ui.main.fragment2.file_upload;
//
//import android.example.cs496.ui.main.fragment2.file_upload.ModelClass.ResponseModel;
//
//import okhttp3.MultipartBody;
//import okhttp3.RequestBody;
//import retrofit2.Call;
//import retrofit2.http.Multipart;
//import retrofit2.http.POST;
//import retrofit2.http.Part;
//
//
//public interface ApiInterface {
//
// @Multipart
// @POST("uploadphoto")
// Call<ResponseModel> fileUpload(
// @Part("sender_information") RequestBody description,
// @Part MultipartBody.Part file);
//
//} | [
"[email protected]"
] | |
8d636e0f26ec17180d288727020fff577a214bff | 86ed92d2014f5b6cc420de29d8e48662525693ed | /src/main/java/man10advancementplugin/man10advancementplugin/advancement/data/BlockData.java | 98269e3ad0e9df21e6057587757139fab17f4e2a | [] | no_license | tororo1066/Man10AdvancementPlugin | 297044fb9d47f2f5e05c427e2058d8d5abac6ed2 | 770d0567f43df8a883419f1cdf366f917c5f435c | refs/heads/master | 2023-07-13T09:26:35.314468 | 2021-08-25T15:38:29 | 2021-08-25T15:38:29 | 399,871,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 414 | java | package man10advancementplugin.man10advancementplugin.advancement.data;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import org.bukkit.Material;
// TODO: Add tag/nbt/state properties
public class BlockData {
@Expose
@SerializedName("block")
private Material block;
public void setType(Material material) {
this.block = material;
}
}
| [
"[email protected]"
] | |
4f9d96996fb949f470f6f47713431d0bb7f6ae5a | de304d689b92c1049ae6a502a1dace21fbccb794 | /movie-catalog/src/test/java/br/com/icaro/moviecatalogservice/MovieCatalogApplicationTests.java | 0a8b7c51af517f31a089be9f32acb01fa7519c19 | [] | no_license | icaromagnago/service-discovery-springboot-eureka | f6da124772955d6e22171118df71de7bdaab88e9 | 15c73acaa6ee76757557a689164d2d4592de56c4 | refs/heads/master | 2023-06-18T22:05:09.642003 | 2021-07-23T12:07:06 | 2021-07-23T12:07:06 | 388,788,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 239 | java | package br.com.icaro.moviecatalogservice;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class MovieCatalogApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
024c0e623084acc50a1823f6a5305c8f0978f2c9 | 4e35daa763a62184406034d9f13e1bee97aef484 | /Week9 - Composite Flyweight/src/ro/ase/csie/cts/g1093/dp/composite/AbstractNode.java | 58f84090c642da415459ecedcec02b67d52d2cc9 | [] | no_license | cristinam7/CTS_1093_Seminar | ac3d0436381f1b74ddc1ba64e95634fbc5a95343 | 89aeeb4b18b967d294ecd1658be6e69dad935c4b | refs/heads/main | 2023-05-12T04:48:50.199689 | 2021-06-06T20:13:49 | 2021-06-06T20:13:49 | 342,572,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 264 | java | package ro.ase.csie.cts.g1093.dp.composite;
public abstract class AbstractNode implements NPCActions {
public abstract void addNode(AbstractNode node);
public abstract AbstractNode getNode(int index);
public abstract void deleteNode(AbstractNode node);
}
| [
"[email protected]"
] | |
aa5be7f0b24ebf4e22527f64a4dc0c24a9128627 | 99cd86199c87482e09059cca0ace65cf41cb4c0d | /src/main/java/com/mbp/lqwangxg/mapper/QuestionMapper.java | 14cfef80be08b258f477281712b0190866294a0a | [] | no_license | lqwangxg/sqlitedemo | 195a87624b855d104d82e3bc5033af2aa85b9b1d | c189e52ca2c45cf74e4e0f2d99f5b9b0b1c646a9 | refs/heads/master | 2023-05-25T15:56:12.416124 | 2020-04-03T10:23:07 | 2020-04-03T10:23:07 | 245,556,888 | 1 | 0 | null | 2023-05-23T20:13:34 | 2020-03-07T02:50:52 | Java | UTF-8 | Java | false | false | 843 | java | package com.mbp.lqwangxg.mapper;
import com.mbp.lqwangxg.model.Question;
public interface QuestionMapper {
/**
* @mbg.generated generated automatically, do not modify!
*/
int deleteByPrimaryKey(Integer id);
/**
* @mbg.generated generated automatically, do not modify!
*/
int insert(Question record);
/**
* @mbg.generated generated automatically, do not modify!
*/
int insertSelective(Question record);
/**
* @mbg.generated generated automatically, do not modify!
*/
Question selectByPrimaryKey(Integer id);
/**
* @mbg.generated generated automatically, do not modify!
*/
int updateByPrimaryKeySelective(Question record);
/**
* @mbg.generated generated automatically, do not modify!
*/
int updateByPrimaryKey(Question record);
} | [
"U0Bd9Oa4"
] | U0Bd9Oa4 |
79f48759528b3aa7483ca47105551cb61d84c5f8 | 126b90c506a84278078510b5979fbc06d2c61a39 | /src/ANXCamera/sources/androidx/core/graphics/drawable/d.java | a8804f023d94fef246a055de433f8b5ec9f3815e | [] | no_license | XEonAX/ANXRealCamera | 196bcbb304b8bbd3d86418cac5e82ebf1415f68a | 1d3542f9e7f237b4ef7ca175d11086217562fad0 | refs/heads/master | 2022-08-02T00:24:30.864763 | 2020-05-29T14:01:41 | 2020-05-29T14:01:41 | 261,256,968 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,967 | java | package androidx.core.graphics.drawable;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
/* compiled from: WrappedDrawableApi14 */
class d extends Drawable implements Drawable.Callback, b, c {
/* renamed from: a reason: collision with root package name */
static final PorterDuff.Mode f601a = PorterDuff.Mode.SRC_IN;
/* renamed from: b reason: collision with root package name */
f f602b;
Drawable c;
private int d;
private PorterDuff.Mode e;
private boolean f;
private boolean g;
d(Drawable drawable) {
this.f602b = c();
a(drawable);
}
d(f fVar, Resources resources) {
this.f602b = fVar;
a(resources);
}
private void a(Resources resources) {
f fVar = this.f602b;
if (fVar != null && fVar.f604b != null) {
a(this.f602b.f604b.newDrawable(resources));
}
}
private boolean a(int[] iArr) {
if (!b()) {
return false;
}
ColorStateList colorStateList = this.f602b.c;
PorterDuff.Mode mode = this.f602b.d;
if (colorStateList == null || mode == null) {
this.f = false;
clearColorFilter();
} else {
int colorForState = colorStateList.getColorForState(iArr, colorStateList.getDefaultColor());
if (!(this.f && colorForState == this.d && mode == this.e)) {
setColorFilter(colorForState, mode);
this.d = colorForState;
this.e = mode;
this.f = true;
return true;
}
}
return false;
}
private f c() {
return new f(this.f602b);
}
public final Drawable a() {
return this.c;
}
public final void a(Drawable drawable) {
Drawable drawable2 = this.c;
if (drawable2 != null) {
drawable2.setCallback((Drawable.Callback) null);
}
this.c = drawable;
if (drawable != null) {
drawable.setCallback(this);
setVisible(drawable.isVisible(), true);
setState(drawable.getState());
setLevel(drawable.getLevel());
setBounds(drawable.getBounds());
f fVar = this.f602b;
if (fVar != null) {
fVar.f604b = drawable.getConstantState();
}
}
invalidateSelf();
}
/* access modifiers changed from: protected */
public boolean b() {
return true;
}
public void draw(Canvas canvas) {
this.c.draw(canvas);
}
public int getChangingConfigurations() {
int changingConfigurations = super.getChangingConfigurations();
f fVar = this.f602b;
return changingConfigurations | (fVar != null ? fVar.getChangingConfigurations() : 0) | this.c.getChangingConfigurations();
}
public Drawable.ConstantState getConstantState() {
f fVar = this.f602b;
if (fVar == null || !fVar.a()) {
return null;
}
this.f602b.f603a = getChangingConfigurations();
return this.f602b;
}
public Drawable getCurrent() {
return this.c.getCurrent();
}
public int getIntrinsicHeight() {
return this.c.getIntrinsicHeight();
}
public int getIntrinsicWidth() {
return this.c.getIntrinsicWidth();
}
public int getMinimumHeight() {
return this.c.getMinimumHeight();
}
public int getMinimumWidth() {
return this.c.getMinimumWidth();
}
public int getOpacity() {
return this.c.getOpacity();
}
public boolean getPadding(Rect rect) {
return this.c.getPadding(rect);
}
public int[] getState() {
return this.c.getState();
}
public Region getTransparentRegion() {
return this.c.getTransparentRegion();
}
public void invalidateDrawable(Drawable drawable) {
invalidateSelf();
}
public boolean isAutoMirrored() {
return this.c.isAutoMirrored();
}
public boolean isStateful() {
ColorStateList colorStateList;
if (b()) {
f fVar = this.f602b;
if (fVar != null) {
colorStateList = fVar.c;
return (colorStateList == null && colorStateList.isStateful()) || this.c.isStateful();
}
}
colorStateList = null;
if (colorStateList == null) {
}
}
public void jumpToCurrentState() {
this.c.jumpToCurrentState();
}
public Drawable mutate() {
if (!this.g && super.mutate() == this) {
this.f602b = c();
Drawable drawable = this.c;
if (drawable != null) {
drawable.mutate();
}
f fVar = this.f602b;
if (fVar != null) {
Drawable drawable2 = this.c;
fVar.f604b = drawable2 != null ? drawable2.getConstantState() : null;
}
this.g = true;
}
return this;
}
/* access modifiers changed from: protected */
public void onBoundsChange(Rect rect) {
Drawable drawable = this.c;
if (drawable != null) {
drawable.setBounds(rect);
}
}
/* access modifiers changed from: protected */
public boolean onLevelChange(int i) {
return this.c.setLevel(i);
}
public void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
scheduleSelf(runnable, j);
}
public void setAlpha(int i) {
this.c.setAlpha(i);
}
public void setAutoMirrored(boolean z) {
this.c.setAutoMirrored(z);
}
public void setChangingConfigurations(int i) {
this.c.setChangingConfigurations(i);
}
public void setColorFilter(ColorFilter colorFilter) {
this.c.setColorFilter(colorFilter);
}
public void setDither(boolean z) {
this.c.setDither(z);
}
public void setFilterBitmap(boolean z) {
this.c.setFilterBitmap(z);
}
public boolean setState(int[] iArr) {
return a(iArr) || this.c.setState(iArr);
}
public void setTint(int i) {
setTintList(ColorStateList.valueOf(i));
}
public void setTintList(ColorStateList colorStateList) {
this.f602b.c = colorStateList;
a(getState());
}
public void setTintMode(PorterDuff.Mode mode) {
this.f602b.d = mode;
a(getState());
}
public boolean setVisible(boolean z, boolean z2) {
return super.setVisible(z, z2) || this.c.setVisible(z, z2);
}
public void unscheduleDrawable(Drawable drawable, Runnable runnable) {
unscheduleSelf(runnable);
}
}
| [
"[email protected]"
] | |
1688b49fb8309d82d40281b60496637d1cddb3e6 | 573c5fc6f9d9cefff8258000a3da7508f087caa5 | /src/main/java/xyz/skycat/work/crudtool/facade/TableCrudMakeFacade.java | 21aa935333e6b253015d3b248a37270f20d26164 | [] | no_license | sky0621/work-crudtool | 6b308491f85b903c09e19453706e448e5917f5bf | 5975d3348c433de8fc5b5847b452b2fa213e799a | refs/heads/master | 2020-04-06T06:57:25.997877 | 2016-08-31T22:15:27 | 2016-08-31T22:15:27 | 59,757,293 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package xyz.skycat.work.crudtool.facade;
import xyz.skycat.work.crudtool.exception.CrudMakeException;
import xyz.skycat.work.crudtool.facade.statement.resolver.TableNamesFindResolver;
/**
* Created by SS on 2016/06/10.
*/
public class TableCrudMakeFacade extends AbstractCrudMakeFacade {
public TableCrudMakeFacade() {
super(new TableNamesFindResolver());
}
}
| [
"[email protected]"
] | |
f7a6f8de5b6d4485a20798206069b005b5288a3c | f5c4836599b773e620c8de6e94172271725e59fa | /src/Controleurs/CtrlIncreaseUp_2.java | d271b5860f5e868303ee0dfbecac76a218f359b4 | [] | no_license | leooel8/LileInterdite | fa8ca437d59d7f4e1b7a53305621f17ef37ef330 | 3c7872487d2e31a2cbd24b90920adf4b6f6cabad | refs/heads/master | 2023-03-05T04:23:10.983282 | 2021-02-12T11:44:36 | 2021-02-12T11:44:36 | 338,298,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | java | package Controleurs;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import Modele.Parametres;
public class CtrlIncreaseUp_2 implements ActionListener{
// ATTRIBUTS
Parametres param;
// CONSTRUCTEUR
public CtrlIncreaseUp_2(Parametres param) {
this.param = param;
}
// METHODES
@Override
public void actionPerformed(ActionEvent e) {
this.param.upDifficulte();
}
}
| [
"[email protected]"
] | |
1f079283d3e32287ba3872a5ae14c900c6fceb92 | 6b79242bf80f12126fce47951af6be150d13a372 | /src/main/java/StudentCube/ControllerPesanAdmin.java | 8d74a2ec96b77656dd42adb8f4596cf81944c874 | [] | no_license | erlanggal/Prototipe-Student-Cube | ec5ea0a54c79b17190137390fe60ebacdbd03be9 | 6cb819e67e3ce8ba3c11650a5a3aa29e621830a8 | refs/heads/master | 2020-03-21T10:55:47.954054 | 2018-07-10T04:14:15 | 2018-07-10T04:14:15 | 138,478,894 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 292 | java | package StudentCube;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class ControllerPesanAdmin {
@RequestMapping("pesan-admin")
public String getPage()
{
return "pesan-admin";
}
}
| [
"[email protected]"
] | |
72342980438ae088f9ad3f1b69778dae1860b8f1 | 5eb46de06d5ade1bc4b9d49e7714367b08446351 | /gateway-limiter/src/test/java/org/cay/springcloud/gatewaylimiter/GatewayLimiterApplicationTests.java | 540901cde34e86eb2d93c36bc97525677e4e3f6a | [] | no_license | zadpp1984/springclouddemo | 280d2bc347c13abafe5cc05e0356395560bb2011 | af1be472b72c99af192b54eafa5110d76fca8aa0 | refs/heads/master | 2020-06-11T18:40:26.694998 | 2019-06-27T08:02:30 | 2019-06-27T08:02:30 | 194,049,206 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package org.cay.springcloud.gatewaylimiter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class GatewayLimiterApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
93f371e912da3353f09ab004505522e1233d1a68 | 1b25caabc0523a16251489f43c07794b3a233eb6 | /src/Main.java | 0567c40e953c65a077cc5c8745d9ea2bb9f60d60 | [] | no_license | liv92/B21Project_Git | af8d411681673faff730d9f0abf308dd91d12d0e | ba56242206c7fb721523210010899a90687d39c6 | refs/heads/master | 2023-01-11T07:26:01.683844 | 2020-11-10T17:50:16 | 2020-11-10T17:50:16 | 311,738,297 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | public class Main {
public static void main(String[] args) {
System.out.println("Hello");
//B21 is good at IntelliJ
// another change
// MORE CHANGES TO PUSH
}
}
| [
"[email protected]"
] | |
ebd33dcecbbb367fca11ba4045b4511b70be8be7 | 6b90ce34bebd599b62d558f2ac56f5e71e48501b | /src/spaceinvaders/impl/SpacesInvaders_aUnVaisseauImpl.java | d97642caff7ca66ba714031e31f4cf9229ea6d6c | [] | no_license | LAVAL51/Anthony_spaceinvaders | 2f1730ac23336fa6dae20e942e62c74837efad53 | 976553e769a0aaae75fd0f3434fa9983dc9b048a | refs/heads/master | 2023-05-07T07:46:15.560785 | 2021-05-28T09:33:37 | 2021-05-28T09:33:37 | 355,587,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 883 | java | /**
*/
package spaceinvaders.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import spaceinvaders.SpaceinvadersPackage;
import spaceinvaders.SpacesInvaders_aUnVaisseau;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Spaces Invaders aUn Vaisseau</b></em>'.
* <!-- end-user-doc -->
*
* @generated
*/
public class SpacesInvaders_aUnVaisseauImpl extends MinimalEObjectImpl.Container implements SpacesInvaders_aUnVaisseau {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SpacesInvaders_aUnVaisseauImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SpaceinvadersPackage.Literals.SPACES_INVADERS_AUN_VAISSEAU;
}
} //SpacesInvaders_aUnVaisseauImpl
| [
"[email protected]"
] | |
8213c899192675545584ed674fdf353560e9651e | 4d2fa04f00eb244100dae94edb5be52ad19a9951 | /src/main/java/com/webproject/app/Servlet/ContentDelete.java | 69462bdc498381ed0f9ce7192e25a9ca392c5f03 | [] | no_license | namrg/WebProject | 3a72bc6d5527908299b64d39bca781a350d9889a | 4e9fa8e825bd040d21583ef5dead5c1baf269c0c | refs/heads/master | 2022-10-30T20:50:27.489811 | 2020-06-16T16:21:43 | 2020-06-16T16:21:43 | 268,723,947 | 0 | 0 | null | 2020-06-02T06:52:26 | 2020-06-02T06:52:25 | null | UTF-8 | Java | false | false | 1,657 | java | package com.webproject.app.Servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.webproject.app.Board.*;
/**
* Servlet implementation class ContentDelete
*/
public class ContentDelete extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public ContentDelete() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
BoardDAO boardDAO = new BoardDAO();
int boardNum;
System.out.println(request.getParameter("boardNum"));
boardNum = Integer.parseInt(request.getParameter("boardNum"));
System.out.println(boardNum);
int result = boardDAO.deleteContent(boardNum);
System.out.println(result);
out.println("<script>");
out.println("alert('게시글이 삭제되었습니다')");
out.println("</script>");
response.addHeader("REFRESH"," 0; URL=soldList.do?pg=1");
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
| [
"[email protected]"
] | |
10e9ed0fe0e28026ea0a36d1f15bbf4e611889f7 | 65765a0ea6b8ab3b6f4bb183447633855d11d597 | /src/main/java/com/poc/pdf/model/RowVO.java | 8283ff2840c1a82dbb24ee860a85976a704cf879 | [] | no_license | shenjun134/pdf-random | 37a60c5cea47349f3aea2877c2043b34709a45d2 | 1573e989c943dfed063445ed826d84be7fba1a53 | refs/heads/master | 2020-03-22T15:49:36.560185 | 2019-01-19T13:24:33 | 2019-01-19T13:24:33 | 140,281,674 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 456 | java | package com.poc.pdf.model;
import java.util.ArrayList;
import java.util.List;
public class RowVO extends ToString {
private static final long serialVersionUID = -1896625160283007411L;
private List<CellVO> list = new ArrayList<>();
public void add(CellVO cell){
this.list.add(cell);
}
public List<CellVO> getList() {
return list;
}
public void setList(List<CellVO> list) {
this.list = list;
}
}
| [
"[email protected]"
] | |
b7fb7163886b25bb2d23ac6e64a064e52e78d04a | 7230fd8a96be77ed0a7fab54a7e33aeacdfdf524 | /gateway/src/main/java/com/app/gateway/service/UsernameAlreadyUsedException.java | 46d5f64232f4c621084f16965d479327ccd96478 | [] | no_license | doanxuantambk/medlatec | 00c9b6d62d30145bcc0d21edd89eaf92a87220f9 | 6b7f0b50a8aaf063034ae60324a5b93c38772e87 | refs/heads/master | 2022-12-22T19:55:58.714383 | 2019-12-29T17:37:04 | 2019-12-29T17:37:04 | 228,631,005 | 0 | 0 | null | 2022-12-16T04:42:24 | 2019-12-17T14:12:07 | Java | UTF-8 | Java | false | false | 200 | java | package com.app.gateway.service;
public class UsernameAlreadyUsedException extends RuntimeException {
public UsernameAlreadyUsedException() {
super("Login name already used!");
}
}
| [
"[email protected]"
] | |
82f8a03aa67be56b10f35b6fdf47f5b8ea999a79 | ba2a0800f81cb79bd65213256cda5b069eae4b45 | /src/main/java/com/muiz6/system/attendance/ui/controller/NavigationPanel.java | 7498b81483eab15f36562e655939916ed54c3d5b | [
"MIT"
] | permissive | muiz6/attendance-system | 8040e9fab151698b6a696ac14f4c7c00e8868922 | 0e9a64ab24d82470084335efc42989ad52c24b15 | refs/heads/master | 2022-11-09T12:08:35.188188 | 2020-06-21T12:01:24 | 2020-06-21T12:01:24 | 238,363,672 | 1 | 0 | MIT | 2020-06-21T12:01:25 | 2020-02-05T03:57:25 | Java | UTF-8 | Java | false | false | 3,077 | java | package com.muiz6.system.attendance.ui.controller;
import com.muiz6.system.attendance.Constants;
import com.muiz6.system.attendance.Util;
import com.muiz6.system.attendance.ui.event.EmployeeItemEvent;
import com.muiz6.system.attendance.ui.event.NavigationContentEvent;
import com.muiz6.system.attendance.ui.control.TabButton;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.layout.StackPane;
import java.net.URL;
import java.util.ResourceBundle;
public class NavigationPanel implements Initializable,
EventHandler<EmployeeItemEvent> {
@FXML
private TabButton _btnAttendance;
@FXML
private TabButton _btnEmployees;
@FXML
private TabButton _btnHolidays;
@FXML
private StackPane _stackPane;
@Override
public void initialize(URL location, ResourceBundle resources) {
// start by content of first tab (attendance tab)
_stackPane.getChildren().add(Util
.getFxmlNode(Constants.RES_FXML_CONTENT_ATTENDANCE));
_stackPane.addEventFilter(EmployeeItemEvent.CUSTOM, this);
_stackPane.addEventFilter(NavigationContentEvent.UPDATE_EVENT,
e -> {
if (e.getContentType() ==
NavigationContentEvent.TYPE_HOLIDAY_CONTENT) {
_stackPane.getChildren().clear();
_stackPane.getChildren().add(Util
.getFxmlNode(
Constants.RES_FXML_CONTENT_HOLIDAYS));
}
});
}
public void onTabClick(ActionEvent actionEvent) {
Object source = actionEvent.getSource();
if (source == _btnAttendance) {
_stackPane.getChildren().clear();
_stackPane.getChildren().add(Util
.getFxmlNode(Constants.RES_FXML_CONTENT_ATTENDANCE));
}
else if (source == _btnEmployees) {
_stackPane.getChildren().clear();
_stackPane.getChildren().add(Util
.getFxmlNode(Constants.RES_FXML_CONTENT_EMPLOYEES));
}
else if(source == _btnHolidays) {
_stackPane.getChildren().clear();
_stackPane.getChildren().add(Util
.getFxmlNode(Constants.RES_FXML_CONTENT_HOLIDAYS));
}
}
@Override
public void handle(EmployeeItemEvent event) {
final int employeeId = event.getEmployeeId();
switch (event.getButtonType()) {
case EmployeeItemEvent.BUTTON_TYPE_ADD_EMPLOYEE:
_stackPane.getChildren().clear();
_stackPane.getChildren().add(Util.getFxmlNode(Constants
.RES_FXML_CONTENT_ADD_EMPLOYEE));
break;
case EmployeeItemEvent.BUTTON_TYPE_VIEW_EMPLOYEE:
_stackPane.getChildren().clear();
_stackPane.getChildren().add(Util.getFxmlNode(Constants
.RES_FXML_CONTENT_VIEW_EMPLOYEE,
c -> new ViewEmployeeContent(employeeId)));
break;
case EmployeeItemEvent.BUTTON_TYPE_EDIT_EMPLOYEE:
_stackPane.getChildren().clear();
_stackPane.getChildren().add(Util.getFxmlNode(Constants
.RES_FXML_CONTENT_EDIT_EMPLOYEE,
c -> new EditEmployeeContent(employeeId)));
break;
case EmployeeItemEvent.BUTTON_TYPE_BACK:
_stackPane.getChildren().clear();
_stackPane.getChildren().add(Util.getFxmlNode(Constants
.RES_FXML_CONTENT_EMPLOYEES));
break;
}
}
}
| [
"[email protected]"
] |
Subsets and Splits