blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
132
path
stringlengths
2
382
src_encoding
stringclasses
34 values
length_bytes
int64
9
3.8M
score
float64
1.5
4.94
int_score
int64
2
5
detected_licenses
listlengths
0
142
license_type
stringclasses
2 values
text
stringlengths
9
3.8M
download_success
bool
1 class
1405677e7dec5cf7cf0d128797ecec081f44c9d8
Java
guominfang/ComponentDemo
/component/src/main/java/com/kwok/component/AppConfig.java
UTF-8
211
1.625
2
[]
no_license
package com.kwok.component; public class AppConfig { public static final String[] COMPONENT = { "com.kwok.newsmodule.NewsApplication", "com.kwok.usermodule.UserApplication" }; }
true
166131878566121a287ee53f313589bff08aae4e
Java
phantrang0112/DoAnJava
/WebBanHangJava/src/model/AccountModel.java
UTF-8
4,866
2.296875
2
[]
no_license
package model; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import javax.servlet.http.HttpSession; import org.eclipse.jdt.internal.compiler.ast.ThisReference; import controller.MyConnect; import entities.Account; public class AccountModel { Account account; public AccountModel(Account account) { this.account = account; } public AccountModel() { super(); } public ArrayList getList() { ArrayList<Account> list = new ArrayList<Account>(); Connection cnConnection = new MyConnect().getcn(); if (cnConnection == null) { return null; } try { String sqlString = "Select * from admin"; PreparedStatement ps = cnConnection.prepareStatement(sqlString); ResultSet resultSet = ps.executeQuery(); while (resultSet.next()) { Account tempAccount = new Account(resultSet.getString(1), resultSet.getString(2)); list.add(tempAccount); } ps.close(); cnConnection.close(); } catch (SQLException e) { e.printStackTrace(); // TODO: handle exception } return list; } // public Account gettAccount(String idUser,String userName,String passWord,String email, String sdt, String idQuyen) { // account.setIdUser(idUser); // account.setUserName(userName); // account.setPassWord(passWord); // account.setEmail(email); // account.setSdt(sdt); // account.setIdQuyen(idQuyen); // // return account; // } public void setAccount(Account account) { this.account = account; } public Account getAccount() { return account; } public Account getAccountHienTai(String userName, String password, HttpSession a){ int kq = 0; Account acc=null; Connection cn = new MyConnect().getcn(); if (cn == null) { return null; } try { String sql = "SELECT * FROM NguoiDung "; PreparedStatement ps = cn.prepareStatement(sql); ResultSet rs = ps.executeQuery(); while (rs.next()) { System.out.println(rs.getString(2) + userName + "...." + password + rs.getString(3)); if (rs.getString(2).equals(userName) && rs.getString(3).equals(password)) { acc = new Account(rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(5), rs.getString(6)); break; } } } catch (SQLException e) { e.printStackTrace(); // TODO: handle exception } return acc; } public int login(String userName, String password, HttpSession a) { int kq = 0; Connection cn = new MyConnect().getcn(); if (cn == null) { return 0; } try { // String sql = "SELECT * FROM NguoiDung "; PreparedStatement ps = cn.prepareStatement(sql); ResultSet rs = ps.executeQuery(); while (rs.next()) { System.out.println(rs.getString(2) + userName + "...." + password + rs.getString(3)); if (rs.getString(2).equals(userName) && rs.getString(3).equals(password)) { kq = 1; break; } } } catch (SQLException e) { e.printStackTrace(); // TODO: handle exception } return kq; } // public int insertAccount() { // int kq = 0; // Connection cn = new MyConnect().getcn(); // if (cn == null) { // return 0; // } // try { // String sqlString = "insert into admin values(?,?)"; // PreparedStatement pStatement = cn.prepareStatement(sqlString); // pStatement.setString(1, account.getUsername()); // pStatement.setString(2, account.getPassword()); // kq = pStatement.executeUpdate(); // // } catch (SQLException e) { // e.printStackTrace(); // // TODO: handle exception // } // return kq; // } public int updateAccount() { int kq = 0; Connection cnConnection = new MyConnect().getcn(); if (cnConnection == null) { return 0; } try { String sqlString = "update NguoiDung set userName=?,passWord=?,email=?,sdt=? where idUser=?"; PreparedStatement pStatement = cnConnection.prepareStatement(sqlString); pStatement.setString(1, account.getUserName()); pStatement.setString(2,account.getPassWord()); pStatement.setString(3, account.getEmail()); pStatement.setString(4, account.getSdt()); pStatement.setString(5, account.getIdUser()); System.out.println(account.getUserName() + account.getPassWord()); kq = pStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); // TODO: handle exception } return kq; } // public int deleteAccount() { // int kq = 0; // Connection cnConnection = new MyConnect().getcn(); // if (cnConnection == null) { // return 0; // } // // try { // String sqlString = "delete from admin where username=?"; // PreparedStatement pStatement = cnConnection.prepareStatement(sqlString); // pStatement.setString(1, account.getUsername()); // kq = pStatement.executeUpdate(); // // } catch (SQLException e) { // e.printStackTrace(); // // TODO: handle exception // } // return kq; // } }
true
a4ce748fa254d1856411bb0fbcb4e5945851dde9
Java
jamaldt/junittest
/src/main/java/com/curso/testing/payments/PaymentRequest.java
UTF-8
481
2.4375
2
[ "MIT" ]
permissive
package com.curso.testing.payments; /** * System: CleanBnB * Name: PaymentRequest * Description: Class that represents a PaymentRequest's Entity in the application * * @author carlosdeltoro * @version 1.0 * @since 11/9/21 */ public class PaymentRequest { private double amount; public PaymentRequest(double amount) { this.amount = amount; } public double getAmount() { return amount; } }
true
02e955cfbbb524bba4cfc63f47f4ccd35f916766
Java
juniorsilver/ureport-android
/app/src/main/java/in/ureport/models/Story.java
UTF-8
2,807
2.25
2
[]
no_license
package in.ureport.models; import android.os.Parcel; import android.os.Parcelable; import com.activeandroid.Model; import com.activeandroid.annotation.Column; import com.activeandroid.annotation.Table; import java.util.Date; /** * Created by johncordeiro on 7/14/15. */ @Table(name = "Story") public class Story extends Model implements Parcelable { @Column(name = "title") private String title; @Column(name = "content") private String content; @Column(name = "createdDate") private Date createdDate; @Column(name = "author") private User user; @Column(name = "contributions") private Integer contributions; @Column(name = "markers") private String markers; public Story() { } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Date getCreatedDate() { return createdDate; } public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public Integer getContributions() { return contributions; } public void setContributions(Integer contributions) { this.contributions = contributions; } public String getMarkers() { return markers; } public void setMarkers(String markers) { this.markers = markers; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(this.title); dest.writeString(this.content); dest.writeLong(createdDate != null ? createdDate.getTime() : -1); dest.writeParcelable(this.user, 0); dest.writeValue(this.contributions); dest.writeString(this.markers); } protected Story(Parcel in) { this.title = in.readString(); this.content = in.readString(); long tmpCreatedDate = in.readLong(); this.createdDate = tmpCreatedDate == -1 ? null : new Date(tmpCreatedDate); this.user = in.readParcelable(User.class.getClassLoader()); this.contributions = (Integer) in.readValue(Integer.class.getClassLoader()); this.markers = in.readString(); } public static final Creator<Story> CREATOR = new Creator<Story>() { public Story createFromParcel(Parcel source) { return new Story(source); } public Story[] newArray(int size) { return new Story[size]; } }; }
true
963f1be872bfc88ddaec660d1262e34e1deff1df
Java
Dongdongdongs/work_java
/ch04/src/ch04/Ch04EX01_03.java
UTF-8
371
3.40625
3
[]
no_license
package ch04; import java.util.Scanner; public class Ch04EX01_03 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String input = scanner.nextLine(); int age = Integer.parseInt(input); if(age >= 20) { System.out.println("agult"); } else { System.out.printf("%d years later", 20-age); } } }
true
e5bdbd900c5c6920935fc955485f12b574ca0185
Java
danielgalvaoguerra/Parallax---Java-Top-Down-Shooter
/src/SmallEnemy.java
UTF-8
2,025
2.90625
3
[]
no_license
import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.geom.Ellipse2D; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; public class SmallEnemy extends Enemy{ public static final int SMALLENEMY_WIDTH = 25; public static final int SMALLENEMY_HEIGHT = 25; public static final double SMALLENEMY_SPEED = 0.3; public static final double SMALLENEMY_HP = 1; private double moveX; private double moveY; private double speedX; private double speedY; private Image img; public SmallEnemy(double xinit, double yinit, int xdir, int ydir) { super(xinit, yinit, SMALLENEMY_HP); moveX = xinit; moveY = yinit; speedX = SMALLENEMY_SPEED*xdir; speedY = SMALLENEMY_SPEED*ydir; img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); getImages(); } private void getImages() { File imgPath = new File("images/smallEnemy.png"); try { img = ImageIO.read(imgPath); } catch(Exception e) {} } public void move(double px, double py) { if(moveX+SMALLENEMY_WIDTH > ParallaxMain.SCREEN_WIDTH || super.getX() < 0) { speedX *= -1; } if(super.getY()+SMALLENEMY_HEIGHT > ParallaxMain.SCREEN_HEIGHT || super.getY() < 0) { speedY *= -1; } moveX += speedX; moveY += speedY; super.setX(moveX); super.setY(moveY); } public void drawImage(Graphics2D g2) { g2.setColor(Color.BLUE); g2.drawImage(img, (int)super.getX(), (int)super.getY(), null); //Ellipse2D.Double enemy = new Ellipse2D.Double(super.getX(), super.getY(), SMALLENEMY_WIDTH, SMALLENEMY_HEIGHT); //g2.fill(enemy); g2.setColor(Color.BLACK); } public Rectangle getBounds() { return new Rectangle((int)super.getX(), (int)super.getY(), SMALLENEMY_WIDTH, SMALLENEMY_HEIGHT); } public String getClassName() { return "SmallEnemy"; } public double getSpeedX() { return speedX; } public double getSpeedY() { return speedY; } }
true
bb6770ca6218211104319c09d36368c1d6949aab
Java
kuali/rice
/rice-middleware/edl/framework/src/main/java/org/kuali/rice/edl/framework/util/EDLFunctions.java
UTF-8
9,701
1.875
2
[ "Artistic-1.0", "MIT", "Apache-2.0", "LicenseRef-scancode-public-domain", "EPL-1.0", "CPL-1.0", "LGPL-2.1-or-later", "BSD-3-Clause", "LGPL-3.0-only", "ECL-2.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-jdom", "LicenseRef-scancode-freemarker", "LicenseRef-scancode-unk...
permissive
/** * Copyright 2005-2015 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.rice.edl.framework.util; import org.apache.commons.lang.StringUtils; import org.kuali.rice.core.api.exception.RiceRuntimeException; import org.kuali.rice.kew.api.KewApiServiceLocator; import org.kuali.rice.kew.api.WorkflowRuntimeException; import org.kuali.rice.kew.api.document.node.RouteNodeInstance; import org.kuali.rice.kew.api.exception.WorkflowException; import org.kuali.rice.kim.api.group.Group; import org.kuali.rice.kim.api.identity.Person; import org.kuali.rice.krad.UserSession; import org.kuali.rice.kim.api.services.KimApiServiceLocator; import org.kuali.rice.krad.document.authorization.PessimisticLock; import org.kuali.rice.krad.service.KRADServiceLocatorWeb; import org.kuali.rice.krad.service.PessimisticLockService; import org.kuali.rice.krad.util.GlobalVariables; import java.util.List; /** * A collection of handy workflow queries to be used from style sheets. * * @author Kuali Rice Team (rice.collab@kuali.org) * */ public class EDLFunctions { private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(EDLFunctions.class); public static boolean isUserInitiator(String id) throws WorkflowException { boolean initiator = false; UserSession userSession = GlobalVariables.getUserSession(); if (userSession != null) { try { String documentId = id.trim(); if (userSession.getPrincipalId().equals(KewApiServiceLocator.getWorkflowDocumentService().getDocument(documentId).getInitiatorPrincipalId())) { initiator = true; } } catch (Exception e) { LOG.debug("Exception encountered trying to determine if user is the document initiator:" + e ); } } return initiator; } public static boolean isUserRouteLogAuthenticated(String documentId) { boolean authenticated=false; UserSession userSession=GlobalVariables.getUserSession(); if(userSession!=null){ String principalId = userSession.getPrincipalId(); try { authenticated = KewApiServiceLocator.getWorkflowDocumentActionsService().isUserInRouteLog(documentId, principalId, true); } catch (NumberFormatException e) { LOG.debug("Invalid format documentId (should be LONG): " + documentId); } catch (RiceRuntimeException e) { LOG.error("Runtime Exception checking if user is route log authenticated: userId: " + principalId + ";documentId: " + documentId); } } return authenticated; } public static boolean isPrincipalIdAuthenticated(String principalId) { return GlobalVariables.getUserSession().getPrincipalId().equals(principalId); } public static boolean isPrincipalNameAuthenticated(String principalName) { return GlobalVariables.getUserSession().getPrincipalName().equals(principalName); } public static boolean isEmployeeIdAuthenticated(String employeeId) { return GlobalVariables.getUserSession().getPerson().getEmployeeId().equals(employeeId); } public static Person getAuthenticatedPerson(){ UserSession userSession=GlobalVariables.getUserSession(); Person user = userSession.getPerson(); return user; } public static String getUserId() { return getAuthenticatedPerson().getPrincipalId(); } public static String getLastName() { return getAuthenticatedPerson().getLastName(); } public static String getGivenName() { return getAuthenticatedPerson().getFirstName(); } public static String getEmailAddress() { return getAuthenticatedPerson().getEmailAddress(); } public static String getCampus() { return getAuthenticatedPerson().getCampusCode(); } public static String getPrimaryDeptCd() { return getAuthenticatedPerson().getPrimaryDepartmentCode(); } public static String getEmpTypCd() { return getAuthenticatedPerson().getEmployeeTypeCode(); } public static String getEmpPhoneNumber() { return getAuthenticatedPerson().getPhoneNumber(); } public static String getCurrentNodeName(String documentId){ List<RouteNodeInstance> routeNodeInstances = null; routeNodeInstances = KewApiServiceLocator.getWorkflowDocumentService().getCurrentRouteNodeInstances(documentId); for (RouteNodeInstance currentNode : routeNodeInstances) { return currentNode.getName(); } return null; } public static boolean isNodeInPreviousNodeList(String nodeName, String id) { LOG.debug("nodeName came in as: " + nodeName); LOG.debug("id came in as: " + id); //get list of previous node names List<String> previousNodeNames; try { previousNodeNames = KewApiServiceLocator.getWorkflowDocumentService().getPreviousRouteNodeNames(id); } catch (Exception e) { throw new WorkflowRuntimeException("Problem generating list of previous node names for documentID = " + id, e); } //see if node name is in the list of previous node names for (String previousNodeName : previousNodeNames) { if (previousNodeName.equals(nodeName)) { return true; } } return false; } public static String escapeJavascript(String value) { return value.replace("\\", "\\\\").replace("\"", "\\\""); } public static boolean isNodeBetween(String firstNodeName, String lastNodeName, String id) { if (isNodeInPreviousNodeList(firstNodeName, id)) { if (isNodeInPreviousNodeList(lastNodeName, id)) { return false; }else { return true; } } else { return false; } } public static boolean isAtNode(String documentId, String nodeName) throws Exception { List<RouteNodeInstance> activeNodeInstances = KewApiServiceLocator.getWorkflowDocumentService().getActiveRouteNodeInstances(documentId); for (RouteNodeInstance nodeInstance : activeNodeInstances) { if (nodeInstance.getName().equals(nodeName)) { return true; } } return false; } public static boolean hasActiveNode(String documentId) throws Exception { List<RouteNodeInstance> activeNodeInstances = KewApiServiceLocator.getWorkflowDocumentService().getActiveRouteNodeInstances(documentId); if (!activeNodeInstances.isEmpty()) { return true; } return false; } public static String getAuthenticationId() { UserSession userSession=GlobalVariables.getUserSession(); return userSession.getPrincipalName(); } public static boolean isUserInGroup(String namespace, String groupName){ boolean isUserInGroup=false; if(!StringUtils.isEmpty(groupName)){ String principalId = getUserId(); try{ isUserInGroup = isMemberOfGroupWithName(namespace, groupName, principalId); }catch(Exception e){ LOG.error("Exception encountered trying to determine if user is member of a group: userId: " + principalId + ";groupNamespace/Name: " + namespace + "/" + groupName + " resulted in error:" + e); } } return isUserInGroup; } private static boolean isMemberOfGroupWithName(String namespace, String groupName, String principalId) { for (Group group : KimApiServiceLocator.getGroupService().getGroupsByPrincipalId(principalId)) { if (StringUtils.equals(namespace, group.getNamespaceCode()) && StringUtils.equals(groupName, group.getName())) { return true; } } return false; } public static String createDocumentLock(String documentId) { PessimisticLockService lockService = KRADServiceLocatorWeb.getPessimisticLockService(); PessimisticLock lock = lockService.generateNewLock(documentId); Long lockLong = lock.getId(); return lockLong.toString(); } public static void removeDocumentLocksByUser(String documentId) { try { PessimisticLockService lockService = KRADServiceLocatorWeb.getPessimisticLockService(); List<PessimisticLock> pessimisticLocks = lockService.getPessimisticLocksForDocument(documentId); lockService.releaseAllLocksForUser(pessimisticLocks, getAuthenticatedPerson()); } catch (Exception e) { LOG.error("Exception encountered trying to delete document locks:" + e ); } } public static Boolean isDocumentLocked(String documentId) { List<PessimisticLock> pessimisticLocks = KRADServiceLocatorWeb.getPessimisticLockService().getPessimisticLocksForDocument(documentId); if (pessimisticLocks.isEmpty()) { return false; } else { return true; } } public static String getDocumentLockOwner(String documentId) { List<PessimisticLock> pessimisticLocks = KRADServiceLocatorWeb.getPessimisticLockService().getPessimisticLocksForDocument(documentId); if (pessimisticLocks.isEmpty()) { return "NoLockOnDoc"; } else { if (pessimisticLocks.size() == (1)) { PessimisticLock lock = pessimisticLocks.get(0); return lock.getOwnedByUser().getPrincipalName(); } else { return "MoreThanOneLockOnDoc"; } } } }
true
f7b1bb7b6665c7cda876676fb70be31580a1a7f6
Java
Daniel-Collins97/WIT-Student-Accommodation-System
/src/PropertyList.java
UTF-8
3,443
3.53125
4
[]
no_license
import java.io.BufferedWriter; import java.io.FileWriter; import java.io.PrintWriter; public class PropertyList { PropertyNode head; private PropertyNode tail; /** * Adds User Specified PropertyNode to the PropertyList * @param propertyNode - User Specified PropertyNode to be added to PropertyList */ public void addProperty (PropertyNode propertyNode) { if(tail == null) { head = propertyNode; tail = propertyNode; } else { tail.setNextNode(propertyNode); tail = propertyNode; } } /** * Deletes User Specified PropertyNode from PropertyList * @param address - User Specified Address of PropertyNode to be Deleted * @return - 0 if Deleting the Found Property would result in an Error * 1 if the Property was Successfully Deleted */ public int deleteProperty(String address) { int foundProp = 1; PropertyNode temp = head; PropertyNode temp1 = tail; if ((temp.getProperty().getAddress().contains(address)) && (temp1.getProperty().getAddress().contains(address))) { System.out.println("Error, Deleting this Property would cause the Property List to become empty"); return 0; } else { while (!findProperty(address).getAddress().contains(address)) { temp = temp.getNextNode(); foundProp++; } PropertyNode previous = head; int count = 1; while (count < foundProp - 1) { previous = previous.getNextNode(); count++; } PropertyNode current = previous.getNextNode(); previous.setNextNode(current.getNextNode()); current.setNextNode(null); return 1; } } /** * Finds User Specified Property * @param address - User Specified Address of Property to be found * @return - Null if Property cannot be found * Found Property Object if Property is Found */ public Property findProperty (String address) { if (head == null) { System.out.println("No Properties in list"); return null; } else { PropertyNode temp = head; while ((temp != null) && (!temp.getProperty().getAddress().equals(address))) temp = temp.getNextNode(); return temp == null ? null : temp.getProperty(); } } /** * Saves Created PropertyList to CSV File * @param address - User Specified Property Address * @param distance - User Specified Distance to WIT * @param carSpaces - User Specified Number of Car Spaces Available */ public static void saveProperty(String address, double distance, int carSpaces) { String fileSrc = "src\\data\\property.txt"; try { FileWriter fw = new FileWriter(fileSrc, true); BufferedWriter bw = new BufferedWriter (fw); PrintWriter pw = new PrintWriter(bw); pw.println("Address = " + address + ", " + "Distance to WIT = " + distance + ", " + "Car Spaces Available = " + carSpaces); pw.flush(); pw.close(); System.out.println("Done!"); } catch (Exception e) { System.out.println("Error writing to File; " + e); } } }
true
b6ed677fcb4b75c7d92342cca73db6765dc7047c
Java
haifeiforwork/xmy
/xmy/xmy-cms-web/src/main/java/com/zfj/xmy/cms/web/controller/goods/FileUploadController.java
UTF-8
7,915
2.578125
3
[]
no_license
package com.zfj.xmy.cms.web.controller.goods; import java.io.BufferedInputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import org.apache.commons.io.FileUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.zfj.base.commons.mini.bean.RespData; import com.zfj.base.util.common.StringUtil; /** * @Title: FileUploadController.java * @Package com.zfj.xmy.cms.web.controller.goods * @Description: 图片上传 * @author hexw * @date 2017年7月13日 下午1:48:37 */ @RequestMapping("/fileUpload") @RestController public class FileUploadController { /** * 服务图标上传 * @param file * @param request * @return */ @RequestMapping("/uploadImage") public RespData brandImage(@RequestParam("file") MultipartFile file,HttpServletRequest request){ RespData respData = new RespData(); Map<String,Object> map = upload(file,request,true,"上传的文件类型不正确,只能上传图片!") ; respData.setData(map); return respData; } /** * 商品图片压缩包上传 * @param file * @param request * @return * @return RespData * Date:2017年7月18日 下午4:10:03 * @author hexw */ @RequestMapping("/uploadZip") public RespData imageZip(@RequestParam("file") MultipartFile file,HttpServletRequest request){ RespData respData = new RespData(); Map<String,Object> map = uploadZip(file,request,true,"上传的文件类型不正确,只能上传zip格式的压缩包!") ; respData.setData(map); return respData; } private Map<String,Object> upload(MultipartFile file,HttpServletRequest request,boolean isImage,String message){ BufferedInputStream bis = null ; FileOutputStream fos = null ; String relativePath = null ; Map<String,Object> result = new HashMap<String,Object>() ; try { bis = new BufferedInputStream(file.getInputStream()) ; String oldFileName = file.getOriginalFilename() ; boolean condition = isImage ? isImage(oldFileName) : isZip(oldFileName) ; if(condition){ String basePath = request.getSession().getServletContext().getRealPath("") ; relativePath = File.separator + "file" + File.separator +oldFileName ; createPath(basePath + File.separator + "file") ; fos = new FileOutputStream(new File(basePath + relativePath)) ; fos.write(file.getBytes()) ; FileUtils.copyInputStreamToFile(bis,new File(basePath + relativePath)); fos.flush() ; result.put("success",true) ; relativePath = relativePath.replaceAll("\\\\\\\\","/").replaceAll("\\\\","/") ; }else{ result.put("success",false) ; result.put("msg",message) ; } } catch (IOException e) { e.printStackTrace(); result.put("success",false) ; result.put("msg","上传失败!") ; } finally { if(null != bis){ try { bis.close() ; } catch (IOException e) { e.printStackTrace(); } } if(null != fos){ try { fos.close() ; } catch (IOException e) { e.printStackTrace(); } } } result.put("filePath",relativePath.replaceFirst("/", "")) ; return result ; } private Map<String,Object> uploadZip(MultipartFile file,HttpServletRequest request,boolean isZip,String message){ BufferedInputStream bis = null ; FileOutputStream fos = null ; String relativePath = null ; String filePath = null; Map<String,Object> result = new HashMap<String,Object>() ; try { bis = new BufferedInputStream(file.getInputStream()) ; String oldFileName = file.getOriginalFilename() ; boolean condition = isZip ? isZip(oldFileName) : isApp(oldFileName) ; if(condition){ String basePath = request.getSession().getServletContext().getRealPath("") ; relativePath = File.separator + "zipfile" + File.separator + oldFileName ; createPath(basePath + File.separator + "zipfile") ; fos = new FileOutputStream(new File(basePath + relativePath)) ; fos.write(file.getBytes()) ; FileUtils.copyInputStreamToFile(bis,new File(basePath + relativePath)); fos.flush() ; result.put("success",true) ; basePath = basePath.replaceAll("\\\\\\\\","/").replaceAll("\\\\","/"); relativePath = relativePath.replaceAll("\\\\\\\\","/").replaceAll("\\\\","/") ; filePath = basePath+relativePath; result.put("filePath",filePath) ; }else{ result.put("success",false) ; result.put("msg",message) ; } } catch (IOException e) { e.printStackTrace(); result.put("success",false) ; result.put("msg","上传失败!") ; } finally { if(null != bis){ try { bis.close() ; } catch (IOException e) { e.printStackTrace(); } } if(null != fos){ try { fos.close() ; } catch (IOException e) { e.printStackTrace(); } } } return result ; } //新建路径 private void createPath(String path) { File file = new File(path) ; if(!file.exists()){ file.mkdirs() ; } } //判断是否是图片 private boolean isImage(String fileName){ fileName = fileName.toLowerCase() ; return !(-1 != fileName.indexOf(".jpg") && -1 != fileName.indexOf(".jpeg") && -1 != fileName.indexOf(".png") && -1 != fileName.indexOf(".gif")) ; } //判断是否是安装包 private boolean isApp(String fileName){ return fileName.endsWith(".apk") ; } //判断是否是zip格式压缩包 private boolean isZip(String fileName){ return fileName.endsWith(".zip"); } /** * 服务图标上传 * @param file * @param request * @return */ @RequestMapping("/layuiEditUploadImage") public JSONObject layuiEditUploadImage(@RequestParam("file") MultipartFile file,HttpServletRequest request){ return layuiEditupload(file,request,true,"上传的文件类型不正确,只能上传图片!") ; } private JSONObject layuiEditupload(MultipartFile file,HttpServletRequest request,boolean isImage,String message){ BufferedInputStream bis = null ; FileOutputStream fos = null ; String relativePath = null ; JSONObject json = new JSONObject(); int code = 0; //上传状态 0:上传成功 1:上传失败 String msg = "" ; //提示信息 try { bis = new BufferedInputStream(file.getInputStream()) ; String oldFileName = file.getOriginalFilename() ; boolean condition = isImage ? isImage(oldFileName) : isZip(oldFileName) ; if(condition){ String basePath = request.getSession().getServletContext().getRealPath("") ; relativePath = File.separator + "file" + File.separator +oldFileName ; createPath(basePath + File.separator + "file") ; fos = new FileOutputStream(new File(basePath + relativePath)) ; fos.write(file.getBytes()) ; FileUtils.copyInputStreamToFile(bis,new File(basePath + relativePath)); fos.flush() ; relativePath = relativePath.replaceAll("\\\\\\\\","/").replaceAll("\\\\","/") ; code = 0; msg = "上传成功"; }else{ code = 1; msg = message; } } catch (IOException e) { e.printStackTrace(); code = 1; msg = "上传失败"; } finally { if(null != bis){ try { bis.close() ; } catch (IOException e) { e.printStackTrace(); } } if(null != fos){ try { fos.close() ; } catch (IOException e) { e.printStackTrace(); } } } JSONObject obj = new JSONObject(); if ( code == 0){ //上传成功 obj.put("src", relativePath.replaceFirst("/", "")); } json.put("code", code); json.put("msg", msg); json.put("data", obj); return json ; } }
true
a803f16d7adf8a67815acb214ae42a36849aa97e
Java
arafat5549/finalssm
/src/main/java/com/jqmkj/roadtrip/entity/SysUserRuleSetting.java
UTF-8
3,652
2.375
2
[]
no_license
package com.jqmkj.roadtrip.entity; import com.jqmkj.roadtrip.base.BaseEntity; import java.io.Serializable; import java.math.BigDecimal; public class SysUserRuleSetting extends BaseEntity implements Serializable { //ID private Long id; //连续签到天数 private Integer continueSignDay; //连续签到赠送数量 private Integer continueSignPoint; //每消费多少元获取1个点 private BigDecimal consumePerPoint; //最低获取点数的订单金额 private BigDecimal lowOrderAmount; //每笔订单最高获取点数 private Integer maxPointPerOrder; //类型:0->积分规则;1->成长值规则 private Integer type; private static final long serialVersionUID = 1L; /** START 以下为自己编写的代码区域 一般是多表之间的联合查询 START **/ /** END 以下为自己编写的代码区域 一般是多表之间的联合查询 END **/ public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Integer getContinueSignDay() { return continueSignDay; } public void setContinueSignDay(Integer continueSignDay) { this.continueSignDay = continueSignDay; } public Integer getContinueSignPoint() { return continueSignPoint; } public void setContinueSignPoint(Integer continueSignPoint) { this.continueSignPoint = continueSignPoint; } public BigDecimal getConsumePerPoint() { return consumePerPoint; } public void setConsumePerPoint(BigDecimal consumePerPoint) { this.consumePerPoint = consumePerPoint; } public BigDecimal getLowOrderAmount() { return lowOrderAmount; } public void setLowOrderAmount(BigDecimal lowOrderAmount) { this.lowOrderAmount = lowOrderAmount; } public Integer getMaxPointPerOrder() { return maxPointPerOrder; } public void setMaxPointPerOrder(Integer maxPointPerOrder) { this.maxPointPerOrder = maxPointPerOrder; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", continueSignDay=").append(continueSignDay); sb.append(", continueSignPoint=").append(continueSignPoint); sb.append(", consumePerPoint=").append(consumePerPoint); sb.append(", lowOrderAmount=").append(lowOrderAmount); sb.append(", maxPointPerOrder=").append(maxPointPerOrder); sb.append(", type=").append(type); sb.append("]"); return sb.toString(); } public enum Column { id("id"), continueSignDay("continue_sign_day"), continueSignPoint("continue_sign_point"), consumePerPoint("consume_per_point"), lowOrderAmount("low_order_amount"), maxPointPerOrder("max_point_per_order"), type("type"); private final String column; public String value() { return this.column; } public String getValue() { return this.column; } Column(String column) { this.column = column; } public String desc() { return this.column + " DESC"; } public String asc() { return this.column + " ASC"; } } }
true
2cb6080c36c3d3de15eae098594def7da2ae059d
Java
hakan2259/news-website
/news-website/src/main/java/com/newswebsite/repository/HomeRepository.java
UTF-8
2,279
1.976563
2
[ "Apache-2.0" ]
permissive
package com.newswebsite.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import com.newswebsite.domain.News; public interface HomeRepository extends JpaRepository<News, Long> { @Query(value="select * from news where active = 1 and news_type = 'Normal' order by id desc limit 0,6",nativeQuery = true) public List<News> findLast6ByNews(); @Query(value="select * from news where active = 1 and news_type = 'Normal' order by id desc limit 6,2",nativeQuery = true) public List<News> StartAt6Find2News(); @Query(value="select * from news where active = 1 and news_type = 'Normal' order by id desc limit 8,6",nativeQuery = true) public List<News> StartAt8Find6News(); @Query(value="select * from news where active = 1 and news_type = 'Normal' order by id desc limit 14,10",nativeQuery = true) public List<News> StartAt14Find10News(); @Query(value="select * from news where active = 1 and news_type = 'Normal' order by id desc limit 24,10",nativeQuery = true) public List<News> StartAt24Find10News(); @Query(value="select * from news where active = 1 and news_type = 'Editor Picks' order by id desc limit 0,8",nativeQuery = true) public List<News> findEditorPicksLast8ByNews(); @Query(value="select * from news where active = 1 and news_type = 'Popular' order by id desc limit 0,6",nativeQuery = true) public List<News> findPopularLast6ByNews(); @Query(value="select * from news where active = 1 and news_type <> 'Vip News' and category = 'Bilim' order by id desc limit 5,5",nativeQuery = true) public List<News> findScienceByNews(); @Query(value="select * from news where active = 1 and news_type <> 'Vip News' and category = 'Teknoloji' order by id desc limit 5,5",nativeQuery = true) public List<News> findTechByNews(); @Query(value="select * from news where active = 1 and news_type <> 'Vip News' and category = 'Sağlık' order by id desc limit 5,5",nativeQuery = true) public List<News> findHealthByNews(); @Query(value="select * from news where active = 1 and news_type <> 'Vip News' and category = 'Kitap Sanat' order by id desc limit 5,5",nativeQuery = true) public List<News> findBookArtByNews(); }
true
19fe39207f602793d322ab3050b0e96d5179e671
Java
St4rFi5h/JAVA-Project
/User.java
UHC
709
3.34375
3
[]
no_license
import java.util.Random; public class User { public String name; Random random = new Random(); int dice1= random.nextInt(5)+1 , dice2= random.nextInt(5)+1; int count =0; int sum= dice1 + dice2;; public String getName() { return name; } public void setName(String name) { this.name = name; } public void roll() { dice1= random.nextInt(5)+1; dice2= random.nextInt(5)+1; } public int getDice1() { return dice1; } public int getDice2() { return dice2; } public void re() { sum= dice1 + dice2; System.out.println(this.name+": ֻ"+dice1 + ","+dice2+" :"+sum+"Դϴ\n"); } }
true
1b14219028ee6e593220edc2e06a88026bd9f363
Java
localcc/AndroidConnect-Android
/app/src/main/java/com/localchicken/androidconnect/Plugins/PluginBase.java
UTF-8
1,008
1.929688
2
[]
no_license
package com.localchicken.androidconnect.Plugins; import android.content.Context; import android.os.Handler; public class PluginBase { private Context ctx; private String pluginName; private int pKey; private Handler socketHandler; public void setCtx(Context ctx){ this.ctx = ctx; } public Context getCtx(){ return this.ctx; } public void setPluginName(String name){ pluginName = name; } public String getPluginName() { return pluginName; } public int getpKey(){ return this.pKey; } public boolean onCreate() { return true; } public void Received(int dataSize, byte[] data) { } public void setHandler(Handler handler) { this.socketHandler = handler; } public Handler getHandler() { return socketHandler; } public void onDestroy() { } private void reqPermDialog() { } }
true
1211c91f95e925c6708b0505cb8a3005b0814e26
Java
Pawan534/myJavaScriptPrograms
/coreJava/JavaCode/src/com/abstractJava/Main.java
UTF-8
402
2.921875
3
[]
no_license
package com.abstractJava; public class Main { public static void main(String[] args) { Dog dog = new Dog("Yorkie"); dog.breath(); dog.eat(); Bird bird = new Paroot("Australian"); bird.fly(); bird.breath(); bird.eat(); Eagle eagle = new Eagle("Eagle"); eagle.eat(); eagle.breath(); eagle.fly(); } }
true
5fc1621369137d3e9641ac5d70a521f8205d5b02
Java
ychxx/YcUtilsX
/app/src/main/java/com/yc/ycutilsx/ScreenShotActivity.java
UTF-8
2,534
1.726563
2
[ "Apache-2.0" ]
permissive
package com.yc.ycutilsx; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.hardware.display.DisplayManager; import android.hardware.display.VirtualDisplay; import android.media.Image; import android.media.ImageReader; import android.media.projection.MediaProjection; import android.media.projection.MediaProjectionManager; import android.os.Build; import android.os.Bundle; import android.widget.ImageView; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; import com.yc.yclibx.YcUtilsInit; import com.yc.yclibx.comment.YcScreenShot; import com.yc.yclibx.comment.YcScreenShotUtil; import com.yc.yclibx.comment.YcUI; import com.yc.yclibx.file.YcImgUtils; import java.nio.ByteBuffer; import io.reactivex.Observable; import io.reactivex.Scheduler; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; /** * */ @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public class ScreenShotActivity extends AppCompatActivity { YcScreenShot ycScreenShot; ImageView imageView2; ImageView imageView3; Bitmap mBitmap; @SuppressLint("CheckResult") @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.screen_shot_activity); imageView2 = findViewById(R.id.imageView2); imageView3 = findViewById(R.id.imageView3); findViewById(R.id.screenShotSystemTv2).setOnClickListener(v -> { // ycScreenShot.againScreenShot(imageView3); }); findViewById(R.id.screenShotImgTv).setOnClickListener(v -> { imageView2.setImageBitmap(mBitmap); }); ycScreenShot = new YcScreenShot(this); ycScreenShot.setGetBitmapCall((bitmap, isShow) -> mBitmap = bitmap); findViewById(R.id.screenShotSystemTv).setOnClickListener(v -> { ycScreenShot.getBitmapData(); // Observable.just(1) // .subscribeOn(Schedulers.io())//上游 // .observeOn(AndroidSchedulers.mainThread()) // .subscribe(integer -> ycScreenShot.getBitmapData()); }); } @Override protected void onResume() { super.onResume(); ycScreenShot.start(); } }
true
76ea0e0db95d80ab5d627e465d3ba7dbee52d171
Java
appNG/appng
/appng-core/src/main/java/org/appng/core/controller/messaging/RabbitMQReceiver.java
UTF-8
5,601
1.976563
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2011-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.appng.core.controller.messaging; import java.io.IOException; import java.util.concurrent.ExecutorService; import org.apache.commons.lang3.StringUtils; import org.appng.api.messaging.EventHandler; import org.appng.api.messaging.EventRegistry; import org.appng.api.messaging.Receiver; import org.appng.api.messaging.Serializer; import org.slf4j.Logger; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.AMQP.Queue.DeclareOk; import com.rabbitmq.client.BuiltinExchangeType; import com.rabbitmq.client.Channel; import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.Envelope; import lombok.extern.slf4j.Slf4j; /** * Message receiver implementing {@link Receiver} to use a RabbitMQ message broker. Following platform properties are * needed (default value in brackets): * <ul> * <li>{@code rabbitMQAdresses} (localhost:5672): A comma separated list of &lt;host&gt;:&lt;port&gt; for RabbitMQ * server(s)</li> * <li>{@code rabbitMQUser} (guest): Username</li> * <li>{@code rabbitMQPassword} (guest): Password</li> * <li>{@code rabbitMQExchange} (appng-messaging): Name of the exchange where the receiver binds its messaging queue on. * Be aware that this name must be different among different clusters using the same RabbitMQ server</li> * <li>{@code rabbitMQAutoDeleteQueue} (true): If the queue to create should be marked as autodelete.</li> * <li>{@code rabbitMQDurableQueue} (false): If the queue to create should be marked as durable.</li> * <li>{@code rabbitMQExclusiveQueue} (true): If the queue to create should be marked as exclusive.</li> * </ul> * * @author Claus Stümke, aiticon GmbH, 2015 * @author Matthias Müller */ @Slf4j public class RabbitMQReceiver extends RabbitMQBase implements Receiver { private static final String RABBIT_MQ_AUTO_DELETE_QUEUE = "rabbitMQAutoDeleteQueue"; private static final String RABBIT_MQ_DURABLE_QUEUE = "rabbitMQDurableQueue"; private static final String RABBIT_MQ_EXCLUSIVE_QUEUE = "rabbitMQExclusiveQueue"; private EventRegistry eventRegistry = new EventRegistry(); private DeclareOk queueDeclare; public Receiver configure(Serializer eventSerializer) { this.eventSerializer = eventSerializer; initialize("appng-rabbitmq-receiver-%d"); return this; } @SuppressWarnings("resource") public RabbitMQSender createSender() { return new RabbitMQSender().configure(eventSerializer); } public void runWith(ExecutorService executorService) { try { channel.exchangeDeclarePassive(exchange); log().info("Exchange {} already exists.", exchange); } catch (IOException e) { try { log().info("Declaring exchange '{}' (type: {})", exchange, BuiltinExchangeType.FANOUT); channel = connection.createChannel(); channel.exchangeDeclare(exchange, BuiltinExchangeType.FANOUT, true); } catch (IOException e1) { throw new IllegalStateException("Error declaring exchange.", e1); } } String nodeId = eventSerializer.getNodeId(); String queueName = (null == nodeId) ? StringUtils.EMPTY : String.format("%s@%s", nodeId, exchange); try { queueDeclare = channel.queueDeclarePassive(queueName); log().info("Queue {} already exists.", queueName); } catch (IOException e) { try { boolean durable = eventSerializer.getPlatformConfig().getBoolean(RABBIT_MQ_DURABLE_QUEUE, false); boolean exclusive = eventSerializer.getPlatformConfig().getBoolean(RABBIT_MQ_EXCLUSIVE_QUEUE, true); boolean autoDelete = eventSerializer.getPlatformConfig().getBoolean(RABBIT_MQ_AUTO_DELETE_QUEUE, true); log().info("Declaring queue '{}'.", queueName); channel = connection.createChannel(); queueDeclare = channel.queueDeclare(queueName, durable, exclusive, autoDelete, null); } catch (IOException e1) { throw new IllegalStateException("Error declaring queue.", e); } } try { String queue = queueDeclare.getQueue(); log().info("Binding queue '{}' to exchange {}", queue, exchange); channel.queueBind(queue, exchange, ""); EventConsumer consumer = new EventConsumer(channel); log().info("Consuming queue '{}' with {}", queue, consumer); channel.basicConsume(queue, true, consumer); } catch (IOException e) { throw new IllegalStateException("Error binding queue to exchange.", e); } } class EventConsumer extends DefaultConsumer { public EventConsumer(Channel channel) { super(channel); } @Override public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { Messaging.handleEvent(LOGGER, eventRegistry, eventSerializer, body, false, null); } @Override public String toString() { return getClass().getSimpleName() + " (" + channel + ")"; } } public void registerHandler(EventHandler<?> handler) { eventRegistry.register(handler); } public void setDefaultHandler(EventHandler<?> defaultHandler) { eventRegistry.setDefaultHandler(defaultHandler); } Logger log() { return LOGGER; } }
true
b64fa8bc1e9c839e56a042ab549a91e9eb041628
Java
xeonye/portal
/portal_new/src/main/java/com/infosmart/portal/service/dwmis/MisEventService.java
UTF-8
889
2
2
[]
no_license
package com.infosmart.portal.service.dwmis; import java.util.List; import java.util.Map; import com.infosmart.portal.pojo.dwmis.DwmisMisTypePo; import com.infosmart.portal.pojo.dwmis.MisEventPo; public interface MisEventService { public List<MisEventPo> getEventMassage(MisEventPo misEventPo); /** * 根据事件Id查询大事件信息 * * @param eventId * @return */ public MisEventPo getEventMessageById(String eventId); public List<DwmisMisTypePo> getEventTypeName(Object param); public List<MisEventPo> getEventsByKpiCode(String EventSearchKey, String kpiCode, String eventType); /** * 列出多个指标关联的大事件<kpiCode,eventList> * * @param EventSearchKey * @param kpiCodeList * @param eventType * @return */ Map<String, List<MisEventPo>> listEventByCodes(String EventSearchKey, List<String> kpiCodeList, String eventType); }
true
94cb66ee45045e9cfdceea865429f58abaea9a90
Java
liuyunyicai/NurseNfcClient_HTTP
/app/src/main/java/hust/nursenfcclient/http/HttpUtils.java
UTF-8
1,574
2.3125
2
[]
no_license
package hust.nursenfcclient.http; import android.content.Context; import com.squareup.okhttp.OkHttpClient; import hust.nursenfcclient.http.okhttp.LoggingInterceptor; import hust.nursenfcclient.http.okhttp.OkHttpClientUtils; import retrofit.GsonConverterFactory; import retrofit.Retrofit; import retrofit.RxJavaCallAdapterFactory; /** * Created by admin on 2016/4/8. */ public class HttpUtils { private static volatile HttpUtils instance = null; private Retrofit retrofit; private OkHttpClient client; public static final String BASE_URL = "http://115.156.187.146/"; private HttpUtils(Context context) { // 添加拦截器 client = OkHttpClientUtils.getDefault(context); retrofit = new Retrofit.Builder() .baseUrl(BASE_URL) .client(client) // 添加okHttp .addConverterFactory(GsonConverterFactory.create()) // GSON进行转换 .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .build(); } public static HttpUtils getInstance(Context context) { if (instance == null) { synchronized (HttpUtils.class) { if (instance == null) { instance = new HttpUtils(context); } } } return instance; } public Retrofit getRetrofit() { return retrofit; } public <T> T create(Class<? extends T> clazz) { return retrofit.create(clazz); } public OkHttpClient getClient() { return client; } }
true
efcdb00e407dc765906fec6326041d7c29776640
Java
shps/hdfs-scaledout-namenode
/KTHFSDashboard/src/main/java/se/kth/kthfsdashboard/log/LogController.java
UTF-8
1,309
2.15625
2
[]
no_license
package se.kth.kthfsdashboard.log; import java.util.ArrayList; import java.util.List; import javax.ejb.EJB; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; /** * * @author x */ @ManagedBean(name = "logController") @RequestScoped public class LogController { @EJB private LogEJB logEJB; private Log log = new Log(); private List<Log> logList = new ArrayList<Log>(); public String doCreateLog() { setLog(getLogEJB().addLog(getLog())); setLogList(getLogEJB().findLogs()); return "showAlllogs.xhtml"; } public String doShowlogs() { setLogList(getLogEJB().findLogs()); // FacesContext ctx = FacesContext.getCurrentInstance(); // ctx.addMessage(null, new FacesMessage("book created", "BOOK created!!!!!!!!!!!!!")); // return null; return "showAlllogs.xhtml"; } public LogEJB getLogEJB() { return logEJB; } public void setLogEJB(LogEJB logEJB) { this.logEJB = logEJB; } public Log getLog() { return log; } public void setLog(Log log) { this.log = log; } public List<Log> getLogList() { return logList; } public void setLogList(List<Log> logList) { this.logList = logList; } }
true
d9743d4b52f60cfab573f79322d6ceb347c50caf
Java
yentann/PS
/app/src/main/java/com/example/ps/Main2Activity.java
UTF-8
2,751
2.171875
2
[]
no_license
package com.example.ps; import android.app.Activity; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import java.util.Calendar; public class Main2Activity extends AppCompatActivity { EditText etName, etDesc , etTime; Button btnAddTask, btnCancel; int reqCode = 12345; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); etName = findViewById(R.id.editTextName); etDesc = findViewById(R.id.editTextDescription); etTime = findViewById(R.id.editTextReminder); btnAddTask = findViewById(R.id.buttonAdd); btnCancel = findViewById(R.id.buttonCancel); btnAddTask.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String name = etName.getText().toString(); String desc = etDesc.getText().toString(); String time = etTime.getText().toString(); if (name.length() == 0) { Toast.makeText(getBaseContext(), "Name cannot be empty", Toast.LENGTH_LONG).show(); } else if (desc.length() == 0) { Toast.makeText(getBaseContext(), "Description cannot be empty", Toast.LENGTH_LONG).show(); } else { DBHelper db = new DBHelper(Main2Activity.this); db.insertTask(name, desc); Calendar cal = Calendar.getInstance(); cal.add(Calendar.SECOND, Integer.parseInt(time)); Intent intent = new Intent(Main2Activity.this, ScheduleNotificationReceiver.class); intent.putExtra("name", name); PendingIntent pendingIntent = PendingIntent.getBroadcast(Main2Activity.this, reqCode, intent, PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager a = (AlarmManager) getSystemService(Activity.ALARM_SERVICE); a.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingIntent); Toast.makeText(getBaseContext(), "Task Inserted", Toast.LENGTH_LONG).show(); finish(); } } }); //button Cancel btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); } }
true
0987cbd6c11b332e3b7f5e12cb419b7b05e53062
Java
SergeyKonstantinov/ofd
/src/main/java/com/sergey/tasks/processors/RequestProcessor.java
UTF-8
2,363
2.53125
3
[]
no_license
package com.sergey.tasks.processors; import com.sergey.tasks.entity.objects.Command; import com.sergey.tasks.entity.objects.CommandEntity; import com.sergey.tasks.entity.exceptions.BadCommandNameException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import com.sergey.tasks.parsers.HttpRequestParser; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.StringReader; import java.math.BigDecimal; /** * Created by Sergey on 10.02.2018. */ public class RequestProcessor { private HttpRequestParser.HttpRequest httpRequest; public RequestProcessor(HttpRequestParser.HttpRequest httpRequest) { this.httpRequest = httpRequest; } public CommandEntity process() throws ParserConfigurationException, IOException, SAXException, BadCommandNameException { CommandEntity commandEntity = new CommandEntity(); commandEntity.setBalance(new BigDecimal(0)); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(httpRequest.getBodyRequest()))); Element root = document.getDocumentElement(); NodeList nodeList = root.getChildNodes(); for (int i=0;i<nodeList.getLength();i++){ Node node = nodeList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element)node; if (element.getTagName().equals("request-type")) commandEntity.setCommand(Command.getCommandByName(element.getTextContent())); if (element.getTagName().equals("extra")) if (element.hasAttribute("name")) if(element.getAttribute("name").equals("login")) commandEntity.setLogin(element.getTextContent()); if(element.getAttribute("name").equals("password")) commandEntity.setPassword(element.getTextContent()); } } return commandEntity; } }
true
d20135c97b1914f28108aeb4de35caa65e1b4393
Java
johnatanmarinho/ktestable
/src/main/java/br/com/johnatan/ktestable/Transitions.java
UTF-8
1,610
3.140625
3
[]
no_license
package br.com.johnatan.ktestable; import java.util.HashMap; import java.util.List; import java.util.Map; public class Transitions { public static final String ERROR = "ERROR"; private Map<String, Map<Character, String>> transition; // Map<estado, Map<leitura, saida>> private List<String> states; private List<Character> alphabet; public Transitions(List<String> states, List<Character> alphabet){ this.states = states; this.alphabet = alphabet; this.transition = new HashMap<>(); for(String state : states){ Map<Character, String> transition = new HashMap<Character, String>(); for(Character c : alphabet){ transition.put(c, ERROR); } this.transition.put(state, transition); } } public String read(String source, Character c){ if(transition.containsKey(source)){ if(transition.get(source).containsKey(c)){ return transition.get(source).get(c); } } return Transitions.ERROR; } public void setTransition(String source, Character c, String destination ){ if(transition.containsKey(source)){ if(transition.get(source).containsKey(c)){ transition.get(source).put(c, destination) ; } }else{ Map<Character, String> aux = new HashMap<>(); aux.put(c, destination); transition.put(source, aux); } } public Map<String, Map<Character, String>> getTransitions(){ return this.transition; } @Override public String toString() { String r = ""; for(String state : states){ for(Character c : alphabet){ r += " state: " + state + " readig: " + c + " goes to " + read(state, c) + "\n"; } } return r; } }
true
833708f4d8a09ee8165d88b34ee1da2cd98d9e99
Java
cha63506/CompSecurity
/lyft-source/src/me/lyft/android/ui/passenger/PassengerClassicRideInProgressView.java
UTF-8
16,452
1.523438
2
[]
no_license
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package me.lyft.android.ui.passenger; import android.content.Context; import android.content.res.Resources; import android.text.Html; import android.util.AttributeSet; import android.widget.ImageButton; import android.widget.RelativeLayout; import android.widget.TextView; import butterknife.ButterKnife; import com.lyft.scoop.Scoop; import me.lyft.android.analytics.ScreenAnalytics; import me.lyft.android.application.geo.IGeoService; import me.lyft.android.application.passenger.IPassengerRideProvider; import me.lyft.android.common.AppFlow; import me.lyft.android.common.DialogFlow; import me.lyft.android.common.Objects; import me.lyft.android.common.Strings; import me.lyft.android.common.Unit; import me.lyft.android.controls.Toolbar; import me.lyft.android.domain.location.Location; import me.lyft.android.domain.location.NullLocation; import me.lyft.android.domain.location.SphericalUtils; import me.lyft.android.domain.passenger.Driver; import me.lyft.android.domain.passenger.PassengerRide; import me.lyft.android.features.FeatureFlag; import me.lyft.android.features.Features; import me.lyft.android.rx.AsyncCall; import me.lyft.android.rx.Binder; import me.lyft.android.rx.MessageBus; import me.lyft.android.rx.ReactiveProperty; import me.lyft.android.ui.HeightObservableLayout; import me.lyft.android.ui.SlideMenuController; import me.lyft.android.ui.ride.RideMap; import rx.functions.Action1; // Referenced classes of package me.lyft.android.ui.passenger: // PassengerRideAddressInput, RideInProgressBottomView, PassengerActiveRideZoomingController public class PassengerClassicRideInProgressView extends RelativeLayout { AppFlow appFlow; private Binder binder; MessageBus bus; ImageButton centerToCurrentLocationButton; private ReactiveProperty destinationChange; DialogFlow dialogFlow; private ReactiveProperty driverLocationSubject; TextView driverNameTextView; TextView driverRatingTextView; private ReactiveProperty driverSubject; IGeoService geoService; private ReactiveProperty isAccepted; private ReactiveProperty isArrived; private ReactiveProperty isPickedup; private Action1 onDestinationChange; private Action1 onDriverChange; private Action1 onDriverLocationChanged; private final Action1 onMapLoaded = new Action1() { final PassengerClassicRideInProgressView this$0; public volatile void call(Object obj) { call((Unit)obj); } public void call(Unit unit) { if (Features.ENABLE_PASSENGER_RIDE_MAP_TRAFFIC.isEnabled()) { rideMap.enableTraffic(); } rideMap.bindPadding(passengerRideTop, passengerRideBottom); passengerActiveRideZoomingController.attach(centerToCurrentLocationButton); ScreenAnalytics.trackScreenView("passenger_regular_ride_in_progress"); rideMap.setGesturesEnabled(true); binder.bind(passengerRideProvider.observeRideUpdateEvent(), onRideUpdated); binder.bind(driverSubject, onDriverChange); binder.bind(destinationChange, onDestinationChange); binder.bind(pickupChange, updatePickupMarkerAndLocation); binder.bind(passengerRideAddressInput.observePickupClick(), new Action1() { final _cls3 this$1; public volatile void call(Object obj) { call((Unit)obj); } public void call(Unit unit) { dialogFlow.show(new PassengerDialogs.LockAddressDialog(true)); } { this$1 = _cls3.this; super(); } }); binder.bind(passengerRideAddressInput.observeDropoffClick(), new Action1() { final _cls3 this$1; public volatile void call(Object obj) { call((Unit)obj); } public void call(Unit unit) { appFlow.goTo(new me.lyft.android.ui.placesearch.PlaceSearchScreens.PassengerSetDropoffSearch()); } { this$1 = _cls3.this; super(); } }); binder.bind(driverLocationSubject, onDriverLocationChanged); binder.bind(toolbar.observeItemClick(), onMenuItemClicked); } { this$0 = PassengerClassicRideInProgressView.this; super(); } }; private final Action1 onMenuItemClicked = new Action1() { final PassengerClassicRideInProgressView this$0; public void call(Integer integer) { switch (integer.intValue()) { default: return; case 2131558433: dialogFlow.show(new PassengerDialogs.PassengerRideOverflowMenuScreen()); break; } } public volatile void call(Object obj) { call((Integer)obj); } { this$0 = PassengerClassicRideInProgressView.this; super(); } }; final Action1 onRideUpdated = new Action1() { final PassengerClassicRideInProgressView this$0; public volatile void call(Object obj) { call((Unit)obj); } public void call(Unit unit) { driverSubject.onNext(passengerRideProvider.getPassengerRide().getDriver()); passengersSubject.onNext(passengerRideProvider.getPassengerRide().getPassengers()); driverLocationSubject.onNext(passengerRideProvider.getPassengerRide().getDriver().getLocation()); isPickedup.onNext(passengerRideProvider.getPassengerRide().isPickedUp()); isAccepted.onNext(passengerRideProvider.getPassengerRide().isAccepted()); destinationChange.onNext(passengerRideProvider.getPassengerRide().getDropoff()); pickupChange.onNext(passengerRideProvider.getPassengerRide().getPickup()); isArrived.onNext(passengerRideProvider.getPassengerRide().isArrived()); routeChangedSubject.onNext(passengerRideProvider.getPassengerRide().getStops()); updateRideBannerText(passengerRideProvider.getPassengerRide()); if (passengerRideProvider.getPassengerRide().shouldHideLocationMarker()) { rideMap.hideLocation(); return; } else { rideMap.displayLocation(); return; } } { this$0 = PassengerClassicRideInProgressView.this; super(); } }; PassengerActiveRideZoomingController passengerActiveRideZoomingController; PassengerRideAddressInput passengerRideAddressInput; HeightObservableLayout passengerRideBottom; IPassengerRideProvider passengerRideProvider; HeightObservableLayout passengerRideTop; private ReactiveProperty passengersSubject; private ReactiveProperty pickupChange; RideInProgressBottomView rideDetailsView; RideMap rideMap; TextView rideStatusTxt; private ReactiveProperty routeChangedSubject; SlideMenuController slideMenuController; Toolbar toolbar; private Action1 updatePickupMarkerAndLocation; public PassengerClassicRideInProgressView(Context context, AttributeSet attributeset) { super(context, attributeset); isAccepted = ReactiveProperty.create(); isArrived = ReactiveProperty.create(); isPickedup = ReactiveProperty.create(); driverLocationSubject = ReactiveProperty.create(NullLocation.getInstance()); destinationChange = ReactiveProperty.create().setEqualityComparator(new me.lyft.android.rx.ReactiveProperty.EqualityComparator() { final PassengerClassicRideInProgressView this$0; public volatile boolean equals(Object obj, Object obj1) { return equals((Location)obj, (Location)obj1); } public boolean equals(Location location, Location location1) { return location != null && location1 != null && SphericalUtils.latLngApproximateEquals(location, location1); } { this$0 = PassengerClassicRideInProgressView.this; super(); } }); driverSubject = ReactiveProperty.create().setEqualityComparator(new me.lyft.android.rx.ReactiveProperty.EqualityComparator() { final PassengerClassicRideInProgressView this$0; public volatile boolean equals(Object obj, Object obj1) { return equals((Driver)obj, (Driver)obj1); } public boolean equals(Driver driver, Driver driver1) { return driver != null && driver1 != null && Objects.equals(driver.getId(), driver1.getId()); } { this$0 = PassengerClassicRideInProgressView.this; super(); } }); routeChangedSubject = ReactiveProperty.create(); pickupChange = ReactiveProperty.create(); passengersSubject = ReactiveProperty.create(); onDestinationChange = new Action1() { final PassengerClassicRideInProgressView this$0; public volatile void call(Object obj) { call((Location)obj); } public void call(Location location) { rideMap.showDestinationMarker(passengerRideProvider.getPassengerRide().getDropoff()); if (location.isNull()) { passengerRideAddressInput.setDropoffAddress(""); } else if (Strings.isNullOrEmpty(location.getDisplayName())) { passengerRideAddressInput.setDropoffAddress(getResources().getString(0x7f070064)); } else { passengerRideAddressInput.setDropoffAddress(location.getDisplayName()); } if (location.isNull()) { passengerRideAddressInput.focusAndStretchDropoffAddress(); return; } else { passengerRideAddressInput.focusAndStretchPickupAddress(); return; } } { this$0 = PassengerClassicRideInProgressView.this; super(); } }; onDriverChange = new Action1() { final PassengerClassicRideInProgressView this$0; public volatile void call(Object obj) { call((Driver)obj); } public void call(Driver driver) { rideDetailsView.setDriver(passengerRideProvider.getPassengerRide().getDriver()); driverNameTextView.setText(passengerRideProvider.getPassengerRide().getDriver().getName()); driver = passengerRideProvider.getPassengerRide().getDriver().getRating(); if (driver == null) { driver = getResources().getString(0x7f07020c); } else { driver = driver.toString(); } driverRatingTextView.setText(driver); } { this$0 = PassengerClassicRideInProgressView.this; super(); } }; updatePickupMarkerAndLocation = new Action1() { final PassengerClassicRideInProgressView this$0; public volatile void call(Object obj) { call((Location)obj); } public void call(Location location) { rideMap.showPickupMarker(passengerRideProvider.getPassengerRide().getPickup()); if (Strings.isNullOrEmpty(location.getDisplayName())) { passengerRideAddressInput.setPickupAddress(getResources().getString(0x7f07023e)); return; } else { passengerRideAddressInput.setPickupAddress(location.getDisplayName()); return; } } { this$0 = PassengerClassicRideInProgressView.this; super(); } }; onDriverLocationChanged = new Action1() { final PassengerClassicRideInProgressView this$0; public volatile void call(Object obj) { call((Location)obj); } public void call(Location location) { rideMap.refreshDriverMarker(); } { this$0 = PassengerClassicRideInProgressView.this; super(); } }; Scoop.a(this).b(this); } private void updateDriverETA() { PassengerRide passengerride = passengerRideProvider.getPassengerRide(); binder.bind(geoService.getDriverEta(passengerride.getId(), passengerride.getDriver().getLocation(), new Location[] { passengerride.getPickup() }), new AsyncCall() { final PassengerClassicRideInProgressView this$0; public void onFail(Throwable throwable) { rideStatusTxt.setText(getResources().getString(0x7f070225)); } public void onSuccess(Long long1) { rideStatusTxt.setText(Html.fromHtml(getResources().getString(0x7f070224, new Object[] { long1 }))); } public volatile void onSuccess(Object obj) { onSuccess((Long)obj); } { this$0 = PassengerClassicRideInProgressView.this; super(); } }); } private void updateRideBannerText(PassengerRide passengerride) { if (passengerride.isAccepted().booleanValue()) { updateDriverETA(); return; } if (passengerride.isArrived().booleanValue()) { rideStatusTxt.setText(0x7f070223); return; } if (passengerride.isPickedUp().booleanValue()) { rideStatusTxt.setText(0x7f070239); return; } else { rideStatusTxt.setText(0x7f07023a); return; } } protected void onAttachedToWindow() { super.onAttachedToWindow(); if (isInEditMode()) { return; } else { binder = Binder.attach(this); slideMenuController.enableMenu(); toolbar.addItem(0x7f0d0021, 0x7f02018c); toolbar.showDivider(); passengerRideAddressInput.setVisibility(0); centerToCurrentLocationButton.setVisibility(0); passengerRideAddressInput.showPickupAndDropoff(); rideDetailsView.setPassengers(passengerRideProvider.getPassengerRide().getPassengers()); binder.bind(rideMap.observeMapLoaded(), onMapLoaded); return; } } protected void onDetachedFromWindow() { super.onDetachedFromWindow(); passengerActiveRideZoomingController.detach(); slideMenuController.disableMenu(); rideMap.disableTraffic(); rideMap.clearAllMarkers(); rideMap.clearRoutes(); rideMap.displayLocation(); rideMap.reset(); } protected void onFinishInflate() { super.onFinishInflate(); if (isInEditMode()) { return; } else { ButterKnife.a(this); return; } } }
true
56ce6abafd6e0d1ebb4b0dbcb5cbffc2612d9773
Java
anishrajan25/Leetcode
/430 Flatten a Multilevel Doubly Linked List.java
UTF-8
920
3.265625
3
[]
no_license
// https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/ /* // Definition for a Node. class Node { public int val; public Node prev; public Node next; public Node child; }; */ class Solution { public Node flatten(Node head) { if(head == null) return null; Node tmp = head; while(tmp != null) { if(tmp.child != null) { Node r = flatten(tmp.child); Node t = tmp.next; while(r.next != null) { r = r.next; } if(t != null) { r.next = t; t.prev = r; } tmp.next = tmp.child; tmp.child.prev = tmp; tmp.child = null; tmp = r.next; } else tmp = tmp.next; } return head; } }
true
527e8c0d6a2d25cf7bbd051e815c9a87f7fd62aa
Java
pengchengming/myCode
/PcmBlog/PcmBlog/src/main/java/cn/pcm/dao/UserDaoImpl.java
UTF-8
2,047
2.5625
3
[]
no_license
package cn.pcm.dao; import java.util.List; import javax.annotation.Resource; import cn.pcm.domain.User; import org.hibernate.Query; import org.hibernate.SessionFactory; import org.springframework.stereotype.Repository; @Repository("userDao") public class UserDaoImpl implements UserDao { @Resource(name="sessionFactory") private SessionFactory sessionFactory; @Override public User getUser(String userName,String password) { String hql = "from User u where u.userName=? and u.password=?"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setString(0, userName); query.setString(1, password); return (User) query.uniqueResult(); } @Override public User getUser(String userName) { String hql = "from User u where u.userName=? "; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setString(0, userName); return (User) query.uniqueResult(); } @Override public List<User> getAllUser() { String hql = "from User"; Query query = sessionFactory.getCurrentSession().createQuery(hql); return query.list(); } @Override public void addUser(User user) { sessionFactory.getCurrentSession().save(user); } @Override public boolean delUser(String id) { String hql = "delete User u where u.id = ?"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setString(0, id); return (query.executeUpdate() > 0); } @Override public boolean updateUserEmail(User user) { String hql = "update User u set u.email = ? where u.id=?"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setString(0, user.getEmail()); query.setString(1, user.getId()); return (query.executeUpdate() > 0); } @Override public boolean updateUserPassword(User user) { String hql = "update User u set u.password = ? where u.id=?"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setString(0, user.getPassword()); query.setString(1, user.getId()); return (query.executeUpdate() > 0); } }
true
deafd320dc76e114470d67d23579e92a80bd5eca
Java
Team-DegreeProject/-SQL
/OurSql/src/execution/table/TruncateTableStatement.java
UTF-8
980
2.609375
3
[]
no_license
package execution.table; import execution.ExecuteStatement; import parsing.Token; import table.BTree.BPlusTreeTool; import table.BTree.CglibBean; import table.Table; import java.util.List; //4 TRUNCATE TABLE 删除表中所有数据 //4.1 TRUNCATE tbname; public class TruncateTableStatement { public List statement; public TruncateTableStatement(List tokens){ statement=tokens; } public boolean truncateTableImpl() throws Exception { String name=((Token)statement.get(1)).image; Table database= ExecuteStatement.db.getDatabase(); List<CglibBean> cl=BPlusTreeTool.getParticularAttribute(database,"tablename",name); if(cl.size()<1){ throw new Exception("There is no table needed to be truncated."); } for(int i=0;i<cl.size();i++){ CglibBean c=cl.get(i); // Table t= (Table) c.getValue("table"); // t.cleanAllData(); } return true; } }
true
a6b5b22b2e9892ccc6af61ae3d8a4225f14563e0
Java
WilsonZhang8/framework
/framework-web/framework-base-webapp/src/main/java/com/zghw/framework/base/controller/HelloBaseController.java
UTF-8
1,272
2.140625
2
[]
no_license
package com.zghw.framework.base.controller; import java.io.IOException; import java.util.Random; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.alibaba.dubbo.common.json.JSON; import com.zghw.framework.base.service.api.IHelloBaseService; import com.zghw.framework.common.util.StringRandom; import com.zghw.framework.entity.base.HelloBase; @RequestMapping("base/helloBase") @Controller public class HelloBaseController { private IHelloBaseService helloBaseService; @RequestMapping(value = "/save") public @ResponseBody String save(HttpServletRequest request) throws IOException { for (int i = 0; i < 10000000; i++) { Integer hits = new Random().nextInt(1000000); HelloBase helloBase = new HelloBase(); helloBase.setName(StringRandom.getStringRandom(50) + hits); helloBase.setHits(hits); helloBase = helloBaseService.save(helloBase); } return JSON.json(null); } @Autowired public void setHelloBaseService(IHelloBaseService helloBaseService) { this.helloBaseService = helloBaseService; } }
true
f877439f8bb95c2a62ce9f64a14c935fd595d37d
Java
Stewmath/WL3-Editor
/src/dialogs/AddRegionDialog.java
UTF-8
1,021
2.84375
3
[]
no_license
package dialogs; import graphics.*; import javax.swing.*; import java.awt.Dialog; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class AddRegionDialog extends JDialog { JTextField sectorField; JButton okButton; public AddRegionDialog(JFrame parent) { super(parent, "Add Region", Dialog.ModalityType.APPLICATION_MODAL); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); JLabel label1 = new JLabel("If nothing warps to this region,"); JLabel label2 = new JLabel("it will not be saved."); label1.setAlignmentX(Component.CENTER_ALIGNMENT); label2.setAlignmentX(Component.CENTER_ALIGNMENT); contentPane.add(label1); contentPane.add(label2); sectorField = new JTextField(); contentPane.add(new LabelWithComponent( new JLabel("Top-left sector: "), sectorField )); add(contentPane); pack(); setVisible(true); } }
true
157ce2758c3dc36e0fd065669a2bd5aefba1d25b
Java
zengqingfa88/activiti-in-action-code
/chapter7-spring-boot/src/main/java/me/kafeitu/activiti/chapter7/spring/boot/ActivitiController.java
UTF-8
2,392
2.1875
2
[ "Apache-2.0" ]
permissive
package me.kafeitu.activiti.chapter7.spring.boot; import org.activiti.engine.ManagementService; import org.activiti.engine.RepositoryService; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import java.util.List; import java.util.Map; /** * @author: Henry Yan */ @Controller @RequestMapping("/activiti") public class ActivitiController { @Autowired ManagementService managementService; @Autowired RepositoryService repositoryService; @Autowired RuntimeService runtimeService; @Autowired TaskService taskService; @ResponseBody @RequestMapping("/engine/info") public Map<String, String> engineProperties() { return managementService.getProperties(); } @RequestMapping("/processes") public ModelAndView processes() { ModelAndView mav = new ModelAndView("processes"); List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().list(); mav.addObject("processes", list); return mav; } @RequestMapping("/process/start/{processDefinitionId}") public String startProcess(@PathVariable("processDefinitionId") String processDefinitionId) { ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId); System.out.println("成功启动了流程:" + processInstance.getId()); return "redirect:/activiti/tasks"; } @RequestMapping("/tasks") public ModelAndView tasks() { ModelAndView mav = new ModelAndView("tasks"); List<Task> list = taskService.createTaskQuery().list(); mav.addObject("tasks", list); return mav; } @RequestMapping("/task/complete/{taskId}") public String completeTask(@PathVariable("taskId") String taskId) { taskService.complete(taskId); return "redirect:/activiti/tasks"; } }
true
12cbbdc309d44b68e9e2792ddc840b98e8c6c4c1
Java
xeruvimov/haulmont-test-task
/src/main/java/com/haulmont/testtask/data/entity/Order.java
UTF-8
2,669
2.484375
2
[]
no_license
package com.haulmont.testtask.data.entity; import javax.persistence.*; import java.util.Date; @Entity @Table(name = "CONTRACT") // "ORDER" is a reserved keyword @NamedQueries({ @NamedQuery(name = "Order.findAll", query = "select o from Order o"), @NamedQuery(name = "Order.findById", query = "select o from Order o where id = :id"), @NamedQuery(name = "Order.findByMechanic", query = "select o from Order o where mechanic = :mechanic") }) public class Order { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ManyToOne @JoinColumn(name = "client_id") private Client client; @ManyToOne @JoinColumn(name = "mechanic_id") private Mechanic mechanic; @Column(name = "description") private String description; @Column(name = "start_date") @Temporal(TemporalType.DATE) private Date startDate; @Column(name = "end_date") @Temporal(TemporalType.DATE) private Date endDate; @Column(name = "price") private Integer price; @Column(name = "status") @Enumerated(EnumType.STRING) private Status status; public Long getId() { return id; } public Client getClient() { return client; } public void setClient(Client client) { this.client = client; } public Mechanic getMechanic() { return mechanic; } public void setMechanic(Mechanic mechanic) { this.mechanic = mechanic; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } public Date getEndDate() { return endDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } public Status getStatus() { return status; } public void setStatus(Status status) { this.status = status; } @Override public String toString() { return "Order{" + "id=" + id + ", client=" + client + ", mechanic=" + mechanic + ", description='" + description + '\'' + ", startDate=" + startDate + ", endDate=" + endDate + ", price=" + price + ", status=" + status + '}'; } }
true
a9c23a557009c418416f7f70fbacce61bfef3f7c
Java
tayanzhuifeng/spring-boot-inside
/demo-classloader-context/src/main/java/com/example/democlassloadercontext/HomeController.java
UTF-8
597
1.929688
2
[ "MIT" ]
permissive
package com.example.democlassloadercontext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.example.democlassloadercontext.utils.ContextUtils; @Controller public class HomeController { @Autowired ApplicationContext context; @RequestMapping("/") @ResponseBody public String context() { return ContextUtils.treeHtml(context); } }
true
9f4dbc626e5668403cc186c96cba80625081f132
Java
geom4rios/producer-consumer
/src/test/java/com/geom4rios/javaproducerconsumer/producer/ProducerRunnerTest.java
UTF-8
3,638
2.125
2
[ "Apache-2.0" ]
permissive
package com.geom4rios.javaproducerconsumer.producer; import com.geom4rios.javaproducerconsumer.Engine; import com.geom4rios.javaproducerconsumer.config.ProducerConsumerTestConfiguration; import com.geom4rios.javaproducerconsumer.task.Task; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Import; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @Import(ProducerConsumerTestConfiguration.class) @SpringBootTest(classes = {Logger.class, Engine.class}) class ProducerRunnerTest { @Autowired Engine engine; @Autowired Logger log; @Autowired @Qualifier("ioProducer") Producer ioProducer; @Autowired @Qualifier("cpuProducer") Producer cpuProducer; @Autowired @Qualifier("memoryProducer") Producer memoryProducer; @BeforeEach public void setUp() { engine.concurrentLinkedDeque.clear(); } @Test @DisplayName("Test ProducerRunner for io tasks") public void testProducerRunnerForIOTasks() { List<Task> expectedTasks = ioProducer.createNewTasks(); int expectedTasksWrittenOnSharedQueue = expectedTasks.size(); log.info("Create the IO ProducerRunner"); ProducerRunner ioProducerRunner = new ProducerRunner(engine, ioProducer, log); log.info("Run ProducerRunner with a producer containing only IO tasks"); ioProducerRunner.run(); log.info("Assert that the producer tasks are written correctly into the shared queue"); assertThat(engine.concurrentLinkedDeque.size()).isEqualTo(expectedTasksWrittenOnSharedQueue); engine.concurrentLinkedDeque.forEach(t -> assertThat(expectedTasks.contains(t))); } @Test @DisplayName("Test ProducerRunner for cpu tasks") public void testProducerRunnerForCpuTasks() { List<Task> expectedTasks = cpuProducer.createNewTasks(); int expectedTasksWrittenOnSharedQueue = expectedTasks.size(); log.info("Create the CPU ProducerRunner"); ProducerRunner cpuProducerRunner = new ProducerRunner(engine, cpuProducer, log); log.info("Run ProducerRunner with a producer containing only CPU tasks"); cpuProducerRunner.run(); log.info("Assert that the producer tasks are written correctly into the shared queue"); assertThat(engine.concurrentLinkedDeque.size()).isEqualTo(expectedTasksWrittenOnSharedQueue); engine.concurrentLinkedDeque.forEach(t -> assertThat(expectedTasks.contains(t))); } @Test @DisplayName("Test ProducerRunner for memory tasks") public void testProducerRunnerForMemoryTasks() { List<Task> expectedTasks = memoryProducer.createNewTasks(); int expectedTasksWrittenOnSharedQueue = expectedTasks.size(); log.info("Create the Memory ProducerRunner"); ProducerRunner memoryProducerRunner = new ProducerRunner(engine, memoryProducer, log); log.info("Run ProducerRunner with a producer containing only Memory tasks"); memoryProducerRunner.run(); log.info("Assert that the producer tasks are written correctly into the shared queue"); assertThat(engine.concurrentLinkedDeque.size()).isEqualTo(expectedTasksWrittenOnSharedQueue); engine.concurrentLinkedDeque.forEach(t -> assertThat(expectedTasks.contains(t))); } }
true
6f5e86cf27d848abc5f4df125ed8c7a0a857f7a3
Java
barun-coder/tokensystem
/app/src/main/java/com/displayfort/dftoken/data/remote/ApiEndPoint.java
UTF-8
1,281
1.585938
2
[]
no_license
package com.displayfort.dftoken.data.remote; /** * Created by Yogesh on 07/07/17. */ public final class ApiEndPoint { // public static final String ENDPOINT_SERVER_LICENSE = BuildConfig.BASE_URL + "login/licence"; // public static final String ENDPOINT_SERVER_TOKEN_SKIP = BuildConfig.BASE_URL + "token/token/"; // static final String ENDPOINT_SERVER_LOGIN = BuildConfig.BASE_URL + "login/ThirdParty"; // static final String ENDPOINT_SERVER_TOKEN_STATUS = BuildConfig.BASE_URL + "token/token/"; // static final String ENDPOINT_SERVER_GET_TOKEN_SKIP= BuildConfig.BASE_URL + "token/token/token_id:"; // static final String ENDPOINT_SERVER_GET_NEW_TOKEN_SKIP= BuildConfig.BASE_URL + "token/token/subcounter_id:"; public static final String ENDPOINT_SERVER_LICENSE ="login/licence"; public static final String ENDPOINT_SERVER_TOKEN_SKIP ="token/token/"; static final String ENDPOINT_SERVER_LOGIN ="login/ThirdParty"; static final String ENDPOINT_SERVER_TOKEN_STATUS ="token/token/"; static final String ENDPOINT_SERVER_GET_TOKEN_SKIP="token/token/token_id:"; static final String ENDPOINT_SERVER_GET_NEW_TOKEN_SKIP="token/token/subcounter_id:"; private ApiEndPoint() { // This class is not publicly instantiable } }
true
ffaaf6d2d24b27e46ef661407d367514cfbfbe69
Java
ViacheslavKr/cinema
/src/main/java/com/krukovskyi/movie/rest/ReportingRestController.java
UTF-8
2,281
2.09375
2
[]
no_license
package com.krukovskyi.movie.rest; import com.krukovskyi.movie.models.Cinema; import com.krukovskyi.movie.models.reports.BoxOfficeReport; import com.krukovskyi.movie.models.reports.GapReport; import com.krukovskyi.movie.services.ReportingService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import java.util.Date; import java.util.List; @Controller @RequestMapping("/api/reports") public class ReportingRestController { @Autowired private ReportingService service; @RequestMapping(method = RequestMethod.GET, value = "/cinema") @ResponseBody public List<Cinema> getCinemaGreaterThanShowing(@RequestParam("showingThreshold") Long showingThreshold, @RequestParam("beginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date beginDate, @RequestParam("endDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date endDate) { return service.findCinemaByShowings(showingThreshold, beginDate, endDate); } @RequestMapping(method = RequestMethod.GET, value = "/{cinemaId}/gaps") @ResponseBody public GapReport getCinemaShowingGaps(@PathVariable Long cinemaId, @RequestParam("beginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date beginDate, @RequestParam("endDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date endDate) { return service.findCinemaShowingGaps(cinemaId, beginDate, endDate); } @RequestMapping(method = RequestMethod.GET, value = "/box/{cinemaId}/{movieId}") @ResponseBody public BoxOfficeReport getBoxOffice(@PathVariable Long cinemaId, @PathVariable Long movieId, @RequestParam("beginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date beginDate, @RequestParam("endDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date endDate) { return service.getBoxOffice(cinemaId, movieId, beginDate, endDate); } }
true
728e6af0f7177d31ca2db4df48c0a42b6f928e71
Java
ctalau/web-author-diff-plugin
/src/main/java/com/oxygenxml/webapp/diff/DiffPlugin.java
UTF-8
312
1.5
2
[]
no_license
package com.oxygenxml.webapp.diff; import ro.sync.exml.plugin.Plugin; import ro.sync.exml.plugin.PluginDescriptor; /** * Plugin class - needed to execute author operations. * * @author ctalau */ public class DiffPlugin extends Plugin { public DiffPlugin(PluginDescriptor desc) { super(desc); } }
true
d97448e159b17f5b2ad51def32a124e833a1a86a
Java
REBOOTERS/NetDiscovery
/core/src/main/java/com/cv4j/netdiscovery/core/queue/filter/DuplicateFilter.java
UTF-8
496
2.21875
2
[ "Apache-2.0" ]
permissive
package com.cv4j.netdiscovery.core.queue.filter; import com.cv4j.netdiscovery.core.domain.Request; /** * Created by tony on 2018/1/3. */ public interface DuplicateFilter { /** * * Check whether the request is duplicate. * * @param request request * @return true if is duplicate */ boolean isDuplicate(Request request); /** * Get TotalRequestsCount for monitor. * @return number of total request */ int getTotalRequestsCount(); }
true
973f84ef51c16cf2f158bf8d52a5865fb04403bf
Java
Yashas-Kantharaj/Niit-java
/work/src/Game/Player.java
UTF-8
1,668
3.171875
3
[]
no_license
package Game; import java.io.IOException; import java.util.Scanner; class Player extends Board{ int player = 0; int i; int choice; char mark,ch; void playermoves() { do{ Createboard(); Scanner in = new Scanner(System.in); player = (player % 2 == 0) ? 1 : 2; System.out.print("Player "+player+", enter a number: " ); int choice = in.nextInt(); mark = (player == 1) ? 'X' : 'O'; if (choice == 1 && square[1] == '1') square[1] = mark; else if (choice == 2 && square[2] == '2') square[2] = mark; else if (choice == 3 && square[3] == '3') square[3] = mark; else if (choice == 4 && square[4] == '4') square[4] = mark; else if (choice == 5 && square[5] == '5') square[5] = mark; else if (choice == 6 && square[6] == '6') square[6] = mark; else if (choice == 7 && square[7] == '7') square[7] = mark; else if (choice == 8 && square[8] == '8') square[8] = mark; else if (choice == 9 && square[9] == '9') square[9] = mark; else { System.out.println("Invalid move press any key to continue"); player--; try { char ch = (char) System.in.read(); } catch (IOException e) { e.printStackTrace(); }; } i = checkwin(); }while (i == - 1); Createboard(); if (i == 1) System.out.println("\n==>Player "+player+" win"); else System.out.println("\n==>Game draw"); System.out.println("Press any key to Terminate"); try { char ch = (char) System.in.read(); } catch (IOException e) { e.printStackTrace(); } } }
true
69c89b7578be5fe4b74730a7e2a663248ba05b50
Java
alexslo/CBP
/app/src/main/java/com/example/alex/cbp/CameraWBTest.java
UTF-8
7,440
2.109375
2
[]
no_license
package com.example.alex.cbp; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Configuration; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.ViewGroup.LayoutParams; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.view.View; import android.hardware.Camera; import android.hardware.Camera.Size; import android.hardware.Camera.PictureCallback; import android.hardware.Camera.AutoFocusCallback; import android.hardware.Camera.PreviewCallback; import android.widget.TextView; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class CameraWBTest extends Activity implements SurfaceHolder.Callback, View.OnClickListener { private Camera camera; private SurfaceHolder surfaceHolder; private SurfaceView preview; private Button shotBtn; private TextView photoNumber; private int pictureCounter = 0; public static final String saveFolderPatch = "/sdcard/CBP/"; public static final String testPictureName = "WB_TEST_PHOTO"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Полноэкранность getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); // Без заголовка requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activiti_camera_wb_test); //Аллерт AlertDialog.Builder builder = new AlertDialog.Builder(CameraWBTest.this); builder.setTitle(R.string.wb_notification_title) .setMessage(R.string.wb_notification_text) .setIcon(R.drawable.ic_launcher) .setCancelable(true) .setNegativeButton(R.string.wb_notification_button, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); preview = (SurfaceView) findViewById(R.id.surfaceView); surfaceHolder = preview.getHolder(); surfaceHolder.addCallback(this); // Для старых API surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); shotBtn = (Button) findViewById(R.id.shot_button); shotBtn.setOnClickListener(this); photoNumber = (TextView) findViewById(R.id.number_photo); photoNumber.setText(Integer.toString(3)); } @Override protected void onResume() { super.onResume(); camera = Camera.open(); photoNumber.setText(Integer.toString(3)); shotBtn.setClickable(true); } @Override protected void onPause() { super.onPause(); if (camera != null) { camera.setPreviewCallback(null); camera.stopPreview(); camera.release(); camera = null; } photoNumber.setText(Integer.toString(3)); shotBtn.setClickable(true); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { } @Override public void surfaceCreated(SurfaceHolder holder) { try { camera.setPreviewDisplay(holder); camera.setPreviewCallback(previewCallbacknew); } catch (IOException e) { e.printStackTrace(); } Size previewSize = camera.getParameters().getPreviewSize(); float aspect = (float) previewSize.width / previewSize.height; int previewSurfaceWidth = preview.getWidth(); int previewSurfaceHeight = preview.getHeight(); LayoutParams lp = preview.getLayoutParams(); // корректируем размер отображаемого preview, чтобы не было искажений if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) { // портретный вид camera.setDisplayOrientation(90); lp.height = previewSurfaceHeight; lp.width = (int) (previewSurfaceHeight / aspect); } else { // ландшафтный camera.setDisplayOrientation(0); lp.width = previewSurfaceWidth; lp.height = (int) (previewSurfaceWidth / aspect); } preview.setLayoutParams(lp); camera.startPreview(); } @Override public void surfaceDestroyed(SurfaceHolder holder) { } @Override public void onClick(View v) { if (v == shotBtn) { shotBtn.setClickable(false); pictureCounter = 0; camera.autoFocus(autoFocusCallback); camera.takePicture(null, null, null, jpegCallback); } } PictureCallback jpegCallback = new PictureCallback() { public void onPictureTaken(byte[] paramArrayOfByte, Camera paramCamera) { // сохраняем полученные jpg в папке /sdcard/CameraExample/ // имя файла - System.currentTimeMillis() try { File saveDir = new File(saveFolderPatch); if (!saveDir.exists()) { saveDir.mkdirs(); } FileOutputStream os = new FileOutputStream(saveFolderPatch + testPictureName + pictureCounter + ".jpg"); os.write(paramArrayOfByte); os.close(); } catch (Exception e) { } // после того, как снимок сделан, показ превью отключается. необходимо включить его paramCamera.startPreview(); // делаем по 3 фото за раз pictureCounter++; photoNumber.setText(Integer.toString(3 - pictureCounter)); if (pictureCounter < 3) { camera.cancelAutoFocus(); camera.autoFocus(autoFocusCallback); camera.takePicture(null, null, null, jpegCallback); } if (pictureCounter == 3) { Intent intent = new Intent(CameraWBTest.this, DynTestResult.class); startActivity(intent); } } }; AutoFocusCallback autoFocusCallback = new AutoFocusCallback() { public void onAutoFocus(boolean paramBoolean, Camera paramCamera) { /* if (paramBoolean) { // если удалось сфокусироваться, делаем снимок //paramCamera.takePicture(null, null, null, this); } */ } }; PreviewCallback previewCallbacknew = new PreviewCallback() { public void onPreviewFrame(byte[] paramArrayOfByte, Camera paramCamera) { // здесь можно обрабатывать изображение, показываемое в preview } }; }
true
7b46ccd8f0ed3c3c354e98c49bddf253d434766a
Java
junges521/src_awe
/src/main/java/com/ss/android/ugc/aweme/commercialize/splash/e.java
UTF-8
1,013
1.664063
2
[]
no_license
package com.ss.android.ugc.aweme.commercialize.splash; import android.animation.ObjectAnimator; import android.view.View; import com.meituan.robust.ChangeQuickRedirect; import com.meituan.robust.PatchProxy; public final /* synthetic */ class e implements Runnable { /* renamed from: a reason: collision with root package name */ public static ChangeQuickRedirect f39461a; /* renamed from: b reason: collision with root package name */ private final View f39462b; e(View view) { this.f39462b = view; } public final void run() { if (PatchProxy.isSupport(new Object[0], this, f39461a, false, 32015, new Class[0], Void.TYPE)) { PatchProxy.accessDispatch(new Object[0], this, f39461a, false, 32015, new Class[0], Void.TYPE); return; } View view = this.f39462b; view.setVisibility(0); view.setAlpha(0.0f); ObjectAnimator.ofFloat(view, "alpha", new float[]{0.0f, 1.0f}).setDuration(430).start(); } }
true
5bf8204eade2e8e49132f2410bf03510b04dd1fb
Java
LvKang-insist/CarSteward
/core/src/main/java/com/car/core/delegate/web/IWebViewInitializer.java
UTF-8
713
1.9375
2
[]
no_license
package com.car.core.delegate.web; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebViewClient; /** * Copyright (C) * * @file: IWebViewInitializer * @author: 345 * @Time: 2019/5/4 15:32 * @description: ${DESCRIPTION} */ public interface IWebViewInitializer { /** * 初始化 * * @param webView 需要初始化的 web * @return webview */ WebView initWebView(WebView webView); /** * 针对浏览器本身行为的一个控制 * * @return */ WebViewClient initWebViewClient(); /** * 针对页面的 一个控制 * * @return */ WebChromeClient initWebChromeClient(); }
true
702f0f2544bd10a42e1d4af5226dd18bff51e717
Java
ac1303/fxtiemo.top
/src/upload/uploadpicture.java
GB18030
3,355
2.421875
2
[]
no_license
package upload; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.Part; import org.apache.commons.lang.StringUtils; /** * Servlet implementation class uploadpicture */ @MultipartConfig(maxFileSize=1024*1024*10) public class uploadpicture extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public uploadpicture() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.getWriter().append("Served at: ").append(request.getContextPath()); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // ñֹ response.setContentType("text/html;charset=UTF-8"); response.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>File Upload Servlet</title>"); out.println("<script src=\"./lib/layui/layui.js\" charset=\"utf-8\"></script>"); out.println("<link rel=\"stylesheet\" href=\"./css/xadmin.css\">"); out.println("<script type=\"text/javascript\" src=\"./js/xadmin.js\"></script>"); out.println("</head>"); out.println("<body>"); out.println("<h1>ļдС</h1>"); String path=configure.Configure.getPath(); String id=request.getParameter("id"); path=path+id+"\\pic\\"; out.println("<p>ļд·Ϊ"+path+":</p><br>"); for(Part part:request.getParts()){ if(part.getName().startsWith("filenam")){ String filename=getFilename(part); out.println("<p>ʼдļ"+filename+";ļСΪ"+part.getSize()+"</p>"); try { part.write(path+filename); } catch (Exception e) { e.printStackTrace(); }finally { File file=new File(path+filename); if(!file.exists()){ out.println(path+filename+"дʧܣԣʧܿϵͳbug"); }else { out.println(path+filename+"дɹ<br><br>"); } } } } out.println("<button onclick=\"window.location.href='close.jsp'\">رղˢ</button>"); out.println("</body>"); out.println("</html>"); } private String getFilename(Part part) { // TODO Auto-generated method stub if(part==null) return null; String fileName=part.getHeader("content-disposition"); if(StringUtils.isBlank(fileName)){ return null; } return StringUtils.substringBetween(fileName, "filename=\"", "\""); } }
true
7b176d253e2d9acdc04ae0870849caa75f78ed77
Java
TylerPierro/Project_0
/src/main/java/gringotts/beans/Transaction.java
UTF-8
3,215
2.953125
3
[]
no_license
package gringotts.beans; import java.io.Serializable; import java.time.LocalDateTime; public class Transaction implements Serializable, Comparable<Transaction> { /** * */ private static final long serialVersionUID = -8083680691197788752L; private double amount; private LocalDateTime date; private String description; public Transaction() { super(); this.amount = 0; this.date = LocalDateTime.now(); this.description = "Unspecified, shady business"; } public Transaction(double amount, LocalDateTime date, String description) { super(); this.amount = amount; this.date = date; if (description.equals("")) this.description = "Unspecified, shady business"; else this.description = description; } public Transaction(double amount, LocalDateTime date) { super(); this.amount = amount; this.date = date; this.setDescription("Unspecified, shady business"); } public Transaction(double amount, String description) { super(); this.amount = amount; if (description.equals("")) this.description = "Unspecified, shady business"; this.description = description; this.setDate(LocalDateTime.now()); } public Transaction(double amount) { super(); this.amount = amount; this.setDescription("Unspecified, shady business"); this.setDate(LocalDateTime.now()); } public double getAmount() { return amount; } public void setAmount(double amount) { this.amount = amount; } public LocalDateTime getDate() { return date; } public void setDate(LocalDateTime date) { this.date = date; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Override public int hashCode() { final int prime = 31; int result = 1; long temp; temp = Double.doubleToLongBits(amount); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + ((date == null) ? 0 : date.hashCode()); result = prime * result + ((description == null) ? 0 : description.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; Transaction other = (Transaction) obj; if (Double.doubleToLongBits(amount) != Double.doubleToLongBits(other.amount)) return false; if (date == null) { if (other.date != null) return false; } else if (!date.equals(other.date)) return false; if (description == null) { if (other.description != null) return false; } else if (!description.equals(other.description)) return false; return true; } @Override public String toString() { return "Transaction [amount=" + amount + ", date=" + date + ", description=" + description + "]\n"; } /*@Override public int compare(Transaction arg0, Transaction arg1) { if (arg0.getDate().compareTo(arg1.getDate()) > 0) return 1; else if (this.getDate().equals(arg1.getDate())) return 0; else return -1; }*/ public int compareTo(Transaction that) { if (this.getDate().compareTo(that.getDate()) > 0) return 1; else if (this.getDate().equals(that.getDate())) return 0; else return -1; } }
true
f8178cb40caf903f24f3a50050ed58b55fecda08
Java
bezjen/MealPlanGenerator
/src/main/java/com/bezjen/whattoeat/model/filter/ReplaceMealModel.java
UTF-8
543
2.171875
2
[]
no_license
package com.bezjen.whattoeat.model.filter; import java.util.ArrayList; import java.util.List; public class ReplaceMealModel extends BaseGeneratorFilterModel { private Integer index; private List<Long> mealsIds; public ReplaceMealModel() { super(); mealsIds = new ArrayList<>(); } public Integer getIndex() { return index; } public void setIndex(Integer index) { this.index = index; } public List<Long> getMealsIds() { return mealsIds; } public void setMealsIds(List<Long> mealsIds) { this.mealsIds = mealsIds; } }
true
794432797d0376e8c0faa4afb14f47c169855313
Java
javaeplanet/CitiesProject
/CitiesProject/src/main/java/com/example/CitiesProject/CitiesProject/controller/BookController.java
UTF-8
1,608
2.4375
2
[]
no_license
package com.example.CitiesProject.CitiesProject.controller; import com.example.CitiesProject.CitiesProject.model.Book; import com.example.CitiesProject.CitiesProject.repos.BookRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.util.List; import java.util.Objects; @RestController public class BookController { @Autowired private BookRepository repository; @PostMapping("/addBook") public Mono<Book> saveBook(@RequestBody Book book){ return repository.save(book); } // @GetMapping("/findAllBooks") // public List<Book> getBooks(){ // return repository.findAll(); // } @GetMapping("/books") public Flux<Book> getAllBooks(){ return repository.findAll(); } @GetMapping("/findAllBooks/{id}") public Mono<Book> getBookById(@PathVariable("id") Integer id){ return repository.findById(id); } @DeleteMapping("/delete/{id}") public Mono<Book> deleteBook(@PathVariable("id") Integer id){ Mono<Void> book = repository.deleteById(id); if(Objects.isNull(book)){ return Mono.empty(); } return getBookById(id).switchIfEmpty(Mono.empty()).filter(Objects::nonNull).flatMap(studentToBeDeleted-> repository.delete(studentToBeDeleted).then(Mono.just(studentToBeDeleted))); } @PutMapping("/update") public Mono<Book> UpdateBook( @RequestBody Book book){ return repository.save(book); } }
true
298eabf3394ed1d57a419949d3015eaa362d8544
Java
altimetrik2019/nasdag-hiring-challenge
/src/main/java/com/nasdaq/nasdaghiringchallenge/repository/SellerRepository.java
UTF-8
324
1.671875
2
[]
no_license
package com.nasdaq.nasdaghiringchallenge.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.nasdaq.nasdaghiringchallenge.model.SellerEntity; @Repository public interface SellerRepository extends JpaRepository<SellerEntity, Integer> { }
true
dfeb0b9ee6a52c771909517b13a98f4a8f7e587f
Java
UntouchedOdin0/buildinggame
/me/stefvanschie/buildinggame/utils/guis/TimeMenu.java
UTF-8
7,297
2.640625
3
[]
no_license
package me.stefvanschie.buildinggame.utils.guis; import java.util.ArrayList; import java.util.List; import me.stefvanschie.buildinggame.managers.arenas.ArenaManager; import me.stefvanschie.buildinggame.utils.Time; import me.stefvanschie.buildinggame.utils.plot.Plot; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; public class TimeMenu { public TimeMenu() {} public void show(Player player) { Inventory inventory = Bukkit.createInventory(null, 18, ChatColor.GREEN + "Time selection"); Plot plot = ArenaManager.getInstance().getArena(player).getPlot(player); //midnight ItemStack midnight = new ItemStack(Material.WATCH, 1); { ItemMeta midnightMeta = midnight.getItemMeta(); midnightMeta.setDisplayName(ChatColor.GREEN + "Midnight"); { List<String> midnightLores = new ArrayList<String>(); midnightLores.add(ChatColor.GRAY + "Set the time of your build to Midnight"); if (plot.getTime() == Time.MIDNIGHT) { midnightLores.add(ChatColor.GOLD + "Currently selected!"); } midnightMeta.setLore(midnightLores); } midnight.setItemMeta(midnightMeta); } //2 AM ItemStack am2 = new ItemStack(Material.WATCH, 1); { ItemMeta am2Meta = am2.getItemMeta(); am2Meta.setDisplayName(ChatColor.GREEN + "2 AM"); { List<String> am2Lores = new ArrayList<String>(); am2Lores.add(ChatColor.GRAY + "Set the time of your build to 2 AM"); if (plot.getTime() == Time.AM2) { am2Lores.add(ChatColor.GOLD + "Currently selected!"); } am2Meta.setLore(am2Lores); } am2.setItemMeta(am2Meta); } //4 AM ItemStack am4 = new ItemStack(Material.WATCH, 1); { ItemMeta am4Meta = am4.getItemMeta(); am4Meta.setDisplayName(ChatColor.GREEN + "4 AM"); { List<String> am4Lores = new ArrayList<String>(); am4Lores.add(ChatColor.GRAY + "Set the time of your build to 4 AM"); if (plot.getTime() == Time.AM4) { am4Lores.add(ChatColor.GOLD + "Currently selected!"); } am4Meta.setLore(am4Lores); } am4.setItemMeta(am4Meta); } //6 AM ItemStack am6 = new ItemStack(Material.WATCH, 1); { ItemMeta am6Meta = am6.getItemMeta(); am6Meta.setDisplayName(ChatColor.GREEN + "6 AM"); { List<String> am6Lores = new ArrayList<String>(); am6Lores.add(ChatColor.GRAY + "Set the time of your build to 6 AM"); if (plot.getTime() == Time.AM6) { am6Lores.add(ChatColor.GOLD + "Currently selected!"); } am6Meta.setLore(am6Lores); } am6.setItemMeta(am6Meta); } //8 AM ItemStack am8 = new ItemStack(Material.WATCH, 1); { ItemMeta am8Meta = am8.getItemMeta(); am8Meta.setDisplayName(ChatColor.GREEN + "8 AM"); { List<String> am8Lores = new ArrayList<String>(); am8Lores.add(ChatColor.GRAY + "Set the time of your build to 8 AM"); if (plot.getTime() == Time.AM8) { am8Lores.add(ChatColor.GOLD + "Currently selected!"); } am8Meta.setLore(am8Lores); } am8.setItemMeta(am8Meta); } //10 AM ItemStack am10 = new ItemStack(Material.WATCH, 1); { ItemMeta am10Meta = am10.getItemMeta(); am10Meta.setDisplayName(ChatColor.GREEN + "10 AM"); { List<String> am10Lores = new ArrayList<String>(); am10Lores.add(ChatColor.GRAY + "Set the time of your build to 10 AM"); if (plot.getTime() == Time.AM10) { am10Lores.add(ChatColor.GOLD + "Currently selected!"); } am10Meta.setLore(am10Lores); } am10.setItemMeta(am10Meta); } //Midday ItemStack midday = new ItemStack(Material.WATCH, 1); { ItemMeta middayMeta = midday.getItemMeta(); middayMeta.setDisplayName(ChatColor.GREEN + "Midday"); { List<String> middayLores = new ArrayList<String>(); middayLores.add(ChatColor.GRAY + "Set the time of your build to Midday"); if (plot.getTime() == Time.MIDDAY) { middayLores.add(ChatColor.GOLD + "Currently selected!"); } middayMeta.setLore(middayLores); } midday.setItemMeta(middayMeta); } //2 PM ItemStack pm2 = new ItemStack(Material.WATCH, 1); { ItemMeta pm2Meta = pm2.getItemMeta(); pm2Meta.setDisplayName(ChatColor.GREEN + "2 PM"); { List<String> pm2Lores = new ArrayList<String>(); pm2Lores.add(ChatColor.GRAY + "Set the time of your build to 2 PM"); if (plot.getTime() == Time.PM2) { pm2Lores.add(ChatColor.GOLD + "Currently selected!"); } pm2Meta.setLore(pm2Lores); } pm2.setItemMeta(pm2Meta); } //4 PM ItemStack pm4 = new ItemStack(Material.WATCH, 1); { ItemMeta pm4Meta = pm4.getItemMeta(); pm4Meta.setDisplayName(ChatColor.GREEN + "4 PM"); { List<String> pm4Lores = new ArrayList<String>(); pm4Lores.add(ChatColor.GRAY + "Set the time of your build to 4 PM"); if (plot.getTime() == Time.PM4) { pm4Lores.add(ChatColor.GOLD + "Currently selected!"); } pm4Meta.setLore(pm4Lores); } pm4.setItemMeta(pm4Meta); } //6 PM ItemStack pm6 = new ItemStack(Material.WATCH, 1); { ItemMeta pm6Meta = pm6.getItemMeta(); pm6Meta.setDisplayName(ChatColor.GREEN + "6 PM"); { List<String> pm6Lores = new ArrayList<String>(); pm6Lores.add(ChatColor.GRAY + "Set the time of your build to 6 PM"); if (plot.getTime() == Time.PM6) { pm6Lores.add(ChatColor.GOLD + "Currently selected!"); } pm6Meta.setLore(pm6Lores); } pm6.setItemMeta(pm6Meta); } //8 PM ItemStack pm8 = new ItemStack(Material.WATCH, 1); { ItemMeta pm8Meta = pm8.getItemMeta(); pm8Meta.setDisplayName(ChatColor.GREEN + "8 PM"); { List<String> pm8Lores = new ArrayList<String>(); pm8Lores.add(ChatColor.GRAY + "Set the time of your build to 8 PM"); if (plot.getTime() == Time.PM8) { pm8Lores.add(ChatColor.GOLD + "Currently selected!"); } pm8Meta.setLore(pm8Lores); } pm8.setItemMeta(pm8Meta); } //10 PM ItemStack pm10 = new ItemStack(Material.WATCH, 1); { ItemMeta pm10Meta = pm10.getItemMeta(); pm10Meta.setDisplayName(ChatColor.GREEN + "10 PM"); { List<String> pm10Lores = new ArrayList<String>(); pm10Lores.add(ChatColor.GRAY + "Set the time of your build to 10 PM"); if (plot.getTime() == Time.PM10) { pm10Lores.add(ChatColor.GOLD + "Currently selected!"); } pm10Meta.setLore(pm10Lores); } pm10.setItemMeta(pm10Meta); } //back ItemStack back = new ItemStack(Material.BOOK, 1); { ItemMeta backMeta = back.getItemMeta(); backMeta.setDisplayName(ChatColor.GREEN + "Back"); { List<String> backLores = new ArrayList<String>(); backLores.add(ChatColor.GRAY + "Go back to the options menu"); backMeta.setLore(backLores); } back.setItemMeta(backMeta); } inventory.setItem(0, midnight); inventory.setItem(1, am2); inventory.setItem(2, am4); inventory.setItem(3, am6); inventory.setItem(4, am8); inventory.setItem(5, am10); inventory.setItem(6, midday); inventory.setItem(7, pm2); inventory.setItem(8, pm4); inventory.setItem(9, pm6); inventory.setItem(10, pm8); inventory.setItem(11, pm10); inventory.setItem(17, back); player.openInventory(inventory); } }
true
910027233221f5e03d885bc631d7932bf269f0a7
Java
irvs/ros_tms
/tms_ur/tms_ur_client/tms_ur_arviewer/src/main/java/com/github/irvs/ros_tms/tms_ur/tms_ur_arviewer/urclientactivity/MyView2.java
UTF-8
7,082
2.0625
2
[]
permissive
package com.github.irvs.ros_tms.tms_ur.tms_ur_arviewer.urclientactivity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PixelFormat; import android.graphics.PorterDuff; import android.util.Log; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.View.OnTouchListener; import android.widget.ImageView; import java.util.ArrayList; public class MyView2 extends SurfaceView implements SurfaceHolder.Callback, OnTouchListener{ //現在認識している家具のID //あまり良い実装ではないがこれでIDをメインノードに伝達する //伝達用メソッド private int furnitureIndex; public int getFurnitureIndex(){ return furnitureIndex; } private final int[] color = { Color.RED, Color.BLUE, Color.GREEN, Color.YELLOW, Color.BLACK, Color.WHITE, Color.GRAY, Color.DKGRAY }; private boolean drawable = false; private float[] x ,y ,z; private float[] px,py,pz; private int found_markers = 0; private int[] ar_code_index; private float[][] resultf; private float[][] mat; private float[] cameraRHF; private float r; private ImageView img; private Bitmap on,off; private ArrayList<String> names; public void setNames(String[] names){ for(String n : names){ this.names.add(n); } } public String getFurnitureName(){ return names.get(furnitureIndex); } //ポップアップ用フラグ private boolean touched; public boolean isTouched(){ return touched; } public void clearTouched(){ touched = false; this.furnitureIndex = 0; this.found_markers = 0; } // public void setFurnitures(ArrayList<TmsdbObject> furnitures){ // this.furnitures = null; // this.furnitures = new ArrayList<TmsdbObject>(); // for(int i=0;i<furnitures.size();i++){ // this.furnitures.add(new TmsdbObject(furnitures.get(i))); // } // } public MyView2(Context context) { super(context); setWillNotDraw(false); // setZOrderOnTop(true);//最前列に // setBackgroundColor(Color.TRANSPARENT);//背景を透明に getHolder().setFormat(PixelFormat.TRANSLUCENT);//透過する getHolder().addCallback(this); px = py = pz = new float[8]; this.ar_code_index = new int[8]; this.resultf = new float[8][16]; this.cameraRHF = new float[16]; x = new float[8]; y = new float[8]; z = new float[8]; r = 50f; setOnTouchListener(this); furnitureIndex = 0; names = new ArrayList<String>(); touched = false; // img = (ImageView)findViewById(R.id.imageView1); } public void setParam(int found_markers, int[] ar_code_index, float[][] resultf, float[] cameraRHF){ drawable = false; this.found_markers = found_markers; System.arraycopy(ar_code_index, 0, this.ar_code_index, 0, found_markers); //set_furnitures_id if(found_markers != 0) furnitureIndex = ar_code_index[0]; else furnitureIndex = 0; for(int i=0;i<found_markers;i++){ System.arraycopy(resultf[i], 0, this.resultf[i], 0, 16); this.ar_code_index[i] = ar_code_index[i]; //x,y,z の 位置計算 x,y,zは-10~10 x[i] = cameraRHF[0] * resultf[i][12] + cameraRHF[4] * resultf[i][13] + cameraRHF[8] * resultf[i][14] + cameraRHF[12] * resultf[i][15]; y[i] = cameraRHF[1] * resultf[i][12] + cameraRHF[5] * resultf[i][13] + cameraRHF[9] * resultf[i][14] + cameraRHF[13] * resultf[i][15]; z[i] = cameraRHF[2] * resultf[i][12] + cameraRHF[6] * resultf[i][13] + cameraRHF[10] * resultf[i][14] + cameraRHF[14] * resultf[i][15]; //0~1.0に変換 x[i] = (x[i] + 10f)/20f; y[i] = (y[i] + 10f)/20f; z[i] = (z[i] + 10f)/20f; //急激に変化しないようフィルタリング filter(x[i],px[i]); filter(y[i],py[i]); filter(z[i],pz[i]); // x[i] = 0.2f*x[i] + 0.8f*px[i]; // y[i] = 0.2f*y[i] + 0.8f*py[i]; // z[i] = 0.2f*z[i] + 0.8f*pz[i]; //px,py,pzに値を代入 px[i] = x[i]; py[i] = y[i]; pz[i] = z[i]; } if(names.size()!=0) drawable = true; // Log.v("MyView2","setCircleParam"); invalidate(); } public void clear(){ drawable = false; invalidate(); } public void filter(float val, float pre_val){ if(!(pre_val<0.55&&pre_val>0.45)){ if(val<0.55&&val>0.45) val = pre_val; } } //mat = cameraRHF*resultf[i] /*private void calcMat(){ this.mat = new float[this.found_markers][16]; for(int i=0;i<this.found_markers;i++){ for(int j=0;j<4;j++){ mat[i][j] = this.cameraRHF[0]*this.resultf[i][j] + this.cameraRHF[1]*this.resultf[i][j+4] + this.cameraRHF[2]*this.resultf[i][j+8] + this.cameraRHF[3]*this.resultf[i][j+11]; mat[i][j+4] = this.cameraRHF[4]*this.resultf[i][j] + this.cameraRHF[5]*this.resultf[i][j+4] + this.cameraRHF[6]*this.resultf[i][j+8] + this.cameraRHF[7]*this.resultf[i][j+11]; mat[i][j+8] = this.cameraRHF[8]*this.resultf[i][j] + this.cameraRHF[9]*this.resultf[i][j+4] + this.cameraRHF[10]*this.resultf[i][j+8] + this.cameraRHF[11]*this.resultf[i][j+11]; mat[i][j+11] = this.cameraRHF[12]*this.resultf[i][j] + this.cameraRHF[13]*this.resultf[i][j+4] + this.cameraRHF[14]*this.resultf[i][j+8] + this.cameraRHF[15]*this.resultf[i][j+11]; } } }*/ @Override protected void onDraw(Canvas canvas){ //canvas = getHolder().lockCanvas(); if(drawable){ Paint paint = new Paint(); paint.setAntiAlias(true); paint.setStyle(Paint.Style.STROKE); paint.setStrokeWidth(5); paint.setTextSize(80); // // for(int i=0;i<found_markers;i++){ // paint.setColor(color[ar_code_index[i]]); // canvas.drawText(names.get(ar_code_index[i]), x[i]*canvas.getWidth()-100, (1-y[i])*canvas.getHeight(), paint); // } if(found_markers>1){ paint.setColor(Color.GREEN); canvas.drawText("Found Markers!",50, 450, paint); // img.setImageResource(R.drawable.icon_on); } } else{ canvas.drawColor(0, PorterDuff.Mode.CLEAR); } //getHolder().unlockCanvasAndPost(canvas); } @Override public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) { Log.v("MyView2","surfaceChanged"); } @Override public void surfaceCreated(SurfaceHolder arg0) { Log.v("MyView2","surfaceCreated"); // Canvas canvas = arg0.lockCanvas(); //// canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); // Paint paint = new Paint(); // paint.setAntiAlias(true); // paint.setStyle(Paint.Style.STROKE); // paint.setStrokeWidth(10); // paint.setColor(Color.RED); // canvas.drawCircle(canvas.getWidth()/2, canvas.getHeight()/2, 50, paint); // arg0.unlockCanvasAndPost(canvas); } @Override public void surfaceDestroyed(SurfaceHolder arg0) { Log.v("MyView2","surfaceDestroyed"); } @Override public boolean onTouch(View v, MotionEvent event){ //タッチ座標の取得 float tx = event.getX(); float ty = event.getY(); touched = true; // if(Float.valueOf(r).equals(50f)) // r = 100f; // else r = 50f; // invalidate(); return true; } }
true
9b86ffedb8dc49061ee2c9d964d04a6c33406b4d
Java
theFaustus/tekwill-java-fun
/src/methods/building/Computer.java
UTF-8
357
3.03125
3
[ "MIT" ]
permissive
package methods.building; public class Computer { private String notes; public Computer() { this.notes = "n/a"; } public Computer(String notes) { this.notes = notes; } public String getNotes() { return notes; } public void setNotes(String notesMemory) { this.notes = notesMemory; } }
true
ac6b78c57c9430e3bd5d3a3370cce69a4bbce969
Java
ria28/Elemenopee
/app/src/main/java/org/wazir/build/elemenophee/Teacher/Fragments/videoFrag.java
UTF-8
4,210
2.046875
2
[]
no_license
package org.wazir.build.elemenophee.Teacher.Fragments; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import org.wazir.build.elemenophee.R; import org.wazir.build.elemenophee.Teacher.adapter.videoRecyclerAdapter; import org.wazir.build.elemenophee.Teacher.model.contentModel; import org.wazir.build.elemenophee.Teacher.videoPlayingActivity; import java.io.File; import java.util.ArrayList; public class videoFrag extends Fragment implements videoRecyclerAdapter.onLayoutClick { RecyclerView recyclerView; videoRecyclerAdapter adapter; int playingVideoPosition = 0; public ArrayList<contentModel> videoList = new ArrayList<>(); public ArrayList<contentModel> pdfList = new ArrayList<>(); public ArrayList<contentModel> otherList = new ArrayList<>(); boolean isTeacher; ArrayList<File> downList; boolean fromDownloads = false; public videoFrag(int playingVideoPosition, ArrayList<contentModel> videoList, ArrayList<contentModel> pdfList, ArrayList<contentModel> otherList, boolean isTeacher) { this.playingVideoPosition = playingVideoPosition; this.videoList = videoList; this.pdfList = pdfList; this.otherList = otherList; this.isTeacher = isTeacher; } public videoFrag(int playingVideoPosition, ArrayList<File> downList, boolean fromDownloads, boolean isTeacher) { this.playingVideoPosition = playingVideoPosition; this.isTeacher = isTeacher; this.downList = downList; this.fromDownloads = fromDownloads; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.video_frag_layout, container, false); recyclerView = view.findViewById(R.id.suggestedVideoRecycler); return view; } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setUpRecyclerView(); } private void setUpRecyclerView() { if (fromDownloads) adapter = new videoRecyclerAdapter(getContext(), true, downList, true, this, playingVideoPosition); else adapter = new videoRecyclerAdapter(getContext(), true, videoList, this, playingVideoPosition,false); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext()); ((LinearLayoutManager) layoutManager).setOrientation(RecyclerView.VERTICAL); recyclerView.setLayoutManager(layoutManager); recyclerView.hasFixedSize(); recyclerView.setAdapter(adapter); } @Override public void onClicked(int i, boolean isVideoPlaying) { if (!fromDownloads) { if (isVideoPlaying) { Log.d("TAG", "onClicked: True"); Intent intent = new Intent(getContext(), videoPlayingActivity.class); intent.putExtra("VIDEO_LINK", videoList.get(i).getFileUrl()); intent.putExtra("VIDEO_LIST", videoList); intent.putExtra("PDF_LIST", pdfList); intent.putExtra("OTHER_LIST", otherList); intent.putExtra("IS_TEACHER", isTeacher); intent.putExtra("PLAYING_VIDEO_POSITION", i); startActivity(intent); getActivity().finish(); } } else { Log.d("TAG", "onClicked: False"); Intent intent = new Intent(getContext(), videoPlayingActivity.class); intent.putExtra("VIDEO_LINK", downList.get(i).toString()); intent.putExtra("DOWNLOADED_VIDEO_LIST", downList); intent.putExtra("FROM_DOWNLOADS", true); intent.putExtra("PLAYING_VIDEO_POSITION", i); startActivity(intent); getActivity().finish(); } } }
true
bc6c54eeece33d8572ba56142b3fa54486b532ef
Java
EmbedITCZ/jbehave-support
/jbehave-support-core/src/main/java/org/jbehavesupport/core/rest/RestServiceSteps.java
UTF-8
4,610
2.34375
2
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
package org.jbehavesupport.core.rest; import java.io.IOException; import lombok.RequiredArgsConstructor; import org.jbehave.core.annotations.Given; import org.jbehave.core.annotations.Then; import org.jbehave.core.annotations.When; import org.jbehave.core.model.ExamplesTable; import org.jbehavesupport.core.expression.ExpressionEvaluatingParameter; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.http.HttpMethod; import org.springframework.stereotype.Component; /** * This class contains basic set of steps for testing REST API: * <p> * Steps: * <ul> * <li> * <code>Given [METHOD] request to [APPLICATION]/[URL] is sent</code> * </li> * <li> * <code>Given [METHOD] request to [APPLICATION]/[URL] is sent with data: DATA</code> * </li> * <li> * <code>Then response from [APPLICATION] REST API has status [STATUS]</code> * </li> * <li> * <code>Then response from [APPLICATION] REST API has status [STATUS] and values match: DATA</code> * </li> * <li> * <code>Then response values from [APPLICATION] REST API are saved: MAPPING</code> * </li> * <p> * Parameters: * <ul> * <li> * <code>METHOD</code> - HTTP request methods, eg. <code>GET</code>, <code>POST</code>, ... * </li> * <li> * <code>APPLICATION</code> - application qualifier used to resolve {@link RestServiceHandler}, * which implements individual steps and where is possible to provide application specific customization * </li> * <li> * <code>URL</code> - the path in URL, eg. <code>user/?order=1</code> * </li> * </ul> */ @Component @RequiredArgsConstructor public final class RestServiceSteps { private final ConfigurableListableBeanFactory beanFactory; @Given("[$method] request to [$application]/[$url] is sent") @When("[$method] request to [$application]/[$url] is sent") public void sendRequest(String method, String application, ExpressionEvaluatingParameter<String> url) throws IOException { resolveHandler(application).sendRequest(url.getValue(), HttpMethod.valueOf(method), null); } @Given("[$method] request to [$application]/[$url] is sent with data: $data") @When("[$method] request to [$application]/[$url] is sent with data: $data") public void sendRequest(String method, String application, ExpressionEvaluatingParameter<String> url, ExamplesTable data) throws IOException { resolveHandler(application).sendCheckedRequest(url.getValue(), HttpMethod.valueOf(method), data); } @When("response from [$application] REST API has status [$status]") @Then("response from [$application] REST API has status [$status]") public void verifyResponse(String application, String status) { resolveHandler(application).verifyResponse(status); } @When("response from [$application] REST API has status [$status] and values match: $data") @Then("response from [$application] REST API has status [$status] and values match: $data") public void verifyResponse(String application, String status, ExamplesTable data) { resolveHandler(application).verifyResponse(status, data); } @Then("response from [$application] REST API is successful") public void verifySuccessfulResponse(String application) { verifySuccessfulResponse(application, new ExamplesTable("")); } @Then("response from [$application] REST API is successful and values match: $data") public void verifySuccessfulResponse(String application, ExamplesTable data) { RestServiceHandler restServiceHandler = resolveHandler(application); restServiceHandler.verifyResponse(null, restServiceHandler.getSuccessResult()); restServiceHandler.verifyResponse(null, data); } @When("response values from [$application] REST API are saved: $mapping") @Then("response values from [$application] REST API are saved: $mapping") public void saveResponse(String application, ExamplesTable mapping) { resolveHandler(application).saveResponse(mapping); } private RestServiceHandler resolveHandler(String application) { try { return BeanFactoryAnnotationUtils.qualifiedBeanOfType(beanFactory, RestServiceHandler.class, application); } catch (NoSuchBeanDefinitionException e) { throw new IllegalArgumentException("RestServiceSteps requires single RestServiceHandler bean with qualifier [" + application + "]", e); } } }
true
6592fdf1246d904d7ccb62fc7590bbdc93fb96cf
Java
mbdebbeler/java-http-server
/src/test/java/server/SocketDispatcherTest.java
UTF-8
1,783
2.8125
3
[ "MIT" ]
permissive
package server; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.io.IOException; public class SocketDispatcherTest { private int portNumber = 6666; private MockDispatcher mockDispatcher; private MockServerSocketWrapper mockServerSocketWrapper; private MockSocketWrapper mockSocketWrapper; @Before public void setUp() { mockServerSocketWrapper = new MockServerSocketWrapper(portNumber); mockDispatcher = new MockDispatcher(mockServerSocketWrapper); mockSocketWrapper = new MockSocketWrapper(); } @Test public void startServerCallsCreateAndListen() throws IOException { mockDispatcher.listen(portNumber); Assert.assertTrue(mockServerSocketWrapper.getIsListening()); } @Test public void aNewSocketWrapperListens() { mockServerSocketWrapper.createAndListen(portNumber); boolean result = mockServerSocketWrapper.getIsListening(); Assert.assertTrue(result); } @Test public void aServerSocketAcceptsConnections() { MockSocketWrapper subject = mockServerSocketWrapper.acceptConnection(); Assert.assertNotNull(subject); } @Test public void aServerSocketReceivesData() { String result = mockSocketWrapper.receive(); Assert.assertEquals("test message", result); } @Test public void aServerSocketSendsData() { String message = mockSocketWrapper.receive(); mockSocketWrapper.send(message.getBytes()); Assert.assertEquals(mockSocketWrapper.getSentDataAsString(), "test message"); } @Test public void aServerSocketCanClose() { mockSocketWrapper.close(); Assert.assertTrue(mockSocketWrapper.getCloseWasCalled()); } }
true
928efe3240b80c485f996ed88c0f6a2478a8a83f
Java
wohajo/blogg-app-be-2
/src/main/java/com/prawda/demoBlogBE/domain/user/UserAPIRequest.java
UTF-8
3,278
2.609375
3
[]
no_license
package com.prawda.demoBlogBE.domain.user; import am.ik.yavi.builder.ValidatorBuilder; import am.ik.yavi.core.Validator; import am.ik.yavi.core.ViolationMessage; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.apache.commons.codec.digest.DigestUtils; @Data @AllArgsConstructor @NoArgsConstructor public class UserAPIRequest { private String name; private String username; private String password; private String email; private Boolean isAdmin; public User toDomain() { return new User(null, name, username, DigestUtils.sha512Hex(password), email, isAdmin); } public static Validator<UserAPIRequest> validator() { return ValidatorBuilder.of(UserAPIRequest.class) ._string(UserAPIRequest::getName, "name", name -> name.notNull() .notBlank() .message("Name cannot be empty and must be between 3 and 60 characters.") .greaterThanOrEqual(3) .lessThanOrEqual(60) .message("Name cannot be empty and must be between 3 and 60 characters.") ) ._string(UserAPIRequest::getUsername, "username", username -> username.notNull() .notBlank() .message("Username cannot be empty and must be between 3 and 60 characters.") .greaterThanOrEqual(3) .lessThanOrEqual(60) .message("Username cannot be empty and must be between 3 and 60 characters.") .predicate(s -> !s.contains("Admin") || !s.contains("admin"), ViolationMessage.of( "Username", "Nice try, but You cannot name yourself admin." ) ) .message("Nice try, but You cannot name yourself admin.") .predicate(s -> !s.contains("~"), ViolationMessage.of( "Username", "Username cannot contain \"~\"." ) ) ) ._string(UserAPIRequest::getEmail, "email", email -> email.notNull() .notBlank() .message("Email cannot be empty.") .greaterThanOrEqual(3) .lessThanOrEqual(60) .message("Email must be between 3 and 60 characters.") .pattern("[\\w]+[@][\\w]+[.][\\w]+") .message("Email must have format like [x]@[y].[z]") ) ._string(UserAPIRequest::getPassword, "password", password -> password.notNull() .notBlank() .message("Password cannot be empty.") .greaterThanOrEqual(8) .lessThanOrEqual(60) .message("Password must be between 8 and 60 characters.") ) .build(); } }
true
0ed075024025de45aa3a2bf4e39704333cf857b4
Java
moutainhigh/GWMS-master
/src/main/java/com/huanqiuyuncang/controller/wms/kuwei/BaoGuoKuWeiController.java
UTF-8
7,499
1.960938
2
[]
no_license
package com.huanqiuyuncang.controller.wms.kuwei; import com.huanqiuyuncang.controller.base.BaseController; import com.huanqiuyuncang.entity.Page; import com.huanqiuyuncang.entity.customer.CustomerEntity; import com.huanqiuyuncang.entity.kuwei.BaoGuoKuWeiEntity; import com.huanqiuyuncang.entity.kuwei.CangKuEntity; import com.huanqiuyuncang.service.wms.customer.CustomerInterface; import com.huanqiuyuncang.service.wms.kuwei.BaoGuoKuWeiInterface; import com.huanqiuyuncang.service.wms.kuwei.CangKuInterface; import com.huanqiuyuncang.util.AppUtil; import com.huanqiuyuncang.util.BeanMapUtil; import com.huanqiuyuncang.util.Jurisdiction; import com.huanqiuyuncang.util.PageData; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Conditional; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by lzf on 2017/6/11. */ @Controller @RequestMapping("baoguokuwei") public class BaoGuoKuWeiController extends BaseController { String menuUrl = "baoguokuwei/list.do"; //菜单地址(权限用) @Autowired private BaoGuoKuWeiInterface baoGuoKuWeiService; @Autowired private CangKuInterface cangKuService; /**保存 * @param * @throws Exception */ @RequestMapping(value="/save") public ModelAndView save() throws Exception{ if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 ModelAndView mv = this.getModelAndView(); PageData pd = this.getPageData(); BeanMapUtil.setCreateUserInfo(pd); BeanMapUtil.setUpdateUserInfo(pd); BaoGuoKuWeiEntity baoGuoKuWei = (BaoGuoKuWeiEntity) BeanMapUtil.mapToObject(pd, BaoGuoKuWeiEntity.class); baoGuoKuWei.setId(this.get32UUID()); baoGuoKuWeiService.insertSelective(baoGuoKuWei); mv.addObject("msg","success"); mv.setViewName("save_result"); return mv; } /**删除 * @param out * @throws Exception */ @RequestMapping(value="/delete") public void delete(PrintWriter out) throws Exception{ if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 PageData pd = this.getPageData(); String id = pd.getString("id"); Integer sum = checkTable("wms_baoguokuwei","id", id); String msg = "success"; if(sum >0){ msg = "error"; }else{ baoGuoKuWeiService.deleteByPrimaryKey(id); } out.write(msg); out.close(); } /**修改 * @param * @throws Exception */ @RequestMapping(value="/edit") public ModelAndView edit() throws Exception{ if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 ModelAndView mv = this.getModelAndView(); PageData pd = this.getPageData(); BeanMapUtil.setUpdateUserInfo(pd); BaoGuoKuWeiEntity baoGuoKuWei = (BaoGuoKuWeiEntity) BeanMapUtil.mapToObject(pd, BaoGuoKuWeiEntity.class); baoGuoKuWeiService.updateByPrimaryKeySelective(baoGuoKuWei); mv.addObject("msg","success"); mv.setViewName("save_result"); return mv; } /**列表 * @param page * @throws Exception */ @RequestMapping(value="/list") public ModelAndView list(Page page) throws Exception{ ModelAndView mv = this.getModelAndView(); PageData pd = this.getPageData(); String USERNAME = Jurisdiction.getUsername(); String role_name = gerRolename(USERNAME); if("仓库管理员".equals(role_name)){ String cangkuid = pd.getString("cangku"); if(cangkuid == null || StringUtils.isBlank(cangkuid)){ List<CangKuEntity> cangkuList = cangKuService.selectByCangkuuser(USERNAME); if(cangkuList != null && cangkuList.size()>0){ pd.put("cangku",cangkuList); } } } Map<String, String> hc = Jurisdiction.getHC(); if(hc.keySet().contains("adminsearch") && "1".equals(hc.get("adminsearch"))){ pd.remove("cangku"); } page.setPd(pd); List<BaoGuoKuWeiEntity> varList = baoGuoKuWeiService.datalistPage(page); mv.setViewName("wms/baoguokuwei/baoguokuwei_list"); mv.addObject("varList", varList); mv.addObject("pd", pd); mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 return mv; } /**去新增页面 * @param * @throws Exception */ @RequestMapping(value="/goAdd") public ModelAndView goAdd()throws Exception{ ModelAndView mv = this.getModelAndView(); PageData pd = this.getPageData(); mv.setViewName("wms/baoguokuwei/baoguokuwei_edit"); mv.addObject("msg", "save"); mv.addObject("pd", pd); return mv; } /**去修改页面 * @param * @throws Exception */ @RequestMapping(value="/goEdit") public ModelAndView goEdit()throws Exception{ ModelAndView mv = this.getModelAndView(); PageData pd = this.getPageData(); String id = pd.getString("id"); BaoGuoKuWeiEntity baoGuoKuWei = baoGuoKuWeiService.selectByPrimaryKey(id);//根据ID读取 mv.setViewName("wms/baoguokuwei/baoguokuwei_edit"); mv.addObject("msg", "edit"); mv.addObject("baoguokuwei", baoGuoKuWei); mv.addObject("pd", pd); mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 return mv; } @RequestMapping(value="/gopackageuser") public ModelAndView gopackageuser()throws Exception{ ModelAndView mv = this.getModelAndView(); PageData pd = this.getPageData(); String id = pd.getString("id"); BaoGuoKuWeiEntity baoGuoKuWei = baoGuoKuWeiService.selectByPrimaryKey(id);//根据ID读取 mv.setViewName("wms/baoguokuwei/baoguokuwei_packageuser"); mv.addObject("msg", "edit"); mv.addObject("baoguokuwei", baoGuoKuWei); mv.addObject("pd", pd); mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 return mv; } /**批量删除 * @param * @throws Exception */ @RequestMapping(value="/deleteAll") @ResponseBody public Object deleteAll() throws Exception{ if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 Map<String,Object> map = new HashMap<String,Object>(); PageData pd = this.getPageData(); List<PageData> pdList = new ArrayList<PageData>(); String DATA_IDS = pd.getString("DATA_IDS"); if(null != DATA_IDS && !"".equals(DATA_IDS)){ String ArrayDATA_IDS[] = DATA_IDS.split(","); Integer sum = checkTable("wms_baoguokuwei","id", ArrayDATA_IDS); if(sum > 0){ map.put("msg","error"); return AppUtil.returnObject(pd, map); } baoGuoKuWeiService.deleteAll(ArrayDATA_IDS); map.put("msg", "success"); }else{ map.put("msg","error"); } return AppUtil.returnObject(pd, map); } }
true
e02ec854d74710ed2a3d06a0e06c3a1ed0291825
Java
ShymaaLotfy/Movie
/app/src/main/java/com/example/android/movie/Networking/ActorsDownloadTask.java
UTF-8
456
2.140625
2
[]
no_license
package com.example.android.movie.Networking; import com.example.android.movie.Models.Actors; import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; import java.io.InputStream; /** * Created by Shimaa on 8/30/2016. */ public class ActorsDownloadTask extends DownloadTask<Actors> { @Override public Actors objectFromJson(JSONObject object) throws JSONException { return new Actors(object,true); } }
true
7140c08ff67d883bf4964d6190103e26b3449133
Java
lstsir2019/simple-faculte-besoin
/src/main/java/com/faculte/simplefacultebesoin/domain/model/dao/ExpressionBesoinItemDao.java
UTF-8
894
1.75
2
[]
no_license
/* * 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.faculte.simplefacultebesoin.domain.model.dao; import com.faculte.simplefacultebesoin.domain.bean.ExpressionBesoinItem; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * * @author ismail boulaanait */ @Repository public interface ExpressionBesoinItemDao extends JpaRepository<ExpressionBesoinItem, Long>{ public List<ExpressionBesoinItem> findByExpressionBesoinReference(String reference); public List<ExpressionBesoinItem> findByReferenceProduit(String referenceProduit); public List<ExpressionBesoinItem> findByExpressionBesoinCodeEntity(String codeEntity); }
true
fd1026a087ca884cee884eaca5df0735177065fe
Java
va-collabnet-archive/tk3
/tk-api-dto/src/main/java/org/ihtsdo/fxmodel/concept/component/refex/type_comp_long/FxRefexCompLongVersion.java
UTF-8
3,404
2.515625
3
[]
no_license
package org.ihtsdo.fxmodel.concept.component.refex.type_comp_long; //~--- non-JDK imports -------------------------------------------------------- import javafx.beans.property.SimpleLongProperty; import org.ihtsdo.fxmodel.concept.component.refex.type_comp.FxRefexCompVersion; import org.ihtsdo.tk.api.ContradictionException; import org.ihtsdo.tk.api.TerminologySnapshotDI; import org.ihtsdo.tk.api.refex.type_nid_long.RefexNidLongVersionBI; //~--- JDK imports ------------------------------------------------------------ import java.io.IOException; import org.ihtsdo.fxmodel.concept.component.refex.FxRefexChronicle; public class FxRefexCompLongVersion <T extends FxRefexChronicle, V extends FxRefexCompLongVersion> extends FxRefexCompVersion<T, V> { public static final long serialVersionUID = 1; //~--- fields -------------------------------------------------------------- public SimpleLongProperty long1Property = new SimpleLongProperty(this, "long1"); //~--- constructors -------------------------------------------------------- public FxRefexCompLongVersion() { super(); } public FxRefexCompLongVersion(T chronicle, TerminologySnapshotDI ss, RefexNidLongVersionBI another) throws IOException, ContradictionException { super(chronicle, ss, another); this.long1Property.set(another.getLong1()); } //~--- methods ------------------------------------------------------------- /** * Compares this object to the specified object. The result is <tt>true</tt> * if and only if the argument is not <tt>null</tt>, is a * <tt>ERefsetCidLongVersion</tt> object, and contains the same values, field by field, * as this <tt>ERefsetCidLongVersion</tt>. * * @param obj the object to compare with. * @return <code>true</code> if the objects are the same; * <code>false</code> otherwise. */ @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (FxRefexCompLongVersion.class.isAssignableFrom(obj.getClass())) { FxRefexCompLongVersion another = (FxRefexCompLongVersion) obj; // ========================================================= // Compare properties of 'this' class to the 'another' class // ========================================================= // Compare longValue if (this.long1Property.get() != another.long1Property.get()) { return false; } // Compare their parents return super.equals(obj); } return false; } public SimpleLongProperty long1Property() { return long1Property; } /** * Returns a string representation of the object. */ @Override public String toString() { StringBuilder buff = new StringBuilder(); buff.append(this.getClass().getSimpleName()).append(": "); buff.append(" long: "); buff.append(this.long1Property.get()); buff.append(" "); buff.append(super.toString()); return buff.toString(); } //~--- get methods --------------------------------------------------------- public long getLong1() { return long1Property.get(); } //~--- set methods --------------------------------------------------------- public void setLong1(long long1) { this.long1Property.set(long1); } }
true
70ee92e57fe6a7e573b0caf01ebe37b25feccb31
Java
ChloeG77/Travel-Planner
/travel_planner_backend/src/main/java/com/laioffer/travel_planner_backend/repository/PlaceRepository.java
UTF-8
253
1.664063
2
[]
no_license
package com.laioffer.travel_planner_backend.repository; import com.laioffer.travel_planner_backend.entity.Place; import org.springframework.data.jpa.repository.JpaRepository; public interface PlaceRepository extends JpaRepository<Place, String> { }
true
7c9dc2e36aac0b8e77dac72e3ba323081145a5c2
Java
igorklimov/JavaCourses1-OOP
/src/CollectionAndDataSctructures/Book.java
UTF-8
570
2.84375
3
[]
no_license
package CollectionAndDataSctructures; public class Book { public String title; public int pageCount; public String author; public void setAuthor(String author) { this.author = author; } public void setPageCount(int pageCount) { this.pageCount = pageCount; } public void setTitle(String title) { this.title = title; } public int getPageCount() { return pageCount; } public String getAuthor() { return author; } public String getTitle() { return title; } }
true
0deba03cbf1149f542e551cb808110e1a360d291
Java
twass21/Practice
/src/BirthdayCalculator.java
UTF-8
1,838
4.03125
4
[]
no_license
import java.util.Scanner; /* * @author Tyler Wassel * Period 5 * Birthday Calculator */ public class BirthdayCalculator { public static void main(String[] args) { Scanner user = new Scanner(System.in); System.out.print("First person please enter your name: "); String firstName = user.nextLine(); System.out.print("Please enter the your birthday: "); int firstBirthday = user.nextInt(); System.out.print("Please enter your birth month as a number: "); int firstBirthMonth = user.nextInt(); System.out.print("Please enter your birth year: "); int firstBirthYear = user.nextInt(); System.out.print("Second person please enter your name: "); String secondName = user.nextLine(); System.out.print("Please enter your birthday: "); int secondBirthday = user.nextInt(); System.out.print("Please enter your birth month as a number: "); int secondBirthMonth = user.nextInt(); System.out.print("Please enter your birth year: "); int secondBirthYear = user.nextInt(); if( firstBirthYear < secondBirthYear) { System.out.println(firstName + " is older"); } else if (firstBirthYear > secondBirthYear) { System.out.println(secondName + " is older"); } else { if( firstBirthMonth < secondBirthMonth) { System.out.println(firstName + " is older"); } else if (firstBirthMonth > secondBirthMonth) { System.out.println(secondName + " is older"); } else { if( firstBirthday < secondBirthday) { System.out.println(firstName + " is older"); } else if (firstBirthday > secondBirthday) { System.out.println(secondName + " is older"); } else { System.out.println("You are the same age"); } } } } }
true
4a14efc39285cb22b3797e9c2db9786d8e029ebd
Java
AmazingWines/EnglishExam
/EnglishExamProject-master/src/main/java/hstc/edu/cn/service/Impl/Read_Page_TitleServiceImpl.java
UTF-8
739
1.992188
2
[]
no_license
package hstc.edu.cn.service.Impl; import hstc.edu.cn.mapper.Read_Page_TitleMapper; import hstc.edu.cn.po.Read_Page_Title; import hstc.edu.cn.service.Read_PageService; import hstc.edu.cn.service.Read_Page_TitleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by win8 on 2017/4/29. */ @Service("read_Page_TitleService") public class Read_Page_TitleServiceImpl implements Read_Page_TitleService { @Autowired private Read_Page_TitleMapper read_page_titleMapper; public List<Read_Page_Title> getRead_Page_TitleByType(int read_pageId) { return read_page_titleMapper.getRead_Page_TitleByType(read_pageId); } }
true
4a564b822b8ea3c4d32c236c8872985becf5d882
Java
eweware/blahguarest
/src/main/java/com/eweware/service/mgr/auxiliary/InboxData.java
UTF-8
702
2.15625
2
[]
no_license
package com.eweware.service.mgr.auxiliary; import java.util.List; import java.util.Map; /** * @author rk@post.harvard.edu * Date: 7/7/13 Time: 11:56 PM */ public class InboxData { private final Integer _inboxNumber; private final List<Map<String, Object>> _inboxItems; public InboxData(List<Map<String, Object>> inboxItems) { this(-1, inboxItems); } public InboxData(Integer inboxNumber, List<Map<String, Object>> inboxItems) { _inboxNumber = inboxNumber; _inboxItems = inboxItems; } public Integer getInboxNumber() { return _inboxNumber; } public List<Map<String, Object>> getInboxItems() { return _inboxItems; } }
true
3cf9f5d51f76a98aa715fe3fc0d8188e40336866
Java
sy8000/dlc20200908
/src/main/java/cn/besbing/Entities/AllTaskExample.java
UTF-8
82,937
2.359375
2
[]
no_license
package cn.besbing.Entities; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; public class AllTaskExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public AllTaskExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } protected void addCriterionForJDBCDate(String condition, Date value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } addCriterion(condition, new java.sql.Date(value.getTime()), property); } protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) { if (values == null || values.size() == 0) { throw new RuntimeException("Value list for " + property + " cannot be null or empty"); } List<java.sql.Date> dateList = new ArrayList<java.sql.Date>(); Iterator<Date> iter = values.iterator(); while (iter.hasNext()) { dateList.add(new java.sql.Date(iter.next().getTime())); } addCriterion(condition, dateList, property); } protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); } public Criteria andCustomerIsNull() { addCriterion("CUSTOMER is null"); return (Criteria) this; } public Criteria andCustomerIsNotNull() { addCriterion("CUSTOMER is not null"); return (Criteria) this; } public Criteria andCustomerEqualTo(String value) { addCriterion("CUSTOMER =", value, "customer"); return (Criteria) this; } public Criteria andCustomerNotEqualTo(String value) { addCriterion("CUSTOMER <>", value, "customer"); return (Criteria) this; } public Criteria andCustomerGreaterThan(String value) { addCriterion("CUSTOMER >", value, "customer"); return (Criteria) this; } public Criteria andCustomerGreaterThanOrEqualTo(String value) { addCriterion("CUSTOMER >=", value, "customer"); return (Criteria) this; } public Criteria andCustomerLessThan(String value) { addCriterion("CUSTOMER <", value, "customer"); return (Criteria) this; } public Criteria andCustomerLessThanOrEqualTo(String value) { addCriterion("CUSTOMER <=", value, "customer"); return (Criteria) this; } public Criteria andCustomerLike(String value) { addCriterion("CUSTOMER like", value, "customer"); return (Criteria) this; } public Criteria andCustomerNotLike(String value) { addCriterion("CUSTOMER not like", value, "customer"); return (Criteria) this; } public Criteria andCustomerIn(List<String> values) { addCriterion("CUSTOMER in", values, "customer"); return (Criteria) this; } public Criteria andCustomerNotIn(List<String> values) { addCriterion("CUSTOMER not in", values, "customer"); return (Criteria) this; } public Criteria andCustomerBetween(String value1, String value2) { addCriterion("CUSTOMER between", value1, value2, "customer"); return (Criteria) this; } public Criteria andCustomerNotBetween(String value1, String value2) { addCriterion("CUSTOMER not between", value1, value2, "customer"); return (Criteria) this; } public Criteria andTSourceCustomerIsNull() { addCriterion("T_SOURCE_CUSTOMER is null"); return (Criteria) this; } public Criteria andTSourceCustomerIsNotNull() { addCriterion("T_SOURCE_CUSTOMER is not null"); return (Criteria) this; } public Criteria andTSourceCustomerEqualTo(String value) { addCriterion("T_SOURCE_CUSTOMER =", value, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerNotEqualTo(String value) { addCriterion("T_SOURCE_CUSTOMER <>", value, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerGreaterThan(String value) { addCriterion("T_SOURCE_CUSTOMER >", value, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerGreaterThanOrEqualTo(String value) { addCriterion("T_SOURCE_CUSTOMER >=", value, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerLessThan(String value) { addCriterion("T_SOURCE_CUSTOMER <", value, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerLessThanOrEqualTo(String value) { addCriterion("T_SOURCE_CUSTOMER <=", value, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerLike(String value) { addCriterion("T_SOURCE_CUSTOMER like", value, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerNotLike(String value) { addCriterion("T_SOURCE_CUSTOMER not like", value, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerIn(List<String> values) { addCriterion("T_SOURCE_CUSTOMER in", values, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerNotIn(List<String> values) { addCriterion("T_SOURCE_CUSTOMER not in", values, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerBetween(String value1, String value2) { addCriterion("T_SOURCE_CUSTOMER between", value1, value2, "tSourceCustomer"); return (Criteria) this; } public Criteria andTSourceCustomerNotBetween(String value1, String value2) { addCriterion("T_SOURCE_CUSTOMER not between", value1, value2, "tSourceCustomer"); return (Criteria) this; } public Criteria andCustomerContactIsNull() { addCriterion("CUSTOMER_CONTACT is null"); return (Criteria) this; } public Criteria andCustomerContactIsNotNull() { addCriterion("CUSTOMER_CONTACT is not null"); return (Criteria) this; } public Criteria andCustomerContactEqualTo(String value) { addCriterion("CUSTOMER_CONTACT =", value, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactNotEqualTo(String value) { addCriterion("CUSTOMER_CONTACT <>", value, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactGreaterThan(String value) { addCriterion("CUSTOMER_CONTACT >", value, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactGreaterThanOrEqualTo(String value) { addCriterion("CUSTOMER_CONTACT >=", value, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactLessThan(String value) { addCriterion("CUSTOMER_CONTACT <", value, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactLessThanOrEqualTo(String value) { addCriterion("CUSTOMER_CONTACT <=", value, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactLike(String value) { addCriterion("CUSTOMER_CONTACT like", value, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactNotLike(String value) { addCriterion("CUSTOMER_CONTACT not like", value, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactIn(List<String> values) { addCriterion("CUSTOMER_CONTACT in", values, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactNotIn(List<String> values) { addCriterion("CUSTOMER_CONTACT not in", values, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactBetween(String value1, String value2) { addCriterion("CUSTOMER_CONTACT between", value1, value2, "customerContact"); return (Criteria) this; } public Criteria andCustomerContactNotBetween(String value1, String value2) { addCriterion("CUSTOMER_CONTACT not between", value1, value2, "customerContact"); return (Criteria) this; } public Criteria andNameIsNull() { addCriterion("NAME is null"); return (Criteria) this; } public Criteria andNameIsNotNull() { addCriterion("NAME is not null"); return (Criteria) this; } public Criteria andNameEqualTo(String value) { addCriterion("NAME =", value, "name"); return (Criteria) this; } public Criteria andNameNotEqualTo(String value) { addCriterion("NAME <>", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThan(String value) { addCriterion("NAME >", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThanOrEqualTo(String value) { addCriterion("NAME >=", value, "name"); return (Criteria) this; } public Criteria andNameLessThan(String value) { addCriterion("NAME <", value, "name"); return (Criteria) this; } public Criteria andNameLessThanOrEqualTo(String value) { addCriterion("NAME <=", value, "name"); return (Criteria) this; } public Criteria andNameLike(String value) { addCriterion("NAME like", value, "name"); return (Criteria) this; } public Criteria andNameNotLike(String value) { addCriterion("NAME not like", value, "name"); return (Criteria) this; } public Criteria andNameIn(List<String> values) { addCriterion("NAME in", values, "name"); return (Criteria) this; } public Criteria andNameNotIn(List<String> values) { addCriterion("NAME not in", values, "name"); return (Criteria) this; } public Criteria andNameBetween(String value1, String value2) { addCriterion("NAME between", value1, value2, "name"); return (Criteria) this; } public Criteria andNameNotBetween(String value1, String value2) { addCriterion("NAME not between", value1, value2, "name"); return (Criteria) this; } public Criteria andTemplateIsNull() { addCriterion("TEMPLATE is null"); return (Criteria) this; } public Criteria andTemplateIsNotNull() { addCriterion("TEMPLATE is not null"); return (Criteria) this; } public Criteria andTemplateEqualTo(String value) { addCriterion("TEMPLATE =", value, "template"); return (Criteria) this; } public Criteria andTemplateNotEqualTo(String value) { addCriterion("TEMPLATE <>", value, "template"); return (Criteria) this; } public Criteria andTemplateGreaterThan(String value) { addCriterion("TEMPLATE >", value, "template"); return (Criteria) this; } public Criteria andTemplateGreaterThanOrEqualTo(String value) { addCriterion("TEMPLATE >=", value, "template"); return (Criteria) this; } public Criteria andTemplateLessThan(String value) { addCriterion("TEMPLATE <", value, "template"); return (Criteria) this; } public Criteria andTemplateLessThanOrEqualTo(String value) { addCriterion("TEMPLATE <=", value, "template"); return (Criteria) this; } public Criteria andTemplateLike(String value) { addCriterion("TEMPLATE like", value, "template"); return (Criteria) this; } public Criteria andTemplateNotLike(String value) { addCriterion("TEMPLATE not like", value, "template"); return (Criteria) this; } public Criteria andTemplateIn(List<String> values) { addCriterion("TEMPLATE in", values, "template"); return (Criteria) this; } public Criteria andTemplateNotIn(List<String> values) { addCriterion("TEMPLATE not in", values, "template"); return (Criteria) this; } public Criteria andTemplateBetween(String value1, String value2) { addCriterion("TEMPLATE between", value1, value2, "template"); return (Criteria) this; } public Criteria andTemplateNotBetween(String value1, String value2) { addCriterion("TEMPLATE not between", value1, value2, "template"); return (Criteria) this; } public Criteria andTaskIdIsNull() { addCriterion("TASK_ID is null"); return (Criteria) this; } public Criteria andTaskIdIsNotNull() { addCriterion("TASK_ID is not null"); return (Criteria) this; } public Criteria andTaskIdEqualTo(String value) { addCriterion("TASK_ID =", value, "taskId"); return (Criteria) this; } public Criteria andTaskIdNotEqualTo(String value) { addCriterion("TASK_ID <>", value, "taskId"); return (Criteria) this; } public Criteria andTaskIdGreaterThan(String value) { addCriterion("TASK_ID >", value, "taskId"); return (Criteria) this; } public Criteria andTaskIdGreaterThanOrEqualTo(String value) { addCriterion("TASK_ID >=", value, "taskId"); return (Criteria) this; } public Criteria andTaskIdLessThan(String value) { addCriterion("TASK_ID <", value, "taskId"); return (Criteria) this; } public Criteria andTaskIdLessThanOrEqualTo(String value) { addCriterion("TASK_ID <=", value, "taskId"); return (Criteria) this; } public Criteria andTaskIdLike(String value) { addCriterion("TASK_ID like", value, "taskId"); return (Criteria) this; } public Criteria andTaskIdNotLike(String value) { addCriterion("TASK_ID not like", value, "taskId"); return (Criteria) this; } public Criteria andTaskIdIn(List<String> values) { addCriterion("TASK_ID in", values, "taskId"); return (Criteria) this; } public Criteria andTaskIdNotIn(List<String> values) { addCriterion("TASK_ID not in", values, "taskId"); return (Criteria) this; } public Criteria andTaskIdBetween(String value1, String value2) { addCriterion("TASK_ID between", value1, value2, "taskId"); return (Criteria) this; } public Criteria andTaskIdNotBetween(String value1, String value2) { addCriterion("TASK_ID not between", value1, value2, "taskId"); return (Criteria) this; } public Criteria andTaskReportedNameIsNull() { addCriterion("TASK_REPORTED_NAME is null"); return (Criteria) this; } public Criteria andTaskReportedNameIsNotNull() { addCriterion("TASK_REPORTED_NAME is not null"); return (Criteria) this; } public Criteria andTaskReportedNameEqualTo(String value) { addCriterion("TASK_REPORTED_NAME =", value, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameNotEqualTo(String value) { addCriterion("TASK_REPORTED_NAME <>", value, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameGreaterThan(String value) { addCriterion("TASK_REPORTED_NAME >", value, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameGreaterThanOrEqualTo(String value) { addCriterion("TASK_REPORTED_NAME >=", value, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameLessThan(String value) { addCriterion("TASK_REPORTED_NAME <", value, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameLessThanOrEqualTo(String value) { addCriterion("TASK_REPORTED_NAME <=", value, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameLike(String value) { addCriterion("TASK_REPORTED_NAME like", value, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameNotLike(String value) { addCriterion("TASK_REPORTED_NAME not like", value, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameIn(List<String> values) { addCriterion("TASK_REPORTED_NAME in", values, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameNotIn(List<String> values) { addCriterion("TASK_REPORTED_NAME not in", values, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameBetween(String value1, String value2) { addCriterion("TASK_REPORTED_NAME between", value1, value2, "taskReportedName"); return (Criteria) this; } public Criteria andTaskReportedNameNotBetween(String value1, String value2) { addCriterion("TASK_REPORTED_NAME not between", value1, value2, "taskReportedName"); return (Criteria) this; } public Criteria andPriorityIsNull() { addCriterion("PRIORITY is null"); return (Criteria) this; } public Criteria andPriorityIsNotNull() { addCriterion("PRIORITY is not null"); return (Criteria) this; } public Criteria andPriorityEqualTo(String value) { addCriterion("PRIORITY =", value, "priority"); return (Criteria) this; } public Criteria andPriorityNotEqualTo(String value) { addCriterion("PRIORITY <>", value, "priority"); return (Criteria) this; } public Criteria andPriorityGreaterThan(String value) { addCriterion("PRIORITY >", value, "priority"); return (Criteria) this; } public Criteria andPriorityGreaterThanOrEqualTo(String value) { addCriterion("PRIORITY >=", value, "priority"); return (Criteria) this; } public Criteria andPriorityLessThan(String value) { addCriterion("PRIORITY <", value, "priority"); return (Criteria) this; } public Criteria andPriorityLessThanOrEqualTo(String value) { addCriterion("PRIORITY <=", value, "priority"); return (Criteria) this; } public Criteria andPriorityLike(String value) { addCriterion("PRIORITY like", value, "priority"); return (Criteria) this; } public Criteria andPriorityNotLike(String value) { addCriterion("PRIORITY not like", value, "priority"); return (Criteria) this; } public Criteria andPriorityIn(List<String> values) { addCriterion("PRIORITY in", values, "priority"); return (Criteria) this; } public Criteria andPriorityNotIn(List<String> values) { addCriterion("PRIORITY not in", values, "priority"); return (Criteria) this; } public Criteria andPriorityBetween(String value1, String value2) { addCriterion("PRIORITY between", value1, value2, "priority"); return (Criteria) this; } public Criteria andPriorityNotBetween(String value1, String value2) { addCriterion("PRIORITY not between", value1, value2, "priority"); return (Criteria) this; } public Criteria andCommonNameIsNull() { addCriterion("COMMON_NAME is null"); return (Criteria) this; } public Criteria andCommonNameIsNotNull() { addCriterion("COMMON_NAME is not null"); return (Criteria) this; } public Criteria andCommonNameEqualTo(String value) { addCriterion("COMMON_NAME =", value, "commonName"); return (Criteria) this; } public Criteria andCommonNameNotEqualTo(String value) { addCriterion("COMMON_NAME <>", value, "commonName"); return (Criteria) this; } public Criteria andCommonNameGreaterThan(String value) { addCriterion("COMMON_NAME >", value, "commonName"); return (Criteria) this; } public Criteria andCommonNameGreaterThanOrEqualTo(String value) { addCriterion("COMMON_NAME >=", value, "commonName"); return (Criteria) this; } public Criteria andCommonNameLessThan(String value) { addCriterion("COMMON_NAME <", value, "commonName"); return (Criteria) this; } public Criteria andCommonNameLessThanOrEqualTo(String value) { addCriterion("COMMON_NAME <=", value, "commonName"); return (Criteria) this; } public Criteria andCommonNameLike(String value) { addCriterion("COMMON_NAME like", value, "commonName"); return (Criteria) this; } public Criteria andCommonNameNotLike(String value) { addCriterion("COMMON_NAME not like", value, "commonName"); return (Criteria) this; } public Criteria andCommonNameIn(List<String> values) { addCriterion("COMMON_NAME in", values, "commonName"); return (Criteria) this; } public Criteria andCommonNameNotIn(List<String> values) { addCriterion("COMMON_NAME not in", values, "commonName"); return (Criteria) this; } public Criteria andCommonNameBetween(String value1, String value2) { addCriterion("COMMON_NAME between", value1, value2, "commonName"); return (Criteria) this; } public Criteria andCommonNameNotBetween(String value1, String value2) { addCriterion("COMMON_NAME not between", value1, value2, "commonName"); return (Criteria) this; } public Criteria andReportNameIsNull() { addCriterion("REPORT_NAME is null"); return (Criteria) this; } public Criteria andReportNameIsNotNull() { addCriterion("REPORT_NAME is not null"); return (Criteria) this; } public Criteria andReportNameEqualTo(String value) { addCriterion("REPORT_NAME =", value, "reportName"); return (Criteria) this; } public Criteria andReportNameNotEqualTo(String value) { addCriterion("REPORT_NAME <>", value, "reportName"); return (Criteria) this; } public Criteria andReportNameGreaterThan(String value) { addCriterion("REPORT_NAME >", value, "reportName"); return (Criteria) this; } public Criteria andReportNameGreaterThanOrEqualTo(String value) { addCriterion("REPORT_NAME >=", value, "reportName"); return (Criteria) this; } public Criteria andReportNameLessThan(String value) { addCriterion("REPORT_NAME <", value, "reportName"); return (Criteria) this; } public Criteria andReportNameLessThanOrEqualTo(String value) { addCriterion("REPORT_NAME <=", value, "reportName"); return (Criteria) this; } public Criteria andReportNameLike(String value) { addCriterion("REPORT_NAME like", value, "reportName"); return (Criteria) this; } public Criteria andReportNameNotLike(String value) { addCriterion("REPORT_NAME not like", value, "reportName"); return (Criteria) this; } public Criteria andReportNameIn(List<String> values) { addCriterion("REPORT_NAME in", values, "reportName"); return (Criteria) this; } public Criteria andReportNameNotIn(List<String> values) { addCriterion("REPORT_NAME not in", values, "reportName"); return (Criteria) this; } public Criteria andReportNameBetween(String value1, String value2) { addCriterion("REPORT_NAME between", value1, value2, "reportName"); return (Criteria) this; } public Criteria andReportNameNotBetween(String value1, String value2) { addCriterion("REPORT_NAME not between", value1, value2, "reportName"); return (Criteria) this; } public Criteria andProductSeriesIsNull() { addCriterion("PRODUCT_SERIES is null"); return (Criteria) this; } public Criteria andProductSeriesIsNotNull() { addCriterion("PRODUCT_SERIES is not null"); return (Criteria) this; } public Criteria andProductSeriesEqualTo(String value) { addCriterion("PRODUCT_SERIES =", value, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesNotEqualTo(String value) { addCriterion("PRODUCT_SERIES <>", value, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesGreaterThan(String value) { addCriterion("PRODUCT_SERIES >", value, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesGreaterThanOrEqualTo(String value) { addCriterion("PRODUCT_SERIES >=", value, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesLessThan(String value) { addCriterion("PRODUCT_SERIES <", value, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesLessThanOrEqualTo(String value) { addCriterion("PRODUCT_SERIES <=", value, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesLike(String value) { addCriterion("PRODUCT_SERIES like", value, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesNotLike(String value) { addCriterion("PRODUCT_SERIES not like", value, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesIn(List<String> values) { addCriterion("PRODUCT_SERIES in", values, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesNotIn(List<String> values) { addCriterion("PRODUCT_SERIES not in", values, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesBetween(String value1, String value2) { addCriterion("PRODUCT_SERIES between", value1, value2, "productSeries"); return (Criteria) this; } public Criteria andProductSeriesNotBetween(String value1, String value2) { addCriterion("PRODUCT_SERIES not between", value1, value2, "productSeries"); return (Criteria) this; } public Criteria andAssignedSampleQuantityIsNull() { addCriterion("ASSIGNED_SAMPLE_QUANTITY is null"); return (Criteria) this; } public Criteria andAssignedSampleQuantityIsNotNull() { addCriterion("ASSIGNED_SAMPLE_QUANTITY is not null"); return (Criteria) this; } public Criteria andAssignedSampleQuantityEqualTo(Long value) { addCriterion("ASSIGNED_SAMPLE_QUANTITY =", value, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityNotEqualTo(Long value) { addCriterion("ASSIGNED_SAMPLE_QUANTITY <>", value, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityGreaterThan(Long value) { addCriterion("ASSIGNED_SAMPLE_QUANTITY >", value, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityGreaterThanOrEqualTo(Long value) { addCriterion("ASSIGNED_SAMPLE_QUANTITY >=", value, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityLessThan(Long value) { addCriterion("ASSIGNED_SAMPLE_QUANTITY <", value, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityLessThanOrEqualTo(Long value) { addCriterion("ASSIGNED_SAMPLE_QUANTITY <=", value, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityIn(List<Long> values) { addCriterion("ASSIGNED_SAMPLE_QUANTITY in", values, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityNotIn(List<Long> values) { addCriterion("ASSIGNED_SAMPLE_QUANTITY not in", values, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityBetween(Long value1, Long value2) { addCriterion("ASSIGNED_SAMPLE_QUANTITY between", value1, value2, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andAssignedSampleQuantityNotBetween(Long value1, Long value2) { addCriterion("ASSIGNED_SAMPLE_QUANTITY not between", value1, value2, "assignedSampleQuantity"); return (Criteria) this; } public Criteria andConditionIsNull() { addCriterion("CONDITION is null"); return (Criteria) this; } public Criteria andConditionIsNotNull() { addCriterion("CONDITION is not null"); return (Criteria) this; } public Criteria andConditionEqualTo(String value) { addCriterion("CONDITION =", value, "condition"); return (Criteria) this; } public Criteria andConditionNotEqualTo(String value) { addCriterion("CONDITION <>", value, "condition"); return (Criteria) this; } public Criteria andConditionGreaterThan(String value) { addCriterion("CONDITION >", value, "condition"); return (Criteria) this; } public Criteria andConditionGreaterThanOrEqualTo(String value) { addCriterion("CONDITION >=", value, "condition"); return (Criteria) this; } public Criteria andConditionLessThan(String value) { addCriterion("CONDITION <", value, "condition"); return (Criteria) this; } public Criteria andConditionLessThanOrEqualTo(String value) { addCriterion("CONDITION <=", value, "condition"); return (Criteria) this; } public Criteria andConditionLike(String value) { addCriterion("CONDITION like", value, "condition"); return (Criteria) this; } public Criteria andConditionNotLike(String value) { addCriterion("CONDITION not like", value, "condition"); return (Criteria) this; } public Criteria andConditionIn(List<String> values) { addCriterion("CONDITION in", values, "condition"); return (Criteria) this; } public Criteria andConditionNotIn(List<String> values) { addCriterion("CONDITION not in", values, "condition"); return (Criteria) this; } public Criteria andConditionBetween(String value1, String value2) { addCriterion("CONDITION between", value1, value2, "condition"); return (Criteria) this; } public Criteria andConditionNotBetween(String value1, String value2) { addCriterion("CONDITION not between", value1, value2, "condition"); return (Criteria) this; } public Criteria andTestGroupIsNull() { addCriterion("TEST_GROUP is null"); return (Criteria) this; } public Criteria andTestGroupIsNotNull() { addCriterion("TEST_GROUP is not null"); return (Criteria) this; } public Criteria andTestGroupEqualTo(String value) { addCriterion("TEST_GROUP =", value, "testGroup"); return (Criteria) this; } public Criteria andTestGroupNotEqualTo(String value) { addCriterion("TEST_GROUP <>", value, "testGroup"); return (Criteria) this; } public Criteria andTestGroupGreaterThan(String value) { addCriterion("TEST_GROUP >", value, "testGroup"); return (Criteria) this; } public Criteria andTestGroupGreaterThanOrEqualTo(String value) { addCriterion("TEST_GROUP >=", value, "testGroup"); return (Criteria) this; } public Criteria andTestGroupLessThan(String value) { addCriterion("TEST_GROUP <", value, "testGroup"); return (Criteria) this; } public Criteria andTestGroupLessThanOrEqualTo(String value) { addCriterion("TEST_GROUP <=", value, "testGroup"); return (Criteria) this; } public Criteria andTestGroupLike(String value) { addCriterion("TEST_GROUP like", value, "testGroup"); return (Criteria) this; } public Criteria andTestGroupNotLike(String value) { addCriterion("TEST_GROUP not like", value, "testGroup"); return (Criteria) this; } public Criteria andTestGroupIn(List<String> values) { addCriterion("TEST_GROUP in", values, "testGroup"); return (Criteria) this; } public Criteria andTestGroupNotIn(List<String> values) { addCriterion("TEST_GROUP not in", values, "testGroup"); return (Criteria) this; } public Criteria andTestGroupBetween(String value1, String value2) { addCriterion("TEST_GROUP between", value1, value2, "testGroup"); return (Criteria) this; } public Criteria andTestGroupNotBetween(String value1, String value2) { addCriterion("TEST_GROUP not between", value1, value2, "testGroup"); return (Criteria) this; } public Criteria andInstArrangeNoIsNull() { addCriterion("INST_ARRANGE_NO is null"); return (Criteria) this; } public Criteria andInstArrangeNoIsNotNull() { addCriterion("INST_ARRANGE_NO is not null"); return (Criteria) this; } public Criteria andInstArrangeNoEqualTo(String value) { addCriterion("INST_ARRANGE_NO =", value, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoNotEqualTo(String value) { addCriterion("INST_ARRANGE_NO <>", value, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoGreaterThan(String value) { addCriterion("INST_ARRANGE_NO >", value, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoGreaterThanOrEqualTo(String value) { addCriterion("INST_ARRANGE_NO >=", value, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoLessThan(String value) { addCriterion("INST_ARRANGE_NO <", value, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoLessThanOrEqualTo(String value) { addCriterion("INST_ARRANGE_NO <=", value, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoLike(String value) { addCriterion("INST_ARRANGE_NO like", value, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoNotLike(String value) { addCriterion("INST_ARRANGE_NO not like", value, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoIn(List<String> values) { addCriterion("INST_ARRANGE_NO in", values, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoNotIn(List<String> values) { addCriterion("INST_ARRANGE_NO not in", values, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoBetween(String value1, String value2) { addCriterion("INST_ARRANGE_NO between", value1, value2, "instArrangeNo"); return (Criteria) this; } public Criteria andInstArrangeNoNotBetween(String value1, String value2) { addCriterion("INST_ARRANGE_NO not between", value1, value2, "instArrangeNo"); return (Criteria) this; } public Criteria andAssginToIsNull() { addCriterion("ASSGIN_TO is null"); return (Criteria) this; } public Criteria andAssginToIsNotNull() { addCriterion("ASSGIN_TO is not null"); return (Criteria) this; } public Criteria andAssginToEqualTo(String value) { addCriterion("ASSGIN_TO =", value, "assginTo"); return (Criteria) this; } public Criteria andAssginToNotEqualTo(String value) { addCriterion("ASSGIN_TO <>", value, "assginTo"); return (Criteria) this; } public Criteria andAssginToGreaterThan(String value) { addCriterion("ASSGIN_TO >", value, "assginTo"); return (Criteria) this; } public Criteria andAssginToGreaterThanOrEqualTo(String value) { addCriterion("ASSGIN_TO >=", value, "assginTo"); return (Criteria) this; } public Criteria andAssginToLessThan(String value) { addCriterion("ASSGIN_TO <", value, "assginTo"); return (Criteria) this; } public Criteria andAssginToLessThanOrEqualTo(String value) { addCriterion("ASSGIN_TO <=", value, "assginTo"); return (Criteria) this; } public Criteria andAssginToLike(String value) { addCriterion("ASSGIN_TO like", value, "assginTo"); return (Criteria) this; } public Criteria andAssginToNotLike(String value) { addCriterion("ASSGIN_TO not like", value, "assginTo"); return (Criteria) this; } public Criteria andAssginToIn(List<String> values) { addCriterion("ASSGIN_TO in", values, "assginTo"); return (Criteria) this; } public Criteria andAssginToNotIn(List<String> values) { addCriterion("ASSGIN_TO not in", values, "assginTo"); return (Criteria) this; } public Criteria andAssginToBetween(String value1, String value2) { addCriterion("ASSGIN_TO between", value1, value2, "assginTo"); return (Criteria) this; } public Criteria andAssginToNotBetween(String value1, String value2) { addCriterion("ASSGIN_TO not between", value1, value2, "assginTo"); return (Criteria) this; } public Criteria andConclusionIsNull() { addCriterion("CONCLUSION is null"); return (Criteria) this; } public Criteria andConclusionIsNotNull() { addCriterion("CONCLUSION is not null"); return (Criteria) this; } public Criteria andConclusionEqualTo(String value) { addCriterion("CONCLUSION =", value, "conclusion"); return (Criteria) this; } public Criteria andConclusionNotEqualTo(String value) { addCriterion("CONCLUSION <>", value, "conclusion"); return (Criteria) this; } public Criteria andConclusionGreaterThan(String value) { addCriterion("CONCLUSION >", value, "conclusion"); return (Criteria) this; } public Criteria andConclusionGreaterThanOrEqualTo(String value) { addCriterion("CONCLUSION >=", value, "conclusion"); return (Criteria) this; } public Criteria andConclusionLessThan(String value) { addCriterion("CONCLUSION <", value, "conclusion"); return (Criteria) this; } public Criteria andConclusionLessThanOrEqualTo(String value) { addCriterion("CONCLUSION <=", value, "conclusion"); return (Criteria) this; } public Criteria andConclusionLike(String value) { addCriterion("CONCLUSION like", value, "conclusion"); return (Criteria) this; } public Criteria andConclusionNotLike(String value) { addCriterion("CONCLUSION not like", value, "conclusion"); return (Criteria) this; } public Criteria andConclusionIn(List<String> values) { addCriterion("CONCLUSION in", values, "conclusion"); return (Criteria) this; } public Criteria andConclusionNotIn(List<String> values) { addCriterion("CONCLUSION not in", values, "conclusion"); return (Criteria) this; } public Criteria andConclusionBetween(String value1, String value2) { addCriterion("CONCLUSION between", value1, value2, "conclusion"); return (Criteria) this; } public Criteria andConclusionNotBetween(String value1, String value2) { addCriterion("CONCLUSION not between", value1, value2, "conclusion"); return (Criteria) this; } public Criteria andDateCreatedIsNull() { addCriterion("DATE_CREATED is null"); return (Criteria) this; } public Criteria andDateCreatedIsNotNull() { addCriterion("DATE_CREATED is not null"); return (Criteria) this; } public Criteria andDateCreatedEqualTo(Date value) { addCriterionForJDBCDate("DATE_CREATED =", value, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedNotEqualTo(Date value) { addCriterionForJDBCDate("DATE_CREATED <>", value, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedGreaterThan(Date value) { addCriterionForJDBCDate("DATE_CREATED >", value, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("DATE_CREATED >=", value, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedLessThan(Date value) { addCriterionForJDBCDate("DATE_CREATED <", value, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("DATE_CREATED <=", value, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedIn(List<Date> values) { addCriterionForJDBCDate("DATE_CREATED in", values, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedNotIn(List<Date> values) { addCriterionForJDBCDate("DATE_CREATED not in", values, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedBetween(Date value1, Date value2) { addCriterionForJDBCDate("DATE_CREATED between", value1, value2, "dateCreated"); return (Criteria) this; } public Criteria andDateCreatedNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("DATE_CREATED not between", value1, value2, "dateCreated"); return (Criteria) this; } public Criteria andDateReceivedIsNull() { addCriterion("DATE_RECEIVED is null"); return (Criteria) this; } public Criteria andDateReceivedIsNotNull() { addCriterion("DATE_RECEIVED is not null"); return (Criteria) this; } public Criteria andDateReceivedEqualTo(Date value) { addCriterionForJDBCDate("DATE_RECEIVED =", value, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedNotEqualTo(Date value) { addCriterionForJDBCDate("DATE_RECEIVED <>", value, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedGreaterThan(Date value) { addCriterionForJDBCDate("DATE_RECEIVED >", value, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("DATE_RECEIVED >=", value, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedLessThan(Date value) { addCriterionForJDBCDate("DATE_RECEIVED <", value, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("DATE_RECEIVED <=", value, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedIn(List<Date> values) { addCriterionForJDBCDate("DATE_RECEIVED in", values, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedNotIn(List<Date> values) { addCriterionForJDBCDate("DATE_RECEIVED not in", values, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedBetween(Date value1, Date value2) { addCriterionForJDBCDate("DATE_RECEIVED between", value1, value2, "dateReceived"); return (Criteria) this; } public Criteria andDateReceivedNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("DATE_RECEIVED not between", value1, value2, "dateReceived"); return (Criteria) this; } public Criteria andPlanStartDateIsNull() { addCriterion("PLAN_START_DATE is null"); return (Criteria) this; } public Criteria andPlanStartDateIsNotNull() { addCriterion("PLAN_START_DATE is not null"); return (Criteria) this; } public Criteria andPlanStartDateEqualTo(Date value) { addCriterionForJDBCDate("PLAN_START_DATE =", value, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateNotEqualTo(Date value) { addCriterionForJDBCDate("PLAN_START_DATE <>", value, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateGreaterThan(Date value) { addCriterionForJDBCDate("PLAN_START_DATE >", value, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("PLAN_START_DATE >=", value, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateLessThan(Date value) { addCriterionForJDBCDate("PLAN_START_DATE <", value, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("PLAN_START_DATE <=", value, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateIn(List<Date> values) { addCriterionForJDBCDate("PLAN_START_DATE in", values, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateNotIn(List<Date> values) { addCriterionForJDBCDate("PLAN_START_DATE not in", values, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateBetween(Date value1, Date value2) { addCriterionForJDBCDate("PLAN_START_DATE between", value1, value2, "planStartDate"); return (Criteria) this; } public Criteria andPlanStartDateNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("PLAN_START_DATE not between", value1, value2, "planStartDate"); return (Criteria) this; } public Criteria andPlanEndDateIsNull() { addCriterion("PLAN_END_DATE is null"); return (Criteria) this; } public Criteria andPlanEndDateIsNotNull() { addCriterion("PLAN_END_DATE is not null"); return (Criteria) this; } public Criteria andPlanEndDateEqualTo(Date value) { addCriterionForJDBCDate("PLAN_END_DATE =", value, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateNotEqualTo(Date value) { addCriterionForJDBCDate("PLAN_END_DATE <>", value, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateGreaterThan(Date value) { addCriterionForJDBCDate("PLAN_END_DATE >", value, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("PLAN_END_DATE >=", value, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateLessThan(Date value) { addCriterionForJDBCDate("PLAN_END_DATE <", value, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("PLAN_END_DATE <=", value, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateIn(List<Date> values) { addCriterionForJDBCDate("PLAN_END_DATE in", values, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateNotIn(List<Date> values) { addCriterionForJDBCDate("PLAN_END_DATE not in", values, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateBetween(Date value1, Date value2) { addCriterionForJDBCDate("PLAN_END_DATE between", value1, value2, "planEndDate"); return (Criteria) this; } public Criteria andPlanEndDateNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("PLAN_END_DATE not between", value1, value2, "planEndDate"); return (Criteria) this; } public Criteria andActureStartDateIsNull() { addCriterion("ACTURE_START_DATE is null"); return (Criteria) this; } public Criteria andActureStartDateIsNotNull() { addCriterion("ACTURE_START_DATE is not null"); return (Criteria) this; } public Criteria andActureStartDateEqualTo(Date value) { addCriterionForJDBCDate("ACTURE_START_DATE =", value, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateNotEqualTo(Date value) { addCriterionForJDBCDate("ACTURE_START_DATE <>", value, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateGreaterThan(Date value) { addCriterionForJDBCDate("ACTURE_START_DATE >", value, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("ACTURE_START_DATE >=", value, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateLessThan(Date value) { addCriterionForJDBCDate("ACTURE_START_DATE <", value, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("ACTURE_START_DATE <=", value, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateIn(List<Date> values) { addCriterionForJDBCDate("ACTURE_START_DATE in", values, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateNotIn(List<Date> values) { addCriterionForJDBCDate("ACTURE_START_DATE not in", values, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateBetween(Date value1, Date value2) { addCriterionForJDBCDate("ACTURE_START_DATE between", value1, value2, "actureStartDate"); return (Criteria) this; } public Criteria andActureStartDateNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("ACTURE_START_DATE not between", value1, value2, "actureStartDate"); return (Criteria) this; } public Criteria andPredictEndDateIsNull() { addCriterion("PREDICT_END_DATE is null"); return (Criteria) this; } public Criteria andPredictEndDateIsNotNull() { addCriterion("PREDICT_END_DATE is not null"); return (Criteria) this; } public Criteria andPredictEndDateEqualTo(Date value) { addCriterionForJDBCDate("PREDICT_END_DATE =", value, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateNotEqualTo(Date value) { addCriterionForJDBCDate("PREDICT_END_DATE <>", value, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateGreaterThan(Date value) { addCriterionForJDBCDate("PREDICT_END_DATE >", value, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("PREDICT_END_DATE >=", value, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateLessThan(Date value) { addCriterionForJDBCDate("PREDICT_END_DATE <", value, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("PREDICT_END_DATE <=", value, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateIn(List<Date> values) { addCriterionForJDBCDate("PREDICT_END_DATE in", values, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateNotIn(List<Date> values) { addCriterionForJDBCDate("PREDICT_END_DATE not in", values, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateBetween(Date value1, Date value2) { addCriterionForJDBCDate("PREDICT_END_DATE between", value1, value2, "predictEndDate"); return (Criteria) this; } public Criteria andPredictEndDateNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("PREDICT_END_DATE not between", value1, value2, "predictEndDate"); return (Criteria) this; } public Criteria andActureEndDateIsNull() { addCriterion("ACTURE_END_DATE is null"); return (Criteria) this; } public Criteria andActureEndDateIsNotNull() { addCriterion("ACTURE_END_DATE is not null"); return (Criteria) this; } public Criteria andActureEndDateEqualTo(Date value) { addCriterionForJDBCDate("ACTURE_END_DATE =", value, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateNotEqualTo(Date value) { addCriterionForJDBCDate("ACTURE_END_DATE <>", value, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateGreaterThan(Date value) { addCriterionForJDBCDate("ACTURE_END_DATE >", value, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("ACTURE_END_DATE >=", value, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateLessThan(Date value) { addCriterionForJDBCDate("ACTURE_END_DATE <", value, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("ACTURE_END_DATE <=", value, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateIn(List<Date> values) { addCriterionForJDBCDate("ACTURE_END_DATE in", values, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateNotIn(List<Date> values) { addCriterionForJDBCDate("ACTURE_END_DATE not in", values, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateBetween(Date value1, Date value2) { addCriterionForJDBCDate("ACTURE_END_DATE between", value1, value2, "actureEndDate"); return (Criteria) this; } public Criteria andActureEndDateNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("ACTURE_END_DATE not between", value1, value2, "actureEndDate"); return (Criteria) this; } public Criteria andReviewedOnIsNull() { addCriterion("REVIEWED_ON is null"); return (Criteria) this; } public Criteria andReviewedOnIsNotNull() { addCriterion("REVIEWED_ON is not null"); return (Criteria) this; } public Criteria andReviewedOnEqualTo(Date value) { addCriterionForJDBCDate("REVIEWED_ON =", value, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnNotEqualTo(Date value) { addCriterionForJDBCDate("REVIEWED_ON <>", value, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnGreaterThan(Date value) { addCriterionForJDBCDate("REVIEWED_ON >", value, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("REVIEWED_ON >=", value, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnLessThan(Date value) { addCriterionForJDBCDate("REVIEWED_ON <", value, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("REVIEWED_ON <=", value, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnIn(List<Date> values) { addCriterionForJDBCDate("REVIEWED_ON in", values, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnNotIn(List<Date> values) { addCriterionForJDBCDate("REVIEWED_ON not in", values, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnBetween(Date value1, Date value2) { addCriterionForJDBCDate("REVIEWED_ON between", value1, value2, "reviewedOn"); return (Criteria) this; } public Criteria andReviewedOnNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("REVIEWED_ON not between", value1, value2, "reviewedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnIsNull() { addCriterion("RPT_AUTHORIZED_ON is null"); return (Criteria) this; } public Criteria andRptAuthorizedOnIsNotNull() { addCriterion("RPT_AUTHORIZED_ON is not null"); return (Criteria) this; } public Criteria andRptAuthorizedOnEqualTo(Date value) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON =", value, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnNotEqualTo(Date value) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON <>", value, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnGreaterThan(Date value) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON >", value, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnGreaterThanOrEqualTo(Date value) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON >=", value, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnLessThan(Date value) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON <", value, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnLessThanOrEqualTo(Date value) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON <=", value, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnIn(List<Date> values) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON in", values, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnNotIn(List<Date> values) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON not in", values, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnBetween(Date value1, Date value2) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON between", value1, value2, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedOnNotBetween(Date value1, Date value2) { addCriterionForJDBCDate("RPT_AUTHORIZED_ON not between", value1, value2, "rptAuthorizedOn"); return (Criteria) this; } public Criteria andRptAuthorizedByIsNull() { addCriterion("RPT_AUTHORIZED_BY is null"); return (Criteria) this; } public Criteria andRptAuthorizedByIsNotNull() { addCriterion("RPT_AUTHORIZED_BY is not null"); return (Criteria) this; } public Criteria andRptAuthorizedByEqualTo(String value) { addCriterion("RPT_AUTHORIZED_BY =", value, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByNotEqualTo(String value) { addCriterion("RPT_AUTHORIZED_BY <>", value, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByGreaterThan(String value) { addCriterion("RPT_AUTHORIZED_BY >", value, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByGreaterThanOrEqualTo(String value) { addCriterion("RPT_AUTHORIZED_BY >=", value, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByLessThan(String value) { addCriterion("RPT_AUTHORIZED_BY <", value, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByLessThanOrEqualTo(String value) { addCriterion("RPT_AUTHORIZED_BY <=", value, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByLike(String value) { addCriterion("RPT_AUTHORIZED_BY like", value, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByNotLike(String value) { addCriterion("RPT_AUTHORIZED_BY not like", value, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByIn(List<String> values) { addCriterion("RPT_AUTHORIZED_BY in", values, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByNotIn(List<String> values) { addCriterion("RPT_AUTHORIZED_BY not in", values, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByBetween(String value1, String value2) { addCriterion("RPT_AUTHORIZED_BY between", value1, value2, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andRptAuthorizedByNotBetween(String value1, String value2) { addCriterion("RPT_AUTHORIZED_BY not between", value1, value2, "rptAuthorizedBy"); return (Criteria) this; } public Criteria andQuotesIsNull() { addCriterion("QUOTES is null"); return (Criteria) this; } public Criteria andQuotesIsNotNull() { addCriterion("QUOTES is not null"); return (Criteria) this; } public Criteria andQuotesEqualTo(BigDecimal value) { addCriterion("QUOTES =", value, "quotes"); return (Criteria) this; } public Criteria andQuotesNotEqualTo(BigDecimal value) { addCriterion("QUOTES <>", value, "quotes"); return (Criteria) this; } public Criteria andQuotesGreaterThan(BigDecimal value) { addCriterion("QUOTES >", value, "quotes"); return (Criteria) this; } public Criteria andQuotesGreaterThanOrEqualTo(BigDecimal value) { addCriterion("QUOTES >=", value, "quotes"); return (Criteria) this; } public Criteria andQuotesLessThan(BigDecimal value) { addCriterion("QUOTES <", value, "quotes"); return (Criteria) this; } public Criteria andQuotesLessThanOrEqualTo(BigDecimal value) { addCriterion("QUOTES <=", value, "quotes"); return (Criteria) this; } public Criteria andQuotesIn(List<BigDecimal> values) { addCriterion("QUOTES in", values, "quotes"); return (Criteria) this; } public Criteria andQuotesNotIn(List<BigDecimal> values) { addCriterion("QUOTES not in", values, "quotes"); return (Criteria) this; } public Criteria andQuotesBetween(BigDecimal value1, BigDecimal value2) { addCriterion("QUOTES between", value1, value2, "quotes"); return (Criteria) this; } public Criteria andQuotesNotBetween(BigDecimal value1, BigDecimal value2) { addCriterion("QUOTES not between", value1, value2, "quotes"); return (Criteria) this; } public Criteria andActualFeeIsNull() { addCriterion("ACTUAL_FEE is null"); return (Criteria) this; } public Criteria andActualFeeIsNotNull() { addCriterion("ACTUAL_FEE is not null"); return (Criteria) this; } public Criteria andActualFeeEqualTo(BigDecimal value) { addCriterion("ACTUAL_FEE =", value, "actualFee"); return (Criteria) this; } public Criteria andActualFeeNotEqualTo(BigDecimal value) { addCriterion("ACTUAL_FEE <>", value, "actualFee"); return (Criteria) this; } public Criteria andActualFeeGreaterThan(BigDecimal value) { addCriterion("ACTUAL_FEE >", value, "actualFee"); return (Criteria) this; } public Criteria andActualFeeGreaterThanOrEqualTo(BigDecimal value) { addCriterion("ACTUAL_FEE >=", value, "actualFee"); return (Criteria) this; } public Criteria andActualFeeLessThan(BigDecimal value) { addCriterion("ACTUAL_FEE <", value, "actualFee"); return (Criteria) this; } public Criteria andActualFeeLessThanOrEqualTo(BigDecimal value) { addCriterion("ACTUAL_FEE <=", value, "actualFee"); return (Criteria) this; } public Criteria andActualFeeIn(List<BigDecimal> values) { addCriterion("ACTUAL_FEE in", values, "actualFee"); return (Criteria) this; } public Criteria andActualFeeNotIn(List<BigDecimal> values) { addCriterion("ACTUAL_FEE not in", values, "actualFee"); return (Criteria) this; } public Criteria andActualFeeBetween(BigDecimal value1, BigDecimal value2) { addCriterion("ACTUAL_FEE between", value1, value2, "actualFee"); return (Criteria) this; } public Criteria andActualFeeNotBetween(BigDecimal value1, BigDecimal value2) { addCriterion("ACTUAL_FEE not between", value1, value2, "actualFee"); return (Criteria) this; } public Criteria andTitleIsNull() { addCriterion("TITLE is null"); return (Criteria) this; } public Criteria andTitleIsNotNull() { addCriterion("TITLE is not null"); return (Criteria) this; } public Criteria andTitleEqualTo(String value) { addCriterion("TITLE =", value, "title"); return (Criteria) this; } public Criteria andTitleNotEqualTo(String value) { addCriterion("TITLE <>", value, "title"); return (Criteria) this; } public Criteria andTitleGreaterThan(String value) { addCriterion("TITLE >", value, "title"); return (Criteria) this; } public Criteria andTitleGreaterThanOrEqualTo(String value) { addCriterion("TITLE >=", value, "title"); return (Criteria) this; } public Criteria andTitleLessThan(String value) { addCriterion("TITLE <", value, "title"); return (Criteria) this; } public Criteria andTitleLessThanOrEqualTo(String value) { addCriterion("TITLE <=", value, "title"); return (Criteria) this; } public Criteria andTitleLike(String value) { addCriterion("TITLE like", value, "title"); return (Criteria) this; } public Criteria andTitleNotLike(String value) { addCriterion("TITLE not like", value, "title"); return (Criteria) this; } public Criteria andTitleIn(List<String> values) { addCriterion("TITLE in", values, "title"); return (Criteria) this; } public Criteria andTitleNotIn(List<String> values) { addCriterion("TITLE not in", values, "title"); return (Criteria) this; } public Criteria andTitleBetween(String value1, String value2) { addCriterion("TITLE between", value1, value2, "title"); return (Criteria) this; } public Criteria andTitleNotBetween(String value1, String value2) { addCriterion("TITLE not between", value1, value2, "title"); return (Criteria) this; } public Criteria andSeqNumIsNull() { addCriterion("SEQ_NUM is null"); return (Criteria) this; } public Criteria andSeqNumIsNotNull() { addCriterion("SEQ_NUM is not null"); return (Criteria) this; } public Criteria andSeqNumEqualTo(Long value) { addCriterion("SEQ_NUM =", value, "seqNum"); return (Criteria) this; } public Criteria andSeqNumNotEqualTo(Long value) { addCriterion("SEQ_NUM <>", value, "seqNum"); return (Criteria) this; } public Criteria andSeqNumGreaterThan(Long value) { addCriterion("SEQ_NUM >", value, "seqNum"); return (Criteria) this; } public Criteria andSeqNumGreaterThanOrEqualTo(Long value) { addCriterion("SEQ_NUM >=", value, "seqNum"); return (Criteria) this; } public Criteria andSeqNumLessThan(Long value) { addCriterion("SEQ_NUM <", value, "seqNum"); return (Criteria) this; } public Criteria andSeqNumLessThanOrEqualTo(Long value) { addCriterion("SEQ_NUM <=", value, "seqNum"); return (Criteria) this; } public Criteria andSeqNumIn(List<Long> values) { addCriterion("SEQ_NUM in", values, "seqNum"); return (Criteria) this; } public Criteria andSeqNumNotIn(List<Long> values) { addCriterion("SEQ_NUM not in", values, "seqNum"); return (Criteria) this; } public Criteria andSeqNumBetween(Long value1, Long value2) { addCriterion("SEQ_NUM between", value1, value2, "seqNum"); return (Criteria) this; } public Criteria andSeqNumNotBetween(Long value1, Long value2) { addCriterion("SEQ_NUM not between", value1, value2, "seqNum"); return (Criteria) this; } public Criteria andTsIsNull() { addCriterion("TS is null"); return (Criteria) this; } public Criteria andTsIsNotNull() { addCriterion("TS is not null"); return (Criteria) this; } public Criteria andTsEqualTo(String value) { addCriterion("TS =", value, "ts"); return (Criteria) this; } public Criteria andTsNotEqualTo(String value) { addCriterion("TS <>", value, "ts"); return (Criteria) this; } public Criteria andTsGreaterThan(String value) { addCriterion("TS >", value, "ts"); return (Criteria) this; } public Criteria andTsGreaterThanOrEqualTo(String value) { addCriterion("TS >=", value, "ts"); return (Criteria) this; } public Criteria andTsLessThan(String value) { addCriterion("TS <", value, "ts"); return (Criteria) this; } public Criteria andTsLessThanOrEqualTo(String value) { addCriterion("TS <=", value, "ts"); return (Criteria) this; } public Criteria andTsLike(String value) { addCriterion("TS like", value, "ts"); return (Criteria) this; } public Criteria andTsNotLike(String value) { addCriterion("TS not like", value, "ts"); return (Criteria) this; } public Criteria andTsIn(List<String> values) { addCriterion("TS in", values, "ts"); return (Criteria) this; } public Criteria andTsNotIn(List<String> values) { addCriterion("TS not in", values, "ts"); return (Criteria) this; } public Criteria andTsBetween(String value1, String value2) { addCriterion("TS between", value1, value2, "ts"); return (Criteria) this; } public Criteria andTsNotBetween(String value1, String value2) { addCriterion("TS not between", value1, value2, "ts"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
true
6f58c30051a72ae336cb116196a4af4395cdc147
Java
pepeto24/first-api-rest-library
/src/main/java/dev/elton/library/system/entities/Livro.java
UTF-8
2,656
2.296875
2
[]
no_license
package dev.elton.library.system.entities; import java.io.Serializable; import java.util.HashSet; import java.util.Set; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonIgnore; @Entity @Table(name = "livro") public class Livro implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String titulo; private String autor; private String descricao; private String editora; private String ano; private Double valor; @OneToMany(mappedBy = "id.livro") private Set<PedidoItem> itens = new HashSet<>(); //para nao admitir repeticao do msm item public Livro() { // default } public Livro(Long id, String titulo, String autor, String descricao, String editora, String ano, Double valor) { super(); this.id = id; this.titulo = titulo; this.autor = autor; this.descricao = descricao; this.editora = editora; this.ano = ano; this.setValor(valor); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitulo() { return titulo; } public void setTitulo(String titulo) { this.titulo = titulo; } public String getAutor() { return autor; } public void setAutor(String autor) { this.autor = autor; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } public String getEditora() { return editora; } public void setEditora(String editora) { this.editora = editora; } public String getAno() { return ano; } public void setAno(String ano) { this.ano = ano; } public Double getValor() { return valor; } public void setValor(Double valor) { this.valor = valor; } @JsonIgnore public Set<Pedido> getPedidos(){ Set<Pedido> set = new HashSet<>(); for(PedidoItem x : itens) { set.add(x.getPedido()); } return set; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Livro other = (Livro) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
true
e4a1d06e8198f9197807c20d67884c468100b922
Java
ganjahnavarro/mdl
/src/main/java/core/controller/CategoryController.java
UTF-8
2,048
2.1875
2
[]
no_license
package core.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import core.dto.CategoryData; import core.dto.mapper.CategoryMapper; import core.model.Category; import core.service.CategoryService; @CrossOrigin @RestController @RequestMapping("/category") public class CategoryController { @Autowired private CategoryService service; private CategoryMapper MAPPER = CategoryMapper.INSTANCE; @RequestMapping(value = { "/", "/list" }, method = RequestMethod.GET) public List<CategoryData> list( @RequestParam(value = "filter", required = false) String filter, @RequestParam(value = "pageSize", required = false) Integer pageSize, @RequestParam(value = "pageOffset", required = false) Integer pageOffset, @RequestParam(value = "orderedBy", required = false) String orderedBy) { return MAPPER.toData(service.findFilteredItems(filter, pageSize, pageOffset, orderedBy)); } @RequestMapping(value = "/", method = RequestMethod.POST) public CategoryData create(@RequestBody CategoryData categoryData) { Category category = MAPPER.fromData(categoryData); return MAPPER.toData((Category) service.save(category)); } @RequestMapping(value = "/", method = RequestMethod.PATCH) public CategoryData update(@RequestBody CategoryData categoryData) { Category category = MAPPER.fromData(categoryData); return MAPPER.toData((Category) service.update(category)); } @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) public void delete(@PathVariable Long id) { service.deleteRecordById(id); } }
true
b6c687c35e8cbea37fc925a43b1492d5bf3b6fee
Java
phunhan239/ExampleAndroid
/menu/app/src/main/java/dvan/example/com/MainActivity.java
UTF-8
3,053
2.203125
2
[]
no_license
package dvan.example.com; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.ContextMenu; import android.view.Gravity; import android.view.LayoutInflater; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity { private Button btnOk; private Button btnOk2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnOk = (Button) findViewById(R.id.ok_btn); btnOk2 = (Button) findViewById(R.id.ok_btn2); registerForContextMenu(btnOk); registerForContextMenu(btnOk2); } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater menuInflater = getMenuInflater(); switch (v.getId()) { case R.id.ok_btn: LayoutInflater layoutInflater = LayoutInflater.from(this); View view = layoutInflater.inflate(R.layout.item_menu_header, null); TextView tvText = (TextView) view.findViewById(R.id.tvText); tvText.setText("hello world"); menu.setHeaderView(view); menuInflater.inflate(R.menu.menu1, menu); break; case R.id.ok_btn2: menu.setHeaderTitle("menu2"); menu.setHeaderIcon(R.drawable.ic_launcher); menuInflater.inflate(R.menu.menu2, menu); break; } } @Override public boolean onContextItemSelected(MenuItem item) { int id = item.getItemId(); switch (id) { case R.id.menu_edit: Toast toast1 = Toast.makeText(getApplicationContext(), "Edit", Toast.LENGTH_SHORT); LayoutInflater layoutInflater = LayoutInflater.from(this); View view = layoutInflater.inflate(R.layout.item_toast, null); TextView tvText = (TextView) view.findViewById(R.id.tvText); tvText.setText("hello world"); toast1.setView(view); toast1.show(); break; case R.id.meu_delete: Toast toast = Toast.makeText(getApplicationContext(), "Delete", Toast.LENGTH_SHORT); toast.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 20); toast.show(); break; case R.id.menu_edit2: Toast.makeText(getApplicationContext(), "Edit2", Toast.LENGTH_SHORT).show(); break; case R.id.meu_delete2: Toast.makeText(getApplicationContext(), "Delete2", Toast.LENGTH_SHORT).show(); break; } return super.onContextItemSelected(item); } }
true
67ebda136e03d31a2f968eff27fb3126af4e871e
Java
volkmuth/FFT
/tests/com/example/data/ChartDataTest.java
UTF-8
1,523
3.15625
3
[]
no_license
package com.example.data; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; public class ChartDataTest { private double[] x, y; private ChartData data; private static final double tol = 0.001; @Before public void setUp() throws Exception { x = new double[100]; y = new double[100]; for (int i = 0; i < 100; i++) { x[i] = i; y[i] = (i - 50) * (i - 50) + 5; } data = new ChartData(x, y); } @Test public void testGetRangeMin() { assertEquals("Minimum for range", 5, data.getRangeMin(), tol); } @Test public void testGetRangeMax() { assertEquals("Maximum for range", 2505, data.getRangeMax(), tol); } @Test public void testGetDomainMin() { assertEquals("Minimum for domain", 0, data.getDomainMin(), tol); } @Test public void testGetDomainMax() { assertEquals("Max for domain", 99, data.getDomainMax(), tol); } @Test public void testSetXYValues() { double[] newX = new double[50]; double[] newY = new double[50]; for (int i = 0; i < 50; i++) { newX[i] = 49 - i; newY[i] = (i - 25) * (25 - i) - 15; } data.setXYValues(newX, newY); assertEquals("Min for domain", 0, data.getDomainMin(), tol); assertEquals("Max for domain", 49, data.getDomainMax(), tol); assertEquals("Min for range", -640, data.getRangeMin(), tol); assertEquals("Max for range", -15, data.getRangeMax(), tol); assertEquals("Number of x values", 50, data.getXValues().length); assertEquals("Number of y values", 50, data.getYValues().length); } }
true
a7ab43805b006c349bea153ebcc5b12899be0873
Java
Agus458/Proyecto-JavaEE
/SteamIndie/SteamIndieCentral/src/main/java/enums/TipoPost.java
UTF-8
65
1.84375
2
[]
no_license
package enums; public enum TipoPost { IMAGEN, VIDEO, TEXTO }
true
27af6f7daeb2c2fc09f74a677c6660609e8b885d
Java
kjwbn1/TwentyHour-projectclear
/app/src/main/java/com/kjw/twentyhour/model/NewOrderSheet.java
UTF-8
505
2.140625
2
[]
no_license
package com.kjw.twentyhour.model; import java.util.List; public class NewOrderSheet { public List<NewProduct> newProductList; public String totalPrice; public String employee; public String uploadDate; public NewOrderSheet(List<NewProduct> newProductList, String employee, String uploadDate, String totalPrice){ this.newProductList = newProductList; this.totalPrice = totalPrice; this.employee = employee; this.uploadDate = uploadDate; } }
true
15373bcb65d15417ba4200054353a14b69a9c6bd
Java
mbari-org/vcr4j
/vcr4j-core/src/main/java/org/mbari/vcr4j/SimpleVideoIO.java
UTF-8
1,918
2.59375
3
[ "Apache-2.0" ]
permissive
package org.mbari.vcr4j; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.subjects.Subject; /** * Sometimes you need a VideoIO object that is an amalgam of observables from different sources. * This class provides a way assemble a VideoIO object using disparate observables * * @author Brian Schlining * @since 2016-04-04T16:07:00 */ public class SimpleVideoIO<S extends VideoState, E extends VideoError> implements VideoIO<S, E> { private final String connectionID; private final Subject<VideoCommand<?>> commandSubject; private final Observable<E> errorObservable; private final Observable<S> stateObservable; private final Observable<VideoIndex> indexObservable; public SimpleVideoIO(String connectionID, Subject<VideoCommand<?>> commandSubject, Observable<S> stateObservable, Observable<E> errorObservable, Observable<VideoIndex> indexObservable) { this.connectionID = connectionID; this.commandSubject = commandSubject; this.errorObservable = errorObservable; this.stateObservable = stateObservable; this.indexObservable = indexObservable; } @Override public Subject<VideoCommand<?>> getCommandSubject() { return commandSubject; } @Override public Observable<E> getErrorObservable() { return errorObservable; } @Override public Observable<VideoIndex> getIndexObservable() { return indexObservable; } @Override public Observable<S> getStateObservable() { return stateObservable; } @Override public void close() { commandSubject.onComplete(); } @Override public <A extends VideoCommand<?>> void send(A videoCommand) { commandSubject.onNext(videoCommand); } @Override public String getConnectionID() { return connectionID; } }
true
091d9cf8182986dfd807cc5f8d9b555f5649d7c8
Java
Isamyrat/OnlineShop
/OnlineShop/src/main/java/org/own/OnlineShop/Repository/AdsRepository.java
UTF-8
206
1.671875
2
[]
no_license
package org.own.OnlineShop.Repository; import org.own.OnlineShop.model.Ads; import org.springframework.data.repository.CrudRepository; public interface AdsRepository extends CrudRepository<Ads, Long> { }
true
fb832e43ba6b15fb70544813c94b50bbb5bd5ddc
Java
fbayhan/springjpatutorial
/src/main/java/com/springdata/tarik/model/Category.java
UTF-8
1,670
2.390625
2
[]
no_license
package com.springdata.tarik.model; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity @Table(name = "tblCategory") public class Category { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long categoryId; private String categoryName; @ManyToMany(mappedBy = "productCategories") private List<Product> products; @ManyToMany() @JoinTable( name = "parentCategories", joinColumns = @JoinColumn(name = "sub_category_id"), inverseJoinColumns = @JoinColumn(name = "parrent_category_id")) private List<Category> parentCategories = new ArrayList<>(); @ManyToMany(mappedBy = "parentCategories") private List<Category> categories; public Long getCategoryId() { return categoryId; } public void setCategoryId(Long categoryId) { this.categoryId = categoryId; } public String getCategoryName() { return categoryName; } public void setCategoryName(String categoryName) { this.categoryName = categoryName; } public List<Product> getProducts() { return products; } public void setProducts(List<Product> products) { this.products = products; } public List<Category> getParentCategories() { return parentCategories; } public void setParentCategories(List<Category> parentCategories) { this.parentCategories = parentCategories; } public List<Category> getCategories() { return categories; } public void setCategories(List<Category> categories) { this.categories = categories; } }
true
04f79c3bcf5be762256b853a4fdf75f0c16d68b1
Java
juany-ramirez/EstructurasP3
/Complejos hospitalarios/src/complejos/Emergencia.java
UTF-8
748
1.984375
2
[]
no_license
/* * 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 complejos; import java.io.Serializable; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; /** * * @author Admin */ public class Emergencia implements Serializable { char rango; Hospital hospital; ArrayList<Paramedico> paramedicos; boolean terminada; boolean condicion; //validacion paramedicos, emergencia tratable //validacion ambulancia cercana public void run(){ while(condicion){ } } }
true
f0e1835471d0a399031126d108ef062d51b9446c
Java
risskla/bookmybook
/src/dao/AdminParametersDao.java
ISO-8859-2
5,928
2.515625
3
[]
no_license
package dao; import java.sql.Connection; import java.sql.Date; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import beans.AdminParameters; public class AdminParametersDao { public static int insert(AdminParameters a) { int res = 0; Connection cnx=null; try { cnx = ConnexionBDD.getInstance().getCnx(); //Requete String sql = "INSERT INTO AdminParameters(id,algoMatchBook,algoMatchReader,dateSaisie) " + "VALUES(?,?,?,?)"; PreparedStatement ps = cnx.prepareStatement(sql); ps.setInt(1, a.getId()); ps.setInt(2, a.getAlgoMatchBook()); ps.setInt(3, a.getAlgoMatchReader()); ps.setDate(4, (Date) a.getDateSaisie()); //Execution et traitement de la rponse res = ps.executeUpdate(); ConnexionBDD.getInstance().closeCnx(); } catch (SQLException e2) { e2.printStackTrace(); } return res; } public static int update(AdminParameters a) { int res = 0; Connection cnx=null; try { // chargement du driver cnx = ConnexionBDD.getInstance().getCnx(); //Requete String sql = "UPDATE AdminParameters SET id=?,algoMatchBook=?,algoMatchReader=?,dateSaisie=? WHERE id=?"; PreparedStatement ps = cnx.prepareStatement(sql); ps.setInt(1, a.getId()); ps.setInt(2, a.getAlgoMatchBook()); ps.setInt(3, a.getAlgoMatchReader()); ps.setDate(4, (Date) a.getDateSaisie()); ps.setInt(5, a.getId()); //Execution et traitement de la rponse res = ps.executeUpdate(); ConnexionBDD.getInstance().closeCnx(); } catch (SQLException e2) { e2.printStackTrace(); } return res; } public static int delete(int id) { int res = 0; Connection cnx=null; try { cnx = ConnexionBDD.getInstance().getCnx(); // ou Class.forName(com.mysql.jdbc.Driver.class.getName()); //Requete System.out.println("dans delete adminparameters"); String sql = "DELETE FROM AdminParameters WHERE id=?"; PreparedStatement ps = cnx.prepareStatement(sql); ps.setInt(1,id); //Execution et traitement de la rponse res = ps.executeUpdate(); ConnexionBDD.getInstance().closeCnx(); } catch (SQLException e) { e.printStackTrace(); } return res; } public static List<AdminParameters> findAll() { List<AdminParameters> le = new ArrayList<AdminParameters>(); Connection cnx=null; try { cnx = ConnexionBDD.getInstance().getCnx(); // ou Class.forName(com.mysql.jdbc.Driver.class.getName()); //Requete String sql = "SELECT id, algoMatchBook, algoMatchReader, dateSaisie FROM AdminParameters"; PreparedStatement ps = cnx.prepareStatement(sql); //Execution et traitement de la rponse ResultSet res = ps.executeQuery(); while(res.next()){ le.add(new AdminParameters(res.getInt("id"), res.getInt("algoMatchBook"), res.getInt("algoMatchReader"), res.getDate("dateSaisie") )); } res.close(); ConnexionBDD.getInstance().closeCnx(); } catch (SQLException e) { e.printStackTrace(); } // return le; } public static AdminParameters find(int id) { AdminParameters a = null; Connection cnx=null; try { cnx = ConnexionBDD.getInstance().getCnx(); // ou Class.forName(com.mysql.jdbc.Driver.class.getName()); //Requete String sql = "SELECT id, algoMatchBook, algoMatchReader, dateSaisie FROM AdminParameters WHERE id=?"; PreparedStatement ps = cnx.prepareStatement(sql); ps.setInt(1, id); //Execution et traitement de la rponse ResultSet res = ps.executeQuery(); while(res.next()){ a = new AdminParameters(res.getInt("id"), res.getInt("algoMatchBook"), res.getInt("algoMatchReader"), res.getDate("dateSaisie") ); break; } res.close(); ConnexionBDD.getInstance().closeCnx(); } catch (SQLException e2) { e2.printStackTrace(); } // return a; } public static List<AdminParameters> findAll(int start, int nbElts) { List<AdminParameters> la = new ArrayList<AdminParameters>(); Connection cnx=null; try { cnx = ConnexionBDD.getInstance().getCnx(); // ou Class.forName(com.mysql.jdbc.Driver.class.getName()); //Requete String sql = "SELECT id, algoMatchBook, algoMatchReader, dateSaisie FROM AdminParameters LIMIT ?,?"; PreparedStatement ps = cnx.prepareStatement(sql); ps.setInt(1, start); ps.setInt(2, nbElts); //Execution et traitement de la rponse ResultSet res = ps.executeQuery(); while(res.next()){ la.add(new AdminParameters(res.getInt("id"), res.getInt("algoMatchBook"), res.getInt("algoMatchReader"), res.getDate("dateSaisie") )); } res.close(); ConnexionBDD.getInstance().closeCnx(); } catch (SQLException e) { e.printStackTrace(); } // return la; } public static int countAdminParameters(){ int counter = 0; Connection cnx=null; try { cnx = ConnexionBDD.getInstance().getCnx(); String sql = "SELECT COUNT(*) FROM AdminParameters"; PreparedStatement ps = cnx.prepareStatement(sql); ResultSet res = ps.executeQuery(); while(res.next()){ counter = res.getInt("COUNT(*)"); break; } ConnexionBDD.getInstance().closeCnx(); }catch (SQLException e) { e.printStackTrace(); } return counter; } public static int getLastParameters(){ int max = 0; Connection cnx=null; try { cnx = ConnexionBDD.getInstance().getCnx(); String sql = "SELECT MAX(id) FROM AdminParameters"; PreparedStatement ps = cnx.prepareStatement(sql); ResultSet res = ps.executeQuery(); while(res.next()){ max = res.getInt("MAX(id)"); break; } ConnexionBDD.getInstance().closeCnx(); }catch (SQLException e) { e.printStackTrace(); } return max; } }
true
873a5b7abc8b5cbb355c6236fa684dadb8c862fd
Java
pabloigoldi/procesarFacturacion
/fuente/procesar.facturar.pedidos/src/main/java/modelo/Cliente.java
UTF-8
1,078
2.421875
2
[]
no_license
package modelo; import enums.CondicionImpositivaEnum; import enums.TipoDocumentoEnum; public class Cliente { private Long nro; private String domicilio; private CondicionImpositivaEnum condicionImpositiva; private TipoDocumentoEnum tipoDocumento; private Long nroDocumento; public Long getNro() { return nro; } public void setNro(Long nro) { this.nro = nro; } public String getDomicilio() { return domicilio; } public void setDomicilio(String domicilio) { this.domicilio = domicilio; } public TipoDocumentoEnum getTipoDocumento() { return tipoDocumento; } public void setTipoDocumento(TipoDocumentoEnum tipoDocumento) { this.tipoDocumento = tipoDocumento; } public Long getNroDocumento() { return nroDocumento; } public void setNroDocumento(Long nroDocumento) { this.nroDocumento = nroDocumento; } public CondicionImpositivaEnum getCondicioImpositiva() { return condicionImpositiva; } public void setCondicioImpositiva(CondicionImpositivaEnum condicionImpositiva) { this.condicionImpositiva = condicionImpositiva; } }
true
6e152403dcc5225df4752b42b3b310485d4300af
Java
ductmkma/quanlydoanvien
/src/main/java/com/zent/controller/ForgotPasswordServlet.java
UTF-8
5,302
2.203125
2
[]
no_license
package com.zent.controller; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Properties; import java.util.Random; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.NoSuchProviderException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeUtility; import javax.servlet.ServletException; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.zent.dao.ForgotPasswordDAO; import com.zent.util.SecurityUtil; /** * Servlet implementation class ForgotPasswordServlet */ @WebServlet("/forgotpassword") @MultipartConfig public class ForgotPasswordServlet extends HttpServlet { private static final long serialVersionUID = 1L; private ForgotPasswordDAO forgotPassDAO = new ForgotPasswordDAO(); /** * @see HttpServlet#HttpServlet() */ public ForgotPasswordServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getRequestDispatcher("/pages/quenmatkhau.jsp").forward( request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String email = request.getParameter("email"); if(email!=null){ if(forgotPassDAO.checkEmail(email)){ int newpass = rand(10000000, 99999999); try { sendMail(email, newpass); } catch (NoSuchProviderException e) { // TODO Auto-generated catch block e.printStackTrace(); } String password = SecurityUtil.md5(String.valueOf(newpass)); Date dateNow = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd"); String updated_at = sdf.format(dateNow); forgotPassDAO.updatePassword(email, password, updated_at); response.sendRedirect(request.getContextPath()+"/login"); }else{ response.getWriter().write("notExist"); } } } public int rand(int min, int max) { try { Random rn = new Random(); int range = max - min + 1; int randomNum = min + rn.nextInt(range); return randomNum; } catch (Exception e) { e.printStackTrace(); return -1; } } public void sendMail(String email,int newpass) throws NoSuchProviderException{ String smtpServer = "smtp.gmail.com"; int port = 587; final String userid = "minhduccomputer.kma@gmail.com";//change accordingly final String password = "Duckien121115";//change accordingly String contentType = "text/html; charset=UTF-8"; String subject = "RESET PASSWORD <NO-REPLY> ! "; String from = "Zent Group"; String to = email;//some invalid address String bounceAddr = email;//change accordingly String body = "Chào bạn, mật khẩu mới của bạn là: "+newpass; Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", smtpServer); props.put("mail.smtp.port", "587"); props.put("mail.transport.protocol", "smtp"); props.put("mail.smtp.from", bounceAddr); Session mailSession = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(userid, password); } }); MimeMessage message = new MimeMessage(mailSession); try { message.addFrom(InternetAddress.parse(from)); } catch (MessagingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { message.setRecipients(Message.RecipientType.TO, to); } catch (MessagingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { message.setSubject(MimeUtility.encodeText(subject, "UTF-8", "B")); } catch (UnsupportedEncodingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (MessagingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { message.setContent(body, contentType); } catch (MessagingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } Transport transport = mailSession.getTransport(); try { System.out.println("Sending ...."); transport.connect(smtpServer, port, userid, password); transport.sendMessage(message, message.getRecipients(Message.RecipientType.TO)); System.out.println("Sending done ..."); } catch (Exception e) { System.err.println("Error Sending: "); e.printStackTrace(); } try { transport.close(); } catch (MessagingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
true
d9c9b7b523aa41881de09927d59dadadb21b0b62
Java
abrums21/muscleCaptain
/src/com/chenglong/muscle/MyTipDB.java
UTF-8
5,497
2.765625
3
[ "Apache-2.0" ]
permissive
package com.chenglong.muscle; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; public class MyTipDB { private SQLiteDatabase db = null; private static String MY_DATABASE_PATH = "/data/data/com.chenglong.muscle/databases"; private static String MY_DATABASE_FILENAME = "my.db"; public MyTipDB() { openAndCreateDb(); // createTable(); return; } private void openAndCreateDb() { // db = // SQLiteDatabase.openOrCreateDatabase("/data/data/com.chenglong.muscle/tmp3.db", // null); db = SQLiteDatabase.openOrCreateDatabase(MY_DATABASE_PATH +"/" + MY_DATABASE_FILENAME, null); } private void createTable() { String sql = "create table tipsTbl(id integer primary key, info text)"; db.execSQL(sql); } public void insert(int id, String info) { String sql = "insert into tipsTbl(id, info) values(" + id + ", '" + info + "')"; db.execSQL(sql); } public void delete(int id) { String sql = "delete from tipsTbl where id=" + id; db.execSQL(sql); } public int getNum() { Cursor cursor = db.query("tipsTbl", null, null, null, null, null, null); return cursor.getCount(); } public String query(int id) { String tips = ""; Cursor cursor = db.query("tipsTbl", new String[] { "info" }, "id=?", new String[] { "" + id }, null, null, null); while (cursor.moveToNext()) { tips = cursor.getString(cursor.getColumnIndex("info")); } return tips; } public void close() { db.close(); } public static void openDatabase(Context context) { try { // 获得dictionary.db文件的绝对路径 String databaseFilename = MY_DATABASE_PATH + "/" + MY_DATABASE_FILENAME; File dir = new File(MY_DATABASE_PATH); // 如果/sdcard/dictionary目录中存在,创建这个目录 if (!dir.exists()) dir.mkdir(); if ((new File(databaseFilename)).exists()) { (new File(databaseFilename)).delete(); } // 如果在/sdcard/dictionary目录中不存在 // dictionary.db文件,则从res\raw目录中复制这个文件到 // SD卡的目录(/sdcard/dictionary) // if (!(new File(databaseFilename)).exists()) { // 获得封装dictionary.db文件的InputStream对象 InputStream is = context.getResources().openRawResource(R.raw.my); FileOutputStream fos = new FileOutputStream(databaseFilename); byte[] buffer = new byte[is.available()]; int count = 0; // 开始复制dictionary.db文件 while ((count = is.read(buffer)) > 0) { fos.write(buffer, 0, count); } fos.close(); is.close(); // } // 打开/sdcard/dictionary目录中的dictionary.db文件 //SQLiteDatabase database = SQLiteDatabase.openOrCreateDatabase(databaseFilename, null); return; } catch (Exception e) { e.printStackTrace(); } } // public static void stub_tipsDbStore() { // MyTipDB db = new MyTipDB(); // db.createTable(); // db.insert(1, "为了能在银幕上展示最好的肌肉状态,克里斯·埃文斯每拍一个镜头前都必须进行大量运动,比如说连续400个俯卧撑"); // db.insert(2, "克里斯·埃文斯遵循少食多餐原则,以低碳水化合物、高蛋白为主,在正餐间辅以水果、坚果、运动营养补剂作为加餐"); // db.insert(3, "每部戏之前,克里斯·埃文斯都要根据角色需要,调整自己的体重,当然对于美国队长这样的英雄人物,增加肌肉和瘦体重是主要训练内容。克里斯·埃文斯采用的是分离式力量训练,即每天只训练一个部位的肌肉群"); // db.insert(4, // "6盎司(170克)的鱼提供34克蛋白质,4克欧米伽-3脂肪酸,一种降低肿痛帮助肌肉修复的健康脂肪,并且它可以帮助抑制皮质醇。(皮质醇水平下降,睾丸酮素的水平就会逐渐升高,帮助肌肉增长。)富含欧米伽-3脂肪酸的饮食还可以让大多数吸收的葡萄糖进入肌肉而不是转化为脂肪"); // db.insert(5, // "克里斯·埃文斯每天都必须锻炼两小时,强度令人难以想象。“我非常喜欢运动,也经常健身,但这次真是令人崩溃,我练到都快吐了,而我的新陈代谢本来就很快,这是更令人烦躁的,有时候我已经明明吃饱了,连看着一块肌肉都想吐,但你必须汲取蛋白质,所以你必须吃。”"); // db.insert(6, "想增加肌肉,牛肉是不可或缺的。牛肉中天然的蛋白质结构更能满足人体的合成需要。对于健身的人来说,一周要保证2次的牛肉摄入。阿诺德·施瓦辛格在训练期,每天的食物摄入就必须有牛肉的"); // db.insert(7, "鸡蛋中的蛋白质是最易被人体吸收的,是健身后迅速补充蛋白质的首选,同时又能为肌肉合成提供必要的维生素和矿物质"); // db.insert(8, "如果你的并不胖,那就喝全脂奶吧。全脂奶中的短链脂肪对肌肉的合成非常重要,同时能帮助身体吸收更多的维生素,又能预防一些疾病的发生"); // db.insert(9, "酸奶两大作用,一个是含有益菌,帮助身体消化吸收食物。另一个则是含大量的钙元素,能够有效的控制肌肉的收缩过程"); // db.insert(10, "大蒜的作用想不到吧!不含有蛋白质和脂肪的食物如何帮助增长肌肉?最重要的一点是能够提升体内荷尔蒙的含量,来形成一个肌肉合成的环境"); // db.close(); // } }
true
477e35966900c3834f54b5dcbd0d9ef17eb5b241
Java
bhargavskr/JavaProg
/ArraysDemo.java
UTF-8
629
3.5625
4
[]
no_license
import java.util.*; class ArraysDemo { public static void main(String arg[]) { int a[]=new int[10]; for(int i=0;i<10;i++) { a[i]=-3*i; } System.out.print(" Contents"); display(a); System.out.print(" Sorted "); Arrays.sort(a); display(a); Arrays.fill(a,2,6,-1); System.out.print(" Filled "); display(a); Arrays.sort(a); System.out.print(" SOrted "); display(a); int in=Arrays.binarySearch(a,-9); System.out.print("Search -9 at "+in); } static void display(int a[]) { for(int m:a) System.out.print(m+" "); System.out.println(); } }
true
e50776426dd5f4018e9cb9e7ee460becda8df6b0
Java
douglashu/hq-forecast
/scrati/common/src/main/java/com/hq/scrati/common/util/geo/pointgrid/IPointAreaGather.java
UTF-8
511
2.125
2
[]
no_license
package com.hq.scrati.common.util.geo.pointgrid; import java.util.List; import com.hq.scrati.common.util.geo.base.IPoint; /** * 点集合范围判断 * @author MAC */ public interface IPointAreaGather { /** * 初始化 */ void init(); /** * 设置点集合 * @param cacheList */ void setCacheList(List<IPoint> cacheList); /** * 是否位于点整范围内 * @param dstPoint * @param distance * @return */ List<PointAreaWrapper> isInArea(IPoint dstPoint,Double distance); }
true
1ece11f4f40b2e906c7153acf2573812e0b4ea44
Java
evanluo1988/risk-management
/start_model/src/main/java/com/springboot/cache/ServerCacheLoader.java
UTF-8
2,645
1.984375
2
[]
no_license
package com.springboot.cache; import com.springboot.service.*; import com.springboot.utils.DetectCacheUtils; import com.springboot.utils.ServerCacheUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; @Slf4j @Component public class ServerCacheLoader implements CommandLineRunner { @Autowired private MenuService menuService; @Autowired private RoleService roleService; @Autowired private AreaService areaService; @Autowired private EtlTranRuleService etlTranRuleService; @Autowired private TableStructService tableStructService; @Autowired private QuotaRuleService quotaRuleService; @Autowired private QuotaGrandService quotaGrandService; @Autowired private QuotaDimensionService quotaDimensionService; @Autowired private LegalDataAddColumnService legalDataAddColumnService; @Autowired private DicTableService dicTableService; @Value("${server.servlet.context-path}") private String contextPath; @Override public void run(String... args) { log.info("cache context path ......"); ServerCacheUtils.setContextPathCache(contextPath); log.info("loading menu list......"); ServerCacheUtils.setMenuListCache(menuService.findAllMenus()); log.info("loading role permission......"); ServerCacheUtils.setRolePermissionCache(roleService.findAllRolePermission()); log.info("loading area ......"); ServerCacheUtils.setAreas(areaService.list()); log.info("loading etl tran rule list......"); DetectCacheUtils.setEtlTranRuleListCache(etlTranRuleService.findEnableRules()); log.info("loading std table struct......"); DetectCacheUtils.setStdTableMap(tableStructService.getStdTableStruct()); log.info("loading quota list......"); DetectCacheUtils.setQuotaList(quotaRuleService.findEnableQuotaRules()); log.info("loading quota grand list......"); DetectCacheUtils.setQuotaGrandList(quotaGrandService.findQuotaGrandList()); log.info("loading quota dimensions......"); DetectCacheUtils.setQuotaDimensionList(quotaDimensionService.getAllQuotaDimensions()); log.info("loading analysis of justice data......"); legalDataAddColumnService.initAnalysisJudicialEngine(); log.info("loading dic table data......"); DetectCacheUtils.setDicTable(dicTableService.getDicTableList()); } }
true
adcb339f2f45588c2b1981476f29b9e9ac2d69a6
Java
chenshuo/bazel
/src/test/java/com/google/devtools/build/android/desugar/testdata/java8/InterfaceMethod.java
UTF-8
1,967
2.25
2
[ "Apache-2.0" ]
permissive
// Copyright 2017 The Bazel Authors. 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 com.google.devtools.build.android.desugar.testdata.java8; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; /** * Desugar test input interface that declares lambdas and method references in default and static * interface methods. */ public interface InterfaceMethod { public default List<String> defaultMethodReference(List<String> names) { return names.stream().filter(this::startsWithS).collect(Collectors.toList()); } public default String defaultInvokingBootclasspathMethods(String expectedValue) { return Stream.of(expectedValue).findFirst().orElse("unexpected"); } public default List<String> staticMethodReference(List<String> names) { return names.stream().filter(InterfaceMethod::startsWithA).collect(Collectors.toList()); } public default List<String> lambdaCallsDefaultMethod(List<String> names) { return names.stream().filter(s -> startsWithS(s)).collect(Collectors.toList()); } public static boolean startsWithA(String input) { return input.startsWith("A"); } public default boolean startsWithS(String input) { return input.startsWith("S"); } /** * Empty class implementing {@link InterfaceMethod} so the test can instantiate and call default * methods. */ public static class Concrete implements InterfaceMethod {} }
true
d7d6b4028e8d2a978f29048ea6ababe8638b45d4
Java
crsedgar/test-utils
/modules/test-db-api/src/main/java/uk/org/cobaltdevelopment/test/db/dataset/DataSetContext.java
UTF-8
2,425
2.984375
3
[]
no_license
package uk.org.cobaltdevelopment.test.db.dataset; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Context for storing values that are made available to any replacement * <code>DataSet</code> implementations. * * @author "Christopher Edgar" * */ public class DataSetContext { private static final Logger LOGGER = LoggerFactory .getLogger(DataSetContext.class); private Map<String, Object> context = new HashMap<String, Object>(); /** * Retrieve value from context by key. * * @param key * @throws IllegalArgumentException * thrown when no object found for key */ public Object get(String key) throws IllegalArgumentException { Object result = context.get(key); if (result == null) { throw new IllegalArgumentException("No object found for key: " + key); } return result; } /** * Generics version of context getter. * * @throws IllegalArgumentException * thrown when no object found for key */ @SuppressWarnings("unchecked") public <T> T get(Class<T> valueType, String key) throws IllegalArgumentException { LOGGER.debug("Retrieving value with key {} from Test Context", key); try { T result = (T) context.get(key); if (result == null) { throw new IllegalArgumentException("No object found for key: " + key); } LOGGER.debug("Return {}", result); return result; } catch (Exception e) { LOGGER.error("ERROR retrieving value from Test Context", e); throw new IllegalArgumentException( String.format( "Error retrieving context value of type [%s] with key [%s]", valueType.getSimpleName(), key)); } } /** * Set a value into the context identifiable by key. Any value with same key * is replaced. */ public <T> void set(String key, T value) { LOGGER.debug("Setting value with key {} into Test Context", key); context.put(key, value); } /** * Returns the keys for all object sin context as an iterator. * */ public Iterator<String> keys() { return context.keySet().iterator(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("DataSetContext{context["); for (String key : context.keySet()) { sb.append(key) .append(":") .append(context.get(key)) .append(","); } sb.append("]}"); return sb.toString(); } }
true
61ed8b11519dcd999fc6781309d28949846de373
Java
BrandonTownson/Android-Final
/lab1/listItems.java
UTF-8
4,732
2.1875
2
[]
no_license
package com.example.brandon.lab1; import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.provider.MediaStore; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageButton; import android.widget.Switch; import android.widget.Toast; public class listItems extends AppCompatActivity { private final int REQUEST_IMAGE_CAPTURE = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list_items); ImageButton imgbutton = (ImageButton) findViewById(R.id.imageButton); Switch switch1 = (Switch) findViewById(R.id.switch1); CheckBox check = (CheckBox) findViewById(R.id.checkBox); imgbutton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent photoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (photoIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(photoIntent, REQUEST_IMAGE_CAPTURE); } } }); switch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){ @Override public void onCheckedChanged (CompoundButton click, boolean isChecked){ Toast.makeText(getApplication(), "the switch is "+ (isChecked ? "on" : "off"), Toast.LENGTH_SHORT).show(); /** if (isChecked){ CharSequence text = "switch is on"; } else { CharSequence text = "Switch is off"; } **/ } }); check.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { AlertDialog.Builder builder = new AlertDialog.Builder(listItems.this); // 2. Chain together various setter methods to set the dialog characteristics builder.setMessage(R.string.dialog_message) //Add a dialog message to strings.xml .setTitle(R.string.dialog_title) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // User clicked OK button Intent resultIntent = new Intent( ); resultIntent.putExtra("Response", "My information to share"); setResult(Activity.RESULT_OK, resultIntent); finish(); } }) .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // User cancelled the dialog } }) .show(); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) { ImageButton imgbutton = (ImageButton) findViewById(R.id.imageButton); Bundle extras = data.getExtras(); Bitmap imageBitmap = (Bitmap) extras.get("data"); imgbutton.setImageBitmap(imageBitmap); } } protected static final String ACTIVITY_NAME= "ListItems"; @Override public void onDestroy(){ super.onDestroy(); Log.i(ACTIVITY_NAME,"In onDestroy()"); } @Override public void onStop(){ super.onStop(); Log.i(ACTIVITY_NAME,"In onStop()"); } @Override public void onPause(){ super.onPause(); Log.i(ACTIVITY_NAME,"In onPause()"); } @Override public void onStart(){ super.onStart(); Log.i(ACTIVITY_NAME,"In onStart"); } @Override public void onResume(){ super.onResume(); Log.i(ACTIVITY_NAME,"In onResume"); } }
true
b7a024b6ba39d1f733763829da4ea7f41bfe6822
Java
ZiqiPolimeros/Java-Chapter4-Loops-and-Files-Chapter5-Methods
/Arithmetica.java
UTF-8
1,930
4.21875
4
[ "MIT" ]
permissive
package arithmetica; import java.util.Scanner; public class Arithmetica { public static void main(String[] args) { String a; System.out.println("If you want to calculate square of a number,please type in \"square(number)\".\n "+ "If you want to calculate four times a number, please type in \"quadruple(number)\".\n" + "If you want to calculate the quotion and remainder of an integer, please type in \"divisionWithR(integer)\".\n"+ "If you want to convert centimeter to feet and inches, please type in \"centimetersToFeetAndInches(number)\".\n" ); Scanner s = new Scanner(System.in); a = s.nextLine(); double inputAsDouble = Double.parseDouble(a); int inputAsInt = Integer.parseInt(a); System.out.println("Square of the number is " + square(inputAsDouble)); System.out.println("Four times of the number is " + quadruple(inputAsDouble)); System.out.println("The division of the number is "+ divisionWithR(inputAsInt, 3)); System.out.println("It's " + centimetersToFeetAndInches(inputAsDouble)); } public static double square(double x){ return (x*x); } public static double quadruple(double y){ return y*4; } public static String divisionWithR(int int1, int int2){ int q = int1/int2; int r = int1%int2; return q + "R" +r; } public static String centimetersToFeetAndInches(double centimeter){ double feet = centimeter / 30.48; double inch = (centimeter - feet * 30.48)/2.54; return feet + "feet" + inch +"inch"; } }
true
c96f9276f6b0bda9aef7bf311c812ce11d86bd85
Java
VDuda/SyncRunner-Pub
/src/API/amazon/mws/xml/JAXB/PaymentTypes.java
UTF-8
1,965
2.03125
2
[ "MIT" ]
permissive
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.05.03 at 03:15:27 PM EDT // package API.amazon.mws.xml.JAXB; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for PaymentTypes. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="PaymentTypes"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="Bank Account"/> * &lt;enumeration value="Credit Card"/> * &lt;enumeration value="Credit Line"/> * &lt;enumeration value="Debit Card"/> * &lt;enumeration value="Invoice Account"/> * &lt;enumeration value="Store Card"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "PaymentTypes") @XmlEnum public enum PaymentTypes { @XmlEnumValue("Bank Account") BANK_ACCOUNT("Bank Account"), @XmlEnumValue("Credit Card") CREDIT_CARD("Credit Card"), @XmlEnumValue("Credit Line") CREDIT_LINE("Credit Line"), @XmlEnumValue("Debit Card") DEBIT_CARD("Debit Card"), @XmlEnumValue("Invoice Account") INVOICE_ACCOUNT("Invoice Account"), @XmlEnumValue("Store Card") STORE_CARD("Store Card"); private final String value; PaymentTypes(String v) { value = v; } public String value() { return value; } public static PaymentTypes fromValue(String v) { for (PaymentTypes c: PaymentTypes.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
true
7663b255ddc731615db40c430ebdee132d275db8
Java
somsomy/petcenter
/src/main/java/com/somsomy/domain/CatsBean.java
UTF-8
2,498
2.265625
2
[]
no_license
package com.somsomy.domain; import java.sql.Timestamp; public class CatsBean { private int catId; private String catName; private String catAge; private String catGender; private String catNeuter; private String catDate; private String catVaccination; private String catIng; private String catInfo; private Timestamp date; private String fileName; private String fileRealName; private int readcount; public int getCatId() { return catId; } public void setCatId(int catId) { this.catId = catId; } public String getCatName() { return catName; } public void setCatName(String catName) { this.catName = catName; } public String getCatAge() { return catAge; } public void setCatAge(String catAge) { this.catAge = catAge; } public String getCatGender() { return catGender; } public void setCatGender(String catGender) { this.catGender = catGender; } public String getCatNeuter() { return catNeuter; } public void setCatNeuter(String catNeuter) { this.catNeuter = catNeuter; } public String getCatDate() { return catDate; } public void setCatDate(String catDate) { this.catDate = catDate; } public String getCatVaccination() { return catVaccination; } public void setCatVaccination(String catVaccination) { this.catVaccination = catVaccination; } public String getCatIng() { return catIng; } public void setCatIng(String catIng) { this.catIng = catIng; } public String getCatInfo() { return catInfo; } public void setCatInfo(String catInfo) { this.catInfo = catInfo; } public Timestamp getDate() { return date; } public void setDate(Timestamp date) { this.date = date; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public String getFileRealName() { return fileRealName; } public void setFileRealName(String fileRealName) { this.fileRealName = fileRealName; } public int getReadcount() { return readcount; } public void setReadcount(int readcount) { this.readcount = readcount; } @Override public String toString() { return "CatsBean [catId=" + catId + ", catName=" + catName + ", catAge=" + catAge + ", catGender=" + catGender + ", catNeuter=" + catNeuter + ", catDate=" + catDate + ", catVaccination=" + catVaccination + ", catIng=" + catIng + ", catInfo=" + catInfo + ", date=" + date + ", fileName=" + fileName + ", fileRealName=" + fileRealName + ", readcount=" + readcount + "]"; } }
true
6fb2d3c31e4cfd11cbf6f3e5531c0cddfa68b11d
Java
ttnam/testhau
/app/src/main/java/io/yostajsc/izigo/usecase/trip/adapter/MemberActiveOnMapsAdapter.java
UTF-8
2,415
2.359375
2
[]
no_license
package io.yostajsc.izigo.usecase.trip.adapter; import android.content.Context; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import java.util.ArrayList; import java.util.Collections; import java.util.List; import io.yostajsc.izigo.R; import io.yostajsc.izigo.usecase.map.model.Person; import io.yostajsc.izigo.usecase.trip.viewholder.ActiveMemberOnMapsViewHolder; /** * Created by Phuc-Hau Nguyen on 10/14/2016. */ public class MemberActiveOnMapsAdapter extends RecyclerView.Adapter<ActiveMemberOnMapsViewHolder> { private Context mContext = null; private List<Person> mList = null; public MemberActiveOnMapsAdapter(Context context) { this.mContext = context; this.mList = new ArrayList<>(); } @Override public ActiveMemberOnMapsViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemLayoutView = LayoutInflater.from(mContext).inflate(R.layout.item_map_person, null); itemLayoutView.setLayoutParams(new CardView.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); return new ActiveMemberOnMapsViewHolder(itemLayoutView); } @Override public void onBindViewHolder(ActiveMemberOnMapsViewHolder holder, int position) { Person person = mList.get(position); holder.bind(person.getAvatar(), person.getName(), person.getDistance(), person.getTime(), person.isVisible()); } @Override public int getItemCount() { if (mList == null) return 0; return mList.size(); } public Person getItem(int position) { if (position < 0 || position >= getItemCount()) { return null; } return this.mList.get(position); } public void add(Person person) { this.mList.add(person); notifyDataSetChanged(); } public void replaceAll(Person[] person) { if (person == null) return; if (this.mList == null) this.mList = new ArrayList<>(); this.mList.clear(); Collections.addAll(mList, person); notifyDataSetChanged(); } public void clear() { if (this.mList != null) this.mList.clear(); } }
true
39540d8379c65d5f27594adbf2533a91029338f8
Java
charulatalodha/BulletinBuzz
/Bulletin_Buzz/src/com/example/bulletin_buzz/mba.java
UTF-8
8,824
1.914063
2
[]
no_license
package com.example.bulletin_buzz; import java.util.ArrayList; import java.util.List; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.Toast; public class mba extends Activity { private ProgressDialog pDialog; String tag="log" ; // JSON parser class JSONParser jsonParser = new JSONParser(); private static String POST_URL ="http://10.0.2.2/bbuz/post.php"; private static String GET_POST_URL ="http://10.0.2.2/bbuz/get_post.php"; ////"http://10.0.2.2/bbuz/login.php"; private static final String TAG_SUCCESS = "success"; private static final String TAG_MESSAGE = "message"; JSONObject json=new JSONObject(); JSONObject json1=new JSONObject(); JSONArray jsarr=new JSONArray(); String got_name,got_id,got_postdata; Button bcomment; EditText writecmt; ListView clist; String count="5",uname,pwd,id1; int cnt=1,id; private ArrayList<String> itemArrey2 = new ArrayList<String>(); private ArrayAdapter<String> adapter2; public String[] cmtlist = new String[] { "Which is the best Institute for prep of MBA in Nagpur", "Latest technology to work on :hadoop"}; public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.mba); Intent intent = getIntent(); uname = intent.getStringExtra(career.cNAME); // id1 = intent.getStringExtra(MainActivity.ID); /* Bundle extras = getIntent().getExtras(); if(extras !=null) { uname = extras.getString("NAME"); // id1 = extras.getString("ID"); //id=Integer.parseInt(id1); } */ /* Intent i = getIntent(); if (i.hasExtra("NAME")){ uname = i.getStringExtra("NAME"); } */ Log.d("uname", uname); new ListPost().execute(); //Log.d("itemArrey2", itemArrey2[i]); bcomment = (Button) findViewById(R.id.bcomment); writecmt=(EditText)findViewById(R.id.writecmt); clist = (ListView) findViewById(R.id.cmtlistView); //itemArrey2 = new ArrayList<String>(); /* for(int j=0;j<cmtlist.length;j++) itemArrey2.add(cmtlist[j]); */ adapter2 = new ArrayAdapter<String>(mba.this, android.R.layout.simple_list_item_1, android.R.id.text1, itemArrey2); clist.setAdapter(adapter2); bcomment.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //////to add items to the list addItemList(); //func called } }); } protected void addItemList() { // TODO Auto-generated method stub // TODO Auto-generated method stub if (isInputValid(writecmt)) { new Insertpost().execute(); itemArrey2.add(0,"Name : "+uname+" \n"+"Post:"+writecmt.getText().toString()); writecmt.setText(""); adapter2.notifyDataSetChanged(); } } protected boolean isInputValid(EditText etInput2) { if (etInput2.getText().toString().trim().length()<1) { etInput2.setError("Please Enter Item"); return false; } else { return true; } } /////////////////// new class /////////////// class Insertpost extends AsyncTask<String, String, String> { //boolean failure = false; @Override protected void onPreExecute() { ///////// super.onPreExecute(); pDialog = new ProgressDialog(mba.this); pDialog.setMessage("Attempting Insert..."); pDialog.setIndeterminate(false); pDialog.setCancelable(true); pDialog.show(); } @Override protected String doInBackground(String... args) { // TODO Auto-generated method stub // Check for success tag pDialog.setMessage("background Insert..."); Log.d("uname", "inserting for "+uname); List<NameValuePair> params = new ArrayList<NameValuePair>(); pDialog.setMessage("after list array ..."); params.add(new BasicNameValuePair("id", id1));//pass this value params.add(new BasicNameValuePair("uname", uname));//--- params.add(new BasicNameValuePair("auth", "student"));//---- params.add(new BasicNameValuePair("postdata",writecmt.getText().toString())); Log.d("request!", "starting"); json1 = jsonParser.makeHttpRequest(POST_URL, "GET", params); // check your log for json response Log.d("Insert attempt", json1.toString()); // json success tag try { // Checking for SUCCESS TAG int success = json1.getInt(TAG_SUCCESS); if (success == 1) { Log.d(tag,"this is success log "); } } catch (JSONException e) { e.printStackTrace(); } return null; } protected void onPostExecute(String file_url) { // dismiss the dialog after getting all products pDialog.dismiss(); // updating UI from Background Thread } } class ListPost extends AsyncTask<String, String, String> { /** * Before starting background thread Show Progress Dialog * */ @Override protected void onPreExecute() { super.onPreExecute(); Log.d("tag","In asynctasl on preexecute "); pDialog = new ProgressDialog(mba.this); pDialog.setMessage("Loading . Please wait..."); pDialog.setIndeterminate(false); pDialog.setCancelable(false); pDialog.show(); } /** * getting All products from url * */ protected String doInBackground(String... args) { // Building Parameters Log.d(tag,"in doinbackground "); List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL Log.d(tag,"before request "); json = jsonParser.makeHttpRequest(GET_POST_URL, "GET", params); Log.d(tag,"after request "); // Check your log cat for JSON reponse Log.d("php return: ", json.toString()); // Checking for SUCCESS TAG /* try { jsarr=json.getJSONArray("products"); for(int i=0;i<jsarr.length();i++) { JSONObject j=jsarr.getJSONObject(i); Log.d(tag, j.toString()); String uname=j.getString("uname"); String post=j.getString("postdata"); //addItemList /*HashMap<String, String> tmphostel = new HashMap<String, String>(); tmphostel.put(TAG_REGNO, regno); tmphostel.put(TAG_NAME, name); HostelList.add(tmphostel);*/ /* itemArrey2.add(0,uname+" :-- "+post); } Log.d(tag+"array",jsarr.toString()); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); Log.d(tag,"exception "); } */ try { // Checking for SUCCESS TAG int success = json.getInt(TAG_SUCCESS); if (success == 1) { // products found // Getting Array of Products jsarr = json.getJSONArray("products"); Log.d(tag,"this is success log "); // looping through All Products for (int i = 0; i < jsarr.length(); i++) { JSONObject c = jsarr.getJSONObject(i); // Storing each json item in variable got_id = c.getString("id"); got_name = c.getString("uname"); got_postdata = c.getString("postdata"); itemArrey2.add(0,"Name:- "+got_name+"\n"+"Post :-- "+got_postdata); } } else { // no products found // Launch Add New product Activity } } catch (JSONException e) { e.printStackTrace(); } return null; } /** * After completing background task Dismiss the progress dialog * **/ protected void onPostExecute(String file_url) { // dismiss the dialog after getting all products pDialog.dismiss(); //pDialog.dismiss(); /*ListAdapter adapter = new SimpleAdapter( ListHostelActivity.this, HostelList, R.layout.list_item, new String[] { TAG_NAME, TAG_REGNO, }, new int[] { R.id.name,R.id.regno}); setListAdapter(adapter);*/ Log.d(tag,"listview updated "); } } }
true
8ab97159476ac90580d269a5a2b95075de8edf71
Java
li525917388/normal
/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NoCheckController.java
UTF-8
6,978
1.859375
2
[ "MIT" ]
permissive
package com.ruoyi.web.controller.system; import java.util.Date; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.ResultInfo; import com.ruoyi.framework.shiro.service.SysPasswordService; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysUser; import com.ruoyi.system.domain.VerificationCode; import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.IVerificationCodeService; /** * 不需要拦截过滤的请求 * @author Li Dehuan * @date 2019年7月10日 * */ @Controller @RequestMapping("/noCheck") public class NoCheckController extends BaseController { @Autowired private ISysUserService sysUserService; @Autowired private IVerificationCodeService verificationCodeService; @Autowired private SysPasswordService passwordService; @Autowired private ISysConfigService configService; /** * 忘记密码跳转 */ @GetMapping("/findPassword") public String findPassword(ModelMap mmap) { return "email/findPassword"; } /** * 检查用户邮箱是否正确 * @param user * @return */ @PostMapping("/checkUserEmail") @ResponseBody public AjaxResult checkUserEmail(SysUser user){ return sysUserService.checkUserEmail(user); } /** * 跳转验证码输入页面 * @param user * @param mmap * @return */ @GetMapping("/toVeriPage") public String toVeriPage(SysUser user, ModelMap mmap){ mmap.put("sysUser", user); return "email/veriPage"; } /** * 检验验证码是否正确 * @param code * @param username * @param email * @param token * @param mmap * @return */ @GetMapping("/checkEmailVeriCode") public String checkEmailVeriCode(String code, String username, String email, String token, ModelMap mmap){ VerificationCode params = new VerificationCode(); params.setUsername(username); params.setEmail(email); params.setVeriCode(code); params.setVaildTime(new Date()); //获取系统默认密码 //String password = configService.selectConfigByKey("sys.user.initPassword"); //SysUser user = sysUserService.selectUserByLoginName(username); /*user.setSalt(ShiroUtils.randomSalt()); user.setPassword(passwordService.encryptPassword(user.getLoginName(), password, user.getSalt()));*/ int res = verificationCodeService.getVerificationCode(params); if(res != 1){ ResultInfo<?> info = new ResultInfo<>(400, "验证已过期"); mmap.put("result", info); return "email/errorInfo"; } mmap.put("VeriCode", params); return "email/updatePassword"; } /** * 检验验证码是否正确 * @param code * @param username * @param email * @return */ @PostMapping("/checkEmailVeriCode") @ResponseBody public AjaxResult checkEmailVeriCode(String code, String loginName, String email){ VerificationCode params = new VerificationCode(); params.setUsername(loginName); params.setEmail(email); params.setVeriCode(code); params.setVaildTime(new Date()); params.setVaild(1); //获取系统默认密码 //String password = configService.selectConfigByKey("sys.user.initPassword"); //获取用户信息 //SysUser user = sysUserService.selectUserByLoginName(loginName); /*user.setSalt(ShiroUtils.randomSalt()); user.setPassword(passwordService.encryptPassword(user.getLoginName(), password, user.getSalt()));*/ //验证 int res = verificationCodeService.getVerificationCode(params); if(res != 1){ return AjaxResult.error("验证码不正确或超时"); } //登录 /*UsernamePasswordToken token = new UsernamePasswordToken(loginName, password); Subject subject = SecurityUtils.getSubject(); try { subject.login(token); } catch (AuthenticationException e) { String msg = "用户或密码错误"; if (StringUtils.isNotEmpty(e.getMessage())) { msg = e.getMessage(); } return error(msg); }*/ return success(); } /** * 修改密码页面跳转 * @param mmap * @return */ @GetMapping("/updatePassword") public String updatePassword(String code, String username, String email, ModelMap mmap){ VerificationCode params = new VerificationCode(); params.setUsername(username); params.setEmail(email); params.setVeriCode(code); params.setVaildTime(new Date()); //获取系统默认密码 //String password = configService.selectConfigByKey("sys.user.initPassword"); //SysUser user = sysUserService.selectUserByLoginName(username); /*user.setSalt(ShiroUtils.randomSalt()); user.setPassword(passwordService.encryptPassword(user.getLoginName(), password, user.getSalt()));*/ int res = verificationCodeService.getVerificationCode(params); if(res != 1){ ResultInfo<?> info = new ResultInfo<>(400, "验证已过期"); mmap.put("result", info); return "email/errorInfo"; } mmap.put("VeriCode", params); return "email/updatePassword"; } /** * 修改密码 * @param password * @return */ @PostMapping("/updatePassword") @ResponseBody public AjaxResult updatePassword(String code, String username, String email, String password){ SysUser user = sysUserService.selectUserByLoginName(username); user.setSalt(ShiroUtils.randomSalt()); user.setPassword(passwordService.encryptPassword(user.getLoginName(), password, user.getSalt())); VerificationCode veri = new VerificationCode(); veri.setVaildTime(new Date()); veri.setVeriCode(code); veri.setUsername(username); veri.setEmail(email); AjaxResult res = verificationCodeService.resetUserPwd(user, veri); return res; } /** * 跳转错误信息页面 * @param info * @param mmap * @return */ @GetMapping("/errorInfo") public String errorInfo(ResultInfo<?> info, ModelMap mmap){ mmap.put("result", info); return "email/errorInfo"; } }
true
ce412a63fb1bb87316a6c5a5749d453538342c26
Java
Enos-game/Assigment-2
/src/main/java/it/unipd/tos/business/TakeAwayBill.java
UTF-8
460
1.789063
2
[]
no_license
//////////////////////////////////////////////////////////////////// // [Lorenzo] [Piran] [1193526] //////////////////////////////////////////////////////////////////// package it.unipd.tos.business; import java.util.List; import it.unipd.tos.model.MenuItem; import it.unipd.tos.model.User; import it.unipd.tos.business.exception.BillException; public interface TakeAwayBill { double getOrderPrice(List<MenuItem> itemsOrder, User user) throws BillException; }
true
02496b393e3f26d5a7252e9d2ed3a65607c1edfa
Java
sasachichito/commons-domain
/src/main/java/com/github/sasachichito/event/DomainEvent.java
UTF-8
423
2.515625
3
[]
no_license
package com.github.sasachichito.event; import java.time.LocalDateTime; /** * The representation of event in the domain. */ public interface DomainEvent { /** * Gets this event version. * * @return the version */ public Integer version(); /** * Gets datetime when this event occurred. * * @return the event occurrence time */ public LocalDateTime occurredOn(); }
true
fadc4895cd535bc92b4ba033b7eeb4845d804a13
Java
nayoung2/java01
/src/step07/Exam02.java
UTF-8
770
3.8125
4
[]
no_license
/*주제 : 클래스 공용 변수 사용 */ //step06 메서드 package step07; public class Exam02 { public static void main(String[] args) { // 1) 클래스 공용 변수 사용 전 // => 2 * 3 + 6 - 7 = ? int a = Calculator.multiple(2, 3); a = Calculator.plus(a, 6); a = Calculator.minus(a, 7); System.out.println(a); // 2) 클래스 공용 변수 사용후 Calculator2.result = 0; // 원래 0으로 초기화 되어있어 쓸 필요 없지만 여러번 사용할 때 //다른 값이 들어가 있을 수도 있기 때문에 초기화를 해줌 Calculator2.plus(2); Calculator2.multiple(3); Calculator2.plus(6); Calculator2.minus(7); System.out.println(Calculator2.result); } }
true
8346ab148b1529ae53a913a22b1a2546cb0df758
Java
GPC-debug/micro
/order-module/src/main/java/com/goldmantis/mapper/own/purchase/WhsPurchaseApplicationPaymentItemMapper.java
UTF-8
1,097
1.632813
2
[]
no_license
package com.goldmantis.mapper.own.purchase; import com.goldmantis.base.BaseMapper; import com.goldmantis.entity.own.purchase.WhsPurchaseApplicationPaymentItem; import com.goldmantis.entity.own.purchase.WhsSupplierBasic; import java.util.List; import java.util.Map; public interface WhsPurchaseApplicationPaymentItemMapper extends BaseMapper<WhsPurchaseApplicationPaymentItem> { List<WhsPurchaseApplicationPaymentItem> selectByPaymentOrderNo(String paymentOrderNo); int cancelWhsPurchaseApplicationPaymentItems(WhsPurchaseApplicationPaymentItem record); List<WhsPurchaseApplicationPaymentItem> selectDistinctInWhByPaymentOrderNo(String paymentOrderNo); List<WhsSupplierBasic> getPayableSupplierListB(Map<String, Object> paramMap); List<WhsSupplierBasic> getPayableSupplierListD(Map<String, Object> paramMap); List<Map<String, Object>> getPayableSupplierListA(Map<String, Object> param); List<Map<String, Object>> getPayableSupplierListC(Map<String, Object> param); List<WhsPurchaseApplicationPaymentItem> listPaymentProAp(Map<String, Object> condition); }
true
5ddf3a5360dac3f08b15b7188b5e73054aadcb35
Java
loschmidt/clustering
/src/main/java/loschmidt/clustering/distance/AvgClusterDistanceCalculator.java
UTF-8
670
2.734375
3
[]
no_license
package loschmidt.clustering.distance; import loschmidt.clustering.IndexCluster; /** * * @author Jan Stourac */ public class AvgClusterDistanceCalculator implements ClusterDistanceCalculator { private final DistanceProvider distanceProvider_; public AvgClusterDistanceCalculator(DistanceProvider distanceProvider) { this.distanceProvider_ = distanceProvider; } @Override public float calculate(IndexCluster o1, IndexCluster o2) { int count = 0; double sum = 0; for (int i : o1.getMembers()) { for (int j : o2.getMembers()) { float d = distanceProvider_.getDistance(i, j); sum += d; count++; } } return (float) (sum / count); } }
true
e4b6cb60f51048d30be1cbc7e68ce165fbc9a83f
Java
han-tun/VRDR_javalib
/src/main/java/edu/gatech/VRDR/model/InjuryLocation.java
UTF-8
412
1.984375
2
[ "Apache-2.0" ]
permissive
package edu.gatech.VRDR.model; import org.hl7.fhir.dstu3.model.Location; import ca.uhn.fhir.model.api.annotation.ResourceDef; import edu.gatech.VRDR.model.util.CommonUtil; @ResourceDef(name = "Location", profile = "http://hl7.org/fhir/us/vrdr/StructureDefinition/VRDR-Injury-Location") public class InjuryLocation extends Location { public InjuryLocation() { super(); CommonUtil.initResource(this); } }
true
d772e7723e70f9c3e87f85fc7276fdaf544abf28
Java
Drakwars/GroupeA07_Android
/app/src/main/java/com/example/flori/groupea07_mobile/Model/SellerUser.java
UTF-8
1,183
2.390625
2
[]
no_license
package com.example.flori.groupea07_mobile.Model; public class SellerUser { private int idSeller; private String username; private int nbSales; private int positiveVote; private int negativeVote; private int idUser; public SellerUser(int idS, String user, int nb, int pVote, int nVote, int idU){ this.idSeller = idS; this.username = user; this.nbSales = nb; this.positiveVote = pVote; this.negativeVote = nVote; this.idUser = idU; } public int getIdSeller(){ return idSeller;} public void setIdSeller(int idS){ idSeller = idS;} public String getUsername() { return username;} public void setUsername(String user){ username = user;} public int getNbSales(){ return nbSales;} public void setNbSales(int nb){ nbSales = nb;} public int getPositiveVote(){ return positiveVote;} public void setPositiveVote(int pVote){ positiveVote = pVote;} public int getNegativeVote(){ return negativeVote;} public void setNegativeVote(int nVote){ negativeVote = nVote;} public int getIdUser(){ return idUser;} public void setIdUser(int idU){ idUser = idU;} }
true
79734ade4a99c8566ed6c7745c92843023c80f65
Java
thilina01/n-api
/src/main/java/com/nanosl/n/module/teammenu/TeamMenuRepository.java
UTF-8
698
1.914063
2
[]
no_license
package com.nanosl.n.module.teammenu; import com.nanosl.n.module.menu.Menu; import com.nanosl.n.module.team.Team; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; public interface TeamMenuRepository extends JpaRepository<TeamMenu, Integer> { @Query(value = "select teamMenu.menu from TeamMenu teamMenu where teamMenu.team= :team And teamMenu.menu.menu IS NULL ") public List<Menu> findTopMenuByTeam(@Param("team") Team team); public TeamMenu findByTeamAndMenu(Team team, Menu menu); public List<TeamMenu> findByTeam(Team team); }
true
c4d4ecd9c2251733cd6a559c6d21705c81fa59d5
Java
Ratel88/450BioProject
/magictool/groupdisplay/CircleDisplayFrame.java
UTF-8
11,246
2.171875
2
[]
no_license
/* * MAGIC Tool, A microarray image and data analysis program * Copyright (C) 2003 Laurie Heyer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Contact Information: * Laurie Heyer * Dept. of Mathematics * PO Box 6959 */ package magictool.groupdisplay; import java.awt.Color; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.print.PageFormat; import java.awt.print.PrinterJob; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import javax.swing.DefaultListModel; import javax.swing.JFileChooser; import javax.swing.JInternalFrame; import javax.swing.JList; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JViewport; import magictool.DidNotFinishException; import magictool.ExpFile; import magictool.GrpFile; import magictool.MainFrame; import magictool.Project; import magictool.filefilters.GifFilter; import magictool.filefilters.NoEditFileChooser; /** * JInternalFrame which displays a Circle Display in a JScrollPane */ public class CircleDisplayFrame extends JInternalFrame { /**expression file*/ protected ExpFile exp; /**group file*/ protected GrpFile grp; private JScrollPane scroll; private JMenuBar menuBar = new JMenuBar(); private JMenu jMenu1 = new JMenu("File"); private JMenuItem printMenu = new JMenuItem("Print"); private JMenuItem closeMenu = new JMenuItem("Close"); private JMenu jMenu2 = new JMenu("Display"); private JMenuItem radiusMenu = new JMenuItem("Change Radius"); private JMenuItem threshMenu = new JMenuItem("Change Threshold"); /**circle display in frame*/ protected CircleDisplay theDisplay; private JMenuItem imgChoice = new JMenuItem("Save As Image..."); private JMenuItem saveGrpChoice = new JMenuItem("Save Selected As Group..."); /**parent frame*/ protected Frame parent; private Project project; /** * Constructs a frame with the circle display containing all genes in the expression file * @param exp expression file * @param parent parent frame * @param project open project */ public CircleDisplayFrame(ExpFile exp, Frame parent, Project project){ this(exp,new GrpFile(),parent, project); } /** * Constructs a frame with the circle display containing all genes specified in the group file * @param exp expression file * @param grp group file * @param parent parent frame * @param project open project */ public CircleDisplayFrame(ExpFile exp, GrpFile grp,Frame parent, Project project) { this.exp=exp; this.parent=parent; this.project = project; if(grp==null) grp = new GrpFile(); else this.grp=grp; //adds all genes in expression file if none exist in group file if(grp.getNumGenes()==0) { Object o[] = exp.getGeneVector(); for(int i=0; i<o.length; i++){ this.grp.addOne(o[i]); } } //constructs the circle display and places it in scrollpane theDisplay = new CircleDisplay(exp, this.grp); scroll = new JScrollPane(theDisplay); scroll.getViewport().setBackground(Color.white); scroll.setBackground(Color.white); this.setBackground(Color.white); scroll.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { //sets up frame characteristics this.setClosable(true); this.setJMenuBar(menuBar); this.setMaximizable(true); this.setResizable(true); this.setDoubleBuffered(true); scroll.setDoubleBuffered(true); //sets up menus printMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_P, java.awt.event.KeyEvent.CTRL_MASK)); printMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { printMenu_actionPerformed(e); } }); closeMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_W, java.awt.event.KeyEvent.CTRL_MASK)); closeMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { closeMenu_actionPerformed(e); } }); radiusMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_R, java.awt.event.KeyEvent.CTRL_MASK)); radiusMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { radiusMenu_actionPerformed(e); } }); threshMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_T, java.awt.event.KeyEvent.CTRL_MASK)); threshMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { threshMenu_actionPerformed(e); } }); imgChoice.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { imgChoice_actionPerformed(e); } }); saveGrpChoice.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { saveGrpChoice_actionPerformed(e); } }); /* this.getContentPane().addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(MouseEvent e) { theDisplay.this_mouseClicked(e, theDisplay.getGraphics()); theDisplay.repaint(); } });*/ this.getContentPane().add(scroll); menuBar.add(jMenu1); menuBar.add(jMenu2); jMenu1.add(imgChoice); jMenu1.add(saveGrpChoice); jMenu1.add(printMenu); jMenu1.addSeparator(); jMenu1.add(closeMenu); jMenu2.add(radiusMenu); jMenu2.add(threshMenu); } private void threshMenu_actionPerformed(ActionEvent e) { String r = (String) JOptionPane.showInputDialog(parent,"Please Enter New Threshold","",JOptionPane.QUESTION_MESSAGE,null,null,""+theDisplay.getThresh()); try{ theDisplay.setThresh(Float.parseFloat(r)); theDisplay.repaint(); } catch(Exception e2){} } private void radiusMenu_actionPerformed(ActionEvent e) { String r = (String) JOptionPane.showInputDialog(parent,"Please Enter New Radius","",JOptionPane.QUESTION_MESSAGE,null,null,""+theDisplay.getRadius()); try{ theDisplay.setRadius(Integer.parseInt(r)); theDisplay.repaint(); } catch(Exception e2){} } private void closeMenu_actionPerformed(ActionEvent e) { this.dispose(); } private void printMenu_actionPerformed(ActionEvent e) { PrinterJob printJob = PrinterJob.getPrinterJob(); PageFormat pf = printJob.pageDialog(printJob.defaultPage()); printJob.setPrintable(theDisplay,pf); if (printJob.printDialog()) { try { printJob.print(); } catch (Exception PrintException) { } } } private void imgChoice_actionPerformed(ActionEvent e) { try{ NoEditFileChooser jfc = new NoEditFileChooser(MainFrame.fileLoader.getFileSystemView()); jfc.setFileFilter(new GifFilter()); jfc.setDialogTitle("Create New Gif File..."); jfc.setApproveButtonText("Select"); File direct = new File(project.getPath() + "images" + File.separator); if(!direct.exists()) direct.mkdirs(); jfc.setCurrentDirectory(direct); int result = jfc.showSaveDialog(null); if (result == JFileChooser.APPROVE_OPTION) { File fileobj = jfc.getSelectedFile(); String name = fileobj.getPath(); if(!name.endsWith(".gif")) name+=".gif"; final String picture = name; Thread thread = new Thread(){ public void run(){ saveImage(picture); } }; thread.start(); } } catch(Exception e1){ JOptionPane.showMessageDialog(parent,"Failed To Create Image"); } } private void saveImage(String name){ try{ int number=1; theDisplay.saveImage(name, number=(int)Math.ceil(theDisplay.getMegaPixels()/project.getImageSize())); if(number>1){ String tn = name.substring(name.lastIndexOf(File.separator), name.lastIndexOf(".")); String tempname = name.substring(0, name.lastIndexOf(File.separator)) + tn + ".html"; BufferedWriter bw = new BufferedWriter(new FileWriter(tempname)); bw.write("<html><header><title>" + name + "</title></header>"); bw.write("<body>"); bw.write("<table cellpadding=0 cellspacing=0 border=0"); for(int i=0; i<number; i++){ bw.write("<tr><td><img src=" + tn.substring(1) + "_images" + tn + i + ".gif border=0></td></tr>"); } bw.write("</table></body></html>"); bw.close(); } } catch(Exception e){ JOptionPane.showMessageDialog(parent,"Failed To Create Image"); } } private void saveGrpChoice_actionPerformed(ActionEvent e) { DefaultListModel groupModel = new DefaultListModel(); JList groupGenes = new JList(); groupGenes.setModel(groupModel); Object[] o = theDisplay.getAllSelected(); if(o.length>0){ for(int i=0; i<o.length; i++){ groupModel.addElement(o[i].toString()); } String s = JOptionPane.showInputDialog(parent,"Enter The Group Name:"); if(s!=null){ GrpFile newGrp = new GrpFile(s); for(int i=0; i<groupModel.size(); i++){ newGrp.addOne(groupModel.elementAt(i)); } if(!s.endsWith(".grp")) s+=".grp"; newGrp.setExpFile(exp.getName()); try{ File file =new File(project.getPath()+exp.getName()+File.separator+s); int result = JOptionPane.YES_OPTION; if (file.exists()) { result = JOptionPane.showConfirmDialog(parent, "The file " + file.getPath() + " already exists. Overwrite this file?", "Overwrite File?", JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) file.delete(); } if(result == JOptionPane.YES_OPTION) newGrp.writeGrpFile(project.getPath()+exp.getName()+File.separator+s); } catch(DidNotFinishException e2){ JOptionPane.showMessageDialog(parent, "Error Writing Group File"); } project.addFile(exp.getName()+File.separator+s); } } else{JOptionPane.showMessageDialog(parent, "No Genes Selected");} } }
true
18097f686fc25682f87543bf3a221ff8c90d7280
Java
viorels/wakeup-android
/src/co/iwakeup/GameActivity.java
UTF-8
1,237
2.34375
2
[]
no_license
package co.iwakeup; import android.app.Activity; import android.os.Bundle; import android.view.KeyEvent; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; public class GameActivity extends Activity { WebView gameWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.webview); gameWebView = (WebView) findViewById(R.id.webview); // gameWebView.loadUrl("http://whackamine.meteor.com"); gameWebView.loadUrl("http://www.inmensia.com/files/minesweeper1.0.html"); WebSettings webSettings = gameWebView.getSettings(); webSettings.setJavaScriptEnabled(true); gameWebView.setWebViewClient(new WebViewClient()); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { // Check if the key event was the Back button and if there's history if ((keyCode == KeyEvent.KEYCODE_BACK) && gameWebView.canGoBack()) { gameWebView.goBack(); return true; } // If it wasn't the Back key or there's no web page history, bubble up to the default // system behavior (probably exit the activity) return super.onKeyDown(keyCode, event); } }
true
2350a7eee3d7682443342ccef176153873818811
Java
SbstnErhrdt/mms
/mms/src/model/content/Module.java
UTF-8
4,352
2.203125
2
[]
no_license
package model.content; import java.sql.Timestamp; import java.util.ArrayList; import util.Utilities; public class Module extends Content { private int moduleID; private String director_email; private boolean isCritical; // parent subjects private ArrayList<Integer> subjectIDs; // lecturers private ArrayList<String> lecturers_emails; // content fields private ArrayList<ModuleField> moduleFields; /** * constructor */ public Module() { super(); this.subjectIDs = new ArrayList<Integer>(); this.lecturers_emails = new ArrayList<String>(); this.moduleFields = new ArrayList<ModuleField>(); } /** * constructor * * @param moduleID */ public Module(int moduleID) { super(); this.moduleID = moduleID; this.subjectIDs = new ArrayList<Integer>(); this.lecturers_emails = new ArrayList<String>(); this.moduleFields = new ArrayList<ModuleField>(); } /** * constructor * * @param moduleID * @param name * @param director_email * @param lastModified * @param modifier_email * * @param enabled */ public Module(int moduleID, String name, String director_email, Timestamp lastModified, String modifier_email, boolean isCritical, boolean enabled) { this.moduleID = moduleID; this.name = name; this.director_email = director_email; this.lastModified = lastModified; this.modifier_email = modifier_email; this.isCritical = isCritical; this.enabled = enabled; this.subjectIDs = new ArrayList<Integer>(); this.lecturers_emails = new ArrayList<String>(); this.moduleFields = new ArrayList<ModuleField>(); } /** * constructor * * @param moduleID * @param name * @param enabled * @param subjectIDs * @param lecturers_emails * @param moduleFields */ public Module(int moduleID, String name, boolean enabled, ArrayList<Integer> subjectIDs, ArrayList<String> lecturers_emails, ArrayList<ModuleField> moduleFields) { super(); this.moduleID = moduleID; this.name = name; this.enabled = enabled; this.subjectIDs = subjectIDs; this.lecturers_emails = lecturers_emails; this.moduleFields = moduleFields; this.subjectIDs = subjectIDs; this.lecturers_emails = lecturers_emails; this.moduleFields = moduleFields; } public int getID() { return moduleID; } public void setID(int moduleID) { this.moduleID = moduleID; } public ArrayList<Integer> getSubjectIDs() { return subjectIDs; } public void setSubjectIDs(ArrayList<Integer> subjectIDs) { this.subjectIDs = subjectIDs; } public ArrayList<String> getLecturers() { return lecturers_emails; } public void setLecturers(ArrayList<String> lecturers_emails) { this.lecturers_emails = lecturers_emails; } public ArrayList<ModuleField> getModuleFields() { return moduleFields; } public void setModuleFields(ArrayList<ModuleField> moduleFields) { this.moduleFields = moduleFields; } public int getModuleID() { return moduleID; } public void setModuleID(int moduleID) { this.moduleID = moduleID; } public boolean isCritical() { return isCritical; } public void setCritical(boolean isCritical) { this.isCritical = isCritical; } public String getDirector_email() { return director_email; } public void setDirector_email(String director_email) { this.director_email = director_email; } public ArrayList<String> getLecturers_emails() { return lecturers_emails; } public void setLecturers_emails(ArrayList<String> lecturers_emails) { this.lecturers_emails = lecturers_emails; } @Override public String toString() { return "Module [moduleID=" + moduleID + ", isCritical=" + isCritical + ", subjectIDs=" + subjectIDs + ", lecturers_emails=" + lecturers_emails + ", moduleFields=" + moduleFields + ", name=" + name + ", content=" + content + ", modifier_email=" + modifier_email + ", lastModified=" + lastModified + ", archived=" + archived + ", enabled=" + enabled + ", version=" + version + "]"; } public Object getModuleFieldValue(String fieldName) { for(ModuleField mf : moduleFields) { if(mf.getFieldName().equals(fieldName)) { return mf.getFieldValue(); } } return null; } }
true
c12307e99f1523d707b23f18ab991500f7e60b19
Java
hunny/xplus
/commons/trunk/commons-compiler/src/main/resources/ok/test/Test.java
UTF-8
147
1.648438
2
[ "MIT" ]
permissive
package ok.test; public class Test { public boolean show() { System.out.println("类动态编译和加载测试。"); return true; } }
true