blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
57717a2dc490d0205d97b37929a13a69b51032b0
512e642d2875072aeb25f211207b3bef68ccce21
/src/org/usfirst/frc/team1764/robot/commands/ShooterQueueNextState.java
8b997a03240debb1df5f8236a29290ab0536a053
[]
no_license
maxdowling1764/TestRobot20172018
5edcc1feb3a21b1bd6c9499a1abbd086547efcda
16d435887b7dc6d50bea9db7ccc0407a910ed290
refs/heads/master
2021-07-24T03:16:46.444031
2017-11-02T18:34:18
2017-11-02T18:34:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
package org.usfirst.frc.team1764.robot.commands; import edu.wpi.first.wpilibj.command.Command; import static org.usfirst.frc.team1764.robot.Robot.*; public class ShooterQueueNextState extends Command { private boolean done = false; public ShooterQueueNextState() { requires(superStructure.getShooterQueue()); } protected void initialize() { } protected void execute() { superStructure.getShooterQueue().nextState(); done = true; } protected boolean isFinished() { return done; } protected void end() { } protected void interrupted() { super.interrupted(); } }
[ "mdow7299@student.lps53.org" ]
mdow7299@student.lps53.org
7e12a862a54ea3ed31115375d3f9b0e78aa7bc2c
11b68353bbf22dc94e6bce175e922530e9d87773
/Security-5/src/main/java/com/amit/result/Model/Student.java
7588f0ba92afcb41f5bf947dc5007eff0bc227c1
[]
no_license
amitsingh6764/Spring-Security
f3f47a245ee84c42640d1915e3dcf05ee8d8b603
2d7d767e27a04746ac86e55122c7c72d4443a97f
refs/heads/master
2023-01-02T10:15:58.853060
2020-10-18T17:05:46
2020-10-18T17:05:46
305,301,676
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
package com.amit.result.Model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Student { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; private String username; private String password; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @Override public String toString() { return "Student [id=" + id + ", username=" + username + ", password=" + password + "]"; } }
[ "as2085582@gmail.com" ]
as2085582@gmail.com
e492c95b3138610572313c1269758aa5ba37941e
a32e3088755ab8e2f6c7f2aa5cee57b2a089e496
/Atlas/src/atlasapp/section_contacts/ContactCell.java
2adb27e312c6812f0df3c32af66040e9ef41aa64
[]
no_license
sharonan/AtlasAndroidConsumer
911200ffa28ed597c7c18eddc61b5a013e132bd1
e9959498ceba2a51a4c8e2eeff8025daddb4862d
refs/heads/master
2020-05-19T17:35:46.229773
2014-01-07T21:06:55
2014-01-07T21:06:55
15,716,638
0
1
null
null
null
null
UTF-8
Java
false
false
2,626
java
// ================================================================================================================== // NotesCell.java // AtlasConsumerAndroid // Copyright (c) 2012 AtlasConsumerAndroid Apps. All rights reserved. // ================================================================================================================== // // ================================================================================================================== // HISTORY // YYYY-MM-DD NAME: Description of changes // ================================================================================================================== // 2012-10-28 TAN: init class to implement Notes View in simulate mode // ================================================================================================================== package atlasapp.section_contacts; import android.app.Activity; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import atlasapp.section_appentry.R; public class ContactCell extends RelativeLayout implements View.OnClickListener { Context mActivity; public ImageView backgroundImageView; public ImageView imageContact; public TextView contactDisplayName; public ImageView imageAtlasUser; public LinearLayout layout; public ImageView dividerImageView; public ContactCell(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); // TODO Auto-generated constructor stub initView(context); } public ContactCell(Context context, AttributeSet attrs) { super(context, attrs); // TODO Auto-generated constructor stub initView(context); } public ContactCell(Context context) { super(context); // TODO Auto-generated constructor stub initView(context); } private void initView(Context context) { // Init CallendarCell view LayoutInflater.from(context).inflate(R.layout.contact_list_cell, this, true); mActivity = (Activity) context; } @Override public void onClick(View arg0) { // TODO Auto-generated method stub } // public void setCellData(ATLNotesCellData cellData) { // // TODO Auto-generated method stub // contactDisplayName.setText(setTitle(cellData.notesCellTitle)); // imageContact.setBackgroundColor(Color.TRANSPARENT); // } // private String setTitle(String text) { // if (text.length() > 20) // text = text.substring(0, 20) + ".."; // // return text; // } }
[ "sharon@getatlas.com" ]
sharon@getatlas.com
6cb65c05126401b4862ccf84906c77a1a0217fc4
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/linkedmall-20180116/src/main/java/com/aliyun/linkedmall20180116/models/ApplyRefundRequest.java
2d7b61179d73cfba2dfd8e0a8808854e0a4b977d
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
5,183
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.linkedmall20180116.models; import com.aliyun.tea.*; public class ApplyRefundRequest extends TeaModel { @NameInMap("AccountType") public String accountType; @NameInMap("ApplyReasonTextId") public Long applyReasonTextId; @NameInMap("ApplyRefundCount") public Integer applyRefundCount; @NameInMap("ApplyRefundFee") public Long applyRefundFee; @NameInMap("BizClaimType") public Integer bizClaimType; @NameInMap("BizId") public String bizId; @NameInMap("BizUid") public String bizUid; @NameInMap("GoodsStatus") public Integer goodsStatus; @NameInMap("LeaveMessage") public String leaveMessage; @NameInMap("LeavePictureList") public java.util.List<ApplyRefundRequestLeavePictureList> leavePictureList; @NameInMap("SubLmOrderId") public String subLmOrderId; @NameInMap("ThirdPartyUserId") public String thirdPartyUserId; @NameInMap("UseAnonymousTbAccount") public Boolean useAnonymousTbAccount; public static ApplyRefundRequest build(java.util.Map<String, ?> map) throws Exception { ApplyRefundRequest self = new ApplyRefundRequest(); return TeaModel.build(map, self); } public ApplyRefundRequest setAccountType(String accountType) { this.accountType = accountType; return this; } public String getAccountType() { return this.accountType; } public ApplyRefundRequest setApplyReasonTextId(Long applyReasonTextId) { this.applyReasonTextId = applyReasonTextId; return this; } public Long getApplyReasonTextId() { return this.applyReasonTextId; } public ApplyRefundRequest setApplyRefundCount(Integer applyRefundCount) { this.applyRefundCount = applyRefundCount; return this; } public Integer getApplyRefundCount() { return this.applyRefundCount; } public ApplyRefundRequest setApplyRefundFee(Long applyRefundFee) { this.applyRefundFee = applyRefundFee; return this; } public Long getApplyRefundFee() { return this.applyRefundFee; } public ApplyRefundRequest setBizClaimType(Integer bizClaimType) { this.bizClaimType = bizClaimType; return this; } public Integer getBizClaimType() { return this.bizClaimType; } public ApplyRefundRequest setBizId(String bizId) { this.bizId = bizId; return this; } public String getBizId() { return this.bizId; } public ApplyRefundRequest setBizUid(String bizUid) { this.bizUid = bizUid; return this; } public String getBizUid() { return this.bizUid; } public ApplyRefundRequest setGoodsStatus(Integer goodsStatus) { this.goodsStatus = goodsStatus; return this; } public Integer getGoodsStatus() { return this.goodsStatus; } public ApplyRefundRequest setLeaveMessage(String leaveMessage) { this.leaveMessage = leaveMessage; return this; } public String getLeaveMessage() { return this.leaveMessage; } public ApplyRefundRequest setLeavePictureList(java.util.List<ApplyRefundRequestLeavePictureList> leavePictureList) { this.leavePictureList = leavePictureList; return this; } public java.util.List<ApplyRefundRequestLeavePictureList> getLeavePictureList() { return this.leavePictureList; } public ApplyRefundRequest setSubLmOrderId(String subLmOrderId) { this.subLmOrderId = subLmOrderId; return this; } public String getSubLmOrderId() { return this.subLmOrderId; } public ApplyRefundRequest setThirdPartyUserId(String thirdPartyUserId) { this.thirdPartyUserId = thirdPartyUserId; return this; } public String getThirdPartyUserId() { return this.thirdPartyUserId; } public ApplyRefundRequest setUseAnonymousTbAccount(Boolean useAnonymousTbAccount) { this.useAnonymousTbAccount = useAnonymousTbAccount; return this; } public Boolean getUseAnonymousTbAccount() { return this.useAnonymousTbAccount; } public static class ApplyRefundRequestLeavePictureList extends TeaModel { @NameInMap("Desc") public String desc; @NameInMap("Picture") public String picture; public static ApplyRefundRequestLeavePictureList build(java.util.Map<String, ?> map) throws Exception { ApplyRefundRequestLeavePictureList self = new ApplyRefundRequestLeavePictureList(); return TeaModel.build(map, self); } public ApplyRefundRequestLeavePictureList setDesc(String desc) { this.desc = desc; return this; } public String getDesc() { return this.desc; } public ApplyRefundRequestLeavePictureList setPicture(String picture) { this.picture = picture; return this; } public String getPicture() { return this.picture; } } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
f6707ad627880c31836cfb490665e70601663d3b
49f7b09404f6f21d4460c696420e7abeb83a34ee
/surveyapp/src/main/java/com/tyss/surveyapp/dao/AdminDaoImpl.java
7d7d29161133eb4c5aa1cd57650e6e9836762407
[]
no_license
gokusaif/saif.tyss
71dda0e1d0dad759a4bd7f25909793b1f8048296
756108fea76ec2b781c67dd10567a907770235b8
refs/heads/master
2023-01-11T22:13:17.734000
2020-02-18T12:44:32
2020-02-18T12:44:32
238,022,371
0
0
null
2023-01-07T14:58:43
2020-02-03T17:32:03
Java
UTF-8
Java
false
false
3,653
java
package com.tyss.surveyapp.dao; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.PersistenceUnit; import javax.persistence.TypedQuery; import org.springframework.stereotype.Repository; import com.tyss.surveyapp.dto.Question; import com.tyss.surveyapp.dto.Survey; import com.tyss.surveyapp.dto.SurveyResponse; import com.tyss.surveyapp.exceptions.AdminException; @Repository public class AdminDaoImpl implements AdminDao { @PersistenceUnit EntityManagerFactory factory; @Override public boolean addQuestions(Survey survey) { EntityManager manager = factory.createEntityManager(); EntityTransaction transaction = manager.getTransaction(); try { transaction.begin(); List<Question> questions = survey.getQuestions(); for (Question question : questions) { question.setSurvey(survey); } survey.setQuestions(questions); manager.persist(survey); transaction.commit(); return true; } catch (Exception e) { throw new AdminException("Survey name already exists"); } } @Override public List<Survey> retrive() { EntityManager manager = factory.createEntityManager(); String jpql = "from Survey"; TypedQuery<Survey> query = manager.createQuery(jpql, Survey.class); return query.getResultList(); } @Override public Survey retriveSurvey(String surveyName) { EntityManager manager = factory.createEntityManager(); Survey survey = manager.find(Survey.class, surveyName); if (survey != null) { return survey; } throw new AdminException("Surveyname is not found"); } @Override public boolean removeSurvey(String surveyName) { EntityManager manager = factory.createEntityManager(); Survey survey = null; try { survey = manager.find(Survey.class, surveyName); EntityTransaction transaction = manager.getTransaction(); transaction.begin(); manager.remove(survey); transaction.commit(); return true; } catch (Exception e) { throw new AdminException("Surveyname is not found"); } } @Override public boolean answerSurvey(SurveyResponse answer) { EntityManager manager = factory.createEntityManager(); EntityTransaction transaction = manager.getTransaction(); transaction.begin(); manager.persist(answer); transaction.commit(); return true; } @Override public SurveyResponse getAnswered(String userEmail, String surveyName) { EntityManager manager = factory.createEntityManager(); String jpql = "from SurveyResponse where userEmail=:email and surveyName=:surveyName"; TypedQuery<SurveyResponse> query = manager.createQuery(jpql, SurveyResponse.class); query.setParameter("email", userEmail); query.setParameter("surveyName", surveyName); try { SurveyResponse surveyResponse = query.getSingleResult(); return surveyResponse; } catch (Exception e) { return null; } } @Override public boolean removeAnswered(int id) { EntityManager manager = factory.createEntityManager(); EntityTransaction transaction = manager.getTransaction(); SurveyResponse survey = manager.find(SurveyResponse.class, id); if (survey != null) { transaction.begin(); manager.remove(survey); transaction.commit(); return true; } throw new AdminException("Answered survey not found"); } public Question getQuestion(int id) { EntityManager manager = factory.createEntityManager(); Question question = manager.find(Question.class, id); return question; } }
[ "ota.sa.97@gmail.com" ]
ota.sa.97@gmail.com
a2d5ce24c4f263dec393c619e2bd929d99eedb33
5777ffae8d75f175a21a48ec6b27024df79baa44
/android/app/src/main/java/com/swiper/MainActivity.java
41fe7ad9564ba391492046ef400fd502e198d902
[]
no_license
iLeafSolutionsPvtLtd/react-native-glow-pad-view
4189fd4bc478127dc19bcfaf69840566b79b8f91
88fe93f2b7341f63d429cf8fb26404275840964d
refs/heads/master
2021-05-05T08:18:20.107274
2018-01-25T06:27:52
2018-01-25T06:27:52
118,871,839
3
0
null
null
null
null
UTF-8
Java
false
false
371
java
package com.swiper; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript.rrrrrrr * This is used to schedule rendering of the component. * */ @Override protected String getMainComponentName() { return "Swiper"; } }
[ "ganga@ileafsolutions.net" ]
ganga@ileafsolutions.net
173bf30e5803d6fd81980675f77b5e485b647a5c
cfcaf63b3c25b30d3c383c9399b2f38c581eda86
/leetcode_notes/leetcode_cn/0563.二叉树的坡度/0563-二叉树的坡度.java
8755a436bb294f4d803d7a79191b706df626ad22
[ "BSD-3-Clause" ]
permissive
robinali/java_notes
f361f525599495f8709691d60885a0a3faeb897b
b462c75851c1cd234b4027cd2b6181f0fbb0ef60
refs/heads/master
2021-06-18T09:23:33.244454
2021-04-13T02:32:33
2021-04-13T02:32:33
200,970,947
0
1
null
null
null
null
UTF-8
Java
false
false
616
java
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { // Time: O(n) Space: O(n) int res = 0; public int findTilt(TreeNode root) { recursiveFindTile(root); return res; } private int recursiveFindTile(TreeNode root) { if(root == null) return 0; int left = recursiveFindTile(root.left); int right = recursiveFindTile(root.right); res += Math.abs(left - right); return left + right + root.val; } }
[ "rli@uei.com" ]
rli@uei.com
374b0c40d0d5630abfe0be7cffa9c59b8876c6e7
87756ecf335bf0d4d91abe116d78ff31e68f3160
/0-basics/Khabibullin_Ruslan/1/QUESTION_1.java
c34bdb85f833f6d6ca9e7a2cd5308e336f13f912
[]
no_license
tuykin/ads_1
a72c2a36d8f5e41f3445aa10c3f15105eb44fab9
c5d855c64cee9edac142dfeacc7f57e58d60081f
refs/heads/master
2021-05-28T06:28:58.517006
2014-11-05T17:19:20
2014-11-05T17:19:20
null
0
0
null
null
null
null
WINDOWS-1251
Java
false
false
604
java
public class QUESTION_1 { public static void main(String[] args) { int i=0,j=0,m=10,n=10; int [][] mas=new int[m][n]; for(i=0;i<m;i++) //Инициализируем массив for(j=0;j<n;j++) mas[i][j]=(int)(Math.random()*2); System.out.print(" "); for(j=0;j<n;j++)System.out.print(" "+j); System.out.println(); for(i=0;i<m;i++){ System.out.print(i+" "); for(j=0;j<n;j++) if(mas[i][j]==1){ System.out.print("* "); if(j==n-1) System.out.println(); } else{ System.out.print(" "); if(j==n-1) System.out.println(); }; }; }; }
[ "willfarm@bk.ru" ]
willfarm@bk.ru
92b12692cdc63c8d94bf7a98a8c7dad0f88fec4f
b9763f737c35328e4c6700ef91d050f1cf850aee
/src/main/java/com/springboot/web/demo/controller/HomeController.java
0d1e8dbd007cb566863b4a17184026bdafd055de
[]
no_license
Wanfadger/SpringBoot-WebApp-Demo
3ac787151f3c610e555a5ec778ec00565581c7fe
fe531a825575461c750787f4faed15e0a3917f06
refs/heads/master
2020-04-16T00:48:39.235867
2019-01-11T00:35:22
2019-01-11T00:35:22
165,152,299
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
package com.springboot.web.demo.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller public class HomeController { @RequestMapping("/home") public String gotToHome() { return "home"; } }
[ "Galiwango.fahad@gmail.com" ]
Galiwango.fahad@gmail.com
78945de16bf2115581c5940ea2b7443f5bb7f5af
0f77c5ec508d6e8b558f726980067d1058e350d7
/1_39_120042/com/ankamagames/wakfu/common/game/group/party/PartySerializer.java
0f4f9e9bc9ad0484d0561a5baebb7fff0335f12d
[]
no_license
nightwolf93/Wakxy-Core-Decompiled
aa589ebb92197bf48e6576026648956f93b8bf7f
2967f8f8fba89018f63b36e3978fc62908aa4d4d
refs/heads/master
2016-09-05T11:07:45.145928
2014-12-30T16:21:30
2014-12-30T16:21:30
29,250,176
5
5
null
2015-01-14T15:17:02
2015-01-14T15:17:02
null
UTF-8
Java
false
false
725
java
package com.ankamagames.wakfu.common.game.group.party; import java.nio.*; import com.ankamagames.framework.kernel.core.common.collections.*; public final class PartySerializer { private final PartyModelInterface m_partyModel; public PartySerializer(final PartyModelInterface partyModel) { super(); this.m_partyModel = partyModel; } public void unserializeGroupData(final byte[] groupData) { final ByteBuffer bb = ByteBuffer.wrap(groupData); this.m_partyModel.setLeaderId(bb.getLong()); } public byte[] serialize() { final ByteArray ba = new ByteArray(); ba.putLong(this.m_partyModel.getLeaderId()); return ba.toArray(); } }
[ "totomakers@hotmail.fr" ]
totomakers@hotmail.fr
ef1025e6b8055a362992be292f08b1d7425279fb
7f1a129c22aa86aeba926d95be992457cf9eddc8
/jclass/src/day07/Test01.java
9011362217ba67433d681a69aa9f0971a334b816
[]
no_license
cr0ng/java
471d0d7cfae0913aaaedd11c637b76e278914598
fc5a7de81072983a8fd7a3197414fe0f77c778a0
refs/heads/master
2023-03-22T13:19:43.192814
2021-03-19T08:53:03
2021-03-19T08:53:03
339,341,329
0
0
null
null
null
null
UHC
Java
false
false
1,286
java
package day07; /* 5명의 학생의 점수를 기억할 배열을 만드는데 그 배열에서 총점도 같이 관리하도록 하고 랜덤하게 학생들의 점수를 입력하고 총점을 구하고 평균을 산출해서 출력해주는 프로그램을 작성하세요. */ public class Test01 { public static void main(String[] args) { //배열을 기억할 변수 만들고 int[] score; score = new int[6]; // 5명의 점수를 만들어서 입력하고 for(int i = 0 ; i < score.length - 1; i++){ int num = (int)(Math.random()*41+60); score[i] = num; } // 총점을 계산한다. for(int i = 0 ; i < score.length - 1 ; i++) { /* int tmp = score[i]; int sum = score[score.length-1]; score[score.length-1] = sum + tmp; */ score[score.length-1]=score[score.length-1]+score[i]; } // 평균계산하기 double avg = score[score.length-1] / (score.length-1.0); // 출력 System.out.print("학생들 과목 점수 : "); for(int i = 0; i < score.length-1;i++) { System.out.print(score[i]+" | "); } System.out.println(); int total = score[score.length-1]; System.out.println("총점 : " + total); System.out.println("평균 : " + avg); } }
[ "yujin@DESKTOP-VDJS387" ]
yujin@DESKTOP-VDJS387
6eab91a8f0b174817dc87e2143fa14a574e6f207
6a1c8540e81a34e315e10c1a33a1202d2f8db8ce
/AdAPI/src/cn/adwalker/IOSChannel/picker/checker/JuZhiPartherCheck.java
21c8770ac1191baba8cd680615c66c6cfee01e2d
[]
no_license
springwindyike/ad-server
7624a3129c705ce5cd97bfe983704d1f29b09889
c2878216505e5aea7222e830ad759a22fc6a22da
refs/heads/master
2021-12-11T05:29:26.909006
2016-10-24T02:48:55
2016-10-24T02:48:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,759
java
package cn.adwalker.IOSChannel.picker.checker; import java.util.Date; import java.util.HashMap; import java.util.Map; import net.sf.json.JSONObject; import cn.adwalker.IOSChannel.picker.bean.AdBean; import cn.adwalker.IOSChannel.picker.bean.CampaignConfig; import cn.adwalker.IOSChannel.picker.bean.ChannelBean; import cn.adwalker.IOSChannel.picker.bean.IosActionLog; import cn.adwalker.IOSChannel.picker.bean.YjfBean; import cn.adwalker.IOSChannel.picker.constant.BaseAttribute; import cn.adwalker.IOSChannel.picker.util.Base64; import cn.adwalker.IOSChannel.picker.util.HttpHelp; import cn.adwalker.IOSChannel.picker.util.Logger; import cn.adwalker.IOSChannel.picker.util.MD5Util; import cn.adwalker.IOSChannel.picker.util.StringUtil; import cn.adwalker.ad.util.AppConstant; /** * @author admin * 桔子渠道对接类 */ public class JuZhiPartherCheck extends PartherCheck { private static final Logger logger = Logger.getLogger(JuZhiPartherCheck.class); private CampaignConfig config=null; private IosActionLog action=null; private static final String skey="3279e91207c231adfeb62d4c56061150"; //"c86be9aca16829a2467f7472f9b89c79"; private static final String SUCCESS_CODE="000000"; private static final String FAIL_CODE="000005"; @Override public String createCheckKey(CampaignConfig config,ChannelBean b){ String checkKey = ""; if(b.isIos6()){//ios6 采用mac地址为确认的唯一标识 checkKey=StringUtil.dealNull(b.getDeviceid()).replaceAll(":", ""); }else if(b.isIos7()){//ios 7则采用openudid idfa idfv中的一种或者多种作为激活的标识 checkKey+=StringUtil.dealNull(b.getIDFA()).toUpperCase(); } return checkKey; } public JuZhiPartherCheck getInstance(){ return new JuZhiPartherCheck(); } @Override void saveIosActionLog(YjfBean bean) { ChannelBean b = (ChannelBean)bean; config = supportService.findTCampaignConfig(b.getAppid()); if(config!=null){ String checkKey = createCheckKey(config, b); IosActionLog action = new IosActionLog(); action.setAdId(b.getAppid()); action.setStat_date(StringUtil.isEmpty(b.getEventtime())?Long.valueOf(new Date().getTime()).intValue():StringUtil.getInt(b.getEventtime(), 0)); action.setChannel(b.getSource()); action.setCreateTime(new Date()); action.setIdfa(StringUtil.dealNull(b.getIDFA()).toUpperCase()); action.setIdfv(b.getIDFV()); action.setMac(checkKey); action.setOpenudid(b.getOPENUDID()); action.setStatus(BaseAttribute.IOS_ACTION_LOG_STATUS_0); //LoggerManager.actionLogger(action); /** * 非自由渠道则保存action_log * */ if(!SELF_CHANNEL.equals(action.getChannel())){ supportService.saveIosActionLog(action); } }else{ logger.logError(" can not find campgin_config. key:"+b.getAppid()); } } @Override void callAddScore(YjfBean bean) { if(null!=action){ //自由渠道的积分墙则返回积分 if(StringUtil.dealNull(action.getPage_type()).equals(AppConstant.PAGE_WALLTYPE_LIST_SMALL)&&action.getChannel().equals(SELF_CHANNEL)){ //mac为空则把idfa重置为mac 以便返还积分 if(StringUtil.isEmpty(action.getMac())){ logger.logInfo("updateIdfaToMacJiangShen==============================="+action.getId()); supportService.updateActionLogIdfaToMac(action.getId()); } addScore(action); }else{//非自由渠道则通知渠道确认激活 callChannelConfirm(action.getChannel(), action); } } } @Override void callComfirmCheck(YjfBean bean) { if(config!=null){ String url = config.getUrl(); String method = config.getSend_type(); if(!StringUtil.isEmpty(url) && url.indexOf("http")!=-1){ Map<String, String> map = getParamter((ChannelBean)bean); if("POST".equals(method)){ HttpHelp.postFromUrl(url, map); }else{ HttpHelp.readFromURL(url, map, null); } o.accumulate("code", "success"); }else{ o.accumulate("code", "Illegal URL"); logger.logInfo("Illegal URL:"+url); } }else{ o.accumulate("code", "can not find campgin_config"); logger.logError(" can not find campgin_config"); } } private Map<String, String> getParamter(ChannelBean data){ Map<String, String> map = new HashMap<String, String>(); map.put("appid", data.getAppid()); //map.put("channel", data.getSource()); map.put("channel", "2000036"); //根据桔子要求 mac 需要改成小写 去掉:号 map.put("imei", data.isIos6()?StringUtil.dealNull(data.getDeviceid()).toLowerCase().replaceAll(":", ""):StringUtil.dealNull(data.getIDFA()).toUpperCase()); map.put("pridata", data.getSource());//保存渠道信息 //String mac = data.isIos6()?data.getDeviceid():data.getIDFA(); //mac = StringUtil.dealNull(mac).replaceAll("-","").replaceAll(":", ""); map.put("target", "0"); return map; } @SuppressWarnings("unused") @Override boolean updateComriamActive(YjfBean bean) { AdBean ab = (AdBean)bean; String data = ab.getData(); JSONObject obj = parseObject(data); if(obj!=null){ String appid = obj.containsKey("appid")?obj.getString("appid"):null;//{"pridata":"","appid":"","imei":"","mac":"","tradeno":""} String imei = obj.containsKey("imei")?obj.getString("imei"):null;//激活标识 String mac = obj.containsKey("imei")?obj.getString("mac"):null; String tradeno = obj.getString("tradeno"); String pridata=obj.getString("pridata");//保存渠道信息 action = supportService.findIosActionLog(imei, appid); //自有媒体激活,idfa存在idfa字段中 if(SELF_CHANNEL.equals(pridata) && action==null){ logger.logInfo(" SELF_CHANNEL CHECK "); action = supportService.findIosActionLogIdfA(imei, appid); } if(null!=action){ if(!StringUtil.equals(BaseAttribute.IOS_ACTION_LOG_STATUS_1, action.getActivite_status())){ supportService.updateActiviceLog(action.getId()); //LoggerManager.activiteLogger(action); o.accumulate("Code",SUCCESS_CODE); o.accumulate("Content", "success"); return true; }else{ o.accumulate("Code",FAIL_CODE); o.accumulate("Content", "不允许重复激活"); } }else{ o.accumulate("Code",FAIL_CODE); o.accumulate("Content", "未找到相应的记录"); } }else{ o.accumulate("Code",FAIL_CODE); o.accumulate("Content", "error"); } return false; } private JSONObject parseObject(String data){ if(null!=data){ String str=""; try { str = new String(Base64.decryptBASE64(data)); logger.logInfo(str); return JSONObject.fromObject(str); } catch (Exception e) { logger.logError(" json error: " +str+" by "+e.getMessage()); } } return null; } @Override boolean validateChannelBean(YjfBean bean) { ChannelBean b = (ChannelBean)bean; if(b.isIos7()){//ios7 openudid idfa idfv必须有一个不为空 if(StringUtil.isEmpty(b.getOPENUDID()) && StringUtil.isEmpty(b.getIDFA()) && StringUtil.isEmpty(b.getIDFV())){ return false; } }else if(StringUtil.isEmpty(b.getDeviceid())){//ie6 deviceid不能为空 return false; } return true; } @Override boolean validateAdBean(YjfBean bean) { AdBean ab = (AdBean)bean; String data = ab.getData(); String sign = ab.getSign(); String vali_sign=new MD5Util().getMD5ofStr(data+skey); if(StringUtil.equalsIgnoreCase(sign, vali_sign)){ return true; }else{ o.accumulate("Code",FAIL_CODE); o.accumulate("Content", "validate sign error"); return false; } } }
[ "13565644@qq.com" ]
13565644@qq.com
30511cd2ff5d238eab389cb924b1b78840b0c3a9
99c4464f7b0347834ff0fc988b0f8cd34afdf6f5
/src/main/java/com/cashregister/actions/ShowAction.java
96502a78840f76d6f973e4b4b39237626fbdd5d0
[]
no_license
pgxyz/cashregister
082fd21bafdaa1f6f300404a4fdbb171996bac64
012ac3fffd1f6e911446196000b2848482881c34
refs/heads/master
2021-01-20T18:48:34.716918
2016-06-28T01:40:50
2016-06-28T01:40:50
62,022,203
0
1
null
null
null
null
UTF-8
Java
false
false
946
java
package com.cashregister.actions; import com.cashregister.userinterface.Editor; import com.cashregister.userinterface.InputValidator; import com.cashregister.exceptions.InvalidInputException; import com.cashregister.exceptions.ValidatorException; /** * Show Action: show denominations in cash register */ public class ShowAction implements Action, InputValidator { private final Editor editor; public ShowAction(Editor editor) { this.editor = editor; } @Override public String perform(String input) throws InvalidInputException, ValidatorException { validate(input); return editor.show(); } @Override public void validate(String input) throws ValidatorException { boolean validated = input.toLowerCase().trim().equals(Action.SHOW); if (!validated) { throw new ValidatorException("Incorrect format: " + input + " ; Correct input: show"); } } }
[ "pradeep.gummi@gmail.com" ]
pradeep.gummi@gmail.com
2d8e3410bda657465ffcc22d3133a8de8ee99605
818f92c243e6d250085850e83903d271b4f324ef
/src/main/java/com/project/propertytax/service/impl/DetailsImpl.java
8d1e0a0cf8727dadf2de69042f4044ca348128a4
[]
no_license
Mahe420/propertytax
c47d53f4a2b22eb894c13dfc4390273c8fed6af4
d9427844c59bf6b07ee885e3e6bfc2b571ab5c8b
refs/heads/master
2023-01-04T06:38:36.102110
2020-10-30T10:16:57
2020-10-30T10:16:57
308,570,241
0
0
null
null
null
null
UTF-8
Java
false
false
4,165
java
package com.project.propertytax.service.impl; import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.project.propertytax.controller.MainController; import com.project.propertytax.entity.Description; import com.project.propertytax.entity.Status; import com.project.propertytax.entity.User; import com.project.propertytax.entity.Zone; import com.project.propertytax.exception.EmptyListException; import com.project.propertytax.repository.DescriptionRepository; import com.project.propertytax.repository.UavRepository; import com.project.propertytax.repository.UserRepository; import com.project.propertytax.repository.ZoneRepository; import com.project.propertytax.service.DetailsService; @Service @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class DetailsImpl implements DetailsService { private static final Logger LOGGER = LoggerFactory.getLogger(DetailsImpl.class); @Autowired ZoneRepository zoneRepository; @Autowired DescriptionRepository descriptionRepository; @Autowired UserRepository userRepository; @Autowired UavRepository uavRespository; @Override public List<String> allZoneNames() throws EmptyListException { LOGGER.info("Get all zone names"); List<Zone> zoneList = zoneRepository.findAll(); if(zoneList==null||zoneList.isEmpty()) { throw new EmptyListException("Unable to retrieve Zone list from db"); } List<String> zoneNameList = zoneList.stream().map(zone -> zone.getName()).collect(Collectors.toList()); return zoneNameList; } @Override public List<String> allDescription() throws EmptyListException { LOGGER.info("Get all description names"); List<Description> descriptionList = descriptionRepository.findAll(); if(descriptionList==null||descriptionList.isEmpty()) { throw new EmptyListException("Unable to retrieve Description list from db"); } List<String> descriptionNameList = descriptionList.stream().map(description -> description.getDescription()) .distinct().collect(Collectors.toList()); return descriptionNameList; } @Override public List<String> allStatus() throws EmptyListException { LOGGER.info("Get all status"); List<Description> descriptionList = descriptionRepository.findAll(); if(descriptionList==null||descriptionList.isEmpty()) { throw new EmptyListException("Unable to retrieve Description list from db"); } List<String> statusList = descriptionList.stream().map(description -> description.getStatus().toString()) .distinct().collect(Collectors.toList()); return statusList; } @Override public Map<String, Map<String, Long>> reportDetails() throws EmptyListException { LOGGER.info("To find the Total cost in all Zones"); List<User> userList = userRepository.findAll(); if(userList==null||userList.isEmpty()) { throw new EmptyListException("Unable to retrieve User List from db"); } List<Zone> zoneList = zoneRepository.findAll(); if(zoneList==null||zoneList.isEmpty()) { throw new EmptyListException("Unable to retrieve Zone List from db"); } Map<String, Map<String, Long>> map = new TreeMap(); zoneList.forEach(zone -> { Map<String, Long> innerMap = new TreeMap(); Long sum = (long) 0; sum = userList.stream().filter(user -> user.getDescription().getStatus().equals(Status.Owner)) .filter(user -> user.getZone().getName().equals(zone.getName())).map(x -> x.getTotalTax()) .reduce((long) 0, (a, b) -> a + b); innerMap.put("Owner", sum); sum = (long) 0; sum = userList.stream().filter(user -> user.getDescription().getStatus().equals(Status.Tenanted)) .filter(user -> user.getZone().getName().equals(zone.getName())).map(x -> x.getTotalTax()) .reduce((long) 0, (a, b) -> a + b); innerMap.put("Tenanted", sum); map.put(zone.getName(), innerMap); }); return map; } }
[ "mahendran.d4897@gmail.com" ]
mahendran.d4897@gmail.com
e1ed5751d9f0dac8d227158312f2ecb6adb18758
4ef66d6e37d2b92382f9e23afde129731b2288fc
/be/be2/src/main/java/com/example/demo/cart/repository/CartRepository.java
094ad077c69179781ab4fd2e8245a29beb0d7f7d
[]
no_license
leedoyun98/team
c48cb9f4085633e58d384cfd115f127248bfe858
698243c63519ad15fd6e50c6c54700fee13b9b2b
refs/heads/master
2023-04-01T14:05:13.459370
2021-03-31T00:48:17
2021-03-31T00:48:17
346,246,208
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package com.example.demo.cart.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.example.demo.cart.domain.Cart; import com.example.demo.cart.repository.ICartRepository; interface ICartRepository{ } public interface CartRepository extends JpaRepository<Cart, Long>, ICartRepository{ }
[ "leedoyun98@naver.com" ]
leedoyun98@naver.com
70af120f16e85e28ec461fb22fb3ea541f5c4780
e46641d8c9f03272d3f89b643b8a0555c4c9db01
/spring-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java
52d7a123d6697db9597467431b4d48cda3dd5a81
[ "Apache-2.0" ]
permissive
cuilan/spring-framework-5.2.x
bb8e4c01fed71a3623b383c7ba85b9c144904f36
90d00897452c9ba676d5f03e832c236270912a86
refs/heads/master
2022-12-08T21:51:38.187136
2020-09-14T17:00:34
2020-09-14T17:00:34
288,503,461
3
0
null
null
null
null
UTF-8
Java
false
false
18,243
java
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://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.springframework.context.annotation; import java.util.LinkedHashSet; import java.util.Set; import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionDefaults; import org.springframework.beans.factory.support.BeanDefinitionReaderUtils; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanNameGenerator; import org.springframework.core.env.Environment; import org.springframework.core.env.EnvironmentCapable; import org.springframework.core.env.StandardEnvironment; import org.springframework.core.io.ResourceLoader; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.PatternMatchUtils; /** * A bean definition scanner that detects bean candidates on the classpath, * registering corresponding bean definitions with a given registry ({@code BeanFactory} * or {@code ApplicationContext}). * * <p>Candidate classes are detected through configurable type filters. The * default filters include classes that are annotated with Spring's * {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Service @Service}, or * {@link org.springframework.stereotype.Controller @Controller} stereotype. * * <p>Also supports Java EE 6's {@link javax.annotation.ManagedBean} and * JSR-330's {@link javax.inject.Named} annotations, if available. * * @author Mark Fisher * @author Juergen Hoeller * @author Chris Beams * @see AnnotationConfigApplicationContext#scan * @see org.springframework.stereotype.Component * @see org.springframework.stereotype.Repository * @see org.springframework.stereotype.Service * @see org.springframework.stereotype.Controller * @since 2.5 */ public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateComponentProvider { private final BeanDefinitionRegistry registry; private BeanDefinitionDefaults beanDefinitionDefaults = new BeanDefinitionDefaults(); @Nullable private String[] autowireCandidatePatterns; private BeanNameGenerator beanNameGenerator = AnnotationBeanNameGenerator.INSTANCE; private ScopeMetadataResolver scopeMetadataResolver = new AnnotationScopeMetadataResolver(); private boolean includeAnnotationConfig = true; /** * Create a new {@code ClassPathBeanDefinitionScanner} for the given bean factory. * * @param registry the {@code BeanFactory} to load bean definitions into, in the form * of a {@code BeanDefinitionRegistry} */ public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry) { this(registry, true); } /** * Create a new {@code ClassPathBeanDefinitionScanner} for the given bean factory. * <p>If the passed-in bean factory does not only implement the * {@code BeanDefinitionRegistry} interface but also the {@code ResourceLoader} * interface, it will be used as default {@code ResourceLoader} as well. This will * usually be the case for {@link org.springframework.context.ApplicationContext} * implementations. * <p>If given a plain {@code BeanDefinitionRegistry}, the default {@code ResourceLoader} * will be a {@link org.springframework.core.io.support.PathMatchingResourcePatternResolver}. * <p>If the passed-in bean factory also implements {@link EnvironmentCapable} its * environment will be used by this reader. Otherwise, the reader will initialize and * use a {@link org.springframework.core.env.StandardEnvironment}. All * {@code ApplicationContext} implementations are {@code EnvironmentCapable}, while * normal {@code BeanFactory} implementations are not. * * @param registry the {@code BeanFactory} to load bean definitions into, in the form * of a {@code BeanDefinitionRegistry} * @param useDefaultFilters whether to include the default filters for the * {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Service @Service}, and * {@link org.springframework.stereotype.Controller @Controller} stereotype annotations * @see #setResourceLoader * @see #setEnvironment */ public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry, boolean useDefaultFilters) { this(registry, useDefaultFilters, getOrCreateEnvironment(registry)); } /** * Create a new {@code ClassPathBeanDefinitionScanner} for the given bean factory and * using the given {@link Environment} when evaluating bean definition profile metadata. * <p>If the passed-in bean factory does not only implement the {@code * BeanDefinitionRegistry} interface but also the {@link ResourceLoader} interface, it * will be used as default {@code ResourceLoader} as well. This will usually be the * case for {@link org.springframework.context.ApplicationContext} implementations. * <p>If given a plain {@code BeanDefinitionRegistry}, the default {@code ResourceLoader} * will be a {@link org.springframework.core.io.support.PathMatchingResourcePatternResolver}. * * @param registry the {@code BeanFactory} to load bean definitions into, in the form * of a {@code BeanDefinitionRegistry} * @param useDefaultFilters whether to include the default filters for the * {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Service @Service}, and * {@link org.springframework.stereotype.Controller @Controller} stereotype annotations * @param environment the Spring {@link Environment} to use when evaluating bean * definition profile metadata * @see #setResourceLoader * @since 3.1 */ public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry, boolean useDefaultFilters, Environment environment) { this(registry, useDefaultFilters, environment, (registry instanceof ResourceLoader ? (ResourceLoader) registry : null)); } /** * Create a new {@code ClassPathBeanDefinitionScanner} for the given bean factory and * using the given {@link Environment} when evaluating bean definition profile metadata. * * @param registry the {@code BeanFactory} to load bean definitions into, in the form * of a {@code BeanDefinitionRegistry} * @param useDefaultFilters whether to include the default filters for the * {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Service @Service}, and * {@link org.springframework.stereotype.Controller @Controller} stereotype annotations * @param environment the Spring {@link Environment} to use when evaluating bean * definition profile metadata * @param resourceLoader the {@link ResourceLoader} to use * @since 4.3.6 */ public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry, boolean useDefaultFilters, Environment environment, @Nullable ResourceLoader resourceLoader) { Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); this.registry = registry; if (useDefaultFilters) { registerDefaultFilters(); } setEnvironment(environment); setResourceLoader(resourceLoader); } /** * Return the BeanDefinitionRegistry that this scanner operates on. */ @Override public final BeanDefinitionRegistry getRegistry() { return this.registry; } /** * Set the defaults to use for detected beans. * * @see BeanDefinitionDefaults */ public void setBeanDefinitionDefaults(@Nullable BeanDefinitionDefaults beanDefinitionDefaults) { this.beanDefinitionDefaults = (beanDefinitionDefaults != null ? beanDefinitionDefaults : new BeanDefinitionDefaults()); } /** * Return the defaults to use for detected beans (never {@code null}). * * @since 4.1 */ public BeanDefinitionDefaults getBeanDefinitionDefaults() { return this.beanDefinitionDefaults; } /** * Set the name-matching patterns for determining autowire candidates. * * @param autowireCandidatePatterns the patterns to match against */ public void setAutowireCandidatePatterns(@Nullable String... autowireCandidatePatterns) { this.autowireCandidatePatterns = autowireCandidatePatterns; } /** * Set the BeanNameGenerator to use for detected bean classes. * <p>Default is a {@link AnnotationBeanNameGenerator}. */ public void setBeanNameGenerator(@Nullable BeanNameGenerator beanNameGenerator) { this.beanNameGenerator = (beanNameGenerator != null ? beanNameGenerator : AnnotationBeanNameGenerator.INSTANCE); } /** * Set the ScopeMetadataResolver to use for detected bean classes. * Note that this will override any custom "scopedProxyMode" setting. * <p>The default is an {@link AnnotationScopeMetadataResolver}. * * @see #setScopedProxyMode */ public void setScopeMetadataResolver(@Nullable ScopeMetadataResolver scopeMetadataResolver) { this.scopeMetadataResolver = (scopeMetadataResolver != null ? scopeMetadataResolver : new AnnotationScopeMetadataResolver()); } /** * Specify the proxy behavior for non-singleton scoped beans. * Note that this will override any custom "scopeMetadataResolver" setting. * <p>The default is {@link ScopedProxyMode#NO}. * * @see #setScopeMetadataResolver */ public void setScopedProxyMode(ScopedProxyMode scopedProxyMode) { this.scopeMetadataResolver = new AnnotationScopeMetadataResolver(scopedProxyMode); } /** * Specify whether to register annotation config post-processors. * <p>The default is to register the post-processors. Turn this off * to be able to ignore the annotations or to process them differently. */ public void setIncludeAnnotationConfig(boolean includeAnnotationConfig) { this.includeAnnotationConfig = includeAnnotationConfig; } /** * Perform a scan within the specified base packages. * * @param basePackages the packages to check for annotated classes * @return number of beans registered */ public int scan(String... basePackages) { int beanCountAtScanStart = this.registry.getBeanDefinitionCount(); doScan(basePackages); // Register annotation config processors, if necessary. if (this.includeAnnotationConfig) { AnnotationConfigUtils.registerAnnotationConfigProcessors(this.registry); } return (this.registry.getBeanDefinitionCount() - beanCountAtScanStart); } /** * Perform a scan within the specified base packages, * returning the registered bean definitions. * <p>This method does <i>not</i> register an annotation config processor * but rather leaves this up to the caller. * * @param basePackages the packages to check for annotated classes * @return set of beans registered if any for tooling registration purposes (never {@code null}) */ protected Set<BeanDefinitionHolder> doScan(String... basePackages) { Assert.notEmpty(basePackages, "At least one base package must be specified"); // 定义 BeanDefinitionHolder Set 集合 Set<BeanDefinitionHolder> beanDefinitions = new LinkedHashSet<>(); for (String basePackage : basePackages) { // 真正去扫描 Set<BeanDefinition> candidates = findCandidateComponents(basePackage); // 循环处理并注册 BeanDefinition for (BeanDefinition candidate : candidates) { // 解析 scope 属性 ScopeMetadata scopeMetadata = this.scopeMetadataResolver.resolveScopeMetadata(candidate); candidate.setScope(scopeMetadata.getScopeName()); // 得到 beanName String beanName = this.beanNameGenerator.generateBeanName(candidate, this.registry); // 扫描出来的 Bean 都是 ScannedGenericBeanDefinition 类型,继承自 AbstractBeanDefinition if (candidate instanceof AbstractBeanDefinition) { // 处理 BeanDefinition,先设置默认值,autowire postProcessBeanDefinition((AbstractBeanDefinition) candidate, beanName); } // AnnotatedBeanDefinition 处理被注解的普通 BeanDefinition if (candidate instanceof AnnotatedBeanDefinition) { AnnotationConfigUtils.processCommonDefinitionAnnotations((AnnotatedBeanDefinition) candidate); } // 检查是否已存在 if (checkCandidate(beanName, candidate)) { BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(candidate, beanName); definitionHolder = AnnotationConfigUtils.applyScopedProxyMode(scopeMetadata, definitionHolder, this.registry); beanDefinitions.add(definitionHolder); // 执行注册 BeanDefinition registerBeanDefinition(definitionHolder, this.registry); } } } return beanDefinitions; } /** * Apply further settings to the given bean definition, * beyond the contents retrieved from scanning the component class. * * @param beanDefinition the scanned bean definition * @param beanName the generated bean name for the given bean */ protected void postProcessBeanDefinition(AbstractBeanDefinition beanDefinition, String beanName) { // 设置默认值 beanDefinition.applyDefaults(this.beanDefinitionDefaults); if (this.autowireCandidatePatterns != null) { beanDefinition.setAutowireCandidate(PatternMatchUtils.simpleMatch(this.autowireCandidatePatterns, beanName)); } } /** * Register the specified bean with the given registry. * <p>Can be overridden in subclasses, e.g. to adapt the registration * process or to register further bean definitions for each scanned bean. * * @param definitionHolder the bean definition plus bean name for the bean * @param registry the BeanDefinitionRegistry to register the bean with */ protected void registerBeanDefinition(BeanDefinitionHolder definitionHolder, BeanDefinitionRegistry registry) { BeanDefinitionReaderUtils.registerBeanDefinition(definitionHolder, registry); } /** * Check the given candidate's bean name, determining whether the corresponding * bean definition needs to be registered or conflicts with an existing definition. * * @param beanName the suggested name for the bean * @param beanDefinition the corresponding bean definition * @return {@code true} if the bean can be registered as-is; * {@code false} if it should be skipped because there is an * existing, compatible bean definition for the specified name * @throws ConflictingBeanDefinitionException if an existing, incompatible * bean definition has been found for the specified name */ protected boolean checkCandidate(String beanName, BeanDefinition beanDefinition) throws IllegalStateException { if (!this.registry.containsBeanDefinition(beanName)) { return true; } BeanDefinition existingDef = this.registry.getBeanDefinition(beanName); BeanDefinition originatingDef = existingDef.getOriginatingBeanDefinition(); if (originatingDef != null) { existingDef = originatingDef; } if (isCompatible(beanDefinition, existingDef)) { return false; } throw new ConflictingBeanDefinitionException("Annotation-specified bean name '" + beanName + "' for bean class [" + beanDefinition.getBeanClassName() + "] conflicts with existing, " + "non-compatible bean definition of same name and class [" + existingDef.getBeanClassName() + "]"); } /** * Determine whether the given new bean definition is compatible with * the given existing bean definition. * <p>The default implementation considers them as compatible when the existing * bean definition comes from the same source or from a non-scanning source. * * @param newDefinition the new bean definition, originated from scanning * @param existingDefinition the existing bean definition, potentially an * explicitly defined one or a previously generated one from scanning * @return whether the definitions are considered as compatible, with the * new definition to be skipped in favor of the existing definition */ protected boolean isCompatible(BeanDefinition newDefinition, BeanDefinition existingDefinition) { return (!(existingDefinition instanceof ScannedGenericBeanDefinition) || // explicitly registered overriding bean (newDefinition.getSource() != null && newDefinition.getSource().equals(existingDefinition.getSource())) || // scanned same file twice newDefinition.equals(existingDefinition)); // scanned equivalent class twice } /** * Get the Environment from the given registry if possible, otherwise return a new * StandardEnvironment. */ private static Environment getOrCreateEnvironment(BeanDefinitionRegistry registry) { Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); if (registry instanceof EnvironmentCapable) { return ((EnvironmentCapable) registry).getEnvironment(); } return new StandardEnvironment(); } }
[ "17746598041@163.com" ]
17746598041@163.com
f35ad9b135f08627e302c9c1e954e57d5ed6ea91
5ab6e7221e37b353ec5c7805e2cbe08dac65c978
/src/main/java/br/com/alura/spring/data/service/RelatoriosService.java
a2a47b2830233b61d9a5dcadcb033cc1e3844a41
[]
no_license
scaziti/spring-data-alura
983573e67791760f16e120dce0e6f9c7e64680d3
bb940cc94c6b334691d7e8ec0d33fcf8b1b10091
refs/heads/main
2023-05-24T03:15:52.687380
2021-06-11T21:23:20
2021-06-11T21:23:20
375,788,506
0
0
null
null
null
null
UTF-8
Java
false
false
2,934
java
package br.com.alura.spring.data.service; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Scanner; import org.springframework.stereotype.Service; import br.com.alura.spring.data.orm.Funcionario; import br.com.alura.spring.data.orm.FuncionarioProjecao; import br.com.alura.spring.data.repository.FuncionarioRepository; @Service public class RelatoriosService { private Boolean system = true; private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); private final FuncionarioRepository funRepository; public RelatoriosService(FuncionarioRepository funRepository) { this.funRepository = funRepository; } public void inicial(Scanner scanner) { while (system) { System.out.println("Qual acao de cargo deseja executar"); System.out.println("0 - Sair"); System.out.println("1 - Busca funcionário nome"); System.out.println("2 - Busca funcionário nome, data contratação e salário maior"); System.out.println("3 - Busca funcionário data contratação"); System.out.println("4 - Busca funcionário salário"); int action = scanner.nextInt(); switch (action) { case 1: buscaFuncionarioNome(scanner); break; case 2: buscaFuncionarioNomeSalarioMaiorData(scanner); break; case 3: buscaFuncionarioDataContratacao(scanner); break; case 4: buscaFuncionarioSalario(); break; default: system = false; break; } } } private void buscaFuncionarioNome(Scanner scanner) { System.out.println("Informe o nome que deseja buscar"); String nome = scanner.next(); List<Funcionario> list = funRepository.findByNome(nome); list.forEach(System.out::println); } private void buscaFuncionarioNomeSalarioMaiorData(Scanner scanner) { System.out.println("Qual o nome pesquisado"); String nome = scanner.next(); System.out.println("Qual a data de contratação que deseja pesquisar"); String data = scanner.next(); System.out.println("Qual o salário que deseja pesquisar"); double salario = scanner.nextDouble(); LocalDate localDate = LocalDate.parse(data, formatter); List<Funcionario> list = funRepository .findNomeSalarioMaiorDataContratacao(nome, salario, localDate); list.forEach(System.out::println); } private void buscaFuncionarioDataContratacao(Scanner scanner) { System.out.println("Informe a data que deseja buscar"); String data = scanner.next(); LocalDate localDate = LocalDate.parse(data, formatter); List<Funcionario> list = funRepository.findDataContratacaoMaior(localDate); list.forEach(System.out::println); } private void buscaFuncionarioSalario() { List<FuncionarioProjecao> list = funRepository.findFuncionarioSalario(); list.forEach(f -> System.out.println("Funcionario: id: " + f.getId() + "\t| nome: " + f.getNome() + " \t\t| salario: R$ " + f.getSalario())); } }
[ "rscaziti@gmail.com" ]
rscaziti@gmail.com
a1cda5859392183672119d8e1492e1378e090b6a
a6ecc37acbc458d521087c9bd8a46d9977beb970
/core/java/android/database/AbstractCursor.java
76f0860b9d36d8ee5adab81dc62051164516d28b
[ "Apache-2.0" ]
permissive
jsherman/platform_frameworks_base
46f4336a8f774299f6520d9a481184331758062d
9bdf576615231e4b9693f08bfe3dc886c2edf49e
refs/heads/master
2021-01-18T09:21:28.294775
2009-01-02T23:55:15
2009-01-02T23:55:15
101,820
1
0
null
null
null
null
UTF-8
Java
false
false
18,617
java
/* * Copyright (C) 2006 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.database; import android.content.ContentResolver; import android.net.Uri; import android.util.Config; import android.util.Log; import android.os.Bundle; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; import android.os.Message; import java.lang.ref.WeakReference; import java.lang.UnsupportedOperationException; import java.util.HashMap; import java.util.Map; /** * This is an abstract cursor class that handles a lot of the common code * that all cursors need to deal with and is provided for convenience reasons. */ public abstract class AbstractCursor implements CrossProcessCursor { private static final String TAG = "Cursor"; DataSetObservable mDataSetObservable = new DataSetObservable(); ContentObservable mContentObservable = new ContentObservable(); /* -------------------------------------------------------- */ /* These need to be implemented by subclasses */ abstract public int getCount(); abstract public String[] getColumnNames(); abstract public String getString(int column); abstract public short getShort(int column); abstract public int getInt(int column); abstract public long getLong(int column); abstract public float getFloat(int column); abstract public double getDouble(int column); abstract public boolean isNull(int column); // TODO implement getBlob in all cursor types public byte[] getBlob(int column) { throw new UnsupportedOperationException("getBlob is not supported"); } /* -------------------------------------------------------- */ /* Methods that may optionally be implemented by subclasses */ /** * returns a pre-filled window, return NULL if no such window */ public CursorWindow getWindow() { return null; } public int getColumnCount() { return getColumnNames().length; } public void deactivate() { deactivateInternal(); } /** * @hide */ public void deactivateInternal() { if (mSelfObserver != null) { mContentResolver.unregisterContentObserver(mSelfObserver); mSelfObserverRegistered = false; } mDataSetObservable.notifyInvalidated(); } public boolean requery() { if (mSelfObserver != null && mSelfObserverRegistered == false) { mContentResolver.registerContentObserver(mNotifyUri, true, mSelfObserver); mSelfObserverRegistered = true; } mDataSetObservable.notifyChanged(); return true; } public boolean isClosed() { return mClosed; } public void close() { mClosed = true; mContentObservable.unregisterAll(); deactivateInternal(); } /** * @hide * @deprecated */ public boolean commitUpdates(Map<? extends Long,? extends Map<String,Object>> values) { return false; } /** * @hide * @deprecated */ public boolean deleteRow() { return false; } /** * This function is called every time the cursor is successfully scrolled * to a new position, giving the subclass a chance to update any state it * may have. If it returns false the move function will also do so and the * cursor will scroll to the beforeFirst position. * * @param oldPosition the position that we're moving from * @param newPosition the position that we're moving to * @return true if the move is successful, false otherwise */ public boolean onMove(int oldPosition, int newPosition) { return true; } public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) { // Default implementation, uses getString String result = getString(columnIndex); if (result != null) { char[] data = buffer.data; if (data == null || data.length < result.length()) { buffer.data = result.toCharArray(); } else { result.getChars(0, result.length(), data, 0); } buffer.sizeCopied = result.length(); } } /* -------------------------------------------------------- */ /* Implementation */ public AbstractCursor() { mPos = -1; mRowIdColumnIndex = -1; mCurrentRowID = null; mUpdatedRows = new HashMap<Long, Map<String, Object>>(); } public final int getPosition() { return mPos; } public final boolean moveToPosition(int position) { // Make sure position isn't past the end of the cursor final int count = getCount(); if (position >= count) { mPos = count; return false; } // Make sure position isn't before the beginning of the cursor if (position < 0) { mPos = -1; return false; } // Check for no-op moves, and skip the rest of the work for them if (position == mPos) { return true; } boolean result = onMove(mPos, position); if (result == false) { mPos = -1; } else { mPos = position; if (mRowIdColumnIndex != -1) { mCurrentRowID = Long.valueOf(getLong(mRowIdColumnIndex)); } } return result; } /** * Copy data from cursor to CursorWindow * @param position start position of data * @param window */ public void fillWindow(int position, CursorWindow window) { if (position < 0 || position > getCount()) { return; } window.acquireReference(); try { int oldpos = mPos; mPos = position - 1; window.clear(); window.setStartPosition(position); int columnNum = getColumnCount(); window.setNumColumns(columnNum); while (moveToNext() && window.allocRow()) { for (int i = 0; i < columnNum; i++) { String field = getString(i); if (field != null) { if (!window.putString(field, mPos, i)) { window.freeLastRow(); break; } } else { if (!window.putNull(mPos, i)) { window.freeLastRow(); break; } } } } mPos = oldpos; } catch (IllegalStateException e){ // simply ignore it } finally { window.releaseReference(); } } public final boolean move(int offset) { return moveToPosition(mPos + offset); } public final boolean moveToFirst() { return moveToPosition(0); } public final boolean moveToLast() { return moveToPosition(getCount() - 1); } public final boolean moveToNext() { return moveToPosition(mPos + 1); } public final boolean moveToPrevious() { return moveToPosition(mPos - 1); } public final boolean isFirst() { return mPos == 0 && getCount() != 0; } public final boolean isLast() { int cnt = getCount(); return mPos == (cnt - 1) && cnt != 0; } public final boolean isBeforeFirst() { if (getCount() == 0) { return true; } return mPos == -1; } public final boolean isAfterLast() { if (getCount() == 0) { return true; } return mPos == getCount(); } public int getColumnIndex(String columnName) { // Hack according to bug 903852 final int periodIndex = columnName.lastIndexOf('.'); if (periodIndex != -1) { Exception e = new Exception(); Log.e(TAG, "requesting column name with table name -- " + columnName, e); columnName = columnName.substring(periodIndex + 1); } String columnNames[] = getColumnNames(); int length = columnNames.length; for (int i = 0; i < length; i++) { if (columnNames[i].equalsIgnoreCase(columnName)) { return i; } } if (Config.LOGV) { if (getCount() > 0) { Log.w("AbstractCursor", "Unknown column " + columnName); } } return -1; } public int getColumnIndexOrThrow(String columnName) { final int index = getColumnIndex(columnName); if (index < 0) { throw new IllegalArgumentException("column '" + columnName + "' does not exist"); } return index; } public String getColumnName(int columnIndex) { return getColumnNames()[columnIndex]; } /** * @hide * @deprecated */ public boolean updateBlob(int columnIndex, byte[] value) { return update(columnIndex, value); } /** * @hide * @deprecated */ public boolean updateString(int columnIndex, String value) { return update(columnIndex, value); } /** * @hide * @deprecated */ public boolean updateShort(int columnIndex, short value) { return update(columnIndex, Short.valueOf(value)); } /** * @hide * @deprecated */ public boolean updateInt(int columnIndex, int value) { return update(columnIndex, Integer.valueOf(value)); } /** * @hide * @deprecated */ public boolean updateLong(int columnIndex, long value) { return update(columnIndex, Long.valueOf(value)); } /** * @hide * @deprecated */ public boolean updateFloat(int columnIndex, float value) { return update(columnIndex, Float.valueOf(value)); } /** * @hide * @deprecated */ public boolean updateDouble(int columnIndex, double value) { return update(columnIndex, Double.valueOf(value)); } /** * @hide * @deprecated */ public boolean updateToNull(int columnIndex) { return update(columnIndex, null); } /** * @hide * @deprecated */ public boolean update(int columnIndex, Object obj) { if (!supportsUpdates()) { return false; } // Long.valueOf() returns null sometimes! // Long rowid = Long.valueOf(getLong(mRowIdColumnIndex)); Long rowid = new Long(getLong(mRowIdColumnIndex)); if (rowid == null) { throw new IllegalStateException("null rowid. mRowIdColumnIndex = " + mRowIdColumnIndex); } synchronized(mUpdatedRows) { Map<String, Object> row = mUpdatedRows.get(rowid); if (row == null) { row = new HashMap<String, Object>(); mUpdatedRows.put(rowid, row); } row.put(getColumnNames()[columnIndex], obj); } return true; } /** * Returns <code>true</code> if there are pending updates that have not yet been committed. * * @return <code>true</code> if there are pending updates that have not yet been committed. * @hide * @deprecated */ public boolean hasUpdates() { synchronized(mUpdatedRows) { return mUpdatedRows.size() > 0; } } /** * @hide * @deprecated */ public void abortUpdates() { synchronized(mUpdatedRows) { mUpdatedRows.clear(); } } /** * @hide * @deprecated */ public boolean commitUpdates() { return commitUpdates(null); } /** * @hide * @deprecated */ public boolean supportsUpdates() { return mRowIdColumnIndex != -1; } public void registerContentObserver(ContentObserver observer) { mContentObservable.registerObserver(observer); } public void unregisterContentObserver(ContentObserver observer) { // cursor will unregister all observers when it close if (!mClosed) { mContentObservable.unregisterObserver(observer); } } /** * @hide pending API council approval */ protected void notifyDataSetChange() { mDataSetObservable.notifyChanged(); } /** * @hide pending API council approval */ protected DataSetObservable getDataSetObservable() { return mDataSetObservable; } public void registerDataSetObserver(DataSetObserver observer) { mDataSetObservable.registerObserver(observer); } public void unregisterDataSetObserver(DataSetObserver observer) { mDataSetObservable.unregisterObserver(observer); } /** * Subclasses must call this method when they finish committing updates to notify all * observers. * * @param selfChange */ protected void onChange(boolean selfChange) { synchronized (mSelfObserverLock) { mContentObservable.dispatchChange(selfChange); if (mNotifyUri != null && selfChange) { mContentResolver.notifyChange(mNotifyUri, mSelfObserver); } } } /** * Specifies a content URI to watch for changes. * * @param cr The content resolver from the caller's context. * @param notifyUri The URI to watch for changes. This can be a * specific row URI, or a base URI for a whole class of content. */ public void setNotificationUri(ContentResolver cr, Uri notifyUri) { synchronized (mSelfObserverLock) { mNotifyUri = notifyUri; mContentResolver = cr; if (mSelfObserver != null) { mContentResolver.unregisterContentObserver(mSelfObserver); } mSelfObserver = new SelfContentObserver(this); mContentResolver.registerContentObserver(mNotifyUri, true, mSelfObserver); mSelfObserverRegistered = true; } } public boolean getWantsAllOnMoveCalls() { return false; } public Bundle getExtras() { return Bundle.EMPTY; } public Bundle respond(Bundle extras) { return Bundle.EMPTY; } /** * This function returns true if the field has been updated and is * used in conjunction with {@link #getUpdatedField} to allow subclasses to * support reading uncommitted updates. NOTE: This function and * {@link #getUpdatedField} should be called together inside of a * block synchronized on mUpdatedRows. * * @param columnIndex the column index of the field to check * @return true if the field has been updated, false otherwise */ protected boolean isFieldUpdated(int columnIndex) { if (mRowIdColumnIndex != -1 && mUpdatedRows.size() > 0) { Map<String, Object> updates = mUpdatedRows.get(mCurrentRowID); if (updates != null && updates.containsKey(getColumnNames()[columnIndex])) { return true; } } return false; } /** * This function returns the uncommitted updated value for the field * at columnIndex. NOTE: This function and {@link #isFieldUpdated} should * be called together inside of a block synchronized on mUpdatedRows. * * @param columnIndex the column index of the field to retrieve * @return the updated value */ protected Object getUpdatedField(int columnIndex) { Map<String, Object> updates = mUpdatedRows.get(mCurrentRowID); return updates.get(getColumnNames()[columnIndex]); } /** * This function throws CursorIndexOutOfBoundsException if * the cursor position is out of bounds. Subclass implementations of * the get functions should call this before attempting * to retrieve data. * * @throws CursorIndexOutOfBoundsException */ protected void checkPosition() { if (-1 == mPos || getCount() == mPos) { throw new CursorIndexOutOfBoundsException(mPos, getCount()); } } @Override protected void finalize() { if (mSelfObserver != null && mSelfObserverRegistered == true) { mContentResolver.unregisterContentObserver(mSelfObserver); } } /** * Cursors use this class to track changes others make to their URI. */ protected static class SelfContentObserver extends ContentObserver { WeakReference<AbstractCursor> mCursor; public SelfContentObserver(AbstractCursor cursor) { super(null); mCursor = new WeakReference<AbstractCursor>(cursor); } @Override public boolean deliverSelfNotifications() { return false; } @Override public void onChange(boolean selfChange) { AbstractCursor cursor = mCursor.get(); if (cursor != null) { cursor.onChange(false); } } } /** * This HashMap contains a mapping from Long rowIDs to another Map * that maps from String column names to new values. A NULL value means to * remove an existing value, and all numeric values are in their class * forms, i.e. Integer, Long, Float, etc. */ protected HashMap<Long, Map<String, Object>> mUpdatedRows; /** * This must be set to the index of the row ID column by any * subclass that wishes to support updates. */ protected int mRowIdColumnIndex; protected int mPos; protected Long mCurrentRowID; protected ContentResolver mContentResolver; protected boolean mClosed = false; private Uri mNotifyUri; private ContentObserver mSelfObserver; final private Object mSelfObserverLock = new Object(); private boolean mSelfObserverRegistered; }
[ "initial-contribution@android.com" ]
initial-contribution@android.com
c5a4b65826ef847488171e5815f18bc8ca209e66
34d6d72c37c2311636f63727a99f88c5e4dd558a
/app/src/test/java/com/example/xmliu/pushdemo/ExampleUnitTest.java
9ba055d9d1cc9b6dd4866ccc45a2526fa2af6e84
[]
no_license
lxmymjr/PushDemo
02ac7876bd26eefe66c13e4d7b13da945b8c35cb
47d9163b8c86bb50a7203b8841c4fc36eb151f24
refs/heads/master
2021-05-07T16:10:05.893624
2017-10-28T04:27:12
2017-10-28T04:27:12
108,619,614
0
0
null
null
null
null
UTF-8
Java
false
false
404
java
package com.example.xmliu.pushdemo; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "lxm19930721@gmail.com" ]
lxm19930721@gmail.com
cc6c35d48f2ce310fb518722e64c71427653329b
5cbab6556a1c84ddd0c55d424020aad84da5bcd7
/cdap-operational-stats-core/src/main/java/co/cask/cdap/operations/hdfs/HDFSInfo.java
664ab446cd212c0a1c35666a1a0bee4486e91b93
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ssanthanam-sfdc/cdap
75ed3b66ae00d23d4f7d095b1f3e5b3f339cc69a
f1abec19350ffd24a99209bf32b81df4263a87f3
refs/heads/develop
2021-01-12T17:47:48.932989
2016-12-16T07:52:38
2016-12-16T07:52:38
69,392,022
0
0
null
2016-09-27T19:38:13
2016-09-27T19:38:13
null
UTF-8
Java
false
false
5,285
java
/* * Copyright © 2016 Cask Data, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package co.cask.cdap.operations.hdfs; import co.cask.cdap.operations.OperationalStats; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Iterables; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.ha.HAServiceProtocol; import org.apache.hadoop.ha.HAServiceStatus; import org.apache.hadoop.ha.HAServiceTarget; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.hdfs.HAUtil; import org.apache.hadoop.hdfs.tools.NNHAServiceTarget; import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.util.VersionInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.net.InetSocketAddress; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.util.Collection; import javax.annotation.Nullable; /** * {@link OperationalStats} representing HDFS information. */ public class HDFSInfo extends AbstractHDFSStats implements HDFSInfoMXBean { private static final Logger LOG = LoggerFactory.getLogger(HDFSInfo.class); @VisibleForTesting static final String STAT_TYPE = "info"; @SuppressWarnings("unused") public HDFSInfo() { this(new Configuration()); } @VisibleForTesting HDFSInfo(Configuration conf) { super(conf); } @Override public String getStatType() { return STAT_TYPE; } @Override public String getVersion() { return VersionInfo.getVersion(); } @Override public String getWebURL() { try { if (HAUtil.isHAEnabled(conf, getNameService())) { URL haWebURL = getHAWebURL(); if (haWebURL != null) { return haWebURL.toString(); } } else { try (FileSystem fs = FileSystem.get(conf)) { URL webUrl = rpcToHttpAddress(fs.getUri()); if (webUrl != null) { return webUrl.toString(); } } } } catch (IOException e) { LOG.warn("Error in determining HDFS URL. Web URL of HDFS will not be available in HDFS operational stats.", e); } return null; } @Override public String getLogsURL() { String webURL = getWebURL(); if (webURL == null) { return null; } return webURL + "/logs"; } @Override public void collect() throws IOException { // No need to refresh static information } @Nullable private String getNameService() { Collection<String> nameservices = conf.getTrimmedStringCollection(DFSConfigKeys.DFS_NAMESERVICES); if (nameservices.isEmpty()) { // we want to return null from this method if nameservices are not configured, so it can be used in methods like // HAUtil.isHAEnabled() return null; } if (1 == nameservices.size()) { return Iterables.getOnlyElement(nameservices); } throw new IllegalStateException("Found multiple nameservices configured in HDFS. CDAP currently does not support " + "HDFS Federation."); } @Nullable private URL getHAWebURL() throws IOException { String activeNamenode = null; String nameService = getNameService(); for (String nnId : DFSUtil.getNameNodeIds(conf, nameService)) { HAServiceTarget haServiceTarget = new NNHAServiceTarget(conf, nameService, nnId); HAServiceProtocol proxy = haServiceTarget.getProxy(conf, 10000); HAServiceStatus serviceStatus = proxy.getServiceStatus(); if (HAServiceProtocol.HAServiceState.ACTIVE != serviceStatus.getState()) { continue; } activeNamenode = DFSUtil.getNamenodeServiceAddr(conf, nameService, nnId); } if (activeNamenode == null) { throw new IllegalStateException("Could not find an active namenode"); } return rpcToHttpAddress(URI.create(activeNamenode)); } @Nullable private URL rpcToHttpAddress(URI rpcURI) throws MalformedURLException { String host = rpcURI.getHost(); if (host == null) { return null; } boolean httpsEnabled = conf.getBoolean(DFSConfigKeys.DFS_HTTPS_ENABLE_KEY, DFSConfigKeys.DFS_HTTPS_ENABLE_DEFAULT); String namenodeWebAddress = httpsEnabled ? conf.get(DFSConfigKeys.DFS_NAMENODE_HTTPS_ADDRESS_KEY, DFSConfigKeys.DFS_NAMENODE_HTTPS_ADDRESS_DEFAULT) : conf.get(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY, DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_DEFAULT); InetSocketAddress socketAddress = NetUtils.createSocketAddr(namenodeWebAddress); int namenodeWebPort = socketAddress.getPort(); String protocol = httpsEnabled ? "https" : "http"; return new URL(protocol, host, namenodeWebPort, ""); } }
[ "bhooshan@cask.co" ]
bhooshan@cask.co
8cc9633cb2eb4f6f6ac296d7e03275291e0958ce
19599ad278e170175f31f3544f140a8bc4ee6bab
/src/com/ametis/cms/dao/impl/ClaimProcedureDaoImpl.java
a30aa8f204c67d49924e4b1af4ccff19612e1c08
[]
no_license
andreHer/owlexaGIT
a2a0df83cd64a399e1c57bb6451262434e089631
426df1790443e8e8dd492690d6b7bd8fd37fa3d7
refs/heads/master
2021-01-01T04:26:16.039616
2016-05-12T07:37:20
2016-05-12T07:37:20
58,693,624
0
0
null
null
null
null
UTF-8
Java
false
false
4,161
java
package com.ametis.cms.dao.impl; import com.ametis.cms.datamodel.ClaimProcedure; import com.ametis.cms.dao.ClaimProcedureDao; import com.ametis.cms.util.dao.DaoSupportUtil; import com.ametis.cms.util.*; import org.hibernate.SessionFactory; import org.hibernate.Session; import org.hibernate.Criteria; import org.hibernate.criterion.DetachedCriteria; import org.springframework.dao.DataAccessException; import org.springframework.orm.hibernate3.HibernateTemplate; // imports+ // imports- /** * ClaimProcedureDao adalah bean implementation untuk DAO tabel claim_procedure. */ public class ClaimProcedureDaoImpl extends DaoSupportUtil implements ClaimProcedureDao // extends+ // extends- { /* * Method create (ClaimProcedure object) berfungsi untuk melakukan penambahan * sebuah object kedalam database * @param object adalah sebuah object yang ingin diubah * @return object baru hasil create dengan assigned primary key , exception jika gagal */ public ClaimProcedure create (ClaimProcedure object) throws DataAccessException { this.getHibernateTemplate().save(object); return object; } /* * Method updateClaimProcedure (ClaimProcedure object) berfungsi untuk melakukan perubahan terhadap * sebuah object yang terdapat didalam database * @param object adalah sebuah object yang ingin diubah * @return object hasil update apabila proses update berhasil dilakukan, dan exception jika gagal. */ public ClaimProcedure update (ClaimProcedure object) throws DataAccessException{ this.getHibernateTemplate().update(object); return object; } /* * Method delete (ClaimProcedure object) berfungsi untuk melakukan penghapusan terhadap * sebuah object yang terdapat didalam database * @param object adalah sebuah object yang ingin dihapus, isi dari object tersebut cukup dengan * mengisi field-field primary key * @return no return value karena objeknya sendiri sudah dihapus - just for consistency. Again, * exception if fail * */ public ClaimProcedure delete (ClaimProcedure object) throws DataAccessException{ this.getHibernateTemplate().delete(object); return object; } /* * Method get (ClaimProcedure object) berfungsi untuk melakukan retrieval terhadap * sebuah object yang terdapat didalam database * @param object adalah sebuah object yang mempunyai ciri-ciri (example) sesuai dengan data yang diinginkan * @return Object yang dihasilkan dari proses retrieval, apabila object tidak ditemukan * maka method akan mengembalikan nilai "NULL" */ public ClaimProcedure get (java.io.Serializable pkey) throws DataAccessException { return (ClaimProcedure) this.getHibernateTemplate().get (ClaimProcedure.class, pkey); } /* BASIC IMPLEMENTATION !! USE WITH CAUTION ! USE IT IF NO OTHER OPTION LEFT @return criteria */ public Criteria getCriteria() throws Exception { HibernateTemplate template = this.getHibernateTemplate(); SessionFactory sessionFactory = template.getSessionFactory(); Session session = sessionFactory.getCurrentSession(); Criteria criteria = session.createCriteria(ClaimProcedure.class); return criteria; } /* BASIC IMPLEMENTATION !! USE WITH CAUTION ! USE IT IF NO OTHER OPTION LEFT WARNING !! DONT" FORGET TO SET THE PROJECTION example : detachedCriteria.setProjection(Property.forName("primary_key_field")); @return DetachedCriteria * */ public DetachedCriteria getDetachedCriteria() throws Exception { DetachedCriteria dc = DetachedCriteria.forClass(ClaimProcedure.class); return dc; } //------------------------------------------------ // GAGAL TERUS -GAK SEMUA JALAN DENGAN BAIK - DINONAKTIFKAN /* public Collection searchClaimProcedure (ClaimProcedure object) throws Exception{ HibernateTemplate template = getHibernateTemplate(); SessionFactory sessionFactory = template.getSessionFactory(); Session session = sessionFactory.getCurrentSession(); Criteria criteria = session.createCriteria(ClaimProcedure.class); criteria.add(Example.create(object)); return criteria.list(); } */ // class+ // class- }
[ "mashuri@7a4bab5d-9f4e-4b47-a10f-b21823e054b7" ]
mashuri@7a4bab5d-9f4e-4b47-a10f-b21823e054b7
7539e06608bc20a672bd1f2ed76b7383657bbf2b
7543eb6be4db4124084b6eac0b26131bcdfea563
/sources/com/facebook/login/LoginClient.java
05b3df344e5e1d4ff506372dc500c697942f069a
[]
no_license
n0misain/6-1_source_from_JADX
bea3bc861ba84c62c27231e7bcff6df49e2f21c9
e0e00915f0b376e7c1d0c162bf7d6697153ce7b1
refs/heads/master
2022-07-19T05:28:02.911308
2020-05-17T00:12:26
2020-05-17T00:12:26
264,563,027
0
0
null
null
null
null
UTF-8
Java
false
false
20,863
java
package com.facebook.login; import android.app.Activity; import android.content.Intent; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.text.TextUtils; import com.facebook.AccessToken; import com.facebook.C0665R; import com.facebook.FacebookException; import com.facebook.GraphResponse; import com.facebook.appevents.AppEventsConstants; import com.facebook.internal.CallbackManagerImpl.RequestCodeOffset; import com.facebook.internal.NativeProtocol; import com.facebook.internal.Utility; import com.facebook.internal.Validate; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.json.JSONException; import org.json.JSONObject; class LoginClient implements Parcelable { public static final Creator<LoginClient> CREATOR = new C07461(); BackgroundProcessingListener backgroundProcessingListener; boolean checkedInternetPermission; int currentHandler = -1; Fragment fragment; LoginMethodHandler[] handlersToTry; Map<String, String> loggingExtras; private LoginLogger loginLogger; OnCompletedListener onCompletedListener; Request pendingRequest; /* renamed from: com.facebook.login.LoginClient$1 */ static class C07461 implements Creator { C07461() { } public LoginClient createFromParcel(Parcel source) { return new LoginClient(source); } public LoginClient[] newArray(int size) { return new LoginClient[size]; } } interface BackgroundProcessingListener { void onBackgroundProcessingStarted(); void onBackgroundProcessingStopped(); } public interface OnCompletedListener { void onCompleted(Result result); } public static class Request implements Parcelable { public static final Creator<Request> CREATOR = new C07471(); private final String applicationId; private final String authId; private final DefaultAudience defaultAudience; private String deviceRedirectUriString; private boolean isRerequest; private final LoginBehavior loginBehavior; private Set<String> permissions; /* renamed from: com.facebook.login.LoginClient$Request$1 */ static class C07471 implements Creator { C07471() { } public Request createFromParcel(Parcel source) { return new Request(source); } public Request[] newArray(int size) { return new Request[size]; } } Request(LoginBehavior loginBehavior, Set<String> permissions, DefaultAudience defaultAudience, String applicationId, String authId) { this.isRerequest = false; this.loginBehavior = loginBehavior; if (permissions == null) { permissions = new HashSet(); } this.permissions = permissions; this.defaultAudience = defaultAudience; this.applicationId = applicationId; this.authId = authId; } Set<String> getPermissions() { return this.permissions; } void setPermissions(Set<String> permissions) { Validate.notNull(permissions, NativeProtocol.RESULT_ARGS_PERMISSIONS); this.permissions = permissions; } LoginBehavior getLoginBehavior() { return this.loginBehavior; } DefaultAudience getDefaultAudience() { return this.defaultAudience; } String getApplicationId() { return this.applicationId; } String getAuthId() { return this.authId; } boolean isRerequest() { return this.isRerequest; } void setRerequest(boolean isRerequest) { this.isRerequest = isRerequest; } String getDeviceRedirectUriString() { return this.deviceRedirectUriString; } void setDeviceRedirectUriString(String deviceRedirectUriString) { this.deviceRedirectUriString = deviceRedirectUriString; } boolean hasPublishPermission() { for (String permission : this.permissions) { if (LoginManager.isPublishPermission(permission)) { return true; } } return false; } private Request(Parcel parcel) { LoginBehavior valueOf; boolean z; DefaultAudience defaultAudience = null; this.isRerequest = false; String enumValue = parcel.readString(); if (enumValue != null) { valueOf = LoginBehavior.valueOf(enumValue); } else { valueOf = null; } this.loginBehavior = valueOf; ArrayList<String> permissionsList = new ArrayList(); parcel.readStringList(permissionsList); this.permissions = new HashSet(permissionsList); enumValue = parcel.readString(); if (enumValue != null) { defaultAudience = DefaultAudience.valueOf(enumValue); } this.defaultAudience = defaultAudience; this.applicationId = parcel.readString(); this.authId = parcel.readString(); if (parcel.readByte() != (byte) 0) { z = true; } else { z = false; } this.isRerequest = z; this.deviceRedirectUriString = parcel.readString(); } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { String str = null; dest.writeString(this.loginBehavior != null ? this.loginBehavior.name() : null); dest.writeStringList(new ArrayList(this.permissions)); if (this.defaultAudience != null) { str = this.defaultAudience.name(); } dest.writeString(str); dest.writeString(this.applicationId); dest.writeString(this.authId); dest.writeByte((byte) (this.isRerequest ? 1 : 0)); dest.writeString(this.deviceRedirectUriString); } } public static class Result implements Parcelable { public static final Creator<Result> CREATOR = new C07481(); final Code code; final String errorCode; final String errorMessage; public Map<String, String> loggingExtras; final Request request; final AccessToken token; /* renamed from: com.facebook.login.LoginClient$Result$1 */ static class C07481 implements Creator { C07481() { } public Result createFromParcel(Parcel source) { return new Result(source); } public Result[] newArray(int size) { return new Result[size]; } } enum Code { SUCCESS(GraphResponse.SUCCESS_KEY), CANCEL("cancel"), ERROR("error"); private final String loggingValue; private Code(String loggingValue) { this.loggingValue = loggingValue; } String getLoggingValue() { return this.loggingValue; } } Result(Request request, Code code, AccessToken token, String errorMessage, String errorCode) { Validate.notNull(code, "code"); this.request = request; this.token = token; this.errorMessage = errorMessage; this.code = code; this.errorCode = errorCode; } static Result createTokenResult(Request request, AccessToken token) { return new Result(request, Code.SUCCESS, token, null, null); } static Result createCancelResult(Request request, String message) { return new Result(request, Code.CANCEL, null, message, null); } static Result createErrorResult(Request request, String errorType, String errorDescription) { return createErrorResult(request, errorType, errorDescription, null); } static Result createErrorResult(Request request, String errorType, String errorDescription, String errorCode) { return new Result(request, Code.ERROR, null, TextUtils.join(": ", Utility.asListNoNulls(errorType, errorDescription)), errorCode); } private Result(Parcel parcel) { this.code = Code.valueOf(parcel.readString()); this.token = (AccessToken) parcel.readParcelable(AccessToken.class.getClassLoader()); this.errorMessage = parcel.readString(); this.errorCode = parcel.readString(); this.request = (Request) parcel.readParcelable(Request.class.getClassLoader()); this.loggingExtras = Utility.readStringMapFromParcel(parcel); } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeString(this.code.name()); dest.writeParcelable(this.token, flags); dest.writeString(this.errorMessage); dest.writeString(this.errorCode); dest.writeParcelable(this.request, flags); Utility.writeStringMapToParcel(dest, this.loggingExtras); } } public LoginClient(Fragment fragment) { this.fragment = fragment; } public Fragment getFragment() { return this.fragment; } void setFragment(Fragment fragment) { if (this.fragment != null) { throw new FacebookException("Can't set fragment once it is already set."); } this.fragment = fragment; } FragmentActivity getActivity() { return this.fragment.getActivity(); } public Request getPendingRequest() { return this.pendingRequest; } public static int getLoginRequestCode() { return RequestCodeOffset.Login.toRequestCode(); } void startOrContinueAuth(Request request) { if (!getInProgress()) { authorize(request); } } void authorize(Request request) { if (request != null) { if (this.pendingRequest != null) { throw new FacebookException("Attempted to authorize while a request is pending."); } else if (AccessToken.getCurrentAccessToken() == null || checkInternetPermission()) { this.pendingRequest = request; this.handlersToTry = getHandlersToTry(request); tryNextHandler(); } } } boolean getInProgress() { return this.pendingRequest != null && this.currentHandler >= 0; } void cancelCurrentHandler() { if (this.currentHandler >= 0) { getCurrentHandler().cancel(); } } LoginMethodHandler getCurrentHandler() { if (this.currentHandler >= 0) { return this.handlersToTry[this.currentHandler]; } return null; } public boolean onActivityResult(int requestCode, int resultCode, Intent data) { if (this.pendingRequest != null) { return getCurrentHandler().onActivityResult(requestCode, resultCode, data); } return false; } protected LoginMethodHandler[] getHandlersToTry(Request request) { ArrayList<LoginMethodHandler> handlers = new ArrayList(); LoginBehavior behavior = request.getLoginBehavior(); if (behavior.allowsGetTokenAuth()) { handlers.add(new GetTokenLoginMethodHandler(this)); } if (behavior.allowsKatanaAuth()) { handlers.add(new KatanaProxyLoginMethodHandler(this)); } if (behavior.allowsFacebookLiteAuth()) { handlers.add(new FacebookLiteLoginMethodHandler(this)); } if (behavior.allowsCustomTabAuth()) { handlers.add(new CustomTabLoginMethodHandler(this)); } if (behavior.allowsWebViewAuth()) { handlers.add(new WebViewLoginMethodHandler(this)); } if (behavior.allowsDeviceAuth()) { handlers.add(new DeviceAuthMethodHandler(this)); } LoginMethodHandler[] result = new LoginMethodHandler[handlers.size()]; handlers.toArray(result); return result; } boolean checkInternetPermission() { if (this.checkedInternetPermission) { return true; } if (checkPermission("android.permission.INTERNET") != 0) { Activity activity = getActivity(); complete(Result.createErrorResult(this.pendingRequest, activity.getString(C0665R.string.com_facebook_internet_permission_error_title), activity.getString(C0665R.string.com_facebook_internet_permission_error_message))); return false; } this.checkedInternetPermission = true; return true; } void tryNextHandler() { if (this.currentHandler >= 0) { logAuthorizationMethodComplete(getCurrentHandler().getNameForLogging(), "skipped", null, null, getCurrentHandler().methodLoggingExtras); } while (this.handlersToTry != null && this.currentHandler < this.handlersToTry.length - 1) { this.currentHandler++; if (tryCurrentHandler()) { return; } } if (this.pendingRequest != null) { completeWithFailure(); } } private void completeWithFailure() { complete(Result.createErrorResult(this.pendingRequest, "Login attempt failed.", null)); } private void addLoggingExtra(String key, String value, boolean accumulate) { if (this.loggingExtras == null) { this.loggingExtras = new HashMap(); } if (this.loggingExtras.containsKey(key) && accumulate) { value = ((String) this.loggingExtras.get(key)) + "," + value; } this.loggingExtras.put(key, value); } boolean tryCurrentHandler() { boolean z = false; LoginMethodHandler handler = getCurrentHandler(); if (!handler.needsInternetPermission() || checkInternetPermission()) { z = handler.tryAuthorize(this.pendingRequest); if (z) { getLogger().logAuthorizationMethodStart(this.pendingRequest.getAuthId(), handler.getNameForLogging()); } else { getLogger().logAuthorizationMethodNotTried(this.pendingRequest.getAuthId(), handler.getNameForLogging()); addLoggingExtra("not_tried", handler.getNameForLogging(), true); } } else { addLoggingExtra("no_internet_permission", AppEventsConstants.EVENT_PARAM_VALUE_YES, false); } return z; } void completeAndValidate(Result outcome) { if (outcome.token == null || AccessToken.getCurrentAccessToken() == null) { complete(outcome); } else { validateSameFbidAndFinish(outcome); } } void complete(Result outcome) { LoginMethodHandler handler = getCurrentHandler(); if (handler != null) { logAuthorizationMethodComplete(handler.getNameForLogging(), outcome, handler.methodLoggingExtras); } if (this.loggingExtras != null) { outcome.loggingExtras = this.loggingExtras; } this.handlersToTry = null; this.currentHandler = -1; this.pendingRequest = null; this.loggingExtras = null; notifyOnCompleteListener(outcome); } OnCompletedListener getOnCompletedListener() { return this.onCompletedListener; } void setOnCompletedListener(OnCompletedListener onCompletedListener) { this.onCompletedListener = onCompletedListener; } BackgroundProcessingListener getBackgroundProcessingListener() { return this.backgroundProcessingListener; } void setBackgroundProcessingListener(BackgroundProcessingListener backgroundProcessingListener) { this.backgroundProcessingListener = backgroundProcessingListener; } int checkPermission(String permission) { return getActivity().checkCallingOrSelfPermission(permission); } void validateSameFbidAndFinish(Result pendingResult) { if (pendingResult.token == null) { throw new FacebookException("Can't validate without a token"); } Result result; AccessToken previousToken = AccessToken.getCurrentAccessToken(); AccessToken newToken = pendingResult.token; if (!(previousToken == null || newToken == null)) { try { if (previousToken.getUserId().equals(newToken.getUserId())) { result = Result.createTokenResult(this.pendingRequest, pendingResult.token); complete(result); } } catch (Exception ex) { complete(Result.createErrorResult(this.pendingRequest, "Caught exception", ex.getMessage())); return; } } result = Result.createErrorResult(this.pendingRequest, "User logged in as different Facebook user.", null); complete(result); } private static AccessToken createFromTokenWithRefreshedPermissions(AccessToken token, Collection<String> grantedPermissions, Collection<String> declinedPermissions) { return new AccessToken(token.getToken(), token.getApplicationId(), token.getUserId(), grantedPermissions, declinedPermissions, token.getSource(), token.getExpires(), token.getLastRefresh()); } private LoginLogger getLogger() { if (this.loginLogger == null || !this.loginLogger.getApplicationId().equals(this.pendingRequest.getApplicationId())) { this.loginLogger = new LoginLogger(getActivity(), this.pendingRequest.getApplicationId()); } return this.loginLogger; } private void notifyOnCompleteListener(Result outcome) { if (this.onCompletedListener != null) { this.onCompletedListener.onCompleted(outcome); } } void notifyBackgroundProcessingStart() { if (this.backgroundProcessingListener != null) { this.backgroundProcessingListener.onBackgroundProcessingStarted(); } } void notifyBackgroundProcessingStop() { if (this.backgroundProcessingListener != null) { this.backgroundProcessingListener.onBackgroundProcessingStopped(); } } private void logAuthorizationMethodComplete(String method, Result result, Map<String, String> loggingExtras) { logAuthorizationMethodComplete(method, result.code.getLoggingValue(), result.errorMessage, result.errorCode, loggingExtras); } private void logAuthorizationMethodComplete(String method, String result, String errorMessage, String errorCode, Map<String, String> loggingExtras) { if (this.pendingRequest == null) { getLogger().logUnexpectedError("fb_mobile_login_method_complete", "Unexpected call to logCompleteLogin with null pendingAuthorizationRequest.", method); } else { getLogger().logAuthorizationMethodComplete(this.pendingRequest.getAuthId(), method, result, errorMessage, errorCode, loggingExtras); } } static String getE2E() { JSONObject e2e = new JSONObject(); try { e2e.put("init", System.currentTimeMillis()); } catch (JSONException e) { } return e2e.toString(); } public LoginClient(Parcel source) { Object[] o = source.readParcelableArray(LoginMethodHandler.class.getClassLoader()); this.handlersToTry = new LoginMethodHandler[o.length]; for (int i = 0; i < o.length; i++) { this.handlersToTry[i] = (LoginMethodHandler) o[i]; this.handlersToTry[i].setLoginClient(this); } this.currentHandler = source.readInt(); this.pendingRequest = (Request) source.readParcelable(Request.class.getClassLoader()); this.loggingExtras = Utility.readStringMapFromParcel(source); } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeParcelableArray(this.handlersToTry, flags); dest.writeInt(this.currentHandler); dest.writeParcelable(this.pendingRequest, flags); Utility.writeStringMapToParcel(dest, this.loggingExtras); } }
[ "jaycrandell3@gmail.com" ]
jaycrandell3@gmail.com
386eb94e32fc38dcaed036ee6c4da5b2fef9b9d5
4c082215b8509bf0faaeaa5affe332e7a44be86a
/src/main/java/com/udacity/jwdnd/course1/cloudstorage/mapper/NoteMapper.java
f059a6b95f0059f625fac005a12b4b860d79c839
[]
no_license
kamilkochan/cloudstorage
ef3cfc34c876d9805bf15385c13516b1a59246af
c1a9433369d981d3f31e3a12816ce4facbc6f781
refs/heads/master
2023-03-17T20:40:44.500997
2021-03-24T13:38:19
2021-03-24T13:38:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
872
java
package com.udacity.jwdnd.course1.cloudstorage.mapper; import com.udacity.jwdnd.course1.cloudstorage.model.Note; import org.apache.ibatis.annotations.*; import java.util.List; @Mapper public interface NoteMapper { @Select("Select * from NOTES where userid = #{userId}") List<Note> getAllUserNotes(Integer userId); @Select("Select * from NOTES where noteid=#{noteId}") Note getNoteById(Integer noteId); @Insert("INSERT INTO NOTES (notetitle,notedescription,userid) values (#{noteTitle},#{noteDescription},#{userId})") @Options(useGeneratedKeys = true,keyProperty = "noteId") int addNote(Note note); @Update("Update NOTES SET notetitle=#{noteTitle}, notedescription=#{noteDescription} where noteid=#{noteId}") int editNote(Note note); @Delete("Delete from NOTES where noteid=#{noteId}") int deleteNote(Integer noteId); }
[ "kamil.kochan@gmail.com" ]
kamil.kochan@gmail.com
a129918e94e423a190ed1574a2dc15ede2aa4a44
5efe9c2e970c62056e430ccbd9cd4dc9d6a6acb7
/gulimall-order/src/main/java/com/zzy/gulimall/order/dao/MqMessageDao.java
053ac3cf83cc0967041b55e2e921a6d09e76735b
[]
no_license
zzy946041754/gulimall-server
4a599bd3db0e5c7101304bea29bf661cb84a049e
0c238d83cdab7b1ec62f6d6282188148970b3719
refs/heads/master
2023-06-17T11:14:31.187913
2021-07-17T08:09:04
2021-07-17T08:09:04
386,852,649
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package com.zzy.gulimall.order.dao; import com.zzy.gulimall.order.entity.MqMessageEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * * * @author zzy * @email zhangzongyuan1011@163.com * @date 2021-05-09 22:39:16 */ @Mapper public interface MqMessageDao extends BaseMapper<MqMessageEntity> { }
[ "946041754@qq.com" ]
946041754@qq.com
98e3982dcc6886fbc99f8615cdcc34d1334bbba1
00867bbc3fc92028d9f46622304969f4c7ed767d
/src/test/java/test/FbSignUp.java
4c9192873f850b1be5b25dc119b87d479eb17ef0
[]
no_license
PrekshaBhavsar/jenkins_projects
ddf5b5e3d241de1ac60acaa99007fa1908387ee5
178c5cc92bfa97feaea796ce91b401213d0a5dfe
refs/heads/master
2023-06-18T11:28:39.900538
2021-07-19T17:51:09
2021-07-19T17:51:09
387,544,233
0
0
null
null
null
null
UTF-8
Java
false
false
1,344
java
package test; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.Select; public class FbSignUp { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://en-gb.facebook.com/"); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(5000, TimeUnit.MILLISECONDS); WebElement CreateNewAcc = driver.findElement(By.xpath("//*[text()='Create New Account']")); CreateNewAcc.click(); WebElement Month = driver.findElement(By.xpath("//*[@id = 'month']")); Select MonthDropDown = new Select(Month); MonthDropDown.selectByVisibleText("Jan"); WebElement Gender = driver.findElement(By.xpath("//*[@type = 'radio' and @value='2']")); Gender.click(); ////*[@type = 'radio' and @value='2']/following::input ////*[@type = 'radio' and @value='2']/preceding::input ////label[text()='Male']/following-sibling::input ////*[contains(text(),'you connect')] ////*[starts-with(text(),'Facebook helps')] //driver.quite(); } }
[ "noreply@github.com" ]
noreply@github.com
92ed863f6d8e76cea3a56a0f07b122c5e7eb91ca
21c41ba1f946c83eb1e286264dbae699896ec4dd
/src/main/java/com/sipstacks/script/ScriptContinueFlowException.java
8346cb4010913273979a8f9acc0d0cb6ce0cf0be
[ "Artistic-2.0" ]
permissive
midoricorp/script
fdeb43d4f7f9c538340966e7b268fad2322205d2
a346ab274ddf1cec4acfa94d4be256cbdf08a232
refs/heads/master
2021-06-27T12:11:56.461847
2020-06-10T16:34:00
2020-06-10T16:34:00
31,407,598
1
0
Artistic-2.0
2020-10-12T20:15:24
2015-02-27T07:03:23
Java
UTF-8
Java
false
false
246
java
package com.sipstacks.script; /** * Created by torrey on 15/05/16. */ public class ScriptContinueFlowException extends ScriptFlowException { public ScriptContinueFlowException() { super("Break called outside of a while!"); } }
[ "tsearle@gmail.com" ]
tsearle@gmail.com
a876e931687c5f562ab0fb7d843b000ef51840a2
3c6e4b2d5f96bd55680da69074f9778279c18fb8
/app/src/main/java/com/example/android/bearguestmobile/RestaurantListFragment.java
548005f8f88b774aca9c9d3fcbc6e417dab753e1
[]
no_license
bailey/be_ar_guest_user
8ee2b14f7228088d4bde4196425ede19976ad863
61ce5e4db28dec5a30d8bfda989ddbad45ed9888
refs/heads/master
2021-10-28T03:36:32.222076
2019-04-21T12:45:37
2019-04-21T12:45:37
182,531,618
2
0
null
null
null
null
UTF-8
Java
false
false
2,825
java
package com.example.android.bearguestmobile; import android.arch.lifecycle.LiveData; import android.arch.lifecycle.Observer; import android.arch.lifecycle.ViewModelProviders; import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; 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.Toast; import java.util.ArrayList; import java.util.List; public class RestaurantListFragment extends Fragment { private View restaurantListFragmentView; private RestaurantListAdapter adapter; // Required empty public constructor public RestaurantListFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { restaurantListFragmentView = inflater.inflate(R.layout.fragment_restaurant_list, container, false); // set up the RecyclerView list of restaurants RecyclerView recyclerView = ((RecyclerView)restaurantListFragmentView).findViewById(R.id.rvRestaurantList); Context context = restaurantListFragmentView.getContext(); // Set list adapter recyclerView.setLayoutManager(new LinearLayoutManager(context)); adapter = new RestaurantListAdapter(context, new ArrayList<Restaurant>()); recyclerView.setAdapter(adapter); // Set screen title and show up arrow ToolbarViewModel toolbarViewModel = ViewModelProviders.of((MainActivity)getActivity()).get(ToolbarViewModel.class); toolbarViewModel.setToolbarTitle("Restaurants"); toolbarViewModel.setShowBackArrow(true); return restaurantListFragmentView; } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); DashboardViewModel dashboardViewModel = ViewModelProviders.of((MainActivity)getActivity()).get(DashboardViewModel.class); // Get a list of observable restaurant objects, by selected ParkID, from shared ViewModel dashboardViewModel.getRestaurantListByLandID().observe(this, new Observer<List<Restaurant>>() { @Override public void onChanged(@Nullable List<Restaurant> restaurants) { // Update the UI if(restaurants!=null){ adapter.setRestaurantList(restaurants); } else { Toast.makeText(getActivity(), "Error: observable object List<Restaurant> is null", Toast.LENGTH_SHORT).show(); } } }); } }
[ "baileybrooks@me.com" ]
baileybrooks@me.com
e194b17b80e1c66e09da0851a9e5f4111e51ec11
98e29ebc331a6347dd0fa2f0c322fb63a82ba5cc
/lab12/src/lab12/Node.java
b562e434ac1ceb99439bb1887643a63ed6294791
[]
no_license
Atonej/CIS163
558b8a5f79bbcc8564552d98e9a5bb39183d6d99
e688c745f5e5563049800f05487d79b3e2e12331
refs/heads/master
2021-01-24T16:33:50.432866
2018-02-28T01:53:10
2018-02-28T01:53:10
123,203,312
0
0
null
null
null
null
UTF-8
Java
false
false
617
java
package lab12; public class Node { private String data; private Node next; private Node prev; public Node(String data, Node next, Node prev) { this.data = data; this.next = next; this.prev = prev; } public Node() { } public Node getPrev() { return prev; } public void setPrev(Node prev) { this.prev = prev; } public String getData() { return data; } public void setData(String data) { this.data = data; } public void setNext(Node next) { this.next = next; } public Node getNext() { return next; } }
[ "noreply@github.com" ]
noreply@github.com
ff2a5a8c449fd84c666aded1680644b9fdc4b983
38084e59c2deebff64e93aa2ee871a18aff7277f
/src/ex_1_2_19/Year.java
a2ff159fe05e262941d1ec777120b05474ca2010
[]
no_license
syfy/ex_1_2_19
fc0e50ec0c0729e8b1b46be6c6d165cd5a14126e
07deed9b141f51039ca9dd1d1f4357d6b615d887
refs/heads/master
2020-12-02T18:19:44.496267
2017-07-07T08:02:46
2017-07-07T08:02:46
96,514,791
0
0
null
null
null
null
UTF-8
Java
false
false
2,232
java
package ex_1_2_19; import java.util.HashMap; import java.util.Map; public class Year { Map<Integer,Day> days ; Map<Integer,String> dayCodes; int day; int month; int year; Map<Integer , Integer> maxMonthDaysValue = new HashMap<Integer,Integer>(); public int countTotalLeapYearBeforeTheYear(int year){ int totalLeapYear = 0; for(int x = 2001 ; x<year ;x++){ if((x%4) ==0){ totalLeapYear++; } } return totalLeapYear; } public int calculateStartDayOfTheYear(int year){ int startDay = 0; startDay =(year-2000 % 7) +countTotalLeapYearBeforeTheYear(year ); return startDay; } public String getDayInWords(){ String returnValue = ""; int dayId = day; for(int x = 1 ; x<month; x++){ dayId = dayId + maxMonthDaysValue.get(x); } System.out.println(dayId); return days.get(dayId).toString(); } private void init(){ if((this.year % 4) ==0){ maxMonthDaysValue.put(2, 29); // leap year }else{ maxMonthDaysValue.put(2, 28); // leap year } maxMonthDaysValue.put(1, 31); maxMonthDaysValue.put(3, 31); maxMonthDaysValue.put(4, 30); maxMonthDaysValue.put(5, 31); maxMonthDaysValue.put(6, 30); maxMonthDaysValue.put(7, 31); maxMonthDaysValue.put(8, 30); maxMonthDaysValue.put(9, 31); maxMonthDaysValue.put(10, 31); maxMonthDaysValue.put(11, 30); maxMonthDaysValue.put(12, 31); } Year(int year,int month, int day) { this.day = day; this.year = year; this.month = month; init(); int numberOfDaysPerYear = 365; if((year %4) ==0 ){ numberOfDaysPerYear =366; } int startDay = calculateStartDayOfTheYear(year); dayCodes = new HashMap<Integer,String>(); dayCodes.put(0, "sun"); dayCodes.put(1, "mon"); dayCodes.put(2, "tue"); dayCodes.put(3, "wed"); dayCodes.put(4, "thu"); dayCodes.put(5, "fri"); dayCodes.put(6, "sat"); days = new HashMap<Integer,Day>(); for (int x = 1; x <= numberOfDaysPerYear; x++) { Day daylocal = new Day(dayCodes.get(startDay%7)); days.put(x, daylocal); startDay++; } System.out.println("Total " + days.size()); } }
[ "hypervisor@DESKTOP-8RMNN45" ]
hypervisor@DESKTOP-8RMNN45
e564ef6291c5d53e2608d84278eccc031f01d213
7c4f9c002f5ee79a8daed65e44290eca82392605
/app/src/main/java/com/betonirlite/nikolay/betonir/Fun4Activity.java
094173159a2dd4f81783a345ad7c47a23c55741f
[]
no_license
vnebo2012/Betonir-Lite
110e23e316de068ff2c185b30c99eaa219765157
676d18a9c9432cd5d8a9720fdcccabf275eec914
refs/heads/master
2020-12-30T13:19:42.310284
2017-07-30T10:53:52
2017-07-30T10:53:52
91,342,899
0
0
null
null
null
null
UTF-8
Java
false
false
356,955
java
package com.betonirlite.nikolay.betonir; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ActivityInfo; import android.net.ConnectivityManager; import android.net.Uri; import android.os.Bundle; import android.os.Vibrator; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.InterstitialAd; import java.util.Locale; public class Fun4Activity extends AppCompatActivity { Button etText; Button etText2; Button etText3; Button etText4; Button etText5; Button etText6; Button etText7; Button etText8; Button etText9; Button etText10; Button etText11; Button etText12; Button etText13; Button etText14; Button etText15; Button etText16; Button etText17; Button etText18; Button etText19; Button etText20; Button etText21; Button etText22; Button etText23; Button etText24; Button etText25; Button etText26; Button etText27; Button etText28; Button etText29; Button etText30; Button etText31; Button etText32; Button etText33; Button etText34; Button etText35; Button etText36; Button etText37; Button etText38; Button etText39; Button etText40; Button etText41; Button etText42; Button etText43; Button etText44; Button etText45; Button etText46; Button etText47; Button etText48; Button etText49; Button etText50; Button etText51; //Арматура Button etText52; Button etText53; Button etText54; Button etText55; Button etText56; Button etText57; Button etText58; Button etText59; Button etText60; Button etText61; Button etText62; Button etText63; Button etText64; Button etText65; Button etText66; Button etText67; Button etText68; Button etText69; Button etText70; Button etText71; Button etText72; Button etText73; Button etText74; Button etText75; Button etText76; Button etText77; Button etText78; Button etText79; Button etText80; Button etText81; Button etText82; TextView etText83; TextView etText84; TextView etText85; TextView etText86; TextView etText87; TextView etText88; TextView etText89; Button btnSave, btnLoad; SharedPreferences sPref; SharedPreferences sPref2; SharedPreferences sPref3; final String SAVED_TEXT = "saved_text"; final String SAVED_TEXT2 = "saved_text2"; final String SAVED_TEXT3 = "saved_text3"; final String SAVED_TEXT4 = "saved_text4"; final String SAVED_TEXT5 = "saved_text5"; final String SAVED_TEXT6 = "saved_text6"; final String SAVED_TEXT7 = "saved_text7"; final String SAVED_TEXT8 = "saved_text8"; final String SAVED_TEXT9 = "saved_text9"; final String SAVED_TEXT10 = "saved_text10"; final String SAVED_TEXT11 = "saved_text11"; final String SAVED_TEXT12 = "saved_text12"; final String SAVED_TEXT13 = "saved_text13"; final String SAVED_TEXT14 = "saved_text14"; final String SAVED_TEXT15 = "saved_text15"; final String SAVED_TEXT16 = "saved_text16"; final String SAVED_TEXT17 = "saved_text17"; final String SAVED_TEXT18 = "saved_text18"; final String SAVED_TEXT19 = "saved_text19"; final String SAVED_TEXT20 = "saved_text20"; final String SAVED_TEXT21 = "saved_text21"; final String SAVED_TEXT22 = "saved_text22"; final String SAVED_TEXT23 = "saved_text23"; final String SAVED_TEXT24 = "saved_text24"; final String SAVED_TEXT25 = "saved_text25"; final String SAVED_TEXT26 = "saved_text26"; final String SAVED_TEXT27 = "saved_text27"; final String SAVED_TEXT28 = "saved_text28"; final String SAVED_TEXT29 = "saved_text29"; final String SAVED_TEXT30 = "saved_text30"; final String SAVED_TEXT31 = "saved_text31"; final String SAVED_TEXT32 = "saved_text32"; final String SAVED_TEXT33 = "saved_text33"; final String SAVED_TEXT34 = "saved_text34"; final String SAVED_TEXT35 = "saved_text35"; final String SAVED_TEXT36 = "saved_text36"; final String SAVED_TEXT37 = "saved_text37"; final String SAVED_TEXT38 = "saved_text38"; final String SAVED_TEXT39 = "saved_text39"; final String SAVED_TEXT40 = "saved_text40"; final String SAVED_TEXT41 = "saved_text41"; final String SAVED_TEXT42 = "saved_text42"; final String SAVED_TEXT43 = "saved_text43"; final String SAVED_TEXT44 = "saved_text44"; final String SAVED_TEXT45 = "saved_text45"; final String SAVED_TEXT46 = "saved_text46"; final String SAVED_TEXT47 = "saved_text47"; final String SAVED_TEXT48 = "saved_text48"; final String SAVED_TEXT49 = "saved_text49"; final String SAVED_TEXT50 = "saved_text50"; final String SAVED_TEXT51 = "saved_text51"; final String SAVED_TEXT52 = "saved_text52"; final String SAVED_TEXT53 = "saved_text53"; final String SAVED_TEXT54 = "saved_text54"; final String SAVED_TEXT55 = "saved_text55"; final String SAVED_TEXT56 = "saved_text56"; final String SAVED_TEXT57 = "saved_text57"; final String SAVED_TEXT58 = "saved_text58"; final String SAVED_TEXT59 = "saved_text59"; final String SAVED_TEXT60 = "saved_text60"; final String SAVED_TEXT61 = "saved_text61"; final String SAVED_TEXT62 = "saved_text62"; final String SAVED_TEXT63 = "saved_text63"; final String SAVED_TEXT64 = "saved_text64"; final String SAVED_TEXT65 = "saved_text65"; final String SAVED_TEXT66 = "saved_text66"; final String SAVED_TEXT67 = "saved_text67"; final String SAVED_TEXT68 = "saved_text68"; final String SAVED_TEXT69 = "saved_text69"; final String SAVED_TEXT70 = "saved_text70"; final String SAVED_TEXT71 = "saved_text71"; final String SAVED_TEXT72 = "saved_text72"; final String SAVED_TEXT73 = "saved_text73"; final String SAVED_TEXT74 = "saved_text74"; final String SAVED_TEXT79 = "saved_text79"; final String SAVED_TEXT80 = "saved_text80"; final String SAVED_TEXT81 = "saved_text81"; final String SAVED_TEXT82 = "saved_text82"; final String SAVED_TEXT83 = "saved_text83"; final String SAVED_TEXT84 = "saved_text84"; final String SAVED_TEXT85 = "saved_text85"; final String SAVED_TEXT86 = "saved_text86"; final String SAVED_TEXT87 = "saved_text87"; final String SAVED_TEXT88 = "saved_text88"; final String SAVED_TEXT89 = "saved_text89"; final Context context2 = this; boolean flag = true; Context context; ScrollView myScroll; private TextView wir_1; private TextView wir_2; private TextView wir_3; private TextView wir_4; private TextView wir_5; private TextView wir_6; private TextView wir_7; private TextView wir_8; private TextView wir_9; private TextView wir_10; private TextView wir_11; private TextView wir_12; //region секция private Button btn1 - btn51; private Button btn1; private Button btn2; private Button btn3; private Button btn4; private Button btn5; private Button btn6; private Button btn7; private Button btn8; private Button btn9; private Button btn10; private Button btn11; private Button btn12; private Button btn13; private Button btn14; private Button btn15; private Button btn16; private Button btn17; private Button btn18; private Button btn19; private Button btn20; private Button btn21; private Button btn22; private Button btn23; private Button btn24; private Button btn25; private Button btn26; private Button btn27; private Button btn28; private Button btn29; private Button btn30; private Button btn31; private Button btn32; private Button btn33; private Button btn34; private Button btn35; private Button btn36; private Button btn37; private Button btn38; private Button btn39; private Button btn40; private Button btn41; private Button btn42; private Button btn43; private Button btn44; private Button btn45; private Button btn46; private Button btn47; private Button btn48; private Button btn49; private Button btn50; private Button btn51; private Button btn52; private Button btn53; private Button btn54; private Button btn55; private Button btn56; private Button btn57; private Button btn58; private Button btn59; private Button btn60; private Button btn61; private Button btn62; private Button btn63; private Button btn64; private Button btn65; private Button btn66; private Button btn67; private Button btn68; private Button btn69; private Button btn70; private Button btn71; private Button btn72; private Button btn73; private Button btn74; private Button btn77; private Button btn78; private Button btn79; private Button btn80; private Button btn81; private Button btn82; //endregion //region секция private Button aetText1 - aetText51; private Button aetText1; private Button aetText2; private Button aetText3; private Button aetText4; private Button aetText5; private Button aetText6; private Button aetText7; private Button aetText8; private Button aetText9; private Button aetText10; private Button aetText11; private Button aetText12; private Button aetText13; private Button aetText14; private Button aetText15; private Button aetText16; private Button aetText17; private Button aetText18; private Button aetText19; private Button aetText20; private Button aetText21; private Button aetText22; private Button aetText23; private Button aetText24; private Button aetText25; private Button aetText26; private Button aetText27; private Button aetText28; private Button aetText29; private Button aetText30; private Button aetText31; private Button aetText32; private Button aetText33; private Button aetText34; private Button aetText35; private Button aetText36; private Button aetText37; private Button aetText38; private Button aetText39; private Button aetText40; private Button aetText41; private Button aetText42; private Button aetText43; private Button aetText44; private Button aetText45; private Button aetText46; private Button aetText47; private Button aetText48; private Button aetText49; private Button aetText50; private Button aetText51; private Button aetText52; private Button aetText53; private Button aetText54; private Button aetText55; private Button aetText56; private Button aetText57; private Button aetText58; private Button aetText59; private Button aetText60; private Button aetText61; private Button aetText62; private Button aetText63; private Button aetText64; private Button aetText65; private Button aetText66; private Button aetText67; private Button aetText68; private Button aetText69; private Button aetText70; private Button aetText71; private Button aetText72; private Button aetText73; private Button aetText74; private Button aetText77; private Button aetText78; private Button aetText79; private Button aetText80; private Button aetText81; private Button aetText82; //endregion //region секция Button button101 - button101; Button button101; Button button102; Button button103; Button button104; Button button105; Button button106; Button button107; Button button108; Button button109; Button button110; Button button111; Button button112; Button button113; Button button114; Button button115; Button button116; Button button117; Button button118; Button button119; Button button120; Button button121; Button button122; Button button123; Button button124; Button button125; Button button126; Button button127; Button button128; Button button129; Button button130; Button button131; Button button132; Button button133; Button button134; Button button135; Button button136; Button button137; Button button138; Button button139; Button button140; Button button141; Button button142; Button button143; Button button144; Button button145; Button button146; Button button147; Button button148; Button button149; Button button150; Button button151; Button button152; Button button153; Button button154; Button button155; Button button158; Button button159; Button button160; Button button161; Button button162; Button button163; Button button164; Button button165; Button button166; Button button167; Button button168; Button button169; Button button170; Button button171; Button button172; Button button173; Button button174; Button button175; Button button176; Button button177; Button button178; Button button179; Button button180; Button button181; Button button182; //endregion //region секция private TextView final_text - final_text51; private TextView final_text; private TextView final_text2; private TextView final_text3; private TextView final_text4; private TextView final_text5; private TextView final_text6; private TextView final_text7; private TextView final_text8; private TextView final_text9; private TextView final_text10; private TextView final_text11; private TextView final_text12; private TextView final_text13; private TextView final_text14; private TextView final_text15; private TextView final_text16; private TextView final_text17; private TextView final_text18; private TextView final_text19; private TextView final_text20; private TextView final_text21; private TextView final_text22; private TextView final_text23; private TextView final_text24; private TextView final_text25; private TextView final_text26; private TextView final_text27; private TextView final_text28; private TextView final_text29; private TextView final_text30; private TextView final_text31; private TextView final_text32; private TextView final_text33; private TextView final_text34; private TextView final_text35; private TextView final_text36; private TextView final_text37; private TextView final_text38; private TextView final_text39; private TextView final_text40; private TextView final_text41; private TextView final_text42; private TextView final_text43; private TextView final_text44; private TextView final_text45; private TextView final_text46; private TextView final_text47; private TextView final_text48; private TextView final_text49; private TextView final_text50; private TextView final_text51; private TextView final_text52; private TextView final_text53; private TextView final_text54; private TextView final_text55; private TextView final_text56; private TextView final_text57; private TextView final_text58; private TextView final_text59; private TextView final_text60; private TextView final_text61; private TextView final_text62; private TextView final_text63; private TextView final_text64; private TextView final_text65; private TextView final_text66; private TextView final_text67; private TextView final_text68; private TextView final_text69; private TextView final_text70; private TextView final_text71; private TextView final_text72; private TextView final_text73; private TextView final_text74; private TextView final_text75; private TextView final_text76; private TextView final_text77; private TextView final_text78; private TextView final_text79; private TextView final_text80; private TextView final_text81; private TextView final_text82; private TextView final_text83; private TextView final_text84; private TextView final_text85; private TextView final_text86; private TextView final_text87; private TextView final_text88; private TextView final_text89; ImageView imageView; ImageView imageView1; InterstitialAd mInterstitialAd; ImageButton mNewGameButton; //endregion /** * Called when the activity is first created. */ final String MY_SETTINGS = "saved_text_fun4"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fun4); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); imageView = (ImageView) findViewById(R.id.imageView23); Toolbar my_toolbar = (Toolbar)findViewById(R.id.my_toolbar); setSupportActionBar(my_toolbar); //getSupportActionBar().setTitle(R.string.my_tb_title); SharedPreferences sp = getSharedPreferences(MY_SETTINGS, Context.MODE_PRIVATE); // проверяем, первый ли раз открывается программа boolean hasVisited = sp.getBoolean("hasVisited4", false); if (!hasVisited) { LayoutInflater li = LayoutInflater.from(context2); View promptsView = li.inflate(R.layout.prompt2, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final TextView bill1 = (TextView) findViewById(R.id.button10); final TextView bill2 = (TextView) findViewById(R.id.button2); final TextView bill3 = (TextView) findViewById(R.id.button); final TextView bill4 = (TextView) findViewById(R.id.button3); final TextView bill5 = (TextView) findViewById(R.id.button5); final TextView bill6 = (TextView) findViewById(R.id.button6); final TextView bill7 = (TextView) findViewById(R.id.button7); final TextView bill8 = (TextView) findViewById(R.id.button38); final TextView bill9 = (TextView) findViewById(R.id.button40); final TextView bill10 = (TextView) findViewById(R.id.button39); final TextView bill11 = (TextView) findViewById(R.id.button8); final TextView bill23 = (TextView) findViewById(R.id.button97); final TextView bill24 = (TextView) findViewById(R.id.button98); final TextView bill25 = (TextView) findViewById(R.id.button99); final TextView bill26 = (TextView) findViewById(R.id.button100); final TextView bill27 = (TextView) findViewById(R.id.button101); final TextView bill28 = (TextView) findViewById(R.id.button102); final TextView bill29 = (TextView) findViewById(R.id.button103); final TextView bill30 = (TextView) findViewById(R.id.button104); final TextView bill31 = (TextView) findViewById(R.id.button105); final TextView bill32 = (TextView) findViewById(R.id.button11); final TextView bill33 = (TextView) findViewById(R.id.button12); final TextView bill34 = (TextView) findViewById(R.id.button52); final TextView bill35 = (TextView) findViewById(R.id.button53); final TextView bill36 = (TextView) findViewById(R.id.button54); final TextView bill37 = (TextView) findViewById(R.id.button55); final TextView bill38 = (TextView) findViewById(R.id.button59); final TextView bill39 = (TextView) findViewById(R.id.button60); final TextView bill40 = (TextView) findViewById(R.id.button61); final TextView bill41 = (TextView) findViewById(R.id.button62); final TextView bill42 = (TextView) findViewById(R.id.button63); final TextView bill43 = (TextView) findViewById(R.id.button64); final TextView bill44 = (TextView) findViewById(R.id.button65); final TextView bill45 = (TextView) findViewById(R.id.button66); final TextView bill46 = (TextView) findViewById(R.id.button70); final TextView bill47 = (TextView) findViewById(R.id.button71); final TextView bill48 = (TextView) findViewById(R.id.button72); final TextView bill49 = (TextView) findViewById(R.id.button73); final TextView bill50 = (TextView) findViewById(R.id.button74); final TextView bill51 = (TextView) findViewById(R.id.button75); final TextView bill52 = (TextView) findViewById(R.id.button15); final TextView bill53 = (TextView) findViewById(R.id.button16); final TextView bill54 = (TextView) findViewById(R.id.button17); final TextView bill55 = (TextView) findViewById(R.id.button18); final TextView bill56 = (TextView) findViewById(R.id.button21); final TextView bill57 = (TextView) findViewById(R.id.button22); final TextView bill58 = (TextView) findViewById(R.id.button23); final TextView bill59 = (TextView) findViewById(R.id.button24); final TextView bill60 = (TextView) findViewById(R.id.button27); final TextView bill61 = (TextView) findViewById(R.id.button28); final TextView bill62 = (TextView) findViewById(R.id.button29); final TextView bill63 = (TextView) findViewById(R.id.button30); final TextView bill64 = (TextView) findViewById(R.id.button31); final TextView bill65 = (TextView) findViewById(R.id.button32); final TextView bill66 = (TextView) findViewById(R.id.button19); final TextView bill67 = (TextView) findViewById(R.id.button20); final TextView bill68 = (TextView) findViewById(R.id.button25); final TextView bill69 = (TextView) findViewById(R.id.button41); final TextView bill70 = (TextView) findViewById(R.id.button42); final TextView bill71 = (TextView) findViewById(R.id.button43); final TextView bill72 = (TextView) findViewById(R.id.button44); final TextView bill73 = (TextView) findViewById(R.id.button45); final TextView bill74 = (TextView) findViewById(R.id.button46); final TextView bill79 = (TextView) findViewById(R.id.button26); final TextView bill80 = (TextView) findViewById(R.id.button33); final TextView bill81 = (TextView) findViewById(R.id.button34); final TextView bill82 = (TextView) findViewById(R.id.button35); final TextView bill83 = (TextView) findViewById(R.id.textView14); final TextView bill84 = (TextView) findViewById(R.id.textView20); final TextView bill85 = (TextView) findViewById(R.id.textView43); final TextView bill86 = (TextView) findViewById(R.id.textView24); final TextView bill87 = (TextView) findViewById(R.id.textView39); final TextView bill88 = (TextView) findViewById(R.id.textView37); final TextView bill89 = (TextView) findViewById(R.id.textView28); etText83 = (TextView) findViewById(R.id.textView14); etText84 = (TextView) findViewById(R.id.textView20); etText85 = (TextView) findViewById(R.id.textView43); etText86 = (TextView) findViewById(R.id.textView24); etText87 = (TextView) findViewById(R.id.textView39); etText88 = (TextView) findViewById(R.id.textView37); etText89 = (TextView) findViewById(R.id.textView28); //final TextView bill75 = (TextView) findViewById(R.id.button36); //final TextView bill76 = (TextView) findViewById(R.id.button37); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int id) { bill1.setText(0 + ""); bill2.setText(4 + ""); bill3.setText(5 + ""); bill4.setText(6 + ""); bill5.setText(7 + ""); bill6.setText(8 + ""); bill7.setText(9 + ""); bill8.setText(10 + ""); bill9.setText(11 + ""); bill10.setText(12 + ""); bill11.setText(13 + ""); ////////// bill23.setText(0 + ""); bill24.setText(4 + ""); bill25.setText(5 + ""); bill26.setText(6 + ""); bill27.setText(7 + ""); bill28.setText(8 + ""); bill29.setText(9 + ""); bill30.setText(10 + ""); bill31.setText(11 + ""); bill32.setText(12 + ""); bill33.setText(13 + ""); bill34.setText(0 + ""); bill35.setText(25 + ""); bill36.setText(40 + ""); bill37.setText(50 + ""); bill38.setText(75 + ""); bill39.setText(100 + ""); bill40.setText(0 + ""); bill41.setText(60 + ""); bill42.setText(70 + ""); bill43.setText(80 + ""); bill44.setText(90 + ""); bill45.setText(100 + ""); bill46.setText(0 + ""); bill47.setText(400 + ""); bill48.setText(500 + ""); bill49.setText(550 + ""); bill50.setText(600 + ""); bill51.setText(700 + ""); bill52.setText(10 + ""); bill53.setText(12 + ""); bill54.setText(14 + ""); bill55.setText(16 + ""); bill56.setText(8 + ""); bill57.setText(10 + ""); bill58.setText(12 + ""); bill59.setText(14 + ""); bill60.setText(15 + ""); bill61.setText(20 + ""); bill62.setText(25 + ""); bill63.setText(30 + ""); bill64.setText(40 + ""); bill65.setText(50 + ""); bill66.setText(8 + ""); bill67.setText(10 + ""); bill68.setText(15 + ""); bill69.setText(2 + ""); bill70.setText(4 + ""); bill71.setText(6 + ""); bill72.setText(8 + ""); bill73.setText(18 + ""); bill74.setText(20 + ""); bill79.setText(2 + ""); bill80.setText(5 + ""); bill81.setText(10 + ""); bill82.setText(15 + ""); bill83.setText(00.00 + ""); bill84.setText(00.00 + ""); bill85.setText(00.00 + ""); bill86.setText(00.00 + ""); bill87.setText(00.00 + ""); bill88.setText(00.00 + ""); bill89.setText(00.00 + ""); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); long mills = 70L; Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(mills); // выводим нужную активность // напр. //Intent intent = new Intent(this, Main2Activity.class); // startActivity(intent); SharedPreferences.Editor e = sp.edit(); e.putBoolean("hasVisited4", true); e.commit(); // не забудьте подтвердить изменения } etText = (Button) findViewById(R.id.button10); etText2 = (Button) findViewById(R.id.button2); etText3 = (Button) findViewById(R.id.button); etText4 = (Button) findViewById(R.id.button3); etText5 = (Button) findViewById(R.id.button5); etText6 = (Button) findViewById(R.id.button6); etText7 = (Button) findViewById(R.id.button7); etText8 = (Button) findViewById(R.id.button38); etText9 = (Button) findViewById(R.id.button40); etText10 = (Button) findViewById(R.id.button39); etText11 = (Button) findViewById(R.id.button8); etText23 = (Button) findViewById(R.id.button97); etText24 = (Button) findViewById(R.id.button98); etText25 = (Button) findViewById(R.id.button99); etText26 = (Button) findViewById(R.id.button100); etText27 = (Button) findViewById(R.id.button101); etText28 = (Button) findViewById(R.id.button102); etText29 = (Button) findViewById(R.id.button103); etText30 = (Button) findViewById(R.id.button104); etText31 = (Button) findViewById(R.id.button105); etText32 = (Button) findViewById(R.id.button11); etText33 = (Button) findViewById(R.id.button12); etText34 = (Button) findViewById(R.id.button52); etText35 = (Button) findViewById(R.id.button53); etText36 = (Button) findViewById(R.id.button54); etText37 = (Button) findViewById(R.id.button55); etText38 = (Button) findViewById(R.id.button59); etText39 = (Button) findViewById(R.id.button60); etText40 = (Button) findViewById(R.id.button61); etText41 = (Button) findViewById(R.id.button62); etText42 = (Button) findViewById(R.id.button63); etText43 = (Button) findViewById(R.id.button64); etText44 = (Button) findViewById(R.id.button65); etText45 = (Button) findViewById(R.id.button66); etText46 = (Button) findViewById(R.id.button70); etText47 = (Button) findViewById(R.id.button71); etText48 = (Button) findViewById(R.id.button72); etText49 = (Button) findViewById(R.id.button73); etText50 = (Button) findViewById(R.id.button74); etText51 = (Button) findViewById(R.id.button75); etText52 = (Button) findViewById(R.id.button15); etText53 = (Button) findViewById(R.id.button16); etText54 = (Button) findViewById(R.id.button17); etText55 = (Button) findViewById(R.id.button18); etText56 = (Button) findViewById(R.id.button21); etText57 = (Button) findViewById(R.id.button22); etText58 = (Button) findViewById(R.id.button23); etText59 = (Button) findViewById(R.id.button24); etText60 = (Button) findViewById(R.id.button27); etText61 = (Button) findViewById(R.id.button28); etText62 = (Button) findViewById(R.id.button29); etText63 = (Button) findViewById(R.id.button30); etText64 = (Button) findViewById(R.id.button31); etText65 = (Button) findViewById(R.id.button32); etText66 = (Button) findViewById(R.id.button19); etText67 = (Button) findViewById(R.id.button20); etText68 = (Button) findViewById(R.id.button25); etText69 = (Button) findViewById(R.id.button41); etText70 = (Button) findViewById(R.id.button42); etText71 = (Button) findViewById(R.id.button43); etText72 = (Button) findViewById(R.id.button44); etText73 = (Button) findViewById(R.id.button45); etText74 = (Button) findViewById(R.id.button46); etText77 = (Button) findViewById(R.id.button36); etText78 = (Button) findViewById(R.id.button37); etText79 = (Button) findViewById(R.id.button26); etText80 = (Button) findViewById(R.id.button33); etText81 = (Button) findViewById(R.id.button34); etText82 = (Button) findViewById(R.id.button35); etText83 = (TextView) findViewById(R.id.textView14); etText84 = (TextView) findViewById(R.id.textView20); etText85 = (TextView) findViewById(R.id.textView43); etText86 = (TextView) findViewById(R.id.textView24); etText87 = (TextView) findViewById(R.id.textView39); etText88 = (TextView) findViewById(R.id.textView37); etText89 = (TextView) findViewById(R.id.textView28); loadText(); loadText2(); loadText3(); loadText4(); loadText5(); loadText6(); loadText7(); loadText8(); loadText9(); loadText10(); loadText11(); loadText23(); loadText24(); loadText25(); loadText26(); loadText27(); loadText28(); loadText29(); loadText30(); loadText31(); loadText32(); loadText33(); loadText34(); loadText35(); loadText36(); loadText37(); loadText38(); loadText39(); loadText40(); loadText41(); loadText42(); loadText43(); loadText44(); loadText45(); loadText46(); loadText47(); loadText48(); loadText49(); loadText50(); loadText51(); loadText52(); loadText53(); loadText54(); loadText55(); loadText56(); loadText57(); loadText58(); loadText59(); loadText60(); loadText61(); loadText62(); loadText63(); loadText64(); loadText65(); loadText66(); loadText67(); loadText68(); loadText69(); loadText70(); loadText71(); loadText72(); loadText73(); loadText74(); loadText79(); loadText80(); loadText81(); loadText82(); loadText83(); loadText84(); loadText85(); loadText86(); loadText87(); loadText88(); loadText89(); //Ряды кнопок (по Алерт Диалогу) //region секция 1 (button101 = (Button) findViewById(R.id.button10);) button101 = (Button) findViewById(R.id.button10); final_text = (TextView) findViewById(R.id.button10); button101.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button102 = (Button) findViewById(R.id.button2); final_text2 = (TextView) findViewById(R.id.button2); button102.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text2.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button103 = (Button) findViewById(R.id.button); final_text3 = (TextView) findViewById(R.id.button); button103.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text3.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button104 = (Button) findViewById(R.id.button3); final_text4 = (TextView) findViewById(R.id.button3); button104.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text4.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button105 = (Button) findViewById(R.id.button5); final_text5 = (TextView) findViewById(R.id.button5); button105.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text5.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button106 = (Button) findViewById(R.id.button6); final_text6 = (TextView) findViewById(R.id.button6); button106.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text6.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button107 = (Button) findViewById(R.id.button7); final_text7 = (TextView) findViewById(R.id.button7); button107.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text7.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button108 = (Button) findViewById(R.id.button38); final_text8 = (TextView) findViewById(R.id.button38); button108.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text8.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button109 = (Button) findViewById(R.id.button40); final_text9 = (TextView) findViewById(R.id.button40); button109.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text9.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button110 = (Button) findViewById(R.id.button39); final_text10 = (TextView) findViewById(R.id.button39); button110.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text10.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); button111 = (Button) findViewById(R.id.button8); final_text11 = (TextView) findViewById(R.id.button8); button111.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text11.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //region секция 3 button123 = (Button) findViewById(R.id.button97); final_text23 = (TextView) findViewById(R.id.button97); button123.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text23.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button124 = (Button) findViewById(R.id.button98); final_text24 = (TextView) findViewById(R.id.button98); button124.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text24.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button125 = (Button) findViewById(R.id.button99); final_text25 = (TextView) findViewById(R.id.button99); button125.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text25.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button126 = (Button) findViewById(R.id.button100); final_text26 = (TextView) findViewById(R.id.button100); button126.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text26.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button127 = (Button) findViewById(R.id.button101); final_text27 = (TextView) findViewById(R.id.button101); button127.setOnLongClickListener(new View.OnLongClickListener() { //region button127 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text27.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button128 = (Button) findViewById(R.id.button102); final_text28 = (TextView) findViewById(R.id.button102); button128.setOnLongClickListener(new View.OnLongClickListener() { //region button128 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text28.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button129 = (Button) findViewById(R.id.button103); final_text29 = (TextView) findViewById(R.id.button103); button129.setOnLongClickListener(new View.OnLongClickListener() { //region button129 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text29.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button130 = (Button) findViewById(R.id.button104); final_text30 = (TextView) findViewById(R.id.button104); button130.setOnLongClickListener(new View.OnLongClickListener() { //region button130 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text30.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button131 = (Button) findViewById(R.id.button105); final_text31 = (TextView) findViewById(R.id.button105); button131.setOnLongClickListener(new View.OnLongClickListener() { //region button131 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) {dialog.cancel(); }else { final_text31.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button132 = (Button) findViewById(R.id.button11); final_text32 = (TextView) findViewById(R.id.button11); button132.setOnLongClickListener(new View.OnLongClickListener() { //region button132 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text32.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button133 = (Button) findViewById(R.id.button12); final_text33 = (TextView) findViewById(R.id.button12); button133.setOnLongClickListener(new View.OnLongClickListener() { //region button133 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text33.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion //region секция 4 button134 = (Button) findViewById(R.id.button52); final_text34 = (TextView) findViewById(R.id.button52); button134.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text34.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button135 = (Button) findViewById(R.id.button53); final_text35 = (TextView) findViewById(R.id.button53); button135.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text35.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button136 = (Button) findViewById(R.id.button54); final_text36 = (TextView) findViewById(R.id.button54); button136.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text36.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button137 = (Button) findViewById(R.id.button55); final_text37 = (TextView) findViewById(R.id.button55); button137.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text37.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button138 = (Button) findViewById(R.id.button59); final_text38 = (TextView) findViewById(R.id.button59); button138.setOnLongClickListener(new View.OnLongClickListener() { //region button127 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text38.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button139 = (Button) findViewById(R.id.button60); final_text39 = (TextView) findViewById(R.id.button60); button139.setOnLongClickListener(new View.OnLongClickListener() { //region button128 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text39.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion //region секция 5 button140 = (Button) findViewById(R.id.button61); final_text40 = (TextView) findViewById(R.id.button61); button140.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) {dialog.cancel(); }else { final_text40.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button141 = (Button) findViewById(R.id.button62); final_text41 = (TextView) findViewById(R.id.button62); button141.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text41.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button142 = (Button) findViewById(R.id.button63); final_text42 = (TextView) findViewById(R.id.button63); button142.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text42.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button143 = (Button) findViewById(R.id.button64); final_text43 = (TextView) findViewById(R.id.button64); button143.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text43.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button144 = (Button) findViewById(R.id.button65); final_text44 = (TextView) findViewById(R.id.button65); button144.setOnLongClickListener(new View.OnLongClickListener() { //region button127 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text44.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button145 = (Button) findViewById(R.id.button66); final_text45 = (TextView) findViewById(R.id.button66); button145.setOnLongClickListener(new View.OnLongClickListener() { //region button128 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text45.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion //region секция 6 button146 = (Button) findViewById(R.id.button70); final_text46 = (TextView) findViewById(R.id.button70); button146.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text46.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button147 = (Button) findViewById(R.id.button71); final_text47 = (TextView) findViewById(R.id.button71); button147.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text47.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button148 = (Button) findViewById(R.id.button72); final_text48 = (TextView) findViewById(R.id.button72); button148.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text48.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button149 = (Button) findViewById(R.id.button73); final_text49 = (TextView) findViewById(R.id.button73); button149.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text49.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button150 = (Button) findViewById(R.id.button74); final_text50 = (TextView) findViewById(R.id.button74); button150.setOnLongClickListener(new View.OnLongClickListener() { //region button127 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text50.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button151 = (Button) findViewById(R.id.button75); final_text51 = (TextView) findViewById(R.id.button75); button151.setOnLongClickListener(new View.OnLongClickListener() { //region button128 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text51.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion //region секция 7 button152 = (Button) findViewById(R.id.button15); final_text52 = (TextView) findViewById(R.id.button15); button152.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button153 = (Button) findViewById(R.id.button16); final_text53 = (TextView) findViewById(R.id.button16); button153.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button154 = (Button) findViewById(R.id.button17); final_text54 = (TextView) findViewById(R.id.button17); button154.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button155 = (Button) findViewById(R.id.button18); final_text55 = (TextView) findViewById(R.id.button18); button155.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion //region секция 8 button158 = (Button) findViewById(R.id.button23); final_text58 = (TextView) findViewById(R.id.button23); button158.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button159 = (Button) findViewById(R.id.button24); final_text59 = (TextView) findViewById(R.id.button24); button159.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button160 = (Button) findViewById(R.id.button27); final_text60 = (TextView) findViewById(R.id.button27); button160.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt4, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text60.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button161 = (Button) findViewById(R.id.button28); final_text61 = (TextView) findViewById(R.id.button28); button161.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt4, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text61.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button162 = (Button) findViewById(R.id.button29); final_text62 = (TextView) findViewById(R.id.button29); button162.setOnLongClickListener(new View.OnLongClickListener() { //region button127 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt4, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text62.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button163 = (Button) findViewById(R.id.button30); final_text63 = (TextView) findViewById(R.id.button30); button163.setOnLongClickListener(new View.OnLongClickListener() { //region button128 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt4, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text63.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion //region секция 9 button164 = (Button) findViewById(R.id.button31); final_text64 = (TextView) findViewById(R.id.button31); button164.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt4, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text64.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button165 = (Button) findViewById(R.id.button32); final_text65 = (TextView) findViewById(R.id.button32); button165.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt4, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text65.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button166 = (Button) findViewById(R.id.button19); final_text66 = (TextView) findViewById(R.id.button19); button166.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text66.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button167 = (Button) findViewById(R.id.button20); final_text67 = (TextView) findViewById(R.id.button20); button167.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text67.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button168 = (Button) findViewById(R.id.button25); final_text68 = (TextView) findViewById(R.id.button25); button168.setOnLongClickListener(new View.OnLongClickListener() { //region button127 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt3, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text68.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion //region секция 10 button169 = (Button) findViewById(R.id.button41); final_text69 = (TextView) findViewById(R.id.button41); button169.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt6, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button170 = (Button) findViewById(R.id.button42); final_text70 = (TextView) findViewById(R.id.button42); button170.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt6, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button171 = (Button) findViewById(R.id.button43); final_text71 = (TextView) findViewById(R.id.button43); button171.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt6, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button172 = (Button) findViewById(R.id.button44); final_text72 = (TextView) findViewById(R.id.button44); button172.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt6, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button173 = (Button) findViewById(R.id.button45); final_text73 = (TextView) findViewById(R.id.button45); button173.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button174 = (Button) findViewById(R.id.button46); final_text74 = (TextView) findViewById(R.id.button46); button174.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion button175 = (Button) findViewById(R.id.button21); final_text75 = (TextView) findViewById(R.id.button21); button175.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button176 = (Button) findViewById(R.id.button22); final_text76 = (TextView) findViewById(R.id.button22); button176.setOnLongClickListener(new View.OnLongClickListener() { //region button126 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt5, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button177 = (Button) findViewById(R.id.button36); final_text77 = (TextView) findViewById(R.id.button36); button177.setOnLongClickListener(new View.OnLongClickListener() { //region button123 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt6, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button178 = (Button) findViewById(R.id.button37); final_text78 = (TextView) findViewById(R.id.button37); button178.setOnLongClickListener(new View.OnLongClickListener() { //region button124 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt6, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion imageView1 = (ImageView) findViewById(R.id.imageView24); imageView1.setOnClickListener(new View.OnClickListener() { //region button124 @Override public void onClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt7, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); //final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return; } } ); //endregion //endregion //region секция 12 button 26. 33. 34. 35 button179 = (Button) findViewById(R.id.button26); final_text79 = (TextView) findViewById(R.id.button26); button179.setOnLongClickListener(new View.OnLongClickListener() { //region button112 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text79.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button180 = (Button) findViewById(R.id.button33); final_text80 = (TextView) findViewById(R.id.button33); button180.setOnLongClickListener(new View.OnLongClickListener() { //region button113 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text80.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button181 = (Button) findViewById(R.id.button34); final_text81 = (TextView) findViewById(R.id.button34); button181.setOnLongClickListener(new View.OnLongClickListener() { //region button114 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text81.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion button182 = (Button) findViewById(R.id.button35); final_text82 = (TextView) findViewById(R.id.button35); button182.setOnLongClickListener(new View.OnLongClickListener() { //region button113 @Override public boolean onLongClick(View arg0) { LayoutInflater li = LayoutInflater.from(context2); final View promptsView = li.inflate(R.layout.prompt, null); AlertDialog.Builder mDialogBuilder = new AlertDialog.Builder(context2); mDialogBuilder.setView(promptsView); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); mDialogBuilder .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //final EditText etNum55 = (EditText) findViewById(R.id.editText2); final EditText userInput = (EditText) promptsView.findViewById(R.id.editText2); if (userInput.getText().length() == 0) { dialog.cancel(); }else { final_text15.setText(userInput.getText()); }} }) .setNegativeButton("Отмена", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = mDialogBuilder.create(); alertDialog.show(); return false; } } ); //endregion //endregion //region секция - для копирования //endregion - для копирования //region секция btn1-btn11 btn1 = (Button) findViewById(R.id.button10); btn2 = (Button) findViewById(R.id.button2); btn3 = (Button) findViewById(R.id.button); btn4 = (Button) findViewById(R.id.button3); btn5 = (Button) findViewById(R.id.button5); btn6 = (Button) findViewById(R.id.button6); btn7 = (Button) findViewById(R.id.button7); btn8 = (Button) findViewById(R.id.button38); btn9 = (Button) findViewById(R.id.button40); btn10 = (Button) findViewById(R.id.button39); btn11 = (Button) findViewById(R.id.button8); //endregion //region секция btn23-btn33 btn23 = (Button) findViewById(R.id.button97); btn24 = (Button) findViewById(R.id.button98); btn25 = (Button) findViewById(R.id.button99); btn26 = (Button) findViewById(R.id.button100); btn27 = (Button) findViewById(R.id.button101); btn28 = (Button) findViewById(R.id.button102); btn29 = (Button) findViewById(R.id.button103); btn30 = (Button) findViewById(R.id.button104); btn31 = (Button) findViewById(R.id.button105); btn32 = (Button) findViewById(R.id.button11); btn33 = (Button) findViewById(R.id.button12); //endregion //region секция btn34-btn51 btn34 = (Button) findViewById(R.id.button52); btn35 = (Button) findViewById(R.id.button53); btn36 = (Button) findViewById(R.id.button54); btn37 = (Button) findViewById(R.id.button55); btn38 = (Button) findViewById(R.id.button59); btn39 = (Button) findViewById(R.id.button60); btn40 = (Button) findViewById(R.id.button61); btn41 = (Button) findViewById(R.id.button62); btn42 = (Button) findViewById(R.id.button63); btn43 = (Button) findViewById(R.id.button64); btn44 = (Button) findViewById(R.id.button65); btn45 = (Button) findViewById(R.id.button66); btn46 = (Button) findViewById(R.id.button70); btn47 = (Button) findViewById(R.id.button71); btn48 = (Button) findViewById(R.id.button72); btn49 = (Button) findViewById(R.id.button73); btn50 = (Button) findViewById(R.id.button74); btn51 = (Button) findViewById(R.id.button75); //endregion //region секция btn52-btn82 btn52 = (Button) findViewById(R.id.button15); btn53 = (Button) findViewById(R.id.button16); btn54 = (Button) findViewById(R.id.button17); btn55 = (Button) findViewById(R.id.button18); btn56 = (Button) findViewById(R.id.button21); btn57 = (Button) findViewById(R.id.button22); btn58 = (Button) findViewById(R.id.button23); btn59 = (Button) findViewById(R.id.button24); btn60 = (Button) findViewById(R.id.button27); btn61 = (Button) findViewById(R.id.button28); btn62 = (Button) findViewById(R.id.button29); btn63 = (Button) findViewById(R.id.button30); btn64 = (Button) findViewById(R.id.button31); btn65 = (Button) findViewById(R.id.button32); btn66 = (Button) findViewById(R.id.button19); btn67 = (Button) findViewById(R.id.button20); btn68 = (Button) findViewById(R.id.button25); btn69 = (Button) findViewById(R.id.button41); btn70 = (Button) findViewById(R.id.button42); btn71 = (Button) findViewById(R.id.button43); btn72 = (Button) findViewById(R.id.button44); btn73 = (Button) findViewById(R.id.button45); btn74 = (Button) findViewById(R.id.button46); btn77 = (Button) findViewById(R.id.button36); btn78 = (Button) findViewById(R.id.button37); btn79 = (Button) findViewById(R.id.button26); btn80 = (Button) findViewById(R.id.button33); btn81 = (Button) findViewById(R.id.button34); btn82 = (Button) findViewById(R.id.button35); //endregion //region секция wir_1-wir_10 wir_1 = (TextView) findViewById(R.id.textViewWir); // wir_2 = (TextView) findViewById(R.id.textViewWir2); wir_3 = (TextView) findViewById(R.id.textViewWir3); wir_4 = (TextView) findViewById(R.id.textViewWir4); wir_5 = (TextView) findViewById(R.id.textViewWir5); wir_6 = (TextView) findViewById(R.id.textViewWir6); wir_7 = (TextView) findViewById(R.id.textViewWir7); wir_8 = (TextView) findViewById(R.id.textViewWir8); wir_9 = (TextView) findViewById(R.id.textViewWir9); wir_10 = (TextView) findViewById(R.id.textViewWir10); wir_11 = (TextView) findViewById(R.id.textViewWir11); wir_12 = (TextView) findViewById(R.id.textViewWir12); //endregion View.OnClickListener btnClk = new View.OnClickListener() { @Override public void onClick(View v) { long mills = 50L; Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(mills); final TextView bill = (TextView) findViewById(R.id.button8); if (bill.getText().length() == 0) { Toast toast = Toast.makeText(getApplicationContext(), "Заполнение пустых ячеек", Toast.LENGTH_LONG); toast.show(); final TextView bill1 = (TextView) findViewById(R.id.button10); final TextView bill2 = (TextView) findViewById(R.id.button2); final TextView bill3 = (TextView) findViewById(R.id.button); final TextView bill4 = (TextView) findViewById(R.id.button3); final TextView bill5 = (TextView) findViewById(R.id.button5); final TextView bill6 = (TextView) findViewById(R.id.button6); final TextView bill7 = (TextView) findViewById(R.id.button7); final TextView bill8 = (TextView) findViewById(R.id.button38); final TextView bill9 = (TextView) findViewById(R.id.button40); final TextView bill10 = (TextView) findViewById(R.id.button39); final TextView bill11 = (TextView) findViewById(R.id.button8); final TextView bill23 = (TextView) findViewById(R.id.button97); final TextView bill24 = (TextView) findViewById(R.id.button98); final TextView bill25 = (TextView) findViewById(R.id.button99); final TextView bill26 = (TextView) findViewById(R.id.button100); final TextView bill27 = (TextView) findViewById(R.id.button101); final TextView bill28 = (TextView) findViewById(R.id.button102); final TextView bill29 = (TextView) findViewById(R.id.button103); final TextView bill30 = (TextView) findViewById(R.id.button104); final TextView bill31 = (TextView) findViewById(R.id.button105); final TextView bill32 = (TextView) findViewById(R.id.button11); final TextView bill33 = (TextView) findViewById(R.id.button12); final TextView bill34 = (TextView) findViewById(R.id.button52); final TextView bill35 = (TextView) findViewById(R.id.button53); final TextView bill36 = (TextView) findViewById(R.id.button54); final TextView bill37 = (TextView) findViewById(R.id.button55); final TextView bill38 = (TextView) findViewById(R.id.button59); final TextView bill39 = (TextView) findViewById(R.id.button60); final TextView bill40 = (TextView) findViewById(R.id.button61); final TextView bill41 = (TextView) findViewById(R.id.button62); final TextView bill42 = (TextView) findViewById(R.id.button63); final TextView bill43 = (TextView) findViewById(R.id.button64); final TextView bill44 = (TextView) findViewById(R.id.button65); final TextView bill45 = (TextView) findViewById(R.id.button66); final TextView bill46 = (TextView) findViewById(R.id.button70); final TextView bill47 = (TextView) findViewById(R.id.button71); final TextView bill48 = (TextView) findViewById(R.id.button72); final TextView bill49 = (TextView) findViewById(R.id.button73); final TextView bill50 = (TextView) findViewById(R.id.button74); final TextView bill51 = (TextView) findViewById(R.id.button75); final TextView bill52 = (TextView) findViewById(R.id.button15); final TextView bill53 = (TextView) findViewById(R.id.button16); final TextView bill54 = (TextView) findViewById(R.id.button17); final TextView bill55 = (TextView) findViewById(R.id.button18); final TextView bill56 = (TextView) findViewById(R.id.button21); final TextView bill57 = (TextView) findViewById(R.id.button22); final TextView bill58 = (TextView) findViewById(R.id.button23); final TextView bill59 = (TextView) findViewById(R.id.button24); final TextView bill60 = (TextView) findViewById(R.id.button27); final TextView bill61 = (TextView) findViewById(R.id.button28); final TextView bill62 = (TextView) findViewById(R.id.button29); final TextView bill63 = (TextView) findViewById(R.id.button30); final TextView bill64 = (TextView) findViewById(R.id.button31); final TextView bill65 = (TextView) findViewById(R.id.button32); final TextView bill66 = (TextView) findViewById(R.id.button19); final TextView bill67 = (TextView) findViewById(R.id.button20); final TextView bill68 = (TextView) findViewById(R.id.button25); final TextView bill69 = (TextView) findViewById(R.id.button41); final TextView bill70 = (TextView) findViewById(R.id.button42); final TextView bill71 = (TextView) findViewById(R.id.button43); final TextView bill72 = (TextView) findViewById(R.id.button44); final TextView bill73 = (TextView) findViewById(R.id.button45); final TextView bill74 = (TextView) findViewById(R.id.button46); final TextView bill79 = (TextView) findViewById(R.id.button26); final TextView bill80 = (TextView) findViewById(R.id.button33); final TextView bill81 = (TextView) findViewById(R.id.button34); final TextView bill82 = (TextView) findViewById(R.id.button35); final TextView bill83 = (TextView) findViewById(R.id.textView14); final TextView bill84 = (TextView) findViewById(R.id.textView20); final TextView bill85 = (TextView) findViewById(R.id.textView43); final TextView bill86 = (TextView) findViewById(R.id.textView24); final TextView bill87 = (TextView) findViewById(R.id.textView39); final TextView bill88 = (TextView) findViewById(R.id.textView37); final TextView bill89 = (TextView) findViewById(R.id.textView28); etText83 = (TextView) findViewById(R.id.textView14); etText84 = (TextView) findViewById(R.id.textView20); etText85 = (TextView) findViewById(R.id.textView43); etText86 = (TextView) findViewById(R.id.textView24); etText87 = (TextView) findViewById(R.id.textView39); etText88 = (TextView) findViewById(R.id.textView37); etText89 = (TextView) findViewById(R.id.textView28); bill1.setText(0 + ""); bill2.setText(4 + ""); bill3.setText(5 + ""); bill4.setText(6 + ""); bill5.setText(7 + ""); bill6.setText(8 + ""); bill7.setText(9 + ""); bill8.setText(10 + ""); bill9.setText(11 + ""); bill10.setText(12 + ""); bill11.setText(13 + ""); ////////// bill23.setText(0 + ""); bill24.setText(4 + ""); bill25.setText(5 + ""); bill26.setText(6 + ""); bill27.setText(7 + ""); bill28.setText(8 + ""); bill29.setText(9 + ""); bill30.setText(10 + ""); bill31.setText(11 + ""); bill32.setText(12 + ""); bill33.setText(13 + ""); bill34.setText(0 + ""); bill35.setText(25 + ""); bill36.setText(40 + ""); bill37.setText(50 + ""); bill38.setText(75 + ""); bill39.setText(100 + ""); bill40.setText(0 + ""); bill41.setText(60 + ""); bill42.setText(70 + ""); bill43.setText(80 + ""); bill44.setText(90 + ""); bill45.setText(100 + ""); bill46.setText(0 + ""); bill47.setText(400 + ""); bill48.setText(500 + ""); bill49.setText(550 + ""); bill50.setText(600 + ""); bill51.setText(700 + ""); bill52.setText(10 + ""); bill53.setText(12 + ""); bill54.setText(14 + ""); bill55.setText(16 + ""); bill56.setText(8 + ""); bill57.setText(10 + ""); bill58.setText(12 + ""); bill59.setText(14 + ""); bill60.setText(15 + ""); bill61.setText(20 + ""); bill62.setText(25 + ""); bill63.setText(30 + ""); bill64.setText(40 + ""); bill65.setText(50 + ""); bill66.setText(8 + ""); bill67.setText(10 + ""); bill68.setText(15 + ""); bill69.setText(2 + ""); bill70.setText(4 + ""); bill71.setText(6 + ""); bill72.setText(8 + ""); bill73.setText(18 + ""); bill74.setText(20 + ""); bill79.setText(2 + ""); bill80.setText(5 + ""); bill81.setText(10 + ""); bill82.setText(15 + ""); bill83.setText(00.00 + ""); bill84.setText(00.00 + ""); bill85.setText(00.00 + ""); bill86.setText(00.00 + ""); bill87.setText(00.00 + ""); bill88.setText(00.00 + ""); bill89.setText(00.00 + ""); }else { switch (v.getId()) { //region секция 1.1 (case R.id.button10:) case R.id.button10: TextView textView001 = (TextView) findViewById(R.id.textViewWir); aetText1 = (Button) findViewById(R.id.button10); float num001 = Float.parseFloat(aetText1.getText().toString()); float w = (float) num001; textView001.setText(String.format(Locale.US, "%.2f", w) + ""); //Animation anim1 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button1 = (Button) findViewById(R.id.button10); // button1.startAnimation(anim1); break; case R.id.button2: TextView textView002 = (TextView) findViewById(R.id.textViewWir); aetText2 = (Button) findViewById(R.id.button2); float num002 = Float.parseFloat(aetText2.getText().toString()); float w2 = (float) num002; textView002.setText(String.format(Locale.US, "%.2f", w2) + ""); // Animation anim2 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button2 = (Button) findViewById(R.id.button2); // button2.startAnimation(anim2); break; case R.id.button: TextView textView003 = (TextView) findViewById(R.id.textViewWir); aetText3 = (Button) findViewById(R.id.button); float num003 = Float.parseFloat(aetText3.getText().toString()); float w3 = (float) num003; textView003.setText(String.format(Locale.US, "%.2f", w3) + ""); // Animation anim3 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button3 = (Button) findViewById(R.id.button); // button3.startAnimation(anim3); break; case R.id.button3: TextView textView004 = (TextView) findViewById(R.id.textViewWir); aetText4 = (Button) findViewById(R.id.button3); float num004 = Float.parseFloat(aetText4.getText().toString()); float w4 = (float) num004; textView004.setText(String.format(Locale.US, "%.2f", w4) + ""); // Animation anim4 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button4 = (Button) findViewById(R.id.button3); // button4.startAnimation(anim4); break; case R.id.button5: TextView textView005 = (TextView) findViewById(R.id.textViewWir); aetText5 = (Button) findViewById(R.id.button5); float num005 = Float.parseFloat(aetText5.getText().toString()); float w5 = (float) num005; textView005.setText(String.format(Locale.US, "%.2f", w5) + ""); // Animation anim5 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button5 = (Button) findViewById(R.id.button5); // button5.startAnimation(anim5); break; case R.id.button6: TextView textView006 = (TextView) findViewById(R.id.textViewWir); aetText6 = (Button) findViewById(R.id.button6); float num006 = Float.parseFloat(aetText6.getText().toString()); float w6 = (float) num006; textView006.setText(String.format(Locale.US, "%.2f", w6) + ""); // Animation anim6 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button6 = (Button) findViewById(R.id.button6); // button6.startAnimation(anim6); break; case R.id.button7: TextView textView007 = (TextView) findViewById(R.id.textViewWir); aetText7 = (Button) findViewById(R.id.button7); float num007 = Float.parseFloat(aetText7.getText().toString()); float w7 = (float) num007; textView007.setText(String.format(Locale.US, "%.2f", w7) + ""); //Animation anim7 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button7 = (Button) findViewById(R.id.button7); // button7.startAnimation(anim7); break; case R.id.button38: TextView textView008 = (TextView) findViewById(R.id.textViewWir); aetText8 = (Button) findViewById(R.id.button38); float num008 = Float.parseFloat(aetText8.getText().toString()); float w8 = (float) num008; textView008.setText(String.format(Locale.US, "%.2f", w8) + ""); // Animation anim8 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button8 = (Button) findViewById(R.id.button38); // button8.startAnimation(anim8); break; case R.id.button40: TextView textView009 = (TextView) findViewById(R.id.textViewWir); aetText9 = (Button) findViewById(R.id.button40); float num009 = Float.parseFloat(aetText9.getText().toString()); float w9 = (float) num009; textView009.setText(String.format(Locale.US, "%.2f", w9) + ""); // Animation anim9 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button9 = (Button) findViewById(R.id.button40); // button9.startAnimation(anim9); break; case R.id.button39: TextView textView010 = (TextView) findViewById(R.id.textViewWir); aetText10 = (Button) findViewById(R.id.button39); float num010 = Float.parseFloat(aetText10.getText().toString()); float w10 = (float) num010; textView010.setText(String.format(Locale.US, "%.2f", w10) + ""); // Animation anim10 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button10 = (Button) findViewById(R.id.button39); // button10.startAnimation(anim10); break; case R.id.button8: TextView textView011 = (TextView) findViewById(R.id.textViewWir); aetText11 = (Button) findViewById(R.id.button8); float num011 = Float.parseFloat(aetText11.getText().toString()); float w11 = (float) num011; textView011.setText(String.format(Locale.US, "%.2f", w11) + ""); // Animation anim11 = AnimationUtils.loadAnimation( // getApplicationContext(), R.anim.sms_anim); // final Button button11 = (Button) findViewById(R.id.button8); // button11.startAnimation(anim11); break; //endregion //region секция 3.1 case R.id.button97: TextView textView023 = (TextView) findViewById(R.id.textViewWir3); aetText23 = (Button) findViewById(R.id.button97); float num023 = Float.parseFloat(aetText23.getText().toString()); float w23 = (float) num023; textView023.setText(String.format(Locale.US, "%.2f", w23) + ""); break; case R.id.button98: TextView textView024 = (TextView) findViewById(R.id.textViewWir3); aetText24 = (Button) findViewById(R.id.button98); float num024 = Float.parseFloat(aetText24.getText().toString()); float w24 = (float) num024; textView024.setText(String.format(Locale.US, "%.2f", w24) + ""); break; case R.id.button99: TextView textView025 = (TextView) findViewById(R.id.textViewWir3); aetText25 = (Button) findViewById(R.id.button99); float num025 = Float.parseFloat(aetText25.getText().toString()); float w25 = (float) num025; textView025.setText(String.format(Locale.US, "%.2f", w25) + ""); break; case R.id.button100: TextView textView026 = (TextView) findViewById(R.id.textViewWir3); aetText26 = (Button) findViewById(R.id.button100); float num026 = Float.parseFloat(aetText26.getText().toString()); float w26 = (float) num026; textView026.setText(String.format(Locale.US, "%.2f", w26) + ""); break; case R.id.button101: TextView textView027 = (TextView) findViewById(R.id.textViewWir3); aetText27 = (Button) findViewById(R.id.button101); float num027 = Float.parseFloat(aetText27.getText().toString()); float w27 = (float) num027; textView027.setText(String.format(Locale.US, "%.2f", w27) + ""); break; case R.id.button102: TextView textView028 = (TextView) findViewById(R.id.textViewWir3); aetText28 = (Button) findViewById(R.id.button102); float num028 = Float.parseFloat(aetText28.getText().toString()); float w28 = (float) num028; textView028.setText(String.format(Locale.US, "%.2f", w28) + ""); break; case R.id.button103: TextView textView029 = (TextView) findViewById(R.id.textViewWir3); aetText29 = (Button) findViewById(R.id.button103); float num029 = Float.parseFloat(aetText29.getText().toString()); float w29 = (float) num029; textView029.setText(String.format(Locale.US, "%.2f", w29) + ""); break; case R.id.button104: TextView textView030 = (TextView) findViewById(R.id.textViewWir3); aetText30 = (Button) findViewById(R.id.button104); float num030 = Float.parseFloat(aetText30.getText().toString()); float w30 = (float) num030; textView030.setText(String.format(Locale.US, "%.2f", w30) + ""); break; case R.id.button105: TextView textView031 = (TextView) findViewById(R.id.textViewWir3); aetText31 = (Button) findViewById(R.id.button105); float num031 = Float.parseFloat(aetText31.getText().toString()); float w31 = (float) num031; textView031.setText(String.format(Locale.US, "%.2f", w31) + ""); break; case R.id.button11: TextView textView032 = (TextView) findViewById(R.id.textViewWir3); aetText32 = (Button) findViewById(R.id.button11); float num032 = Float.parseFloat(aetText32.getText().toString()); float w32 = (float) num032; textView032.setText(String.format(Locale.US, "%.2f", w32) + ""); break; case R.id.button12: TextView textView033 = (TextView) findViewById(R.id.textViewWir3); aetText33 = (Button) findViewById(R.id.button12); float num033 = Float.parseFloat(aetText33.getText().toString()); float w33 = (float) num033; textView033.setText(String.format(Locale.US, "%.2f", w33) + ""); break; //endregion //region секция 4.1 case R.id.button52: TextView textView034 = (TextView) findViewById(R.id.textViewWir4); aetText34 = (Button) findViewById(R.id.button52); float num034 = Float.parseFloat(aetText34.getText().toString()); float w34 = (float) num034; textView034.setText(String.format(Locale.US, "%.2f", w34) + ""); break; case R.id.button53: TextView textView035 = (TextView) findViewById(R.id.textViewWir4); aetText35 = (Button) findViewById(R.id.button53); float num035 = Float.parseFloat(aetText35.getText().toString()); float w35 = (float) num035; textView035.setText(String.format(Locale.US, "%.2f", w35) + ""); break; case R.id.button54: TextView textView036 = (TextView) findViewById(R.id.textViewWir4); aetText36 = (Button) findViewById(R.id.button54); float num036 = Float.parseFloat(aetText36.getText().toString()); float w36 = (float) num036; textView036.setText(String.format(Locale.US, "%.2f", w36) + ""); break; case R.id.button55: TextView textView037 = (TextView) findViewById(R.id.textViewWir4); aetText37 = (Button) findViewById(R.id.button55); float num037 = Float.parseFloat(aetText37.getText().toString()); float w37 = (float) num037; textView037.setText(String.format(Locale.US, "%.2f", w37) + ""); break; case R.id.button59: TextView textView038 = (TextView) findViewById(R.id.textViewWir4); aetText38 = (Button) findViewById(R.id.button59); float num038 = Float.parseFloat(aetText38.getText().toString()); float w38 = (float) num038; textView038.setText(String.format(Locale.US, "%.2f", w38) + ""); break; case R.id.button60: TextView textView039 = (TextView) findViewById(R.id.textViewWir4); aetText39 = (Button) findViewById(R.id.button60); float num039 = Float.parseFloat(aetText39.getText().toString()); float w39 = (float) num039; textView039.setText(String.format(Locale.US, "%.2f", w39) + ""); break; //endregion //region секция 5.1 case R.id.button61: TextView textView040 = (TextView) findViewById(R.id.textViewWir5); aetText40 = (Button) findViewById(R.id.button61); float num040 = Float.parseFloat(aetText40.getText().toString()); float w40 = (float) num040; textView040.setText(String.format(Locale.US, "%.2f", w40) + ""); break; case R.id.button62: TextView textView041 = (TextView) findViewById(R.id.textViewWir5); aetText41 = (Button) findViewById(R.id.button62); float num041 = Float.parseFloat(aetText41.getText().toString()); float w41 = (float) num041; textView041.setText(String.format(Locale.US, "%.2f", w41) + ""); break; case R.id.button63: TextView textView042 = (TextView) findViewById(R.id.textViewWir5); aetText42 = (Button) findViewById(R.id.button63); float num042 = Float.parseFloat(aetText42.getText().toString()); float w42 = (float) num042; textView042.setText(String.format(Locale.US, "%.2f", w42) + ""); break; case R.id.button64: TextView textView043 = (TextView) findViewById(R.id.textViewWir5); aetText43 = (Button) findViewById(R.id.button64); float num043 = Float.parseFloat(aetText43.getText().toString()); float w43 = (float) num043; textView043.setText(String.format(Locale.US, "%.2f", w43) + ""); break; case R.id.button65: TextView textView044 = (TextView) findViewById(R.id.textViewWir5); aetText44 = (Button) findViewById(R.id.button65); float num044 = Float.parseFloat(aetText44.getText().toString()); float w44 = (float) num044; textView044.setText(String.format(Locale.US, "%.2f", w44) + ""); break; case R.id.button66: TextView textView045 = (TextView) findViewById(R.id.textViewWir5); aetText45 = (Button) findViewById(R.id.button66); float num045 = Float.parseFloat(aetText45.getText().toString()); float w45 = (float) num045; textView045.setText(String.format(Locale.US, "%.2f", w45) + ""); break; //endregion //region секция 6.1 case R.id.button70: TextView textView046 = (TextView) findViewById(R.id.textViewWir6); aetText46 = (Button) findViewById(R.id.button70); float num046 = Float.parseFloat(aetText46.getText().toString()); float w46 = (float) num046; textView046.setText(String.format(Locale.US, "%.2f", w46) + ""); break; case R.id.button71: TextView textView047 = (TextView) findViewById(R.id.textViewWir6); aetText47 = (Button) findViewById(R.id.button71); float num047 = Float.parseFloat(aetText47.getText().toString()); float w47 = (float) num047; textView047.setText(String.format(Locale.US, "%.2f", w47) + ""); break; case R.id.button72: TextView textView048 = (TextView) findViewById(R.id.textViewWir6); aetText48 = (Button) findViewById(R.id.button72); float num048 = Float.parseFloat(aetText48.getText().toString()); float w48 = (float) num048; textView048.setText(String.format(Locale.US, "%.2f", w48) + ""); break; case R.id.button73: TextView textView049 = (TextView) findViewById(R.id.textViewWir6); aetText49 = (Button) findViewById(R.id.button73); float num049 = Float.parseFloat(aetText49.getText().toString()); float w49 = (float) num049; textView049.setText(String.format(Locale.US, "%.2f", w49) + ""); break; case R.id.button74: TextView textView050 = (TextView) findViewById(R.id.textViewWir6); aetText50 = (Button) findViewById(R.id.button74); float num050 = Float.parseFloat(aetText50.getText().toString()); float w50 = (float) num050; textView050.setText(String.format(Locale.US, "%.2f", w50) + ""); break; case R.id.button75: TextView textView051 = (TextView) findViewById(R.id.textViewWir6); aetText51 = (Button) findViewById(R.id.button75); float num051 = Float.parseFloat(aetText51.getText().toString()); float w51 = (float) num051; textView051.setText(String.format(Locale.US, "%.2f", w51) + ""); break; //endregion //region секция 7.1 case R.id.button15: TextView textView052 = (TextView) findViewById(R.id.textViewWir7); aetText52 = (Button) findViewById(R.id.button15); float num052 = Float.parseFloat(aetText52.getText().toString()); float w52 = (float) num052; textView052.setText(String.format(Locale.US, "%.0f", w52) + ""); break; case R.id.button16: TextView textView053 = (TextView) findViewById(R.id.textViewWir7); aetText53 = (Button) findViewById(R.id.button16); float num053 = Float.parseFloat(aetText53.getText().toString()); float w53 = (float) num053; textView053.setText(String.format(Locale.US, "%.0f", w53) + ""); break; case R.id.button17: TextView textView054 = (TextView) findViewById(R.id.textViewWir7); aetText54 = (Button) findViewById(R.id.button17); float num054 = Float.parseFloat(aetText54.getText().toString()); float w54 = (float) num054; textView054.setText(String.format(Locale.US, "%.0f", w54) + ""); break; case R.id.button18: TextView textView055 = (TextView) findViewById(R.id.textViewWir7); aetText55 = (Button) findViewById(R.id.button18); float num055 = Float.parseFloat(aetText55.getText().toString()); float w55 = (float) num055; textView055.setText(String.format(Locale.US, "%.0f", w55) + ""); break; //endregion //region секция 8.1 case R.id.button21: TextView textView056 = (TextView) findViewById(R.id.textViewWir8); aetText56 = (Button) findViewById(R.id.button21); float num056 = Float.parseFloat(aetText56.getText().toString()); float w56 = (float) num056; textView056.setText(String.format(Locale.US, "%.0f", w56) + ""); break; case R.id.button22: TextView textView057 = (TextView) findViewById(R.id.textViewWir8); aetText57 = (Button) findViewById(R.id.button22); float num057 = Float.parseFloat(aetText57.getText().toString()); float w57 = (float) num057; textView057.setText(String.format(Locale.US, "%.0f", w57) + ""); break; case R.id.button23: TextView textView058 = (TextView) findViewById(R.id.textViewWir8); aetText58 = (Button) findViewById(R.id.button23); float num058 = Float.parseFloat(aetText58.getText().toString()); float w58 = (float) num058; textView058.setText(String.format(Locale.US, "%.0f", w58) + ""); break; case R.id.button24: TextView textView059 = (TextView) findViewById(R.id.textViewWir8); aetText59 = (Button) findViewById(R.id.button24); float num059 = Float.parseFloat(aetText59.getText().toString()); float w59 = (float) num059; textView059.setText(String.format(Locale.US, "%.0f", w59) + ""); break; //endregion //region секция 9.1 case R.id.button27: TextView textView060 = (TextView) findViewById(R.id.textViewWir9); aetText60 = (Button) findViewById(R.id.button27); float num060 = Float.parseFloat(aetText60.getText().toString()); float w60 = (float) num060; textView060.setText(String.format(Locale.US, "%.0f", w60) + ""); break; case R.id.button28: TextView textView061 = (TextView) findViewById(R.id.textViewWir9); aetText61 = (Button) findViewById(R.id.button28); float num061 = Float.parseFloat(aetText61.getText().toString()); float w61 = (float) num061; textView061.setText(String.format(Locale.US, "%.0f", w61) + ""); break; case R.id.button29: TextView textView062 = (TextView) findViewById(R.id.textViewWir9); aetText62 = (Button) findViewById(R.id.button29); float num062 = Float.parseFloat(aetText62.getText().toString()); float w62 = (float) num062; textView062.setText(String.format(Locale.US, "%.0f", w62) + ""); break; case R.id.button30: TextView textView063 = (TextView) findViewById(R.id.textViewWir9); aetText63 = (Button) findViewById(R.id.button30); float num063 = Float.parseFloat(aetText63.getText().toString()); float w63 = (float) num063; textView063.setText(String.format(Locale.US, "%.0f", w63) + ""); break; case R.id.button31: TextView textView064 = (TextView) findViewById(R.id.textViewWir9); aetText64 = (Button) findViewById(R.id.button31); float num064 = Float.parseFloat(aetText64.getText().toString()); float w64 = (float) num064; textView064.setText(String.format(Locale.US, "%.0f", w64) + ""); break; case R.id.button32: TextView textView065 = (TextView) findViewById(R.id.textViewWir9); aetText65 = (Button) findViewById(R.id.button32); float num065 = Float.parseFloat(aetText65.getText().toString()); float w65 = (float) num065; textView065.setText(String.format(Locale.US, "%.0f", w65) + ""); break; //endregion //region секция 10.1 case R.id.button19: TextView textView066 = (TextView) findViewById(R.id.textViewWir10); aetText66 = (Button) findViewById(R.id.button19); float num066 = Float.parseFloat(aetText66.getText().toString()); float w66 = (float) num066; textView066.setText(String.format(Locale.US, "%.2f", w66) + ""); break; case R.id.button20: TextView textView067 = (TextView) findViewById(R.id.textViewWir10); aetText67 = (Button) findViewById(R.id.button20); float num067 = Float.parseFloat(aetText67.getText().toString()); float w67 = (float) num067; textView067.setText(String.format(Locale.US, "%.2f", w67) + ""); break; case R.id.button25: TextView textView068 = (TextView) findViewById(R.id.textViewWir10); aetText68 = (Button) findViewById(R.id.button25); float num068 = Float.parseFloat(aetText68.getText().toString()); float w68 = (float) num068; textView068.setText(String.format(Locale.US, "%.2f", w68) + ""); break; //endregion //region секция 11.1 case R.id.button41: TextView textView069 = (TextView) findViewById(R.id.textViewWir11); aetText69 = (Button) findViewById(R.id.button41); float num069 = Float.parseFloat(aetText69.getText().toString()); float w69 = (float) num069; textView069.setText(String.format(Locale.US, "%.0f", w69) + ""); imageView.setImageResource(R.drawable.rad2); break; case R.id.button42: TextView textView070 = (TextView) findViewById(R.id.textViewWir11); aetText70 = (Button) findViewById(R.id.button42); float num070 = Float.parseFloat(aetText70.getText().toString()); float w70 = (float) num070; textView070.setText(String.format(Locale.US, "%.0f", w70) + ""); imageView.setImageResource(R.drawable.rad4); break; case R.id.button43: TextView textView071 = (TextView) findViewById(R.id.textViewWir11); aetText71 = (Button) findViewById(R.id.button43); float num071 = Float.parseFloat(aetText71.getText().toString()); float w71 = (float) num071; textView071.setText(String.format(Locale.US, "%.0f", w71) + ""); imageView.setImageResource(R.drawable.rad6); break; case R.id.button44: TextView textView072 = (TextView) findViewById(R.id.textViewWir11); aetText72 = (Button) findViewById(R.id.button44); float num072 = Float.parseFloat(aetText72.getText().toString()); float w72 = (float) num072; textView072.setText(String.format(Locale.US, "%.0f", w72) + ""); imageView.setImageResource(R.drawable.rad8); break; case R.id.button45: TextView textView073 = (TextView) findViewById(R.id.textViewWir7); aetText73 = (Button) findViewById(R.id.button45); float num073 = Float.parseFloat(aetText73.getText().toString()); float w73 = (float) num073; textView073.setText(String.format(Locale.US, "%.0f", w73) + ""); break; case R.id.button46: TextView textView074 = (TextView) findViewById(R.id.textViewWir7); aetText74 = (Button) findViewById(R.id.button46); float num074 = Float.parseFloat(aetText74.getText().toString()); float w74 = (float) num074; textView074.setText(String.format(Locale.US, "%.0f", w74) + ""); break; case R.id.button36: TextView textView077 = (TextView) findViewById(R.id.textViewWir11); aetText77 = (Button) findViewById(R.id.button36); float num077 = Float.parseFloat(aetText77.getText().toString()); float w77 = (float) num077; textView077.setText(String.format(Locale.US, "%.0f", w77) + ""); imageView.setImageResource(R.drawable.rad3); break; case R.id.button37: TextView textView078 = (TextView) findViewById(R.id.textViewWir11); aetText78 = (Button) findViewById(R.id.button37); float num078 = Float.parseFloat(aetText78.getText().toString()); float w78 = (float) num078; textView078.setText(String.format(Locale.US, "%.0f", w78) + ""); imageView.setImageResource(R.drawable.rad10); break; //endregion //region секция button 12.1 - 26. 33. 34. 35. case R.id.button26: TextView textView079 = (TextView) findViewById(R.id.textViewWir12); aetText79 = (Button) findViewById(R.id.button26); float num079 = Float.parseFloat(aetText79.getText().toString()); float w79 = (float) num079; textView079.setText(String.format(Locale.US, "%.0f", w79) + ""); break; case R.id.button33: TextView textView080 = (TextView) findViewById(R.id.textViewWir12); aetText80 = (Button) findViewById(R.id.button33); float num080 = Float.parseFloat(aetText80.getText().toString()); float w80 = (float) num080; textView080.setText(String.format(Locale.US, "%.0f", w80) + ""); break; case R.id.button34: TextView textView081 = (TextView) findViewById(R.id.textViewWir12); aetText81 = (Button) findViewById(R.id.button34); float num081 = Float.parseFloat(aetText81.getText().toString()); float w81 = (float) num081; textView081.setText(String.format(Locale.US, "%.0f", w81) + ""); break; case R.id.button35: TextView textView082 = (TextView) findViewById(R.id.textViewWir12); aetText82 = (Button) findViewById(R.id.button35); float num082 = Float.parseFloat(aetText82.getText().toString()); float w82 = (float) num082; textView082.setText(String.format(Locale.US, "%.0f", w82) + ""); //imageView.setImageResource(R.drawable.rad8); break; //endregion //&&&&&& default: } }} }; //region секция (btn1.setOnClickListener(btnClk);) btn1.setOnClickListener(btnClk); btn2.setOnClickListener(btnClk); btn3.setOnClickListener(btnClk); btn4.setOnClickListener(btnClk); btn5.setOnClickListener(btnClk); btn6.setOnClickListener(btnClk); btn7.setOnClickListener(btnClk); btn8.setOnClickListener(btnClk); btn9.setOnClickListener(btnClk); btn10.setOnClickListener(btnClk); btn11.setOnClickListener(btnClk); btn23.setOnClickListener(btnClk); btn24.setOnClickListener(btnClk); btn25.setOnClickListener(btnClk); btn26.setOnClickListener(btnClk); btn27.setOnClickListener(btnClk); btn28.setOnClickListener(btnClk); btn29.setOnClickListener(btnClk); btn30.setOnClickListener(btnClk); btn31.setOnClickListener(btnClk); btn32.setOnClickListener(btnClk); btn33.setOnClickListener(btnClk); btn34.setOnClickListener(btnClk); btn35.setOnClickListener(btnClk); btn36.setOnClickListener(btnClk); btn37.setOnClickListener(btnClk); btn38.setOnClickListener(btnClk); btn39.setOnClickListener(btnClk); btn40.setOnClickListener(btnClk); btn41.setOnClickListener(btnClk); btn42.setOnClickListener(btnClk); btn43.setOnClickListener(btnClk); btn44.setOnClickListener(btnClk); btn45.setOnClickListener(btnClk); btn46.setOnClickListener(btnClk); btn47.setOnClickListener(btnClk); btn48.setOnClickListener(btnClk); btn49.setOnClickListener(btnClk); btn50.setOnClickListener(btnClk); btn51.setOnClickListener(btnClk); btn52.setOnClickListener(btnClk); btn53.setOnClickListener(btnClk); btn54.setOnClickListener(btnClk); btn55.setOnClickListener(btnClk); btn56.setOnClickListener(btnClk); btn57.setOnClickListener(btnClk); btn58.setOnClickListener(btnClk); btn59.setOnClickListener(btnClk); btn60.setOnClickListener(btnClk); btn61.setOnClickListener(btnClk); btn62.setOnClickListener(btnClk); btn63.setOnClickListener(btnClk); btn64.setOnClickListener(btnClk); btn65.setOnClickListener(btnClk); btn66.setOnClickListener(btnClk); btn67.setOnClickListener(btnClk); btn68.setOnClickListener(btnClk); btn69.setOnClickListener(btnClk); btn70.setOnClickListener(btnClk); btn71.setOnClickListener(btnClk); btn72.setOnClickListener(btnClk); btn73.setOnClickListener(btnClk); btn74.setOnClickListener(btnClk); //btn75.setOnClickListener(btnClk); // btn76.setOnClickListener(btnClk); btn77.setOnClickListener(btnClk); btn78.setOnClickListener(btnClk); btn79.setOnClickListener(btnClk); btn80.setOnClickListener(btnClk); btn81.setOnClickListener(btnClk); btn82.setOnClickListener(btnClk); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab2 = (FloatingActionButton) findViewById(R.id.fab); fab2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { TextView aetText1; TextView aetText2; TextView aetText3; TextView aetText4; TextView aetText5; TextView aetText6; TextView aetText7; TextView aetText8; TextView aetText9; TextView aetText10; TextView aetText11; TextView aetText12; // Стороны aetText1 = (TextView) findViewById(R.id.textViewWir); //aetText2 = (TextView) findViewById(R.id.textViewWir2); aetText3 = (TextView) findViewById(R.id.textViewWir3); //ширина aetText4 = (TextView) findViewById(R.id.textViewWir4); //глубина aetText5 = (TextView) findViewById(R.id.textViewWir5); //цена aetText6 = (TextView) findViewById(R.id.textViewWir6); aetText9 = (TextView) findViewById(R.id.textViewWir9); aetText10 = (TextView) findViewById(R.id.textViewWir10); aetText11 = (TextView) findViewById(R.id.textViewWir11); aetText12 = (TextView) findViewById(R.id.textViewWir12); float num001 = Float.parseFloat(aetText1.getText().toString()); // float num002 = Float.parseFloat(aetText2.getText().toString()); float num003 = Float.parseFloat(aetText3.getText().toString()); float num004 = Float.parseFloat(aetText4.getText().toString()); float num005 = Float.parseFloat(aetText5.getText().toString()); float num006 = Float.parseFloat(aetText6.getText().toString()); float num007 = Float.parseFloat(aetText11.getText().toString()); float num009 = Float.parseFloat(aetText9.getText().toString()); float num010 = Float.parseFloat(aetText10.getText().toString()); float num012 = Float.parseFloat(aetText12.getText().toString()); float w = (float) ((float) ((num001 * 3) + (num003 * 3)) * ((num004 * 0.01)*(num005 * 0.01))); TextView textView142 = (TextView) findViewById(R.id.textView14); textView142.setText(String.format(Locale.US, "%.2f", w) + ""); float t = (float) w*(num006); TextView textView144 = (TextView) findViewById(R.id.textView20); textView144.setText(String.format(Locale.US, "%.2f", t) + ""); aetText11 = (TextView) findViewById(R.id.textViewWir11); aetText8 = (TextView) findViewById(R.id.textViewWir8); if (Float.parseFloat(aetText11.getText().toString()) == 3){ if (Float.parseFloat(aetText8.getText().toString()) == 8) { // x - метров на периметр float a = (float) num004 - 10; float b = (float) num005 - 10; float l = (float) a/2; float c = (float) ((float) (b*b)+(Math.pow(l,2))); float d = (float) Math.sqrt(c); float p = (float) ((a) + ((d)*2)); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.395 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 10) { float a = (float) num004 - 10; float b = (float) num005 - 10; float l = (float) a/2; float c = (float) ((float) (b*b)+(Math.pow(l,2))); float d = (float) Math.sqrt(c); float p = (float) ((a) + ((d)*2)); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.617 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 12) { float a = (float) num004 - 10; float b = (float) num005 - 10; float l = (float) a/2; float c = (float) ((float) (b*b)+(Math.pow(l,2))); float d = (float) Math.sqrt(c); float p = (float) ((a) + ((d)*2)); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.888 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 14) { float a = (float) num004 - 10; float b = (float) num005 - 10; float l = (float) a/2; float c = (float) ((float) (b*b)+(Math.pow(l,2))); float d = (float) Math.sqrt(c); float p = (float) ((a) + ((d)*2)); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 1.210 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");}} else if (Float.parseFloat(aetText11.getText().toString()) == 2){ if (Float.parseFloat(aetText8.getText().toString()) == 8) { // x - метров на периметр float p = (float) (num005 - 10); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.395 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 10) { float p = (float) (num005 - 10); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.617 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 12) { float p = (float) (num005 - 10); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.888 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 14) { float p = (float) (num005 - 10); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 1.210 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + ""); } } else if (Float.parseFloat(aetText8.getText().toString()) == 8) { // x - метров на периметр float p = (float) (((num004 - 10) + (num005 - 10))*2); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.395 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 10) { float p = (float) (((num004 - 10) + (num005 - 10))*2); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.617 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 12) { float p = (float) (((num004 - 10) + (num005 - 10))*2); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 0.888 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + "");} else if (Float.parseFloat(aetText8.getText().toString()) == 14) { float p = (float) (((num004 - 10) + (num005 - 10))*2); float x = (float) (float) ((((((num001 + num003)*3)/num009)*p))); float e = (float) 1.210 * x; float r = (float) x; TextView textView145 = (TextView) findViewById(R.id.textView37); TextView textView146 = (TextView) findViewById(R.id.textView39); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView146.setText(String.format(Locale.US, "%.2f", r) + ""); } aetText7 = (TextView) findViewById(R.id.textViewWir7); if (Float.parseFloat(aetText7.getText().toString()) == 10) { float e1 = (float) (((float) (((num001 * 3) +(num003*3)) * (0.617))*num007)); float m1 = (float) (((float) (((num001 * 2) +(num003*2))*(num007)))); float e = (float) (e1+(e1*num012/100)); float m = (float) (m1+(m1*num012/100)); TextView textView145 = (TextView) findViewById(R.id.textView24); TextView textView148 = (TextView) findViewById(R.id.textView43); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView148.setText(String.format(Locale.US, "%.2f", m) + "");} else if (Float.parseFloat(aetText7.getText().toString()) == 12) { float e1 = (float) (((float) (((num001 * 3) +(num003*3)) * (0.888))*num007)); float m1 = (float) (((float) (((num001 * 2) +(num003*2))*(num007)))); float e = (float) (e1+(e1*num012/100)); float m = (float) (m1+(m1*num012/100)); TextView textView145 = (TextView) findViewById(R.id.textView24); TextView textView148 = (TextView) findViewById(R.id.textView43); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView148.setText(String.format(Locale.US, "%.2f", m) + "");} else if (Float.parseFloat(aetText7.getText().toString()) == 14) { float e1 = (float) (((float) (((num001 * 3) +(num003*3)) * (1.210))*num007)); float m1 = (float) (((float) (((num001 * 3) +(num003*3))*(num007)))); float e = (float) (e1+(e1*num012/100)); float m = (float) (m1+(m1*num012/100)); TextView textView145 = (TextView) findViewById(R.id.textView24); TextView textView148 = (TextView) findViewById(R.id.textView43); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView148.setText(String.format(Locale.US, "%.2f", m) + "");} else if (Float.parseFloat(aetText7.getText().toString()) == 16) { float e1 = (float) (((float) (((num001 * 3) +(num003*3)) * (1.580))*num007)); float m1 = (float) (((float) (((num001 * 3) +(num003*3))*(num007)))); float e = (float) (e1+(e1*num012/100)); float m = (float) (m1+(m1*num012/100)); TextView textView145 = (TextView) findViewById(R.id.textView24); TextView textView148 = (TextView) findViewById(R.id.textView43); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView148.setText(String.format(Locale.US, "%.2f", m) + "");} else if (Float.parseFloat(aetText7.getText().toString()) == 18) { float e1 = (float) (((float) (((num001 * 3) +(num003*3)) * (2.000))*num007)); float m1 = (float) (((float) (((num001 * 3) +(num003*3))*(num007)))); float e = (float) (e1+(e1*num012/100)); float m = (float) (m1+(m1*num012/100)); TextView textView145 = (TextView) findViewById(R.id.textView24); TextView textView148 = (TextView) findViewById(R.id.textView43); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView148.setText(String.format(Locale.US, "%.2f", m) + "");} else if (Float.parseFloat(aetText7.getText().toString()) == 20) { float e1 = (float) (((float) (((num001 * 3) +(num003*3)) * (2.470))*num007)); float m1 = (float) (((float) (((num001 * 3) +(num003*3))*(num007)))); float e = (float) (e1+(e1*num012/100)); float m = (float) (m1+(m1*num012/100)); TextView textView145 = (TextView) findViewById(R.id.textView24); TextView textView148 = (TextView) findViewById(R.id.textView43); textView145.setText(String.format(Locale.US, "%.2f", e) + ""); textView148.setText(String.format(Locale.US, "%.2f", m) + "");} // цена арматуры TextView text1; TextView text2; text1 = (TextView) findViewById(R.id.textView24); text2 = (TextView) findViewById(R.id.textView37); float num01 = Float.parseFloat(text1.getText().toString()); float num02 = Float.parseFloat(text2.getText().toString()); float s = (float) (num02+num01)*(num010); TextView textView147 = (TextView) findViewById(R.id.textView28); textView147.setText(String.format(Locale.US, "%.2f", s) + ""); Toast toast = Toast.makeText(getApplicationContext(), "Подсчитано", Toast.LENGTH_SHORT); toast.show(); return; //Snackbar.make(view, "Подсчитано", Snackbar.LENGTH_SHORT) //Snackbar.make(view, "Подсчитано", Snackbar.LENGTH_SHORT) // .setAction("Action", null).show(); } }); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { final TextView bill83 = (TextView) findViewById(R.id.textView14); final TextView bill84 = (TextView) findViewById(R.id.textView20); final TextView bill85 = (TextView) findViewById(R.id.textView43); final TextView bill86 = (TextView) findViewById(R.id.textView24); final TextView bill87 = (TextView) findViewById(R.id.textView39); final TextView bill88 = (TextView) findViewById(R.id.textView37); final TextView bill89 = (TextView) findViewById(R.id.textView28); etText83 = (TextView) findViewById(R.id.textView14); etText84 = (TextView) findViewById(R.id.textView20); etText85 = (TextView) findViewById(R.id.textView43); etText86 = (TextView) findViewById(R.id.textView24); etText87 = (TextView) findViewById(R.id.textView39); etText88 = (TextView) findViewById(R.id.textView37); etText89 = (TextView) findViewById(R.id.textView28); bill83.setText(00.00 + ""); bill84.setText(00.00 + ""); bill85.setText(00.00 + ""); bill86.setText(00.00 + ""); bill87.setText(00.00 + ""); bill88.setText(00.00 + ""); bill89.setText(00.00 + ""); Toast toast = Toast.makeText(getApplicationContext(), "Сброс", Toast.LENGTH_SHORT); toast.show(); return true; } //Snackbar.make(view, "Подсчитано", Snackbar.LENGTH_SHORT) //Snackbar.make(view, "Подсчитано", Snackbar.LENGTH_SHORT) // .setAction("Action", null).show(); }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.share) { Intent a = new Intent(this,HellpActivity.class); a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(a); //Do something return true; } else if (id == R.id.email) { Intent a = new Intent(this,MainActivity.class); a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(a); //Do something return true; } else if (id == R.id.action_settings2) { Intent a = new Intent(this,MainActivity.class); a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(a); //Do something } else if (id == R.id.reset) { final TextView bill83 = (TextView) findViewById(R.id.textView14); final TextView bill84 = (TextView) findViewById(R.id.textView20); final TextView bill85 = (TextView) findViewById(R.id.textView43); final TextView bill86 = (TextView) findViewById(R.id.textView24); final TextView bill87 = (TextView) findViewById(R.id.textView39); final TextView bill88 = (TextView) findViewById(R.id.textView37); final TextView bill89 = (TextView) findViewById(R.id.textView28); etText83 = (TextView) findViewById(R.id.textView14); etText84 = (TextView) findViewById(R.id.textView20); etText85 = (TextView) findViewById(R.id.textView43); etText86 = (TextView) findViewById(R.id.textView24); etText87 = (TextView) findViewById(R.id.textView39); etText88 = (TextView) findViewById(R.id.textView37); etText89 = (TextView) findViewById(R.id.textView28); bill83.setText(00.00 + ""); bill84.setText(00.00 + ""); bill85.setText(00.00 + ""); bill86.setText(00.00 + ""); bill87.setText(00.00 + ""); bill88.setText(00.00 + ""); bill89.setText(00.00 + ""); //Do something return true; } return super.onOptionsItemSelected(item); } //region сохранение данных void saveText() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT, etText.getText().toString()); ed.commit(); //Toast.makeText(this, "Text saved", Toast.LENGTH_SHORT).show(); } void loadText() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT, ""); etText.setText(savedText); // Toast.makeText(this, "Text loaded", Toast.LENGTH_SHORT).show(); } void saveText2() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT2, etText2.getText().toString()); ed.commit(); } void loadText2() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT2, ""); etText2.setText(savedText); } void saveText3() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT3, etText3.getText().toString()); ed.commit(); } void loadText3() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT3, ""); etText3.setText(savedText); } void saveText4() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT4, etText4.getText().toString()); ed.commit(); } void loadText4() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT4, ""); etText4.setText(savedText); } void saveText5() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT5, etText5.getText().toString()); ed.commit(); } void loadText5() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT5, ""); etText5.setText(savedText); } void saveText6() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT6, etText6.getText().toString()); ed.commit(); } void loadText6() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT6, ""); etText6.setText(savedText); } void saveText7() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT7, etText7.getText().toString()); ed.commit(); } void loadText7() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT7, ""); etText7.setText(savedText); } void saveText8() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT8, etText8.getText().toString()); ed.commit(); } void loadText8() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT8, ""); etText8.setText(savedText); } void saveText9() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT9, etText9.getText().toString()); ed.commit(); } void loadText9() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT9, ""); etText9.setText(savedText); } void saveText10() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT10, etText10.getText().toString()); ed.commit(); } void loadText10() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT10, ""); etText10.setText(savedText); } void saveText11() { sPref2 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref2.edit(); ed.putString(SAVED_TEXT11, etText11.getText().toString()); ed.commit(); } void loadText11() { sPref2 = getPreferences(MODE_PRIVATE); String savedText = sPref2.getString(SAVED_TEXT11, ""); etText11.setText(savedText); } void saveText23() { sPref3 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref3.edit(); ed.putString(SAVED_TEXT23, etText23.getText().toString()); ed.commit(); // Toast.makeText(this, "Text saved", Toast.LENGTH_SHORT).show(); } void loadText23() { sPref3 = getPreferences(MODE_PRIVATE); String savedText = sPref3.getString(SAVED_TEXT23, ""); etText23.setText(savedText); // Toast.makeText(this, "Text loaded", Toast.LENGTH_SHORT).show(); } void saveText24() { sPref3 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref3.edit(); ed.putString(SAVED_TEXT24, etText24.getText().toString()); ed.commit(); // Toast.makeText(this, "Text saved", Toast.LENGTH_SHORT).show(); } void loadText24() { sPref3 = getPreferences(MODE_PRIVATE); String savedText = sPref3.getString(SAVED_TEXT24, ""); etText24.setText(savedText); // Toast.makeText(this, "Text loaded", Toast.LENGTH_SHORT).show(); } void saveText25() { sPref3 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref3.edit(); ed.putString(SAVED_TEXT25, etText25.getText().toString()); ed.commit(); } void loadText25() { sPref3 = getPreferences(MODE_PRIVATE); String savedText = sPref3.getString(SAVED_TEXT25, ""); etText25.setText(savedText); } void saveText26() { sPref3 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref3.edit(); ed.putString(SAVED_TEXT26, etText26.getText().toString()); ed.commit(); } void loadText26() { sPref3 = getPreferences(MODE_PRIVATE); String savedText = sPref3.getString(SAVED_TEXT26, ""); etText26.setText(savedText); } void saveText27() { sPref3 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref3.edit(); ed.putString(SAVED_TEXT27, etText27.getText().toString()); ed.commit(); } void loadText27() { sPref3 = getPreferences(MODE_PRIVATE); String savedText = sPref3.getString(SAVED_TEXT27, ""); etText27.setText(savedText); } void saveText28() { sPref3 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref3.edit(); ed.putString(SAVED_TEXT28, etText28.getText().toString()); ed.commit(); } void loadText28() { sPref3 = getPreferences(MODE_PRIVATE); String savedText = sPref3.getString(SAVED_TEXT28, ""); etText28.setText(savedText); } void saveText29() { sPref3 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref3.edit(); ed.putString(SAVED_TEXT29, etText29.getText().toString()); ed.commit(); } void loadText29() { sPref3 = getPreferences(MODE_PRIVATE); String savedText = sPref3.getString(SAVED_TEXT29, ""); etText29.setText(savedText); } void saveText30() { sPref3 = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref3.edit(); ed.putString(SAVED_TEXT30, etText30.getText().toString()); ed.commit(); } void loadText30() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT30, ""); etText30.setText(savedText); } void saveText31() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT31, etText31.getText().toString()); ed.commit(); } void loadText31() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT31, ""); etText31.setText(savedText); } void saveText32() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT32, etText32.getText().toString()); ed.commit(); } void loadText32() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT32, ""); etText32.setText(savedText); } void saveText33() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT33, etText33.getText().toString()); ed.commit(); } void loadText33() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT33, ""); etText33.setText(savedText); } void saveText34() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT34, etText34.getText().toString()); ed.commit(); } void loadText34() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT34, ""); etText34.setText(savedText); } void saveText35() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT35, etText35.getText().toString()); ed.commit(); } void loadText35() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT35, ""); etText35.setText(savedText); } void saveText36() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT36, etText36.getText().toString()); ed.commit(); } void loadText36() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT36, ""); etText36.setText(savedText); } void saveText37() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT37, etText37.getText().toString()); ed.commit(); } void loadText37() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT37, ""); etText37.setText(savedText); } void saveText38() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT38, etText38.getText().toString()); ed.commit(); } void loadText38() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT38, ""); etText38.setText(savedText); } void saveText39() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT39, etText39.getText().toString()); ed.commit(); } void loadText39() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT39, ""); etText39.setText(savedText); } void saveText40() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT40, etText40.getText().toString()); ed.commit(); } void loadText40() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT40, ""); etText40.setText(savedText); } void saveText41() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT41, etText41.getText().toString()); ed.commit(); } void loadText41() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT41, ""); etText41.setText(savedText); } void saveText42() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT42, etText42.getText().toString()); ed.commit(); } void loadText42() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT42, ""); etText42.setText(savedText); } void saveText43() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT43, etText43.getText().toString()); ed.commit(); } void loadText43() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT43, ""); etText43.setText(savedText); } void saveText44() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT44, etText44.getText().toString()); ed.commit(); } void loadText44() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT44, ""); etText44.setText(savedText); } void saveText45() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT45, etText45.getText().toString()); ed.commit(); } void loadText45() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT45, ""); etText45.setText(savedText); } void saveText46() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT46, etText46.getText().toString()); ed.commit(); } void loadText46() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT46, ""); etText46.setText(savedText); } void saveText47() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT47, etText47.getText().toString()); ed.commit(); } void loadText47() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT47, ""); etText47.setText(savedText); } void saveText48() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT48, etText48.getText().toString()); ed.commit(); } void loadText48() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT48, ""); etText48.setText(savedText); } void saveText49() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT49, etText49.getText().toString()); ed.commit(); } void loadText49() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT49, ""); etText49.setText(savedText); } void saveText50() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT50, etText50.getText().toString()); ed.commit(); } void loadText50() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT50, ""); etText50.setText(savedText); } void saveText51() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT51, etText51.getText().toString()); ed.commit(); } void loadText51() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT51, ""); etText51.setText(savedText); } //endregion void saveText52() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT52, etText52.getText().toString()); ed.commit(); } void loadText52() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT52, ""); etText52.setText(savedText); } void saveText53() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT53, etText53.getText().toString()); ed.commit(); } void loadText53() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT53, ""); etText53.setText(savedText); } void saveText54() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT54, etText54.getText().toString()); ed.commit(); } void loadText54() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT54, ""); etText54.setText(savedText); } void saveText55() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT55, etText55.getText().toString()); ed.commit(); } void loadText55() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT55, ""); etText55.setText(savedText); } void saveText56() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT56, etText56.getText().toString()); ed.commit(); } void loadText56() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT56, ""); etText56.setText(savedText); } void saveText57() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT57, etText57.getText().toString()); ed.commit(); } void loadText57() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT57, ""); etText57.setText(savedText); } void saveText58() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT58, etText58.getText().toString()); ed.commit(); } void loadText58() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT58, ""); etText58.setText(savedText); } void saveText59() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT59, etText59.getText().toString()); ed.commit(); } void loadText59() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT59, ""); etText59.setText(savedText); } void saveText60() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT60, etText60.getText().toString()); ed.commit(); } void loadText60() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT60, ""); etText60.setText(savedText); } void saveText61() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT61, etText61.getText().toString()); ed.commit(); } void loadText61() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT61, ""); etText61.setText(savedText); } void saveText62() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT62, etText62.getText().toString()); ed.commit(); } void loadText62() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT62, ""); etText62.setText(savedText); } void saveText63() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT63, etText63.getText().toString()); ed.commit(); } void loadText63() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT63, ""); etText63.setText(savedText); } void saveText64() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT64, etText64.getText().toString()); ed.commit(); } void loadText64() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT64, ""); etText64.setText(savedText); } void saveText65() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT65, etText65.getText().toString()); ed.commit(); } void loadText65() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT65, ""); etText65.setText(savedText); } void saveText66() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT66, etText66.getText().toString()); ed.commit(); } void loadText66() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT66, ""); etText66.setText(savedText); } void saveText67() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT67, etText67.getText().toString()); ed.commit(); } void loadText67() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT67, ""); etText67.setText(savedText); } void saveText68() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT68, etText68.getText().toString()); ed.commit(); } void loadText68() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT68, ""); etText68.setText(savedText); } void saveText69() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT69, etText69.getText().toString()); ed.commit(); } void loadText69() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT69, ""); etText69.setText(savedText); } void saveText70() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT70, etText70.getText().toString()); ed.commit(); } void loadText70() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT70, ""); etText70.setText(savedText); } void saveText71() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT71, etText71.getText().toString()); ed.commit(); } void loadText71() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT71, ""); etText71.setText(savedText); } void saveText72() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT72, etText72.getText().toString()); ed.commit(); } void loadText72() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT72, ""); etText72.setText(savedText); } void saveText73() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT73, etText73.getText().toString()); ed.commit(); } void loadText73() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT73, ""); etText73.setText(savedText); } void saveText74() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT74, etText74.getText().toString()); ed.commit(); } void loadText74() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT74, ""); etText74.setText(savedText); } void saveText79() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT79, etText79.getText().toString()); ed.commit(); } void loadText79() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT79, ""); etText79.setText(savedText); } void saveText80() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT80, etText80.getText().toString()); ed.commit(); } void loadText80() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT80, ""); etText80.setText(savedText); } void saveText81() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT81, etText81.getText().toString()); ed.commit(); } void loadText81() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT81, ""); etText81.setText(savedText); } void saveText82() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT82, etText82.getText().toString()); ed.commit(); } void loadText82() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT82, ""); etText82.setText(savedText); } // сохранение данных void saveText83() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT83, etText83.getText().toString()); ed.commit(); } void loadText83() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT83, ""); etText83.setText(savedText); } void saveText84() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT84, etText84.getText().toString()); ed.commit(); } void loadText84() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT84, ""); etText84.setText(savedText); } void saveText85() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT85, etText85.getText().toString()); ed.commit(); } void loadText85() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT85, ""); etText85.setText(savedText); } void saveText86() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT86, etText86.getText().toString()); ed.commit(); } void loadText86() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT86, ""); etText86.setText(savedText); } void saveText87() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT87, etText87.getText().toString()); ed.commit(); } void loadText87() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT87, ""); etText87.setText(savedText); } void saveText88() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT88, etText88.getText().toString()); ed.commit(); } void loadText88() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT88, ""); etText88.setText(savedText); } void saveText89() { sPref = getPreferences(MODE_PRIVATE); SharedPreferences.Editor ed = sPref.edit(); ed.putString(SAVED_TEXT89, etText89.getText().toString()); ed.commit(); } void loadText89() { sPref = getPreferences(MODE_PRIVATE); String savedText = sPref.getString(SAVED_TEXT89, ""); etText89.setText(savedText); } @Override protected void onDestroy() { super.onDestroy(); saveText(); saveText2(); saveText3(); saveText4(); saveText5(); saveText6(); saveText7(); saveText8(); saveText9(); saveText10(); saveText11(); //saveText12(); //saveText13(); //saveText14(); //saveText15(); //saveText16(); //saveText17(); // saveText18(); // saveText19(); // saveText20(); // saveText21(); // saveText22(); saveText23(); saveText24(); saveText25(); saveText26(); saveText27(); saveText28(); saveText29(); saveText30(); saveText31(); saveText32(); saveText33(); saveText34(); saveText35(); saveText36(); saveText37(); saveText38(); saveText39(); saveText40(); saveText41(); saveText42(); saveText43(); saveText44(); saveText45(); saveText46(); saveText47(); saveText48(); saveText49(); saveText50(); saveText51(); saveText52(); saveText53(); saveText54(); saveText55(); saveText56(); saveText57(); saveText58(); saveText59(); saveText60(); saveText61(); saveText62(); saveText63(); saveText64(); saveText65(); saveText66(); saveText67(); saveText68(); saveText69(); saveText70(); saveText71(); saveText72(); saveText73(); saveText74(); saveText79(); saveText80(); saveText81(); saveText82(); saveText83(); saveText84(); saveText85(); saveText86(); saveText87(); saveText88(); saveText89(); } public void onClickDom(View view) { Intent a = new Intent(this,MainActivity.class); a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(a); } //do something on back. public void onClick_Ca(View view) { long mills = 15L; Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(mills); Intent intent = getPackageManager().getLaunchIntentForPackage("com.google.android.calculator"); if (intent != null) { // We found the activity now start the activity intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } else { Intent intent2 = getPackageManager().getLaunchIntentForPackage("mobi.appplus.calculator.plus"); if (intent2 != null) { // We found the activity now start the activity intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent2); } else { // Bring user to the market or let them choose an app? intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setData(Uri.parse("market://details?id=" + "mobi.appplus.calculator.plus")); startActivity(intent); } } } }
[ "vnebo2012@gmail.com" ]
vnebo2012@gmail.com
b12ebd654a9233f160f4e2ec83efe0f1afe5b426
f70b716fbe8eed903cf842698c89bdf8b0ef43b6
/e2e/gui/src/test/java/com/epam/pipeline/autotests/ao/PipelineGraphTabAO.java
ce8c2ce9cfe93a54e76f3d64561a6ac21de6ac22
[ "Apache-2.0" ]
permissive
jaideepjoshi/cloud-pipeline
7e7d9cc9ff7912745ed1f9fd346b49a29769bdcd
2d5081c2f2ceb55213f92e8c6da242c80fff03fa
refs/heads/master
2022-12-04T18:42:46.212873
2019-03-26T11:23:17
2019-03-26T11:23:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,249
java
/* * Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.epam.pipeline.autotests.ao; import com.codeborne.selenide.SelenideElement; import com.epam.pipeline.autotests.utils.Utils; import java.util.Arrays; import java.util.Map; import java.util.function.Consumer; import static com.codeborne.selenide.Condition.enabled; import static com.codeborne.selenide.Condition.text; import static com.codeborne.selenide.Condition.visible; import static com.codeborne.selenide.Selectors.byClassName; import static com.codeborne.selenide.Selectors.byId; import static com.codeborne.selenide.Selectors.byText; import static com.codeborne.selenide.Selenide.$; import static com.codeborne.selenide.Selenide.$$; import static com.codeborne.selenide.Selenide.actions; import static com.epam.pipeline.autotests.ao.Primitive.*; import static com.epam.pipeline.autotests.utils.PipelineSelectors.button; import static java.util.concurrent.TimeUnit.SECONDS; import static org.openqa.selenium.By.className; import static org.openqa.selenium.By.cssSelector; import static org.openqa.selenium.By.tagName; public class PipelineGraphTabAO extends AbstractPipelineTabAO<PipelineGraphTabAO> { private final Map<Primitive, SelenideElement> elements = initialiseElements( super.elements(), entry(SAVE, context().find(byId("wdl-graph-save-button"))), entry(REVERT, context().find(byId("wdl-graph-revert-button"))), entry(LAYOUT, context().find(byId("wdl-graph-layout-button"))), entry(FIT, context().find(byId("wdl-graph-fit-button"))), entry(SHOW_LINKS, context().find(byId("wdl-graph-show-links-button"))), entry(ADD_SCATTER, context().find(byId("wdl-graph-workflow-add-scatter-button"))), entry(ADD_TASK, context().find(byId("wdl-graph-workflow-add-task-button"))), entry(EDIT_TASK, context().find(byId("wdl-graph-task-edit-button"))), entry(EDIT_WORKFLOW, context().find(byId("wdl-graph-workflow-edit-button"))), entry(CANVAS, context().find(tagName("canvas"))), entry(MINIMIZE, $(byClassName("graph__graph-interface-button-icon"))) ); public PipelineGraphTabAO(String pipelineName) { super(pipelineName); } @Override protected PipelineGraphTabAO open() { changeTabTo(GRAPH_TAB); return this; } public TaskAdditionPopupAO openAddTaskDialog() { click(ADD_TASK); return new TaskAdditionPopupAO(this); } public ScatterAdditionPopupAO openAddScatterDialog() { click(ADD_SCATTER); return new ScatterAdditionPopupAO(this); } public PipelineGraphTabAO revert() { return click(REVERT); } public PipelineGraphTabAO fit() { return click(FIT); } public PipelineGraphTabAO minimize() { return click(MINIMIZE); } public PipelineGraphTabAO searchLabel(String labelText) { $$(byClassName("label")).findBy(text(labelText)).shouldBe(visible); return this; } public PipelineGraphTabAO searchScatter(String labelText) { $$(byClassName("port-label")).findBy(text(labelText)).shouldBe(visible); return this; } public PipelineGraphTabAO clickScatter(String name) { fit().minimize().minimize().minimize(); $$(byClassName("label")).findBy(text(name)).shouldBe(visible).click(); return this; } public TaskEditionPopupAO edit() { click(EDIT_TASK); return new TaskEditionPopupAO(this); } public WorkflowEditionPopupAO editWorkflow() { click(EDIT_WORKFLOW); return new WorkflowEditionPopupAO(this); } public PipelineGraphTabAO saveAndCommitWithMessage(String message) { return openCommitDialog().typeInField(message).ok(); } public PipelineGraphTabAO saveAndChangeJsonWithMessage(String message) { return openCommitDialog().typeInField(message).updateConfiguration().ok(); } public CommitPopupAO<PipelineGraphTabAO> openCommitDialog() { ensure(SAVE, enabled).click(SAVE); return new CommitPopupAO<>(this); } @Override public SelenideElement context() { return $(className("graph__graph-container")); } @Override public Map<Primitive, SelenideElement> elements() { return elements; } public static class TaskAdditionPopupAO extends PopupAO<TaskAdditionPopupAO, PipelineGraphTabAO> { private final Map<Primitive, SelenideElement> elements = initialiseElements( entry(NAME, context().find(byId("name"))), entry(INPUT_ADD, context().find(byId("edit-wdl-form-add-variable-button"))), entry(OUTPUT_ADD, context().find(byId("edit-wdl-form-add-output-button"))), entry(ANOTHER_DOCKER_IMAGE, Utils.getFormRowByLabel(context(), "Use another docker image").find(byClassName("ant-checkbox-wrapper"))), entry(DOCKER_IMAGE_COMBOBOX, context().find(byText("Docker image:")).closest(".ant-row-flex")), entry(COMMAND, Utils.getFormRowByLabel(context(), "Command").find(byClassName("edit-w-d-l-tool-form__code-editor"))), entry(ADD, context().find(byId("edit-wdl-form-add-button"))), entry(CANCEL, context().find(byId("edit-wdl-form-cancel-button"))) ); public TaskAdditionPopupAO(final PipelineGraphTabAO parentAO) { super(parentAO); } @Override public Map<Primitive, SelenideElement> elements() { return elements; } @Override public SelenideElement context() { return Utils.getPopupByTitle("Add task"); } @Override public PipelineGraphTabAO cancel() { return click(CANCEL).parent(); } @Override public PipelineGraphTabAO ok() { return click(ADD).parent(); } public SectionRowAO<TaskAdditionPopupAO> clickInputSectionAddButton() { click(INPUT_ADD); return new SectionRowAO<>(this); } public SectionRowAO<TaskAdditionPopupAO> clickOutputSectionAddButton() { click(OUTPUT_ADD); return new SectionRowAO<>(this); } public TaskAdditionPopupAO setName(String name) { return setValue(NAME, name); } public TaskAdditionPopupAO setCommand(String command) { actions().moveToElement($(byClassName("CodeMirror-line"))).click().perform(); Utils.clickAndSendKeysWithSlashes($(byClassName("CodeMirror-line")), command); return this; } public TaskAdditionPopupAO enableAnotherDockerImage() { return click(ANOTHER_DOCKER_IMAGE); } public TaskAdditionPopupAO disableAnotherDockerImage() { return enableAnotherDockerImage(); } public DockerImageSelection openDockerImagesCombobox() { click(DOCKER_IMAGE_COMBOBOX); sleep(1, SECONDS); return new DockerImageSelection(this); } } public static class TaskEditionPopupAO extends TaskAdditionPopupAO { private Map<Primitive, SelenideElement> elements = initialiseElements( super.elements(), entry(ALIAS, Utils.getFormRowByLabel(context(), "Alias").find(byId("alias"))), entry(SAVE, context().find(byClassName("ant-modal-footer")).find(byId("edit-wdl-form-save-button"))) ); public TaskEditionPopupAO(PipelineGraphTabAO parentAO) { super(parentAO); } @Override public Map<Primitive, SelenideElement> elements() { return elements; } @Override public SelenideElement context() { return Utils.getPopupByTitle("Edit task"); } @Override public PipelineGraphTabAO ok() { return click(SAVE).parent(); } } public static class WorkflowEditionPopupAO extends TaskEditionPopupAO { private Map<Primitive, SelenideElement> elements = initialiseElements( super.elements() ); public WorkflowEditionPopupAO(PipelineGraphTabAO parentAO) { super(parentAO); } @Override public Map<Primitive, SelenideElement> elements() { return elements; } @Override public SelenideElement context() { return Utils.getPopupByTitle("Edit workflow"); } @Override public PipelineGraphTabAO ok() { return click(SAVE).parent(); } } public static class ScatterAdditionPopupAO extends PopupAO<ScatterAdditionPopupAO, PipelineGraphTabAO> { private final Map<Primitive, SelenideElement> elements = initialiseElements( entry(ADD, context().find(byClassName("ant-modal-footer")).find(button("ADD"))), entry(CANCEL, context().find(byClassName("ant-modal-footer")).find(button("CANCEL"))), entry(INPUT_ADD, context().find(byId("edit-wdl-form-add-variable-button"))) ); public ScatterAdditionPopupAO(PipelineGraphTabAO parentAO) { super(parentAO); } @Override public Map<Primitive, SelenideElement> elements() { return elements; } @Override public SelenideElement context() { return Utils.getPopupByTitle("Add scatter"); } @Override public PipelineGraphTabAO ok() { return click(ADD).parent(); } public SectionRowAO<ScatterAdditionPopupAO> clickInputSectionAddButton() { click(INPUT_ADD); return new SectionRowAO<>(this); } public PipelineGraphTabAO cancel() { return click(CANCEL).parent(); } } @SuppressWarnings("unchecked") public static class SectionRowAO<PARENT_TYPE extends AccessObject<PARENT_TYPE>> implements AccessObject<SectionRowAO<PARENT_TYPE>> { private final Map<Primitive, SelenideElement> elements = initialiseElements( entry(NAME, inputByColumn(context(), 1)), entry(TYPE, inputByColumn(context(), 2)), entry(VALUE, inputByColumn(context(), 3)), entry(DELETE_ICON, column(context(), 4).find(byClassName("anticon-delete"))) ); private final PARENT_TYPE parentAO; public SectionRowAO(PARENT_TYPE parentAO) { this.parentAO = parentAO; } @Override public Map<Primitive, SelenideElement> elements() { return elements; } @Override public SelenideElement context() { return $$(className("ant-table")).findBy(text("Input")); } public TypeCombobox openTypeCombobox() { click(TYPE); return new TypeCombobox(this); } public SectionRowAO<PARENT_TYPE> setName(String name) { return setValue(NAME, name); } public SectionRowAO<PARENT_TYPE> setType(String type) { return openTypeCombobox().set(type).close(); } public SectionRowAO<PARENT_TYPE> setValue(String value) { return setValue(VALUE, value); } private SelenideElement inputByColumn(SelenideElement context, int num) { return column(context, num).find(tagName("input")); } private SelenideElement column(SelenideElement context, int num) { return row(context).find(cssSelector(String.format("td:nth-child(%d)", num))); } private SelenideElement row(SelenideElement context) { return context.find(className("ant-table-row")); } public PARENT_TYPE close() { return parentAO; } public PARENT_TYPE dropCurrentRow() { click(DELETE_ICON); return parentAO; } } public static class TypeCombobox extends ComboboxAO<TypeCombobox, SectionRowAO> { private final SectionRowAO parentAO; public TypeCombobox(SectionRowAO parentAO) { super(parentAO); this.parentAO = parentAO; } @Override SelenideElement closingElement() { // any other place return parentAO.get(NAME); } public static Consumer<TypeCombobox> shouldContainTypes(final String... types) { return combobox -> Arrays.stream(types).forEach(type -> combobox.ensure(byText(type), visible)); } } }
[ "aleksandr_sidoruk@epam.com" ]
aleksandr_sidoruk@epam.com
19896845da04e4681f1ff0d02ec76ec9c8da05e8
5e2f704e893a7546491c3eb97b8d07117380afad
/e3-search-web/src/main/java/com/jisen/e3mall/search/controller/SearchController.java
d234f6443f20dda7c0ab9622f5e2a53c32352707
[]
no_license
qq289736032/e3
786a1b8dd08e9fb9c3cd30fe5da916af6ac8478f
02805d3b9aa43d47eed58bae82e65350fa5cf177
refs/heads/master
2021-08-20T05:50:37.989239
2017-11-28T09:52:03
2017-11-28T09:52:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,406
java
package com.jisen.e3mall.search.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import com.jisen.e3mall.common.pojo.SearchResult; import com.jisen.search.service.SearchService; /** * 商品搜索 * @author Administrator */ @Controller public class SearchController { @Autowired private SearchService searchService; @Value("${SEARCH_RESULT_ROWS}") private Integer SEARCH_RESULT_ROWS; @RequestMapping("/search") public String searchItemList(String keyword, @RequestParam(defaultValue="1") Integer page, Model model) throws Exception{ //处理乱码 keyword = new String(keyword.getBytes("iso-8859-1"),"utf-8"); SearchResult searchResult = searchService.search(keyword, page, SEARCH_RESULT_ROWS); //把结果传递给页面 model.addAttribute("query",keyword); model.addAttribute("totalPages",searchResult.getTotalPages()); model.addAttribute("recordCount",searchResult.getRecordCount()); model.addAttribute("page",page); model.addAttribute("itemList",searchResult.getItemList()); //返回逻辑视图 return "search"; } }
[ "289736032@qq.com" ]
289736032@qq.com
023b9c1ee5de826ab5659df6a539c89c17a1b629
404a189c16767191ffb172572d36eca7db5571fb
/main-war/build/generated/document/gov/georgia/dhr/dfcs/sacwis/ws/document/DocumentServices.java
7ba95eb6998d7797894c01c5009de423da401170
[]
no_license
tayduivn/training
648a8e9e91194156fb4ffb631749e6d4bf2d0590
95078fb2c7e21bf2bba31e2bbd5e404ac428da2f
refs/heads/master
2021-06-13T16:20:41.293097
2017-05-08T21:37:59
2017-05-08T21:37:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
472
java
// This class was generated by the JAXRPC SI, do not edit. // Contents subject to change without notice. // JAX-RPC Standard Implementation (1.1.3, build R1) // Generated source version: 1.1.3 package gov.georgia.dhr.dfcs.sacwis.ws.document; import javax.xml.rpc.*; public interface DocumentServices extends javax.xml.rpc.Service { public gov.georgia.dhr.dfcs.sacwis.ws.document.DocumentServicesSoap getDocumentServicesSoap() throws ServiceException; }
[ "lgeddam@gmail.com" ]
lgeddam@gmail.com
6ec52082c58fe9e351444e99fd2f20a67b86ac80
2645933b21473405ce29a72c7f279be2fd38e080
/src/cn/miranda/MeowCraft/Listeners/Skills/Active/SummonSkeletonEvent.java
81a8fe549a8602703173b8fd69430424f259ef8c
[]
no_license
MirandaMeow/MeowCraft
7937fd059fde194658be520a775bf82777f0e818
99eacf844140171dc858ddd75929319d120a0a43
refs/heads/master
2023-08-13T04:46:10.188426
2021-10-06T07:29:32
2021-10-06T07:29:32
293,010,698
2
0
null
null
null
null
UTF-8
Java
false
false
3,078
java
package cn.miranda.MeowCraft.Listeners.Skills.Active; import cn.miranda.MeowCraft.Manager.ConfigManager; import cn.miranda.MeowCraft.Manager.MessageManager; import cn.miranda.MeowCraft.Task.Skill.OccSkillsCoolDownTask; import cn.miranda.MeowCraft.Utils.Effect; import cn.miranda.MeowCraft.Utils.Occ; import cn.miranda.MeowCraft.Utils.SkillLib; import org.bukkit.Material; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.EquipmentSlot; import static cn.miranda.MeowCraft.Manager.ConfigManager.*; public class SummonSkeletonEvent implements Listener { @EventHandler(priority = EventPriority.NORMAL) private void SelfExplode(PlayerInteractEvent event) { Player player = event.getPlayer(); String playerName = player.getName(); String skillName = "Voodoo_SummonSkeleton"; if (!player.hasPermission("occ.bypass")) { if (!Occ.isFitOcc(player, skillName) || !playerData.getBoolean(String.format("%s.occConfig.enabled", playerName), true)) { return; } } if (player.isSneaking() && (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) && player.getInventory().getItemInMainHand().getType() == Material.BONE && event.getHand() == EquipmentSlot.HAND) { if (playerData.get(String.format("%s.occConfig.occSkills.%s", playerName, skillName)) == null) { return; } if (cache.get(String.format("OccSkillCoolDown.%s.%s", playerName, skillName)) != null) { MessageManager.ActionBarMessage(player, String.format("§c§l骸骨复苏§r§e冷却尚未结束 §e剩余 §b%s §e秒", cache.getInt(String.format("OccSkillCoolDown.%s.%s", playerName, skillName)))); return; } if (!Occ.requireItem(player, Material.BONE, skills.getInt(String.format("%s.cost", skillName), 40))) { MessageManager.ActionBarMessage(player, "§c骨头不足"); return; } int amount = skills.getInt(String.format("%s.amount", skillName), 2); int maxHealth = skills.getInt(String.format("%s.maxHealth", skillName), 60); int timeLeft = skills.getInt(String.format("%s.timeLeft", skillName), 60) * 20; int coolDown = skills.getInt(String.format("%s.cooldown", skillName), 600); MessageManager.ActionBarMessage(player, "§c§l骸骨复苏§r§e发动!"); SkillLib.summonMob(player, EntityType.SKELETON, amount, maxHealth, timeLeft); Effect.activeSkillEffect(player); cache.set(String.format("OccSkillCoolDown.%s.%s", playerName, skillName), coolDown); new OccSkillsCoolDownTask().OccSkillsCoolDown(player, skillName); ConfigManager.saveConfigs(); } } }
[ "444037570@qq.com" ]
444037570@qq.com
835a7378f60fbe66390846ae2c99ec7c4451022e
66a581f87a9aa4972ea22cedc07c0a6c4308c5c5
/S4_JUnit/junit-testing/src/MyTestSuite.java
ffd5faaa484f8ad1d44d849599a8af7bb81ad537
[]
no_license
itsVinu/Java
2c28f7ced6f219eac617bc14206bffef371c92a6
03bced6e62c884f04dd02c022ace47f3cde8fd1b
refs/heads/master
2023-08-22T10:25:16.989821
2021-10-02T17:48:41
2021-10-02T17:48:41
412,871,025
1
0
null
null
null
null
UTF-8
Java
false
false
446
java
import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) @SuiteClasses({Demo1.class,Demo2.class,Employee.class}) public class MyTestSuite { public static void main(String[] args) { Result res = JUnitCore.runClasses(MyTestSuite.class); System.out.println(res.getRunCount()); } }
[ "aakashgpt12321@gmail.com" ]
aakashgpt12321@gmail.com
aaafa3e3be077d011f107dd67dc04ac4fececb1e
cca48a30091d93a8ad01d506a9d74f9985e6b8c9
/src/main/java/com/ge/digital/model/DashboardConfig.java
459a7ee41848b6220cec0a65bd8edc111582058e
[]
no_license
clmath/predix-starter
7ec28b8a490989d8d5b7b516e3f2a630decd7deb
909bf7fe26f822d6e140ea2444840602005e2a0e
refs/heads/master
2021-01-12T10:31:19.497648
2016-12-13T22:36:50
2016-12-13T22:36:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package com.ge.digital.model; import lombok.Getter; import lombok.Setter; /** * Created by benoitlaurent on 12/12/16. */ public class DashboardConfig { @Getter @Setter private String defaultConfig; public DashboardConfig(String defaultConfig) { this.defaultConfig = defaultConfig; } public DashboardConfig() { defaultConfig = "POUET"; } }
[ "Benoit.Laurent@ge.com" ]
Benoit.Laurent@ge.com
21f3785da7d32b663b8af7bf9d6137092058b885
a249c2addc54fa5250d268f1c9cb71c1f555fec4
/learn-data-structures-and-algorithms/src/main/java/com/hqbhoho/bigdata/data/structures/stack/MinStack.java
3e7c385cc53780f3c567ceef1d9a6461f3003f58
[]
no_license
hqbhoho/learn-bigdata
3bb16248eed5498758bf3f98179242078ed6ddf7
cb2eca9b1b795a4a8712850f0ec49a32b2f7922d
refs/heads/master
2022-11-21T16:48:22.455348
2020-09-15T01:30:16
2020-09-15T01:30:28
173,652,937
19
7
null
2022-11-16T11:46:09
2019-03-04T01:31:39
Java
UTF-8
Java
false
false
1,428
java
package com.hqbhoho.bigdata.data.structures.stack; import java.util.EmptyStackException; /** * describe: * * @author hqbhoho * @version [v1.0] * @date 2020/04/17 */ public class MinStack { public static void main(String[] args) { MinStack minStack = new MinStack(); minStack.push(-2); minStack.push(0); minStack.push(-1); System.out.println(minStack.getMin()); System.out.println(minStack.top()); minStack.pop(); System.out.println(minStack.getMin()); } static class Node { int val; Node next; int curMin; public Node(int val) { this.val = val; } } private Node first; /** * initialize your data structure here. */ public MinStack() { } public void push(int x) { Node cur = new Node(x); cur.next = first; if(first != null && cur.val >= first.curMin){ cur.curMin = first.curMin; }else{ cur.curMin = cur.val; } first = cur; } public void pop() { if (first == null) throw new EmptyStackException(); Node node = first; first = first.next; node.next = null; } public int top() { if (first == null) throw new EmptyStackException(); return first.val; } public int getMin() { return first.curMin; } }
[ "13638680321@163.com" ]
13638680321@163.com
89091c3d8b323cef904b78339354df0753f5789e
997d376ecbdba35561d29ebdca72cc77166a878a
/app/src/main/java/com/example/hospital/Hospital_2.java
af7f666ca33171824161c8f0e05eaaea9cbec65a
[]
no_license
MZaimM/HospitalApp-Android-Studio
f3d60618dc9f0aa8254c924248c9d613fa45ebe9
92ade5cb1c1ceb4a98d02e026c60bf24c8e82f45
refs/heads/master
2022-11-16T17:00:09.976765
2020-07-08T23:13:38
2020-07-08T23:13:38
278,059,366
2
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.example.hospital; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class Hospital_2 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_hospital_2); } }
[ "maulanazaim900@gmail.com" ]
maulanazaim900@gmail.com
8cfbabe4c49ea0efc47d1d3febc5395548171be5
06d3809a71fb0a62de7b99f2c643c4ccf8174f84
/src/main/java/net/mcreator/googlymod/item/GooglitePickaxeItem.java
e46b71457d682a33e3902ade92cc133b6dd87502
[]
no_license
Phantomere/TheGooglyMod
ac5c731e60386ec5b61312898df45b4a19f85081
8c2a13700afc0cb3e3b2b5bc0371c78f1b169e18
refs/heads/master
2023-03-07T17:28:44.218415
2021-02-15T19:09:41
2021-02-15T19:09:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,843
java
package net.mcreator.googlymod.item; import net.minecraftforge.registries.ObjectHolder; import net.minecraft.world.World; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.ITextComponent; import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.PickaxeItem; import net.minecraft.item.ItemStack; import net.minecraft.item.Item; import net.minecraft.item.IItemTier; import net.minecraft.client.util.ITooltipFlag; import net.mcreator.googlymod.itemgroup.GooglyModItemGroup; import net.mcreator.googlymod.GooglymodModElements; import java.util.List; @GooglymodModElements.ModElement.Tag public class GooglitePickaxeItem extends GooglymodModElements.ModElement { @ObjectHolder("googlymod:googlite_pickaxe") public static final Item block = null; public GooglitePickaxeItem(GooglymodModElements instance) { super(instance, 35); } @Override public void initElements() { elements.items.add(() -> new PickaxeItem(new IItemTier() { public int getMaxUses() { return 4002; } public float getEfficiency() { return 9f; } public float getAttackDamage() { return 2f; } public int getHarvestLevel() { return 5; } public int getEnchantability() { return 28; } public Ingredient getRepairMaterial() { return Ingredient.fromStacks(new ItemStack(GoogliteIngotItem.block, (int) (1))); } }, 1, -3f, new Item.Properties().group(GooglyModItemGroup.tab)) { @Override public void addInformation(ItemStack itemstack, World world, List<ITextComponent> list, ITooltipFlag flag) { super.addInformation(itemstack, world, list, flag); list.add(new StringTextComponent("The pickaxe glows with an ethereal light")); } }.setRegistryName("googlite_pickaxe")); } }
[ "Hooligans@192.168.55.162" ]
Hooligans@192.168.55.162
7fff51dd22178bb08e483e0f27889d5a04838563
1149bf13edc32114438602bf5c1fc7c25d0b9d2a
/twq_websocket/src/test/java/test/Testsql.java
f736617eed490812949fdb0e3fd34c329111b93b
[]
no_license
qingyunhui/daocaore
eb1628456793bd037be7695d031f2c5d8e83699e
83babdda2b1623b38c0c05068e0c1ba24394debb
refs/heads/master
2021-01-13T02:45:12.027589
2017-08-15T12:40:24
2017-08-15T12:40:24
77,363,706
0
0
null
null
null
null
UTF-8
Java
false
false
26,413
java
package test; import java.sql.ResultSet; import java.sql.SQLException; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.Hashtable; import java.util.List; import com.tw.jdbc.SqlserverJdbc; import com.tw.util.FileUtil; public class Testsql { public static void main(String[] args) throws Exception{ SqlserverJdbc db = temPlan("1"); /*StringBuilder sb = new StringBuilder(); sb.append("[").append("{field : 'FItemID',title : '序号',width : 100,rowspan:2}").append(",") .append("{field : 'FNumber',title : '物料编号',width : 100,rowspan:2}").append(",") .append("{field : 'FName',title : '物料名称',width : 100,rowspan:2}").append(",") .append("{field : 'FModel',title : '物料规格',width : 100,rowspan:2}").append(",") .append("{field : 'CLQty',title : '材料仓库存',width : 100,rowspan:2}").append(",") .append("{field : 'DJQty',title : '待检仓库存',width : 100,rowspan:2}").append(",") .append("{field : 'TLFQty',title : '在制需求量',width : 100,rowspan:2}").append(",") .append("{field : '',title : '总计',colspan:3}").append(","); ResultSet rs = db.ExecuteQuery("select distinct PlanDate from #TmpScheduling order by PlanDate"); try { while (rs.next()) { sb.append("{field : '',title : '"+rs.getString(1)+"',colspan:4}").append(","); ResultSet rs01 = db.ExecuteQuery("select ErpNo from #TmpScheduling where PlanDate='"+rs.getString(1)+"' order by schedulingSeq"); while (rs01.next()) { sb.append("{field : '',title : '"+rs01.getString(1)+"',colspan:2}").append(","); } } } catch (SQLException e) { e.printStackTrace(); } sb.deleteCharAt(sb.length()-1); sb.append("],[").append("{field : 'PlanNum',title : '总计划入库数',width : 100}").append(",") .append("{field : 'TXqty',title : '总需求数量',width : 100}").append(",") .append("{field : 'TSqty',title : '总剩余数量',width : 100}").append(","); ResultSet rs01 = db.ExecuteQuery("select distinct PlanDate from #TmpScheduling order by PlanDate"); try { while (rs01.next()) { sb.append("{field : 'D-").append(rs01.getString(1)).append("-1',title : '计划入库数',width : 100}").append(",") .append("{field : 'D-").append(rs01.getString(1)).append("-2',title : '可用数量',width : 100}").append(",") .append("{field : 'D-").append(rs01.getString(1)).append("-3',title : '需求数量',width : 100}").append(",") .append("{field : 'D-").append(rs01.getString(1)).append("-4',title : '剩余数量',width : 100}").append(","); ResultSet rs02 = db.ExecuteQuery("select ErpNo from #TmpScheduling where PlanDate='"+rs01.getString(1)+"' order by schedulingSeq"); while (rs02.next()) { sb.append("{field : 'E-").append(rs02.getString(1)).append("-1',title : '需求数量',width : 100}").append(",") .append("{field : 'E-").append(rs02.getString(1)).append("-2',title : '剩余数量',width : 100}").append(","); } } } catch (SQLException e) { e.printStackTrace(); } sb.deleteCharAt(sb.length()-1).append("]"); System.out.println(sb.toString());*/ // db.Close(); // mtlist(db); db.Close(); } private static void mtlist(SqlserverJdbc db2) throws Exception{ String sql = ""; String sql1 = ""; ResultSet rs = null; List<String[]> list = null; DecimalFormat fnum = new DecimalFormat("##0.00"); try{ sql = " select a.FItemID, a.FNumber, a.FName, a.FModel, cast(a.FQty as numeric(10,2)) as FQty, " + " cast(isnull(b.CLQty,0) as numeric(10,2)) as CLQty, cast(isnull(b.DJQty,0) as numeric(10,2)) as DJQty, " + " cast(isnull(c.FNeedQty,0) as numeric(10,2)) as TLFQty, cast(isnull(d.PlanNum,0) as numeric(10,2)) as PlanNum " + " from( " + " select FItemID, FNumber, FName, FModel, sum(FQty) as FQty " + " from #TmpErpMtInfo " + " group by FItemID, FNumber, FName, FModel " + " ) a " + " left join #TmpStockInfo b on a.FItemID=b.FItemID " + " left join V_UM_MRP_PPBomEntry c on a.FItemID=c.FItemID " + " left join ( " + " select FItemID, FNumber, sum(a.PlanNum) as PlanNum " + " from #TmpDatePlanInPut a " + " join ( " + " select distinct PlanDate from #TmpScheduling " + " ) b on a.DateStr=b.PlanDate " + " group by FItemID, FNumber " + " ) d on a.FItemID=d.FitemID " + " order by a.FNumber "; rs = db2.ExecuteQuery(sql); list = new ArrayList<String[]>(); List<Hashtable<String, Object>> rows = new ArrayList<Hashtable<String, Object>>(); StringBuilder sb = new StringBuilder(); sb.append("{\"total\":28,\"rows\":["); int index = 0; while(rs.next()){ /*String[] str ={ rs.getString("FItemID").trim(), ""+(++index), rs.getString("FNumber").trim(), rs.getString("FName").trim(), rs.getString("FModel").trim(), rs.getString("CLQty").trim(), rs.getString("DJQty").trim(), rs.getString("TLFQty").trim(), rs.getString("PlanNum").trim(), (fnum.format(rs.getFloat("FQty")))+"", (fnum.format(rs.getFloat("CLQty")+rs.getFloat("DJQty")-rs.getFloat("TLFQty") +rs.getFloat("PlanNum")-rs.getFloat("FQty")))+"" }; list.add(str);*/ sb.append("{").append("\"FItemID\":\"").append(rs.getString("FItemID").trim()).append("\"").append(",") .append("\"FNumber\":\"").append(rs.getString("FNumber").trim()).append("\"").append(",") .append("\"FName\":\"").append(rs.getString("FName").trim()).append("\"").append(",") .append("\"FModel\":\"").append(rs.getString("FModel").trim()).append("\"").append(",") .append("\"CLQty\":\"").append(rs.getString("CLQty").trim()).append("\"").append(",") .append("\"DJQty\":\"").append(rs.getString("DJQty").trim()).append("\"").append(",") .append("\"TLFQty\":\"").append(rs.getString("TLFQty").trim()).append("\"").append(",") .append("\"PlanNum\":\"").append(rs.getString("PlanNum").trim()).append("\"").append(",") .append("\"TXqty\":\"").append(fnum.format(rs.getFloat("FQty")+rs.getFloat("TLFQty"))).append("\"").append(",") .append("\"TSqty\":\"").append(fnum.format(rs.getFloat("CLQty")+rs.getFloat("DJQty")-rs.getFloat("FQty") -rs.getFloat("TLFQty"))).append("\"").append(","); sql1 = " select b.FItemID, c.FNumber, b.des, b.Data_1, b.Data_2, a.DateSeq, a.ErpSeq, b.Data_seq " + " from( " + " select b.ErpNo as des, a.seq as DateSeq, b.seq as ErpSeq " + " from #tmpDateSeq a " + " join #tmpErpSeq b on a.DateStr=b.DateStr " + " union all " + " select DateStr as des, seq as DateSeq, 0 as ErpSeq " + " from #tmpDateSeq " + " ) a " + " join( " + " select DateStr as des, FItemID, '\"D-'+DateStr+'-1\":\"'+cast(PlanNum as varchar(20))+'\"' as Data_1,'\"D-'+DateStr+'-2\":\"'+cast(KFQty as varchar(20))+'\"' as Data_2, 1 as Data_seq from #tmpDateMt_2 " + " union all " + " select DateStr as des, FItemID, '\"D-'+DateStr+'-3\":\"'+cast(FQty as varchar(20))+'\"' as Data_1,'\"D-'+DateStr+'-4\":\"'+cast(SFQty as varchar(20))+'\"' as Data_2, 1 as Data_seq from #tmpDateMt_2 " + " union all " + " select ErpNo as des, FItemID, '\"E-'+ErpNo+'-1\":\"'+cast(FQty as varchar(20))+'\"' as Data_1, '\"E-'+ErpNo+'-2\":\"'+cast(SFQty as varchar(20))+'\"' as Data_2, 1 as Data_seq from #tmpErpMt_2 " + " ) b on a.des=b.des " + " join( " + " select distinct FItemID, FNumber from #TmpErpMtInfo " + " ) c on b.FItemID=c.FItemID where b.FItemID='"+rs.getString("FItemID").trim()+"'" + " order by c.FNumber, b.FItemID, a.DateSeq, a.ErpSeq, b.Data_seq "; ResultSet rs01 = db2.ExecuteQuery(sql1); while (rs01.next()) { sb.append(rs01.getString("Data_1")).append(",").append(rs01.getString("Data_2")).append(","); // System.out.println(rs01.getString("Data_1")+",,,,,,,,"+rs01.getString("Data_2")); } sb.deleteCharAt(sb.length()-1); sb.append("},"); // System.out.println("111111111111111111111111111111111111"); // Hashtable<String, Object> dic = new Hashtable<String, Object>(); // dic.put("FItemID", rs.getString("FItemID").trim()); // dic.put("FNumber", rs.getString("FNumber").trim()); // dic.put("FName", rs.getString("FName").trim()); // dic.put("FModel", rs.getString("FModel").trim()); // dic.put("CLQty", rs.getString("CLQty").trim()); // dic.put("DJQty", rs.getString("DJQty").trim()); // dic.put("TLFQty", rs.getString("TLFQty").trim()); // dic.put("PlanNum", rs.getString("PlanNum").trim()); // dic.put("TXqty", fnum.format(rs.getFloat("FQty")+rs.getFloat("TLFQty"))); // dic.put("TSqty", fnum.format(rs.getFloat("CLQty")+rs.getFloat("DJQty")-rs.getFloat("FQty")-rs.getFloat("TLFQty"))); // rows.add(dic); } sb.deleteCharAt(sb.length()-1); sb.append("]}"); // System.out.println(sb.toString()); // for (String[] s : list) { // System.out.println(Arrays.deepToString(s)); // } // return list; // FileUtil.create(sb.toString()); }catch(Exception e){ e.printStackTrace(); } } private static SqlserverJdbc temPlan(String typeFlag) throws Exception{ String condition = ""; if ("1".equals(typeFlag)) { condition = " and (b.FName like '%贴片%' or b.FName in('PCB-主板','PCB-WIFI小板','射频滤波器')) "; } else if ("2".equals(typeFlag)) { condition = " and b.Fname not like '%贴片%' and ( " + " (b.Fnumber like 'A.C%' " + " or b.Fnumber like 'A.R%' " + " or b.Fnumber like 'A.L%' " + " or b.Fnumber like 'A.D%' " + " or b.Fnumber like 'A.Q%' " + " or b.Fnumber like 'A.E%' " + " or b.Fnumber like 'A.X%' " + " or b.Fnumber like 'A.S%' " + " ) " + " or (b.Fnumber like 'A.P%' and b.FName not in('PCB-主板','PCB-WIFI小板')) " + " or b.FName in('陶瓷滤波器','插件晶体','插件晶振','高频变压器','调协器','插件IC','普通排线') " + ") "; } else if ("3".equals(typeFlag)) { condition = " and ( " + " b.Fnumber like 'A.H%' and b.Fname<>'普通排线' " + " or b.Fnumber like 'A.T%' and b.Fname<>'高频变压器' " + " or b.Fnumber like 'A.B%' " + " or b.Fnumber like 'A.F%' " + " or b.Fnumber like 'A.K%' " + " or b.Fnumber like 'A.M%' " + " or b.Fname in('喇叭','蜂鸣器','电视机','功能模块','IC卡') " + ") "; } SqlserverJdbc db = new SqlserverJdbc(); String sql = ""; sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpScheduling') and type='U') drop table #TmpScheduling "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpErpMtInfo') and type='U') drop table #TmpErpMtInfo "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpStockInfo') and type='U') drop table #TmpStockInfo "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpDateSeq') and type='U') drop table #TmpDateSeq "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpErpSeq') and type='U') drop table #TmpErpSeq "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpDatePlanInPut') and type='U') drop table #TmpDatePlanInPut "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpDatePlanInPut_1') and type='U') drop table #TmpDatePlanInPut_1 "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpErpNeedInPut') and type='U') drop table #TmpErpNeedInPut "; db.Execute(sql); //排程表信息 sql = " select ErpNo, CustName, ProNo, OrderNum, OrderDate, PlanDate, PlanNum, TypeFlag, SchedulingSeq " + " into #TmpScheduling " + " from( " + " select ErpNoSplit as ErpNo, CustName, ProNo, OrderNum, " + " CONVERT(varchar(10), OrderDate, 23) as OrderDate, " + " CONVERT(varchar(10), PatchPlanDate, 23) as PlanDate, " + " PatchPlanNum as PlanNum, 1 as TypeFlag, SchedulingSeq " + " from V_UM_MRP_Scheduling " + " where PatchPlanDate is not null and isnull(PatchPlanNum,0)<>0 " + " union all " + " select ErpNoSplit as ErpNo, CustName, ProNo, OrderNum, " + " CONVERT(varchar(10), OrderDate, 23) as OrderDate, " + " CONVERT(varchar(10), PluginPlanDate, 23) as PlanDate, " + " PluginPlanNum as PlanNum, 2 as TypeFlag, SchedulingSeq " + " from V_UM_MRP_Scheduling " + " where PluginPlanDate is not null and isnull(PluginPlanNum,0)<>0 " + " union all " + " select ErpNoSplit as ErpNo, CustName, ProNo, OrderNum, " + " CONVERT(varchar(10), OrderDate, 23) as OrderDate, " + " CONVERT(varchar(10), PackPlanDate, 23) as PlanDate, " + " PackPlanNum as PlanNum, 3 as TypeFlag, SchedulingSeq " + " from V_UM_MRP_Scheduling " + " where PackPlanDate is not null and isnull(PackPlanNum,0)<>0 " + " )a " + " where TypeFlag = '"+typeFlag+"' "; db.Execute(sql); // db.Execute("select * into tmp_Scheduling from #TmpScheduling"); //销售订单物料需求信息 sql = " select a.ErpNo, a.FInterID, a.FBOMNumber, a.FItemID, b.FName, b.FNumber, b.FModel, a.FAuxQty, a.FQty " + " into #TmpErpMtInfo " + " from( " + " select b.ErpNo, a.FBOMNumber, a.FInterID, a.FItemID, " + " sum(a.FAuxQty*b.PlanNum) as FAuxQty, sum(a.FQty*b.PlanNum) as FQty " + " from UM_MRP_BOMdetail a " + " join #TmpScheduling b on a.FBOMNumber=b.ProNo " + " group by b.ErpNo, a.FBOMNumber, a.FInterID, a.FItemID " + " )a " + " join t_ICItem b on a.FItemID=b.FItemID " + " where 1=1 "+condition + " order by a.ErpNo, a.FItemID "; db.Execute(sql); db.Execute("select * into tmp_ErpMtInfo from #TmpErpMtInfo"); //插入物料需求里可互替的XXX或XXR物料而又不在需求里的XXX或XXR物料 /* sql = " insert into #TmpErpMtInfo(ErpNo, FInterID, FBOMNumber, FItemID, FName, FNumber, FModel, FAuxQty, FQty) " + " select b.ErpNo, b.FInterID, b.FBOMNumber, a.FItemID, a.FName, a.FNumber, a.FModel, 0 as FAuxQty, 0 as FQty " + " from( " + " select a.* " + " from( " + " select distinct FItemID, FNumber, FName, FModel from #TmpErpMtInfo " + " union " + " select distinct b.FItemID_R, b.FNumber_R, b.FName_R, b.FModel_R from #TmpErpMtInfo a " + " join V_UM_MRP_t_icitem b on a.FItemID=b.FItemID " + " union " + " select distinct b.FItemID_X, b.FNumber_X, b.FName_X, b.FModel_X from #TmpErpMtInfo a " + " join V_UM_MRP_t_icitem b on a.FItemID=b.FItemID " + " ) a " + " left join #TmpErpMtInfo b on a.FItemID=b.FItemID " + " where b.FItemID is null " + " ) a " + " join( " + " select top 1 * from #TmpErpMtInfo " + " ) b on 1=1 "; db.Execute(sql); //插入替代物料 sql = "insert into #TmpErpMtInfo(ErpNo, FInterID, FBOMNumber, FItemID, FName, FNumber, FModel, FAuxQty, FQty) " + "select a.ErpStr, 0, '',b.FItemID, b.FName, b.FNumber, b.FModel, a.NeedNum as FAuxQty, a.NeedNum as FQty " + "from UM_MRP_SaveInfo_Dtl_ErpNeed a left join t_ICItem b on a.FNumber=b.FNumber " + "where a.FNumber not in (SELECT fnumber FROM #TmpErpMtInfo) "+condition; db.Execute(sql); //获取物料库存(材料仓和待检仓) sql = " select FItemID, CLQty, DJQty, CLQty+DJQty as StockQty " + " into #TmpStockInfo " + " from( " + " select FItemID, " + " sum(case when FstockID in(152,16477,29005) then FQty else 0 end) as CLQty, " + " sum(case when FstockID=151 then FQty else 0 end) as DJQty " + " from ICInventory " + " group by FItemID " + " ) a "; db.Execute(sql); //排程的日期排序 sql = " select DateStr, ROW_NUMBER() OVER(ORDER BY DateStr) as seq " + " into #tmpDateSeq " + " from( " + " select distinct PlanDate as DateStr from #TmpScheduling " + " )a "; db.Execute(sql); //排程的销售订单排序 sql = " select PlanDate as DateStr, ErpNo, ROW_NUMBER() OVER(PARTITION BY PlanDate ORDER BY SchedulingSeq) as seq " + " into #tmpErpSeq " + " from #TmpScheduling "; db.Execute(sql); sql = "select a.DateStr, c.FItemID, c.FNumber, a.PlanNum " + "into #TmpDatePlanInPut " + "from UM_MRP_SaveInfo_Dtl_DatePlan a " + "join (select FNumber,max(versionDate) versionDate from UM_MRP_SaveInfo_Dtl_DatePlan group by FNumber) b " + "on a.FNumber = b.FNumber and a.versionDate=b.versionDate " + "join t_icitem c on b.FNumber=c.FNumber where a.MtType='"+typeFlag+"'"; db.Execute(sql); //最新操作日期的需求数量 sql = "select a.ErpStr as ErpNo, c.FItemID, c.FNumber, a.NeedNum " + "into #TmpErpNeedInPut " + "from UM_MRP_SaveInfo_Dtl_ErpNeed a " + "join (select ErpStr, FNumber,max(versionDate) versionDate " + "from UM_MRP_SaveInfo_Dtl_ErpNeed group by ErpStr, FNumber) b " + "on a.ErpStr = b.ErpStr and a.FNumber = b.FNumber and a.versionDate=b.versionDate " + "join t_icitem c on b.FNumber=c.FNumber where a.MtType='"+typeFlag+"'"; db.Execute(sql); //每个计划日期物料的计划数 sql = " select a.PlanDate, a.FItemID, isnull(b.PlanNum, 0) as PlanNum " + " into #TmpDatePlanInPut_1 " + " from( " + " select a.PlanDate, b.FItemID " + " from( " + " select distinct PlanDate from #TmpScheduling " + " ) a " + " join ( " + " select distinct FItemID from #TmpDatePlanInPut " + " ) b on 1=1 " + " ) a " + " left join #TmpDatePlanInPut b on a.PlanDate=b.DateStr and a.FItemID=b.FItemID "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpDateMt') and type='U') drop table #TmpDateMt "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tmpDateMt_1') and type='U') drop table #TmpDateMt_1 "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tmpDateMt_2') and type='U') drop table #TmpDateMt_2 "; db.Execute(sql); //每个计划日期的物料库存 需求 计划数 sql = " select a.DateStr, a.FItemID, isnull(c.StockQty,0) as StockQty, " + " isnull(b.FQty,0) as FQty, isnull(d.PlanNum,0) as PlanNum " + " into #TmpDateMt " + " from( " + " select DateStr, FItemID " + " from( " + " select distinct PlanDate as DateStr from #TmpScheduling " + " ) a " + " join( " + " select distinct FItemID from #TmpErpMtInfo " + " ) b on 1=1 " + " ) a " + " left join ( " + " select b.PlanDate as DateStr, a.FItemID, sum(FQty) as FQty " + " from #TmpErpMtInfo a " + " join #TmpScheduling b on a.ErpNo=b.ErpNo " + " group by b.PlanDate, a.FItemID " + " ) b on a.DateStr=b.DateStr and a.FItemID=b.FItemID " + " left join #TmpStockInfo c on a.FItemID=c.FItemID " + " left join #TmpDatePlanInPut d on a.DateStr=d.DateStr and a.FItemID=d.FItemID "; db.Execute(sql); sql = " select a.DateStr, a.FItemID, a.StockQty, a.PlanNum, a.FQty, " + " sum(b.FQty) as TFQty, a.StockQty+sum(b.PlanNum)-sum(b.FQty) as SFQty, " + " a.StockQty+sum(b.PlanNum)-sum(b.FQty)+a.FQty as KFQty " + " into #tmpDateMt_1 " + " from #tmpDateMt a " + " join #tmpDateMt b on a.FItemID=b.FItemID and a.DateStr>=b.DateStr " + " group by a.DateStr, a.FItemID, a.StockQty, a.PlanNum, a.FQty " + " order by a.FItemID, a.DateStr "; db.Execute(sql); sql = " select a.DateStr, a.FItemID, a.StockQty, a.PlanNum, a.FQty, " + " a.TFQty, a.SFQty+isnull(b.FNeedQty,0) as SFQty, " + " a.KFQty+isnull(b.FNeedQty,0) as KFQty " + " into #tmpDateMt_2 " + " from #tmpDateMt_1 a " + " left join V_UM_MRP_PPBomEntry b on a.FItemID=b.FItemID "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpErpMt') and type='U') drop table #TmpErpMt "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpErpMt_1') and type='U') drop table #TmpErpMt_1 "; db.Execute(sql); sql = " if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TmpErpMt_2') and type='U') drop table #TmpErpMt_2 "; db.Execute(sql); sql = " select a.ErpNo, a.PlanDate, a.seq, a.FItemID, isnull(StockQty,0) as StockQty, isnull(e.PlanNum,0) as PlanNum, " + " isnull(f.NeedNum, isnull(b.FQty,0)) as FQty " + " into #TmpErpMt " + " from( " + " select a.ErpNo, a.PlanDate, a.seq, b.FItemID " + " from( " + " select distinct ErpNo, PlanDate, ROW_NUMBER() OVER(ORDER BY PlanDate, SchedulingSeq) as seq " + " from #TmpScheduling " + " )a " + " join( " + " select distinct FItemID from #TmpErpMtInfo " + " )b on 1=1 " + " ) a " + " left join #TmpErpMtInfo b on a.ErpNo=b.ErpNo and a.FItemID=b.FItemID " + " left join #TmpStockInfo c on a.FItemID=c.FItemID " + " left join ( " + " select a.PlanDate, a.FItemID, sum(b.PlanNum) as PlanNum " + " from #TmpDatePlanInPut_1 a " + " join #TmpDatePlanInPut_1 b on a.FItemID=b.FItemID and a.PlanDate>=b.PlanDate " + " group by a.PlanDate, a.FItemID " + " ) e on a.PlanDate=e.PlanDate and a.FItemID=e.FItemID " + " left join #TmpErpNeedInPut f on a.ErpNo=f.ErpNo and a.FItemID=F.FItemID " + " order by a.FItemID, a.seq "; db.Execute(sql); sql = " select a.PlanDate, a.FItemID, a.StockQty, a.ErpNo, a.FQty, a.seq, " + " sum(b.FQty) as TFQty, a.StockQty+a.PlanNum-sum(b.FQty) as SFQty " + " into #tmpErpMt_1 " + " from #tmpErpMt a " + " join #tmpErpMt b on a.FItemID=b.FItemID and a.seq>=b.seq " + " group by a.PlanDate,a.FItemID, a.StockQty, a.ErpNo, a.FQty, a.seq, a.PlanNum " + " order by a.FItemID, a.seq "; db.Execute(sql); sql = " select a.FItemID, a.StockQty, a.ErpNo, a.FQty, a.seq, " + " a.TFQty, a.SFQty+isnull(b.FNeedQty,0) as SFQty " + " into #tmpErpMt_2 " + " from #tmpErpMt_1 a " + " left join V_UM_MRP_PPBomEntry b on a.FItemID=b.FItemID "; db.Execute(sql);*/ return db; } }
[ "qingyunhui@zuozh.com" ]
qingyunhui@zuozh.com
741ae46ad80a4095cbeec01be1615d726820aabc
3a637dea0c295968857c2ed909e077e28196ed72
/CoreJava/Day07/Lesson/Person.java
2e81cde62fb72ffb1062d58f6554650e9469f119
[]
no_license
fly-liuhao/StudyNotes
bcd0bbb41f6be38553ce371759b4e5d6ae4ed1bb
66665bcb1d6cf04da5f9a0eafbb649300d17f22c
refs/heads/master
2022-10-29T18:32:17.569707
2019-09-23T09:29:23
2019-09-23T09:29:23
210,117,079
0
0
null
2022-10-06T04:49:16
2019-09-22T08:50:24
HTML
UTF-8
Java
false
false
2,363
java
/** * @项目名称: Javacore * @文件名称: Person.java * @Date: 2019年5月12日 * @Copyright: 2019 www.xxx.com Inc. All rights reserved. * 注意:本内容仅限于xxx公司内部传阅,禁止外泄以及用于其他的商业目的 */ package cn.edu.tit.corejava07; /** * OOP-封装、继承 * * @author: liuhao * @version 1.0 */ public class Person { public int ageplus = 10; private String name; public int age = ageplus; private String sex; /** * 父类默认构造函数 */ public Person() { System.out.println("这里是父类的默认构造方法"); } /** * 父类带参构造函数 * * @param name * @param age * @param sex */ public Person(String name, int age, String sex) { this.name = name; this.age = age; this.sex = sex; System.out.println("这里是父类的带参构造方法"); } /** * 父类说话方法 */ public void speak() { System.out.println("哈喽~"); } } class Student extends Person { int score; public Student() { // super(); System.out.println("这里是子类Student的构造方法!"); } /** * 子类Student重写父类的speak()方法 */ public void speak() { System.out.println("我是一名学生..."); } /** * 子类Student独有的写作业方法 */ public void doHomeWork() { System.out.println("我正在写作业!"); } } class Teacher extends Person { int workAge; public Teacher() { System.out.println("这里是子类Teacher的构造方法!"); } /** * 子类Teacher重写父类的speak()方法 */ public void speak() { System.out.println("我是一名老师..."); } /** * 子类Teacher独有的批改作业方法 */ public void checkHomeWork() { System.out.println("我正在批改作业!"); } } class Test extends Person { public static void main(String[] args) { // 创建子类对象 Student student = new Student(); Teacher teacher = new Teacher(); // 调用子类重写方法以及子类特有方法 student.speak(); student.doHomeWork(); teacher.speak(); teacher.checkHomeWork(); } }
[ "15364925795@163.com" ]
15364925795@163.com
0420d7a3009834e68b4f32b0944cde3c5a94bf5b
db8dbf01da44f8eea938f143a9bd7c4015d4a784
/src/main/java/FindElementExample3.java
b07451215915908a761fa2eb6361e86d5245893a
[]
no_license
HariHaraKumarC/SELENIUM-BASICS
5f5d6dca3a7bbe4ef1b6f43c78e837dd52d581f7
4c2b73730f3418868cdd590dc34693fa69cc916a
refs/heads/master
2020-03-25T02:49:57.915816
2018-08-04T18:06:00
2018-08-04T18:06:00
143,309,510
0
0
null
null
null
null
UTF-8
Java
false
false
1,486
java
import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import java.util.Iterator; import java.util.List; /** * Created by harih on 8/2/2018. * Used Locator: Tag Selector */ public class FindElementExample3 extends HelloBrowserWebDriver { public static void main(String[] args){ FindElementExample3 findElementExample3=new FindElementExample3(); WebDriver driver= findElementExample3.getBrowserDriver("Chrome"); findElementExample3.launchGoogleAppsFromGoogleHome(driver); } public void launchGoogleAppsFromGoogleHome(WebDriver driver){ String url = "https://www.google.com/"; //To Maximise the window driver.manage().window().maximize(); driver.get(url); try { List <WebElement> anchorTags=driver.findElements(By.tagName("a")); Iterator<WebElement> iterator=anchorTags.iterator(); while(iterator.hasNext()){ WebElement anchor= iterator.next(); if(anchor.getAttribute("title").equalsIgnoreCase("Google apps")){ anchor.click(); break; } } System.out.println("Google App Launched Successfully from Google Home Page..."); }catch(NoSuchElementException e){ System.out.println("No Such Element Exception occured > "+e); } } }
[ "hariharakumar.c@outlook.com" ]
hariharakumar.c@outlook.com
141d3037c339473cb6def94e5b68eaf77e6fd21f
64ff5c4eee0df08cf8939a3a06bff925730dba80
/src/main/java/com/dr/mutiplethreads/chapter4/ConditionTestMoreMethod/extthread/ThreadBB.java
a6b6946b43c2fd4fdd7c7f97f2ed2ac8aa5df361
[]
no_license
topEngineerRay/learning
0b06cb4a9b76c12cb00badc933037db6361d8bbb
57daac31c7884ae81bdbc1c885d2d0f6b83f30b2
refs/heads/master
2020-09-03T08:33:48.251289
2019-11-04T05:49:03
2019-11-04T05:49:03
219,426,619
0
0
null
null
null
null
UTF-8
Java
false
false
381
java
package com.dr.mutiplethreads.chapter4.ConditionTestMoreMethod.extthread; import com.dr.mutiplethreads.chapter4.ConditionTestMoreMethod.service.MyService; public class ThreadBB extends Thread { private MyService service; public ThreadBB(MyService service) { super(); this.service = service; } @Override public void run() { service.methodB(); } }
[ "ray.ding@sap.com" ]
ray.ding@sap.com
e74dd56948086d4d3d80c540004d924baa953f17
a2b61de1300b5d082ec8058ec053645456349601
/src/main/java/com/ike/o2o/entity/Product.java
80d7beec7eb219deb1e1b70588b56a309edc0d0b
[]
no_license
z18601963410/o2o
908ab52014a324710b86f4ca33833ae619b008a6
716cae09eb5d5f63e52b9f67583d02ad26db64af
refs/heads/master
2023-05-05T10:13:17.252519
2021-05-27T05:38:33
2021-05-27T05:38:33
359,774,618
0
0
null
null
null
null
UTF-8
Java
false
false
4,078
java
package com.ike.o2o.entity; import java.util.Date; import java.util.List; /** * 商品类 */ public class Product { private Long productId; private String productName; private String productDesc; private String imgAddr; //商品正常价格 private String normalPrice; //商品折扣价格 private String promotionPrice; private Integer priority; //商品积分 private Integer point; private Date createTime; private Date lastEditTime; //-1 不可用 ,0 下架,1 在前端系统展示 private Integer enableStatus; private List<ProductImg> productImgList; private ProductCategory productCategory; private Shop shop; public Product(String productName) { this.productName = productName; } public Product() { } @Override public String toString() { return "Product{" + "productId=" + productId + ", productName='" + productName + '\'' + ", productDesc='" + productDesc + '\'' + ", imgAddr='" + imgAddr + '\'' + ", normalPrice='" + normalPrice + '\'' + ", promotionPrice='" + promotionPrice + '\'' + ", priority=" + priority + ", point=" + point + ", createTime=" + createTime + ", lastEditTime=" + lastEditTime + ", enableStatus=" + enableStatus + ", productImgList=" + productImgList + ", productCategory=" + productCategory + ", shop=" + shop + '}'; } public void setProductId(Long productId) { this.productId = productId; } public Integer getPoint() { return point; } public void setPoint(Integer point) { this.point = point; } public Long getProductId() { return productId; } public void setProductID(Long productId) { this.productId = productId; } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } public String getProductDesc() { return productDesc; } public void setProductDesc(String productDesc) { this.productDesc = productDesc; } public String getImgAddr() { return imgAddr; } public void setImgAddr(String imgAddr) { this.imgAddr = imgAddr; } public String getNormalPrice() { return normalPrice; } public void setNormalPrice(String normalPrice) { this.normalPrice = normalPrice; } public String getPromotionPrice() { return promotionPrice; } public void setPromotionPrice(String promotionPrice) { this.promotionPrice = promotionPrice; } public Integer getPriority() { return priority; } public void setPriority(Integer priority) { this.priority = priority; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getLastEditTime() { return lastEditTime; } public void setLastEditTime(Date lastEditTime) { this.lastEditTime = lastEditTime; } public Integer getEnableStatus() { return enableStatus; } public void setEnableStatus(Integer enableStatus) { this.enableStatus = enableStatus; } public List<ProductImg> getProductImgList() { return productImgList; } public void setProductImgList(List<ProductImg> productImgList) { this.productImgList = productImgList; } public ProductCategory getProductCategory() { return productCategory; } public void setProductCategory(ProductCategory productCategory) { this.productCategory = productCategory; } public Shop getShop() { return shop; } public void setShop(Shop shop) { this.shop = shop; } }
[ "644511451@qq.com" ]
644511451@qq.com
17953e40b00b3fdbc25bb4228571c991e175938e
00dfd0396b4677f0f88e5bad50f91b6dceddbd07
/src/main/java/com/restful/webservices/restfulWebServices/Dao/StudentDoa.java
6937851599d7b15e215a7b1a598ea2e7d59f2683
[]
no_license
rajiv5555/restfulWebServices
1537e29d3b0acca40a7ff6b43118d40e52969fcb
58041453a9a484e74ac6bf51dd25211e3f30b195
refs/heads/master
2022-10-24T17:59:59.018624
2020-06-14T08:46:12
2020-06-14T08:46:12
268,244,168
1
0
null
null
null
null
UTF-8
Java
false
false
368
java
/** * */ package com.restful.webservices.restfulWebServices.Dao; import com.restful.webservices.restfulWebServices.readRepository.StudentReadRepository; import com.restful.webservices.restfulWebServices.writeRepository.StudentWriteRepository; /** * @author rajivranjan * */ public interface StudentDoa extends StudentReadRepository,StudentWriteRepository { }
[ "rajiv.r@zivame.com" ]
rajiv.r@zivame.com
5d14e59d076d2c9ee5aa17fc13129c8890ff1ef3
caa93e04defd9a2cdb6bd02fa683df942f36546d
/src/main/java/Result.java
9e2381ee41ddf0a2e5ce8d691106d0ca1010c770
[]
no_license
ayham-Ghanem/Coin_Converter
ca679c4ee1e5132e0c5dda8a352d0927a73b08d5
ab33754c8a883a5b56fd8b539a475e261d1043e1
refs/heads/master
2023-06-02T17:24:57.904340
2021-06-23T08:19:18
2021-06-23T08:19:18
376,073,694
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
public class Result { private double amount; private String conversion; public Result(double amount, String conversion){ this.amount = amount; this.conversion = conversion; } public double getAmount() { return amount; } public String getConversion() { return conversion; } @Override public String toString(){ return conversion + " --> " + amount ; } }
[ "ayham.ghanem.2000@gmail.com" ]
ayham.ghanem.2000@gmail.com
0a15bd71fff5081503f64a378fd18ddb6ee78a91
30ccb24638f8299a0777e5d537d4779735d7f0ca
/monri/src/main/java/com/monri/android/exception/PermissionException.java
1520bb60c11935703a8802042e6c892a5513207d
[ "MIT" ]
permissive
MonriPayments/monri-android
c24165d2782fba2eb0041c9a0f3adaffb340e30f
0345c372e0f7c1a0295795f44c87999b284c4215
refs/heads/development
2023-02-05T14:05:02.281805
2023-02-02T09:02:32
2023-02-02T09:02:32
219,746,836
2
0
MIT
2023-02-02T09:02:34
2019-11-05T13:04:51
Java
UTF-8
Java
false
false
374
java
package com.monri.android.exception; /** * A type of {@link AuthenticationException} resulting from incorrect permissions * to perform the requested action. */ public class PermissionException extends AuthenticationException { public PermissionException(String message, String requestId, Integer statusCode) { super(message, requestId, statusCode); } }
[ "jasmin.suljich@gmail.com" ]
jasmin.suljich@gmail.com
4cd6c13df5fdfabf159d10c85f19083ea5d3c523
fd2cc9c9879f114ee18811de6adcfeb2ec21843c
/src/test/java/com/travelers/tests/SearchHotelTest.java
4472f296055b82f47b2e368e5313ac419f738c25
[]
no_license
monikador/Base
4db96b8bbef9474add936d1590f9be4cb96d0f6d
aaa44870d01e53c772717cd90c4d473a5314e560
refs/heads/main
2023-02-12T05:20:21.607366
2021-01-11T12:30:43
2021-01-11T12:30:43
323,268,272
0
0
null
null
null
null
UTF-8
Java
false
false
1,380
java
package com.travelers.tests; import com.travelers.pages.HomePage; import com.travelers.pages.ResultPage; import org.testng.Assert; import org.testng.annotations.Test; import java.util.List; public class SearchHotelTest extends BaseSeleniumTest { @Test public void searchHotelTest() { // driver.manage().timeouts().implicitlyWait(15L, TimeUnit.SECONDS); driver.get("http://www.kurs-selenium.pl/demo/"); //HomePage homePage = new HomePage((driver)); // ResultPage resultPage = homePage HomePage homePage = new HomePage((driver)); homePage.SetCityHotel("Dubai") .setDateRange("09/11/2018", "09/13/2018") .openTravellersInput() .setAdult() .setChild() .setChild() .performSearchButton(); ResultPage resultPage = new ResultPage(driver); List<String> homeName = resultPage.getHotelNames(); Assert.assertEquals(homeName.get(0),"Jumeirah Beach Hotel"); Assert.assertEquals(homeName.get(1),"Oasis Beach Tower"); Assert.assertEquals(homeName.get(2),"Rose Rayhaan Rotana"); List<String> prices = resultPage.getHotelPrices(); Assert.assertEquals(prices.get(0),"$22"); Assert.assertEquals(prices.get(1),"$50"); Assert.assertEquals(prices.get(2),"$80"); } }
[ "mtokarczyk77@gmail.com" ]
mtokarczyk77@gmail.com
ceeb63775aea8bc7a18157069bcd7af737c02a2c
1f9f2bfc10ed8dbb2e1109d5c98a980fae4590a2
/app/src/main/java/com/ckz/baisi/view/BudejieRefresh.java
8e237d57f1f4aca81456eec8d7dd15b3861bb6dd
[ "Apache-2.0" ]
permissive
c786909486/baisi
05cb1ba8cd486b1a3b141f4bd6c9f0a6caee95a7
141bb6050d54152cb654a5527737dbb268d79bb4
refs/heads/master
2021-01-12T03:21:22.428048
2017-04-25T05:01:01
2017-04-25T08:32:50
78,198,739
0
0
null
null
null
null
UTF-8
Java
false
false
3,319
java
package com.ckz.baisi.view; import android.content.Context; import android.graphics.drawable.AnimationDrawable; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; import com.ckz.baisi.R; import com.lcodecore.tkrefreshlayout.IHeaderView; import com.lcodecore.tkrefreshlayout.OnAnimEndListener; /** * Created by CKZ on 2017/2/5. */ public class BudejieRefresh extends FrameLayout implements IHeaderView { private ImageView pullIcon,refreshIcon; private TextView refreshTextView; public TextView refreshTime; public BudejieRefresh(Context context) { this(context, null); } public BudejieRefresh(Context context, AttributeSet attrs) { this(context, attrs, 0); } public BudejieRefresh(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); } private void init() { View rootView = View.inflate(getContext(), R.layout.refresh_layout, null); pullIcon = (ImageView) rootView.findViewById(R.id.pull_icon); refreshIcon = (ImageView) rootView.findViewById(R.id.refreshing_icon); refreshTextView = (TextView) rootView.findViewById(R.id.refresh_txt); refreshTime = (TextView) rootView.findViewById(R.id.refresh_time); addView(rootView); } public void setPullDownStr(String pullDownStr1) { pullDownStr = pullDownStr1; } public void setReleaseRefreshStr(String releaseRefreshStr1) { releaseRefreshStr = releaseRefreshStr1; } public void setRefreshingStr(String refreshingStr1) { refreshingStr = refreshingStr1; } private String pullDownStr = "下拉可以刷新"; private String releaseRefreshStr = "松开立即刷新"; private String refreshingStr = "正在刷新数据中..."; @Override public View getView() { return this; } @Override public void onPullingDown(float fraction, float maxHeadHeight, float headHeight) { if (fraction < 0.5f){ refreshTextView.setText(pullDownStr); pullIcon.setImageResource(R.drawable.pull_animation); } if (fraction > 0.5f) {refreshTextView.setText(releaseRefreshStr);} pullIcon.setImageResource(R.drawable.release_ani); } @Override public void onPullReleasing(float fraction, float maxHeadHeight, float headHeight) { if (fraction < 0.5f) { refreshTextView.setText(pullDownStr); if (pullIcon.getVisibility() == GONE) { pullIcon.setVisibility(VISIBLE); refreshIcon.setVisibility(GONE); } } } @Override public void startAnim(float maxHeadHeight, float headHeight) { refreshTextView.setText(refreshingStr); pullIcon.setVisibility(GONE); refreshIcon.setVisibility(VISIBLE); ((AnimationDrawable) refreshIcon.getDrawable()).start(); } @Override public void onFinish(OnAnimEndListener listener) { listener.onAnimEnd(); } @Override public void reset() { pullIcon.setVisibility(VISIBLE); refreshIcon.setVisibility(GONE); refreshTextView.setText(pullDownStr); } }
[ "786909486@qq.com" ]
786909486@qq.com
c22298e1ae7e78d3aff8ee243457490de043e17b
32f38cd53372ba374c6dab6cc27af78f0a1b0190
/app/src/main/java/com/autonavi/minimap/route/bus/localbus/overlay/RouteBusPointOverlay.java
acc0b0f223d62c13f2850418359b5dbd009aaeb1
[]
no_license
shuixi2013/AmapCode
9ea7aefb42e0413f348f238f0721c93245f4eac6
1a3a8d4dddfcc5439df8df570000cca12b15186a
refs/heads/master
2023-06-06T23:08:57.391040
2019-08-29T04:36:02
2019-08-29T04:36:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
319
java
package com.autonavi.minimap.route.bus.localbus.overlay; import com.autonavi.minimap.base.overlay.PointOverlay; import com.autonavi.minimap.base.overlay.PointOverlayItem; public class RouteBusPointOverlay extends PointOverlay<PointOverlayItem> { public RouteBusPointOverlay(bty bty) { super(bty); } }
[ "hubert.yang@nf-3.com" ]
hubert.yang@nf-3.com
0a36aca04d4553661bb9e830db057e51b4e1a2db
f901d5943af4ee151a7616f4d6371150b0e5393a
/src/com/example/fragment/FragmentTuan.java
b48544b319a5f46df605b4bf1328ba3dd00d7ffc
[]
no_license
zqq1314521/Dianping
0b52ecda3ababceea17497b72c46786fc8486d29
308af454e955fd599f86964d3b368625ec9cbba5
refs/heads/master
2021-01-18T15:08:16.963225
2015-10-18T14:45:19
2015-10-18T14:45:19
44,466,133
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
package com.example.fragment; import com.example.dianping.R; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class FragmentTuan extends Fragment{ @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // TODO Auto-generated method stub View view = inflater.inflate(R.layout.fragment_tuan, null); return view; } }
[ "loveibeyond@gmail.com" ]
loveibeyond@gmail.com
f31e3cf2bde3b6dafe8ec548e4fc50b0969254f8
f76ce1b785b1609f02dc107ab478cf6ea4ce1a62
/app/src/main/java/com/example/ejerciciofinal/AlertDialog.java
b16d705b6154533bcd3844fd7e8256e3b6441f2d
[]
no_license
itshio/EjercicioFinal
f8d9c7a102b5765147ab60a7bd309ac4a0a8d75e
ff5b3cd4d5f98a3ab4b0b649fc6a323c0c02fdb5
refs/heads/master
2021-04-29T21:52:20.075815
2018-02-19T10:33:11
2018-02-19T10:33:11
121,626,664
0
0
null
null
null
null
UTF-8
Java
false
false
944
java
package com.example.ejerciciofinal; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; /** * Created by DIDACT on 16/02/2018. */ public class AlertDialog extends DialogFragment { @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(getActivity()); builder.setMessage("Un ordenador de la prehistoria") .setTitle("Aplicacion creada por: ") .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); return builder.create(); } }
[ "morpheoosmatrix@gmail.com" ]
morpheoosmatrix@gmail.com
1349778dc16d52c0f04038bd258da9a4ceb251cd
df1ed0bac56a4b27b9889b9ebbdde76a6b258341
/src/if01/pkg10118025/latihan29/warnakepribadian/IF0110118025Latihan29WarnaKepribadian.java
89636df7368399c94380d22eefa750c3c96bde6a
[]
no_license
rizki2704/IF01-10118025-Latihan29-WarnaKepribadian
6dc87d843a6b84f17d0f5603ab650f4f3d25b1ea
959d8a1d8f2f9df24a7c0b32c91265cf4409c6fd
refs/heads/master
2020-08-09T14:47:24.650890
2019-10-10T06:55:33
2019-10-10T06:55:33
214,109,366
0
0
null
null
null
null
UTF-8
Java
false
false
6,160
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 if01.pkg10118025.latihan29.warnakepribadian; import java.util.Scanner; /** * Nama : Rizki Restu Illahi * NIM : 10118025 * Kelas : IF-01 */ public class IF0110118025Latihan29WarnaKepribadian { public static final String RESET = "\u001B[0m"; public static final String BLACK = "\u001B[30m"; public static final String RED = "\u001B[31m"; public static final String GREEN = "\u001B[32m"; public static final String YELLOW = "\u001B[33m"; public static final String BLUE = "\u001B[34m"; public static final String PURPLE = "\u001B[35m"; public static final String CYAN = "\u001B[36m"; public static final String WHITE = "\u001B[37m"; public static final String BGRED = "\u001B[41m"; public static final String BGGREEN = "\u001B[42m"; public static final String BGYELLOW = "\u001B[43m"; public static final String BGBLUE = "\u001B[44m"; public static final String BGMAGENTA = "\u001B[45m"; public static void ColRed() { System.out.println("1. Periang,"); System.out.println("2. Pemberani,"); System.out.println("3. Berani mengambil resiko dalam setiap langkah,"); System.out.println("4. Menyukai tantangan"); System.out.println("5. Kurang sabar,"); System.out.println("6. Dapat menahan marah namun jika sudah tahap puncak toleransi, kemarahnnya akan sulit dikontrol,"); System.out.println("7. Memiliki energi kehangatan dan cinta."); } public static void ColGreen() { System.out.println("1. Romantis,"); System.out.println("2. Menyukai hal yang berbau alami dan keindahan,"); System.out.println("3. Teguh pada prinsip,"); System.out.println("4. Menginginkan kesempurnaan,"); System.out.println("5. Mudah cemburu,"); System.out.println("6. Mudah merasa iri,"); System.out.println("7. Menjunjung tinggi suatu nilai toleransi dan kepercayaan."); } public static void ColYellow() { System.out.println("1. Optimis,"); System.out.println("2. Suka bergaul,"); System.out.println("3. Periang,"); System.out.println("4. Senang menolong,"); System.out.println("5. Lincah dan aktif,"); System.out.println("6. Tidak suka meremehkan kekurangan orang lain,"); System.out.println("7. Loyal,"); System.out.println("8. Hangat,"); System.out.println("9. Meskipun karakternya optimis dan idealis, seringkali goyah dan tidak stabil,"); System.out.println("10. Cenderung penakut."); } public static void ColBlue() { System.out.println("1. Menyenangkan,"); System.out.println("2. Bijaksana,"); System.out.println("3. Pembawaan diri tenang saat menghadapi masalah,"); System.out.println("4. Dinamis,"); System.out.println("5. Senang berbagi,"); System.out.println("6. Bersahabat,"); System.out.println("7. Tidak terlalu suka menjadi sorotan banyak orang,"); System.out.println("8. Menyembunyikan perasaan karena karakternya yang cenderung mencari jalan damai."); } public static void ColPurple() { System.out.println("1. Optimis,"); System.out.println("2. Tidak pernah ragu, "); System.out.println("3. Menurutnya pasangan yang ideal adalah yang memiliki mental yang kuat,"); System.out.println("4. Memiliki ambisi yang besar,"); System.out.println("5. Memiliki empati yang besar,"); System.out.println("6. Memiliki sisi misterius sebab seringkali menutupi perasaannya,"); System.out.println("7. Terkadang bersikap keras kepala dan angkuh."); } public static void main(String[] args) { // TODO code application logic here String pilihan, warnaPribadi, nama, Nama; System.out.println(RED + "YUK " + GREEN + "CEK " + YELLOW + "KEPRIBADIANMU " + CYAN + "DARI " + PURPLE + "WARNA " + BLUE + "FAVORITMU"); System.out.println(BGRED + WHITE + " MERAH "); System.out.println(BGGREEN + WHITE + " HIJAU "); System.out.println(BGYELLOW + WHITE + " KUNING "); System.out.println(BGBLUE + WHITE + " BIRU "); System.out.println(BGMAGENTA + WHITE + " UNGU "); Scanner scan = new Scanner(System.in); System.out.print(RESET + "\nPILIH WARNA FAVORITMU : " + RESET); pilihan = scan.nextLine(); warnaPribadi = pilihan.toUpperCase(); System.out.print("NAMA KAMU: " + RESET); nama = scan.nextLine(); Nama = nama.toUpperCase(); System.out.println("\n===HASIL TEST KEPRIBADIAN " + Nama + "==="); switch (warnaPribadi) { case "MERAH": System.out.println(RESET + "Warna Favoritmu adalah : " + RED + warnaPribadi); ColRed(); break; case "HIJAU": System.out.println("Warna Favoritmu adalah : " + GREEN + warnaPribadi); ColGreen(); break; case "KUNING": System.out.println("Warna Favoritmu adalah : " + YELLOW + warnaPribadi); ColYellow(); break; case "BIRU": System.out.println("Warna Favoritmu adalah : " + BLUE + warnaPribadi); ColBlue(); break; case "UNGU": System.out.println("Warna Favoritmu adalah : " + PURPLE + warnaPribadi); ColPurple(); break; default: System.out.println("Oops.. Belum teridentifikasi"); break; } } }
[ "noreply@github.com" ]
noreply@github.com
d8fb8a067873d0936648044c495c3bba456c3122
2522a82d444e1865e187e937f34f8b00cdb657c5
/app/src/androidTest/java/com/example/archek/romeservice/ExampleInstrumentedTest.java
91fa17aa0c92f376ba77fe9a07cb3e6116239b19
[]
no_license
ArchkWay/RomeService
94dd9f9d7915acdfe8f799effbaffb2117d9129c
46a60cb416f0fc07ee9ffd370fcf36802dcd9c8a
refs/heads/master
2020-04-10T14:21:15.428274
2018-12-10T08:44:03
2018-12-10T08:44:03
161,074,985
0
0
null
null
null
null
UTF-8
Java
false
false
744
java
package com.example.archek.romeservice; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.archek.romeservice", appContext.getPackageName()); } }
[ "Ovchinnikowork@gmail.com" ]
Ovchinnikowork@gmail.com
686a14479fc11b9ffefada28d4bf78743b40dd10
ecb7e109a62f6a2a130e3320ed1fb580ba4fc2de
/reference-code/esr/esale-tenants/src/main/java/jp/co/softbrain/esales/tenants/config/ConstantsTenants.java
3994f30ba4c2756d26d456e31a7fa16aafc4b6a6
[]
no_license
nisheeth84/prjs_sample
df732bc1eb58bc4fd4da6e76e6d59a2e81f53204
3fb10823ca4c0eb3cd92bcd2d5d4abc8d59436d9
refs/heads/master
2022-12-25T22:44:14.767803
2020-10-07T14:55:52
2020-10-07T14:55:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,861
java
package jp.co.softbrain.esales.tenants.config; import java.util.List; import com.google.common.collect.ImmutableList; /** * Application constants. */ public final class ConstantsTenants { private ConstantsTenants() { // do nothing } /** * Micro service name */ public static final String EMPLOYEE_SERVICE_NAME = "employees"; public static final String SCHEDULE_SERVICE_NAME = "schedules"; public static final String PRODUCT_SERVICE_NAME = "products"; public static final String CUSTOMERS_SERVICE_NAME = "customers"; public static final String BUSINESSCARDS_SERVICE_NAME = "businesscards"; public static final String ACTIVITIES_SERVICE_NAME = "activities"; public static final String TIMELINES_SERVICE_NAME = "timelines"; public static final String SALES_SERVICE_NAME = "sales"; public static final String COMMONS_SERVICE_NAME = "commons"; public static final String ANALYSIS_SERVICE_NAME = "analysis"; public static final String EXTERNALS_SERVICE_NAME = "externals"; public static final String SERVICE_NAME = "tenants"; public static final String SCHEMA_NAME = "tenants"; public static final String SYSTEM_ACCOUNT = "system"; public static final String TENANT_ID = "softbrain"; public static final Long BATCH_USER_ID = -1L; public static final int YEAR_MONTH_MAX_LENGTH = 6; public static final String TENANT_ITEM = "テナント"; public static final String PACKAGE_ID = "packageId"; public static final String DEFAULT_LANG = "ja_jp"; public static final String COLUMN_NAME_USER_ID = "user_id"; public static final String DUPLICATE = "ERR_COM_0058"; public static final String UPDATE_IP_ADDRESSES = "updateIpAddresses"; public static final String VALIDATE_MSG_FAILED = "Validate failed"; public static final String URL_API_VALIDATE = "validate"; public static final String META_FILE_INVALID = "ERR_TEN_0005"; /** * List config table in database */ public static final List<String> LIST_CONFIG_TABLES = List.of( "masters_stands", "masters_motivations", "api_tokens", "schedules_google_calendar", "schedules_types", "holidays", "company_holidays", "equipments", "equipments_types", "periods", "ip_address", "authentication_saml", "url_api_setting", "mails_servers", "activities_formats", "positions", "products_tradings_progress", "products_types", "masters_scenarios", "masters_scenarios_details", "access_log", "schema_version"); // flyway schema history /** * List of mirco services that are not target in setting tenant process */ public static final List<String> IGNORE_MICROSERVICE_NAME = ImmutableList.of( SERVICE_NAME, "sb", "feedback", "tutorials"); /** * Creation status of tenant in table Tenants */ public enum TenantCreationStatus { NOT_CREATE(1), CREATING(2), CREATED(3); private int value; private TenantCreationStatus(int value) { this.value = value; } public int getValue() { return value; } } /** * Response status of api. */ public enum ResponseStatus { SUCCESS(0), ERROR(1); private int value; private ResponseStatus(int value) { this.value = value; } public int getValue() { return value; } } /** * Payment status of payments management. */ public enum PaymentStatus { BUSINESS_CARD(1); private int value; private PaymentStatus(int value) { this.value = value; } public int getValue() { return value; } } /** * Type of packages. */ public enum Type { USER(1), TENANT(2); private int value; private Type(int value) { this.value = value; } public int getValue() { return value; } } /** * Contract status of tenant */ public enum TenantContractStatus { START(1, "起動"), SUSPENDED(2, "停止"), DELETED(3, "削除"); private Integer statusCode; private String label; private TenantContractStatus(Integer statusCode, String label) { this.statusCode = statusCode; this.label = label; } public String getLabel() { return label; } public Integer getStatusCode() { return statusCode; } } public enum ElasticsearchIndexEnum { EMPLOYEE_INDEX(EMPLOYEE_SERVICE_NAME, "employee"), SCHEDULE_INDEX(SCHEDULE_SERVICE_NAME, "calendar"), PRODUCT_INDEX(PRODUCT_SERVICE_NAME, "product"), CUSTOMER_INDEX(PRODUCT_SERVICE_NAME, "customer"), BUSINESSCARD_INDEX(BUSINESSCARDS_SERVICE_NAME, "businesscard"), ACTIVITY_INDEX(ACTIVITIES_SERVICE_NAME, "activity"), TIMELINE_INDEX(TIMELINES_SERVICE_NAME, "timeline"), SALE_INDEX(SALES_SERVICE_NAME, "sale"); private final String microServiceName; private final String suffix; ElasticsearchIndexEnum(String microServiceName, String suffix) { this.microServiceName = microServiceName; this.suffix = suffix; } public String getMicroServiceName() { return microServiceName; } public String getSuffix() { return suffix; } } public static final String CANNOT_MODIFY_COGNITO_ACCOUNT = "ERR_TEN_0006"; }
[ "phamkhachoabk@gmail.com" ]
phamkhachoabk@gmail.com
d694fc035e82ebfa4d224f4b6432e294eba40ce3
2a63eac29e22aaa7f14633682d0680f1a89497c8
/chapter15/src/main/java/com/reactivedesignpatterns/chapter15/RequestResponse.java
087d8e4ff8d4fb9f0fab846ca12d4979df0e8063
[ "Apache-2.0" ]
permissive
phderome/CodeSamples
58341347d75423ea40826a6948d501713c40bb21
2f4012b645b6423da1c616668d940bb533919fb4
refs/heads/master
2021-01-22T22:13:14.984285
2017-04-30T01:00:45
2017-04-30T01:00:45
86,951,901
1
0
null
2017-04-02T00:28:17
2017-04-02T00:28:17
null
UTF-8
Java
false
false
1,953
java
/** * Copyright (C) 2015 Roland Kuhn <http://rolandkuhn.com> */ package com.reactivedesignpatterns.chapter15; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetSocketAddress; import java.net.SocketAddress; public class RequestResponse { private static final int SERVER_PORT = 8888; static public class Server { static public void main(String[] args) throws IOException { // bind a socket for receiving packets try (final DatagramSocket socket = new DatagramSocket(SERVER_PORT)) { // receive one packet final byte[] buffer = new byte[1500]; final DatagramPacket packet1 = new DatagramPacket(buffer, buffer.length); socket.receive(packet1); final SocketAddress sender = packet1.getSocketAddress(); System.out.println("server: received " + new String(packet1.getData())); System.out.println("server: sender was " + sender); // send response back final byte[] response = "got it!".getBytes(); final DatagramPacket packet2 = new DatagramPacket(response, response.length, sender); socket.send(packet2); } } } static public class Client { static public void main(String[] args) throws IOException { // get local socket with random port try (final DatagramSocket socket = new DatagramSocket()) { // send message to server final byte[] request = "hello".getBytes(); final DatagramPacket packet1 = new DatagramPacket(request, request.length, new InetSocketAddress("localhost", SERVER_PORT)); socket.send(packet1); // receive one packet final byte[] buffer = new byte[1500]; final DatagramPacket packet2 = new DatagramPacket(buffer, buffer.length); socket.receive(packet2); final SocketAddress sender = packet2.getSocketAddress(); System.out.println("client: received " + new String(packet2.getData())); System.out.println("client: sender was " + sender); } } } }
[ "rk@rkuhn.info" ]
rk@rkuhn.info
13cc621aa5eb3607c831b512c112c85e1664b17c
f23d5e09499e1024baf4869542fdf597ad0f9944
/src/main/java/com/viafirma/tray/ws/dto/PingResponseDTO.java
ce08ed83810107b832f004c499aba4dbb5a86031
[]
no_license
viavansi/viafirma-inbox-api-integration-sample
f4b83f3c35ab991688d904c0c7f24ce9ed607d02
5e08848a824f5827e5df4a91e5ed49b754ac2a81
refs/heads/master
2021-01-20T02:54:56.829839
2017-04-27T09:29:25
2017-04-27T09:29:25
89,467,383
0
0
null
null
null
null
UTF-8
Java
false
false
375
java
package com.viafirma.tray.ws.dto; public class PingResponseDTO extends WSInformationDTO { private String result; public PingResponseDTO() { super(); } //******************************* // Getters / Setters //******************************* public String getResult() { return result; } public void setResult(String result) { this.result = result; } }
[ "juan.g.hurtado@gmail.com" ]
juan.g.hurtado@gmail.com
4f0e8fd5792e6cc3329db9c772041fc2adcc9d3d
a884980ced19cd5d759cecc9f0f8a668bcbd0b9d
/samza-api/src/main/java/org/apache/samza/task/AsyncStreamTaskFactory.java
e5ce9c4b5e1c6439a2d4613c2228a652a74821e3
[ "Apache-2.0", "MIT", "OFL-1.1" ]
permissive
Swrrt/Samza-Snapshot
1dcfd3c3de68fab3c7baeb8c8e54c148b85a7b6a
95d0d15f7c5cfb01471d007d26bec62279e84d78
refs/heads/master
2021-06-17T09:17:42.197481
2019-05-04T12:47:43
2019-05-04T12:47:43
132,570,279
1
1
Apache-2.0
2019-04-17T06:01:25
2018-05-08T07:21:49
Java
UTF-8
Java
false
false
1,068
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.samza.task; /** * Build {@link AsyncStreamTask} instances. * Implementations should return a new instance for each {@link #createInstance()} invocation. */ public interface AsyncStreamTaskFactory { AsyncStreamTask createInstance(); }
[ "workshop@soccf-snr4-004.comp.nus.edu.sg" ]
workshop@soccf-snr4-004.comp.nus.edu.sg
34925306ff221c11297d1f1d80e47ca6b8a9ff5b
e700163edae408b248c47d884b4c861878608a64
/de.uhh.l2g.plugins/de.uhh.l2g.plugins-service/src/main/java/de/uhh/l2g/plugins/model/impl/SegmentModelImpl.java
931215717b31031af2a42c17b289fee7eade1034
[]
no_license
GitHubUserGitHubUser/modules
20517a4ddbf935c1c38e11143b4e0f6a9e8de3a6
eabe90a27a941145f08c26eb725011fcf593c381
refs/heads/master
2020-07-08T23:55:20.266146
2019-08-27T11:28:16
2019-08-27T11:28:16
203,815,500
0
0
null
2019-08-22T14:48:00
2019-08-22T14:47:59
null
UTF-8
Java
false
false
20,572
java
/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package de.uhh.l2g.plugins.model.impl; import aQute.bnd.annotation.ProviderType; import com.liferay.expando.kernel.model.ExpandoBridge; import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil; import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.model.CacheModel; import com.liferay.portal.kernel.model.User; import com.liferay.portal.kernel.model.impl.BaseModelImpl; import com.liferay.portal.kernel.service.ServiceContext; import com.liferay.portal.kernel.service.UserLocalServiceUtil; import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.ProxyUtil; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import de.uhh.l2g.plugins.model.Segment; import de.uhh.l2g.plugins.model.SegmentModel; import java.io.Serializable; import java.sql.Types; import java.util.Date; import java.util.HashMap; import java.util.Map; /** * The base model implementation for the Segment service. Represents a row in the &quot;LG_Segment&quot; database table, with each column mapped to a property of this class. * * <p> * This implementation and its corresponding interface {@link SegmentModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link SegmentImpl}. * </p> * * @author Iavor Sturm * @see SegmentImpl * @see Segment * @see SegmentModel * @generated */ @ProviderType public class SegmentModelImpl extends BaseModelImpl<Segment> implements SegmentModel { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. All methods that expect a segment model instance should use the {@link Segment} interface instead. */ public static final String TABLE_NAME = "LG_Segment"; public static final Object[][] TABLE_COLUMNS = { { "segmentId", Types.BIGINT }, { "videoId", Types.BIGINT }, { "start_", Types.VARCHAR }, { "title", Types.VARCHAR }, { "description", Types.VARCHAR }, { "end_", Types.VARCHAR }, { "chapter", Types.INTEGER }, { "userId", Types.BIGINT }, { "groupId", Types.BIGINT }, { "companyId", Types.BIGINT }, { "userName", Types.VARCHAR }, { "createDate", Types.TIMESTAMP }, { "modifiedDate", Types.TIMESTAMP } }; public static final Map<String, Integer> TABLE_COLUMNS_MAP = new HashMap<String, Integer>(); static { TABLE_COLUMNS_MAP.put("segmentId", Types.BIGINT); TABLE_COLUMNS_MAP.put("videoId", Types.BIGINT); TABLE_COLUMNS_MAP.put("start_", Types.VARCHAR); TABLE_COLUMNS_MAP.put("title", Types.VARCHAR); TABLE_COLUMNS_MAP.put("description", Types.VARCHAR); TABLE_COLUMNS_MAP.put("end_", Types.VARCHAR); TABLE_COLUMNS_MAP.put("chapter", Types.INTEGER); TABLE_COLUMNS_MAP.put("userId", Types.BIGINT); TABLE_COLUMNS_MAP.put("groupId", Types.BIGINT); TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT); TABLE_COLUMNS_MAP.put("userName", Types.VARCHAR); TABLE_COLUMNS_MAP.put("createDate", Types.TIMESTAMP); TABLE_COLUMNS_MAP.put("modifiedDate", Types.TIMESTAMP); } public static final String TABLE_SQL_CREATE = "create table LG_Segment (segmentId LONG not null primary key,videoId LONG,start_ VARCHAR(75) null,title VARCHAR(75) null,description VARCHAR(75) null,end_ VARCHAR(75) null,chapter INTEGER,userId LONG,groupId LONG,companyId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null)"; public static final String TABLE_SQL_DROP = "drop table LG_Segment"; public static final String ORDER_BY_JPQL = " ORDER BY segment.start ASC"; public static final String ORDER_BY_SQL = " ORDER BY LG_Segment.start_ ASC"; public static final String DATA_SOURCE = "liferayDataSource"; public static final String SESSION_FACTORY = "liferaySessionFactory"; public static final String TX_MANAGER = "liferayTransactionManager"; public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(de.uhh.l2g.plugins.service.util.ServiceProps.get( "value.object.entity.cache.enabled.de.uhh.l2g.plugins.model.Segment"), true); public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(de.uhh.l2g.plugins.service.util.ServiceProps.get( "value.object.finder.cache.enabled.de.uhh.l2g.plugins.model.Segment"), true); public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(de.uhh.l2g.plugins.service.util.ServiceProps.get( "value.object.column.bitmask.enabled.de.uhh.l2g.plugins.model.Segment"), true); public static final long COMPANYID_COLUMN_BITMASK = 1L; public static final long GROUPID_COLUMN_BITMASK = 2L; public static final long USERID_COLUMN_BITMASK = 4L; public static final long VIDEOID_COLUMN_BITMASK = 8L; public static final long START_COLUMN_BITMASK = 16L; public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(de.uhh.l2g.plugins.service.util.ServiceProps.get( "lock.expiration.time.de.uhh.l2g.plugins.model.Segment")); public SegmentModelImpl() { } @Override public long getPrimaryKey() { return _segmentId; } @Override public void setPrimaryKey(long primaryKey) { setSegmentId(primaryKey); } @Override public Serializable getPrimaryKeyObj() { return _segmentId; } @Override public void setPrimaryKeyObj(Serializable primaryKeyObj) { setPrimaryKey(((Long)primaryKeyObj).longValue()); } @Override public Class<?> getModelClass() { return Segment.class; } @Override public String getModelClassName() { return Segment.class.getName(); } @Override public Map<String, Object> getModelAttributes() { Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("segmentId", getSegmentId()); attributes.put("videoId", getVideoId()); attributes.put("start", getStart()); attributes.put("title", getTitle()); attributes.put("description", getDescription()); attributes.put("end", getEnd()); attributes.put("chapter", getChapter()); attributes.put("userId", getUserId()); attributes.put("groupId", getGroupId()); attributes.put("companyId", getCompanyId()); attributes.put("userName", getUserName()); attributes.put("createDate", getCreateDate()); attributes.put("modifiedDate", getModifiedDate()); attributes.put("entityCacheEnabled", isEntityCacheEnabled()); attributes.put("finderCacheEnabled", isFinderCacheEnabled()); return attributes; } @Override public void setModelAttributes(Map<String, Object> attributes) { Long segmentId = (Long)attributes.get("segmentId"); if (segmentId != null) { setSegmentId(segmentId); } Long videoId = (Long)attributes.get("videoId"); if (videoId != null) { setVideoId(videoId); } String start = (String)attributes.get("start"); if (start != null) { setStart(start); } String title = (String)attributes.get("title"); if (title != null) { setTitle(title); } String description = (String)attributes.get("description"); if (description != null) { setDescription(description); } String end = (String)attributes.get("end"); if (end != null) { setEnd(end); } Integer chapter = (Integer)attributes.get("chapter"); if (chapter != null) { setChapter(chapter); } Long userId = (Long)attributes.get("userId"); if (userId != null) { setUserId(userId); } Long groupId = (Long)attributes.get("groupId"); if (groupId != null) { setGroupId(groupId); } Long companyId = (Long)attributes.get("companyId"); if (companyId != null) { setCompanyId(companyId); } String userName = (String)attributes.get("userName"); if (userName != null) { setUserName(userName); } Date createDate = (Date)attributes.get("createDate"); if (createDate != null) { setCreateDate(createDate); } Date modifiedDate = (Date)attributes.get("modifiedDate"); if (modifiedDate != null) { setModifiedDate(modifiedDate); } } @Override public long getSegmentId() { return _segmentId; } @Override public void setSegmentId(long segmentId) { _segmentId = segmentId; } @Override public long getVideoId() { return _videoId; } @Override public void setVideoId(long videoId) { _columnBitmask |= VIDEOID_COLUMN_BITMASK; if (!_setOriginalVideoId) { _setOriginalVideoId = true; _originalVideoId = _videoId; } _videoId = videoId; } public long getOriginalVideoId() { return _originalVideoId; } @Override public String getStart() { if (_start == null) { return StringPool.BLANK; } else { return _start; } } @Override public void setStart(String start) { _columnBitmask = -1L; _start = start; } @Override public String getTitle() { if (_title == null) { return StringPool.BLANK; } else { return _title; } } @Override public void setTitle(String title) { _title = title; } @Override public String getDescription() { if (_description == null) { return StringPool.BLANK; } else { return _description; } } @Override public void setDescription(String description) { _description = description; } @Override public String getEnd() { if (_end == null) { return StringPool.BLANK; } else { return _end; } } @Override public void setEnd(String end) { _end = end; } @Override public int getChapter() { return _chapter; } @Override public void setChapter(int chapter) { _chapter = chapter; } @Override public long getUserId() { return _userId; } @Override public void setUserId(long userId) { _columnBitmask |= USERID_COLUMN_BITMASK; if (!_setOriginalUserId) { _setOriginalUserId = true; _originalUserId = _userId; } _userId = userId; } @Override public String getUserUuid() { try { User user = UserLocalServiceUtil.getUserById(getUserId()); return user.getUuid(); } catch (PortalException pe) { return StringPool.BLANK; } } @Override public void setUserUuid(String userUuid) { } public long getOriginalUserId() { return _originalUserId; } @Override public long getGroupId() { return _groupId; } @Override public void setGroupId(long groupId) { _columnBitmask |= GROUPID_COLUMN_BITMASK; if (!_setOriginalGroupId) { _setOriginalGroupId = true; _originalGroupId = _groupId; } _groupId = groupId; } public long getOriginalGroupId() { return _originalGroupId; } @Override public long getCompanyId() { return _companyId; } @Override public void setCompanyId(long companyId) { _columnBitmask |= COMPANYID_COLUMN_BITMASK; if (!_setOriginalCompanyId) { _setOriginalCompanyId = true; _originalCompanyId = _companyId; } _companyId = companyId; } public long getOriginalCompanyId() { return _originalCompanyId; } @Override public String getUserName() { if (_userName == null) { return StringPool.BLANK; } else { return _userName; } } @Override public void setUserName(String userName) { _userName = userName; } @Override public Date getCreateDate() { return _createDate; } @Override public void setCreateDate(Date createDate) { _createDate = createDate; } @Override public Date getModifiedDate() { return _modifiedDate; } public boolean hasSetModifiedDate() { return _setModifiedDate; } @Override public void setModifiedDate(Date modifiedDate) { _setModifiedDate = true; _modifiedDate = modifiedDate; } public long getColumnBitmask() { return _columnBitmask; } @Override public ExpandoBridge getExpandoBridge() { return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(), Segment.class.getName(), getPrimaryKey()); } @Override public void setExpandoBridgeAttributes(ServiceContext serviceContext) { ExpandoBridge expandoBridge = getExpandoBridge(); expandoBridge.setAttributes(serviceContext); } @Override public Segment toEscapedModel() { if (_escapedModel == null) { _escapedModel = (Segment)ProxyUtil.newProxyInstance(_classLoader, _escapedModelInterfaces, new AutoEscapeBeanHandler(this)); } return _escapedModel; } @Override public Object clone() { SegmentImpl segmentImpl = new SegmentImpl(); segmentImpl.setSegmentId(getSegmentId()); segmentImpl.setVideoId(getVideoId()); segmentImpl.setStart(getStart()); segmentImpl.setTitle(getTitle()); segmentImpl.setDescription(getDescription()); segmentImpl.setEnd(getEnd()); segmentImpl.setChapter(getChapter()); segmentImpl.setUserId(getUserId()); segmentImpl.setGroupId(getGroupId()); segmentImpl.setCompanyId(getCompanyId()); segmentImpl.setUserName(getUserName()); segmentImpl.setCreateDate(getCreateDate()); segmentImpl.setModifiedDate(getModifiedDate()); segmentImpl.resetOriginalValues(); return segmentImpl; } @Override public int compareTo(Segment segment) { int value = 0; value = getStart().compareToIgnoreCase(segment.getStart()); if (value != 0) { return value; } return 0; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Segment)) { return false; } Segment segment = (Segment)obj; long primaryKey = segment.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } } @Override public int hashCode() { return (int)getPrimaryKey(); } @Override public boolean isEntityCacheEnabled() { return ENTITY_CACHE_ENABLED; } @Override public boolean isFinderCacheEnabled() { return FINDER_CACHE_ENABLED; } @Override public void resetOriginalValues() { SegmentModelImpl segmentModelImpl = this; segmentModelImpl._originalVideoId = segmentModelImpl._videoId; segmentModelImpl._setOriginalVideoId = false; segmentModelImpl._originalUserId = segmentModelImpl._userId; segmentModelImpl._setOriginalUserId = false; segmentModelImpl._originalGroupId = segmentModelImpl._groupId; segmentModelImpl._setOriginalGroupId = false; segmentModelImpl._originalCompanyId = segmentModelImpl._companyId; segmentModelImpl._setOriginalCompanyId = false; segmentModelImpl._setModifiedDate = false; segmentModelImpl._columnBitmask = 0; } @Override public CacheModel<Segment> toCacheModel() { SegmentCacheModel segmentCacheModel = new SegmentCacheModel(); segmentCacheModel.segmentId = getSegmentId(); segmentCacheModel.videoId = getVideoId(); segmentCacheModel.start = getStart(); String start = segmentCacheModel.start; if ((start != null) && (start.length() == 0)) { segmentCacheModel.start = null; } segmentCacheModel.title = getTitle(); String title = segmentCacheModel.title; if ((title != null) && (title.length() == 0)) { segmentCacheModel.title = null; } segmentCacheModel.description = getDescription(); String description = segmentCacheModel.description; if ((description != null) && (description.length() == 0)) { segmentCacheModel.description = null; } segmentCacheModel.end = getEnd(); String end = segmentCacheModel.end; if ((end != null) && (end.length() == 0)) { segmentCacheModel.end = null; } segmentCacheModel.chapter = getChapter(); segmentCacheModel.userId = getUserId(); segmentCacheModel.groupId = getGroupId(); segmentCacheModel.companyId = getCompanyId(); segmentCacheModel.userName = getUserName(); String userName = segmentCacheModel.userName; if ((userName != null) && (userName.length() == 0)) { segmentCacheModel.userName = null; } Date createDate = getCreateDate(); if (createDate != null) { segmentCacheModel.createDate = createDate.getTime(); } else { segmentCacheModel.createDate = Long.MIN_VALUE; } Date modifiedDate = getModifiedDate(); if (modifiedDate != null) { segmentCacheModel.modifiedDate = modifiedDate.getTime(); } else { segmentCacheModel.modifiedDate = Long.MIN_VALUE; } return segmentCacheModel; } @Override public String toString() { StringBundler sb = new StringBundler(27); sb.append("{segmentId="); sb.append(getSegmentId()); sb.append(", videoId="); sb.append(getVideoId()); sb.append(", start="); sb.append(getStart()); sb.append(", title="); sb.append(getTitle()); sb.append(", description="); sb.append(getDescription()); sb.append(", end="); sb.append(getEnd()); sb.append(", chapter="); sb.append(getChapter()); sb.append(", userId="); sb.append(getUserId()); sb.append(", groupId="); sb.append(getGroupId()); sb.append(", companyId="); sb.append(getCompanyId()); sb.append(", userName="); sb.append(getUserName()); sb.append(", createDate="); sb.append(getCreateDate()); sb.append(", modifiedDate="); sb.append(getModifiedDate()); sb.append("}"); return sb.toString(); } @Override public String toXmlString() { StringBundler sb = new StringBundler(43); sb.append("<model><model-name>"); sb.append("de.uhh.l2g.plugins.model.Segment"); sb.append("</model-name>"); sb.append( "<column><column-name>segmentId</column-name><column-value><![CDATA["); sb.append(getSegmentId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>videoId</column-name><column-value><![CDATA["); sb.append(getVideoId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>start</column-name><column-value><![CDATA["); sb.append(getStart()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>title</column-name><column-value><![CDATA["); sb.append(getTitle()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>description</column-name><column-value><![CDATA["); sb.append(getDescription()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>end</column-name><column-value><![CDATA["); sb.append(getEnd()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>chapter</column-name><column-value><![CDATA["); sb.append(getChapter()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>userId</column-name><column-value><![CDATA["); sb.append(getUserId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>groupId</column-name><column-value><![CDATA["); sb.append(getGroupId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>companyId</column-name><column-value><![CDATA["); sb.append(getCompanyId()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>userName</column-name><column-value><![CDATA["); sb.append(getUserName()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>createDate</column-name><column-value><![CDATA["); sb.append(getCreateDate()); sb.append("]]></column-value></column>"); sb.append( "<column><column-name>modifiedDate</column-name><column-value><![CDATA["); sb.append(getModifiedDate()); sb.append("]]></column-value></column>"); sb.append("</model>"); return sb.toString(); } private static final ClassLoader _classLoader = Segment.class.getClassLoader(); private static final Class<?>[] _escapedModelInterfaces = new Class[] { Segment.class }; private long _segmentId; private long _videoId; private long _originalVideoId; private boolean _setOriginalVideoId; private String _start; private String _title; private String _description; private String _end; private int _chapter; private long _userId; private long _originalUserId; private boolean _setOriginalUserId; private long _groupId; private long _originalGroupId; private boolean _setOriginalGroupId; private long _companyId; private long _originalCompanyId; private boolean _setOriginalCompanyId; private String _userName; private Date _createDate; private Date _modifiedDate; private boolean _setModifiedDate; private long _columnBitmask; private Segment _escapedModel; }
[ "iavor.sturm@uni-hamburg.de" ]
iavor.sturm@uni-hamburg.de
1e28b4cc029e39348972d166716a924c5a30dc7e
9d2ebee4c7ea61fd7135bf0e090fbd92ee69c49b
/chapter07/src/com/benkyou/oop/MethodDetail02.java
ec069b77e62d1ca8f042d04db9d528aa5d102942
[]
no_license
naruseshiroha/HSP
10d32963b7f77feb381aceea4a8d65fa7dcd371a
6e99c4cecce5d93b2a63d587f9c46250ec2e6a81
refs/heads/main
2023-06-27T00:49:36.977425
2021-07-23T14:13:01
2021-07-23T14:13:01
364,448,371
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package com.benkyou.oop; public class MethodDetail02 { public static void main(String[] args) { B b = new B(); b.sayOk(); b.m1(); } } class B { // 同一个类中的方法调用:直接调用即可 public void print(int n) { System.out.println("print() is called. n is " + n); } public void sayOk() { print(10); System.out.println("sayOk() is called. "); } // B 类调用 C 类方法:通过对象名调用 public void m1() { // 创建 C 对象,然后调用 C 类方法即可 C c = new C(); c.hi(); System.out.println("m1() is called."); } } class C { public void hi() { System.out.println("C hi() is called."); } }
[ "lixunsam@gmail.com" ]
lixunsam@gmail.com
f8d299991b7f60d8c4248c9f760f34fb100f7fe0
7f76c2a81b8e635cb69f4e3750a4a3bce103cedd
/Command Center/CommandCenterController_v1/src/udp_manualcontrol_transmit/TxManualControlStruct.java
e1764b78062869ccbcc278f76782b462ac162914
[]
no_license
james-novino/Lunabots_2015
4c170c54eb3478034eca736e9c75501e0238cc22
1d777a5176c1527ebc8bd122d9979798e84ca5e9
refs/heads/master
2016-09-05T09:03:22.067914
2014-12-05T04:38:41
2014-12-05T04:38:41
27,574,363
1
0
null
null
null
null
UTF-8
Java
false
false
1,168
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package udp_manualcontrol_transmit; import struct.*; /** * * @author chalbers2 */ @StructClass public class TxManualControlStruct { @StructField(order=0) public boolean runManualControl; @StructField(order=1) public boolean issueAutonomousStartSignal; @StructField(order=2) public boolean runAutonomousSystem; @StructField(order=3) public boolean issueAutonomousStopSignal; @StructField(order=4) public boolean issueAutonomousResetSignal; @StructField(order=5) public int countdownTimeInSeconds; @StructField(order=6) public float leftMotorSpeed; @StructField(order=7) public float rightMotorSpeed; @StructField(order=8) public float collectionSystemSpeed; @StructField(order=9) public float dumpSystemSpeed; @StructField(order=10) public float driveMotorMaxSpeed; @StructField(order=11) public float collectionSystemAutonomousSpeed; @StructField(order=12) public float dumpSystemAutonomousSpeed; }
[ "james_novino@hotmail.com" ]
james_novino@hotmail.com
14a76a38d38c55e5a3aa76349ccc3c4f452dd79d
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project445/src/test/java/org/gradle/test/performance/largejavamultiproject/project445/p2226/Test44537.java
3f23e0eaac62774b1dd398db4944c104e0e2caf5
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,182
java
package org.gradle.test.performance.largejavamultiproject.project445.p2226; import org.junit.Test; import static org.junit.Assert.*; public class Test44537 { Production44537 objectUnderTest = new Production44537(); @Test public void testProperty0() { Production44534 value = new Production44534(); objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { Production44535 value = new Production44535(); objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { Production44536 value = new Production44536(); objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
0d982cc832fcf2e75604fc228892d13a8784fff3
86f48e328dc998c8d81d4a1a5cfcc6bbee7f7346
/app/src/main/java/com/racavalieri/gallerysearch/Entity/Image.java
40465dcf9f9587c2ed52cdfa63336c2a16e70ca4
[]
no_license
rafaelcavalieri/GalleryApp
c0e9d55cff662fbf320befb6ae041f40b03289ab
0e83a2b93cd956393cb7b88ebbeae33a61037f58
refs/heads/master
2020-05-07T11:53:42.451810
2019-12-05T21:12:02
2019-12-05T21:12:02
180,479,421
0
0
null
null
null
null
UTF-8
Java
false
false
1,136
java
package com.racavalieri.gallerysearch.Entity; public class Image { public int uid; private String path; private String keywords; private String lastModified; private String latitude; private String longitude; public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getKeywords() { return keywords; } public void setKeywords(String keywords) { this.keywords = keywords; } public String getLastModified() { return lastModified; } public void setLastModified(String lastModified) { this.lastModified = lastModified; } public int getUid() { return uid; } public void setUid(int uid) { this.uid = uid; } public String getLatitude() { return latitude; } public void setLatitude(String latitude) { this.latitude = latitude; } public String getLongitude() { return longitude; } public void setLongitude(String longitude) { this.longitude = longitude; } }
[ "rafael.cvlr@gmail.com" ]
rafael.cvlr@gmail.com
127b61311c0c184d9c3061589967ba2fb81fb412
7091ce31fbd4c7d48996609b68bdd0e1a29f5291
/src/main/java/cn/dawnland/dawnland_back/interceptor/AdminSecurityConfig.java
766efc958e59047c1b5bed724f895a87d8136f1f
[]
no_license
MaoZa/DawnLandPluginBack
c88ba3db08ff52f9a1bc273c2ea0135b38517353
e2da6b3844aa59fbc32205d23197b978ab146744
refs/heads/master
2020-04-04T11:21:09.370316
2018-11-20T09:53:38
2018-11-20T09:53:38
155,887,718
1
0
null
null
null
null
UTF-8
Java
false
false
861
java
package cn.dawnland.dawnland_back.interceptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration public class AdminSecurityConfig extends WebMvcConfigurerAdapter { @Autowired LoginInterceptor loginInterceptor; @Override public void addInterceptors(InterceptorRegistry registry) { // 多个拦截器组成一个拦截器链 // addPathPatterns 用于添加拦截规则 // excludePathPatterns 用户排除拦截 registry.addInterceptor(loginInterceptor).addPathPatterns("/**").excludePathPatterns("/user/login"); super.addInterceptors(registry); } }
[ "462721276@qq.com" ]
462721276@qq.com
df2ffc557fac247235d8e5446140b35bfee2bc8f
e06fc4482cbb619060c9958e9c05785a5e0c35f1
/Transport-final-project/Transport/src/main/java/Transport/Repository/Impl/VehicleRepoImplementations/CarRepositoryImpl.java
631df45be47a4ae6912240f5171a6bce03ecaf9f
[]
no_license
torqueShorts/Transport_Final
bc4b544a995854d9ba0fa79ca6ee9c17062ffb37
880fd143cb475b352b30b5e89e6b21bde8a4379d
refs/heads/master
2022-07-08T08:07:43.243787
2019-10-20T23:36:41
2019-10-20T23:36:41
216,190,102
1
1
null
2019-10-20T23:36:42
2019-10-19T10:42:13
Java
UTF-8
Java
false
false
2,367
java
package Transport.Repository.Impl.VehicleRepoImplementations; import Transport.Domain.Vehicles.Car; import Transport.Repository.Repositories.VehicleRepositories.CarRepository; import org.springframework.stereotype.Repository; import java.util.ArrayList; public class CarRepositoryImpl implements CarRepository { private static CarRepositoryImpl repo = null; private ArrayList<Car> cars; private CarRepositoryImpl() { this.cars = new ArrayList<Car>(); } public static CarRepositoryImpl getRepo() { if(repo == null) { repo = new CarRepositoryImpl(); } return repo; } @Override public Car create(Car car) { this.cars.add(car); return car; } @Override public Car update(Car car) { int count = 1; Car val = null; for(int i = 0; i < cars.size(); i++) { if(cars.get(i).getVeh().getVehicleLicense() == car.getVeh().getVehicleLicense()) { cars.set(i,car); count--; val = cars.get(i); System.out.println("Car updated"); } } if(count > 0) { System.out.println("Car not found"); } return val; } @Override public void delete(String obj) { int count = 1; for(int i = 0; i < cars.size(); i++) { if(cars.get(i).getVeh().getVehicleLicense().equalsIgnoreCase(obj)) { cars.remove(i); count--; System.out.println("car removed"); } } if(count > 0) { System.out.println("car not found"); } } @Override public Car read(String obj) { int count = 1; Car val = null; for(int i = 0; i < cars.size(); i++) { if(cars.get(i).getVeh().getVehicleLicense().equalsIgnoreCase(obj)) { val = cars.get(i); count--; System.out.println("Car read"); } } if(count > 0) { System.out.println("Car not found"); } return val; } @Override public ArrayList<Car> getAll() { return this.cars; } }
[ "11-209@bmdhsw.co.za" ]
11-209@bmdhsw.co.za
5d757ddcd88c6cf41b8450fc8e2f4a120d1dfba5
ae67ff3e4deb769cb33e5b4408fab2c2191d181a
/Lab1/src/InfixCalc.java
7437cf44b50bac779fa91a5418a42e869305802a
[]
no_license
khanninator2000/CSS143
7f828b915ca46e01b76269805f230bce61248b8e
a2883c9a76d5d5feed02931380752bb4cc03ee43
refs/heads/master
2020-04-16T16:46:49.950957
2018-05-18T23:41:14
2018-05-18T23:41:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,810
java
import javafx.util.Pair; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintWriter; /** * Calculator that calculates values from left to right. */ public class InfixCalc { public static void main(String[] $) throws FileNotFoundException { PrintWriter pw = new PrintWriter(new FileOutputStream("output.txt"), true); for (java.util.Scanner sc = new java.util.Scanner(new FileInputStream("inputData.txt")); sc.hasNextLine(); pw.println(calculate(sc.nextLine().replaceAll("[ ]", "")))); } /** * Section of code that calculates a value. * Precondition: no spaces between operators and numbers * * @param s Infix String. * @return float with the computed value of the string. */ public static float calculate(String s) { Pair<Float, Integer> token = get_next_int(s, 0); float lhs = token.getKey(); char operator; float rhs; while (token.getValue() < s.length()) { operator = s.charAt(token.getValue()); token = get_next_int(s, token.getValue() + 1); rhs = token.getKey(); lhs = perform_operation(lhs, rhs, operator); } return lhs; } /** * Performs the operation on lhs and rhs based on operator. * * @param lhs Value on the left side of the operator. * @param rhs Value on the right side of the operator. * @param operator The operation to perform on lhs and rhs. * @return A float with the result of lhs and rhs. */ private static float perform_operation(float lhs, float rhs, char operator) { switch (operator) { case '+': return lhs + rhs; case '-': return lhs - rhs; case '*': return lhs * rhs; case '/': return lhs / rhs; default: return lhs; } } /** * Gets the next number and ending position on the string s starting at start. * This method supports decimals and negative numbers. * * @param s The String to view. * @param start The starting index of the String (method has no bounds check). * @return A javafx.util.Pair with the next Integer (token) and the ending index. */ private static Pair<Float, Integer> get_next_int(String s, int start) { StringBuilder accumulator = new StringBuilder(); int i = start; for (; i < s.length() && (Character.isDigit(s.charAt(i)) || (accumulator.length() == 0 && s.charAt(i) == '-') || s.charAt(i) == '.'); i++) { accumulator.append(s.charAt(i)); } return new Pair<>(Float.parseFloat(accumulator.toString()), i); } }
[ "sudomeacat@gmail.com" ]
sudomeacat@gmail.com
e23beaa1b597062056e358ce77efe3cfbb9bf4bf
245a03bc088efa76b9f514d17a22825c8c3f5465
/src/main/java/org/ua/bryl/controller/HomeController.java
54954296e9888540a9e5d992ed3414f7d1cd08ec
[]
no_license
BADRobin/Library
d406f72385e5e7e0fa15f496570638a08df7d517
a9675eb0b0b3a26c53486e8a556a5f86c941e007
refs/heads/master
2023-07-25T23:36:36.390393
2023-07-18T07:03:17
2023-07-18T07:03:17
176,334,180
2
0
null
2022-12-15T23:26:46
2019-03-18T17:14:02
SCSS
UTF-8
Java
false
false
1,025
java
package org.ua.bryl.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; /** * Created by olegbryl 18/03/2019. */ @Controller public class HomeController { @RequestMapping("/") public String home() { return "index"; } @RequestMapping(value = "/login", method = RequestMethod.GET) public String login(@RequestParam(value = "error", required = false) String error, @RequestParam(value = "logout", required = false) String logout, Model model) { if(error != null) { model.addAttribute("error", "The username or password are invalid"); } if(logout != null) { model.addAttribute("msg", "The session has ended successfully"); } return "login"; } }
[ "olegbryl@gmail.com" ]
olegbryl@gmail.com
99357a2d7c87742f7304d8ea477b5c9ed4c1f052
305150d2127a71b37a07e546940bc40d05f72f08
/src/GeneralShape.java
667630a782a64dc5063c5b47a83a9614f3e82d7f
[]
no_license
HathoutFatna/Java-Paint-DesignPatterns
39877e4eee2b45891052f230c7e796db5f8ead47
d23839f4ef9bc0491e291584fd9586b93ed584ef
refs/heads/master
2022-04-14T13:39:53.976948
2020-04-10T11:31:02
2020-04-10T11:31:02
254,618,387
1
0
null
null
null
null
UTF-8
Java
false
false
52
java
public interface GeneralShape { void paste(); }
[ "f.hathout@outlook.fr" ]
f.hathout@outlook.fr
877327cfaa10dd487115abe6da69253afb5dabea
257366ced6a740705e1686be6ab801f085bc6b74
/housematch-core/src/main/java/ca/ulaval/glo4003/housematch/domain/propertyphoto/PropertyPhotoNotFoundException.java
a622ffb571a70b2148dc3677304a2e977609ff47
[ "MIT" ]
permissive
Lorac/house-match
1cac7096904cac0fe27dcbf6ae234e6e83633481
ca6334008df13e4f42cf0f940df78e25c3e03394
refs/heads/master
2021-01-21T15:12:13.879916
2016-02-11T02:47:47
2016-02-11T02:47:47
47,229,743
0
0
null
null
null
null
UTF-8
Java
false
false
364
java
package ca.ulaval.glo4003.housematch.domain.propertyphoto; public class PropertyPhotoNotFoundException extends Exception { private static final long serialVersionUID = 751474011098753048L; public PropertyPhotoNotFoundException() { super(); } public PropertyPhotoNotFoundException(final String message) { super(message); } }
[ "o.robert@hotmail.com" ]
o.robert@hotmail.com
9121ff9425d376630bd9cc16cb51257f1f69b700
ef0c039e27f173a3aa4e82ab4e26edc93f9e28e0
/testutils/src/main/java/com/android/testutils/apk/SplitApks.java
f63ee92600a888e2a5d8283e2323e818a604549e
[ "Apache-2.0" ]
permissive
ggaier/android_platform_tools_base
1091a25aa220665d7eb02481426f4941d0fedd18
85c6b73c22cd23c069d94eb19c824d4fb74a5ec9
refs/heads/master
2020-09-17T11:33:48.674204
2019-11-26T02:43:12
2019-11-26T02:43:12
224,085,780
1
3
null
null
null
null
UTF-8
Java
false
false
3,047
java
/* * Copyright (C) 2016 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 com.android.testutils.apk; import com.android.annotations.NonNull; import com.android.annotations.Nullable; import com.android.annotations.concurrency.Immutable; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.io.IOException; import java.nio.file.Path; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; import org.jf.dexlib2.dexbacked.DexBackedClassDef; /** * Represents a collection of split APKs, such as from a instant run cold swap. * * <p>This exists to represent a model of the underlying data that assertions can be built upon, for * example as a truth subject. */ @Immutable public final class SplitApks implements AutoCloseable { @NonNull private final List<Apk> apks; // Cached state @SuppressWarnings("NonFinalFieldInImmutable") @Nullable private ImmutableMap<String, DexBackedClassDef> allClasses = null; public SplitApks(@NonNull List<Apk> apks) { this.apks = ImmutableList.copyOf(apks); } public Apk get(int index) { return apks.get(index); } public int size() { return apks.size(); } public List<Dex> getAllDexes() throws IOException { ImmutableList.Builder<Dex> allDexes = ImmutableList.builder(); for (Apk apk : apks) { allDexes.addAll(apk.getAllDexes()); } return allDexes.build(); } public Map<String, DexBackedClassDef> getAllClasses() throws IOException { if (allClasses != null) { return allClasses; } ImmutableMap.Builder<String, DexBackedClassDef> allClassesBuilder = ImmutableMap.builder(); for (Dex dex : getAllDexes()) { allClassesBuilder.putAll(dex.getClasses()); } allClasses = allClassesBuilder.build(); return allClasses; } @NonNull public List<Path> getEntries(@NonNull String name) { return apks.stream() .map(apk -> apk.getEntry(name)) .filter(Objects::nonNull) .collect(Collectors.toList()); } @Override public void close() throws Exception { for (Apk apk : apks) { apk.close(); } } @Override public String toString() { return "Apks<" + apks.stream().map(Apk::toString).collect(Collectors.joining(",")) + ">"; } }
[ "jwenbo52@gmail.com" ]
jwenbo52@gmail.com
f345dcda34eb384e31205f2ee900031381ef97f5
363ea820482234f8925eb775977ec7db4c8aa9bf
/app/src/main/java/com/cloud/tao/bean/etc/Order.java
c62d3fd56bcb6566e8415ae8d0db90f37984d7ad
[ "Apache-2.0" ]
permissive
liulyn/android_webview
cb8f5d119c6376a64b3ee1a2e1ed6f2c6cd48806
3538fb0713f0acd387f0ce880bbd34622a911b23
refs/heads/master
2021-08-24T01:59:06.968445
2017-12-07T15:02:51
2017-12-07T15:02:51
113,463,110
0
0
null
null
null
null
UTF-8
Java
false
false
1,806
java
package com.cloud.tao.bean.etc; import java.util.Arrays; /** * Created by gezi-pc on 2016/10/18. */ public class Order { public String store_id; public String parent_order_id; public String total_price; public String actual_total_price; public String state; public String state_name; public String refund_state; public String refund_state_name; public String pay_way; public String pay_way_name; public String buyer_u_client_id; public String buyer_login_name; public String order_create_time; public String order_pay_time; public String order_end_time; public int show_action_btn; public OrderChild[] son; @Override public String toString() { return "Order{" + "store_id='" + store_id + '\'' + ", parent_order_id='" + parent_order_id + '\'' + ", total_price='" + total_price + '\'' + ", actual_total_price='" + actual_total_price + '\'' + ", state='" + state + '\'' + ", state_name='" + state_name + '\'' + ", refund_state='" + refund_state + '\'' + ", refund_state_name='" + refund_state_name + '\'' + ", pay_way='" + pay_way + '\'' + ", pay_way_name='" + pay_way_name + '\'' + ", buyer_u_client_id='" + buyer_u_client_id + '\'' + ", buyer_login_name='" + buyer_login_name + '\'' + ", order_create_time='" + order_create_time + '\'' + ", order_pay_time='" + order_pay_time + '\'' + ", order_end_time='" + order_end_time + '\'' + ", show_action_btn='" + show_action_btn + '\'' + ", son=" + Arrays.toString(son) + '}'; } }
[ "524400890@qq.com" ]
524400890@qq.com
ac0043f4d015ebb36f39ada8ce6977fd2395d94f
a83e1caab53dc1641dcb3b45d9eb160e2656750e
/example/android/app/src/main/java/com/example/MainApplication.java
642ef35742932eb0af5add6eacf9353b91c58f3c
[ "MIT" ]
permissive
kant/react-native-network-state
15c599f725c2c1551de8ccfa42d873c42d0d0c56
0076fd60e900e0e3857ffb57cab436ab6af66e04
refs/heads/master
2020-12-07T02:55:46.095843
2019-12-28T10:32:47
2019-12-28T10:32:47
232,615,327
0
0
MIT
2020-01-08T17:08:51
2020-01-08T17:08:50
null
UTF-8
Java
false
false
1,137
java
package com.example; import android.app.Application; import com.facebook.react.ReactApplication; import com.reactnativevietnam.RNNetworkStatePackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new RNNetworkStatePackage() ); } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }
[ "anhtuank7c@hotmail.com" ]
anhtuank7c@hotmail.com
93b06c35db90ded960728b220ec406e659caa63c
b2d5628c05b8a364a6e1580b8ed1bbd6af8788e9
/src/test/java/io/github/xhanin/jarup/SystemOutRule.java
f61bdf95cbcc6d10b3156bba1b00c7342e05e3f1
[ "Apache-2.0" ]
permissive
xhanin/jarup
1e8d4815ab24eca0babb67f6110130d70c65c487
1734b49a70616d6beefd9eb102f6f2c93c3b88f4
refs/heads/master
2021-01-19T05:46:59.563148
2015-10-21T14:52:40
2015-10-21T14:52:40
15,772,747
3
2
Apache-2.0
2021-07-06T12:54:48
2014-01-09T16:50:55
Java
UTF-8
Java
false
false
1,272
java
package io.github.xhanin.jarup; import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; import java.io.ByteArrayOutputStream; import java.io.PrintStream; /** * Date: 10/1/14 * Time: 18:19 */ public class SystemOutRule implements TestRule { private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); private final ByteArrayOutputStream errContent = new ByteArrayOutputStream(); private void setUpStreams() { System.setOut(new PrintStream(outContent)); System.setErr(new PrintStream(errContent)); } private void cleanUpStreams() { System.setOut(null); System.setErr(null); } public String out() { return outContent.toString(); } public String err() { return errContent.toString(); } @Override public Statement apply(final Statement statement, Description description) { return new Statement() { @Override public void evaluate() throws Throwable { setUpStreams(); try { statement.evaluate(); } finally { cleanUpStreams(); } } }; } }
[ "xavier.hanin@4sh.fr" ]
xavier.hanin@4sh.fr
83151db048db724b4e5bf15e1106602b7733e7e6
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_1012076.java
bf0235a95ac06934c31de1848051d42b54d868fc
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
171
java
public void reset(){ setModuleName(getDefaultModuleName()); if (myProjectPath != null) { setModuleLocation(getDefaultModulePath() + getDefaultModuleName()); } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
a19ad345c92cccf31354c44d1b38771464c4a681
0cff8bf27c964d7f350619c95f78f019c8c18636
/Data Structure/Arrays/Que3.java
5fd1bc359fbb95db14ae67aa5cece3bedbfbdf1e
[]
no_license
Rutuja6199/Edac-May2021
9bf336aa13d4658b0ac593f8611673ac321a46c7
b720f826d3992308794b007e874d65ee942c5374
refs/heads/main
2023-06-03T20:52:44.035990
2021-06-20T15:55:50
2021-06-20T15:55:50
365,245,424
0
0
null
null
null
null
UTF-8
Java
false
false
502
java
/*int Write a program to shift every element of an array to circularly right. E.g.- INPUT : 1 2 3 4 5 OUTPUT : 5 1 2 3 4 4 5 1 2 3 3 4 5 1 2 2 3 4 5 1 1 2 3 4 5*/ public class Que3 { public static void main(String[] args) { int a[]= {1,2,3,4,5}; for(int i=0;i<a.length;i++) { int temp=a[a.length-1]; for(int j=a.length-1;j>0;j--) a[j]=a[j-1]; a[0]=temp; for(int k=0;k<a.length;k++) System.out.print(a[k]); System.out.println(); } } }
[ "noreply@github.com" ]
noreply@github.com
10aa28cff2114554ad5b3ab5ca023a2ddc5affba
e8a659bc6fb0714a72f583e7a0635d27e402b72e
/mobileazan/MobileAzan/pt/Method.java
fc3c653e5915bc2ef6c9f1059a1e9b28dd5ecf2e
[]
no_license
MyAdsAndroid/mobileazan
d59ff7912c44d92c34abca2d9abb30a4f3e1fe9b
d2d4c9f7726739fc2d87a0f878e3319459e9352c
refs/heads/master
2023-01-28T16:43:47.089881
2008-03-16T20:56:14
2008-03-16T20:56:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,104
java
package pt; import pt.Method; public class Method { double fajrAng; /* Fajr angle */ double ishaaAng; /* Ishaa angle */ double imsaakAng; /* The angle difference between Imsaak and Fajr ( default is 1.5)*/ int fajrInv; /* Fajr Interval is the amount of minutes between Fajr and Shurooq (0 if not used) */ int ishaaInv; /* Ishaa Interval is the amount if minutes between Ishaa and Maghrib (0 if not used) */ int imsaakInv; /* Imsaak Interval is the amount of minutes between Imsaak and Fajr. The default is 10 minutes before Fajr if Fajr Interval is set */ public int round; /* Method used for rounding seconds: 0: No Rounding. "Prayer.seconds" is set to the amount of computed seconds. 1: Normal Rounding. If seconds are equal to 30 or above, add 1 minute. Sets "Prayer.seconds" to zero. 2: Special Rounding. Similar to normal rounding but we always round down for Shurooq and Imsaak times. (default) 3: Aggressive Rounding. Similar to Special Rounding but we add 1 minute if the seconds value is equal to 1 second or more. */ double mathhab; /* Assr prayer shadow ratio: 1: Shaf'i (default) 2: Hanafi */ double nearestLat; /* Latitude Used for the 'Nearest Latitude' extreme methods. The default is 48.5 */ int extreme; /* Extreme latitude calculation method (see below) */ int offset; /* Enable Offsets switch (set this to 1 to activate). This option allows you to add or subtract any amount of minutes to the daily computed prayer times based on values (in minutes) for each prayer in the offList array */ double offList[] = new double[6]; /* For Example: If you want to add 30 seconds to Maghrib and subtract 2 minutes from Ishaa: offset = 1 offList[4] = 0.5 offList[5] = -2 ..and than call getPrayerTimes as usual. */ public Method(Method meth){ this.fajrAng = meth.fajrAng; this.ishaaAng = meth.ishaaAng; this.imsaakAng = meth.imsaakAng; this.fajrInv = meth.fajrInv; this.ishaaInv = meth.ishaaInv; this.imsaakInv = meth.imsaakInv; this.round = meth.round; this.mathhab = meth.mathhab; this.nearestLat = meth.nearestLat; this.extreme = meth.extreme; this.offset = meth.offset; this.offList = new double[6]; for (int i = 0; i < offList.length; i++) { this.offList[i] = meth.offList[i]; } } public Method() { } }
[ "alaaeldinalex@75b8d0cf-7446-0410-abfa-ab2ac548d469" ]
alaaeldinalex@75b8d0cf-7446-0410-abfa-ab2ac548d469
683b35aa3d1952c0442483d31b0193d56bb58803
5b1eed3d59f7ae1399aee3929329e595cb7e9043
/hwTwo/src/allTogether/Credit.java
5a734b8bac1bfc8aae887abb995d5b03a8180335
[]
no_license
Ahoura21/HubRepo
2cfb312632f91e48f20224d0973c7b1f07c91b06
65ae482ad6063ec3053242fecb40e33e32fc027c
refs/heads/master
2020-06-19T04:22:14.650879
2016-12-10T06:49:19
2016-12-10T06:49:19
74,921,232
0
0
null
null
null
null
UTF-8
Java
false
false
113
java
package allTogether; public interface Credit { public void creditCustomer(); public void backGround(); }
[ "nirvana.atashin@gmail.com" ]
nirvana.atashin@gmail.com
cf75b2e3dc4268327f1f521cecc12fa9194d9bc8
30aaf88728d6ed94c536cf2754070d068a475c93
/iyeeku-ext/src/main/java/com/iyeeku/ext/commonPermission/dao/impl/CommonPermissionDaoImpl.java
866e38e719df98dbd22bad4b491730c03c110da3
[]
no_license
liyuanlove/iyeeku
1a0ca6706935937ce0000a1e54eddc5045ce252b
be80b1222c8e6bd38a2f5679b19a41d1337f88ad
refs/heads/master
2020-04-06T09:17:49.840222
2018-11-10T06:56:10
2018-11-10T06:56:10
157,336,272
1
0
null
2018-11-13T07:10:24
2018-11-13T07:10:24
null
UTF-8
Java
false
false
1,970
java
package com.iyeeku.ext.commonPermission.dao.impl; import com.iyeeku.core.orm.impl.BaseDaoImpl; import com.iyeeku.ext.commonPermission.dao.CommonPermissionDao; import com.iyeeku.ext.function.vo.PFResMenuVO; import com.iyeeku.ext.grant.vo.PFArcGrantVO; import org.springframework.stereotype.Repository; import java.util.List; import java.util.Map; @Repository public class CommonPermissionDaoImpl extends BaseDaoImpl implements CommonPermissionDao { @Override public List<PFResMenuVO> findRoleMenu(PFArcGrantVO arcGrantVO) { return this.queryAll_myBatis("com.iyeeku.ext.function.dao.PFResMenuDao.findRoleMenu" , arcGrantVO); } @Override public List<PFResMenuVO> findPerParentMenu(PFArcGrantVO arcGrantVO) { return this.queryAll_myBatis("com.iyeeku.ext.function.dao.PFResMenuDao.findPerParentMenu" , arcGrantVO); } @Override public List<PFResMenuVO> findPerLeafMenu(PFArcGrantVO arcGrantVO) { return this.queryAll_myBatis("com.iyeeku.ext.function.dao.PFResMenuDao.findPerLeafMenu" , arcGrantVO); } @Override public List<PFArcGrantVO> findSSmkGrantInfo(Map<String, String> map) { return this.queryAll_myBatis("com.iyeeku.ext.grant.dao.PFArcGrantDao.findSSmkGrantInfo" ,map); } @Override public void updateMenuOrUrlRolePer(PFArcGrantVO arcGrantVO) { this.update_myBatis("com.iyeeku.ext.grant.dao.PFArcGrantDao.updateMenuOrUrlRolePer" , arcGrantVO); } @Override public void addCommonPer(PFArcGrantVO arcGrantVO) { this.save_myBatis("com.iyeeku.ext.grant.dao.PFArcGrantDao.saveGrant" , arcGrantVO); } @Override public void delMenuPer(PFArcGrantVO arcGrantVO) { this.update_myBatis("com.iyeeku.ext.grant.dao.PFArcGrantDao.delMenuPer" ,arcGrantVO); } @Override public void delCommonPer(PFArcGrantVO arcGrantVO) { this.update_myBatis("com.iyeeku.ext.grant.dao.PFArcGrantDao.updateMenuPer" , arcGrantVO); } }
[ "iyeeku@qq.com" ]
iyeeku@qq.com
3cdb11a948f31010f84bd1288c55eca3a3c95d9e
513226a99c5e6a8c91f0fbd38dae68e98783b2a0
/Tokenisation/ServiceTokenisation/src/main/java/com/service/tokenisation/model/TokenInteger.java
e7eed7e52d645c36ae66491068c649b9c465a002
[ "MIT" ]
permissive
satyajitg2/TokenService
9eb02bc8f07d7efc43874cfd803b4dd58e4474f0
06e9a6f765803eb6112a0a88a7d51b8c4c846feb
refs/heads/master
2021-09-05T00:31:44.393788
2018-01-23T04:58:03
2018-01-23T04:58:03
118,076,482
0
0
null
null
null
null
UTF-8
Java
false
false
5,251
java
package com.service.tokenisation.model; import java.sql.Date; import java.sql.Timestamp; /** * POJO class for TokenInteger * * @author: Satyajit Singh * @version: 1 */ public class TokenInteger { private long token; private boolean repeatableFlag; private Date tokenExpiryDate; private Timestamp tokenCreationDatetime; private String cSDValue; private String sourceFieldName; private String tokenMetadata; private String domainName; private String businessEntityName; private String systemName; private String targetFieldName; public long getToken() { return token; } public void setToken(long token) { this.token = token; } public boolean isRepeatableFlag() { return repeatableFlag; } public Date getTokenExpiryDate() { return tokenExpiryDate; } public void setTokenExpiryDate(Date tokenExpiryDate) { this.tokenExpiryDate = tokenExpiryDate; } public Timestamp getTokenCreationDatetime() { return tokenCreationDatetime; } public void setTokenCreationDatetime(Timestamp timeStamp) { this.tokenCreationDatetime = timeStamp; } public String getcSDValue() { return cSDValue; } public void setcSDValue(String cSDValue) { this.cSDValue = cSDValue; } public String getSourceFieldName() { return sourceFieldName; } public void setSourceFieldName(String sourceFieldName) { this.sourceFieldName = sourceFieldName; } public String getTokenMetadata() { return tokenMetadata; } public void setTokenMetadata(String tokenMetadata) { this.tokenMetadata = tokenMetadata; } public String getTargetFieldName() { return targetFieldName; } public void setTargetFieldName(String targetFieldName) { this.targetFieldName = targetFieldName; } public void setRepeatableFlag(boolean repeatableFlag) { this.repeatableFlag = repeatableFlag; } public String getDomainName() { return domainName; } public void setDomainName(String domainName) { this.domainName = domainName; } public String getBusinessEntityName() { return businessEntityName; } public void setBusinessEntityName(String businessEntityName) { this.businessEntityName = businessEntityName; } public String getSystemName() { return systemName; } public void setSystemName(String systemName) { this.systemName = systemName; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((businessEntityName == null) ? 0 : businessEntityName.hashCode()); result = prime * result + ((cSDValue == null) ? 0 : cSDValue.hashCode()); result = prime * result + ((domainName == null) ? 0 : domainName.hashCode()); result = prime * result + (repeatableFlag ? 1231 : 1237); result = prime * result + ((sourceFieldName == null) ? 0 : sourceFieldName.hashCode()); result = prime * result + ((systemName == null) ? 0 : systemName.hashCode()); result = prime * result + ((targetFieldName == null) ? 0 : targetFieldName.hashCode()); result = prime * result + (int) (token ^ (token >>> 32)); result = prime * result + ((tokenCreationDatetime == null) ? 0 : tokenCreationDatetime.hashCode()); result = prime * result + ((tokenExpiryDate == null) ? 0 : tokenExpiryDate.hashCode()); result = prime * result + ((tokenMetadata == null) ? 0 : tokenMetadata.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } TokenInteger other = (TokenInteger) obj; if (businessEntityName == null) { if (other.businessEntityName != null) { return false; } } else if (!businessEntityName.equals(other.businessEntityName)) { return false; } if (cSDValue == null) { if (other.cSDValue != null) { return false; } } else if (!cSDValue.equals(other.cSDValue)) { return false; } if (domainName == null) { if (other.domainName != null) { return false; } } else if (!domainName.equals(other.domainName)) { return false; } if (repeatableFlag != other.repeatableFlag) { return false; } if (sourceFieldName == null) { if (other.sourceFieldName != null) { return false; } } else if (!sourceFieldName.equals(other.sourceFieldName)) { return false; } if (systemName == null) { if (other.systemName != null) { return false; } } else if (!systemName.equals(other.systemName)) { return false; } if (targetFieldName == null) { if (other.targetFieldName != null) { return false; } } else if (!targetFieldName.equals(other.targetFieldName)) { return false; } if (token != other.token){ return false; } if (tokenCreationDatetime == null) { if (other.tokenCreationDatetime != null) { return false; } } else if (!tokenCreationDatetime.equals(other.tokenCreationDatetime)) { return false; } if (tokenExpiryDate == null) { if (other.tokenExpiryDate != null) { return false; } } else if (!tokenExpiryDate.equals(other.tokenExpiryDate)) { return false; } if (tokenMetadata == null) { if (other.tokenMetadata != null) { return false; } } else if (!tokenMetadata.equals(other.tokenMetadata)) { return false; } return true; } }
[ "satyajit.singh@intersectalliance.com" ]
satyajit.singh@intersectalliance.com
a5331ae63c2ebf9e5b8389115e712f5725573b12
7c83b3cf100af54fc1aa9b82b9367f9a58696372
/src/main/java/org/lanternpowered/server/game/registry/type/item/inventory/equipment/EquipmentTypeRegistryModule.java
9b16bc3afbf0d610010d09bf73b04645c79f236c
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
GustaveHooghmoed/LanternServer
c971eb284fdc18554f4aceefef47f40f116e4f14
61b3d181e87d571bcea01fbab8093a0a718578f8
refs/heads/master
2021-05-14T14:29:46.643758
2017-09-21T13:15:46
2017-12-30T14:10:59
115,972,253
1
0
null
2018-01-02T03:48:32
2018-01-02T03:48:32
null
UTF-8
Java
false
false
3,470
java
/* * This file is part of LanternServer, licensed under the MIT License (MIT). * * Copyright (c) LanternPowered <https://www.lanternpowered.org> * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.lanternpowered.server.game.registry.type.item.inventory.equipment; import static com.google.common.base.Preconditions.checkNotNull; import org.lanternpowered.server.game.registry.AdditionalPluginCatalogRegistryModule; import org.lanternpowered.server.inventory.equipment.LanternEquipmentType; import org.lanternpowered.server.inventory.equipment.LanternHeldEquipmentType; import org.lanternpowered.server.inventory.equipment.LanternWornEquipmentType; import org.spongepowered.api.data.type.HandType; import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.item.inventory.equipment.EquipmentType; import org.spongepowered.api.item.inventory.equipment.EquipmentTypes; public final class EquipmentTypeRegistryModule extends AdditionalPluginCatalogRegistryModule<EquipmentType> { public EquipmentTypeRegistryModule() { super(EquipmentTypes.class); } @Override public void registerDefaults() { register(new LanternEquipmentType("minecraft", "all", type -> true)); register(new LanternEquipmentType("minecraft", "equipped", type -> type instanceof LanternHeldEquipmentType || type instanceof LanternWornEquipmentType)); register(new LanternHeldEquipmentType("minecraft", "held", type -> type instanceof LanternHeldEquipmentType)); register(new LanternHeldEquipmentType("minecraft", "main_hand")); register(new LanternHeldEquipmentType("minecraft", "off_hand")); register(new LanternWornEquipmentType("minecraft", "worn", type -> type instanceof LanternWornEquipmentType)); register(new LanternWornEquipmentType("minecraft", "boots")); register(new LanternWornEquipmentType("minecraft", "chestplate")); register(new LanternWornEquipmentType("minecraft", "headwear")); register(new LanternWornEquipmentType("minecraft", "leggings")); } public static EquipmentType forHand(HandType handType) { checkNotNull(handType, "handType"); return handType == HandTypes.MAIN_HAND ? EquipmentTypes.MAIN_HAND : EquipmentTypes.OFF_HAND; } }
[ "seppevolkaerts@hotmail.com" ]
seppevolkaerts@hotmail.com
8c48e83ff57cdaa893574abc1dd56fbcfbbaef70
9eb7c939c9558478cc7decf164988a3df17feb54
/src/weixin/p3/linksucai/controller/WeixinLinksucaiController.java
c38c72ee4b5f4a63e93835d83dad2854bfd47fe6
[]
no_license
jy02537333/jy_GiftBook_API
8a8a92ae88e35c7f3c6633709c3bee5b1e88564d
809d696399b7807151dd24629d4e3d94dd6eb913
refs/heads/master
2021-01-13T16:06:39.370424
2018-04-28T07:55:21
2018-04-28T07:55:21
81,708,565
1
0
null
null
null
null
UTF-8
Java
false
false
17,839
java
package weixin.p3.linksucai.controller; import java.io.IOException; import java.io.OutputStream; import java.util.List; import java.util.Map; import java.util.ResourceBundle; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.jeecgframework.core.common.controller.BaseController; import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; import org.jeecgframework.core.common.model.json.AjaxJson; import org.jeecgframework.core.common.model.json.DataGrid; import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.util.BrowserUtils; import org.jeecgframework.core.util.ExceptionUtil; import org.jeecgframework.core.util.MyBeanUtils; import org.jeecgframework.core.util.ResourceUtil; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.oConvertUtils; import org.jeecgframework.poi.excel.ExcelExportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.entity.ExcelTitle; import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.tag.core.easyui.TagUtil; import org.jeecgframework.web.system.service.SystemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import weixin.guanjia.account.entity.WeixinAccountEntity; import com.jeecg.service.guanjia.WeixinAccountServiceI; import weixin.p3.linksucai.entity.WeixinLinksucaiEntity; import weixin.p3.linksucai.service.WeixinLinksucaiServiceI; import weixin.p3.oauth2.rule.RemoteWeixinMethod; import weixin.p3.oauth2.util.SignatureUtil; /** * @Title: Controller * @Description: 链接素材 * @author onlineGenerator * @date 2015-01-22 21:39:44 * @version V1.0 * */ @Controller @RequestMapping("/weixinLinksucaiController") public class WeixinLinksucaiController extends BaseController { /** * 签名密钥key */ private static final String SIGN_KEY = "4B6CAED6F7B19126F72780372E839CC47B1912B6CAED753F"; /** * Logger for this class */ private static final Logger logger = Logger.getLogger(WeixinLinksucaiController.class); @Autowired private WeixinLinksucaiServiceI weixinLinksucaiService; @Autowired private SystemService systemService; @Autowired private RemoteWeixinMethod remoteWeixinMethod; @Autowired private WeixinAccountServiceI weixinAccountService; private String message; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } /** * 转向私有模板 * @return */ @RequestMapping(params = "privateList") public ModelAndView privateList() { return new ModelAndView("weixin/guanjia/linksucai/privateWeixinLinksucaiList"); } @RequestMapping(params = "privateDatagrid") @ResponseBody /** * 私有查询数据 * @param newsTemplate * @param request * @param response * @param dataGrid */ public void privateDatagrid(WeixinLinksucaiEntity weixinLinksucai,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { CriteriaQuery cq = new CriteriaQuery(WeixinLinksucaiEntity.class, dataGrid); cq.eq("accountid", ResourceUtil.getShangJiaAccountId()); cq.add(); org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq,weixinLinksucai); this.weixinLinksucaiService.getDataGridReturn(cq, true); String baseurl = ResourceUtil.getConfigByName("domain"); for(int i=0;i<dataGrid.getResults().size();i++) { WeixinLinksucaiEntity t=(WeixinLinksucaiEntity) dataGrid.getResults().get(i); String inner_link = baseurl+"/weixinLinksucaiController.do?link&id="+t.getId(); t.setInnerLink(inner_link); } //update-begin--Author:macaholin Date:20150404 for:新增微信公众账号邮编名称(不存储数据库,只有用于显示),用于区分相同素材标题情况下是哪个父亲账号分享下来的 List<WeixinAccountEntity> accountList = weixinAccountService.loadAll(WeixinAccountEntity.class); //update-end--Author:macaholin Date:20150404 for:新增微信公众账号邮编名称(不存储数据库,只有用于显示),用于区分相同素材标题情况下是哪个父亲账号分享下来的 TagUtil.datagrid(response, dataGrid); } /** * 链接跳转 */ @RequestMapping(params = "link") public void link(WeixinLinksucaiEntity weixinLinksucai,HttpServletRequest request, HttpServletResponse response) { //获取请求路径 String backUrl = this.getRequestUrlWithParams(request); //URL配置ID String id = request.getParameter("id"); //URL配置信息 weixinLinksucai = systemService.getEntity(WeixinLinksucaiEntity.class, id); //微信公众账号ID String accountid = weixinLinksucai.getAccountid(); //update-begin-------author:scott-----------date:20151012--------for:如果连接带参数jwid,则通过jwid原始ID获取公众号信息------------ //如果带有参数jwid,标示指定公众号,逻辑如下 String jwid = request.getParameter("jwid"); if(oConvertUtils.isNotEmpty(jwid)){ WeixinAccountEntity weixinAccountEntity = weixinAccountService.getWeixinAccountByWeixinOldId(jwid); if(weixinAccountEntity!=null){ accountid = weixinAccountEntity.getId(); } } //update-end-------author:scott-----------date:20151012--------for:如果连接带参数jwid,则通过jwid原始ID获取公众号信息-------------- //微信用户 Openid String openid = ResourceUtil.getUserOpenId(); //跳转出链接 String outer_link_deal = null; //update-start--Author:scott Date:20150809 for:【判断访问地址是否有附加参数,有的话原样带回去】---------------------- String requestQueryString = (request.getRequestURL() + "?" + request.getQueryString()).replace(weixinLinksucai.getInnerLink(), ""); String outUrl = weixinLinksucai.getOuterLink(); if(oConvertUtils.isNotEmpty(requestQueryString)){ outUrl = outUrl + requestQueryString; } //update-start--Author:scott Date:20150809 for:【判断访问地址是否有附加参数,有的话原样带回去】---------------------- //------------------------------------------------------------------------------------------------------------- //如果为空则调用author2.0接口 if(oConvertUtils.isEmpty(openid)){ outer_link_deal = remoteWeixinMethod.callWeixinAuthor2ReturnUrl(request, accountid, backUrl); } if(oConvertUtils.isEmpty(outer_link_deal)){ openid = ResourceUtil.getUserOpenId(); System.out.println("------------------begin----------begin1-------------------"); outer_link_deal = weixinLinksucaiService.installOuterLinkWithSysParams(outUrl, openid, accountid,null); System.out.println("------------------begin----------begin2-------------------"); } //------------------------------------------------------------------------------------------------------------- try { //---update-begin--author:scott-----date:20151127-----for:参数加签名---------------------------------- if(outer_link_deal.indexOf("https://open.weixin.qq.com")!=-1){ //针对调整到auth2.0链接不加签名 response.sendRedirect(outer_link_deal); }else{ //针对参数加签,防止用户篡改 String sign = SignatureUtil.sign(SignatureUtil.getSignMap(outer_link_deal), SIGN_KEY); response.sendRedirect(outer_link_deal+"&sign="+sign); } //---update-end--author:scott-----date:20151127-----for:参数加签名---------------------------------- } catch (IOException e) { e.printStackTrace(); } } /** * 删除链接素材 * * @return */ @RequestMapping(params = "doDel") @ResponseBody public AjaxJson doDel(WeixinLinksucaiEntity weixinLinksucai, HttpServletRequest request) { AjaxJson j = new AjaxJson(); weixinLinksucai = systemService.getEntity(WeixinLinksucaiEntity.class, weixinLinksucai.getId()); message = "链接素材删除成功"; if(!weixinLinksucai.getAccountid().equals(ResourceUtil.getShangJiaAccountId())){ message="父级共享的数据子公众帐号不能操作"; }else{ try{ weixinLinksucaiService.delete(weixinLinksucai); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); }catch(Exception e){ e.printStackTrace(); message = "链接素材删除失败"; throw new BusinessException(e.getMessage()); } } j.setMsg(message); return j; } /** * 批量删除链接素材 * * @return */ @RequestMapping(params = "doBatchDel") @ResponseBody public AjaxJson doBatchDel(String ids,HttpServletRequest request){ AjaxJson j = new AjaxJson(); message = "链接素材删除成功"; try{ for(String id:ids.split(",")){ WeixinLinksucaiEntity weixinLinksucai = systemService.getEntity(WeixinLinksucaiEntity.class, id ); if(!weixinLinksucai.getAccountid().equals(ResourceUtil.getShangJiaAccountId())){ continue; } weixinLinksucaiService.delete(weixinLinksucai); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); } }catch(Exception e){ e.printStackTrace(); message = "链接素材删除失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; } /** * 添加链接素材 * * @param ids * @return */ @RequestMapping(params = "doAdd") @ResponseBody public AjaxJson doAdd(WeixinLinksucaiEntity weixinLinksucai, HttpServletRequest request) { AjaxJson j = new AjaxJson(); message = "链接素材添加成功"; try{ weixinLinksucaiService.save(weixinLinksucai); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); }catch(Exception e){ e.printStackTrace(); message = "链接素材添加失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; } /** * 更新链接素材 * * @param ids * @return */ @RequestMapping(params = "doUpdate") @ResponseBody public AjaxJson doUpdate(WeixinLinksucaiEntity weixinLinksucai, HttpServletRequest request) { AjaxJson j = new AjaxJson(); message = "链接素材更新成功"; WeixinLinksucaiEntity t = weixinLinksucaiService.get(WeixinLinksucaiEntity.class, weixinLinksucai.getId()); try { MyBeanUtils.copyBeanNotNull2Bean(weixinLinksucai, t); weixinLinksucaiService.saveOrUpdate(t); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); } catch (Exception e) { e.printStackTrace(); message = "链接素材更新失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; } /** * 链接素材新增页面跳转 * * @return */ @RequestMapping(params = "goAdd") public ModelAndView goAdd(WeixinLinksucaiEntity weixinLinksucai, HttpServletRequest req) { if (StringUtil.isNotEmpty(weixinLinksucai.getId())) { weixinLinksucai = weixinLinksucaiService.getEntity(WeixinLinksucaiEntity.class, weixinLinksucai.getId()); req.setAttribute("weixinLinksucaiPage", weixinLinksucai); } req.setAttribute("accountid", ResourceUtil.getShangJiaAccountId()); return new ModelAndView("weixin/guanjia/linksucai/weixinLinksucai-add"); } /** * 链接素材编辑页面跳转 * * @return */ @RequestMapping(params = "goUpdate") public ModelAndView goUpdate(WeixinLinksucaiEntity weixinLinksucai, HttpServletRequest req) { if (StringUtil.isNotEmpty(weixinLinksucai.getId())) { weixinLinksucai = weixinLinksucaiService.getEntity(WeixinLinksucaiEntity.class, weixinLinksucai.getId()); req.setAttribute("weixinLinksucaiPage", weixinLinksucai); } req.setAttribute("accountid", ResourceUtil.getShangJiaAccountId()); return new ModelAndView("weixin/guanjia/linksucai/weixinLinksucai-update"); } /** * 导入功能跳转 * * @return */ @RequestMapping(params = "upload") public ModelAndView upload(HttpServletRequest req) { return new ModelAndView("weixin/guanjia/linksucai/weixinLinksucaiUpload"); } /** * 导出excel * * @param request * @param response */ @RequestMapping(params = "exportXls") public void exportXls(WeixinLinksucaiEntity weixinLinksucai,HttpServletRequest request,HttpServletResponse response , DataGrid dataGrid) { response.setContentType("application/vnd.ms-excel"); String codedFileName = null; OutputStream fOut = null; try { codedFileName = "链接素材"; // 根据浏览器进行转码,使其支持中文文件名 if (BrowserUtils.isIE(request)) { response.setHeader( "content-disposition", "attachment;filename=" + java.net.URLEncoder.encode(codedFileName, "UTF-8") + ".xls"); } else { String newtitle = new String(codedFileName.getBytes("UTF-8"), "ISO8859-1"); response.setHeader("content-disposition", "attachment;filename=" + newtitle + ".xls"); } // 产生工作簿对象 HSSFWorkbook workbook = null; CriteriaQuery cq = new CriteriaQuery(WeixinLinksucaiEntity.class, dataGrid); org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, weixinLinksucai, request.getParameterMap()); List<WeixinLinksucaiEntity> weixinLinksucais = this.weixinLinksucaiService.getListByCriteriaQuery(cq,false); workbook = ExcelExportUtil.exportExcel(new ExcelTitle("链接素材列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(), "导出信息"), WeixinLinksucaiEntity.class, weixinLinksucais); fOut = response.getOutputStream(); workbook.write(fOut); } catch (Exception e) { } finally { try { fOut.flush(); fOut.close(); } catch (IOException e) { } } } /** * 导出excel 使模板 * * @param request * @param response */ @RequestMapping(params = "exportXlsByT") public void exportXlsByT(WeixinLinksucaiEntity weixinLinksucai,HttpServletRequest request,HttpServletResponse response , DataGrid dataGrid) { response.setContentType("application/vnd.ms-excel"); String codedFileName = null; OutputStream fOut = null; try { codedFileName = "链接素材"; // 根据浏览器进行转码,使其支持中文文件名 if (BrowserUtils.isIE(request)) { response.setHeader( "content-disposition", "attachment;filename=" + java.net.URLEncoder.encode(codedFileName, "UTF-8") + ".xls"); } else { String newtitle = new String(codedFileName.getBytes("UTF-8"), "ISO8859-1"); response.setHeader("content-disposition", "attachment;filename=" + newtitle + ".xls"); } // 产生工作簿对象 HSSFWorkbook workbook = null; workbook = ExcelExportUtil.exportExcel(new ExcelTitle("链接素材列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(), "导出信息"), WeixinLinksucaiEntity.class, null); fOut = response.getOutputStream(); workbook.write(fOut); } catch (Exception e) { } finally { try { fOut.flush(); fOut.close(); } catch (IOException e) { } } } @SuppressWarnings("unchecked") @RequestMapping(params = "importExcel", method = RequestMethod.POST) @ResponseBody public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) { AjaxJson j = new AjaxJson(); MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { MultipartFile file = entity.getValue();// 获取上传文件对象 ImportParams params = new ImportParams(); params.setTitleRows(2); params.setSecondTitleRows(1); params.setNeedSave(true); try { List<WeixinLinksucaiEntity> listWeixinLinksucaiEntitys = (List<WeixinLinksucaiEntity>)ExcelImportUtil.importExcelByIs(file.getInputStream(),WeixinLinksucaiEntity.class,params); for (WeixinLinksucaiEntity weixinLinksucai : listWeixinLinksucaiEntitys) { weixinLinksucaiService.save(weixinLinksucai); } j.setMsg("文件导入成功!"); } catch (Exception e) { j.setMsg("文件导入失败!"); logger.error(ExceptionUtil.getExceptionMessage(e)); }finally{ try { file.getInputStream().close(); } catch (IOException e) { e.printStackTrace(); } } } return j; } @RequestMapping(params = "poplink") public ModelAndView poplink(ModelMap modelMap, @RequestParam String id) { //WeixinLinksucaiEntity weixinLinksucai = weixinLinksucaiService.getEntity(WeixinLinksucaiEntity.class, id); ResourceBundle bundler = ResourceBundle.getBundle("sysConfig"); String absolutePathUrl = bundler.getString("domain") + "/weixinLinksucaiController.do?link&id=" + id; modelMap.put("url",absolutePathUrl); return new ModelAndView("weixin/guanjia/linksucai/poplinksucai"); } /** * 获取Request请求的路径信息 带参数 * @param request * @return */ private static String getRequestUrlWithParams(HttpServletRequest request){ String backurl = request.getScheme()+"://"+request.getServerName()+request.getRequestURI()+"?"+request.getQueryString(); return backurl; } }
[ "jy02537333@gmail.com" ]
jy02537333@gmail.com
275a14a3b811b78502b0b2766a3f2b1a2b213c04
72e5b617b05e380b6f99676bdf4528a1b3795b72
/src/eg/edu/alexu/csd/oop/game/controller/gameLoop/AbstractGameLoop.java
13948b87638bdd6c5bbe9a32901b38fc9bfbc85e
[]
no_license
omarmohamedemam/Clown-OF-Plates
b7584c565858f8cbe1468b974b73bbf2531d6b3e
3fa7f1615ce08ef77c3b9d63fd8598c2562591de
refs/heads/master
2020-12-05T01:43:30.559055
2020-01-05T22:42:56
2020-01-05T22:42:56
231,971,346
0
0
null
null
null
null
UTF-8
Java
false
false
1,165
java
package eg.edu.alexu.csd.oop.game.controller.gameLoop; import java.util.Iterator; import eg.edu.alexu.csd.oop.game.GameObject; import eg.edu.alexu.csd.oop.game.model.world.AbstractWorldModel; public abstract class AbstractGameLoop { protected final int MAX_TIME ; protected final long startTime; protected final int width ; protected final int height ; /**dPattern Iterator*/ protected final Iterator<GameObject> constant; /**dPattern Iterator*/ protected final Iterator<GameObject> moving ; /**dPattern Iterator*/ protected final Iterator<GameObject> control ; public AbstractGameLoop(AbstractWorldModel world) { this.startTime = world.startTime; this.MAX_TIME = world.MAX_TIME ; this.width = world.getWidth(); this.height = world.getHeight(); this.constant = world.constant.iterator(); this.moving = world.moving.iterator(); this.control = world.control.iterator(); } /** * Game Loop logic * refresh the world state and update locations * @author Abdelrahman, Zidan * @dPattern Facade * @return false means game over */ public abstract boolean updateAndCheck(); }
[ "noreply@github.com" ]
noreply@github.com
581e5e9b01bbe9bd3c1a24b27c9401204f8925f2
6fb66547ba46ec56a9953069483a84f833628c03
/cloud2020/cloud-stream-rabbitmq-provider8801/src/main/java/com/mao/springcloud/service/impl/MessageProviderImpl.java
b759ab3c027281729a52ce9aad1193ea6f724c51
[]
no_license
lloam/cloud2020
46837f47988f34bfa4132bb5b80a2b7f4871b120
7e6d84c00879fc92fee65577b238ace6c110f814
refs/heads/main
2023-08-30T19:06:24.922755
2021-10-04T08:27:28
2021-10-04T08:27:28
403,304,844
0
0
null
null
null
null
UTF-8
Java
false
false
1,032
java
package com.mao.springcloud.service.impl; import com.mao.springcloud.service.IMessageProvider; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.messaging.Source; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.support.MessageBuilder; import javax.annotation.Resource; import java.util.UUID; /** * Author: lloam * Date: 2021/9/21 11:27 * Description: * 不需要加 @Service 注解,因为这个类是和 RabbitMQ 处理的 * 定义消息的推送管道 */ @EnableBinding(Source.class) // 定义消息的推送管道 @Slf4j public class MessageProviderImpl implements IMessageProvider { @Resource private MessageChannel output; // 消息发送管道 public String send() { String serial = UUID.randomUUID().toString(); output.send(MessageBuilder.withPayload(serial).build()); log.info("*****serial:" + serial); return serial; } }
[ "2196143404@qq.com" ]
2196143404@qq.com
a0834c8493279235cd69018c9b977d9c63ff8b90
4c33b043293b6994d139d2d0be8b086585f4c6bf
/com/sample/_9_BEYOND/PatriciaSET.java
83afa6b02a6a3506b86a79eb041a8063e6ac2425
[]
no_license
JungArthur/JavaAlgorithms
802ae2a797a9dcf26fdc1a5c9f4de72054359bcc
845b8c6d3813c8744fe18bd6d47cebaf11e6d431
refs/heads/main
2023-04-18T02:10:42.469512
2021-04-20T13:59:44
2021-04-20T13:59:44
359,832,493
0
0
null
null
null
null
UTF-8
Java
false
false
18,827
java
package com.sample._9_BEYOND; import com.io.STANDARD.*; import com.sample._1_FUNDAMENTALS.Queue; /****************************************************************************** * Compilation: javac PatriciaSET.java * Execution: java PatriciaSET * Dependencies: StdOut.java StdRandom.java Queue.java * Data files: n/a * * A set implementation based on PATRICIA. * * % java PatriciaSET 1000000 1 * Creating dataset (1000000 items)... * Shuffling... * Adding (1000000 items)... * Iterating... * 1000000 items iterated * Shuffling... * Deleting (500000 items)... * Iterating... * 500000 items iterated * Checking... * 500000 items found and 500000 (deleted) items missing * Deleting the rest (500000 items)... * PASS 1 TESTS SUCCEEDED * % * ******************************************************************************/ import java.util.Iterator; /** * The {@code PatriciaSET} class provides an implementation of an * unordered set, with the restriction that the items (keys) are of class * {@link java.lang.String}. It supports the usual <em>add</em>, * <em>contains</em>, <em>delete</em>, <em>size</em>, and <em>is-empty</em> * methods. It also provides an <em>iterator</em> method for iterating over all * the elements in the set. * <p> * This unordered set class implements PATRICIA (Practical Algorithm to * Retrieve Information Coded In Alphanumeric). In spite of the acronym, string * keys are not limited to alphanumeric content. A key may possess any string * value, with one exception: a zero-length string is not permitted. * <p> * Unlike other generic set implementations that can accept a parameterized key * type, this set class can only accommodate keys of class * {@link java.lang.String}. This unfortunate restriction stems from a * limitation in Java. Although Java provides excellent support for generic * programming, the current infrastructure somewhat limits generic collection * implementations to those that employ comparison-based or hash-based methods. * PATRICIA does not employ comparisons or hashing; instead, it relies on * bit-test operations. Because Java does not furnish any generic abstractions * (or implementations) for bit-testing the contents of an object, providing * support for generic keys using PATRICIA does not seem practical. * <p> * PATRICIA is a variation of a trie, and it is often classified as a * space-optimized trie. In a classical trie, each level represents a * subsequent digit in a key. In PATRICIA, nodes only exist to identify the * digits (bits) that distinguish the individual keys within the trie. Because * PATRICIA uses a radix of two, each node has only two children, like a binary * tree. Also like a binary tree, the number of nodes, within the trie, equals * the number of keys. Consequently, some classify PATRICIA as a tree. * <p> * The analysis of PATRICIA is complicated. The theoretical wost-case * performance for an <em>add</em>, <em>contains</em>, or <em>delete</em> * operation is <strong>O(N)</strong>, when <strong>N</strong> is less than * <strong>W</strong> (where <strong>W</strong> is the length in bits of the * longest key), and <strong>O(W)</strong>, when <strong>N</strong> is greater * than <strong>W</strong>. However, the worst case is unlikely to occur with * typical use. The average (and usual) performance of PATRICIA is * approximately <strong>~lg N</strong> for each <em>add</em>, * <em>contains</em>, or <em>delete</em> operation. Although this appears to * put PATRICIA on the same footing as binary trees, this time complexity * represents the number of single-bit test operations (under PATRICIA), and * not full-key comparisons (as required by binary trees). After the single-bit * tests conclude, PATRICIA requires just one full-key comparison to confirm * the existence (or absence) of the key (per <em>add</em>, <em>contains</em>, * or <em>delete</em> operation). * <p> * In practice, decent implementations of PATRICIA can often outperform * balanced binary trees, and even hash tables. Although this particular * implementation performs well, the source code was written with an emphasis * on clarity, and not performance. PATRICIA performs admirably when its * bit-testing loops are well tuned. Consider using the source code as a guide, * should you need to produce an optimized implementation, for anther key type, * or in another programming language. * <p> * Other resources for PATRICIA:<br> * Sedgewick, R. (1990) <i>Algorithms in C</i>, Addison-Wesley<br> * Knuth, D. (1973) <i>The Art of Computer Programming</i>, Addison-Wesley<br> * * @author John Hentosh (based on an implementation by Robert Sedgewick) */ public class PatriciaSET implements Iterable<String> { private Node head; private int count; /* An inner Node class specifies the objects that hold each key. The b * value indicates the relevant bit position. */ private class Node { private Node left, right; private String key; private int b; public Node(String key, int b) { this.key = key; this.b = b; } }; /** * Initializes an empty PATRICIA-based set. */ /* The constructor creates a head (sentinel) node that contains a * zero-length string. */ public PatriciaSET() { head = new Node("", 0); head.left = head; head.right = head; count = 0; } /** * Adds the key to the set if it is not already present. * @param key the key to add * @throws IllegalArgumentException if {@code key} is {@code null} * @throws IllegalArgumentException if {@code key} is the empty string. */ public void add(String key) { if (key == null) throw new IllegalArgumentException("called add(null)"); if (key.length() == 0) throw new IllegalArgumentException("invalid key"); Node p; Node x = head; do { p = x; if (safeBitTest(key, x.b)) x = x.right; else x = x.left; } while (p.b < x.b); if (!x.key.equals(key)) { int b = firstDifferingBit(x.key, key); x = head; do { p = x; if (safeBitTest(key, x.b)) x = x.right; else x = x.left; } while (p.b < x.b && x.b < b); Node t = new Node(key, b); if (safeBitTest(key, b)) { t.left = x; t.right = t; } else { t.left = t; t.right = x; } if (safeBitTest(key, p.b)) p.right = t; else p.left = t; count++; } } /** * Does the set contain the given key? * @param key the key * @return {@code true} if the set contains {@code key} and * {@code false} otherwise * @throws IllegalArgumentException if {@code key} is {@code null} * @throws IllegalArgumentException if {@code key} is the empty string. */ public boolean contains(String key) { if (key == null) throw new IllegalArgumentException("called contains(null)"); if (key.length() == 0) throw new IllegalArgumentException("invalid key"); Node p; Node x = head; do { p = x; if (safeBitTest(key, x.b)) x = x.right; else x = x.left; } while (p.b < x.b); return x.key.equals(key); } /** * Removes the key from the set if the key is present. * @param key the key * @throws IllegalArgumentException if {@code key} is {@code null} * @throws IllegalArgumentException if {@code key} is the empty string. */ public void delete(String key) { if (key == null) throw new IllegalArgumentException("called delete(null)"); if (key.length() == 0) throw new IllegalArgumentException("invalid key"); Node g; // previous previous (grandparent) Node p = head; // previous (parent) Node x = head; // node to delete do { g = p; p = x; if (safeBitTest(key, x.b)) x = x.right; else x = x.left; } while (p.b < x.b); if (x.key.equals(key)) { Node z; Node y = head; do { // find the true parent (z) of x z = y; if (safeBitTest(key, y.b)) y = y.right; else y = y.left; } while (y != x); if (x == p) { // case 1: remove (leaf node) x Node c; // child of x if (safeBitTest(key, x.b)) c = x.left; else c = x.right; if (safeBitTest(key, z.b)) z.right = c; else z.left = c; } else { // case 2: p replaces (internal node) x Node c; // child of p if (safeBitTest(key, p.b)) c = p.left; else c = p.right; if (safeBitTest(key, g.b)) g.right = c; else g.left = c; if (safeBitTest(key, z.b)) z.right = p; else z.left = p; p.left = x.left; p.right = x.right; p.b = x.b; } count--; } } /** * Is the set empty? * @return {@code true} if the set is empty, and {@code false} * otherwise */ boolean isEmpty() { return count == 0; } /** * Returns the number of keys in the set. * @return the number of keys in the set */ int size() { return count; } /** * Returns all of the keys in the set, as an iterator. * To iterate over all of the keys in a set named {@code set}, use the * foreach notation: {@code for (Key key : set)}. * @return an iterator to all of the keys in the set */ public Iterator<String> iterator() { Queue<String> queue = new Queue<String>(); if (head.left != head) collect(head.left, 0, queue); if (head.right != head) collect(head.right, 0, queue); return queue.iterator(); } private void collect(Node x, int b, Queue<String> queue) { if (x.b > b) { collect(x.left, x.b, queue); queue.enqueue(x.key); collect(x.right, x.b, queue); } } /** * Returns a string representation of this set. * @return a string representation of this set, with the keys separated * by single spaces */ public String toString() { StringBuilder s = new StringBuilder(); for (String key : this) s.append(key + " "); if (s.length() > 0) s.deleteCharAt(s.length() - 1); return s.toString(); } /* The safeBitTest function logically appends a terminating sequence (when * required) to extend (logically) the string beyond its length. * * The inner loops of the get and put methods flow much better when they * are not concerned with the lengths of strings, so a trick is employed to * allow the get and put methods to view every string as an "infinite" * sequence of bits. Logically, every string gets a '\uffff' character, * followed by an "infinite" sequence of '\u0000' characters, appended to * the end. * * Note that the '\uffff' character serves to mark the end of the string, * and it is necessary. Simply padding with '\u0000' is insufficient to * make all unique Unicode strings "look" unique to the get and put methods * (because these methods do not regard string lengths). */ private static boolean safeBitTest(String key, int b) { if (b < key.length() * 16) return bitTest(key, b) != 0; if (b > key.length() * 16 + 15) return false; // padding /* 16 bits of 0xffff */ return true; // end marker } private static int bitTest(String key, int b) { return (key.charAt(b >>> 4) >>> (b & 0xf)) & 1; } /* Like the safeBitTest function, the safeCharAt function makes every * string look like an "infinite" sequence of characters. Logically, every * string gets a '\uffff' character, followed by an "infinite" sequence of * '\u0000' characters, appended to the end. */ private static int safeCharAt(String key, int i) { if (i < key.length()) return key.charAt(i); if (i > key.length()) return 0x0000; // padding else return 0xffff; // end marker } /* For efficiency's sake, the firstDifferingBit function compares entire * characters first, and then considers the individual bits (once it finds * two characters that do not match). Also, the least significant bits of * an individual character are examined first. There are many Unicode * alphabets where most (if not all) of the "action" occurs in the least * significant bits. * * Notice that the very first character comparison excludes the * least-significant bit. The firstDifferingBit function must never return * zero; otherwise, a node would become created as a child to the head * (sentinel) node that matches the bit-index value (zero) stored in the * head node. This would violate the invariant that bit-index values * increase as you descend into the trie. */ private static int firstDifferingBit(String k1, String k2) { int i = 0; int c1 = safeCharAt(k1, 0) & ~1; int c2 = safeCharAt(k2, 0) & ~1; if (c1 == c2) { i = 1; while (safeCharAt(k1, i) == safeCharAt(k2, i)) i++; c1 = safeCharAt(k1, i); c2 = safeCharAt(k2, i); } int b = 0; while (((c1 >>> b) & 1) == ((c2 >>> b) & 1)) b++; return i * 16 + b; } /** * Unit tests the {@code PatriciaSET} data type. * This test fixture runs a series of tests on a randomly generated dataset. * You may specify up to two integer parameters on the command line. The * first parameter indicates the size of the dataset. The second parameter * controls the number of passes (a new random dataset becomes generated at * the start of each pass). * * @param args the command-line arguments */ public static void main(String[] args) { PatriciaSET set = new PatriciaSET(); int limitItem = 1000000; int limitPass = 1; int countPass = 0; boolean ok = true; if (args.length > 0) limitItem = Integer.parseInt(args[0]); if (args.length > 1) limitPass = Integer.parseInt(args[1]); do { String[] a = new String[limitItem]; StdOut.printf("Creating dataset (%d items)...\n", limitItem); for (int i = 0; i < limitItem; i++) a[i] = Integer.toString(i, 16); StdOut.printf("Shuffling...\n"); StdRandom.shuffle(a); StdOut.printf("Adding (%d items)...\n", limitItem); for (int i = 0; i < limitItem; i++) set.add(a[i]); int countItems = 0; StdOut.printf("Iterating...\n"); for (String key : set) countItems++; StdOut.printf("%d items iterated\n", countItems); if (countItems != limitItem) ok = false; if (countItems != set.size()) ok = false; StdOut.printf("Shuffling...\n"); StdRandom.shuffle(a); int limitDelete = limitItem / 2; StdOut.printf("Deleting (%d items)...\n", limitDelete); for (int i = 0; i < limitDelete; i++) set.delete(a[i]); countItems = 0; StdOut.printf("Iterating...\n"); for (String key : set) countItems++; StdOut.printf("%d items iterated\n", countItems); if (countItems != limitItem - limitDelete) ok = false; if (countItems != set.size()) ok = false; int countDelete = 0; int countRemain = 0; StdOut.printf("Checking...\n"); for (int i = 0; i < limitItem; i++) { if (i < limitDelete) { if (!set.contains(a[i])) countDelete++; } else { if (set.contains(a[i])) countRemain++; } } StdOut.printf("%d items found and %d (deleted) items missing\n", countRemain, countDelete); if (countRemain + countDelete != limitItem) ok = false; if (countRemain != set.size()) ok = false; if (set.isEmpty()) ok = false; StdOut.printf("Deleting the rest (%d items)...\n", limitItem - countDelete); for (int i = countDelete; i < limitItem; i++) set.delete(a[i]); if (!set.isEmpty()) ok = false; countPass++; if (ok) StdOut.printf("PASS %d TESTS SUCCEEDED\n", countPass); else StdOut.printf("PASS %d TESTS FAILED\n", countPass); } while (ok && countPass < limitPass); if (!ok) throw new java.lang.RuntimeException("TESTS FAILED"); } } /****************************************************************************** * Copyright 2002-2020, Robert Sedgewick and Kevin Wayne. * * This file is part of algs4.jar, which accompanies the textbook * * Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, * Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. * http://algs4.cs.princeton.edu * * * algs4.jar is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * algs4.jar is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with algs4.jar. If not, see http://www.gnu.org/licenses. ******************************************************************************/
[ "at@ATs-MacBook-Air.local" ]
at@ATs-MacBook-Air.local
9a6893d89df89c398d535e3e48e7f6aff1913c13
8764eeb467a34a22e45902bfc0b8922f27a15f24
/common/reactive/src/test/java/io/helidon/common/reactive/MultiToTest.java
c4f35829b833eacfea4c7cf93aa0d17cec69f969
[ "Apache-2.0", "LicenseRef-scancode-unicode", "LGPL-3.0-only", "LicenseRef-scancode-warranty-disclaimer", "CC0-1.0", "GPL-3.0-only", "LicenseRef-scancode-protobuf", "LGPL-2.0-or-later", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference", "EPL-1.0", "Classpath-exception-2.0", "Lic...
permissive
aseovic/helidon
36c43b9cf217a05c8ffa22e21a0e4d17a887acbb
895695a902b4b843b61afa5e80c8280cec468946
refs/heads/master
2021-06-10T10:50:49.807748
2021-04-26T17:13:43
2021-04-26T17:23:44
168,202,967
0
4
Apache-2.0
2019-09-11T10:18:40
2019-01-29T18:07:33
Java
UTF-8
Java
false
false
1,562
java
/* * Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * 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.helidon.common.reactive; import java.util.function.Function; import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; public class MultiToTest { @Test public void compose() { TestSubscriber<String> ts = new TestSubscriber<>(Long.MAX_VALUE); Function<Multi<Integer>, Multi<String>> function = upstream -> upstream.map(Object::toString); Multi.just(1) .to(function) .subscribe(ts); ts.assertResult("1"); } @Test public void composeNull() { assertThrows(NullPointerException.class, () -> Multi.just(1).to(null)); } @Test public void composeThrows() { assertThrows(IllegalArgumentException.class, () -> Multi.just(1) .to(s -> { throw new IllegalArgumentException(); })); } }
[ "noreply@github.com" ]
noreply@github.com
1a2c80ada6dc4721aeafc14a114b316daa808af4
42e863330316459d6046f362f4a6d727c69fe743
/alumni-system/alumni-system/src/java/com/controllers/alumni/AlumniController.java
bfe3efd2173ea5d96849a32644f2c28b9f7b6ee6
[]
no_license
nurfatinatqh/alumni-system-team2
86dad8e834233e87b91797b7e06bb2ec3424a6ae
065044ca522179a4f1206d19a7c7883613de6821
refs/heads/main
2023-02-20T15:15:32.527313
2021-01-22T16:53:35
2021-01-22T16:53:35
332,406,672
0
0
null
2021-01-24T09:07:40
2021-01-24T09:07:39
null
UTF-8
Java
false
false
49,621
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.controllers.alumni; import com.controllers.alumni.adapter.Route; import com.controllers.alumni.singleton.AlumniPageList; import static com.controllers.alumni.singleton.AlumniPageList.ALUMNI_DEFAULT_PROFILE_PICTURE; import com.controllers.alumni.singleton.AlumniRequestTypeList; import com.controllers.alumni.singleton.AlumniSQLStatementList; import com.jdbc.utility.JDBCUtility; import com.models.alumni.Alumni; import com.google.gson.Gson; import com.models.user.User; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.sql.Blob; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; 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 javax.servlet.http.HttpSession; import javax.servlet.http.Part; /** * * @author PC */ @WebServlet("/mobile-api/alumniList") public class AlumniController extends HttpServlet { private static ArrayList<Alumni> alumniList; private static Alumni currentAlumni; private static int totalAlumni = 0; private static int totalPages; private final int TOTAL_ALUMNI_PER_PAGE = 10; private static int currentPage = 1; private static final Comparator<Alumni> ASC_ALUMNI_NAME; private static final Comparator<Alumni> DESC_ALUMNI_NAME; // We initialize static variables inside a static block. static { ASC_ALUMNI_NAME = (Alumni alumni1, Alumni alumni2) -> alumni1.getName().compareTo(alumni2.getName()); DESC_ALUMNI_NAME = (Alumni alumni1, Alumni alumni2) -> alumni2.getName().compareTo(alumni1.getName()); } /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { if (alumniList == null || alumniList.isEmpty()) { getAllAlumniInfoFromDatabase(); } String requestType = request.getParameter("requestType"); if (null == requestType) { out.println("<script>alert('requestType is null');</script>"); } else switch (requestType) { case AlumniRequestTypeList.REQUEST_TYPE_VIEW_ALUMNI_LIST: if (getAllAlumniInfoFromDatabase()) { sortAlumniByNameAscendingOrder(); goToPage(1); processViewAlumniList(request, response); } else { out.println("<script>alert('Error Happen when retrieving all of the alumni information from database');</script>"); } break; case AlumniRequestTypeList.REQUEST_TYPE_UPDATE_ALUMN_PROFILE_PICTURE: String uploadButton = request.getParameter("upload-btn"); String removeButton = request.getParameter("remove-btn"); String message = ""; if(uploadButton != null) { message = processUpdateAlumniProfilePicture(request, response); } else if(removeButton != null) { // final String pathString = request.getScheme() + "://" + "alumni-module.herokuapp.com" + "/assets/img/alumni/profile/default.png"; // final String pathString = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/assets/img/alumni/profile/default.png"; // final String pathString = request.getContextPath() + "/assets/img/alumni/profile/default.png"; // // Path path = Paths.get(pathString); // byte[] fileContent = Files.readAllBytes(defaultPicture.toPath()); // byte[] fileContent = Files.readAllBytes(path); byte[] fileContent = java.util.Base64.getDecoder().decode(ALUMNI_DEFAULT_PROFILE_PICTURE); if(saveUpdatedProfilePictureIntoDatabase(fileContent)) { String base64Image = Base64.getEncoder().encodeToString(fileContent); currentAlumni.setAlumniProfilePicture(base64Image); message = "Successfully restore default picture"; } else { message = "Failed to restore default picture"; } } viewOverlay(request, response, message, AlumniRequestTypeList.REQUEST_TYPE_MANAGE_SELECTED_ALUMNI_INFO); setAttributesForCurrentAlumni(request, response, "update"); new Route().includePage(request, response, AlumniPageList.MANAGE_ALUMNI_INFO_PAGE); break; case AlumniRequestTypeList.REQUEST_TYPE_MANAGE_ALUMNUS_ALUMNA_INFO: if (setCurrentAlumni(request)) { viewManageInfoPage(request, response); } else { HttpSession session = request.getSession(); String messageForManageAlumniInfoList = "Error happen when retrieving current alumni information with alumniID =" + ((User)session.getAttribute("user")).getUserID() + " from database<br />"; viewOverlay(request, response, messageForManageAlumniInfoList, AlumniRequestTypeList.REQUEST_TYPE_MANAGE_ALUMNUS_ALUMNA_INFO); } break; case AlumniRequestTypeList.REQUEST_TYPE_MANAGE_SELECTED_ALUMNI_INFO: processManageSelectedAlumniInfo(request, response); viewManageInfoPage(request, response); break; case AlumniRequestTypeList.REQUEST_TYPE_DELETE_UPDATE_ALUMNI_INFO: String btnUpdateSelected = request.getParameter("update-btn"); String btnDeleteSelected = request.getParameter("delete-btn"); if (btnUpdateSelected != null) { processViewUpdateAlumniInfoPage(request, response); } else if (btnDeleteSelected != null) { processViewDeleteAlumniInfoPage(request, response); } break; case AlumniRequestTypeList.REQUEST_TYPE_UPDATE_ALUMNI_INFO: String btnSaveSelected = request.getParameter("save-btn"); String btnCancelSelected = request.getParameter("cancel-btn"); String messageUpdateCancelInfo = ""; if (btnSaveSelected != null) { if(saveUpdatedInfoIntoDatabase(request, response)) { messageUpdateCancelInfo = "Successfully update the information"; }else { messageUpdateCancelInfo = "Failed update the information"; } } else if (btnCancelSelected != null) { messageUpdateCancelInfo = "Any changes made have been reverted"; } viewOverlay(request, response, messageUpdateCancelInfo, AlumniRequestTypeList.REQUEST_TYPE_MANAGE_SELECTED_ALUMNI_INFO); setAttributesForCurrentAlumni(request, response, "view"); new Route().includePage(request, response, AlumniPageList.MANAGE_ALUMNI_INFO_PAGE); break; case AlumniRequestTypeList.REQUEST_TYPE_CONFIRMATION_TO_DELETE_ALUMNI_INFO: String btnYesSelected = request.getParameter("yes-btn"); String btnNoSelected = request.getParameter("no-btn"); if (btnYesSelected != null) { String messageDeleteConfirmation = ""; if (deleteAlumniAccountFromDatabase(request, response)) { messageDeleteConfirmation = "Successfully delete alumni"; } else { messageDeleteConfirmation = "Failed to delete alumni"; } viewOverlay(request, response, messageDeleteConfirmation, AlumniRequestTypeList.REQUEST_TYPE_VIEW_ALUMNI_LIST); setContentForAlumniList(request); new Route().includePage(request, response, AlumniPageList.VIEW_ALUMNI_LIST_INFO_PAGE); } else if (btnNoSelected != null) { viewManageInfoPage(request, response); } break; case AlumniRequestTypeList.REQUEST_TYPE_VIEW_ALUMNI_LIST_AT_SELECTED_PAGE: goToPage(Integer.parseInt(request.getParameter("pageNumber"))); processViewAlumniList(request, response); break; case AlumniRequestTypeList.REQUEST_TYPE_FILTER_ALUMNI_INFO: if (request.getParameter("filterReq").equalsIgnoreCase("orderByNameAtoZ")) { sortAlumniByNameAscendingOrder(); request.setAttribute("filterReq", "orderByNameAtoZ"); } else if (request.getParameter("filterReq").equalsIgnoreCase("orderByNameZtoA")) { sortAlumniByNameDescendingOrder(); request.setAttribute("filterReq", "orderByNameZtoA"); } goToPage(1); processViewAlumniList(request, response); break; case AlumniRequestTypeList.REQUEST_TYPE_SEARCH_ALUMNI: String searchBtn = request.getParameter("searchBtn"); String resetBtn = request.getParameter("resetBtn"); if (searchBtn != null) { String searchReq = request.getParameter("searchReq"); String searchInfo = request.getParameter("searchInfo"); if (searchReq.equalsIgnoreCase("searchByName")) { searchByAlumniName(searchInfo); } else if (searchReq.equalsIgnoreCase("searchByLocationInState")) { searchByAlumniLocationInState(searchInfo); } sortAlumniByNameAscendingOrder(); request.setAttribute("filterReq", "orderByNameAtoZ"); request.setAttribute("selectedSearchReq", searchReq); goToPage(1); processViewAlumniList(request, response); } else if (resetBtn != null) { if (getAllAlumniInfoFromDatabase()) { sortAlumniByNameAscendingOrder(); goToPage(1); processViewAlumniList(request, response); } else { out.println("Error Happen when retrieving all of the alumni information from database"); } } break; default: break; } } } private String processUpdateAlumniProfilePicture(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String message = ""; final String imageFileBase64 = request.getParameter("fileContentBase64"); final String fileName = request.getParameter("uploadedFileName"); if(imageFileBase64 == null) { if(fileName != null) message = "Failed to upload image : " + fileName; else message = "Failed to upload image"; } else { byte[] imageBytes = java.util.Base64.getDecoder().decode(imageFileBase64); // InputStream filecontent = imageFilePart.getInputStream(); // // ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); // byte[] buffer = new byte[4096]; // int bytesRead = -1; // // while ((bytesRead = filecontent.read(buffer)) != -1) { // outputStream.write(buffer, 0, bytesRead); // } // // byte[] imageBytes = outputStream.toByteArray(); if(saveUpdatedProfilePictureIntoDatabase(imageBytes)) { String base64Image = Base64.getEncoder().encodeToString(imageBytes); currentAlumni.setAlumniProfilePicture(base64Image); message = "Successfully upload image into database"; } else { message = "Failed to upload image into database"; } } return message; } private void viewOverlay(HttpServletRequest request, HttpServletResponse response, String message, String requestType) throws ServletException, IOException { HttpSession session = request.getSession(); session.setAttribute("processMessage", message); session.setAttribute("requestType", requestType); new Route().includePage(request, response, AlumniPageList.PROCESS_STATUS_OVERLAY_PAGE); } private void searchByAlumniName(String searchInfo) { ArrayList<Alumni> searchResults = new ArrayList<>(); for (int i = 0; i < totalAlumni; i++) { if (alumniList.get(i).getName().toUpperCase().contains(searchInfo.toUpperCase())) { searchResults.add(alumniList.get(i)); } } alumniList = searchResults; totalAlumni = searchResults.size(); totalPages = totalAlumni / TOTAL_ALUMNI_PER_PAGE; int remain = totalAlumni % TOTAL_ALUMNI_PER_PAGE; if (remain > 0) { totalPages += 1; } } private void searchByAlumniLocationInState(String searchInfo) { ArrayList<Alumni> searchResults = new ArrayList<>(); for (int i = 0; i < totalAlumni; i++) { if (alumniList.get(i).getAlumniAddressState().toUpperCase().contains(searchInfo.toUpperCase())) { searchResults.add(alumniList.get(i)); } } alumniList = searchResults; totalAlumni = searchResults.size(); totalPages = totalAlumni / TOTAL_ALUMNI_PER_PAGE; int remain = totalAlumni % TOTAL_ALUMNI_PER_PAGE; if (remain > 0) { totalPages += 1; } } private void sortAlumniByNameAscendingOrder() { Alumni[] alumniArray = new Alumni[totalAlumni]; for (int i = 0; i < totalAlumni; i++) { alumniArray[i] = alumniList.get(i); } Arrays.sort(alumniArray, ASC_ALUMNI_NAME); for (int i = 0; i < totalAlumni; i++) { alumniList.set(i, alumniArray[i]); } } private void sortAlumniByNameDescendingOrder() { Alumni[] alumniArray = new Alumni[totalAlumni]; for (int i = 0; i < totalAlumni; i++) { alumniArray[i] = alumniList.get(i); } Arrays.sort(alumniArray, DESC_ALUMNI_NAME); for (int i = 0; i < totalAlumni; i++) { alumniList.set(i, alumniArray[i]); } } private boolean setCurrentAlumni(HttpServletRequest request) { if (getAllAlumniInfoFromDatabase()) { currentAlumni = null; boolean status = false; HttpSession session = request.getSession(); String currentAlumniID = ((User)session.getAttribute("user")).getUserID() ; for (int i = 0; i < totalAlumni; i++) { if (alumniList.get(i).getAlumniID().equals(currentAlumniID)) { currentAlumni = alumniList.get(i); status = true; break; } status = false; } return status; } else { return false; } } private void processViewUpdateAlumniInfoPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { setAttributesForCurrentAlumni(request, response, "update"); new Route().forwardPage(request, response, AlumniPageList.UPDATE_ALUMNI_INFO_PAGE); } private void processViewDeleteAlumniInfoPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { setAttributesForCurrentAlumni(request, response, "delete"); new Route().forwardPage(request, response, AlumniPageList.DELETE_ALUMNI_INFO_PAGE); } private void viewManageInfoPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (currentAlumni == null) { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { out.println("currentAlumni is null"); return; } } setAttributesForCurrentAlumni(request, response, "view"); new Route().forwardPage(request, response, AlumniPageList.MANAGE_ALUMNI_INFO_PAGE); } // private void forwardPage(HttpServletRequest request, HttpServletResponse response, String path) // throws ServletException, IOException { // RequestDispatcher dispatcher = getServletConfig().getServletContext().getRequestDispatcher(path); // dispatcher.forward(request, response); // } private void processManageSelectedAlumniInfo(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String selectedAlumniID = request.getParameter("selectedAlumniID"); for (int i = 0; i < totalAlumni; i++) { if (alumniList.get(i).getAlumniID().equals(selectedAlumniID)) { currentAlumni = alumniList.get(i); break; } } } private void displaySelectedImage(HttpServletResponse response) throws ServletException, IOException { byte[] byteData = Base64.getDecoder().decode(currentAlumni.getAlumniProfilePicture()); response.setContentType("image/jpeg"); response.setContentType("image/jpg"); response.setContentType("image/png"); response.getOutputStream().write(byteData); response.getOutputStream().flush(); response.getOutputStream().close(); } private void setAttributesForCurrentAlumni(HttpServletRequest request, HttpServletResponse response, String manageAlumniProcess) throws ServletException, IOException { request.setAttribute("id", currentAlumni.getAlumniID()); request.setAttribute("name", currentAlumni.getName()); request.setAttribute("phoneNumber", currentAlumni.getPhoneNum()); request.setAttribute("profilePicture", currentAlumni.getAlumniProfilePicture()); request.setAttribute("profStatus", currentAlumni.getAlumniProfStatus()); request.setAttribute("profStatusYearGained", currentAlumni.getAlumniProfStatusYearGained()); request.setAttribute("alumniAddress1", currentAlumni.getAlumniAddress1()); request.setAttribute("alumniAddress2", currentAlumni.getAlumniAddress2()); request.setAttribute("alumniAddressCity", currentAlumni.getAlumniAddressCity()); request.setAttribute("alumniAddressCountry", currentAlumni.getAlumniAddressCountry()); request.setAttribute("alumniAddressPostCode", currentAlumni.getAlumniAddressPostCode()); request.setAttribute("alumniAddressState", currentAlumni.getAlumniAddressState()); request.setAttribute("email", currentAlumni.getEmail()); request.setAttribute("batchDiploma", currentAlumni.getAlumniBatchDiploma()); request.setAttribute("startStudyYearDiploma", currentAlumni.getAlumniStartStudyYearDiploma()); request.setAttribute("fieldOfSpecializationDiploma", currentAlumni.getAlumniFieldOfSpecializationDiploma()); request.setAttribute("graduateYearDiploma", currentAlumni.getAlumniGraduateYearDiploma()); request.setAttribute("batchBachelor", currentAlumni.getAlumniBatchBachelor()); request.setAttribute("startStudyYearBachelor", currentAlumni.getAlumniStartStudyYearBachelor()); request.setAttribute("fieldOfSpecializationBachelor", currentAlumni.getAlumniFieldOfSpecializationBachelor()); request.setAttribute("graduateYearBachelor", currentAlumni.getAlumniGraduateYearBachelor()); request.setAttribute("batchMaster", currentAlumni.getAlumniBatchMaster()); request.setAttribute("startStudyYearMaster", currentAlumni.getAlumniStartStudyYearMaster()); request.setAttribute("fieldOfSpecializationMaster", currentAlumni.getAlumniFieldOfSpecializationMaster()); request.setAttribute("graduateYearMaster", currentAlumni.getAlumniGraduateYearMaster()); request.setAttribute("curEmployer", currentAlumni.getAlumniCurEmployer()); request.setAttribute("curJob", currentAlumni.getAlumniCurJob()); request.setAttribute("curSalary", currentAlumni.getAlumniCurSalary()); request.setAttribute("prevEmployer", currentAlumni.getAlumniPrevEmployer()); request.setAttribute("prevJob", currentAlumni.getAlumniPrevJob()); request.setAttribute("prevSalary", currentAlumni.getAlumniPrevSalary()); request.setAttribute("employerAddress1", currentAlumni.getEmployerAddress1()); request.setAttribute("employerAddress2", currentAlumni.getEmployerAddress2()); request.setAttribute("employerAddressCity", currentAlumni.getEmployerAddressCity()); request.setAttribute("employerAddressCountry", currentAlumni.getEmployerAddressCountry()); request.setAttribute("employerAddressPostCode", currentAlumni.getEmployerAddressPostCode()); request.setAttribute("employerAddressState", currentAlumni.getEmployerAddressState()); request.setAttribute("manageAlumniProcess", manageAlumniProcess); } private void setContentForAlumniList(HttpServletRequest request) throws ServletException, IOException { String[] alumniID = new String[TOTAL_ALUMNI_PER_PAGE]; String[] alumniName = new String[TOTAL_ALUMNI_PER_PAGE]; String[] alumniEmail = new String[TOTAL_ALUMNI_PER_PAGE]; String[] alumniState = new String[TOTAL_ALUMNI_PER_PAGE]; String[] alumniGraduationYearDiploma = new String[TOTAL_ALUMNI_PER_PAGE]; String[] alumniGraduationYearBachelor = new String[TOTAL_ALUMNI_PER_PAGE]; String[] alumniGraduationYearMaster = new String[TOTAL_ALUMNI_PER_PAGE]; String[] alumniProfStatus = new String[TOTAL_ALUMNI_PER_PAGE]; String[] alumniCurJob = new String[TOTAL_ALUMNI_PER_PAGE]; int j = currentPage * TOTAL_ALUMNI_PER_PAGE - TOTAL_ALUMNI_PER_PAGE; for (int i = 0; i < TOTAL_ALUMNI_PER_PAGE; i++, j++) { if (alumniList.isEmpty() || j >= totalAlumni) { alumniID[i] = ""; alumniName[i] = ""; alumniEmail[i] = ""; alumniState[i] = ""; alumniGraduationYearDiploma[i] = ""; alumniGraduationYearBachelor[i] = ""; alumniGraduationYearMaster[i] = ""; alumniProfStatus[i] = ""; alumniCurJob[i] = ""; continue; } alumniID[i] = alumniList.get(j).getAlumniID(); alumniName[i] = alumniList.get(j).getName(); alumniEmail[i] = alumniList.get(j).getEmail(); alumniState[i] = alumniList.get(j).getAlumniAddressState(); alumniGraduationYearDiploma[i] = Integer.toString(alumniList.get(j).getAlumniGraduateYearDiploma()); alumniGraduationYearBachelor[i] = Integer.toString(alumniList.get(j).getAlumniGraduateYearBachelor()); alumniGraduationYearMaster[i] = Integer.toString(alumniList.get(j).getAlumniGraduateYearMaster()); alumniProfStatus[i] = alumniList.get(j).getAlumniProfStatus(); alumniCurJob[i] = alumniList.get(j).getAlumniCurJob(); } request.setAttribute("totalAlumni", totalAlumni); request.setAttribute("totalPages", totalPages); request.setAttribute("currentPage", currentPage); request.setAttribute("TOTAL_ALUMNI_PER_PAGE", TOTAL_ALUMNI_PER_PAGE); request.setAttribute("alumniIDArray", alumniID); request.setAttribute("alumniNameArray", alumniName); request.setAttribute("alumniEmailArray", alumniEmail); request.setAttribute("alumniStateArray", alumniState); request.setAttribute("alumniGraduationYearDiplomaArray", alumniGraduationYearDiploma); request.setAttribute("alumniGraduationYearBachelorArray", alumniGraduationYearBachelor); request.setAttribute("alumniGraduationYearMasterArray", alumniGraduationYearMaster); request.setAttribute("alumniProfStatusArray", alumniProfStatus); request.setAttribute("alumniCurJobArray", alumniCurJob); } private void processViewAlumniList(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { setContentForAlumniList(request); new Route().forwardPage(request, response, AlumniPageList.VIEW_ALUMNI_LIST_INFO_PAGE); } private void goToPage(int page) { if (totalPages == 0) { currentPage = 0; return; } currentPage = page; } // private void includePage(HttpServletRequest request, HttpServletResponse response, String path) // throws ServletException, IOException { // RequestDispatcher dispatcher = getServletConfig().getServletContext().getRequestDispatcher(path); // dispatcher.include(request, response); // } private boolean getAllAlumniInfoFromDatabase() { alumniList = new ArrayList<>(); boolean status = false; try { Connection con = JDBCUtility.getCon(); String statementQuery1 = AlumniSQLStatementList.SQL_STATEMENT_RETRIEVE_ALL_FROM_TABLE_ALUMNI; Statement statement1 = con.createStatement(); ResultSet result1 = statement1.executeQuery(statementQuery1); String statementQuery2 = AlumniSQLStatementList.SQL_STATEMENT_RETRIEVE_ALL_FROM_TABLE_USER_WHERE_ROLE_IS_ALUMNI; Statement statement2 = con.createStatement(); ResultSet result2 = statement2.executeQuery(statementQuery2); while (result1.next() && result2.next()) { Alumni alumni = new Alumni(); alumni.setUserID(result2.getString("userID")); alumni.setName(result2.getString("name")); alumni.setPhoneNum(result2.getString("phone")); alumni.setEmail(result2.getString("email")); alumni.setRole(result2.getString("role")); alumni.setPassword(result2.getString("password")); Blob blob = result1.getBlob("alumniProfilePicture"); InputStream inputStream = blob.getBinaryStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; int bytesRead = -1; while ((bytesRead = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, bytesRead); } byte[] imageBytes = outputStream.toByteArray(); String base64Image = Base64.getEncoder().encodeToString(imageBytes); alumni.setAlumniPersonalInfo(result1.getString("alumniID"), result1.getString("alumniProfStatus"), result1.getInt("alumniProfStatusYearGained"), base64Image); alumni.setAlumniAddress(result1.getString("alumniAddress1"), result1.getString("alumniAddress2"), result1.getString("alumniAddressCity"), result1.getString("alumniAddressPostCode"), result1.getString("alumniAddressState"), result1.getString("alumniAddressCountry")); alumni.setAlumniEducationalInfoDiploma(result1.getInt("alumniGraduateYearDiploma"), result1.getInt("alumniStartStudyYearDiploma"), result1.getString("alumniFieldOfSpecializationDiploma"), result1.getInt("alumniBatchDiploma")); alumni.setAlumniEducationalInfoBachelor(result1.getInt("alumniGraduateYearBachelor"), result1.getInt("alumniStartStudyYearBachelor"), result1.getString("alumniFieldOfSpecializationBachelor"), result1.getInt("alumniBatchBachelor")); alumni.setAlumniEducationalInfoMaster(result1.getInt("alumniGraduateYearMaster"), result1.getInt("alumniStartStudyYearMaster"), result1.getString("alumniFieldOfSpecializationMaster"), result1.getInt("alumniBatchMaster")); alumni.setAlumniEmploymentInfo(result1.getString("alumniPrevJob"), result1.getDouble("alumniPrevSalary"), result1.getString("alumniCurJob"), result1.getDouble("alumniCurSalary"), result1.getString("alumniPrevEmployer"), result1.getString("alumniCurEmployer")); alumni.setEmployerAddress(result1.getString("employerAddress1"), result1.getString("employerAddress2"), result1.getString("employerAddressCity"), result1.getString("employerAddressPostCode"), result1.getString("employerAddressState"), result1.getString("employerAddressCountry")); alumniList.add(alumni); status = true; } totalAlumni = alumniList.size(); totalPages = totalAlumni / TOTAL_ALUMNI_PER_PAGE; int remain = totalAlumni % TOTAL_ALUMNI_PER_PAGE; if (remain > 0) { totalPages += 1; } return true; } catch (SQLException | IOException ex) { Logger.getLogger(AlumniController.class.getName()).log(Level.SEVERE, null, ex); status = false; } return status; } private ArrayList<Alumni> getAllAlumniInfoFromDatabaseForMobile() throws IOException { ArrayList<Alumni> alumniUserList = new ArrayList<>(); try { Connection con = JDBCUtility.getCon(); String statementQuery1 = AlumniSQLStatementList.SQL_STATEMENT_RETRIEVE_ALL_FROM_TABLE_ALUMNI; Statement statement1 = con.createStatement(); ResultSet result1 = statement1.executeQuery(statementQuery1); String statementQuery2 = AlumniSQLStatementList.SQL_STATEMENT_RETRIEVE_ALL_FROM_TABLE_USER_WHERE_ROLE_IS_ALUMNI; Statement statement2 = con.createStatement(); ResultSet result2 = statement2.executeQuery(statementQuery2); while (result1.next() && result2.next()) { Alumni alumni = new Alumni(); alumni.setUserID(result2.getString("userID")); alumni.setName(result2.getString("name")); alumni.setPhoneNum(result2.getString("phone")); alumni.setEmail(result2.getString("email")); alumni.setRole(result2.getString("role")); alumni.setPassword(result2.getString("password")); Blob blob = result1.getBlob("alumniProfilePicture"); ByteArrayOutputStream outputStream; String base64Image; try (InputStream inputStream = blob.getBinaryStream()) { outputStream = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; int bytesRead = -1; while ((bytesRead = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, bytesRead); } byte[] imageBytes = outputStream.toByteArray(); base64Image = Base64.getEncoder().encodeToString(imageBytes); } outputStream.close(); alumni.setAlumniPersonalInfo(result1.getString("alumniID"), result1.getString("alumniProfStatus"), result1.getInt("alumniProfStatusYearGained"), base64Image); alumni.setAlumniAddress(result1.getString("alumniAddress1"), result1.getString("alumniAddress2"), result1.getString("alumniAddressCity"), result1.getString("alumniAddressPostCode"), result1.getString("alumniAddressState"), result1.getString("alumniAddressCountry")); alumni.setAlumniEducationalInfoDiploma(result1.getInt("alumniGraduateYearDiploma"), result1.getInt("alumniStartStudyYearDiploma"), result1.getString("alumniFieldOfSpecializationDiploma"), result1.getInt("alumniBatchDiploma")); alumni.setAlumniEducationalInfoBachelor(result1.getInt("alumniGraduateYearBachelor"), result1.getInt("alumniStartStudyYearBachelor"), result1.getString("alumniFieldOfSpecializationBachelor"), result1.getInt("alumniBatchBachelor")); alumni.setAlumniEducationalInfoMaster(result1.getInt("alumniGraduateYearMaster"), result1.getInt("alumniStartStudyYearMaster"), result1.getString("alumniFieldOfSpecializationMaster"), result1.getInt("alumniBatchMaster")); alumni.setAlumniEmploymentInfo(result1.getString("alumniPrevJob"), result1.getDouble("alumniPrevSalary"), result1.getString("alumniCurJob"), result1.getDouble("alumniCurSalary"), result1.getString("alumniPrevEmployer"), result1.getString("alumniCurEmployer")); alumni.setEmployerAddress(result1.getString("employerAddress1"), result1.getString("employerAddress2"), result1.getString("employerAddressCity"), result1.getString("employerAddressPostCode"), result1.getString("employerAddressState"), result1.getString("employerAddressCountry")); alumniUserList.add(alumni); } return alumniUserList; } catch (SQLException ex) { Logger.getLogger(AlumniController.class.getName()).log(Level.SEVERE, null, ex); } return null; } private boolean saveUpdatedInfoIntoDatabase(HttpServletRequest request, HttpServletResponse response) { boolean status = false; try { String currentAlumniID = currentAlumni.getAlumniID(); String updatedAlumniProfStatus = request.getParameter("updatedAlumniProfStatus"); int updatedAlumniProfStatusGainedYear = Integer.parseInt(request.getParameter("updatedAlumniProfStatusGainedYear")); String updatedAlumniAddress1 = request.getParameter("updatedAlumniAddress1"); String updatedAlumniAddress2 = request.getParameter("updatedAlumniAddress2"); String updatedAlumniAddressCity = request.getParameter("updatedAlumniAddressCity"); String updatedAlumniAddressPostCode = request.getParameter("updatedAlumniAddressPostCode"); String updatedAlumniAddressState = request.getParameter("updatedAlumniAddressState"); String updatedAlumniAddressCountry = request.getParameter("updatedAlumniAddressCountry"); String updatedAlumniFieldOfSpecializationDiploma = request.getParameter("updatedAlumniFieldOfSpecializationDiploma"); int updatedAlumniStartStudyDiploma = Integer.parseInt(request.getParameter("updatedAlumniStartStudyDiploma")); int updatedAlumniBatchDiploma = Integer.parseInt(request.getParameter("updatedAlumniBatchDiploma")); int updatedAlumniGraduateYearDiploma = Integer.parseInt(request.getParameter("updatedAlumniGraduateYearDiploma")); String updatedAlumniFieldOfSpecializationBachelor = request.getParameter("updatedAlumniFieldOfSpecializationBachelor"); int updatedAlumniStartStudyBachelor = Integer.parseInt(request.getParameter("updatedAlumniStartStudyBachelor")); int updatedAlumniBatchBachelor = Integer.parseInt(request.getParameter("updatedAlumniBatchBachelor")); int updatedAlumniGraduateYearBachelor = Integer.parseInt(request.getParameter("updatedAlumniGraduateYearBachelor")); String updatedAlumniFieldOfSpecializationMaster = request.getParameter("updatedAlumniFieldOfSpecializationMaster"); int updatedAlumniStartStudyMaster = Integer.parseInt(request.getParameter("updatedAlumniStartStudyMaster")); int updatedAlumniBatchMaster = Integer.parseInt(request.getParameter("updatedAlumniBatchMaster")); int updatedAlumniGraduateYearMaster = Integer.parseInt(request.getParameter("updatedAlumniGraduateYearMaster")); String updatedAlumniCurJob = request.getParameter("updatedAlumniCurJob"); String updatedAlumniPrevJob = request.getParameter("updatedAlumniPrevJob"); String updatedAlumniCurEmployer = request.getParameter("updatedAlumniCurEmployer"); String updatedAlumniPrevEmployer = request.getParameter("updatedAlumniPrevEmployer"); double updatedAlumniCurSalary = Double.parseDouble(request.getParameter("updatedAlumniCurSalary")); double updatedAlumniPrevSalary = Double.parseDouble(request.getParameter("updatedAlumniPrevSalary")); String updatedEmployerAddress1 = request.getParameter("updatedEmployerAddress1"); String updatedEmployerAddress2 = request.getParameter("updatedEmployerAddress2"); String updatedEmployerAddressCity = request.getParameter("updatedEmployerAddressCity"); String updatedEmployerAddressPostCode = request.getParameter("updatedEmployerAddressPostCode"); String updatedEmployerAddressState = request.getParameter("updatedEmployerAddressState"); String updatedEmployerAddressCountry = request.getParameter("updatedEmployerAddressCountry"); Connection con = JDBCUtility.getCon(); String statementQuery = AlumniSQLStatementList.SQL_STATEMENT_UPDATE_SELECTED_ALUMNI_INFO; PreparedStatement statement = con.prepareStatement(statementQuery); statement.setString(1, updatedAlumniAddress1); statement.setString(2, updatedAlumniAddress2); statement.setString(3, updatedAlumniAddressCity); statement.setString(4, updatedAlumniAddressCountry); statement.setString(5, updatedAlumniAddressPostCode); statement.setString(6, updatedAlumniAddressState); statement.setInt(7, updatedAlumniBatchDiploma); statement.setInt(8, updatedAlumniBatchBachelor); statement.setInt(9, updatedAlumniBatchMaster); statement.setString(10, updatedAlumniCurEmployer); statement.setString(11, updatedAlumniCurJob); statement.setDouble(12, updatedAlumniCurSalary); statement.setInt(13, updatedAlumniStartStudyDiploma); statement.setInt(14, updatedAlumniStartStudyBachelor); statement.setInt(15, updatedAlumniStartStudyMaster); statement.setString(16, updatedAlumniFieldOfSpecializationDiploma); statement.setString(17, updatedAlumniFieldOfSpecializationBachelor); statement.setString(18, updatedAlumniFieldOfSpecializationMaster); statement.setInt(19, updatedAlumniGraduateYearDiploma); statement.setInt(20, updatedAlumniGraduateYearBachelor); statement.setInt(21, updatedAlumniGraduateYearMaster); statement.setString(22, updatedAlumniPrevEmployer); statement.setString(23, updatedAlumniPrevJob); statement.setDouble(24, updatedAlumniPrevSalary); statement.setString(25, updatedAlumniProfStatus); statement.setInt(26, updatedAlumniProfStatusGainedYear); statement.setString(27, updatedEmployerAddress1); statement.setString(28, updatedEmployerAddress2); statement.setString(29, updatedEmployerAddressCity); statement.setString(30, updatedEmployerAddressCountry); statement.setString(31, updatedEmployerAddressPostCode); statement.setString(32, updatedEmployerAddressState); statement.setString(33, currentAlumniID); int result = statement.executeUpdate(); if (result == 0) { status = false; } else if (result > 0) { status = true; } if (status) { currentAlumni.setAlumniPersonalInfo(currentAlumniID, updatedAlumniProfStatus, updatedAlumniProfStatusGainedYear, currentAlumni.getAlumniProfilePicture()); currentAlumni.setAlumniAddress(updatedAlumniAddress1, updatedAlumniAddress2, updatedAlumniAddressCity, updatedAlumniAddressPostCode, updatedAlumniAddressState, updatedAlumniAddressCountry); currentAlumni.setAlumniEducationalInfoDiploma(updatedAlumniGraduateYearDiploma, updatedAlumniStartStudyDiploma, updatedAlumniFieldOfSpecializationDiploma, updatedAlumniBatchDiploma); currentAlumni.setAlumniEducationalInfoBachelor(updatedAlumniGraduateYearBachelor, updatedAlumniStartStudyBachelor, updatedAlumniFieldOfSpecializationBachelor, updatedAlumniBatchBachelor); currentAlumni.setAlumniEducationalInfoMaster(updatedAlumniGraduateYearMaster, updatedAlumniStartStudyMaster, updatedAlumniFieldOfSpecializationMaster, updatedAlumniBatchMaster); currentAlumni.setAlumniEmploymentInfo(updatedAlumniPrevJob, updatedAlumniPrevSalary, updatedAlumniCurJob, updatedAlumniCurSalary, updatedAlumniPrevEmployer, updatedAlumniCurEmployer); currentAlumni.setEmployerAddress(updatedEmployerAddress1, updatedEmployerAddress2, updatedEmployerAddressCity, updatedEmployerAddressPostCode, updatedEmployerAddressState, updatedEmployerAddressCountry); for (int i = 0; i < totalAlumni; i++) { if (alumniList.get(i).getAlumniID().equals(currentAlumniID)) { alumniList.set(i, currentAlumni); break; } } } } catch (SQLException ex) { Logger.getLogger(AlumniController.class.getName()).log(Level.SEVERE, null, ex); status = false; } return status; } private boolean saveUpdatedProfilePictureIntoDatabase(byte[] imageBytes) { try (Connection connection = JDBCUtility.getCon()) { Blob imageBlob = connection.createBlob(); imageBlob.setBytes(1, imageBytes); PreparedStatement statement = connection.prepareStatement(AlumniSQLStatementList.SQL_STATEMENT_UPDATE_SELECTED_ALUMNI_PROFILE_PICTURE); statement.setBlob(1, imageBlob); statement.setString(2, currentAlumni.getAlumniID()); if(statement.executeUpdate() > 0) { JDBCUtility.jdbcConClose(); return true; } JDBCUtility.jdbcConClose(); return false; } catch (SQLException ex) { Logger.getLogger(AlumniController.class.getName()).log(Level.INFO, ex.getMessage()); } return false; } private boolean deleteAlumniAccountFromDatabase(HttpServletRequest request, HttpServletResponse response) { boolean status = false; Connection con; try { String currentAlumniID = currentAlumni.getAlumniID(); con = JDBCUtility.getCon(); String statementQuery1 = AlumniSQLStatementList.SQL_STATEMENT_DELETE_SELECTED_ALUMNI; String statementQuery2 = AlumniSQLStatementList.SQL_STATEMENT_DELETE_SELECTED_USER; PreparedStatement statement1 = con.prepareStatement(statementQuery1); PreparedStatement statement2 = con.prepareStatement(statementQuery2); statement1.setString(1, currentAlumniID); statement2.setString(1, currentAlumniID); int result1 = statement1.executeUpdate(); int result2 = statement2.executeUpdate(); if (result1 == 0 || result2 == 0) { status = false; } else if (result1 > 0 && result2 > 0) { status = true; } if (status) { for (int i = 0; i < totalAlumni; i++) { if (alumniList.get(i).getAlumniID() == null ? currentAlumniID == null : alumniList.get(i).getAlumniID().equals(currentAlumniID)) { alumniList.remove(i); break; } } currentAlumni = null; --totalAlumni; } } catch (SQLException ex) { Logger.getLogger(AlumniController.class.getName()).log(Level.SEVERE, null, ex); status = false; } return status; } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String requestType = request.getParameter("requestType"); if(requestType != null && requestType.equals("requestImage")) { displaySelectedImage(response); } else { response.setContentType("text/html"); try (PrintWriter out = response.getWriter()) { ArrayList<Alumni> alumni = getAllAlumniInfoFromDatabaseForMobile(); Gson gson = new Gson(); String jsonString = gson.toJson(alumni); out.println(jsonString); out.close(); } } } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "noreply@github.com" ]
noreply@github.com
8559bd085a9ec10d37773232cdc4543a1727661b
ab888b4a8c43d70df394b501dd9d2385996a03cb
/src/main/java/com/stackroute/pe5/Student.java
69efd9a41103e930d6a06644457c409adbed85ef
[]
no_license
garvit88/Java_PE-5
f38dcf62a77ce625b5171b0c263c4ffe65b25ad2
39ba1167370908adfb1714d3cbbd83f65c70eaba
refs/heads/master
2020-03-21T17:28:00.553558
2018-06-27T05:26:29
2018-06-27T05:26:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
514
java
package com.stackroute.pe5; public class Student { private int id; private String name; private int age; public Student(int id, String name, int age) { super(); this.id = id; this.name = name; this.age = age; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
[ "garvitgarg88@gmail.com" ]
garvitgarg88@gmail.com
5ee9128d462325bea607556f73266f8c1cdcc0d6
c9e3f5ec19a0f370b72506b4475e96e12cd00c01
/App1/exercise/src/main/java/com/example/exercise/mockTest.java
73e4b45322c2fa19a236af5de9f4ef9f634a1f16
[]
no_license
Emrys-Hong/Term4_java_code
f45b4468a4251a27b30788f06cac1e14d5a1e7f8
8e38d95e320bf059c757c34b8bc91c0d2568c458
refs/heads/master
2020-04-11T17:44:40.122723
2018-12-17T15:05:32
2018-12-17T15:05:32
161,972,495
1
0
null
null
null
null
UTF-8
Java
false
false
1,804
java
package com.example.exercise; import java.util.ArrayList; /* === MOCK TEST QUESTION === **ATTENTION** - in the actual exam you will be given the questions on paper. An incomplete class definition for a Course object is given below. This object is meant to store information on the names of students taking a particular course in a school. TestCourse.java is provided for you to test your code. You no need to (a) The "students" instance variable is an ArrayList that stores student names as strings. When the constructor is called, "students" should be instantiated and the "numberOfStudents" variable should be initialized to zero. (b) Add the getter methods for all the instance variables. (c) Complete addStudent(). A student name as a string is passed to it and this method adds it to the end of the "students" ArrayList. You are reminded that "numberOfStudents" should be incremented. (d) Complete dropStudent(). A student name as a string is passed to it and this method removes this particular student name from the "students" ArrayList. */ public class mockTest { private String courseName; private int numberOfStudents; private ArrayList<String> students; public mockTest(String courseName){ this.courseName = courseName; this.numberOfStudents = 0; students = new ArrayList<>(); } public String getCourseName() { return courseName; } public int getNumberOfStudents() { return numberOfStudents; } public ArrayList<String> getStudents() { return students; } public void addStudent(String student){ numberOfStudents ++; students.add(student); } public void dropStudent(String student){ numberOfStudents --; students.remove(student); } }
[ "hongpengfei.emrys@gmail.com" ]
hongpengfei.emrys@gmail.com
c8bdc274d4e319890dc4f45b6e1f1dd8a735c2d6
cb2acc0595acb46b8ffc292d4ef55a870be8d81e
/Proyecto Eclipse/practica4/common/src/main/java/dominio/TipoTarjeta.java
3846d80790abe4feeff22c029e8b73493fc07efd
[]
no_license
ebc722/Practica4-ProcesosSoftware
151cb2313c98f82e0663e1729afefda6e624acc9
d63f6b0550d9c98f542a58b06c365849257cca3c
refs/heads/master
2023-02-25T09:32:56.451292
2021-01-27T20:37:49
2021-01-27T20:37:49
326,213,388
0
0
null
null
null
null
UTF-8
Java
false
false
85
java
package dominio; public enum TipoTarjeta { MASTERCARD, VISA, AMERICAN_EXPRESS }
[ "ebc722@alumnos.unican.es" ]
ebc722@alumnos.unican.es
06cbb4cf2da4986ca0e03a4cd1319bf77c5b2848
b2ddaba2502079a2b38bca1f72d10c637679595c
/app/src/main/java/com/nabin/collegerfinder/Bll/LoginBll.java
2e931204d7e2923e4a21ce995c843d95cb9e3cb3
[]
no_license
Nabinthakurathi/CollegeFindrer
6502a92081f10db9fe5ba226fc521e37bd0e87bc
8fb2b7ea402179676b1c1f83da4a5c7d25c48ceb
refs/heads/main
2023-03-26T09:50:39.418044
2021-03-26T11:05:01
2021-03-26T11:05:01
338,289,488
0
0
null
null
null
null
UTF-8
Java
false
false
983
java
package com.nabin.collegerfinder.Bll; import com.nabin.collegerfinder.Api.UsersApi; import com.nabin.collegerfinder.serverResponse.SignupResponse; import com.nabin.collegerfinder.Url.url; import java.io.IOException; import retrofit2.Call; import retrofit2.Response; public class LoginBll { Boolean isSuccess = false; public boolean checkUser(String username, String password){ UsersApi usersApi = url.getInstance().create(UsersApi.class); Call<SignupResponse> usersCall = usersApi.CheckUser(username, password); try{ Response<SignupResponse> loginResponse = usersCall.execute(); if (loginResponse.isSuccessful() && loginResponse.body().getStatus().equals("Login success!")) { url.token += loginResponse.body().getToken(); isSuccess = true; } } catch (IOException e) { e.printStackTrace(); } return isSuccess; } }
[ "thakurathinabin@gmail.com" ]
thakurathinabin@gmail.com
e84a7bc6360d046400e70b3433f37f3bada7b9b2
6f9463eb7ac66a03cfc6b70a26c9a97a64812714
/cliente/src/main/java/com/ncubo/extensibilidad/cliente/librerias/Pedido.java
4b748cba7aa36cfc65f363f85896b7c4a2a56090
[]
no_license
TestingSoftware/Extensibilidad
54fefa043daf32f1515e1d4a951eaa43fb2f5d45
12fe289adf8c153dfd742de5dc06922f5a6fa522
refs/heads/master
2021-01-10T15:11:31.287781
2016-02-24T17:14:37
2016-02-24T17:14:37
50,207,148
0
0
null
null
null
null
UTF-8
Java
false
false
107
java
package com.ncubo.extensibilidad.cliente.librerias; public class Pedido { public Pedido() { } }
[ "dalaian@outlook.com" ]
dalaian@outlook.com
43134b20e82455f30fde8aee20711dc1644eab29
f90fc4414d50f5818725073cc6de59662168bed6
/template-method/src/Tea.java
2def7d274a13f51c3a7ebc38879e1bd5e20fcf28
[]
no_license
linguishi/HF-design-pattern
2f5e50e150fa586247508649f3d9f10c16d33cf6
2fdf8a2272fb426841b4a1eba70ef2c64851e999
refs/heads/master
2021-09-10T16:45:27.183837
2018-03-29T15:12:49
2018-03-29T15:12:49
125,888,752
1
0
null
null
null
null
UTF-8
Java
false
false
243
java
public class Tea extends CaffeineBeverage{ @Override protected void addCondiments() { System.out.println("Adding Lemon"); } @Override protected void brew() { System.out.println("Steeping the tea"); } }
[ "513228837@qq.com" ]
513228837@qq.com
0a4452528f0591913b5e813e91d3ebf54d190405
cd4802766531a9ccf0fb54ca4b8ea4ddc15e31b5
/java/com/l2jmobius/gameserver/model/conditions/ConditionPlayerIsOnSide.java
1e4c0fa2adddabc73e6ae13a935122d125008b32
[]
no_license
singto53/underground
8933179b0d72418f4b9dc483a8f8998ef5268e3e
94264f5168165f0b17cc040955d4afd0ba436557
refs/heads/master
2021-01-13T10:30:20.094599
2016-12-11T20:32:47
2016-12-11T20:32:47
76,455,182
0
1
null
null
null
null
UTF-8
Java
false
false
1,545
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.l2jmobius.gameserver.model.conditions; import com.l2jmobius.gameserver.enums.CastleSide; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.skills.Skill; /** * The Class ConditionPlayerIsOnSide. * @author St3eT */ public class ConditionPlayerIsOnSide extends Condition { private final CastleSide _side; /** * Instantiates a new condition player race. * @param side the allowed Castle side. */ public ConditionPlayerIsOnSide(CastleSide side) { _side = side; } @Override public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item) { if ((effector == null) || !effector.isPlayer()) { return false; } return effector.getActingPlayer().getPlayerSide() == _side; } }
[ "MobiusDev@7325c9f8-25fd-504a-9f63-8876acdc129b" ]
MobiusDev@7325c9f8-25fd-504a-9f63-8876acdc129b
edd4a953bcdb1b249eea44277443a885c4ecac12
edbf942052817832157b732a7786ccccd6f104fa
/src/java/src/main/java/com/cecd/sdk/examples/testcenter/TestCenter.java
00e68de6032a3c55d1c073f636ed36c27410906b
[]
no_license
joncv/cecd-thrift
7c0b17ef66c1ca187be38fb5c2e87c5efa260b74
43e690a2e499718685923d0e1f1048a55541d301
refs/heads/master
2020-07-04T02:01:31.834464
2019-07-15T09:34:37
2019-07-15T09:34:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
545
java
package com.cecd.sdk.examples.testcenter; import com.cecd.sdk.examples.RpcClientIntercepterTest; import com.cecd.sdk.rpc.RpcDoc; import com.cecd.sdk.rpc.RpcFactory; import com.cecd.sdk.rpc.RpcModuleAbstract; public class TestCenter extends RpcModuleAbstract { public TestCenter() { //初始化后放入工厂类中 this.setInterceptor(new RpcClientIntercepterTest()); this.setServiceId(1005); this.setServiceName("user-center"); this.setLang("java"); RpcFactory.addService(this); } }
[ "zhangyubo@gouuse.cn" ]
zhangyubo@gouuse.cn
8e7720b6e578f71506cbf344b534899263346ea2
44f604eb6ce9412bf344b79ad2bae0344c74930e
/app/src/main/java/com/zhaoyao/miaomiao/controller/video/souhu/SohuControllerWindow.java
3d72a8e347abc2816ddda14e7367f4a3fc57ea4d
[]
no_license
liuwei1995/MiaoMiaoOld
275d5db6ea021297149180c19cfcb5552eb02d42
a252aae63e79f750f263e8b46bcc559f4cbed92b
refs/heads/master
2021-01-20T00:21:25.570295
2017-09-01T08:42:26
2017-09-01T08:42:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
19,880
java
/* * Copyright (c) 2013 Sohu TV. All rights reserved. */ package com.zhaoyao.miaomiao.controller.video.souhu; import java.util.ArrayList; import java.util.Formatter; import java.util.HashMap; import java.util.List; import java.util.Locale; import android.content.Context; import android.media.AudioManager; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnTouchListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.Button; import android.widget.ImageView; import android.widget.PopupWindow; import android.widget.RelativeLayout; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; import com.sohuvideo.api.DownloadInfo; import com.sohuvideo.api.SohuDownloadManager; import com.sohuvideo.api.SohuPlayerDefinition; import com.sohuvideo.api.SohuPlayerItemBuilder; import com.sohuvideo.api.SohuPlayerSetting; import com.zhaoyao.miaomiao.R; import com.zhaoyao.miaomiao.adapter.video.shouhu.OptionAdapter; import com.zhaoyao.miaomiao.adapter.video.shouhu.OptionAdapter.OptionItem; import com.zhaoyao.miaomiao.util.souhu.DialogUtil; import com.zhaoyao.miaomiao.util.souhu.DialogUtil.OnOptionItemClickListener; /** * @author shileiHao 2013-9-4 */ public class SohuControllerWindow extends PopupWindow { private static final String VOLUME = "VOLUME"; private static final String MUTE = "MUTE"; private static final String TAG = "SohuControllerWindow"; private static final int FAST_WARD_SECONDS = 30; private static final int AUTO_SHOWN_SPAN = 5000; private static final int MSG_HIDE = 0; protected Context mContext; private View mContentView; private View mAnchorView; private PlayerControlProxy proxy; private StringBuilder mFormatBuilder; private Formatter mFormatter; private int mCurrent; private int mDuration; private boolean mDragging; private AudioManager mAudioManager; private int mLastVolumn; private final static HashMap<Integer, String> map; static { map = new HashMap<Integer, String>(); map.put(SohuPlayerDefinition.PE_DEFINITION_FLUENCY, "普清"); map.put(SohuPlayerDefinition.PE_DEFINITION_HIGH, "高清"); map.put(SohuPlayerDefinition.PE_DEFINITION_SUPER, "超清"); map.put(SohuPlayerDefinition.PE_DEFINITION_ORIGINAL, "原画"); } private boolean definitionEnabled = true; protected SohuPlayerItemBuilder activeItem; // -------------------------------------- private View mControllerTitle; private TextView tvTitle; private TextView tvDownload; private View mControllerBar; private ImageView ivSetting; private ImageView ivPrevious; private ImageView ivNext; private ImageView ivForward; private ImageView ivBackward; private ImageView ivPlayPause; private ImageView ivVolumn; private Button btnDefinition; private SeekBar seekVolumn; private SeekBar seekProgress; private TextView tvPosition; // -------------------------------------- private ViewGroup vDefinitionSelector; // -------------------------------------- // -------------------------------------- private boolean mHardwareDecode = false; // -------------------------------------- private long vid; private long sid; private int mSite; private long mLastClickDownloadTime = 0l; private static final int DOWNLOAD_CLICK_DELAY = 500; /** * 此view显示分为三种模式;搜狐视频,本地视频和直播视频模�? */ public static enum MODE_TYPE { MODE_SOHU, MODE_LOCAL, MODE_LIVE }; public SohuControllerWindow(Context context) { this(context, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); } public SohuControllerWindow(Context context, int width, int height) { super(context); setWidth(width); setHeight(height); init(context); } public void setAnchorView(View anchor) { this.mAnchorView = anchor; } public void hide() { Log.d(TAG, "try to hide"); hideDefinitionSelector(); if (isShowing()) { dismiss(); if (visibleListener != null) { visibleListener.onVisibleStateChange(false); } } } private void hideDelayed(int sec) { Log.d(TAG, "hide delayed:" + sec); mHandler.removeMessages(MSG_HIDE); if (sec > 0) { mHandler.sendEmptyMessageDelayed(MSG_HIDE, sec); } } public void show() { if (!isShowing()) { showTitle(); showControllerBar(); updateVolumnView(-1); updateDefinitionButton(); hideDelayed(AUTO_SHOWN_SPAN); showAtLocation(mAnchorView, Gravity.BOTTOM | Gravity.LEFT, 0, 0); if (visibleListener != null) { visibleListener.onVisibleStateChange(true); } } } /** * 上一集下�?集状�? * * @param hasPrevious * @param hasNext */ public void setPreviousNextState(boolean hasPrevious, boolean hasNext) { this.ivNext.setEnabled(hasNext); this.ivPrevious.setEnabled(hasPrevious); } public void setCurrentPlayingIndex(SohuPlayerItemBuilder builder, int index) { Log.d(TAG, "setCurrentPlayingIndex:" + index); this.activeItem = builder; /** 更新�?下definition button **/ updateDefinitionButton(); } public void release() { mHandler.removeCallbacksAndMessages(null); } private final Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); switch (msg.what) { case MSG_HIDE: { hide(); break; } default: break; } } }; protected void init(Context context) { mContext = context; mFormatBuilder = new StringBuilder(); mFormatter = new Formatter(mFormatBuilder, Locale.getDefault()); mAudioManager = (AudioManager) context .getSystemService(Context.AUDIO_SERVICE); mLastVolumn = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); LayoutInflater inflater = (LayoutInflater) mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); mContentView = inflater.inflate(R.layout.souhu_popup_controller, null); setContentView(mContentView); initControllerTitle(); initControllerBar(); vDefinitionSelector = (ViewGroup) mContentView .findViewById(R.id.linearlay_select_definition); mContentView.setFocusable(true); mContentView.setFocusableInTouchMode(true); setTouchInterceptor(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { hideDelayed(0); } else if (event.getAction() == MotionEvent.ACTION_UP) { hideDelayed(AUTO_SHOWN_SPAN); } return false; } }); mContentView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { hide(); } }); setOutsideTouchable(true); setBackgroundDrawable(mContext.getResources().getDrawable( R.color.transparent)); } private void initControllerTitle() { mControllerTitle = mContentView .findViewById(R.id.layout_controller_title); tvTitle = (TextView) mControllerTitle .findViewById(R.id.tv_controller_title); tvDownload = (TextView) mControllerTitle.findViewById(R.id.tv_download); tvDownload.setOnClickListener(mTitleClickListener); } public void setTitle(String title) { this.tvTitle.setText(title); } public void setVid(long vid) { this.vid = vid; } public void setSid(long sid) { this.sid = sid; } public void setSite(int site) { mSite = site; } private void showTitle() { mControllerTitle.setVisibility(View.VISIBLE); } public void updatePlaypauseState(boolean isPlaying) { ivPlayPause.setImageResource(isPlaying ? R.drawable.ic_pause : R.drawable.ic_play); } private final OnClickListener mTitleClickListener = new OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case R.id.tv_download: clickDownload(v); break; } } }; private void clickDownload(View v) { long current = System.currentTimeMillis(); if (current - mLastClickDownloadTime < DOWNLOAD_CLICK_DELAY) { mLastClickDownloadTime = current; return; } mLastClickDownloadTime = current; if (vid != 0) { int currentDefinition = proxy.getCurrentDefinition(); DownloadInfo info = new DownloadInfo(vid, sid, mSite, currentDefinition); SohuDownloadManager.getInstance().addTask(info); } } private void initControllerBar() { mControllerBar = mContentView.findViewById(R.id.layout_controller_bar); ivSetting = (ImageView) mControllerBar.findViewById(R.id.iv_setting); ivPrevious = (ImageView) mControllerBar.findViewById(R.id.iv_previous); ivNext = (ImageView) mControllerBar.findViewById(R.id.iv_next); ivForward = (ImageView) mControllerBar .findViewById(R.id.iv_fast_forward); ivBackward = (ImageView) mControllerBar .findViewById(R.id.iv_fast_backward); ivPlayPause = (ImageView) mControllerBar .findViewById(R.id.iv_play_or_pause); ivVolumn = (ImageView) mControllerBar.findViewById(R.id.iv_volume); btnDefinition = (Button) mControllerBar .findViewById(R.id.btn_definition); seekVolumn = (SeekBar) mControllerBar.findViewById(R.id.seekbar_volume); seekProgress = (SeekBar) mControllerBar .findViewById(R.id.seekbar_progress); tvPosition = (TextView) mControllerBar .findViewById(R.id.tv_progresstime); ivSetting.setOnClickListener(mControllerbarClickListener); ivPrevious.setOnClickListener(mControllerbarClickListener); ivNext.setOnClickListener(mControllerbarClickListener); ivForward.setOnClickListener(mControllerbarClickListener); ivBackward.setOnClickListener(mControllerbarClickListener); ivPlayPause.setOnClickListener(mControllerbarClickListener); ivVolumn.setOnClickListener(mControllerbarClickListener); btnDefinition.setOnClickListener(mControllerbarClickListener); seekVolumn.setOnSeekBarChangeListener(mVolumnSeekBarChangeListener); seekProgress.setOnSeekBarChangeListener(mProgressSeekBarChangeListener); } private void showControllerBar() { // TODO ANIMATION? } public void enableSetting(boolean enable) { } public void enableDefinition(boolean enable) { if (enable != definitionEnabled) { definitionEnabled = enable; btnDefinition.setVisibility(definitionEnabled ? View.VISIBLE : View.INVISIBLE); } } public void updateDefinitionButton() { if (definitionEnabled) { int definition = SohuPlayerSetting.getPreferDefinition(); if (proxy != null) { definition = proxy.getCurrentDefinition(); } Log.d(TAG, "definition:" + definition); if (btnDefinition != null && map.get(definition) != null) { btnDefinition.setText(map.get(definition)); } } } private void showDefinitionSelector() { int cur = proxy.getCurrentDefinition(); List<Integer> definitions = proxy.getDefinitions(); vDefinitionSelector.removeAllViews(); for (Integer definition : definitions) { View definitionItemView = View.inflate(mContext, R.layout.souhu_definition_item, null); Button definitionBtn = (Button) definitionItemView .findViewById(R.id.button_definition); definitionBtn.setText(map.get(definition)); definitionBtn.setTag(definition); if (cur == definition) { definitionBtn.setTextColor(mContext.getResources().getColor( R.color.red)); } else { definitionBtn.setTextColor(mContext.getResources().getColor( R.color.gray3)); definitionBtn.setOnClickListener(mOnDefinitioItemClick); } vDefinitionSelector.addView(definitionItemView, 0); } RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) vDefinitionSelector .getLayoutParams(); lp.leftMargin = btnDefinition.getLeft(); vDefinitionSelector.setLayoutParams(lp); vDefinitionSelector.setVisibility(View.VISIBLE); } private final OnClickListener mOnDefinitioItemClick = new OnClickListener() { @Override public void onClick(View v) { vDefinitionSelector.setVisibility(View.GONE); int definition = (Integer) v.getTag(); Log.i(TAG, "select type is " + map.get(definition)); SohuPlayerSetting.setPreferDefinition(definition); hide(); proxy.changeDefinition(definition); } }; private final OnSeekBarChangeListener mVolumnSeekBarChangeListener = new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar seekBar) { hideDelayed(AUTO_SHOWN_SPAN); } @Override public void onStartTrackingTouch(SeekBar seekBar) { hideDelayed(0); } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (fromUser) { mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, 0); updateVolumnView(progress); } } }; private final OnSeekBarChangeListener mProgressSeekBarChangeListener = new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar seekBar) { if (proxy != null) { proxy.seekto(mCurrent * 1000); } mDragging = false; hideDelayed(AUTO_SHOWN_SPAN); } @Override public void onStartTrackingTouch(SeekBar seekBar) { mDragging = true; hideDelayed(0); } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { Log.d(TAG, "progress:" + progress + ",fromUser:" + fromUser); if (fromUser) { mCurrent = progress; updateProgressView(); } } }; private final OnClickListener mControllerbarClickListener = new OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case R.id.iv_setting: clickSetting(); break; case R.id.iv_previous: clickPrevious(); break; case R.id.iv_next: clickNext(); break; case R.id.iv_fast_forward: clickForward(); break; case R.id.iv_fast_backward: clickBackward(); break; case R.id.iv_play_or_pause: clickPlayPause(); break; case R.id.iv_volume: clickVolumn(v); break; case R.id.btn_definition: clickDefinition(); break; } } }; private void clickSetting() { List<OptionItem> items = new ArrayList<OptionItem>(); OptionItem item_sh = new OptionItem("跳过片头", SohuPlayerSetting.getNeedSkipHeader()); items.add(item_sh); OptionItem item_st = new OptionItem("跳过片尾", SohuPlayerSetting.getNeedSkipTail()); items.add(item_st); OptionItem item_an = new OptionItem("自动播放下一集", SohuPlayerSetting.getNeedAutoNext()); items.add(item_an); final OptionAdapter adapter = new OptionAdapter(mContext, true); adapter.setItems(items); DialogUtil.showOptionDialog(mContext,"播放器设置", adapter, null, new OnOptionItemClickListener() { @Override public void onOption(int position, boolean selected) { switch (position) { case 0: { SohuPlayerSetting.setNeedSkipHeader(selected); break; } case 1: { SohuPlayerSetting.setNeedSkipTail(selected); break; } case 2: { SohuPlayerSetting.setNeedAutoNext(selected); break; } default: break; } } }); } private boolean hideDefinitionSelector() { if (vDefinitionSelector.isShown()) { vDefinitionSelector.setVisibility(View.GONE); return true; } return false; } private void clickDefinition() { if (!hideDefinitionSelector()) { // TODO update once? showDefinitionSelector(); } } private void clickPrevious() { proxy.previous(); } private void clickNext() { proxy.next(); } private void clickForward() { proxy.fastForward(FAST_WARD_SECONDS); } private void clickBackward() { proxy.fastBackward(FAST_WARD_SECONDS); } private void clickPlayPause() { proxy.playOrPause(); } private void clickVolumn(View v) { String tag = (String) v.getTag(); int nextValue = 0; if (MUTE.equals(tag)) { ivVolumn.setImageResource(R.drawable.souhu_ic_volume); ivVolumn.setTag("VOLUME"); nextValue = mLastVolumn; } else { mLastVolumn = mAudioManager .getStreamVolume(AudioManager.STREAM_MUSIC); ivVolumn.setImageResource(R.drawable.souhu_ic_mute); ivVolumn.setTag("MUTE"); } mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, nextValue, 0); updateVolumnView(nextValue); } /** * 更新声音进度 * * @param value * 负数表示取当前系统�?�,否则更新到value�? */ public void updateVolumnView(int value) { int current = value >= 0 ? value : mAudioManager .getStreamVolume(AudioManager.STREAM_MUSIC); seekVolumn.setMax(mAudioManager .getStreamMaxVolume(AudioManager.STREAM_MUSIC)); seekVolumn.setProgress(current); if (current == 0) { ivVolumn.setImageResource(R.drawable.souhu_ic_mute); ivVolumn.setTag(MUTE); } else { ivVolumn.setImageResource(R.drawable.souhu_ic_volume); ivVolumn.setTag(VOLUME); } } public void setPlayControlProxy(PlayerControlProxy control) { this.proxy = control; } /** * 格式化时�? * * @param seconds * @return */ private String formatTime(int seconds) { int second = seconds % 60; int minutes = (seconds / 60) % 60; int hours = seconds / 3600; mFormatBuilder.setLength(0); return mFormatter.format("%d:%02d:%02d", hours, minutes, second) .toString(); } /** * 更新进度 */ private void updateProgressView() { tvPosition.setText(formatTime(mCurrent) + "/" + formatTime(mDuration)); if (mDuration == 0) { seekProgress.setProgress(0); } else { seekProgress.setMax(mDuration); seekProgress.setProgress(mCurrent); } } /** * 设置进度信息,如果可见,则更新进度条 * * @param current * @param duration */ public void setProgress(int current, int duration) { if (!mDragging) { this.mCurrent = current / 1000; this.mDuration = duration / 1000; if (isShowing()) { updateProgressView(); } } } protected void setDisplayModeType(MODE_TYPE type) { if (mContentView == null) { return; } if (type == MODE_TYPE.MODE_LIVE) { mContentView.findViewById(R.id.layout_progressbar).setVisibility( View.GONE); ivSetting.setVisibility(View.INVISIBLE); btnDefinition.setVisibility(View.INVISIBLE); ivPrevious.setVisibility(View.INVISIBLE); ivBackward.setVisibility(View.INVISIBLE); ivForward.setVisibility(View.INVISIBLE); ivNext.setVisibility(View.INVISIBLE); tvDownload.setVisibility(View.GONE); } else if (type == MODE_TYPE.MODE_LOCAL) { mContentView.findViewById(R.id.layout_progressbar).setVisibility( View.VISIBLE); ivSetting.setVisibility(View.VISIBLE); btnDefinition.setVisibility(View.INVISIBLE); ivPrevious.setVisibility(View.INVISIBLE); ivBackward.setVisibility(View.VISIBLE); ivForward.setVisibility(View.VISIBLE); ivNext.setVisibility(View.INVISIBLE); tvDownload.setVisibility(View.GONE); } else { mContentView.findViewById(R.id.layout_progressbar).setVisibility( View.VISIBLE); ivSetting.setVisibility(View.VISIBLE); btnDefinition.setVisibility(View.VISIBLE); ivPrevious.setVisibility(View.VISIBLE); ivBackward.setVisibility(View.VISIBLE); ivForward.setVisibility(View.VISIBLE); ivNext.setVisibility(View.VISIBLE); tvDownload.setVisibility(View.VISIBLE); } } public static interface PlayerControlProxy { void playOrPause(); void next(); void previous(); void fastForward(int sec); void fastBackward(int sec); void seekto(int pos); void playVideoAt(int index); List<Integer> getDefinitions(); int getCurrentDefinition(); void changeDefinition(int definition); ArrayList<SohuPlayerItemBuilder> getVideolist(int listType); } private ControllerVisibleListener visibleListener; public void setVisibleChangeListener(ControllerVisibleListener listener) { this.visibleListener = listener; } public static interface ControllerVisibleListener { void onVisibleStateChange(boolean visible); } }
[ "liuwei9502@163.com" ]
liuwei9502@163.com
75891dfb89ebe6a096891290c7fbe20b35f31c3d
8f1ae5573e9ccb8a2e4a578c6e7685be41caad34
/produto/produto-web/src/main/java/br/unifor/aluno/ads/produto/rest/ProdutoResourceRESTService.java
5a4754c90ab0f4af8ded3e8d8489badaf51746d3
[]
no_license
AdrianoModa/ProgWeb
7f0bd3f6119f03843b3a428e6a0b4eb342d0a222
9f3f16b1383c103a59c00e649c71a48a04e4d0fe
refs/heads/master
2021-01-19T08:11:53.811861
2017-04-27T19:39:28
2017-04-27T19:39:28
87,609,195
0
0
null
null
null
null
UTF-8
Java
false
false
2,269
java
package br.unifor.aluno.ads.produto.rest; import java.util.List; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import br.unifor.aluno.ads.produto.bo.ProdutoBO; import br.unifor.aluno.ads.produto.entitys.Produto; @RequestScoped @Path("/produto") public class ProdutoResourceRESTService { @Inject private ProdutoBO produtoBO; @GET @Produces(MediaType.APPLICATION_JSON) public Response exibeProduto(){ List<Produto> listaProdutos = produtoBO.verProdutos(); return Response.ok(listaProdutos).build(); } @POST @Path("/inserir/{nome}/{descricao}/{preco}/{disponivel}") @Produces(MediaType.APPLICATION_JSON) public Response insereProduto(@PathParam("nome") String nome, @PathParam("descricao") String descricao, @PathParam("preco") Integer preco, @PathParam("disponivel") boolean isDisponivel){ Produto produto = new Produto(); produto.setNome(nome); produto.setDescricao(descricao); produto.setPreco(preco); produto.setDisponivel(isDisponivel); produtoBO.inserirNovoProduto(produto); return Response.ok().build(); } @PUT @Path("/atualizar/{id}") @Consumes(MediaType.APPLICATION_JSON) public Response atualizarContato(@PathParam("id") Long id, Produto produto){ Produto produtoExistente = produtoBO.buscarPorId(id); if(produtoExistente == null){ throw new WebApplicationException(Status.NOT_MODIFIED); } produtoExistente.setNome(produto.getNome()); produtoExistente.setPreco(produto.getPreco()); produtoBO.atualizarProduto(produtoExistente); return Response.ok().build(); } @DELETE @Path("/remover/{id}") @Produces(MediaType.APPLICATION_JSON) public Response deletarContato(@PathParam("id") Long id){ Produto produto = produtoBO.buscarPorId(id); if(produto == null){ throw new WebApplicationException(Status.NOT_MODIFIED); } produtoBO.removerProduto(produto); return Response.ok().build(); } }
[ "frodostark@gandalfthegrey" ]
frodostark@gandalfthegrey
c27abfc73f8370f496c176421057366b8794fd70
8d6368e1a58a9c2e678057fb53205b0ed4754ab0
/src/main/java/kr/or/ddit/user/service/UserServiceImpl.java
6d5b043c5db87f2560104d561e96a2b4288df0c9
[]
no_license
JangGooHyeon/Spring
9e54ce883485e2198fbf805520df6b8e4bb9b8e6
25ddfe75635f8d12e3999fa39cad7310fc19560c
refs/heads/master
2020-04-25T07:59:49.891655
2019-03-14T01:09:17
2019-03-14T01:09:17
172,631,244
0
0
null
null
null
null
UTF-8
Java
false
false
2,664
java
package kr.or.ddit.user.service; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.springframework.stereotype.Service; import kr.or.ddit.db.mybatis.MybatisSqlSessionFactory; import kr.or.ddit.user.dao.IUserDao; import kr.or.ddit.user.dao.UserDaoImpl; import kr.or.ddit.user.model.UserVo; import kr.or.ddit.util.model.PageVo; @Service("userService") public class UserServiceImpl implements IUserService { @Resource(name="userDao") private IUserDao dao; public UserServiceImpl() { } /** * Method : getAllUser * 작성자 : goo84 * 변경이력 : * @return * Method 설명 : 전체 사용자 정보 조회 */ @Override public List<UserVo> getAllUser() { return dao.getAllUser(); } /** * Method : selectUser * 작성자 : goo84 * 변경이력 : * @param userId * @return * Method 설명 : 특정 사용자 정보 조회 */ @Override public UserVo selectUser(String userId) { return dao.selectUser(userId); } /** * Method : selectUserPagingList * 작성자 : goo84 * 변경이력 : * @param pageVo * @return * Method 설명 : 사용자 페이징 리스트 조회 */ @Override public Map<String, Object> selectUserPagingList(PageVo pageVo) { Map<String, Object> resultMap = new HashMap<String, Object>(); resultMap.put("userList", dao.selectUserPagingList(pageVo)); resultMap.put("userCnt", dao.getUserCnt()); return resultMap; } /** * Method : insertUser * 작성자 : goo84 * 변경이력 : * @param userVo * @return * Method 설명 : 사용자 등록 */ @Override public int insertUser(UserVo userVo) { return dao.insertUser(userVo); } /** * Method : updateUser * 작성자 : goo84 * 변경이력 : * @param userVo * @return * Method 설명 : 사용자 정보 수정 */ @Override public int updateUser(UserVo userVo) { return dao.updateUser(userVo); } /** * Method : updateUserPass * 작성자 : goo84 * 변경이력 : * @param userVo * @return * Method 설명 : 사용자 비밀번호 암호화 작업 */ @Override public int updateUserPass(UserVo userVo) { return dao.updateUserPass(userVo); } /** * Method : deleteUser * 작성자 : goo84 * 변경이력 : * @param userId * @return * Method 설명 : 사용자 삭제 */ @Override public int deleteUser(String userId) { return dao.deleteUser(userId); } }
[ "goo8455@naver.com" ]
goo8455@naver.com
1c07971b9f496c5f41a6e74e2fc7e02339bc607d
d471f32a0fb8068332bd54b10a3e2b1461dc9882
/app/src/main/java/com/example/gp2021/ui/academic/addStudent.java
36744a2f90cee42454c113f9744899d3e491be3d
[]
no_license
ibrahimkelany/GP2021
b1dfdf81c319b460a784124dac9d42f25a5ebad0
2cbe5ae4079a5c7bcd9c2754c979880d4012e669
refs/heads/main
2023-06-15T15:17:32.557978
2021-07-05T23:02:55
2021-07-05T23:02:55
334,709,994
0
0
null
null
null
null
UTF-8
Java
false
false
17,231
java
package com.example.gp2021.ui.academic; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.PopupMenu; import android.widget.Toast; import com.example.gp2021.R; import com.example.gp2021.data.model.student; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; public class addStudent extends AppCompatActivity { EditText stdID, stdName, stdEmail, travelTime, studyTime, failures, activities, freeTime, goOut, health, gender, absence; Button addStd; ProgressDialog LoadingBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_student); LoadingBar = new ProgressDialog(this); travelTime = (EditText)findViewById(R.id.editStdTravelTime); travelTime.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { travelTime.setText(""); loadTravelTimeMenu(); } }); travelTime.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus) { travelTime.setText(""); loadTravelTimeMenu(); } } }); studyTime = (EditText)findViewById(R.id.editStdStudyTime); studyTime.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { studyTime.setText(""); loadStudyTimeMenu(); } }); studyTime.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus) { studyTime.setText(""); loadStudyTimeMenu();} } }); activities = (EditText)findViewById(R.id.editStdActivities); activities.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { activities.setText(""); loadActivitiesMenu(); } }); activities.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus) { activities.setText(""); loadActivitiesMenu();} } }); freeTime = (EditText)findViewById(R.id.editStdFreeTime); freeTime.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { freeTime.setText(""); loadfreeTimeAfterSchoolMenu(); } }); freeTime.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus) { freeTime.setText(""); loadfreeTimeAfterSchoolMenu();} } }); goOut = (EditText)findViewById(R.id.editStdGoingOut); goOut.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { goOut.setText(""); loadGoingOutWithFriendsMenu(); } }); goOut.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus) { goOut.setText(""); loadGoingOutWithFriendsMenu();} } }); health = (EditText)findViewById(R.id.editStdHealthStatus); health.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { health.setText(""); loadHealthMenu(); } }); health.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus) {health.setText(""); loadHealthMenu();} } }); gender = (EditText)findViewById(R.id.editStdGender); gender.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { gender.setText(""); loadGenderMenu(); } }); gender.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if(hasFocus) { gender.setText(""); loadGenderMenu();} } }); addStd = (Button)findViewById(R.id.btnAddStd); addStd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { readEditTexts(); if(stdID.getText().toString().equals("")||stdName.getText().toString().equals("")||stdEmail.getText().toString().equals("")|| gender.getText().toString().equals("")||travelTime.getText().toString().equals("")||studyTime.getText().toString().equals("") ||failures.getText().toString().equals("")||activities.getText().toString().equals("")||freeTime.getText().toString().equals("") ||goOut.getText().toString().equals("")||health.getText().toString().equals("")||absence.getText().toString().equals("")) { Toast.makeText((addStudent.this), "Please Fill Empty Fields", Toast.LENGTH_SHORT).show(); } else { LoadingBar.setTitle("Add Student"); LoadingBar.setMessage("please wait until student is added"); LoadingBar.setCanceledOnTouchOutside(false); readEditTexts(); String std_id = stdID.getText().toString(); String std_name = stdName.getText().toString().toLowerCase(); String std_email= stdEmail.getText().toString(); String std_gender = gender.getText().toString(); String std_TravelTime = travel_time(travelTime.getText().toString()); String std_studyTime = study_time(studyTime.getText().toString()); String std_failures = getNumOfPastFailure(failures.getText().toString()); String std_activities = activities.getText().toString(); String std_free_time = free_time_OR_go_out(freeTime.getText().toString()); String std_go_out = free_time_OR_go_out(goOut.getText().toString()); String std_health = health_status(health.getText().toString()); String std_absence = absence.getText().toString(); if(isEmailValid(std_email)) { LoadingBar.show(); student std = new student(std_id,std_name,std_email,std_gender,std_TravelTime,std_studyTime,std_failures,std_activities, std_free_time,std_go_out,std_health,std_absence); add_student(std); } else { Toast.makeText((addStudent.this), "email is not valid", Toast.LENGTH_SHORT).show(); } } } }); } public void loadTravelTimeMenu() { PopupMenu popup = new PopupMenu(addStudent.this, travelTime); popup.getMenu().add("less than 30 min"); popup.getMenu().add("30 to 60 min"); popup.getMenu().add("1 to 2 hours"); popup.getMenu().add("more than 2 hours"); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { travelTime.setText(item.getTitle().toString()); return true; } }); popup.show();//showing popup menu } //--------------------------------------------------- public void loadStudyTimeMenu() { PopupMenu popup = new PopupMenu(addStudent.this, studyTime); popup.getMenu().add("less than 2 hours"); popup.getMenu().add("2 to 4 hours"); popup.getMenu().add("4 to 6 hours"); popup.getMenu().add("more than 6 hours"); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { studyTime.setText(item.getTitle().toString()); return true; } }); popup.show();//showing popup menu } public void loadActivitiesMenu() { PopupMenu popup = new PopupMenu(addStudent.this, activities); popup.getMenu().add("yes"); popup.getMenu().add("no"); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { activities.setText(item.getTitle().toString()); return true; } }); popup.show();//showing popup menu } public void loadfreeTimeAfterSchoolMenu() { PopupMenu popup = new PopupMenu(addStudent.this, freeTime); popup.getMenu().add("very low"); popup.getMenu().add("low"); popup.getMenu().add("average"); popup.getMenu().add("high"); popup.getMenu().add("very high"); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { freeTime.setText(item.getTitle().toString()); return true; } }); popup.show();//showing popup menu } public void loadGoingOutWithFriendsMenu() { PopupMenu popup = new PopupMenu(addStudent.this, goOut); popup.getMenu().add("very low"); popup.getMenu().add("low"); popup.getMenu().add("average"); popup.getMenu().add("high"); popup.getMenu().add("very high"); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { goOut.setText(item.getTitle().toString()); return true; } }); popup.show();//showing popup menu } public void loadHealthMenu() { PopupMenu popup = new PopupMenu(addStudent.this, health); popup.getMenu().add("very bad"); popup.getMenu().add("bad"); popup.getMenu().add("moderate"); popup.getMenu().add("good"); popup.getMenu().add("very good"); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { health.setText(item.getTitle().toString()); return true; } }); popup.show();//showing popup menu } public void loadGenderMenu() { PopupMenu popup = new PopupMenu(addStudent.this, gender); popup.getMenu().add("male"); popup.getMenu().add("female"); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { gender.setText(item.getTitle().toString()); return true; } }); popup.show();//showing popup menu } public void readEditTexts() { stdID = (EditText)findViewById(R.id.editStdID); stdName = (EditText)findViewById(R.id.editStdName); stdEmail = (EditText)findViewById(R.id.editStdEmail); travelTime = (EditText)findViewById(R.id.editStdTravelTime); studyTime = (EditText)findViewById(R.id.editStdStudyTime); failures = (EditText)findViewById(R.id.editStdPastFailures); activities = (EditText)findViewById(R.id.editStdActivities); freeTime = (EditText)findViewById(R.id.editStdFreeTime); goOut = (EditText)findViewById(R.id.editStdGoingOut); health = (EditText)findViewById(R.id.editStdHealthStatus); gender = (EditText)findViewById(R.id.editStdGender); absence = (EditText)findViewById(R.id.editStdAbsecnce); } public String travel_time(String str) { if(str.equals("less than 30 min") ) return ("1"); else if(str.equals("30 to 60 min")) return "2"; else if(str.equals("1 to 2 hours")) return "3"; else return "4"; } public String study_time(String str) { if(str.equals("less than 2 hours") ) return ("1"); else if(str.equals("2 to 4 hours")) return "2"; else if(str.equals("4 to 6 hours")) return "3"; else return "4"; } public String free_time_OR_go_out(String str) { if(str.equals("very low") ) return ("1"); else if(str.equals("low")) return "2"; else if(str.equals("average")) return "3"; else if(str.equals("high")) return "4"; else return "5"; } public String health_status(String str) { if(str.equals("very bad") ) return ("1"); else if(str.equals("bad")) return "2"; else if(str.equals("moderate")) return "3"; else if(str.equals("good")) return "4"; else return "5"; } public void add_student(student std) { DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference(); rootRef.child("student").addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { if(!snapshot.child(std.getStdID()).exists()) { boolean email_name = true; for(DataSnapshot ds : snapshot.getChildren()) { student s = ds.getValue(student.class); if(s.getStdName().equals(std.getStdName()) || s.getEmail().equals(std.getEmail())) { email_name = false; break; } } if(email_name) { rootRef.child("student").child(std.getStdID()).setValue(std).addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { LoadingBar.dismiss(); Toast.makeText((addStudent.this), "student is added successfully", Toast.LENGTH_SHORT).show(); clear(); } } }); } else {LoadingBar.dismiss(); Toast.makeText(getApplicationContext(),"name or email are already used",Toast.LENGTH_LONG).show(); } } else { LoadingBar.dismiss(); Toast.makeText(getApplicationContext(),"Id already used",Toast.LENGTH_LONG).show(); } } @Override public void onCancelled(@NonNull DatabaseError error) { } }); } public String getNumOfPastFailure(String num) { int N = Integer.parseInt(num); if(N < 3) return num; else return "4"; } public void clear() { stdID.setText(""); stdName.setText(""); stdEmail.setText(""); travelTime.setText(""); studyTime.setText(""); failures.setText(""); activities.setText(""); freeTime.setText(""); goOut.setText(""); health.setText(""); gender.setText(""); absence.setText(""); } public boolean isEmailValid(String email) { if(email.contains(".com")) return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches(); else return false; } }
[ "ahmedasas222@yahoo.com" ]
ahmedasas222@yahoo.com
62b8731d43e75b3704cfe4b3116886e89f997f9d
f5c6e60172abd0964d6c3136fd58af45390b8c6a
/InferenciaBorrosa/src/ReglaDifusa/ReglaSugeno.java
5beb8eae3b3a42e1fda04a42f5301c476d2697b6
[]
no_license
RenzoAlcala/SIDPARK
5f5311d9ec43588fdc50fd104b44af9032672321
64a0b0f74624cb5bda8fc319ca7b36706b778a78
refs/heads/master
2021-06-19T03:22:58.011858
2017-06-19T04:23:08
2017-06-19T04:23:08
93,814,335
0
0
null
null
null
null
UTF-8
Java
false
false
6,289
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 ReglaDifusa; import OperadorDifuso.DefineOperador; import OperadorDifuso.OperadorFuncion; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /** * * @author RALCALA */ public class ReglaSugeno extends Regla { private Map<String, String> listaOperadores; public ReglaSugeno(Map<String, String> listaOperadores){ this.listaOperadores = listaOperadores; } private Double evaluarConsecuente(String exprConsecuente,Double valorDisparoRegla,Map<String, Double> salidasDifusas){ //SE DEBE DEFINIR UNA FUNCION PARA MODELAR LA SALIDA return OperadorFuncion.calcular(listaOperadores.get(DefineOperador.K_IMPLICACION),valorDisparoRegla,salidasDifusas.get(exprConsecuente.replaceAll(" ", ""))); } @Override public Object evaluar(Map<String,Double> entradasDifusa,Map<String, Double> salidasDifusas){ try{ String expresion = getExpr(); String[] valoresExpr = expresion.split("=>"); if(valoresExpr.length!=2){ throw new Exception("Ocurrio un error al interpretar la regla, no ha indicado correctamente el símbolo de implicación"); } String exprAntecedente = valoresExpr[0]; String exprConsecuente = valoresExpr[1]; double valorDisparo = Double.parseDouble(evaluarAntecedente(entradasDifusa,exprAntecedente)); return evaluarConsecuente(exprConsecuente,valorDisparo,salidasDifusas); //return valorDisparo; }catch(Exception e){ System.out.println("ERROR ReglaSugeno.evaluar: "+e.getMessage()); e.printStackTrace(); } return null; } private String evaluarAntecedente(Map<String,Double> entradasDifusa, String expr) { try{ String valDifuso; if ((valDifuso=obtenerValorDifuso(entradasDifusa,expr.trim()))!=null) { return valDifuso; } int indMinOp = Integer.MAX_VALUE; String operador = ""; for (Map.Entry<String,String> operadorFunc: listaOperadores.entrySet()) { int index = expr.indexOf(operadorFunc.getKey()); if (index != -1 && indMinOp > index) { indMinOp = index; operador = operadorFunc.getValue(); } } if (indMinOp == -1) { throw new Exception("Error: No se encontro un operador para calcular. Verifique que las entradas y los términos esten registrados en entradas.config."); } String miembroIzq = expr.substring(0, indMinOp); String miembroDer = expr.substring(indMinOp + operador.length(), expr.length()); String valIzq; String valDer; if (hayOperador(miembroIzq)) { valIzq = evaluarAntecedente(entradasDifusa,miembroIzq); } else { valIzq = miembroIzq; } if (hayOperador(miembroDer)) { valDer = evaluarAntecedente(entradasDifusa,miembroDer); } else { valDer = miembroDer; } //for (String oper : listaOperadores) { // if (operador.equals(oper)) { String valDifIzq; String valDifDer; if(esDouble(valIzq.replaceAll(" ", ""))){ valDifIzq = valIzq.replaceAll(" ", ""); }else{ valDifIzq = entradasDifusa.get(valIzq.replaceAll(" ", ""))+""; } if(esDouble(valDer.replaceAll(" ", ""))){ valDifDer = valDer.replaceAll(" ", ""); }else{ valDifDer = entradasDifusa.get(valDer.replaceAll(" ", ""))+""; } return ""+OperadorFuncion.calcular(operador,Double.parseDouble(valDifIzq), Double.parseDouble(valDifDer)); // } //} }catch(Exception e){ System.out.println("ERROR ReglaDifusa.ReglaSugeno: "+e.getMessage()); e.printStackTrace(); } return ""; } private String obtenerValorDifuso(Map<String,Double> entradasDifusa,String expr){ String exprLimpio = expr.replaceAll(" ", ""); return (entradasDifusa.get(exprLimpio)==null)?null:entradasDifusa.get(exprLimpio)+""; } private boolean esDouble(String valor){ try{Double.parseDouble(valor);return true;}catch(Exception e){}return false; } public String obtenerConsecuente(){ return getExpr().split("=>")[1].trim().replaceAll(" ", ""); } public String obtenerAntecedente(){ return getExpr().split("=>")[0].trim().replaceAll(" ", ""); } private boolean hayOperador(String expresion) { for (Map.Entry<String,String> operadorFunc: listaOperadores.entrySet()) { if (expresion.contains(operadorFunc.getKey())) { return true; } } return false; } public static void main(String[] args) { Map<String, String> operadoresFunciones = new HashMap(); operadoresFunciones.put("AND", "MIN"); operadoresFunciones.put("OR", "MAX"); operadoresFunciones.put("IMPLICACION", "PROD"); operadoresFunciones.put("AGREGACION", "MAX"); ReglaSugeno rs = new ReglaSugeno(operadoresFunciones); rs.setExpr("Vel ==Bajo AND AccX== Alto AND AccX == Bajo => Pel == Alto"); Map<String, Double> entradasDifusas = new HashMap(); entradasDifusas.put("Vel==Bajo", 0.1d); entradasDifusas.put("Vel==Alto", 0.2d); entradasDifusas.put("Vel==Medio", 0.3d); entradasDifusas.put("AccX==Alto", 0.4d); entradasDifusas.put("AccX==Bajo", 0.5d); entradasDifusas.put("AccX==Medio", 0.6d); Map<String, Double> salidas = new HashMap(); salidas.put("Pel==Alto", 1d); Object res = rs.evaluar(entradasDifusas,salidas); System.out.println("Resultado: "+res.toString()); } }
[ "alcalarenzo94@gmail.com" ]
alcalarenzo94@gmail.com
92652f1d48214a0dddb6ad471815d93dad8496d0
42c4c9526678334c40d05d2c56f6eef2310a01ac
/music-xml/src/test/java/com/soft1851/spring/music/service/CollectionServiceTest.java
68ef87ece628734d15c5261bfb9e5b44e5a48b13
[]
no_license
RRapids/spring-learning
669493e88e150aceb0a91d0b65ac0c5a2e71b7fd
89474dfee47858197dfb8d9d578ef603c3ec3021
refs/heads/master
2022-12-22T13:04:21.633491
2020-04-04T10:40:18
2020-04-04T10:40:18
247,849,628
0
0
null
null
null
null
UTF-8
Java
false
false
1,356
java
package com.soft1851.spring.music.service; import com.soft1851.spring.music.common.Result; import com.soft1851.spring.music.domain.dto.UserDto; import com.soft1851.spring.music.domain.entity.MusicCollection; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"/spring-mybatis.xml"}) public class CollectionServiceTest { @Resource private CollectionService collectionService; @Test public void batchDelete() { List<String> list = new ArrayList<>(); list.add("3"); UserDto userDto = UserDto.builder() .userId(1) .musicList(list) .build(); Result result = collectionService.batchDelete(userDto); System.out.println(result); } @Test public void insertCollection() { MusicCollection musicCollection = MusicCollection.builder() .userId("1") .musicId("3") .build(); Result result = collectionService.insertCollection(musicCollection); System.out.println(result); } }
[ "tengfeiqaq@gmail.com" ]
tengfeiqaq@gmail.com