blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
808535c76f2444c1df060a868a0fea4a6008b3d2
dbac77a4e3f43da7a801e325c10dae51881d9bb2
/app/src/main/java/appcomercial/parquesanto/com/ec/appcomercial/fragmentoIzq.java
98bc094c78c2cc8ebc871126206ce05e9b66a342
[]
no_license
Kattyvela/AppComercial
e7c413c7a70bd1d7105c639cf6d1404d05acc1a4
361d922bca347b6e825f2adc010dad8384744b44
refs/heads/master
2020-09-17T21:38:02.345748
2016-09-01T19:22:21
2016-09-01T19:22:21
67,068,747
0
0
null
null
null
null
UTF-8
Java
false
false
3,643
java
package appcomercial.parquesanto.com.ec.appcomercial; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the * {@link fragmentoIzq.OnFragmentInteractionListener} interface * to handle interaction events. * Use the {@link fragmentoIzq#newInstance} factory method to * create an instance of this fragment. */ public class fragmentoIzq extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; private OnFragmentInteractionListener mListener; public fragmentoIzq() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment fragmentoIzq. */ // TODO: Rename and change types and number of parameters public static fragmentoIzq newInstance(String param1, String param2) { fragmentoIzq fragment = new fragmentoIzq(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragmento_izq_inicio, container, false); } // TODO: Rename method, update argument and hook method into UI event public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } } @Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof OnFragmentInteractionListener) { mListener = (OnFragmentInteractionListener) context; } else { throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener"); } } @Override public void onDetach() { super.onDetach(); mListener = null; } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * >Communicating with Other Fragments</a> for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } }
[ "ktty_vv888@hotmail.com" ]
ktty_vv888@hotmail.com
c2c706b5c23f84c0924de8f63211dcf9846f3fbb
09649412e12bdc15cf61607e881203735cfafa50
/proxies/com/microsoft/bingads/campaignmanagement/NMTOKENS.java
fc1a649d21ad79686210c368e901429ef5628238
[ "MIT" ]
permissive
yosefarr/BingAds-Java-SDK
cec603b74a921e71c6173ce112caccdf7c1fdbc8
d1c333d0ba5b7e434c85a92c7a80dad0add0d634
refs/heads/master
2021-01-18T15:02:53.945816
2016-03-06T13:18:32
2016-03-06T13:18:32
51,738,651
0
1
null
2016-02-15T07:38:14
2016-02-15T07:38:13
null
UTF-8
Java
false
false
1,817
java
package com.microsoft.bingads.campaignmanagement; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * <p>Java class for NMTOKENS simple type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;simpleType name="NMTOKENS"> * &lt;restriction> * &lt;simpleType> * &lt;list itemType="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;/simpleType> * &lt;minLength value="1"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NMTOKENS", namespace = "http://www.w3.org/2001/XMLSchema", propOrder = { "values" }) public class NMTOKENS { @XmlValue @XmlSchemaType(name = "NMTOKENS") protected List<NMTOKEN> values; /** * Gets the value of the values property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the values property. * * <p> * For example, to add a new item, do as follows: * <pre> * getValues().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link NMTOKEN } * * */ public List<NMTOKEN> getValues() { if (values == null) { values = new ArrayList<NMTOKEN>(); } return this.values; } }
[ "bing_ads_sdk@microsoft.com" ]
bing_ads_sdk@microsoft.com
2fdcde3718646898593a2eafc474be03dab4a9a3
ccaeddafb73e969c0c2b242dd9625f40a8dfd541
/src/com/d1/helper/CommentHelper.java
0eae6c9dd0a64ede7303f6d1cd0346e644271d07
[]
no_license
ACGT/d1
1f2e3e1759e34bfb1a730fda28ff90d3a4349531
c661e7c0b2ea1182105c9b155b1740515c6a2f37
refs/heads/master
2021-01-21T20:34:57.056280
2015-10-16T14:10:51
2015-10-16T14:10:51
null
0
0
null
null
null
null
GB18030
Java
false
false
9,113
java
package com.d1.helper; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.SimpleExpression; import com.d1.bean.Comment; import com.d1.bean.CommentCache; import com.d1.dbcache.core.BaseManager; import com.d1.util.StringUtils; import com.d1.util.Tools; /** * 商品评价表辅助类 * @author chengang * @createTime 2011-10-27 22:02:55 * */ public class CommentHelper { public static final BaseManager manager = Tools.getManager(Comment.class); public static final BaseManager cacheManager = Tools.getManager(CommentCache.class); /** * 通过ID找到对象 * @param id * @return Comment */ public static Comment getById(String id) { if(Tools.isNull(id)) return null; return (Comment)manager.get(id); } /** * 通过物品ID获得评论的长度 * @param productId - 物品ID * @return int */ public static int getCommentLength(String productId){ if(Tools.isNull(productId)) return 0; List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_gdsid", productId)); listRes.add(Restrictions.eq("gdscom_status", new Long(1))); //listRes.add(Restrictions.eq("gdscom_checkStatue", new Long(1))); return manager.getLength(listRes); } /** * 获得对应商品的评论信息(已审核且页面显示状态为1) * @param productId - 物品ID * @param start - 开始 * @param length - 长度 * @return List<Comment> */ public static List getCommentList(String productId , int start , int length){ if(Tools.isNull(productId)) return null; List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_gdsid", productId)); listRes.add(Restrictions.eq("gdscom_status", new Long(1))); //listRes.add(Restrictions.eq("gdscom_checkStatue", new Long(1))); List<Order> listOrder = new ArrayList<Order>(); listOrder.add(Order.desc("gdscom_createdate")); return manager.getList(listRes, listOrder, start, length); } /** * 获得最高分数评论信息(已审核且页面显示状态为1) * @param productId - 物品ID * @param start - 开始 * @param length - 长度 * @return List<Comment> */ public static List getCommentListByLevel(String productId , int start , int length){ if(Tools.isNull(productId)) return null; List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_gdsid", productId)); listRes.add(Restrictions.eq("gdscom_status", new Long(1))); //listRes.add(Restrictions.eq("gdscom_checkStatue", new Long(1))); List<Order> listOrder = new ArrayList<Order>(); listOrder.add(Order.desc("gdscom_level")); listOrder.add(Order.desc("gdscom_createdate")); return manager.getList(listRes, listOrder, start, length); } public static List getCommentList(String productId){ if(Tools.isNull(productId)) return null; List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_gdsid", productId)); listRes.add(Restrictions.eq("gdscom_status", new Long(1))); //listRes.add(Restrictions.eq("gdscom_checkStatue", new Long(1))); List<Order> listOrder = new ArrayList<Order>(); listOrder.add(Order.desc("gdscom_createdate")); return manager.getList(listRes, listOrder, 0, 1000); } /** * 根据打分的等级获得长度 * @param productId - 物品ID * @param level - 等级 * @return int */ public static int getCommentLevelCount(String productId , long level){ if(Tools.isNull(productId)) return 0; List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_gdsid", productId)); //listRes.add(Restrictions.ne("gdscom_status", new Long(2))); listRes.add(Restrictions.eq("gdscom_level", new Long(level))); return manager.getLength(listRes); } /** * 根据打分的等级获得缓存评论的长度 * @param productId - 物品ID * @param level - 等级 * @return int */ public static int getCacheCommentLevelCount(String productId , long level){ if(Tools.isNull(productId)) return 0; List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_gdsid", productId)); listRes.add(Restrictions.eq("gdscom_level", new Long(level))); return cacheManager.getLength(listRes); } /** * 获得评论等级的平均分 * @param productId - 物品ID * @return double */ public static double getCommentLevel(String productId){ if(Tools.isNull(productId)) return 0; int score_5 = getCommentLevelCount(productId , 5); int score_4 = getCommentLevelCount(productId , 4); int score_3 = getCommentLevelCount(productId , 3); int score_2 = getCommentLevelCount(productId , 2); int score_1 = getCommentLevelCount(productId , 1); score_5 += getCacheCommentLevelCount(productId , 5); score_4 += getCacheCommentLevelCount(productId , 4); score_3 += getCacheCommentLevelCount(productId , 3); score_2 += getCacheCommentLevelCount(productId , 2); score_1 += getCacheCommentLevelCount(productId , 1); return (score_5 + score_4 * 0.8 + score_3 * 0.6 + score_2 * 0.4 + score_1 * 0.2) / (score_1 + score_2 + score_3 + score_4 + score_5); } /** * 商品评价星级显示 * @param productId - 物品ID * @return int */ public static int getLevelView(String productId){ double score= getCommentLevel(productId); int avgscore=0; try{ avgscore=(int)(score * 10); }catch(Exception ex) { avgscore=0; } return avgscore; } /** *获取评论人的邮箱(但不全显) * * @param gdscom_uid 会员id * @return 新的会员uid */ public static String GetCommentUid(String gdscom_uid) { if(Tools.isNull(gdscom_uid)) return ""; String str=gdscom_uid.trim(); if(str==null)str=""; return "***"+StringUtils.getCnSubstring(str,0,10); } /** * 获取“我的评论” */ public static List getMyCommentList(Long mbrid){ List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_mbrid", mbrid)); List<Order> listOrder = new ArrayList<Order>(); listOrder.add(Order.desc("gdscom_createdate")); return manager.getList(listRes, listOrder, 0, 1000); } public static List getMyCacheCommentList(Long mbrid){ List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_mbrid", mbrid)); List<Order> listOrder = new ArrayList<Order>(); listOrder.add(Order.desc("gdscom_createdate")); return cacheManager.getList(listRes, listOrder, 0, 1000); } public static List getMyNewCommentList(Long mbrid,String orderid){ List<SimpleExpression> listRes = new ArrayList<SimpleExpression>(); listRes.add(Restrictions.eq("gdscom_mbrid", mbrid)); listRes.add(Restrictions.eq("gdscom_odrid", orderid)); //listRes.add(Restrictions.eq("sessionid", sessionid)); return manager.getList(listRes, null, 0, 1000); } //评论数 public static int getinCommentLength(String[] gdsarr){ if(gdsarr.length==0) return 0; int comcount=0; for(int j=0;j<gdsarr.length;j++){ comcount+=getCommentLength(gdsarr[j]); } return comcount; } //评论列表 public static List getinCommentList2(String[] gdsarr, int count){ if(gdsarr.length==0) return null; ArrayList<Comment> list=new ArrayList<Comment>(); for(int j=0;j<gdsarr.length;j++){ List<Comment> commentlist = getCommentList(gdsarr[j]); for(Comment comment:commentlist){ list.add(comment); } } if(list==null || list.size()==0){ return null; } //排序 Collections.sort(list,new CommentCreateTimeComparator()); int i=0; ArrayList<Comment> list2=new ArrayList<Comment>(); for(Comment comment:list){ if(i<count){ list2.add(comment); } i++; } return list2; } //评论列表 public static List getinCommentList(String[] gdsarr, int start , int length){ if(gdsarr.length==0) return null; ArrayList<Comment> list=new ArrayList<Comment>(); for(int j=0;j<gdsarr.length;j++){ List<Comment> commentlist = getCommentList(gdsarr[j]); for(Comment comment:commentlist){ list.add(comment); } } if(list==null || list.size()==0){ return null; } //排序 Collections.sort(list,new CommentCreateTimeComparator()); ArrayList<Comment> newlist = new ArrayList<Comment>(); for(int i=start;i<start+length&&i<list.size();i++){ newlist.add(list.get(i)); } return newlist; } } class CommentCreateTimeComparator implements Comparator<Comment>{ @Override public int compare(Comment p0, Comment p1) { if(p0.getGdscom_createdate()!=null&&p1.getGdscom_createdate()!=null){ if(p0.getGdscom_createdate().getTime()>p1.getGdscom_createdate().getTime()){ return -1 ; }else if(p0.getGdscom_createdate().getTime()==p1.getGdscom_createdate().getTime()){ return 0 ; }else{ return 1 ; } } return 0; } }
[ "cangjie@hotmail.com" ]
cangjie@hotmail.com
4164210fbb94d7369c7614c791acb980743cf3fe
2fa5ed61e379b56608f82d0644771f27c6a2aa59
/src/chapter8/challenge1/Main.java
7916270b0d8886f038ad262eb27dc823f703a27f
[]
no_license
stefanoantonel/Developer_II
399fc0e79785f5943540d87e6b13b68b5227e2a7
56d6fe5afe55df297d0ef60cb76fa689463933f8
refs/heads/master
2020-04-09T15:55:57.092884
2015-05-12T17:23:29
2015-05-12T17:23:29
29,539,154
0
0
null
null
null
null
UTF-8
Java
false
false
976
java
package chapter8.challenge1; import java.text.DecimalFormat; import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { double area, radius, length, width; String r = JOptionPane.showInputDialog("Enter the radius of a circle"); radius = Double.parseDouble(r); area = Shape.calculateArea(radius); StringBuilder sb = new StringBuilder(); sb.append("The area of the circle with radius : "); sb.append(radius); sb.append(" is: "); DecimalFormat fmt = new DecimalFormat("0.00"); sb.append(fmt.format(area)); JOptionPane.showMessageDialog(null, sb.toString()); System.out.println("The area of circle with radius of 5 is : "+ Shape.calculateArea(5.0)); System.out.println("The area of rectangle with width 5 and heigth 3 is : "+ Shape.calculateArea((float)5.0, (float) 3.0)); System.out.println("The area of cilinder with radius 5 and heigth is 3.8 is : "+ Shape.calculateArea((double)5.0, (double)3.8)); } }
[ "stefanoantonel@gmail.com" ]
stefanoantonel@gmail.com
5bf599efd0ccd7fb01759050e29511941c7a89bc
1930d97ebfc352f45b8c25ef715af406783aabe2
/src/main/java/com/alipay/api/response/KoubeiMarketingToolPointsUpdateResponse.java
43ab8de958cafafa6be13bfbe30ebaa9f28df6e8
[ "Apache-2.0" ]
permissive
WQmmm/alipay-sdk-java-all
57974d199ee83518523e8d354dcdec0a9ce40a0c
66af9219e5ca802cff963ab86b99aadc59cc09dd
refs/heads/master
2023-06-28T03:54:17.577332
2021-08-02T10:05:10
2021-08-02T10:05:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: koubei.marketing.tool.points.update response. * * @author auto create * @since 1.0, 2019-01-07 20:51:15 */ public class KoubeiMarketingToolPointsUpdateResponse extends AlipayResponse { private static final long serialVersionUID = 4777951786449228542L; /** * 集点变更流水号 */ @ApiField("point_log_no") private String pointLogNo; public void setPointLogNo(String pointLogNo) { this.pointLogNo = pointLogNo; } public String getPointLogNo( ) { return this.pointLogNo; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
41be28686c76d62b3f3bc2d0dddeb1ba28b26468
b7804b214a4a2dd2987f91051a33292e5c577326
/patterns/src/main/java/ua/ho/godex/strategy/character/Knight.java
b70e8f3d9ed76361ad9b31ae62d462bc1297051c
[]
no_license
PavlenkoB/java-learn
cbf1c5da68fbb7b16005abb0e4579aabddb7c79f
753f2c8fee0880d6a3a9a66c6fa0cee63ff3bc38
refs/heads/master
2021-04-28T20:49:36.635780
2021-01-18T11:59:11
2021-01-18T11:59:11
121,936,766
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package ua.ho.godex.strategy.character; /** * Creator: Pavlenko Bohdan * Date: 16.03.2018 * Project: patterns */ public class Knight extends Character { @Override public void fight() { System.out.println(this.getClass().getSimpleName() + " use " + this.weapon.useWeapon()); } }
[ "godexxxx@gmail.com" ]
godexxxx@gmail.com
1e761d69f15ad3f38238711132cc98b96e2e0544
782ec3604b606db97a2f7b3eacd8b896ba037b5e
/src/main/java/co/edu/usbcali/clum/view/UsuarioView.java
43c91af5f63a36b222de22c2cb392eb71e19c349
[]
no_license
gcmartinezg/clum-backend
956a41f98f58c3363eeb8321345ab4ae03e7e228
57e69ef6949b88f8cb9012fd6712b22b38487295
refs/heads/master
2022-12-22T05:26:22.591133
2019-11-26T11:33:08
2019-11-26T11:33:08
208,532,812
0
0
null
2022-12-16T00:47:04
2019-09-15T02:49:00
Java
UTF-8
Java
false
false
13,232
java
package co.edu.usbcali.clum.view; import co.edu.usbcali.clum.domain.*; import co.edu.usbcali.clum.dto.UsuarioDTO; import co.edu.usbcali.clum.exception.*; import co.edu.usbcali.clum.utility.*; import org.primefaces.component.calendar.*; import org.primefaces.component.commandbutton.CommandButton; import org.primefaces.component.inputtext.InputText; import org.primefaces.event.RowEditEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Serializable; import java.sql.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; import java.util.TimeZone; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedProperty; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; /** * @author Zathura Code Generator http://zathuracode.org/ * www.zathuracode.org * */ @ManagedBean @ViewScoped public class UsuarioView implements Serializable { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(UsuarioView.class); private InputText txtContrasenia; private InputText txtIdEstado_Estado; private InputText txtTerceroId_Tercero; private InputText txtTipoUsuarioId_TipoUsuario; private InputText txtUsuarioId; private CommandButton btnSave; private CommandButton btnModify; private CommandButton btnDelete; private CommandButton btnClear; private List<UsuarioDTO> data; private UsuarioDTO selectedUsuario; private Usuario entity; private boolean showDialog; @ManagedProperty(value = "#{businessDelegator}") private BusinessDelegator businessDelegatorView; public UsuarioView() { super(); } public String action_new() { action_clear(); selectedUsuario = null; setShowDialog(true); return ""; } public String action_clear() { entity = null; selectedUsuario = null; if (txtContrasenia != null) { txtContrasenia.setValue(null); txtContrasenia.setDisabled(true); } if (txtIdEstado_Estado != null) { txtIdEstado_Estado.setValue(null); txtIdEstado_Estado.setDisabled(true); } if (txtTerceroId_Tercero != null) { txtTerceroId_Tercero.setValue(null); txtTerceroId_Tercero.setDisabled(true); } if (txtTipoUsuarioId_TipoUsuario != null) { txtTipoUsuarioId_TipoUsuario.setValue(null); txtTipoUsuarioId_TipoUsuario.setDisabled(true); } if (txtUsuarioId != null) { txtUsuarioId.setValue(null); txtUsuarioId.setDisabled(false); } if (btnSave != null) { btnSave.setDisabled(true); } if (btnDelete != null) { btnDelete.setDisabled(true); } return ""; } public void listener_txtId() { try { String usuarioId = FacesUtils.checkString(txtUsuarioId); entity = (usuarioId != null) ? businessDelegatorView.getUsuario(usuarioId) : null; } catch (Exception e) { entity = null; } if (entity == null) { txtContrasenia.setDisabled(false); txtIdEstado_Estado.setDisabled(false); txtTerceroId_Tercero.setDisabled(false); txtTipoUsuarioId_TipoUsuario.setDisabled(false); txtUsuarioId.setDisabled(false); btnSave.setDisabled(false); } else { txtContrasenia.setValue(entity.getContrasenia()); txtContrasenia.setDisabled(false); txtIdEstado_Estado.setValue(entity.getEstado().getIdEstado()); txtIdEstado_Estado.setDisabled(false); txtTerceroId_Tercero.setValue(entity.getTercero().getTerceroId()); txtTerceroId_Tercero.setDisabled(false); txtTipoUsuarioId_TipoUsuario.setValue(entity.getTipoUsuario() .getTipoUsuarioId()); txtTipoUsuarioId_TipoUsuario.setDisabled(false); txtUsuarioId.setValue(entity.getUsuarioId()); txtUsuarioId.setDisabled(true); btnSave.setDisabled(false); if (btnDelete != null) { btnDelete.setDisabled(false); } } } public String action_edit(ActionEvent evt) { selectedUsuario = (UsuarioDTO) (evt.getComponent().getAttributes() .get("selectedUsuario")); txtContrasenia.setValue(selectedUsuario.getContrasenia()); txtContrasenia.setDisabled(false); txtIdEstado_Estado.setValue(selectedUsuario.getIdEstado_Estado()); txtIdEstado_Estado.setDisabled(false); txtTerceroId_Tercero.setValue(selectedUsuario.getTerceroId_Tercero()); txtTerceroId_Tercero.setDisabled(false); txtTipoUsuarioId_TipoUsuario.setValue(selectedUsuario.getTipoUsuarioId_TipoUsuario()); txtTipoUsuarioId_TipoUsuario.setDisabled(false); txtUsuarioId.setValue(selectedUsuario.getUsuarioId()); txtUsuarioId.setDisabled(true); btnSave.setDisabled(false); setShowDialog(true); return ""; } public String action_save() { try { if ((selectedUsuario == null) && (entity == null)) { action_create(); } else { action_modify(); } data = null; } catch (Exception e) { FacesUtils.addErrorMessage(e.getMessage()); } return ""; } public String action_create() { try { entity = new Usuario(); String usuarioId = FacesUtils.checkString(txtUsuarioId); entity.setContrasenia(FacesUtils.checkString(txtContrasenia)); entity.setUsuarioId(usuarioId); entity.setEstado((FacesUtils.checkInteger(txtIdEstado_Estado) != null) ? businessDelegatorView.getEstado(FacesUtils.checkInteger( txtIdEstado_Estado)) : null); entity.setTercero((FacesUtils.checkInteger(txtTerceroId_Tercero) != null) ? businessDelegatorView.getTercero(FacesUtils.checkInteger( txtTerceroId_Tercero)) : null); entity.setTipoUsuario((FacesUtils.checkInteger( txtTipoUsuarioId_TipoUsuario) != null) ? businessDelegatorView.getTipoUsuario(FacesUtils.checkInteger( txtTipoUsuarioId_TipoUsuario)) : null); businessDelegatorView.saveUsuario(entity); FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYSAVED); action_clear(); } catch (Exception e) { entity = null; FacesUtils.addErrorMessage(e.getMessage()); } return ""; } public String action_modify() { try { if (entity == null) { String usuarioId = new String(selectedUsuario.getUsuarioId()); entity = businessDelegatorView.getUsuario(usuarioId); } entity.setContrasenia(FacesUtils.checkString(txtContrasenia)); entity.setEstado((FacesUtils.checkInteger(txtIdEstado_Estado) != null) ? businessDelegatorView.getEstado(FacesUtils.checkInteger( txtIdEstado_Estado)) : null); entity.setTercero((FacesUtils.checkInteger(txtTerceroId_Tercero) != null) ? businessDelegatorView.getTercero(FacesUtils.checkInteger( txtTerceroId_Tercero)) : null); entity.setTipoUsuario((FacesUtils.checkInteger( txtTipoUsuarioId_TipoUsuario) != null) ? businessDelegatorView.getTipoUsuario(FacesUtils.checkInteger( txtTipoUsuarioId_TipoUsuario)) : null); businessDelegatorView.updateUsuario(entity); FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYMODIFIED); } catch (Exception e) { data = null; FacesUtils.addErrorMessage(e.getMessage()); } return ""; } public String action_delete_datatable(ActionEvent evt) { try { selectedUsuario = (UsuarioDTO) (evt.getComponent().getAttributes() .get("selectedUsuario")); String usuarioId = new String(selectedUsuario.getUsuarioId()); entity = businessDelegatorView.getUsuario(usuarioId); action_delete(); } catch (Exception e) { FacesUtils.addErrorMessage(e.getMessage()); } return ""; } public String action_delete_master() { try { String usuarioId = FacesUtils.checkString(txtUsuarioId); entity = businessDelegatorView.getUsuario(usuarioId); action_delete(); } catch (Exception e) { FacesUtils.addErrorMessage(e.getMessage()); } return ""; } public void action_delete() throws Exception { try { businessDelegatorView.deleteUsuario(entity); FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYDELETED); action_clear(); data = null; } catch (Exception e) { throw e; } } public String action_closeDialog() { setShowDialog(false); action_clear(); return ""; } public String action_modifyWitDTO(String contrasenia, String usuarioId, Integer idEstado_Estado, Integer terceroId_Tercero, Integer tipoUsuarioId_TipoUsuario) throws Exception { try { entity.setContrasenia(FacesUtils.checkString(contrasenia)); businessDelegatorView.updateUsuario(entity); FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYMODIFIED); } catch (Exception e) { //renderManager.getOnDemandRenderer("UsuarioView").requestRender(); FacesUtils.addErrorMessage(e.getMessage()); throw e; } return ""; } public InputText getTxtContrasenia() { return txtContrasenia; } public void setTxtContrasenia(InputText txtContrasenia) { this.txtContrasenia = txtContrasenia; } public InputText getTxtIdEstado_Estado() { return txtIdEstado_Estado; } public void setTxtIdEstado_Estado(InputText txtIdEstado_Estado) { this.txtIdEstado_Estado = txtIdEstado_Estado; } public InputText getTxtTerceroId_Tercero() { return txtTerceroId_Tercero; } public void setTxtTerceroId_Tercero(InputText txtTerceroId_Tercero) { this.txtTerceroId_Tercero = txtTerceroId_Tercero; } public InputText getTxtTipoUsuarioId_TipoUsuario() { return txtTipoUsuarioId_TipoUsuario; } public void setTxtTipoUsuarioId_TipoUsuario( InputText txtTipoUsuarioId_TipoUsuario) { this.txtTipoUsuarioId_TipoUsuario = txtTipoUsuarioId_TipoUsuario; } public InputText getTxtUsuarioId() { return txtUsuarioId; } public void setTxtUsuarioId(InputText txtUsuarioId) { this.txtUsuarioId = txtUsuarioId; } public List<UsuarioDTO> getData() { try { if (data == null) { data = businessDelegatorView.getDataUsuario(); } } catch (Exception e) { e.printStackTrace(); } return data; } public void setData(List<UsuarioDTO> usuarioDTO) { this.data = usuarioDTO; } public UsuarioDTO getSelectedUsuario() { return selectedUsuario; } public void setSelectedUsuario(UsuarioDTO usuario) { this.selectedUsuario = usuario; } public CommandButton getBtnSave() { return btnSave; } public void setBtnSave(CommandButton btnSave) { this.btnSave = btnSave; } public CommandButton getBtnModify() { return btnModify; } public void setBtnModify(CommandButton btnModify) { this.btnModify = btnModify; } public CommandButton getBtnDelete() { return btnDelete; } public void setBtnDelete(CommandButton btnDelete) { this.btnDelete = btnDelete; } public CommandButton getBtnClear() { return btnClear; } public void setBtnClear(CommandButton btnClear) { this.btnClear = btnClear; } public TimeZone getTimeZone() { return java.util.TimeZone.getDefault(); } public BusinessDelegator getBusinessDelegatorView() { return businessDelegatorView; } public void setBusinessDelegatorView( BusinessDelegator businessDelegatorView) { this.businessDelegatorView = businessDelegatorView; } public boolean isShowDialog() { return showDialog; } public void setShowDialog(boolean showDialog) { this.showDialog = showDialog; } }
[ "josedani0630@hotmail.com" ]
josedani0630@hotmail.com
d19b63680aad85d4b928420fe79a959285669c0d
7e2e00a1c9bf5a4c87fed8609b337ac9dd7af7a1
/gateway/src/main/java/com/example/gateway/responseObjects/User.java
0d371da8b4664566b0c917c13ee36535bd6c4fe9
[]
no_license
Sai-Srikar/OOOPSS
ac947a382f0754cf08ddb5600a9a195f161ffcfb
f2abb9e22dec3aa7f24bc686a443bdaee1eb2b67
refs/heads/master
2021-05-25T18:38:05.764854
2020-04-23T15:33:32
2020-04-23T15:33:32
253,872,832
0
0
null
2021-01-06T01:05:08
2020-04-07T18:00:21
JavaScript
UTF-8
Java
false
false
1,700
java
package com.example.gateway.responseObjects; import java.util.ArrayList; public class User { private String userId; private String name; private String mobileNumber; private String category; private String emailId; private ArrayList<String> locations; private ArrayList<String> favRestaurants; public User() { super(); } public User(String userId, String name, String mobileNumber, String category, String emailId, ArrayList<String> locations, ArrayList<String> favRestaurants) { super(); this.userId = userId; this.name = name; this.mobileNumber = mobileNumber; this.category = category; this.emailId = emailId; this.locations = locations; this.favRestaurants = favRestaurants; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMobileNumber() { return mobileNumber; } public void setMobileNumber(String mobileNumber) { this.mobileNumber = mobileNumber; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public String getEmailId() { return emailId; } public void setEmailId(String emailId) { this.emailId = emailId; } public ArrayList<String> getLocations() { return locations; } public void setLocations(ArrayList<String> locations) { this.locations = locations; } public ArrayList<String> getFavRestaurants() { return favRestaurants; } public void setFavRestaurants(ArrayList<String> favRestaurants) { this.favRestaurants = favRestaurants; } }
[ "saisrikar23799@gmail.com" ]
saisrikar23799@gmail.com
b7c4b9fe6be7f03b18d99daa309caeb487740d02
dbb5639ee0a6b9d467edef5c3dc8150523aa483f
/2008/Vtb24Group/ejbSource/com/vtb/ejb/SecurityActionProcessorFacadeLocalHome.java
fe69af1d48b360821fc4d4f80cfcbd5bca03236d
[]
no_license
ildar66/RAD7_VTB
806eac9ac3b1c54e4b4444537f6fcf8cee5741b1
4674e5bb772ed72a726e734d733ce8d11d3623b1
refs/heads/master
2020-11-29T21:59:02.463950
2017-07-08T08:38:41
2017-07-08T08:38:41
96,605,429
0
0
null
null
null
null
UTF-8
Java
false
false
388
java
package com.vtb.ejb; /** * Local Home interface for Enterprise Bean: SecurityActionProcessorFacade */ public interface SecurityActionProcessorFacadeLocalHome extends javax.ejb.EJBLocalHome { /** * Creates a default instance of Session Bean: SecurityActionProcessorFacade */ public com.vtb.ejb.SecurityActionProcessorFacadeLocal create() throws javax.ejb.CreateException; }
[ "ildar66@inbox.ru" ]
ildar66@inbox.ru
2ec445899bba038334c055d5114071e448b5e248
b76b9002df98261b248436af0a603ab82a31f54c
/ms-auth-service/src/main/java/com/example/demo/MsAuthServiceApplication.java
ebcb7d988cb92e09b15c3c5e2f4635e585df7a13
[]
no_license
rajputaanand/ms_with_docker
82e6be42f4c27a48616f07092b2aab4516b966aa
34fd3f64f3401549cc7dbf1609fa68944f76eab0
refs/heads/master
2023-03-03T11:27:44.090691
2021-02-14T20:13:07
2021-02-14T20:13:07
338,884,947
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; @SpringBootApplication @EnableEurekaClient public class MsAuthServiceApplication { public static void main(String[] args) { SpringApplication.run(MsAuthServiceApplication.class, args); } }
[ "rajputaanand@gmail.com" ]
rajputaanand@gmail.com
fbc3be6524350eefdf72a4eb7b9fadfbbb8e325b
09f52d42129af1a56a1c8a9840cfae0030f47569
/src/main/java/com/example/securityjpa/SecurityJpaApplication.java
0d384836a08f51cc8309f0d0a2fc6ec344df623a
[]
no_license
BzCoder/security-jpa
ea63f47983303614a7d74599a99cbe98e0268d09
614bddc5de66fc19c2027e2a775335bb518c9f0c
refs/heads/master
2020-03-22T08:16:47.624990
2018-07-09T10:35:47
2018-07-09T10:35:47
139,756,786
1
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.example.securityjpa; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SecurityJpaApplication { public static void main(String[] args) { SpringApplication.run(SecurityJpaApplication.class, args); } }
[ "107630221@qq.com" ]
107630221@qq.com
dc65b1f7514b9c04ed8fd0a8074a50c0aa886623
b604434fcc253c7b28c6c1039d4706c899141ea8
/Projects/Final_SOA_Client/build/generated/jax-wsCache/GetEmployeedetailsofTruck/services/GetEmployeedetailsofTruckResponse.java
91df4c3f344f0119c0ddbda49dd4ba0736f6a79c
[]
no_license
Rahul-cs/Service-Oriented-Architecture-G8
2762a5ddc1eedccb8ab867987e832cbb613015a5
369caf5d39fd8b04f0390d1c86b5a2e1ea577750
refs/heads/master
2021-08-21T20:27:29.249851
2017-11-29T00:21:58
2017-11-29T00:21:58
110,311,097
0
0
null
null
null
null
UTF-8
Java
false
false
1,513
java
package services; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for GetEmployeedetailsofTruckResponse complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="GetEmployeedetailsofTruckResponse"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "GetEmployeedetailsofTruckResponse", propOrder = { "_return" }) public class GetEmployeedetailsofTruckResponse { @XmlElement(name = "return") protected String _return; /** * Gets the value of the return property. * * @return * possible object is * {@link String } * */ public String getReturn() { return _return; } /** * Sets the value of the return property. * * @param value * allowed object is * {@link String } * */ public void setReturn(String value) { this._return = value; } }
[ "Rsulepethkar@hawk.iit.edu" ]
Rsulepethkar@hawk.iit.edu
27d9655cc1a362f0d251968b31bf9b73f4676bf7
835539d60d05f7547eb0fd4c207a801fd0e01606
/prodctm-persistence/src/test/java/pro/documentum/persistence/jpa/query/UpperQueryTest.java
02cb2c39883d92b59a9b25da15b1c139a573ab39
[]
no_license
dubrovskyd/prodctm
8eef2d251752beddd2d0e714541d6689b18a6e7d
c7e7f7c34c22918d422bea3a6f9c56ab15bb7a51
refs/heads/master
2021-01-15T17:59:47.585515
2016-06-08T01:53:34
2016-06-08T01:53:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
710
java
package pro.documentum.persistence.jpa.query; import static org.hamcrest.Matchers.endsWith; import org.junit.Test; import pro.documentum.model.jpa.DmUser; /** * @author Andrey B. Panfilov <andrey@panfilov.tel> */ public class UpperQueryTest extends AbstractQueryTest { @Test public void testUpper1() throws Exception { String q = str(jpa(DmUser.class, "UPPER(userName) = 'dmadmin'")); assertThat(q, endsWith("WHERE UPPER(this.user_name)='dmadmin'")); } @Test public void testUpper2() throws Exception { String q = str(jpa(DmUser.class, "userName.toUpperCase() = 'dmadmin'")); assertThat(q, endsWith("WHERE UPPER(this.user_name)='dmadmin'")); } }
[ "andrew@panfilov.tel" ]
andrew@panfilov.tel
004f8f07924c6b34669529855d1a092bbd0db31e
448cd5bb78b75d61b05d5489f332f3c092b11f95
/src/test/java/facades/MovieFacadeTest.java
65b9412ad1b7663dcb8e1294c8d354141a2f4b14
[]
no_license
atombomben/day3-movie
0048ea0fdfaf68703c637310178ac7f1d5c9146e
f64c675550775ae42886002f9f675dec29ababcc
refs/heads/master
2023-08-06T22:11:05.503603
2021-09-17T15:30:42
2021-09-17T15:30:42
407,484,417
0
0
null
null
null
null
UTF-8
Java
false
false
1,885
java
package facades; import utils.EMF_Creator; import entities.Movie; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; //Uncomment the line below, to temporarily disable this test //@Disabled public class MovieFacadeTest { private static EntityManagerFactory emf; private static MovieFacade facade; public MovieFacadeTest() { } @BeforeAll public static void setUpClass() { emf = EMF_Creator.createEntityManagerFactoryForTest(); facade = MovieFacade.getFacadeExample(emf); } @AfterAll public static void tearDownClass() { // Clean up database after test is done or use a persistence unit with drop-and-create to start up clean on every test } // Setup the DataBase in a known state BEFORE EACH TEST //TODO -- Make sure to change the code below to use YOUR OWN entity class @BeforeEach public void setUp() { EntityManager em = emf.createEntityManager(); try { em.getTransaction().begin(); em.createNamedQuery("Movie.deleteAllRows").executeUpdate(); em.persist(new Movie("Some txt", "More text")); em.persist(new Movie("aaa", "bbb")); em.getTransaction().commit(); } finally { em.close(); } } @AfterEach public void tearDown() { // Remove any data after each test was run } // TODO: Delete or change this method @Test public void testAFacadeMethod() throws Exception { assertEquals(2, facade.getRenameMeCount(), "Expects two rows in the database"); } }
[ "71074932+atombomben@users.noreply.github.com" ]
71074932+atombomben@users.noreply.github.com
b20a0b007134959e8ac6297f249245281eee6ec7
703c2c10b20ff285056594d5fecfb1c224198715
/src/com/gargoylesoftware/htmlunit/svg/SvgMissingGlyph.java
5ddcd6f2278ea7b62b2dd86aee92fa9f3103ee23
[]
no_license
semihyumusak/SpEnD
692c94a350f2145aec657738ee9273b689670352
386c207197bf952735d26d8c2a6ffbaed726a8da
refs/heads/master
2020-04-12T06:30:20.868402
2016-08-16T18:37:10
2016-08-16T18:37:10
50,120,081
3
0
null
null
null
null
UTF-8
Java
false
false
1,571
java
/* * Copyright (c) 2002-2014 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.gargoylesoftware.htmlunit.svg; import java.util.Map; import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.html.DomAttr; /** * Wrapper for the SVG element "missing-glyph". * * @version $Revision: 8931 $ * @author Frank Danek */ public class SvgMissingGlyph extends SvgElement { /** The tag represented by this element. */ public static final String TAG_NAME = "missing-glyph"; /** * Creates a new instance. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ SvgMissingGlyph(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page, attributes); } }
[ "semihyumusak@yahoo.com" ]
semihyumusak@yahoo.com
57afa151a3c3c4203707cffe892ce2fba64d4538
cc2408250934f1a0bbb8edd9ac416ddaf1d7cda3
/src/main/java/w1/User.java
691ada9886d1d16686f19e12137a7e1373b1c549
[]
no_license
MikiKru/p2_nst
dd8f075f59237cd29c4be6a900f36b123d694933
2b129c657e69c7d9dd2725e83338d557589113a9
refs/heads/master
2023-05-31T08:01:42.576360
2021-06-12T07:24:35
2021-06-12T07:24:35
345,043,120
0
0
null
null
null
null
UTF-8
Java
false
false
994
java
package w1; // ALT + Ins - generate -> konstruktor, getters and setters, toString public class User { private String email; private String password; public User(String email, String password) { // konstruktor this.email = email; // -> nazwa jak nazwa klasy this.password = password; // -> nie zwaca wartości i nie jest typu void } // -> inicjalizuje obiekt public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @Override public String toString() { // -> napisowa reprezentacja obiektu return "w1.User{" + "email='" + email + '\'' + ", password='" + password + '\'' + '}'; } }
[ "michal_kruczkowski@o2.pl" ]
michal_kruczkowski@o2.pl
d838228de95c03819553d2fd62a25b22de9fc6dc
efcf914c0c7d8ade4fc195d505d9d3c6aaf029ec
/miniprogram/src/main/java/com/lyl/work/service/impl/ClockedServiceImpl.java
0ddfd1e8a0ffda4f382f9df07f3777fbd3c7e407
[]
no_license
blue-for-dragon/LearningProject
2aa79b104e01d8c952a8a35f7ae996f29494720e
d42905f652cbe1cd76419cfdf779af7432aa8ac1
refs/heads/master
2023-06-15T18:32:49.705811
2021-07-13T14:25:54
2021-07-13T14:25:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
944
java
package com.lyl.work.service.impl; import com.lyl.work.dao.ClockedDao; import com.lyl.work.entity.Clocked; import com.lyl.work.service.ClockedService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service("clockedService") public class ClockedServiceImpl implements ClockedService { @Autowired private ClockedDao clockedDao; @Override public Clocked queryClockedByid(String Id) { return clockedDao.queryClockedByid(Id); } @Override public void updateClocked(String Id) { clockedDao.updateClocked(Id); } @Override public void insertNewClocked(String NewId) { clockedDao.insertNewClocked(NewId); } @Override public Integer queryTimes(String Id) { return clockedDao.queryTimes(Id); } @Override public void insertNewOpenId(String Id) { clockedDao.insertNewOpenId(Id); } }
[ "lyl24677@163.com" ]
lyl24677@163.com
c5d83eb7d42df0c50b1a5d8767fcc66c6ab6242e
85569de2518ed855857e70cbd904fecba7ff3d38
/app/src/main/java/io/seamoss/urbino/views/node/tasks/ExerciseViewHolder.java
2c5c69cf6a02a31ec60e879e3e96a37014a3e2e1
[]
no_license
ammelto/Urbino
b2830687798201dd49e40f3bf0e368c0d987fd81
acd34a1c7f42b6b40957578dc4125bb80bcba88f
refs/heads/master
2021-01-19T02:49:54.411609
2017-03-18T07:11:09
2017-03-18T07:11:09
81,792,434
0
0
null
null
null
null
UTF-8
Java
false
false
2,043
java
package io.seamoss.urbino.views.node.tasks; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.Button; import android.widget.FrameLayout; import android.widget.TextView; import org.w3c.dom.Text; import butterknife.BindView; import butterknife.ButterKnife; import io.seamoss.urbino.R; import io.seamoss.urbino.data.models.tasks.Exercise; import timber.log.Timber; /** * Created by Alexander Melton on 3/17/2017. */ public class ExerciseViewHolder extends TaskViewholder { private Exercise exercise; @BindView(R.id.exercise_title) TextView title; @BindView(R.id.exercise_description) TextView description; @BindView(R.id.exercise_questions_text) TextView questions; @BindView(R.id.exercise_timelimit_text) TextView timelimit; @BindView(R.id.exercise_mentor) Button mentor; @BindView(R.id.exercise_start) Button start; @BindView(R.id.exercise_bonus) FrameLayout bonus; @BindView(R.id.exercise_bonus_amount) TextView multiplier; public ExerciseViewHolder(View itemView) { super(itemView); ButterKnife.bind(this, itemView); } @Override public void bind(Exercise exercise) { this.exercise = exercise; title.setText(exercise.getName()); description.setText(exercise.getDescription()); questions.setText(String.format(itemView.getResources().getString(R.string.card_exercise_questions), exercise.getQuestions().size())); if(exercise.getTimeLimit() == -1) timelimit.setText(itemView.getResources().getString(R.string.card_exercise_timeLimit)); else timelimit.setText(String.format(itemView.getResources().getString(R.string.card_exercise_timeLimit_active), exercise.getTimeLimit())); if(exercise.isHasBonus()) multiplier.setText(String.format(itemView.getResources().getString(R.string.task_bonus), exercise.getMultiplier())); else bonus.setVisibility(View.INVISIBLE); } }
[ "alexander.melton@okstate.edu" ]
alexander.melton@okstate.edu
4144fe329f738883c238cea13de987fbb60bedf0
cd7dbe9c2e5e390bb2c8c2816657ba3914aa1f93
/core/src/de/mewel/pixellogic/model/PixelLogicLevelCollection.java
2e45be6ff5d62c94d0fd92c3cf32164817831dba
[ "MIT" ]
permissive
Mewel/PixelLogic
240e4732f50391f3cef2ad407a55e2497dd0190a
f7596e772f395966302ce2131436f8e08fc82990
refs/heads/master
2021-06-14T02:51:48.089807
2021-05-14T22:46:32
2021-05-14T22:46:32
194,254,844
1
0
null
null
null
null
UTF-8
Java
false
false
4,193
java
package de.mewel.pixellogic.model; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.utils.OrderedMap; import java.util.List; import java.util.Locale; public class PixelLogicLevelCollection { private String id; private OrderedMap<String, String> languages; private Integer pixmapWidth; private Integer pixmapHeight; private Boolean preserveSize = false; private Boolean preserveOrder = false; private List<PixelLogicLevelData> level; private List<Integer> order; private Pixmap pixmap; private Pixmap levelmap; private Pixmap unsolved; public String getId() { return id; } public void setId(String id) { this.id = id; } public OrderedMap<String, String> getLanguages() { return languages; } public Integer getPixmapWidth() { return pixmapWidth; } public void setPixmapWidth(Integer pixmapWidth) { this.pixmapWidth = pixmapWidth; } public Integer getPixmapHeight() { return pixmapHeight; } public void setPixmapHeight(Integer pixmapHeight) { this.pixmapHeight = pixmapHeight; } public List<PixelLogicLevelData> getLevelList() { return level; } public void setLevelList(List<PixelLogicLevelData> level) { this.level = level; } public PixelLogicLevelData getLevel(String name) { Integer index = getLevelIndexByName(name); return index != null ? level.get(index) : null; } public Integer getLevelIndexByName(String name) { for (int i = 0; i < this.level.size(); i++) { PixelLogicLevelData levelData = level.get(i); if (levelData.getName().equals(name)) { return i; } } return null; } public Integer indexOf(PixelLogicLevelData levelData) { return this.level.indexOf(levelData); } public void setPixmap(Pixmap pixmap) { this.pixmap = pixmap; } public void setLevelmap(Pixmap levelmap) { this.levelmap = levelmap; } public Pixmap getPixmap() { return pixmap; } public Pixmap getLevelmap() { return levelmap; } public void setUnsolvedPixmap(Pixmap unsolvedPixmap) { this.unsolved = unsolvedPixmap; } public Pixmap getUnsolved() { return unsolved; } public Boolean getPreserveOrder() { return preserveOrder; } public void setPreserveOrder(Boolean preserveOrder) { this.preserveOrder = preserveOrder; } public Boolean getPreserveSize() { return preserveSize; } public void setPreserveSize(Boolean preserveSize) { this.preserveSize = preserveSize; } public List<Integer> getOrder() { return order; } public void setOrder(List<Integer> order) { this.order = order; } public Sprite getSprite(String name, Texture levelTexture) { return getSprite(name, levelTexture, pixmapWidth, pixmapHeight); } public Sprite getSprite(String name, Texture levelTexture, int fixedWidth, int fixedHeight) { PixelLogicLevelData data = getLevel(name); Integer x = data.getX(); Integer y = data.getY(); if (x == null || y == null) { Integer index = getLevelIndexByName(name); int columns = levelTexture.getWidth() / pixmapWidth; y = index / columns; x = index % columns; } return new Sprite(levelTexture, x * pixmapWidth, y * pixmapHeight, fixedWidth, fixedHeight); } public String getName() { OrderedMap<String, String> languages = getLanguages(); if (languages == null) { return getId(); } String language = Locale.getDefault().getLanguage(); String primaryLanguageText = languages.get(language); if (primaryLanguageText != null) { return primaryLanguageText; } String englishText = languages.get("en"); return englishText != null ? englishText : getId(); } }
[ "thegreatmewel@gmail.com" ]
thegreatmewel@gmail.com
98d53cac53a26db043f78d2f60aa407877c4415d
c56fedd7e617014d917a5d3d18f2d3125113fee7
/management/testing/sample-entity/src/main/java/org/terracotta/management/entity/sample/client/management/CacheStatisticCollectorManagementProvider.java
7d19d5ed4182a8a2570a189a05b4072c94a91279
[ "Apache-2.0" ]
permissive
rahul-mittal/terracotta-platform
373bb6740ba4a696a918666811019a472e8e2ae7
5a599752f483e051920be161f82eac4a862e1643
refs/heads/master
2021-05-01T18:32:03.028444
2020-07-14T19:24:00
2020-07-15T07:28:32
279,851,143
0
0
Apache-2.0
2020-07-15T11:32:49
2020-07-15T11:32:49
null
UTF-8
Java
false
false
1,118
java
/* * Copyright Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.terracotta.management.entity.sample.client.management; import org.terracotta.management.model.context.Context; import org.terracotta.management.registry.Named; import org.terracotta.management.registry.RequiredContext; import org.terracotta.management.registry.collect.StatisticCollectorProvider; @RequiredContext({@Named("appName")}) class CacheStatisticCollectorManagementProvider extends StatisticCollectorProvider { CacheStatisticCollectorManagementProvider(Context context) { super(context); } }
[ "mathieu.carbou@gmail.com" ]
mathieu.carbou@gmail.com
991bfa506dc77644dce135fe25bc2fc44bfd26be
c7e0f3ae98d7c9744004aa9fba0b09d40cf68b02
/Bookworms/src/main/java/com/bookworm/BookwormsApplication.java
fca25f8fa1fa5929fbb2d9ebab5b792c71c89967
[]
no_license
aman1bhardwaj/Bookworms
27d71535f0adbff6b88beed310a27a3f9e378d72
d5410c7f13d7c343723bae6c917ee6da98f29420
refs/heads/main
2023-08-11T15:54:40.258252
2021-09-24T05:42:18
2021-09-24T05:42:18
403,274,018
0
0
null
null
null
null
UTF-8
Java
false
false
311
java
package com.bookworm; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class BookwormsApplication { public static void main(String[] args) { SpringApplication.run(BookwormsApplication.class, args); } }
[ "84137675+aman1bhardwaj@users.noreply.github.com" ]
84137675+aman1bhardwaj@users.noreply.github.com
95a88a32c8eebcba3746e6138005a78720ac366f
de9f7852b44fe7268a90f962e9742e0a5069db78
/app/src/main/java/com/breeziness/timetable/loginPage/LoginActivity.java
8bffbf0c21ceffcc9263af20bb275b4b20fe81d1
[ "Apache-2.0" ]
permissive
zhu-dev/timetable
291a21b81dc0e9b9536362660f47de9f98f7f5f8
142d69aa12eb08949c3f223583c3203dee768684
refs/heads/master
2020-04-25T03:12:30.707900
2019-07-06T13:50:45
2019-07-06T13:50:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,970
java
package com.breeziness.timetable.loginPage; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.Toast; import com.breeziness.timetable.R; import com.breeziness.timetable.base.ActivityCollector; import com.breeziness.timetable.base.BaseActivity; public class LoginActivity extends BaseActivity implements View.OnClickListener { private EditText login_ev_id_input;//账号 private EditText login_ev_password_input;//密码 private Button login_btn_login; //登录按键 private ImageView login_iv_clear_input;//清空输入 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.activity_login); getWindow().setNavigationBarColor(Color.WHITE);//设置底部导航虚拟按键颜色为白色 //Toolbar相关 setToolbarTitle("登录胖圆课表"); setToolbarAlpha(0); } @Override protected int getLayoutId() { return R.layout.activity_login; } @Override protected void initView() { login_ev_id_input = findViewById(R.id.login_ev_id_input); login_ev_password_input = findViewById(R.id.login_ev_password_input); login_btn_login = findViewById(R.id.login_btn_login); login_iv_clear_input = findViewById(R.id.login_iv_clear_input); login_btn_login.setOnClickListener(this); login_iv_clear_input.setOnClickListener(this); } @Override protected void initData() { } @Override public void onClick(View v) { switch (v.getId()) { case R.id.login_btn_login: // 登录之前要判断输入得值是否合法 if (checkInputMessage(login_ev_id_input.getText(), login_ev_password_input.getText())) { //登录验证账号和密码 //验证成功则保存账号密码 } break; case R.id.login_iv_clear_input: // 清空输入 login_ev_id_input.setText(""); login_ev_password_input.setText(""); break; } } @Override public void onBackPressed() { super.onBackPressed(); //在取消登录时退出本应用 ActivityCollector.finishAll(); } private boolean checkInputMessage(CharSequence user_name, CharSequence password) { if (user_name.length() == 0 || password.length() == 0) { Toast.makeText(LoginActivity.this, "账号/密码不能为空", Toast.LENGTH_SHORT).show(); return false; } else if (user_name.length() != 10 || password.length() < 6) { Toast.makeText(LoginActivity.this, "账号/密码格式错误", Toast.LENGTH_SHORT).show(); return false; } return true; } }
[ "breeziness123@outlook.com" ]
breeziness123@outlook.com
2e19c33c4d61b5bee14b246fba81a4e0ca3c150e
015f7236e4b759dbf9d6992c0cb3c38b90d8be99
/fsbasics1-backend/src/main/java/io/agileintelligence/fsbasics1backend/exception/ProjectTaskException.java
6fd867ba86ef79fe30888f2e146650a0fe1e5d9f
[]
no_license
AgileIntYoutube/FSBasicS1-SpringBoot-React
ea364c18a328a0fe9a3e5fd82a725b5290871003
dbc2718cec53efc93d5d983cafe1ef61b7e91004
refs/heads/master
2023-01-13T14:07:56.015720
2019-11-04T23:48:03
2019-11-04T23:48:03
215,788,856
0
0
null
2023-01-04T23:33:12
2019-10-17T12:37:59
JavaScript
UTF-8
Java
false
false
412
java
package io.agileintelligence.fsbasics1backend.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(HttpStatus.NOT_FOUND) public class ProjectTaskException extends RuntimeException { public ProjectTaskException(String message) { super(message); } }
[ "io.agileintelligence@gmail.com" ]
io.agileintelligence@gmail.com
9ccf37e7abc526ade575094f816c8cd1371f024d
5f13c94194459ef7d61b9d416bfc61abdfeb536f
/APPLICATION/SpringSecurityWebMvcRestExample/src/main/java/com/adarsh/spring/rest/service/RoleServiceImpl.java
19ec9cbcaba573a5932ffbdced38949e04dafc5c
[]
no_license
adarshkumarsingh83/spring_security
092cd3a7385cf2abfdf8e165ec08995de30cd835
8d655c1e0ae80ad3d1b1fe6a400da92af8032c08
refs/heads/master
2023-02-03T06:17:55.941921
2023-01-24T05:33:26
2023-01-24T05:33:26
46,787,876
2
3
null
2023-01-23T21:06:45
2015-11-24T11:37:09
Java
UTF-8
Java
false
false
2,298
java
/* * Copyright (c) 2015 Espark And ©Adarsh Development Services @copyright All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of Espark nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.adarsh.spring.rest.service; import com.adarsh.spring.rest.entity.Role; import com.adarsh.spring.rest.resporitory.RoleDAO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * @author Adarsh Kumar * @author $LastChangedBy: Adarsh Kumar$ * @version $Revision: 0001 $, $Date:: 1/1/10 0:00 AM#$ * @Espark @copyright all right reserve */ @Service @Transactional public class RoleServiceImpl implements RoleService { @Autowired private RoleDAO roleDAO; public Role getRole(int id) { return roleDAO.getRole(id); } }
[ "adarshkumarsingh83@gmail.com" ]
adarshkumarsingh83@gmail.com
e468a5123a62f3486f55e1415db7a1ab4c8d2e7b
f1fe48ab3fcbc5283e5a0ededafc3ccff2de1c4f
/src/com/ray/deepintothread/ch02/topic_5/ReGetInTheLock2.java
d62bf92bb4998343bc6097bb461973c3d113a8d2
[]
no_license
raylee2015/DeepIntoThread
1d36eaa29aa27b277ed92bde1d79df46b37c34a3
c3f520b1a0e850825defe9eba5f07159c581decb
refs/heads/master
2021-01-21T04:50:43.598276
2016-06-18T13:50:20
2016-06-18T13:50:20
55,654,312
8
0
null
null
null
null
UTF-8
Java
false
false
671
java
package com.ray.deepintothread.ch02.topic_5; public class ReGetInTheLock2 { public static void main(String[] args) throws InterruptedException { Sub sub = new Sub(); ThreadTwo threadTwo = new ThreadTwo(sub); Thread thread = new Thread(threadTwo); thread.start(); } } class ThreadTwo implements Runnable { private Sub sub; public ThreadTwo(Sub sub) { this.sub = sub; } @Override public void run() { sub.show(); } } class Father { public void show() { System.out.println("father show"); } } class Sub extends Father { @Override public void show() { System.out.println("sub show"); super.show(); } }
[ "lilinghui-123@163.com" ]
lilinghui-123@163.com
f16a02a804978e4b4eecd97dea89e61d72b45f36
32fc5279dac7220b68a542d9f9bd8c6289406968
/src/main/java/com/zhao/service/PermService.java
6ab89bbca73ee76064215623cb9fc8733523f30e
[]
no_license
MrZhaoHuan/rbac
c76566e81ad9fe5e7b1686011b182d2a179635c6
72d9d4833a15ec839e60cce1265558f38c085b3a
refs/heads/master
2020-03-22T04:38:24.455750
2018-07-03T01:24:09
2018-07-03T01:24:09
139,510,910
1
0
null
null
null
null
UTF-8
Java
false
false
2,693
java
package com.zhao.service; import com.zhao.dao.PermissionMapper; import com.zhao.pojo.Permission; import com.zhao.util.PageObj; import com.zhao.vo.PermVo; import com.zhao.web.exception.ParamException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @创建人 zhaohuan * @邮箱 1101006260@qq.com * @创建时间 2018-06-14 15:23 * @描述 */ @Service public class PermService { private PermissionMapper mapper; @Autowired public void setMapper(PermissionMapper mapper) { this.mapper = mapper; } /* *@描述 查询权限列表 *@创建时间 2018/6/14 15:26 *@参数 *@返回值 **/ public PageObj getPermPageList(int permModuleId, PageObj pageObj) { int pageNo = pageObj.getPageNo()<1?1:pageObj.getPageNo(); int pageSize = pageObj.getPageSize()<0?0:pageObj.getPageSize(); int total = 0; //总条数 //更正页码和每页数量 pageObj.setPageNo(pageNo); pageObj.setPageSize(pageSize); //查询权限列表 List<PermVo> permVos = mapper.selectPageList(permModuleId,(pageNo-1)*pageSize,pageSize); if(permVos==null || permVos.size()==0){ permVos = new ArrayList<>(); }else{ total = permVos.get(0).getTotal(); } Map<String,Object> map = new HashMap<>(); map.put("total",total); map.put("data",permVos); pageObj.setCode("0"); pageObj.setData(map); return pageObj; } public void save(Permission permission) { permission.setId(null); //校验权限名称 validPermName(permission); //保存 mapper.insertSelective(permission); } private void validPermName(Permission permission){ //校验:同1个权限模块下,不能有相同名称的权限 int count = mapper.selectCountBySamePermModule(permission.getPermmoduleId(),permission.getName(),permission.getId()); if(count>0){ throw new ParamException("当前权限模块下,存在名称为"+permission.getName()+"的权限"); } } public void update(Permission permission) { //校验权限名称 validPermName(permission); //更新 mapper.updateByPrimaryKeySelective(permission); } public List<Permission> getByUrl(String url) { return mapper.selectPermBySelect(url); } public List<Integer> getAllPermByUser(Integer id) { return mapper.getAllPermByUser(id); } }
[ "1101006260@qq.com" ]
1101006260@qq.com
68b9fc3bb2395b7ed0cfe1e14cc8e33e9ad86fdc
12b14b30fcaf3da3f6e9dc3cb3e717346a35870a
/examples/commons-math3/mutations/mutants-GeometricDistribution/63/org/apache/commons/math3/distribution/GeometricDistribution.java
6e52ae5787484e82f2ce844dee2be97764ca7c52
[ "BSD-3-Clause", "Minpack", "Apache-2.0" ]
permissive
SmartTests/smartTest
b1de326998857e715dcd5075ee322482e4b34fb6
b30e8ec7d571e83e9f38cd003476a6842c06ef39
refs/heads/main
2023-01-03T01:27:05.262904
2020-10-27T20:24:48
2020-10-27T20:24:48
305,502,060
0
0
null
null
null
null
UTF-8
Java
false
false
4,527
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.math3.distribution; import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.util.FastMath; import org.apache.commons.math3.random.RandomGenerator; import org.apache.commons.math3.random.Well19937c; /** * Implementation of the geometric distribution. * * @see <a href="http://en.wikipedia.org/wiki/Geometric_distribution">Geometric distribution (Wikipedia)</a> * @see <a href="http://mathworld.wolfram.com/GeometricDistribution.html">Geometric Distribution (MathWorld)</a> * @version $Id$ * @since 3.3 */ public class GeometricDistribution extends AbstractIntegerDistribution { /** Serializable version identifier. */ private static final long serialVersionUID = 20130507L; /** The probability of success. */ private final double probabilityOfSuccess; /** * Create a geometric distribution with the given probability of success. * * @param p probability of success. * @throws OutOfRangeException if {@code p <= 0} or {@code p > 1}. */ public GeometricDistribution(double p) { this(new Well19937c(), p); } /** * Creates a geometric distribution. * * @param rng Random number generator. * @param p Probability of success. * @throws OutOfRangeException if {@code p <= 0} or {@code p > 1}. */ public GeometricDistribution(RandomGenerator rng, double p) { super(rng); if (p <= 0 || p > 1) { throw new OutOfRangeException(LocalizedFormats.OUT_OF_RANGE_LEFT, p, 0, 1); } probabilityOfSuccess = p; } /** * Access the probability of success for this distribution. * * @return the probability of success. */ public double getProbabilityOfSuccess() { return probabilityOfSuccess; } /** {@inheritDoc} */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { final double p = probabilityOfSuccess; ret = FastMath.pow(1 - p, x) * p; } return ret; } /** {@inheritDoc} */ public double cumulativeProbability(int x) { double ret; if (x < 0) { ret = 0.0; } else { final double p = probabilityOfSuccess; ret = 1.0 * FastMath.pow(1 - p, x + 1); } return ret; } /** * {@inheritDoc} * * For probability parameter {@code p}, the mean is {@code (1 - p) / p}. */ public double getNumericalMean() { final double p = probabilityOfSuccess; return (1 - p) / p; } /** * {@inheritDoc} * * For probability parameter {@code p}, the variance is * {@code (1 - p) / (p * p)}. */ public double getNumericalVariance() { final double p = probabilityOfSuccess; return (1 - p) / (p * p); } /** * {@inheritDoc} * * The lower bound of the support is always 0. * * @return lower bound of the support (always 0) */ public int getSupportLowerBound() { return 0; } /** * {@inheritDoc} * * The upper bound of the support is infinite (which we approximate as * {@code Integer.MAX_VALUE}). * * @return upper bound of the support (always Integer.MAX_VALUE) */ public int getSupportUpperBound() { return Integer.MAX_VALUE; } /** * {@inheritDoc} * * The support of this distribution is connected. * * @return {@code true} */ public boolean isSupportConnected() { return true; } }
[ "kesina@Kesinas-MBP.lan" ]
kesina@Kesinas-MBP.lan
9ad2e24a6ff6d4cdb291622a4d4a9ec284b78af7
bd24f7df8d72d275a5701c15b35fc700c70aa3bd
/src/main/java/dragon/network/messages/service/listtopo/TopoListSMsg.java
78677433997cb318403ee54c4d256cf0fc9e92c0
[ "Apache-2.0" ]
permissive
arnhrwd/dragon
02ac85b1fabd48d3da52fd87665589f93232842f
e8b07d987e0caf6a2c356c6710fec9f1c1c57a3f
refs/heads/master
2022-12-27T00:11:10.386720
2020-07-02T03:29:52
2020-07-02T03:29:52
249,955,255
6
1
Apache-2.0
2022-12-14T20:43:40
2020-03-25T11:02:31
Java
UTF-8
Java
false
false
1,364
java
package dragon.network.messages.service.listtopo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import dragon.ComponentError; import dragon.metrics.Sample; import dragon.network.messages.service.ServiceMessage; /** * @author aaron * */ public class TopoListSMsg extends ServiceMessage { private static final long serialVersionUID = -4010036400846816662L; /** * */ public final HashMap<String, HashMap<String, String>> descState; /** * */ public final HashMap<String, HashMap<String, HashMap<String, ArrayList<ComponentError>>>> descErrors; /** * */ public final HashMap<String,HashMap<String,List<String>>> descComponents; /** * */ public final HashMap<String,HashMap<String,HashMap<String,Sample>>> descMetrics; /** * @param descState * @param descErrors * @param descComponents */ public TopoListSMsg(HashMap<String, HashMap<String, String>> descState, HashMap<String, HashMap<String, HashMap<String, ArrayList<ComponentError>>>> descErrors, HashMap<String,HashMap<String,List<String>>> descComponents, HashMap<String,HashMap<String,HashMap<String,Sample>>> descMetrics) { super(ServiceMessage.ServiceMessageType.TOPOLOGY_LIST); this.descState=descState; this.descErrors=descErrors; this.descComponents=descComponents; this.descMetrics=descMetrics; } }
[ "aharwood@unimelb.edu.au" ]
aharwood@unimelb.edu.au
e501686445f3c07e9f3ea39b9e344f7490a53417
fa434c82b124b0d249258cb1f719492d0f5600da
/src/components/tables/headers/renderers/SteamAchievementsTableHeaderRenderer.java
fe131ee77fdedb405f9bd472937b1ffcba8dc316
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Naeregwen/games-librarian
b0d51ba15a0bb41625255cdd57f5d53250c81d7c
a35171945e1d0a909be0dd5bdf3c17b7eb099761
refs/heads/master
2016-08-12T16:09:44.504729
2016-03-27T12:14:27
2016-03-27T12:14:27
48,418,240
0
0
null
null
null
null
UTF-8
Java
false
false
4,239
java
/** * Copyright 2012-2014 Naeregwen * * 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 components.tables.headers.renderers; import java.awt.Color; import java.awt.Component; import java.awt.FlowLayout; import javax.swing.BoxLayout; import javax.swing.Icon; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.JTable; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import javax.swing.border.LineBorder; import javax.swing.plaf.basic.BasicArrowButton; import javax.swing.table.TableCellRenderer; import commons.GamesLibrarianIcons; import commons.api.SteamAchievementsList; import commons.enums.SteamAchievementsSortMethod; import components.tables.models.SteamAchievementsTableModel; /** * @author Naeregwen * */ public class SteamAchievementsTableHeaderRenderer implements TableCellRenderer { /* (non-Javadoc) * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int) */ @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS)); JPanel avatarPanel = new JPanel(); avatarPanel.setLayout(new FlowLayout()); avatarPanel.setBorder(UIManager.getBorder("TableHeader.cellBorder")); JLabel avatarIcon = new JLabel(); avatarIcon.setHorizontalAlignment(JLabel.CENTER); SteamAchievementsList achievementsList = ((SteamAchievementsTableModel) table.getModel()).getAchievementListAt(table.convertColumnIndexToModel(column)); Double achievementsRatio = achievementsList != null ? achievementsList.getAchievementsRatio() * 100 : 0; Icon playerAvatarIcon = achievementsList != null ? achievementsList.getPlayerAvatarIcon() : null; avatarIcon.setIcon(playerAvatarIcon != null ? playerAvatarIcon : GamesLibrarianIcons.noAvatarIcon); SteamAchievementsSortMethod achievementsSortMethod = ((SteamAchievementsTableModel) table.getModel()).getSteamAchievementsComparator().getSteamAchievementsSortMethod(); BasicArrowButton sortDirectionIndicator = null; switch (achievementsSortMethod) { case InitialAscendingOrder : sortDirectionIndicator = new BasicArrowButton(BasicArrowButton.EAST); break; case NameAscendingOrder : case UnlockDateAscendingOrder : sortDirectionIndicator = new BasicArrowButton(BasicArrowButton.NORTH); break; case NameDescendingOrder : case UnlockDateDescendingOrder : sortDirectionIndicator = new BasicArrowButton(BasicArrowButton.SOUTH); break; } sortDirectionIndicator.setBorder(new EmptyBorder(0, 0, 0, 0)); avatarIcon.setText("<html>" + ((String) value) + "<br/>" + achievementsList.getPrintableAchievementsRatio(achievementsRatio) + "</html>"); // avatarIcon.setText("<html>" + ((String) value) + "<br/>" + String.format("%4.2f %%", achievementsRatio) + "</html>"); avatarPanel.add(avatarIcon); avatarPanel.add(sortDirectionIndicator); mainPanel.add(avatarPanel); JProgressBar progressBar = new JProgressBar(0, 100); progressBar.setValue(achievementsList.getCeiledAchievementsRatio(achievementsRatio)); progressBar.setStringPainted(true); progressBar.setBorder(new LineBorder(Color.BLACK)); progressBar.setBorder(UIManager.getBorder("TableHeader.cellBorder")); mainPanel.add(progressBar); return mainPanel; } }
[ "chan.yslas@laposte.net" ]
chan.yslas@laposte.net
ac3f6b088cb2837c346b8382c02eb4e7e6868bc5
2529417899be822a1ae13d6d33055353c4bf04d3
/spring-cloud/hawk-job/src/main/java/cn/cincout/distribute/hawk/job/HawkJobApplication.java
d14ec16e02fd6c4af8def2ef82c5b6c3fb3a8406
[]
no_license
zhangzhaoyu/spring-cloud-parent
9d51e87aabb63861bf660ecc826d5abfcc9592d9
8f6c850d940f8b6c120112506172f191f46ece05
refs/heads/master
2020-03-23T04:40:01.649369
2019-02-13T03:13:30
2019-02-13T03:13:30
141,097,828
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package cn.cincout.distribute.hawk.job; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class HawkJobApplication { public static void main(String[] args) { SpringApplication.run(HawkJobApplication.class, args); } }
[ "zhangzhaoyu0524@163.com" ]
zhangzhaoyu0524@163.com
34f1a7e77271dd3f45f2d948f5a392cdc782fd0d
9219ab5adeebd481dca2621a2afda3ace0b0bb8d
/src/org/cz/validate/RegistrationValidator.java
7eb6c95c5f3fbcf07f762d76a8e748b2bb6947c4
[]
no_license
mariuso28/UrbanParadigm-candice
bc7f521b61d8d520ad7621fb34b9a284ad54a459
a36af37d1cf3eb3960631c6640343364950273cb
refs/heads/master
2021-01-22T23:00:54.449509
2018-01-03T06:49:48
2018-01-03T06:49:48
92,792,663
0
0
null
null
null
null
UTF-8
Java
false
false
1,251
java
package org.cz.validate; public class RegistrationValidator { public static String validateFields(String email, String password, String contact, String phone) { String msg = ""; msg += checkEmail(email); msg += checkField("Contact",contact); msg += checkPhone(phone); msg += checkPassword(password); if (!msg.isEmpty()) return msg.substring(0,msg.length()-1); return msg; } private static String checkEmail(String email) { String msg = checkField("Email",email); if (msg.isEmpty()) { EmailValidator ev = new EmailValidator(); if (!ev.validate(email)) msg += "Email,"; } return msg; } private static String checkPhone(String phone) { String msg = checkField("Phone",phone); if (msg.isEmpty()) { PhoneValidator pv = new PhoneValidator(); if (!pv.validate(phone)) msg += "Phone,"; } return msg; } private static String checkPassword(String password) { String msg = checkField("Password",password); if (msg.isEmpty()) { if (password.length()<8) return "Password should be 8 chars or more - please fix"; } return ""; } private static String checkField(String field,String value) { if (value==null || value.isEmpty()) return field + ","; return ""; } }
[ "mariuso.pk@gmail.com" ]
mariuso.pk@gmail.com
6224141f54b2de3c2cb5c009ced02f03a92226f7
8ba1d191811cd7fb4990d9b982013088247b4f8f
/sprirngboot-websocket/src/test/java/com/eic/springchatapp/SpringBootWebSocketAppTests.java
80e2067167f9859badaaa85da096fc5f718b072c
[]
no_license
EicDafusen/springboot-chat
acb33c5511aad00460357e3dd7a24dcce0e17736
0e47538860d78a2e3697afffa55d00705a2d3ad9
refs/heads/master
2023-02-05T21:56:51.829686
2020-12-26T12:08:53
2020-12-26T12:08:53
314,553,926
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package com.eic.springchatapp; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SpringBootWebSocketAppTests { @Test void contextLoads() { } }
[ "bahadirhamzagul@gmail.com" ]
bahadirhamzagul@gmail.com
1d0ae310fe746f0e746ce0c59607c1b6dd6a958b
2a73b993c5a9508ee53f24219c67f80945fc6d0c
/RetryAnalyzer/src/com/Retry/retryAnalyzer.java
fac62d335f8eab59bf422f88815dcd7b9ad4a951
[]
no_license
HMV4/D-workspace-PhpTravelDataDrivenMavenFramwork
62312624cba95eb55b41a6bd28566f3ed0df5337
7a94c5154092ea148395bb65ffad912c2f072106
refs/heads/master
2021-01-01T18:06:04.226829
2017-08-26T10:09:05
2017-08-26T10:09:05
98,249,002
0
0
null
null
null
null
UTF-8
Java
false
false
649
java
package com.Retry; import org.testng.IRetryAnalyzer; import org.testng.ITestResult; public class retryAnalyzer implements IRetryAnalyzer{ int count=0; int retryLimit=3; @Override public boolean retry(ITestResult result) { // TODO Auto-generated method stub if(result.getStatus()==ITestResult.FAILURE && count<=retryLimit) { try { Thread.sleep(1000); System.out.println(String.format("Mehodname: %s retrycount :%d", result.getMethod(),count)); count ++; return true; } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return false; } }
[ "hituj.velukar4@gmail.com" ]
hituj.velukar4@gmail.com
e06e81991fe0d20895c6b569e043d300716605b7
5356b17403522e1785cac778105bd4aecfa9be71
/src/main/java/org/tessa/web/web/HelloController.java
ac2db167799241ec9fc04a4c378fdb0e2c0d6776
[]
no_license
czawadka/tessa
df3c7741754543aeb95797daae54d7b8e46cba18
a0fbd4e42cca0cc6399f6a1d31b814645801f0a3
refs/heads/master
2021-01-25T07:27:32.349222
2014-10-28T21:40:40
2014-10-28T21:40:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package org.tessa.web.web; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; //@RestController @Controller public class HelloController { @RequestMapping("/") public String index() { return "index"; } @RequestMapping("/login") @Layout(value = "none") public String login() { return "login"; } }
[ "czawadka@atlassian.com" ]
czawadka@atlassian.com
e9a1eec54e500f444411c23b2f180d5d79d02e4f
f7b0ce9ce509209af0bc3d3347458cf20521b295
/project/src/main/java/project/app/server/service/UserRoleBridgeServiceImpl.java
bf83683b5b293158ad720e706e75550fa613d24e
[]
no_license
applifireAlgo/test21Dec
469a5629efbbc726907851cdc5c3c1e6b4729c60
1322aeee88a9cf987c21e74d11c6d71a82c56da1
refs/heads/master
2021-01-10T13:52:03.673246
2016-01-15T10:28:53
2016-01-15T10:28:53
48,352,856
0
0
null
null
null
null
UTF-8
Java
false
false
10,940
java
package project.app.server.service; import org.springframework.web.bind.annotation.RestController; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import com.athena.annotation.Complexity; import com.athena.annotation.SourceCodeAuthorClass; import com.athena.framework.server.helper.RuntimeLogInfoHelper; import com.spartan.sprinkler.core.Sprinkler; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import project.app.server.repository.UserRoleBridgeRepository; import project.app.shared.authorization.UserRoleBridge; import com.athena.framework.server.bean.ResponseBean; import com.athena.framework.server.exception.repository.SpartanPersistenceException; import java.lang.Override; import org.springframework.http.HttpEntity; import org.springframework.web.bind.annotation.RequestMethod; import com.athena.framework.server.exception.repository.SpartanTransactionException; import java.util.List; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.PathVariable; import com.athena.framework.server.bean.FindByBean; @RestController @Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS) @SourceCodeAuthorClass(createdBy = "puja.singh@algorhythm.co.in", updatedBy = "", versionNumber = "1", comments = "Service for UserRoleBridge Transaction table", complexity = Complexity.MEDIUM) @RequestMapping("/UserRoleBridge") public class UserRoleBridgeServiceImpl extends UserRoleBridgeService { @Autowired private RuntimeLogInfoHelper runtimeLogInfoHelper; @Autowired private UserRoleBridgeRepository<UserRoleBridge> userRoleBridgerepo; @Autowired private Sprinkler sprinkler; @RequestMapping(value = "/findAll", consumes = "application/json", method = RequestMethod.GET) @Override public HttpEntity<ResponseBean> findAll() throws SpartanPersistenceException, Exception { ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK; java.util.List<project.app.shared.authorization.UserRoleBridge> lstuserrolebridge = userRoleBridgerepo.findAll(); responseBean.add("success", true); responseBean.add("message", "Successfully retrived "); responseBean.add("data", lstuserrolebridge); return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } @RequestMapping(consumes = "application/json", method = RequestMethod.POST) @Override public HttpEntity<ResponseBean> save(@RequestBody UserRoleBridge entity) throws SpartanPersistenceException, SpartanTransactionException, Exception { ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.CREATED; try { userRoleBridgerepo.save(entity); responseBean.add("success", true); responseBean.add("message", "Successfully Created"); responseBean.add("data", entity); httpStatus = org.springframework.http.HttpStatus.CREATED; } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException("can not save", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } @RequestMapping(consumes = "application/json", headers = { "isArray" }, method = RequestMethod.POST) @Override public HttpEntity<ResponseBean> save(@RequestBody List<UserRoleBridge> entity, @RequestHeader("isArray") boolean request) throws SpartanPersistenceException, SpartanTransactionException, Exception { ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.CREATED; try { userRoleBridgerepo.save(entity); responseBean.add("success", true); responseBean.add("message", "Successfully Created"); httpStatus = org.springframework.http.HttpStatus.CREATED; } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException("can not save", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } @RequestMapping(value = "/{cid}", consumes = "application/json", method = RequestMethod.DELETE) @Override public HttpEntity<ResponseBean> delete(@PathVariable("cid") String entity) throws SpartanPersistenceException, SpartanTransactionException, Exception { ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK; try { userRoleBridgerepo.delete(entity); httpStatus = org.springframework.http.HttpStatus.OK; responseBean.add("success", true); responseBean.add("message", "Successfully deleted "); } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException("can not delete", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } @RequestMapping(consumes = "application/json", method = RequestMethod.PUT) @Override public HttpEntity<ResponseBean> update(@RequestBody UserRoleBridge entity) throws SpartanPersistenceException, SpartanTransactionException, Exception { ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK; try { userRoleBridgerepo.update(entity); responseBean.add("success", true); responseBean.add("message", "Successfully updated "); responseBean.add("data", entity._getPrimarykey().toString()); } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException("can not update", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } @RequestMapping(consumes = "application/json", headers = { "isArray" }, method = RequestMethod.PUT) @Override public HttpEntity<ResponseBean> update(@RequestBody List<UserRoleBridge> entity, @RequestHeader("isArray") boolean request) throws SpartanPersistenceException, SpartanTransactionException, Exception { ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK; try { userRoleBridgerepo.update(entity); responseBean.add("success", true); responseBean.add("message", "Successfully updated entities"); httpStatus = org.springframework.http.HttpStatus.OK; } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException("can not update", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } @RequestMapping(value = "/findByRoleId", method = RequestMethod.POST) @Override public HttpEntity<ResponseBean> findByRoleId(@RequestBody FindByBean findByBean) throws SpartanPersistenceException, Exception { com.athena.framework.server.bean.ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK; try { List<project.app.shared.authorization.UserRoleBridge> lstuserrolebridge = userRoleBridgerepo.findByRoleId((java.lang.String) findByBean.getFindKey()); responseBean.add("success", true); responseBean.add("message", "Successfully retrived "); responseBean.add("data", lstuserrolebridge); } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException("can not find ID", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } @RequestMapping(value = "/findByUserId", method = RequestMethod.POST) @Override public HttpEntity<ResponseBean> findByUserId(@RequestBody FindByBean findByBean) throws SpartanPersistenceException, Exception { com.athena.framework.server.bean.ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK; try { List<project.app.shared.authorization.UserRoleBridge> lstuserrolebridge = userRoleBridgerepo.findByUserId((java.lang.String) findByBean.getFindKey()); responseBean.add("success", true); responseBean.add("message", "Successfully retrived "); responseBean.add("data", lstuserrolebridge); } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException("can not find ID", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } @RequestMapping(value = "/findById", method = RequestMethod.POST) @Override public HttpEntity<ResponseBean> findById(@RequestBody FindByBean findByBean) throws SpartanPersistenceException, Exception { com.athena.framework.server.bean.ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK; try { project.app.shared.authorization.UserRoleBridge lstuserrolebridge = userRoleBridgerepo.findById((java.lang.String) findByBean.getFindKey()); responseBean.add("success", true); responseBean.add("message", "Successfully retrived "); responseBean.add("data", lstuserrolebridge); } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException("can not find ID", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); } }
[ "applifire@efa435d93ce0" ]
applifire@efa435d93ce0
39a6f6c3012fa5510318928e0bf534ceae889b07
e3fca76a5351ab8158d535e7e1acabff826f1388
/src/com/bridgelabz/ObjectOrientedPrograms/StockPortfolio.java
20cae66d9dd53670e7a4927b70cfdb4dbb95eb47
[]
no_license
Sagarika99/JavaCorePrograms
d243d41b43c1bb614a39f2c864c4fe4170aadd05
cf15064ec5c3a2f6231d0a24d436a8d612c1b935
refs/heads/master
2023-07-16T02:19:16.303411
2021-08-26T16:14:56
2021-08-26T16:14:56
394,607,841
0
0
null
null
null
null
UTF-8
Java
false
false
1,377
java
package com.bridgelabz.ObjectOrientedPrograms; import java.util.Scanner; public class StockPortfolio { public Stock[] stocks; public int companyStocks = 0; public StockPortfolio() { Scanner sc = new Scanner(System.in); System.out.println("Enter number of Company Stocks: "); int companyStocks = sc.nextInt(); stocks = new Stock[companyStocks]; for (int i=0; i<companyStocks; i++) { addStocks(); } } public void addStocks(){ Scanner sc = new Scanner(System.in); System.out.println("Enter Stock name: "); String stockname = sc.next(); System.out.println("Enter the no of Shares: "); int shares = sc.nextInt(); System.out.println("Enter price per kg:"); int price = sc.nextInt(); stocks[companyStocks] = new Stock(stockname, shares, price); companyStocks++; } public void printReport() { int totalvalue = 0; System.out.println(); for (int i=0; i<stocks.length; i++) { int value = stocks[i].sharePrice*stocks[i].numOfShares; totalvalue += value; System.out.println("Stocks [StockName=" + stocks[i].stockName + ", numOfShares=" + stocks[i].numOfShares + ", sharePrice=" + stocks[i].sharePrice + "] Total cost "+value); } System.out.println("Total value of Stocks : "+totalvalue); } public static void main(String[] args) { StockPortfolio portfolio = new StockPortfolio(); portfolio.printReport(); } }
[ "sagarika.shinde@morningstar.com" ]
sagarika.shinde@morningstar.com
d2f05455c13b6f7181110b0b6439f8372391d6fa
e3fb2b44481f46682fc6bd87df231da2daffeb1e
/client-java-5.0.15_source_from_Procyon/rp/com/google/common/collect/CompactHashMap.java
347b97cb0af9b54bd808151b19831ce7e798a089
[]
no_license
sachindwivedi18/Hibernate
733b2acecff1e0642b540e7382f61459f5abbda7
d561a342be2fdc6cca91aedebeb1b4dd6e9d8625
refs/heads/master
2023-06-11T10:14:09.375468
2021-06-29T14:51:36
2021-06-29T14:51:36
365,769,635
0
0
null
null
null
null
UTF-8
Java
false
false
22,048
java
// // Decompiled by Procyon v0.5.36 // package rp.com.google.common.collect; import java.util.function.Consumer; import java.util.Spliterators; import java.util.Spliterator; import java.util.ConcurrentModificationException; import java.util.NoSuchElementException; import java.io.ObjectInputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.function.BiConsumer; import java.util.Iterator; import java.util.function.BiFunction; import com.google.errorprone.annotations.CanIgnoreReturnValue; import rp.com.google.common.base.Objects; import java.util.Arrays; import rp.com.google.common.base.Preconditions; import java.util.Collection; import java.util.Map; import java.util.Set; import rp.com.google.common.annotations.VisibleForTesting; import rp.com.google.common.annotations.GwtIncompatible; import java.io.Serializable; import java.util.AbstractMap; @GwtIncompatible class CompactHashMap<K, V> extends AbstractMap<K, V> implements Serializable { private static final int MAXIMUM_CAPACITY = 1073741824; static final float DEFAULT_LOAD_FACTOR = 1.0f; private static final long NEXT_MASK = 4294967295L; private static final long HASH_MASK = -4294967296L; static final int DEFAULT_SIZE = 3; static final int UNSET = -1; private transient int[] table; @VisibleForTesting transient long[] entries; @VisibleForTesting transient Object[] keys; @VisibleForTesting transient Object[] values; transient float loadFactor; transient int modCount; private transient int threshold; private transient int size; private transient Set<K> keySetView; private transient Set<Map.Entry<K, V>> entrySetView; private transient Collection<V> valuesView; public static <K, V> CompactHashMap<K, V> create() { return new CompactHashMap<K, V>(); } public static <K, V> CompactHashMap<K, V> createWithExpectedSize(final int expectedSize) { return new CompactHashMap<K, V>(expectedSize); } CompactHashMap() { this.init(3, 1.0f); } CompactHashMap(final int capacity) { this(capacity, 1.0f); } CompactHashMap(final int expectedSize, final float loadFactor) { this.init(expectedSize, loadFactor); } void init(final int expectedSize, final float loadFactor) { Preconditions.checkArgument(expectedSize >= 0, (Object)"Initial capacity must be non-negative"); Preconditions.checkArgument(loadFactor > 0.0f, (Object)"Illegal load factor"); final int buckets = Hashing.closedTableSize(expectedSize, loadFactor); this.table = newTable(buckets); this.loadFactor = loadFactor; this.keys = new Object[expectedSize]; this.values = new Object[expectedSize]; this.entries = newEntries(expectedSize); this.threshold = Math.max(1, (int)(buckets * loadFactor)); } private static int[] newTable(final int size) { final int[] array = new int[size]; Arrays.fill(array, -1); return array; } private static long[] newEntries(final int size) { final long[] array = new long[size]; Arrays.fill(array, -1L); return array; } private int hashTableMask() { return this.table.length - 1; } private static int getHash(final long entry) { return (int)(entry >>> 32); } private static int getNext(final long entry) { return (int)entry; } private static long swapNext(final long entry, final int newNext) { return (0xFFFFFFFF00000000L & entry) | (0xFFFFFFFFL & (long)newNext); } void accessEntry(final int index) { } @CanIgnoreReturnValue @Override public V put(final K key, final V value) { final long[] entries = this.entries; final Object[] keys = this.keys; final Object[] values = this.values; final int hash = Hashing.smearedHash(key); final int tableIndex = hash & this.hashTableMask(); final int newEntryIndex = this.size; int next = this.table[tableIndex]; if (next == -1) { this.table[tableIndex] = newEntryIndex; } else { int last; long entry; do { last = next; entry = entries[next]; if (getHash(entry) == hash && Objects.equal(key, keys[next])) { final V oldValue = (V)values[next]; values[next] = value; this.accessEntry(next); return oldValue; } next = getNext(entry); } while (next != -1); entries[last] = swapNext(entry, newEntryIndex); } if (newEntryIndex == Integer.MAX_VALUE) { throw new IllegalStateException("Cannot contain more than Integer.MAX_VALUE elements!"); } final int newSize = newEntryIndex + 1; this.resizeMeMaybe(newSize); this.insertEntry(newEntryIndex, key, value, hash); this.size = newSize; if (newEntryIndex >= this.threshold) { this.resizeTable(2 * this.table.length); } ++this.modCount; return null; } void insertEntry(final int entryIndex, final K key, final V value, final int hash) { this.entries[entryIndex] = ((long)hash << 32 | 0xFFFFFFFFL); this.keys[entryIndex] = key; this.values[entryIndex] = value; } private void resizeMeMaybe(final int newSize) { final int entriesSize = this.entries.length; if (newSize > entriesSize) { int newCapacity = entriesSize + Math.max(1, entriesSize >>> 1); if (newCapacity < 0) { newCapacity = Integer.MAX_VALUE; } if (newCapacity != entriesSize) { this.resizeEntries(newCapacity); } } } void resizeEntries(final int newCapacity) { this.keys = Arrays.copyOf(this.keys, newCapacity); this.values = Arrays.copyOf(this.values, newCapacity); long[] entries = this.entries; final int oldCapacity = entries.length; entries = Arrays.copyOf(entries, newCapacity); if (newCapacity > oldCapacity) { Arrays.fill(entries, oldCapacity, newCapacity, -1L); } this.entries = entries; } private void resizeTable(final int newCapacity) { final int[] oldTable = this.table; final int oldCapacity = oldTable.length; if (oldCapacity >= 1073741824) { this.threshold = Integer.MAX_VALUE; return; } final int newThreshold = 1 + (int)(newCapacity * this.loadFactor); final int[] newTable = newTable(newCapacity); final long[] entries = this.entries; final int mask = newTable.length - 1; for (int i = 0; i < this.size; ++i) { final long oldEntry = entries[i]; final int hash = getHash(oldEntry); final int tableIndex = hash & mask; final int next = newTable[tableIndex]; entries[newTable[tableIndex] = i] = ((long)hash << 32 | (0xFFFFFFFFL & (long)next)); } this.threshold = newThreshold; this.table = newTable; } private int indexOf(final Object key) { final int hash = Hashing.smearedHash(key); long entry; for (int next = this.table[hash & this.hashTableMask()]; next != -1; next = getNext(entry)) { entry = this.entries[next]; if (getHash(entry) == hash && Objects.equal(key, this.keys[next])) { return next; } } return -1; } @Override public boolean containsKey(final Object key) { return this.indexOf(key) != -1; } @Override public V get(final Object key) { final int index = this.indexOf(key); this.accessEntry(index); return (V)((index == -1) ? null : this.values[index]); } @CanIgnoreReturnValue @Override public V remove(final Object key) { return this.remove(key, Hashing.smearedHash(key)); } private V remove(final Object key, final int hash) { final int tableIndex = hash & this.hashTableMask(); int next = this.table[tableIndex]; if (next == -1) { return null; } int last = -1; while (getHash(this.entries[next]) != hash || !Objects.equal(key, this.keys[next])) { last = next; next = getNext(this.entries[next]); if (next == -1) { return null; } } final V oldValue = (V)this.values[next]; if (last == -1) { this.table[tableIndex] = getNext(this.entries[next]); } else { this.entries[last] = swapNext(this.entries[last], getNext(this.entries[next])); } this.moveLastEntry(next); --this.size; ++this.modCount; return oldValue; } @CanIgnoreReturnValue private V removeEntry(final int entryIndex) { return this.remove(this.keys[entryIndex], getHash(this.entries[entryIndex])); } void moveLastEntry(final int dstIndex) { final int srcIndex = this.size() - 1; if (dstIndex < srcIndex) { this.keys[dstIndex] = this.keys[srcIndex]; this.values[dstIndex] = this.values[srcIndex]; this.keys[srcIndex] = null; this.values[srcIndex] = null; final long lastEntry = this.entries[srcIndex]; this.entries[dstIndex] = lastEntry; this.entries[srcIndex] = -1L; final int tableIndex = getHash(lastEntry) & this.hashTableMask(); int lastNext = this.table[tableIndex]; if (lastNext == srcIndex) { this.table[tableIndex] = dstIndex; } else { int previous; long entry; do { previous = lastNext; lastNext = getNext(entry = this.entries[lastNext]); } while (lastNext != srcIndex); this.entries[previous] = swapNext(entry, dstIndex); } } else { this.keys[dstIndex] = null; this.values[dstIndex] = null; this.entries[dstIndex] = -1L; } } int firstEntryIndex() { return this.isEmpty() ? -1 : 0; } int getSuccessor(final int entryIndex) { return (entryIndex + 1 < this.size) ? (entryIndex + 1) : -1; } int adjustAfterRemove(final int indexBeforeRemove, final int indexRemoved) { return indexBeforeRemove - 1; } @Override public void replaceAll(final BiFunction<? super K, ? super V, ? extends V> function) { Preconditions.checkNotNull(function); for (int i = 0; i < this.size; ++i) { this.values[i] = function.apply((Object)this.keys[i], (Object)this.values[i]); } } @Override public Set<K> keySet() { return (this.keySetView == null) ? (this.keySetView = this.createKeySet()) : this.keySetView; } Set<K> createKeySet() { return (Set<K>)new KeySetView(); } Iterator<K> keySetIterator() { return new Itr<K>() { @Override K getOutput(final int entry) { return (K)CompactHashMap.this.keys[entry]; } }; } @Override public void forEach(final BiConsumer<? super K, ? super V> action) { Preconditions.checkNotNull(action); for (int i = 0; i < this.size; ++i) { action.accept((Object)this.keys[i], (Object)this.values[i]); } } @Override public Set<Map.Entry<K, V>> entrySet() { return (this.entrySetView == null) ? (this.entrySetView = this.createEntrySet()) : this.entrySetView; } Set<Map.Entry<K, V>> createEntrySet() { return (Set<Map.Entry<K, V>>)new EntrySetView(); } Iterator<Map.Entry<K, V>> entrySetIterator() { return new Itr<Map.Entry<K, V>>() { @Override Map.Entry<K, V> getOutput(final int entry) { return new MapEntry(entry); } }; } @Override public int size() { return this.size; } @Override public boolean isEmpty() { return this.size == 0; } @Override public boolean containsValue(final Object value) { for (int i = 0; i < this.size; ++i) { if (Objects.equal(value, this.values[i])) { return true; } } return false; } @Override public Collection<V> values() { return (this.valuesView == null) ? (this.valuesView = this.createValues()) : this.valuesView; } Collection<V> createValues() { return (Collection<V>)new ValuesView(); } Iterator<V> valuesIterator() { return new Itr<V>() { @Override V getOutput(final int entry) { return (V)CompactHashMap.this.values[entry]; } }; } public void trimToSize() { final int size = this.size; if (size < this.entries.length) { this.resizeEntries(size); } int minimumTableSize = Math.max(1, Integer.highestOneBit((int)(size / this.loadFactor))); if (minimumTableSize < 1073741824) { final double load = size / (double)minimumTableSize; if (load > this.loadFactor) { minimumTableSize <<= 1; } } if (minimumTableSize < this.table.length) { this.resizeTable(minimumTableSize); } } @Override public void clear() { ++this.modCount; Arrays.fill(this.keys, 0, this.size, null); Arrays.fill(this.values, 0, this.size, null); Arrays.fill(this.table, -1); Arrays.fill(this.entries, -1L); this.size = 0; } private void writeObject(final ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeInt(this.size); for (int i = 0; i < this.size; ++i) { stream.writeObject(this.keys[i]); stream.writeObject(this.values[i]); } } private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.init(3, 1.0f); int i; final int elementCount = i = stream.readInt(); while (--i >= 0) { final K key = (K)stream.readObject(); final V value = (V)stream.readObject(); this.put(key, value); } } private abstract class Itr<T> implements Iterator<T> { int expectedModCount; int currentIndex; int indexToRemove; private Itr() { this.expectedModCount = CompactHashMap.this.modCount; this.currentIndex = CompactHashMap.this.firstEntryIndex(); this.indexToRemove = -1; } @Override public boolean hasNext() { return this.currentIndex >= 0; } abstract T getOutput(final int p0); @Override public T next() { this.checkForConcurrentModification(); if (!this.hasNext()) { throw new NoSuchElementException(); } this.indexToRemove = this.currentIndex; final T result = this.getOutput(this.currentIndex); this.currentIndex = CompactHashMap.this.getSuccessor(this.currentIndex); return result; } @Override public void remove() { this.checkForConcurrentModification(); CollectPreconditions.checkRemove(this.indexToRemove >= 0); ++this.expectedModCount; CompactHashMap.this.removeEntry(this.indexToRemove); this.currentIndex = CompactHashMap.this.adjustAfterRemove(this.currentIndex, this.indexToRemove); this.indexToRemove = -1; } private void checkForConcurrentModification() { if (CompactHashMap.this.modCount != this.expectedModCount) { throw new ConcurrentModificationException(); } } } class KeySetView extends Maps.KeySet<K, V> { KeySetView() { super(CompactHashMap.this); } @Override public Object[] toArray() { return ObjectArrays.copyAsObjectArray(CompactHashMap.this.keys, 0, CompactHashMap.this.size); } @Override public <T> T[] toArray(final T[] a) { return ObjectArrays.toArrayImpl(CompactHashMap.this.keys, 0, CompactHashMap.this.size, a); } @Override public boolean remove(final Object o) { final int index = CompactHashMap.this.indexOf(o); if (index == -1) { return false; } CompactHashMap.this.removeEntry(index); return true; } @Override public Iterator<K> iterator() { return CompactHashMap.this.keySetIterator(); } @Override public Spliterator<K> spliterator() { return Spliterators.spliterator(CompactHashMap.this.keys, 0, CompactHashMap.this.size, 17); } @Override public void forEach(final Consumer<? super K> action) { Preconditions.checkNotNull(action); for (int i = 0; i < CompactHashMap.this.size; ++i) { action.accept((Object)CompactHashMap.this.keys[i]); } } } class EntrySetView extends Maps.EntrySet<K, V> { @Override Map<K, V> map() { return (Map<K, V>)CompactHashMap.this; } @Override public Iterator<Map.Entry<K, V>> iterator() { return CompactHashMap.this.entrySetIterator(); } @Override public Spliterator<Map.Entry<K, V>> spliterator() { return (Spliterator<Map.Entry<K, V>>)CollectSpliterators.indexed(CompactHashMap.this.size, 17, x$0 -> new MapEntry(x$0)); } @Override public boolean contains(final Object o) { if (o instanceof Map.Entry) { final Map.Entry<?, ?> entry = (Map.Entry<?, ?>)o; final int index = CompactHashMap.this.indexOf(entry.getKey()); return index != -1 && Objects.equal(CompactHashMap.this.values[index], entry.getValue()); } return false; } @Override public boolean remove(final Object o) { if (o instanceof Map.Entry) { final Map.Entry<?, ?> entry = (Map.Entry<?, ?>)o; final int index = CompactHashMap.this.indexOf(entry.getKey()); if (index != -1 && Objects.equal(CompactHashMap.this.values[index], entry.getValue())) { CompactHashMap.this.removeEntry(index); return true; } } return false; } } final class MapEntry extends AbstractMapEntry<K, V> { private final K key; private int lastKnownIndex; MapEntry(final int index) { this.key = (K)CompactHashMap.this.keys[index]; this.lastKnownIndex = index; } @Override public K getKey() { return this.key; } private void updateLastKnownIndex() { if (this.lastKnownIndex == -1 || this.lastKnownIndex >= CompactHashMap.this.size() || !Objects.equal(this.key, CompactHashMap.this.keys[this.lastKnownIndex])) { this.lastKnownIndex = CompactHashMap.this.indexOf(this.key); } } @Override public V getValue() { this.updateLastKnownIndex(); return (V)((this.lastKnownIndex == -1) ? null : CompactHashMap.this.values[this.lastKnownIndex]); } @Override public V setValue(final V value) { this.updateLastKnownIndex(); if (this.lastKnownIndex == -1) { CompactHashMap.this.put(this.key, value); return null; } final V old = (V)CompactHashMap.this.values[this.lastKnownIndex]; CompactHashMap.this.values[this.lastKnownIndex] = value; return old; } } class ValuesView extends Maps.Values<K, V> { ValuesView() { super(CompactHashMap.this); } @Override public Iterator<V> iterator() { return CompactHashMap.this.valuesIterator(); } @Override public void forEach(final Consumer<? super V> action) { Preconditions.checkNotNull(action); for (int i = 0; i < CompactHashMap.this.size; ++i) { action.accept((Object)CompactHashMap.this.values[i]); } } @Override public Spliterator<V> spliterator() { return Spliterators.spliterator(CompactHashMap.this.values, 0, CompactHashMap.this.size, 16); } @Override public Object[] toArray() { return ObjectArrays.copyAsObjectArray(CompactHashMap.this.values, 0, CompactHashMap.this.size); } @Override public <T> T[] toArray(final T[] a) { return ObjectArrays.toArrayImpl(CompactHashMap.this.values, 0, CompactHashMap.this.size, a); } } }
[ "sachindwivedi18@gmail.com" ]
sachindwivedi18@gmail.com
302fbb20308b3162c977067d00f4510a91cd8715
df50016eab35688a7d7cef724b27911848fc84c8
/cursos.capitulo2.tipos/src/cajero/cuenta.java
1b5bb2d1265fcdcdf68d8b3ac69a60b759ee6248
[]
no_license
haruz26/java2
ccbe0d19bc1106dc9f018be5d77de0bbb4a34539
437e2311b809d0c4c9385790632090125527283f
refs/heads/master
2021-01-10T20:20:04.740750
2014-08-04T21:00:17
2014-08-04T21:00:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
682
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package cajero; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Miguel Corona */ public class cuenta { float saldo; public cuenta(float saldo){ this.saldo = saldo; } public float getSaldo() { return saldo; } public void setSaldo(float saldo) throws SaldoNegativoException { if(saldo<0) throw new SaldoNegativoException(); this.saldo = saldo; } }
[ "Miguel Corona@MiguelCorona-PC" ]
Miguel Corona@MiguelCorona-PC
ef17baa043fe4e6438718b679a51f09fe52132da
1b4fadd028765ea7076c68ec379ffe021cf757ae
/src/Exceptions/InvalidDataException.java
1b29381fbf49b5d8cb1ea3c9c7337ec0215ef069
[]
no_license
amikhaylova/computational_math_lab5
190b91d43c3935be01302d1a4575d954a6f3a3a6
35470c403b9d9f9557a28f30abd955c6ec7637c0
refs/heads/master
2022-07-07T03:06:00.424852
2020-05-09T10:36:24
2020-05-09T10:36:24
262,166,966
0
0
null
null
null
null
UTF-8
Java
false
false
156
java
package Exceptions; public class InvalidDataException extends Exception { public InvalidDataException(String message){ super(message); } }
[ "mialana1999@gmail.com" ]
mialana1999@gmail.com
cdbcbed11a470a4c847b6f7891b7bd23ca3ce0e3
c9ff4c7d1c23a05b4e5e1e243325d6d004829511
/aws-java-sdk-dynamodb/src/test/java/com/amazonaws/services/dynamodbv2/pojos/HashKeyRangeKeyBothAutoGenerated.java
944ab31d04affe55c309527596b5c91657d2bd70
[ "Apache-2.0" ]
permissive
Purushotam-Thakur/aws-sdk-java
3c5789fe0b0dbd25e1ebfdd48dfd71e25a945f62
ab58baac6370f160b66da96d46afa57ba5bdee06
refs/heads/master
2020-07-22T23:27:57.700466
2019-09-06T23:28:26
2019-09-06T23:28:26
207,350,924
1
0
Apache-2.0
2019-09-09T16:11:46
2019-09-09T16:11:45
null
UTF-8
Java
false
false
2,981
java
/* * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights * Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.dynamodbv2.pojos; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBRangeKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable; @DynamoDBTable(tableName = "aws-java-sdk-string-range") public class HashKeyRangeKeyBothAutoGenerated { private String key; private String rangeKey; private String otherAttribute; @DynamoDBAutoGeneratedKey @DynamoDBHashKey public String getKey() { return key; } public void setKey(String key) { this.key = key; } @DynamoDBAutoGeneratedKey @DynamoDBRangeKey public String getRangeKey() { return rangeKey; } public void setRangeKey(String rangeKey) { this.rangeKey = rangeKey; } public String getOtherAttribute() { return otherAttribute; } public void setOtherAttribute(String otherAttribute) { this.otherAttribute = otherAttribute; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((otherAttribute == null) ? 0 : otherAttribute.hashCode()); result = prime * result + ((rangeKey == null) ? 0 : rangeKey.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; HashKeyRangeKeyBothAutoGenerated other = (HashKeyRangeKeyBothAutoGenerated) obj; if ( key == null ) { if ( other.key != null ) return false; } else if ( !key.equals(other.key) ) return false; if ( otherAttribute == null ) { if ( other.otherAttribute != null ) return false; } else if ( !otherAttribute.equals(other.otherAttribute) ) return false; if ( rangeKey == null ) { if ( other.rangeKey != null ) return false; } else if ( !rangeKey.equals(other.rangeKey) ) return false; return true; } }
[ "" ]
94805646bd7af2dfd693b56cd2a46ee16e3ebae1
0a2ef8c61f257c69635de34df9a3fe950d525fca
/app/src/main/java/com/example/android/moonpatrolshooter/Transform.java
b0746d92777a835c7d309ecce729c96fca1d2261
[]
no_license
pesu12/MoonPatrolShooter
55bc9e81c89076f8d42c71f31eabb955f4ea7d10
a8d9f6a4ddd1e649e211ce4226925591d86184f5
refs/heads/main
2023-04-23T22:53:55.930429
2021-05-11T14:10:00
2021-05-11T14:10:00
365,029,108
0
0
null
null
null
null
UTF-8
Java
false
false
3,682
java
package com.example.android.moonpatrolshooter; import android.graphics.PointF; import android.graphics.RectF; class Transform { // These two members are for scrolling background private int mXClip; private boolean mReversedFirst = false; private RectF mCollider; private PointF mLocation; private boolean mFacingRight = true; private boolean mHeadingUp = false; private boolean mHeadingDown = false; private boolean mHeadingLeft = false; private boolean mHeadingRight = false; private float mSpeed; private float mObjectHeight; private float mObjectWidth; private static PointF mScreenSize; Transform(float speed, float objectWidth, float objectHeight, PointF startingLocation, PointF screenSize){ mCollider = new RectF(); mSpeed = speed; mObjectHeight = objectHeight; mObjectWidth = objectWidth; mLocation = startingLocation; mScreenSize = screenSize; } // Here are some helper methods that the background will use boolean getReversedFirst(){ return mReversedFirst; } void flipReversedFirst(){ mReversedFirst = !mReversedFirst; } int getXClip(){ return mXClip; } void setXClip(int newXClip){ mXClip = newXClip; } PointF getmScreenSize(){ return mScreenSize; } void headUp(){ mHeadingUp = true; mHeadingDown = false; } void headDown(){ mHeadingDown = true; mHeadingUp = false; } void headRight(){ mHeadingRight = true; mHeadingLeft = false; mFacingRight = true; } void headLeft(){ mHeadingLeft = true; mHeadingRight = false; mFacingRight = false; } boolean headingUp(){ return mHeadingUp; } boolean headingDown(){ return mHeadingDown; } boolean headingRight(){ return mHeadingRight; } boolean headingLeft(){ return mHeadingLeft; } void updateCollider(){ // Pull the borders in a bit (10%) mCollider.top = mLocation.y + (mObjectHeight / 10); mCollider.left = mLocation.x + (mObjectWidth /10); mCollider.bottom = (mCollider.top + mObjectHeight) - mObjectHeight/10; mCollider.right = (mCollider.left + mObjectWidth) - mObjectWidth/10; } float getObjectHeight(){ return mObjectHeight; } void stopVertical(){ mHeadingDown = false; mHeadingUp = false; } float getSpeed(){ return mSpeed; } void setLocation(float horizontal, float vertical){ mLocation = new PointF(horizontal, vertical); updateCollider(); } PointF getLocation() { return mLocation; } PointF getSize(){ return new PointF((int)mObjectWidth, (int)mObjectHeight); } void flip(){ mFacingRight = !mFacingRight; } boolean getFacingRight(){ return mFacingRight; } RectF getCollider(){ return mCollider; } PointF getFiringLocation(float laserLength){ PointF mFiringLocation = new PointF(); if(mFacingRight) { mFiringLocation.x = mLocation.x + (mObjectWidth / 8f); }else { mFiringLocation.x = mLocation.x + (mObjectWidth / 8f) - (laserLength); } // Move the height down a bit of ship height from origin mFiringLocation.y = mLocation.y + (mObjectHeight / 1.28f); return mFiringLocation; } }
[ "sundberg_p@yahoo.com" ]
sundberg_p@yahoo.com
39f8004814157890590c4b5944e03daef2fa5716
0e2a1a0a4f176f08093d996fe62347c739ce9598
/trunk/mis/src/main/java/com/px/mis/account/dao/OutIntoWhsAdjSnglSubTabDao.java
7b638b81a78b97119ad540e40dd186b538fce87a
[]
no_license
LIHUIJAVA/JOB
21dc3979b57d2923da9a0f6f33a9f0919b617b4d
3142faf6045696e8c932d1a2139bdd17a40378e7
refs/heads/master
2022-12-21T01:56:05.451002
2020-03-01T12:04:32
2020-03-01T12:04:32
244,107,727
0
1
null
2022-12-16T07:52:27
2020-03-01T07:42:17
JavaScript
UTF-8
Java
false
false
557
java
package com.px.mis.account.dao; import com.px.mis.account.entity.OutIntoWhsAdjSnglSubTab; public interface OutIntoWhsAdjSnglSubTabDao { int insertOutIntoWhsAdjSnglSubTab(OutIntoWhsAdjSnglSubTab outIntoWhsAdjSnglSubTabDoc); /*int updateOutIntoWhsAdjSnglSubTabByOrdrNum(OutIntoWhsAdjSnglSubTab outIntoWhsAdjSnglSubTabDoc);*/ int deleteOutIntoWhsAdjSnglSubTabByFormNum(String formNum); /*OutIntoWhsAdjSnglSubTab selectOutIntoWhsAdjSnglSubTabByOrdrNum(Integer ordrNum); List<OutIntoWhsAdjSnglSubTab> selectOutIntoWhsAdjSnglSubTabList();*/ }
[ "lh" ]
lh
dc453d16d9ae464942d4af9c5fb40dd96c9a5a29
4df05e67afcf097894f234807f71183edc2b2dfd
/src/test/java/fr/brouillard/oss/jgitver/cfg/Issue51Test.java
ef40d36b3b671cf64a8359576983bf11137b6e75
[ "Apache-2.0" ]
permissive
jgitver/jgitver-maven-plugin
b679ac2caed0d71c402e054aa4cc5247eb812eb1
c14645a1900b47ac92c516319a987e6173e93006
refs/heads/master
2022-11-11T18:26:44.470436
2022-01-07T10:04:35
2022-02-09T07:37:13
57,225,462
160
56
NOASSERTION
2022-10-28T12:40:19
2016-04-27T15:42:22
Groovy
UTF-8
Java
false
false
1,819
java
/* * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) * * 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 fr.brouillard.oss.jgitver.cfg; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import java.io.IOException; import java.util.List; import org.apache.maven.MavenExecutionException; import org.junit.Test; public class Issue51Test { @Test public void can_load_correctly_provided_configuration() throws IOException, MavenExecutionException { InMemoryLogger inMemoryLogger = new InMemoryLogger(); try (ResourceConfigurationProvider fromResource = ResourceConfigurationProvider.fromResource("/config/issue-51-cfg.xml")) { Configuration cfg = ConfigurationLoader.loadFromRoot( fromResource.getConfigurationDirectory(), inMemoryLogger); assertThat(cfg, notNullValue()); List<BranchPolicy> branchPolicies = cfg.branchPolicies; assertThat(branchPolicies.size(), is(1)); List<String> transformations = branchPolicies.get(0).transformations; assertThat(transformations.size(), is(1)); assertThat(transformations.get(0), is("IDENTITY")); } } }
[ "matthieu@brouillard.fr" ]
matthieu@brouillard.fr
62a1ee39f9d72d49c54efc19a1f384b7d5d51dea
87cc5b502288e8dc135b7076b50d08e6815cefbe
/src/implementation_listeners_DXpath_Wait/DashbordPage.java
18e1e355f3398c7a66405001e1680365e3600229
[]
no_license
snehalkangune/MultipleTask
bcb2344aea6bb322e5be1f59bbba5147fe6343eb
12a5f9b14360905009c01417fd4628c94fc2b768
refs/heads/master
2023-07-17T05:31:38.962080
2021-09-13T07:28:36
2021-09-13T07:28:36
405,631,598
0
0
null
null
null
null
UTF-8
Java
false
false
2,849
java
package implementation_listeners_DXpath_Wait; //9:16 time correct code import java.util.List; import java.util.ArrayList; import org.apache.log4j.Logger; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Listeners; import org.testng.annotations.Test; //@Listeners(Listener.class) // class to listener connection public class DashbordPage { WebDriver driver; Logger log = Logger.getLogger(DashbordPage.class); @BeforeClass public void setEnvClass() { driver = Utility.getBrowserOpened(); Utility.openUrl( "file:///D:/snehal/selenium%20software/Offline%20Website/Offline%20Website/pages/examples/dashboard.html"); } @Test(priority = 1) public void verifyTitle() throws InterruptedException { String actualTitle = driver.getTitle();// --------getTitle method // System.out.println(actualTitle); log.info(actualTitle); String expTitle = "JavaByKiran | Dashboard"; Assert.assertEquals(actualTitle, expTitle); } @Test(priority = 2) public void subTitleofDasgboard() { String subTitleofDasgboard = driver.findElement(By.xpath("/html/body/div/div[1]/section[1]/h1/small")) .getText(); // System.out.println(subTitleofDasgboard); log.info(subTitleofDasgboard); String expHeading = "Courses Offered"; Assert.assertEquals(subTitleofDasgboard, expHeading); // __________________________________________________________________________ // List Of Courses ArrayList<String> actualListOfCourses = new ArrayList<>(); List<WebElement> listOfCources = driver.findElements(By.xpath("//h3")); for (WebElement course : listOfCources) { String courseName = course.getText(); actualListOfCourses.add(courseName); } // System.out.println("Print name of courses " + actualListOfCourses); log.info("Print name of courses " + actualListOfCourses); } // ------------------------------------------------------------------------------------------------------------------------------- @Test(priority = 3) public void userTabLink() throws InterruptedException { driver.findElement(By.xpath("/html/body/div/aside/section/ul/li[3]/a/span")).click(); Thread.sleep(30); String actualTitle = driver.getTitle(); // System.out.println(actualTitle); log.info(actualTitle); String expTitle = "JavaByKiran | User"; Assert.assertEquals(actualTitle, expTitle); } @Test(priority = 4) public void logoutButton() throws InterruptedException { driver.findElement(By.xpath("/html/body/div/header/nav/div/ul/li/a")).click(); Thread.sleep(30); String actualTitle = driver.getTitle(); //System.out.println(actualTitle); log.info(actualTitle); String expTitle = "JavaByKiran | Log in"; Assert.assertEquals(actualTitle, expTitle); } }
[ "snehalkangune22496@gmail.com" ]
snehalkangune22496@gmail.com
36019fb80f3d8f7ee9ed6500c9733fcd3bd811b2
63bebda99f7067abf12b4eb4b3661cdef052f214
/hrms/src/main/java/com/example/hrms/DataAccess/Abstracts/EmployerDao.java
425645b62528a2d293c2c4e5f0f913016706e3d5
[]
no_license
CengizhanKorkmaz/HrmsBackend
e5ea02661b55edb66cac2da81e8fbd53430b372b
57c1bd4f14ce37fdd34457bd459049c9c449d270
refs/heads/master
2023-07-29T23:39:39.144775
2021-09-16T15:43:11
2021-09-16T15:43:11
407,221,911
0
0
null
null
null
null
UTF-8
Java
false
false
904
java
package com.example.hrms.DataAccess.Abstracts; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.transaction.annotation.Transactional; import com.example.hrms.Entities.Concretes.Employer; public interface EmployerDao extends JpaRepository<Employer, Integer>{ @Transactional @Modifying(clearAutomatically = true, flushAutomatically = true) @Query("Update JobAdvertisement j Set j.advertStatus = false where j.id = :id ") void updateAdvertStatusFalse(@Param("id") int id); @Transactional @Modifying(clearAutomatically = true, flushAutomatically = true) @Query("Update JobAdvertisement j Set j.advertStatus = true where j.id = :id ") void updateAdvertStatusTrue(@Param("id") int id); }
[ "Korkmaz@Korkmaz" ]
Korkmaz@Korkmaz
45f9268322405a14025d48bda8cbb2f3a0adaa1c
66fc25f07e7ef6f323568c09b65f53ea77a76592
/app/src/main/java/com/example/admin/views/MainActivity.java
92beee79d243cd05a747008522e61bf2aeeeb6fd
[]
no_license
udayeni508/views
d511c1fecf68d09e8aeb7d73ac2ed757c36ec9de
b153c84d01162443bef82635f65e0800ab3c36fe
refs/heads/master
2020-05-23T23:26:04.601420
2019-05-16T19:50:01
2019-05-16T19:50:01
186,994,590
0
0
null
null
null
null
UTF-8
Java
false
false
2,677
java
package com.example.admin.views; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.view.View; import android.widget.CompoundButton; import android.widget.Toast; import android.widget.CheckBox; import android.widget.ToggleButton; import static android.support.v7.app.AlertDialog.*; public class MainActivity extends AppCompatActivity { ToggleButton toggleButton; CheckBox ch1,ch2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); toggleButton=(ToggleButton)findViewById(R.id.tgb); ch1=(CheckBox)findViewById(R.id.ch1); ch2=(CheckBox)findViewById(R.id.ch2); ch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Toast.makeText(MainActivity.this,"you checked python",Toast.LENGTH_SHORT).show(); } }); ch2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Toast.makeText(MainActivity.this,"You checked java",Toast.LENGTH_SHORT).show(); } }); toggleButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (toggleButton.isChecked()) { Toast.makeText(MainActivity.this, "turned on", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(MainActivity.this, "turned off", Toast.LENGTH_SHORT).show(); } } }); } public void OpenAlert(View view){ final AlertDialog.Builder myAlert=new AlertDialog.Builder(this); myAlert.setTitle("exit"); myAlert.setMessage("are you sure you want to exit"); myAlert.setPositiveButton("yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int which) { finish(); } }); myAlert.setNegativeButton("no", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int which) { dialogInterface.dismiss(); } }); myAlert.setCancelable(false); myAlert.show(); } }
[ "udayeni.123@gmail.com" ]
udayeni.123@gmail.com
7d4ad39cf154afe6dfed83f72fae7ed09afa22f4
45380077ad693ebce8c378b87555c5785c4c7354
/app/src/main/java/com/forcetechsoft/financeplanner/model/UserModel.java
28f0811a7d5701a7373c186a09c91d5ce5564f36
[]
no_license
gabormol/FinancePlannerAndroidNative
40ed7667c000613495eca0c02aa2681d13d17ea0
865ee4b44653711bf69a45bd046a20944e75f88d
refs/heads/master
2022-11-11T10:39:31.027888
2020-06-22T18:50:01
2020-06-22T18:50:01
263,993,321
0
0
null
null
null
null
UTF-8
Java
false
false
8,157
java
package com.forcetechsoft.financeplanner.model; import android.content.Context; import android.database.Cursor; import android.util.Log; import com.forcetechsoft.financeplanner.model.services.CommunicationService; import com.forcetechsoft.financeplanner.model.services.SimpleCallback; /** * Created by egbomol on 3/25/2016. */ public class UserModel extends GenericFinancePlannerModel { CommunicationService communicationService = CommunicationService.INSTANCE; @Override public void logIn(final Context aContext) { Log.d(TAG, "LOFASZ: Starting login process..."); communicationService.loginToBackend("lofasz", "lofasz", dbOperations, new SimpleCallback() { @Override public void onSuccess() { Cursor aCursor = dbOperations.getUserItem("lofasz"); logDatabaseContent(aCursor); } @Override public void onError() { Log.d(TAG, "LOFASZ: LOGIN failed!!!"); } }); } @Override public boolean getLoginStatus() { return true; // TODO fix } @Override public void logOut() { dbOperations.deleteUserItem(dbOperations.getUserName()); } @Override public void myExpenses(Context aContext) { Log.d(TAG, "LOFASZ: Getting expenses..."); String token = dbOperations.getUserToken(dbOperations.getUserName()); communicationService.getMyExpenses(token, dbOperations, new SimpleCallback() { @Override public void onSuccess() { Log.d(TAG, "LOFASZ: GET EXPENSES OK!"); Cursor aCursor = dbOperations.getAllTemplateItems(); logDatabaseContent(aCursor); } @Override public void onError() { Log.d(TAG, "LOFASZ: GET EXPENSES failed!!!"); } }); } @Override public void myTimesheet(Context aContext) { Log.d(TAG, "LOFASZ: Getting timesheet..."); String token = dbOperations.getUserToken(dbOperations.getUserName()); communicationService.getMyTimesheet(token, dbOperations, new SimpleCallback() { @Override public void onSuccess() { Cursor aCursor = dbOperations.getAllTimesheetItems(); logDatabaseContent(aCursor); } @Override public void onError() { Log.d(TAG, "LOFASZ: GET EXPENSES failed!!!"); } }); } @Override public void myStatictics(Context aContext) { Log.d(TAG, "LOFASZ: Getting statistics..."); String token = dbOperations.getUserToken(dbOperations.getUserName()); communicationService.getMyStatistics(token, dbOperations, new SimpleCallback() { @Override public void onSuccess() { Log.d(TAG, "LOFASZ: GET STATISTICS success! "); } @Override public void onError() { Log.d(TAG, "LOFASZ: GET STATISTICS failed!!!"); } }); } @Override public void myData(Context aContext) { String token = dbOperations.getUserToken(dbOperations.getUserName()); communicationService.getMyData(token, dbOperations, new SimpleCallback() { @Override public void onSuccess() { Cursor aCursor = dbOperations.getUserItem(dbOperations.getUserName()); logDatabaseContent(aCursor); Log.d(TAG, "LOFASZ: myData returned"); } @Override public void onError() { Log.d(TAG, "LOFASZ: GET myData failed!!!"); } }); } public void logDatabaseContent(Cursor aCursor){ aCursor.moveToFirst(); Log.d(TAG, "LOFASZ: read from Database: "); String[] columnNames = aCursor.getColumnNames(); String cursorString = ""; for (String name: columnNames) cursorString += String.format("%s ][ ", name); do { for (String name: columnNames) { cursorString += String.format("%s ][ ", aCursor.getString(aCursor.getColumnIndex(name))); } cursorString += "\n"; } while (aCursor.moveToNext()); Log.d(TAG, "Database content: " + cursorString); } public void showResponse(String response) { Log.d(TAG, "RESPONSE: " + response); } @Override public boolean isUserLoggedIn(Context aContext) { if (dbOperations.getUserName() != null){ return true; } else { return false; } } @Override public void returnAllContactsInLogd(Context aContext) { /*String contact_id; String name; String phoneNum; Log.d(TAG, "LOFASZ - returnAllContacts is called"); StringBuffer output = new StringBuffer(); Cursor aCursor = dbOperations.getAllTemplateItems(); Log.d(TAG, "LOFASZ - returnAllContacts Cursor is received..."); int rowNum = aCursor.getCount(); Log.d(TAG, "LOFASZ - returnAllContactsInLogd Cursor size: " + rowNum); aCursor.moveToFirst(); for (int i = 0; i < rowNum; i++) { Log.d(TAG, "LOFASZ - cursor moved to next..."); contact_id = aCursor.getString( aCursor.getColumnIndex(FinancePlannerDatabaseHelper.TEMPLATE_COLUMN_ID)); //Log.d(TAG,"LOFASZ - contact_id = " + contact_id); output.append("\n _ID:" + contact_id); name = aCursor.getString( aCursor.getColumnIndex(FinancePlannerDatabaseHelper.TEMPLATE_COLUMN_EXPENSE_NAME)); //Log.d(TAG,"LOFASZ - name = " + name); output.append("\n Name:" + name); phoneNum = aCursor.getString( aCursor.getColumnIndex(FinancePlannerDatabaseHelper.TEMPLATE_COLUMN_EXPENSE_PLANNED)); //Log.d(TAG,"LOFASZ - phoneNum = " + phoneNum); output.append("\n Phone Num:" + phoneNum); aCursor.moveToNext(); /*dbOperations.insertContact(name, phoneNum); Log.d(TAG,"LOFASZ - inserting contact into the database..."); phoneNumber = phoneCursor.getString(phoneCursor.getColumnIndex(NUMBER)); output.append("\n Phone number:" + phoneNumber);*/ /*} Log.d(TAG, "Share database: " + output.toString());*/ } /*private void insertContactIntoShareDatabase(Cursor aCursor){ int contactIdx = aCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone._ID); int nameIdx = aCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); int phoneNumberIdx = aCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); int photoIdIdx = aCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.PHOTO_ID); String contact_id = aCursor.getString(contactIdx); Log.d(TAG,"LOFASZ - contact_id = " + contact_id); String name = aCursor.getString(nameIdx); Log.d(TAG,"LOFASZ - name = " + name); String phoneNum = aCursor.getString(phoneNumberIdx); Log.d(TAG,"LOFASZ - phoneNum = " + phoneNum); dbOperations.insertTemplateItem(name, phoneNum); Log.d(TAG,"LOFASZ - inserting contact into the database..."); }*/ }
[ "molnr.gabor@gmail.com" ]
molnr.gabor@gmail.com
249bbf7af2d3b9ac24c54172f0bf32b641c8ba56
f4c23b1eb0b15abbfe4a3d3facd21457d01673e4
/app/src/test/java/com/example/guardadordemapas/ExampleUnitTest.java
8a0f44ad2d9f6dc6af140d78520a0d3b3a0b7eba
[]
no_license
usamahas17/Guardadordemapas
bdb6475a535e39bf977ff20cd92021be0ac72870
a5f68ee7f72fd60a395267e169e4bdb9fd53171c
refs/heads/master
2023-01-05T21:48:32.790168
2020-10-31T00:29:44
2020-10-31T00:29:44
308,773,411
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.example.guardadordemapas; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "ponsiopilato1999@gmail.com" ]
ponsiopilato1999@gmail.com
b8a4aa1c40c0ec3381c13ea919c52c6c3ade7b09
f17063376739a3684fd10b8428886360cdf3c42b
/MainActivity/src/es/usc/citius/openet/mg/tab/fragments/FragmentExample1.java
12c1520afdde304b8ceacd19161087617945d794
[]
no_license
ricard0javier/MTIN
9c9ccde3816ebfad3d3a5394454d61d43385a37b
c4e3a1dba49a762b3ac0c42634b6a6a161f41d23
refs/heads/master
2021-01-23T12:45:08.316264
2012-11-28T17:43:31
2012-11-28T17:43:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,897
java
package es.usc.citius.openet.mg.tab.fragments; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; import android.os.Bundle; import android.os.Message; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import android.widget.Toast; import es.usc.citius.openet.mg.tab.R; import es.usc.citius.openet.mg.tab.events.Event; import es.usc.citius.openet.mg.tab.events.EventBus; import es.usc.citius.openet.mg.tab.events.EventBusListener; import es.usc.citius.openet.mg.tab.events.EventFactory; import es.usc.citius.openet.mg.tab.tasks.DummyFragmentTask; public class FragmentExample1 extends Fragment implements EventBusListener { private TextView textTV; private View progressBar = null; private DummyFragmentTask runningTask = null; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.example_fragment, null); textTV = (TextView) view.findViewById(R.id.fakeTV_1); progressBar = view.findViewById(R.id.fragment_title_pb); return view; } @Override public void onStart() { super.onStart(); EventBus.getInstance().register(this); } @Override public void onStop() { super.onStop(); EventBus.getInstance().unRegister(this); if (this.runningTask != null) { this.runningTask.cancel(true); } } @Override public void onReceive(Message event) { final int eventType = Event.getEventType(event); if (eventType == Event.EVENT_PATIENT_SELECTED) { String patient = Event.getEventPayload(event); if (patient == null) { return; } manageEventPatientSelected(patient); Toast.makeText(this.getActivity(), "Recibido: " + Event.toString(event), Toast.LENGTH_LONG) .show(); // Enviar otra tarea en segundo plano DummyFragmentTask dft = new DummyFragmentTask(this); runningTask = dft; dft.execute(); } } private void manageEventPatientSelected(String patient) { if (patient == null) { return; } StringBuilder sb = new StringBuilder(); try { JSONObject jsonObject = new JSONObject(patient); sb.append(jsonObject.getString("name")); sb.append(" ("); sb.append(jsonObject.getInt("number_of_statements")); sb.append(")"); } catch (JSONException e) { Message event = EventFactory.createEvent(Event.EVENT_ERROR_API_FORMAT); EventBus.getInstance().sendEvent(event); } textTV.setText("Status: \n" + sb.toString()); } public void setLoadingStatus(boolean isLoading) { progressBar.setVisibility(isLoading ? View.VISIBLE : View.GONE); } public void setAyncTaskFinished(DummyFragmentTask task) { runningTask = null; } }
[ "villanueva.ricardo@gmail.com" ]
villanueva.ricardo@gmail.com
c4a72e18f52e7bef71f491a1ae098a407ec12ac7
c1852cd5ddd12f09ed44b2a91e7cb547ee45ce3a
/src/model/common/CropIdeals.java
05407ee85c173227066de8c5a7258850ff6ea18d
[]
no_license
lynchtyler/cs351Project3_Tyler_James_Garrison_David_Chris
7fa7687e948ea117dd4316793c29c29f43cb1801
5b60bf86b0a53b3e1dceb0f231c40d7edff1c230
refs/heads/master
2021-01-19T07:06:53.289398
2015-05-07T05:44:24
2015-05-07T05:44:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,082
java
package model.common; /** * Created by Tim on 4/5/15. * Contains the ideal conditions for the * four crops. */ public interface CropIdeals { public final int WHEAT_AVG_HIGH = 24; public final int WHEAT_AVG_LOW = 21; public final int WHEAT_MAX_HIGH = 35; public final int WHEAT_MAX_LOW = 4; public final int WHEAT_RAIN_HIGH = 38; public final int WHEAT_RAIN_LOW = 31; public final int RICE_AVG_HIGH = 27; public final int RICE_AVG_LOW = 21; public final int RICE_MAX_HIGH = 27; public final int RICE_MAX_LOW = 15; public final int RICE_RAIN_HIGH = 300; public final int RICE_RAIN_LOW = 115; public final int CORN_AVG_HIGH = 35; public final int CORN_AVG_LOW = 5; public final int CORN_MAX_HIGH = 45; public final int CORN_MAX_LOW = 0; public final int CORN_RAIN_HIGH = 50; public final int CORN_RAIN_LOW = 45; public final int SOY_AVG_HIGH = 35; public final int SOY_AVG_LOW = 18; public final int SOY_MAX_HIGH = 40; public final int SOY_MAX_LOW = 15; public final int SOY_RAIN_HIGH = 70; public final int SOY_RAIN_LOW = 45; }
[ "tchavez22@unm.edu" ]
tchavez22@unm.edu
d70380e4ee0aff022b991d229afeafeb70cb2156
5fedb08590b97e71f65b6854cac40f4679e4ae93
/woooqi-bpm-app/src/main/java/com/woooqi/bpm/manage/shiro/AnyRolesAuthorizationFilter.java
6c989581d40dd04c7f7314ed41d6096949707673
[]
no_license
xeon-ye/woooqi-bpm
c234156eb75420f4835800e3b25aa2b0f3df6fff
64dc99312eb91de4bb2008d60e0cd963a2d1c683
refs/heads/master
2021-09-05T12:20:37.785041
2018-01-27T13:57:11
2018-01-27T13:57:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
871
java
package com.woooqi.bpm.manage.shiro; import java.io.IOException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import org.apache.shiro.subject.Subject; import org.apache.shiro.web.filter.authz.RolesAuthorizationFilter; public class AnyRolesAuthorizationFilter extends RolesAuthorizationFilter{ @Override public boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws IOException { Subject subject = getSubject(request, response); String[] rolesArray = (String[]) mappedValue; if (rolesArray == null || rolesArray.length == 0) { return true; } for(int i=0;i<rolesArray.length;i++){ if(subject.hasRole(rolesArray[i])){ return true; } } return false; } }
[ "wangqi528528@qq.com" ]
wangqi528528@qq.com
f5d600932ae4ca7829df020451abbf2b5f51da28
ad7f07a0cf708a736a382835ebe9eafe9addd812
/p2p-core/core-service/src/main/java/com/solution/p2p/core/user/service/ResourceServiceImpl.java
792ccb0f4aa6c079f881e21b50037d5747d7442c
[]
no_license
zhaom/p2p-solution
dc6cbb393f4481b83cccf2f74ac04009627d2014
462222111250a2aa6f035f3f57c8f47f31b13155
refs/heads/master
2021-01-23T02:53:56.238672
2015-02-26T10:50:30
2015-02-26T10:50:30
30,795,861
1
2
null
null
null
null
UTF-8
Java
false
false
2,196
java
package com.solution.p2p.core.user.service; import com.solution.p2p.core.common.entity.SysResource; import com.solution.p2p.core.common.service.BasicServiceImpl; import com.solution.p2p.core.common.service.ResourceService; import com.solution.p2p.core.common.utils.ServiceResult; import com.solution.p2p.core.user.dao.SysResourceMapper; import java.util.List; import java.util.Set; public class ResourceServiceImpl extends BasicServiceImpl implements ResourceService { private SysResourceMapper sysResourceMapper; public void setSysResourceMapper(SysResourceMapper sysResourceMapper) { this.sysResourceMapper = sysResourceMapper; } @Override public ServiceResult<SysResource> createResource(SysResource sysResource, String appKey, String sign) { return null; //To change body of implemented methods use File | Settings | File Templates. } @Override public ServiceResult<SysResource> updateResource(SysResource sysResource, String appKey, String sign) { return null; //To change body of implemented methods use File | Settings | File Templates. } @Override public ServiceResult<Object> deleteResource(Long aLong, String appKey, String sign) { //To change body of implemented methods use File | Settings | File Templates. return null; } @Override public ServiceResult<SysResource> findOne(Long aLong, String appKey, String sign) { return null; //To change body of implemented methods use File | Settings | File Templates. } @Override public ServiceResult<List<SysResource>> findAll(String appKey, String sign) { return null; //To change body of implemented methods use File | Settings | File Templates. } @Override public ServiceResult<Set<String>> findPermissions(Set<Long> longs, String appKey, String sign) { return null; //To change body of implemented methods use File | Settings | File Templates. } @Override public ServiceResult<List<SysResource>> findMenus(Set<String> strings, String appKey, String sign) { return null; //To change body of implemented methods use File | Settings | File Templates. } }
[ "zhaominhe@gmail.com" ]
zhaominhe@gmail.com
9e79442fb6b784c176c76059d9fc1a4d3aba4a52
30bf1c9502ba1619e3aea1b34f096a52b31a6614
/src/main/java/com/example/demo/controller/UserController.java
1584a9c37739e55e8dfbbad705f0c4a9814db06b
[]
no_license
coderben2017/Spring-Boot-Demo
92fccc55ab05f615106137b284e3c323f45fc689
89fff2cc78a0e0fef450d1faf11b978a973c1aa3
refs/heads/master
2020-03-27T04:44:12.462167
2018-08-30T02:49:14
2018-08-30T02:49:14
145,964,466
0
0
null
null
null
null
UTF-8
Java
false
false
2,681
java
package com.example.demo.controller; import com.example.demo.dao.UserRepository; import com.example.demo.data.User; import com.example.demo.enums.ResultEnum; import com.example.demo.service.UserService; import com.example.demo.util.ResultUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.util.List; @RestController public class UserController { @Autowired private UserRepository userRepository; @Autowired private UserService userService; private final static Logger logger = LoggerFactory.getLogger(UserController.class); @GetMapping(value = "/users") public List<User> getAllUsers() { return userRepository.findAll(); } @DeleteMapping(value = "/users") public void deleteTwo(@RequestParam(value = "ids") String ids) { String[] array = ids.split(","); Integer id1 = Integer.parseInt(array[0]); Integer id2 = Integer.parseInt(array[1]); userService.deleteTwo(id1, id2); } @GetMapping(value = "/users/{age}") public List<User> getUsersByAge(@PathVariable(value = "age") Integer age) { return userRepository.findByAge(age); } @GetMapping(value = "/user") public User getUserById(@RequestParam("id") Integer id) { return userRepository.findById(id).get(); } @PostMapping(value = "/user") public Object addUser(@Valid User user, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultUtil.error(ResultEnum.AGE_LITTLE.getCode(), ResultEnum.AGE_LITTLE.getMessage()); } return ResultUtil.success(userRepository.save(user)); } @PutMapping(value = "/user") public User updateUser(@RequestParam(value = "id") Integer id, @RequestParam(value = "name") String name, @RequestParam(value = "gender") String gender, @RequestParam(value = "age") Integer age) { User user = new User(); user.setId(id); user.setName(name); user.setGender(gender); user.setAge(age); return userRepository.save(user); } @DeleteMapping(value = "/user") public void deleteUser(@RequestParam(value = "id") Integer id) { userRepository.deleteById(id); } @GetMapping(value = "/user/age") public Object getUserAge(@RequestParam(value = "id") Integer id) throws Exception { return userService.getAgeById(id); } }
[ "jinben01@inspur.com" ]
jinben01@inspur.com
6b22e7c7eb401df6307257c5b4cd272624342780
1d948c35b26707f885f58094398a900f81fd7229
/src/main/java/com/spidernet/dashboard/entity/CapabilityMap.java
680fe180f3853b1c080c352c45b86e5137958a9c
[]
no_license
RichardBaiBingGe/SpiderNet
7cf4938f1b4b1e6b3c51f4834ecb669440d85b91
cb695228cfacf39e0cec9729ffc23ef329768532
refs/heads/master
2021-04-30T14:19:22.067415
2018-02-12T09:58:54
2018-02-12T09:58:54
118,851,419
1
0
null
2018-01-25T02:33:23
2018-01-25T02:33:23
null
UTF-8
Java
false
false
960
java
package com.spidernet.dashboard.entity; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * view capability map * * @author Hurricane * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "Object") @XmlType(propOrder = { "capabilityMap"}) public class CapabilityMap { @XmlElementWrapper(name = "capabilityMap") @XmlElement(name = "capability") private List<CapabilityB> capabilityMap = new ArrayList<CapabilityB>(); public List<CapabilityB> getCapabilityMap() { return capabilityMap; } public void setCapabilityMap(List<CapabilityB> capabilityMap) { this.capabilityMap = capabilityMap; } }
[ "donghui_dh@163.com" ]
donghui_dh@163.com
d9c9b416a5151b113dd7d3badba84479192235bd
ea43986915e25e623a816c21b13d67fcf6ef6217
/app/src/main/java/com/strategy/intecom/vtc/fixuser/view/fragment/FMCreateOrder.java
423c83bc1a6a44e993e35448f7f359af4332239c
[]
no_license
phamluanhanu2010/FixUser
745f43c069da5a77be9bae183f42c78603ef58ef
69aa5e99e68d6798818dff128c30058781b698aa
refs/heads/master
2021-05-06T17:20:08.104515
2017-11-23T14:19:25
2017-11-23T14:19:25
111,818,054
0
0
null
null
null
null
UTF-8
Java
false
false
8,587
java
package com.strategy.intecom.vtc.fixuser.view.fragment; import android.annotation.SuppressLint; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import com.strategy.intecom.vtc.fixuser.MainScreen; import com.strategy.intecom.vtc.fixuser.R; import com.strategy.intecom.vtc.fixuser.interfaces.Callback; import com.strategy.intecom.vtc.fixuser.model.VtcModelNewOrder; import com.strategy.intecom.vtc.fixuser.utils.Const; import com.strategy.intecom.vtc.fixuser.view.base.AppCore; import com.strategy.intecom.vtc.fixuser.view.base.AppCoreBase; import com.strategy.intecom.vtc.fixuser.view.custom.MyViewPager; /** * A simple {@link Fragment} subclass. */ public class FMCreateOrder extends AppCore implements Callback, MainScreen.OnBackListenner { // the steps of this create order private static final int PAGE_NUMBER = 3; // private package static final int STEP_ONE_RESPOND_FIELDS = 1; static final int STEP_TWO_RESPOND_FIELDS_DETAIL = 2; static final int STEP_THREE_RESPOND_FIELD_DETAIL = 3; static final int STEP_SPECIAL_UPDATE_FIX_FIELD = 4; private ImageView mTabOne; private ImageView mTabTwo; private ImageView mTabThree; private Pager adapter; //This is our viewPager private MyViewPager viewPager; private Callback mCallback; private VtcModelNewOrder mNewOrder; public FMCreateOrder() { } @SuppressLint("ValidFragment") public FMCreateOrder(Callback callback) { mCallback = callback; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); getCurrentActivity().setOnBackListenner(this); } @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { savedInstanceState = getArguments(); if(savedInstanceState != null){ mNewOrder = savedInstanceState.getParcelable(Const.KEY_BUNDLE_ACTION_NEW_ORDER); } if(mNewOrder == null){ mNewOrder = new VtcModelNewOrder(); } return inflater.inflate(R.layout.ui_create_order, container, false); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mTabOne = (ImageView)view.findViewById(R.id.tab_one); mTabTwo = (ImageView)view.findViewById(R.id.tab_two); mTabThree = (ImageView)view.findViewById(R.id.tab_three); //Initializing viewPager viewPager = (MyViewPager) view.findViewById(R.id.pager); //Creating our pager adapter adapter = new Pager(getCurrentActivity().getSupportFragmentManager()); //Adding adapter to pager viewPager.setAdapter(adapter); viewPager.setPagingEnabled(false); setSelectedTab(Pager.PAGE_ONE); } private void setSelectedTab(int i) { mTabOne.setImageResource((i == Pager.PAGE_ONE) ? R.drawable.tab_bkg_selected: R.drawable.tab_bkg_unselected); mTabTwo.setImageResource((i == Pager.PAGE_TWO) ? R.drawable.tab_bkg_selected: R.drawable.tab_bkg_unselected); mTabThree.setImageResource((i == Pager.PAGE_THREE) ? R.drawable.tab_bkg_selected: R.drawable.tab_bkg_unselected); } @Override public <T> void onHandlerCallBack(int key, T... t) { switch (key) { case STEP_ONE_RESPOND_FIELDS: Bundle data = (Bundle) t[0]; mNewOrder = data.getParcelable(Const.KEY_BUNDLE_ACTION_NEW_ORDER); adapter.getTabTwo().updateData(data); viewPager.setCurrentItem(Pager.PAGE_TWO); setSelectedTab(Pager.PAGE_TWO); break; case STEP_TWO_RESPOND_FIELDS_DETAIL: mNewOrder = (VtcModelNewOrder) t[0]; adapter.getTabThree().updateData(mNewOrder); viewPager.setCurrentItem(Pager.PAGE_THREE); setSelectedTab(Pager.PAGE_THREE); break; case STEP_THREE_RESPOND_FIELD_DETAIL: mNewOrder = (VtcModelNewOrder) t[0]; mCallback.onHandlerCallBack(-1, mNewOrder); cmdBack(); break; case STEP_SPECIAL_UPDATE_FIX_FIELD: FMSearchFixFieldText.Holder dataHolder = (FMSearchFixFieldText.Holder) t[0]; if (mNewOrder != null) { mNewOrder.setName(dataHolder.parent.getName()); mNewOrder.setPrice(dataHolder.child.getPrice()); mNewOrder.setFieldId(dataHolder.child.getId()); mNewOrder.setFieldChildName(dataHolder.child.getName()); } Bundle bundle = new Bundle(); bundle.putParcelable(Const.KEY_BUNDLE_ACTION_FIELD, dataHolder.parent); bundle.putParcelable(Const.KEY_BUNDLE_ACTION_NEW_ORDER, mNewOrder); adapter.getTabTwo().updateData(bundle); adapter.getTabOne().updateData(mNewOrder); viewPager.setCurrentItem(Pager.PAGE_THREE); setSelectedTab(Pager.PAGE_THREE); break; } } @Override public void onBack() { int currentID = viewPager.getCurrentItem(); switch (currentID) { case Pager.PAGE_ONE: if (adapter != null) { adapter.getTabOne().onDestroyView(); } cmdBack(); break; case Pager.PAGE_TWO: viewPager.setCurrentItem(Pager.PAGE_ONE); setSelectedTab(Pager.PAGE_ONE); break; case Pager.PAGE_THREE: viewPager.setCurrentItem(Pager.PAGE_TWO); setSelectedTab(Pager.PAGE_TWO); break; } } @Override public void onDestroy() { getCurrentActivity().setOnBackListenner(null); super.onDestroy(); } private class Pager extends FragmentStatePagerAdapter { private static final int PAGE_ONE = 0; private static final int PAGE_TWO = 1; private static final int PAGE_THREE = 2; //integer to count number of tabs int tabCount; private FMFixFieldsList mTabOne; private FMFixFieldsListDetail mTabTwo; private FMFillOrderDetail mTabThree; //Constructor to the class public Pager(FragmentManager fm) { super(fm); //Initializing tab count this.tabCount = PAGE_NUMBER; } //Overriding method getItem @Override public Fragment getItem(int position) { //Returning the current tabs switch (position) { case 0: return getTabOne(); case 1: return getTabTwo(); case 2: return getTabThree(); default: return null; } } //Overriden method getCount to get the number of tabs @Override public int getCount() { return tabCount; } public FMFixFieldsList getTabOne() { if (mTabOne == null) { mTabOne = new FMFixFieldsList(Const.KEY_CREATE_ORDER_FLOW_STEP_ONE, FMCreateOrder.this); mTabOne.updateData(mNewOrder); mTabOne.setmBackListenner(FMCreateOrder.this); } return mTabOne; } public FMFixFieldsListDetail getTabTwo() { if (mTabTwo == null) { mTabTwo = new FMFixFieldsListDetail(Const.KEY_CREATE_ORDER_FLOW_STEP_TWO, FMCreateOrder.this); mTabTwo.setmBackListenner(FMCreateOrder.this); } return mTabTwo; } public FMFillOrderDetail getTabThree() { if (mTabThree == null) { mTabThree = new FMFillOrderDetail(FMCreateOrder.this); mTabThree.setmBackListenner(FMCreateOrder.this); } return mTabThree; } } }
[ "phamluanhanu2010@gmail.com" ]
phamluanhanu2010@gmail.com
450c2fad8fb0be9b010d5244867208d73dc05a62
96962d37fae28403404daf2783283919b0a05ad7
/src/_13_bananas_4eva/Bananas123.java
28f3c4f5260c71a3b279b68f511a5585601ddec3
[]
no_license
League-Level0-Student/level-0-module-1-nicolesalgado
cc74d3c34a69f327f55fde4813ebaf8a2a491bc0
4a50a80b334970236f645b275327b6d23fd0436a
refs/heads/master
2020-09-24T11:32:10.582638
2020-09-16T01:26:14
2020-09-16T01:26:14
225,751,126
0
0
null
null
null
null
UTF-8
Java
false
false
173
java
package _13_bananas_4eva; public class Bananas123 { public static void main(String[] args) { for (int i = 0; i < 1000 ; i++) { System.out.println("bananas123"); } } }
[ "root@b1af13a3252d" ]
root@b1af13a3252d
a3ee621c5c9c562d785d96700165401d0c51ced8
b209f1a01e1780a1891f660c4a1a6f54b114b386
/src/test/java/org/bitbucket/amedeo/firebaseHelper/model/Item.java
1a168b07e706d963d19ca35e0d3e9f55a6ed0623
[]
no_license
elema/firebase-java-rest
391487bfe4c970c38044115d3abe16d822d42ab3
e8512c5361abccd7c5bdc730688a6a95d84cd33c
refs/heads/master
2021-01-25T14:16:36.191231
2017-12-04T00:54:59
2017-12-04T00:54:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
629
java
package org.bitbucket.amedeo.firebaseHelper.model; /** * @Exclude Model class created for test */ public class Item { private String name; private String description; public Item(){}; public Item(String name, String description) { this.name = name; this.description = description; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
[ "ste.amedeo@gmail.com" ]
ste.amedeo@gmail.com
d9f0eaad5e2c63f1a82d4d6a511728c19776d112
c5fae89577249a85adb2c2704472188ab64c2b0d
/src/com/hc/holocook/service/member/MNickChkService.java
febd6632274b89fe522918a781fa2616d4edee2a
[]
no_license
AsnemBlue/holocook
d639c67611fc5d82c3b83a0b324475d30356607a
4885ca2f26114ff3b053bae7b1b905a95fb76193
refs/heads/master
2021-04-20T04:09:51.635013
2020-06-19T04:28:58
2020-06-19T04:28:58
249,653,215
1
0
null
null
null
null
UTF-8
Java
false
false
675
java
package com.hc.holocook.service.member; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.hc.holocook.dao.MemberDao; import com.hc.holocook.service.Service; public class MNickChkService implements Service { @Override public void execute(HttpServletRequest request, HttpServletResponse response) { String mNick = request.getParameter("mNick"); MemberDao mDao = MemberDao.getInstance(); if(mDao.mNickChk(mNick)==MemberDao.NONEXISTENT) { request.setAttribute("nickChkMsg","사용가능한 닉네임입니다." ); }else { request.setAttribute("nickChkMsg","중복된 닉네임입니다." ); } } }
[ "jeenpark@naver.com" ]
jeenpark@naver.com
efe856026143b7cb757b92181cea4afa4a0b223b
9688b9a42fd86032ba96ece55aed78957f6485a3
/src/main/java/com/vural/dp/behavioral/chainofresponsibility/sample01/handlers/BillingSupportHandler.java
addf8e87a07aa8fdd083621022013abb8ad7b651
[]
no_license
aticivural/design-patterns
4d392acfea959c448bb0756321747a008421d68c
cb0516326dcbf9c976dd19b146d09c586ffc7ad8
refs/heads/master
2022-11-08T04:10:53.516234
2020-06-21T22:00:52
2020-06-21T22:00:52
255,676,959
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.vural.dp.behavioral.chainofresponsibility.sample01.handlers; public class BillingSupportHandler extends AbstractSupportHandler { public BillingSupportHandler(int level) { this.level = level; } @Override protected void handleRequest(String message) { System.out.println(getClass().getSimpleName() + ": Processing request " + message); } }
[ "vural.atici@sony.com" ]
vural.atici@sony.com
09154cfc9d034679ba4dffa4b6e876aa61987be4
5add32e5d81439087392286a6656688243d6e217
/src/ISIS/Code/Class/DialogoIndustrias.java
cfa7b1826f458503d4c1419baf50a206ea9c51a2
[]
no_license
joseangelmr/liki-liki-town
8113f20abc35aca5a768befb94fa6248d2c3f6d9
f5e4c5d81b1c8a67937c86f7c436f7ebd72e69ce
refs/heads/master
2021-01-23T13:42:51.581315
2014-07-10T16:16:35
2014-07-10T16:16:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
26,318
java
package ISIS.Code.Class; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JDialog; import javax.swing.event.EventListenerList; import ISIS.Code.Matriz.Mapa; /** * * @author ISIS */ public class DialogoIndustrias extends JDialog { /** * Creates new form Dialogo */ public DialogoIndustrias(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" // desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { System.out.println("incia componentes dialogo"); panelNice1 = new org.edisoncor.gui.panel.PanelNice(); tabbedSelector21 = new org.edisoncor.gui.tabbedPane.TabbedSelector2(); panelImage1 = new org.edisoncor.gui.panel.PanelImage(); panelCurves1 = new org.edisoncor.gui.panel.PanelCurves(); buttonSeven1 = new org.edisoncor.gui.button.ButtonSeven(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); buttonSeven2 = new org.edisoncor.gui.button.ButtonSeven(); jLabel3 = new javax.swing.JLabel(); buttonSeven3 = new org.edisoncor.gui.button.ButtonSeven(); jLabel4 = new javax.swing.JLabel(); buttonSeven4 = new org.edisoncor.gui.button.ButtonSeven(); jLabel5 = new javax.swing.JLabel(); buttonSeven5 = new org.edisoncor.gui.button.ButtonSeven(); buttonSeven26 = new org.edisoncor.gui.button.ButtonSeven(); panelImage2 = new org.edisoncor.gui.panel.PanelImage(); panelCurves4 = new org.edisoncor.gui.panel.PanelCurves(); jLabel6 = new javax.swing.JLabel(); buttonSeven6 = new org.edisoncor.gui.button.ButtonSeven(); jLabel7 = new javax.swing.JLabel(); buttonSeven7 = new org.edisoncor.gui.button.ButtonSeven(); jLabel8 = new javax.swing.JLabel(); buttonSeven8 = new org.edisoncor.gui.button.ButtonSeven(); jLabel9 = new javax.swing.JLabel(); buttonSeven9 = new org.edisoncor.gui.button.ButtonSeven(); jLabel10 = new javax.swing.JLabel(); buttonSeven10 = new org.edisoncor.gui.button.ButtonSeven(); buttonSeven27 = new org.edisoncor.gui.button.ButtonSeven(); panelImage3 = new org.edisoncor.gui.panel.PanelImage(); panelCurves5 = new org.edisoncor.gui.panel.PanelCurves(); jLabel11 = new javax.swing.JLabel(); buttonSeven11 = new org.edisoncor.gui.button.ButtonSeven(); jLabel12 = new javax.swing.JLabel(); buttonSeven12 = new org.edisoncor.gui.button.ButtonSeven(); jLabel13 = new javax.swing.JLabel(); buttonSeven13 = new org.edisoncor.gui.button.ButtonSeven(); jLabel14 = new javax.swing.JLabel(); buttonSeven14 = new org.edisoncor.gui.button.ButtonSeven(); jLabel15 = new javax.swing.JLabel(); buttonSeven15 = new org.edisoncor.gui.button.ButtonSeven(); buttonSeven28 = new org.edisoncor.gui.button.ButtonSeven(); panelImage4 = new org.edisoncor.gui.panel.PanelImage(); panelCurves2 = new org.edisoncor.gui.panel.PanelCurves(); jLabel16 = new javax.swing.JLabel(); buttonSeven16 = new org.edisoncor.gui.button.ButtonSeven(); jLabel17 = new javax.swing.JLabel(); buttonSeven17 = new org.edisoncor.gui.button.ButtonSeven(); jLabel18 = new javax.swing.JLabel(); buttonSeven18 = new org.edisoncor.gui.button.ButtonSeven(); jLabel19 = new javax.swing.JLabel(); buttonSeven19 = new org.edisoncor.gui.button.ButtonSeven(); jLabel20 = new javax.swing.JLabel(); buttonSeven20 = new org.edisoncor.gui.button.ButtonSeven(); buttonSeven29 = new org.edisoncor.gui.button.ButtonSeven(); panelImage5 = new org.edisoncor.gui.panel.PanelImage(); panelCurves3 = new org.edisoncor.gui.panel.PanelCurves(); jLabel21 = new javax.swing.JLabel(); buttonSeven21 = new org.edisoncor.gui.button.ButtonSeven(); jLabel22 = new javax.swing.JLabel(); buttonSeven22 = new org.edisoncor.gui.button.ButtonSeven(); jLabel23 = new javax.swing.JLabel(); buttonSeven23 = new org.edisoncor.gui.button.ButtonSeven(); jLabel24 = new javax.swing.JLabel(); buttonSeven24 = new org.edisoncor.gui.button.ButtonSeven(); jLabel25 = new javax.swing.JLabel(); buttonSeven25 = new org.edisoncor.gui.button.ButtonSeven(); buttonSeven30 = new org.edisoncor.gui.button.ButtonSeven(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setUndecorated(true); panelNice1.setPreferredSize(new java.awt.Dimension(500, 400)); panelImage1.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/Backgrounds/BackCasas.jpg"))); // NOI18N panelImage1.setLayout(null); panelCurves1.setLayout(null); buttonSeven1.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven1.setText("Comprar"); panelCurves1.add(buttonSeven1); buttonSeven1.setBounds(100, 100, 70, 22); buttonSeven1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { dispose(); gamepanel.mouseClicked(evt); gamepanel.setClick(true); // setSeleccionada(1); } }); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/MenuCompra/Industria/Aserradero.png"))); // NOI18N panelCurves1.add(jLabel1); jLabel1.setBounds(27, 12, 189, 100); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/MenuCompra/Industria/lblCafeteria.png"))); // NOI18N panelCurves1.add(jLabel2); jLabel2.setBounds(30, 130, 189, 100); buttonSeven2.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven2.setText("Comprar"); panelCurves1.add(buttonSeven2); buttonSeven2.setBounds(110, 220, 70, 22); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/MenuCompra/Industria/lblFruteria.png"))); // NOI18N panelCurves1.add(jLabel3); jLabel3.setBounds(30, 260, 189, 100); buttonSeven3.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven3.setText("Comprar"); panelCurves1.add(buttonSeven3); buttonSeven3.setBounds(110, 350, 70, 22); jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/MenuCompra/Industria/lblGranja.png"))); // NOI18N panelCurves1.add(jLabel4); jLabel4.setBounds(220, 70, 189, 100); buttonSeven4.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven4.setText("Comprar"); panelCurves1.add(buttonSeven4); buttonSeven4.setBounds(300, 160, 70, 22); jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/MenuCompra/Industria/lblRestaurantBarato.png"))); // NOI18N panelCurves1.add(jLabel5); jLabel5.setBounds(220, 200, 189, 100); buttonSeven5.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven5.setText("Comprar"); panelCurves1.add(buttonSeven5); buttonSeven5.setBounds(300, 290, 70, 22); buttonSeven26.setBackground(new java.awt.Color(0, 0, 255)); buttonSeven26.setText("Volver"); buttonSeven26.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { dispose(); } }); panelCurves1.add(buttonSeven26); buttonSeven26.setBounds(406, 345, 80, 30); panelImage1.add(panelCurves1); panelCurves1.setBounds(-1, -1, 490, 390); tabbedSelector21.addTab("", new javax.swing.ImageIcon(getClass() .getResource("/ISIS/Resource/ButtonImages/#1 (Copiar).png")), panelImage1, ""); // NOI18N panelImage2.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/Backgrounds/BackCasas2.jpg"))); // NOI18N panelImage2.setLayout(null); panelCurves4.setLayout(null); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves4.add(jLabel6); jLabel6.setBounds(27, 12, 189, 100); buttonSeven6.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven6.setText("Comprar"); panelCurves4.add(buttonSeven6); buttonSeven6.setBounds(100, 100, 70, 22); jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves4.add(jLabel7); jLabel7.setBounds(30, 130, 189, 100); buttonSeven7.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven7.setText("Comprar"); panelCurves4.add(buttonSeven7); buttonSeven7.setBounds(110, 220, 70, 22); jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves4.add(jLabel8); jLabel8.setBounds(30, 260, 189, 100); buttonSeven8.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven8.setText("Comprar"); panelCurves4.add(buttonSeven8); buttonSeven8.setBounds(110, 350, 70, 22); jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves4.add(jLabel9); jLabel9.setBounds(220, 70, 189, 100); buttonSeven9.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven9.setText("Comprar"); panelCurves4.add(buttonSeven9); buttonSeven9.setBounds(300, 160, 70, 22); jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves4.add(jLabel10); jLabel10.setBounds(220, 200, 189, 100); buttonSeven10.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven10.setText("Comprar"); panelCurves4.add(buttonSeven10); buttonSeven10.setBounds(300, 290, 70, 22); buttonSeven27.setBackground(new java.awt.Color(0, 0, 255)); buttonSeven27.setText("Volver"); buttonSeven27.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { dispose(); } }); panelCurves4.add(buttonSeven27); buttonSeven27.setBounds(406, 345, 80, 30); panelImage2.add(panelCurves4); panelCurves4.setBounds(0, 0, 490, 390); tabbedSelector21.addTab("", new javax.swing.ImageIcon(getClass() .getResource("/ISIS/Resource/ButtonImages/#2 (Copiar).png")), panelImage2); // NOI18N panelImage3.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/Backgrounds/BackCasas3.jpg"))); // NOI18N panelImage3.setLayout(null); panelCurves5.setLayout(null); jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves5.add(jLabel11); jLabel11.setBounds(27, 12, 189, 100); buttonSeven11.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven11.setText("Comprar"); panelCurves5.add(buttonSeven11); buttonSeven11.setBounds(100, 100, 70, 22); jLabel12.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves5.add(jLabel12); jLabel12.setBounds(30, 130, 189, 100); buttonSeven12.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven12.setText("Comprar"); panelCurves5.add(buttonSeven12); buttonSeven12.setBounds(110, 220, 70, 22); jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves5.add(jLabel13); jLabel13.setBounds(30, 260, 189, 100); buttonSeven13.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven13.setText("Comprar"); panelCurves5.add(buttonSeven13); buttonSeven13.setBounds(110, 350, 70, 22); jLabel14.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves5.add(jLabel14); jLabel14.setBounds(220, 70, 189, 100); buttonSeven14.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven14.setText("Comprar"); panelCurves5.add(buttonSeven14); buttonSeven14.setBounds(300, 160, 70, 22); jLabel15.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves5.add(jLabel15); jLabel15.setBounds(220, 200, 189, 100); buttonSeven15.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven15.setText("Comprar"); panelCurves5.add(buttonSeven15); buttonSeven15.setBounds(300, 290, 70, 22); buttonSeven28.setBackground(new java.awt.Color(0, 0, 255)); buttonSeven28.setText("Volver"); buttonSeven28.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { dispose(); } }); panelCurves5.add(buttonSeven28); buttonSeven28.setBounds(406, 345, 80, 30); panelImage3.add(panelCurves5); panelCurves5.setBounds(0, 0, 490, 390); tabbedSelector21.addTab("", new javax.swing.ImageIcon(getClass() .getResource("/ISIS/Resource/ButtonImages/#3 (Copiar).png")), panelImage3); // NOI18N panelImage4.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/Backgrounds/BackCasas4.jpg"))); // NOI18N panelImage4.setLayout(null); panelCurves2.setLayout(null); jLabel16.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves2.add(jLabel16); jLabel16.setBounds(27, 12, 189, 100); buttonSeven16.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven16.setText("Comprar"); panelCurves2.add(buttonSeven16); buttonSeven16.setBounds(100, 100, 70, 22); jLabel17.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves2.add(jLabel17); jLabel17.setBounds(30, 130, 189, 100); buttonSeven17.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven17.setText("Comprar"); panelCurves2.add(buttonSeven17); buttonSeven17.setBounds(110, 220, 70, 22); jLabel18.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves2.add(jLabel18); jLabel18.setBounds(30, 260, 189, 100); buttonSeven18.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven18.setText("Comprar"); panelCurves2.add(buttonSeven18); buttonSeven18.setBounds(110, 350, 70, 22); jLabel19.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves2.add(jLabel19); jLabel19.setBounds(220, 70, 189, 100); buttonSeven19.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven19.setText("Comprar"); panelCurves2.add(buttonSeven19); buttonSeven19.setBounds(300, 160, 70, 22); jLabel20.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves2.add(jLabel20); jLabel20.setBounds(220, 200, 189, 100); buttonSeven20.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven20.setText("Comprar"); panelCurves2.add(buttonSeven20); buttonSeven20.setBounds(300, 290, 70, 22); buttonSeven29.setBackground(new java.awt.Color(0, 0, 255)); buttonSeven29.setText("Volver"); buttonSeven29.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { dispose(); } }); panelCurves2.add(buttonSeven29); buttonSeven29.setBounds(406, 345, 80, 30); panelImage4.add(panelCurves2); panelCurves2.setBounds(0, 0, 490, 380); tabbedSelector21.addTab("", new javax.swing.ImageIcon(getClass() .getResource("/ISIS/Resource/ButtonImages/#4 (Copiar).png")), panelImage4, ""); // NOI18N panelImage5.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/Backgrounds/BackCasas5.jpg"))); // NOI18N panelImage5.setLayout(null); panelCurves3.setLayout(null); jLabel21.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves3.add(jLabel21); jLabel21.setBounds(27, 12, 189, 100); buttonSeven21.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven21.setText("Comprar"); panelCurves3.add(buttonSeven21); buttonSeven21.setBounds(100, 100, 70, 22); jLabel22.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves3.add(jLabel22); jLabel22.setBounds(30, 130, 189, 100); buttonSeven22.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven22.setText("Comprar"); panelCurves3.add(buttonSeven22); buttonSeven22.setBounds(110, 220, 70, 22); jLabel23.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves3.add(jLabel23); jLabel23.setBounds(30, 260, 189, 100); buttonSeven23.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven23.setText("Comprar"); panelCurves3.add(buttonSeven23); buttonSeven23.setBounds(110, 350, 70, 22); jLabel24.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves3.add(jLabel24); jLabel24.setBounds(220, 70, 189, 100); buttonSeven24.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven24.setText("Comprar"); panelCurves3.add(buttonSeven24); buttonSeven24.setBounds(300, 160, 70, 22); jLabel25.setIcon(new javax.swing.ImageIcon(getClass().getResource( "/ISIS/Resource/ButtonImages/PetroCasa.png"))); // NOI18N panelCurves3.add(jLabel25); jLabel25.setBounds(220, 200, 189, 100); buttonSeven25.setBackground(new java.awt.Color(255, 0, 0)); buttonSeven25.setText("Comprar"); panelCurves3.add(buttonSeven25); buttonSeven25.setBounds(300, 290, 70, 22); buttonSeven30.setBackground(new java.awt.Color(0, 0, 255)); buttonSeven30.setText("Volver"); buttonSeven30.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { dispose(); } }); panelCurves3.add(buttonSeven30); buttonSeven30.setBounds(406, 345, 80, 30); panelImage5.add(panelCurves3); panelCurves3.setBounds(0, 0, 490, 380); tabbedSelector21.addTab("", new javax.swing.ImageIcon(getClass() .getResource("/ISIS/Resource/ButtonImages/#5 (Copiar).png")), panelImage5, ""); // NOI18N javax.swing.GroupLayout panelNice1Layout = new javax.swing.GroupLayout( panelNice1); panelNice1.setLayout(panelNice1Layout); panelNice1Layout .setHorizontalGroup(panelNice1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( panelNice1Layout .createSequentialGroup() .addContainerGap() .addComponent( tabbedSelector21, javax.swing.GroupLayout.DEFAULT_SIZE, 565, Short.MAX_VALUE) .addContainerGap())); panelNice1Layout.setVerticalGroup(panelNice1Layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING).addGroup( panelNice1Layout .createSequentialGroup() .addContainerGap() .addComponent(tabbedSelector21, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE).addContainerGap())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout( getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 585, Short.MAX_VALUE) .addGroup( layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelNice1, javax.swing.GroupLayout.DEFAULT_SIZE, 585, Short.MAX_VALUE))); layout.setVerticalGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 421, Short.MAX_VALUE) .addGroup( layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelNice1, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE))); tabbedSelector21.setEnabledAt(1, false); tabbedSelector21.setEnabledAt(2, false); tabbedSelector21.setEnabledAt(3, false); tabbedSelector21.setEnabledAt(4, false); pack(); }// </editor-fold>//GEN-END:initComponents public void addActionListener(ActionListener listener) { eventListenerList.add(ActionListener.class, listener); } public void removeActionListener(ActionListener listener) { eventListenerList.remove(ActionListener.class, listener); } public ActionListener[] getActionListeners() { return eventListenerList.getListeners(ActionListener.class); } private void fireActionEvent(ActionEvent evt) { ActionListener[] actionListeners = getActionListeners(); for (ActionListener actionListener : actionListeners) { actionListener.actionPerformed(evt); } } /** * @param args * the command line arguments */ public static void main(String args[]) { /* * Set the Nimbus look and feel */ // <editor-fold defaultstate="collapsed" // desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay with the * default look and feel. For details see * http://download.oracle.com/javase * /tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager .getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Dialogo.class.getName()).log( java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Dialogo.class.getName()).log( java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Dialogo.class.getName()).log( java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Dialogo.class.getName()).log( java.util.logging.Level.SEVERE, null, ex); } // </editor-fold> /* * Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { Dialogo dialog = new Dialogo(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // public static int getSeleccionada() { // return seleccionada; // } // // public static void setSeleccionada(int seleccionada) { // Dialogo.seleccionada = seleccionada; // } // Variables declaration - do not modify//GEN-BEGIN:variables private org.edisoncor.gui.button.ButtonSeven buttonSeven1; private org.edisoncor.gui.button.ButtonSeven buttonSeven10; private org.edisoncor.gui.button.ButtonSeven buttonSeven11; private org.edisoncor.gui.button.ButtonSeven buttonSeven12; private org.edisoncor.gui.button.ButtonSeven buttonSeven13; private org.edisoncor.gui.button.ButtonSeven buttonSeven14; private org.edisoncor.gui.button.ButtonSeven buttonSeven15; private org.edisoncor.gui.button.ButtonSeven buttonSeven16; private org.edisoncor.gui.button.ButtonSeven buttonSeven17; private org.edisoncor.gui.button.ButtonSeven buttonSeven18; private org.edisoncor.gui.button.ButtonSeven buttonSeven19; private org.edisoncor.gui.button.ButtonSeven buttonSeven2; private org.edisoncor.gui.button.ButtonSeven buttonSeven20; private org.edisoncor.gui.button.ButtonSeven buttonSeven21; private org.edisoncor.gui.button.ButtonSeven buttonSeven22; private org.edisoncor.gui.button.ButtonSeven buttonSeven23; private org.edisoncor.gui.button.ButtonSeven buttonSeven24; private org.edisoncor.gui.button.ButtonSeven buttonSeven25; private org.edisoncor.gui.button.ButtonSeven buttonSeven26; private org.edisoncor.gui.button.ButtonSeven buttonSeven27; private org.edisoncor.gui.button.ButtonSeven buttonSeven28; private org.edisoncor.gui.button.ButtonSeven buttonSeven29; private org.edisoncor.gui.button.ButtonSeven buttonSeven3; private org.edisoncor.gui.button.ButtonSeven buttonSeven30; private org.edisoncor.gui.button.ButtonSeven buttonSeven4; private org.edisoncor.gui.button.ButtonSeven buttonSeven5; private org.edisoncor.gui.button.ButtonSeven buttonSeven6; private org.edisoncor.gui.button.ButtonSeven buttonSeven7; private org.edisoncor.gui.button.ButtonSeven buttonSeven8; private org.edisoncor.gui.button.ButtonSeven buttonSeven9; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private org.edisoncor.gui.panel.PanelCurves panelCurves1; private org.edisoncor.gui.panel.PanelCurves panelCurves2; private org.edisoncor.gui.panel.PanelCurves panelCurves3; private org.edisoncor.gui.panel.PanelCurves panelCurves4; private org.edisoncor.gui.panel.PanelCurves panelCurves5; private org.edisoncor.gui.panel.PanelImage panelImage1; private org.edisoncor.gui.panel.PanelImage panelImage2; private org.edisoncor.gui.panel.PanelImage panelImage3; private org.edisoncor.gui.panel.PanelImage panelImage4; private org.edisoncor.gui.panel.PanelImage panelImage5; private org.edisoncor.gui.panel.PanelNice panelNice1; private org.edisoncor.gui.tabbedPane.TabbedSelector2 tabbedSelector21; private EventListenerList eventListenerList = new EventListenerList(); private Mapa gamepanel = new Mapa(); // static int seleccionada; }
[ "joseangel2212@gmail.com" ]
joseangel2212@gmail.com
1d8d84e9f2a308046236b5b7afa20467dddc5683
19067b548725bcbde9318975310475626de7eeab
/PracticeWithJatan/src/com/java/string/StringPunctuation.java
cdbcae3f134a20c4beb229cdd3263b14651a7111
[]
no_license
H2OPatel/CoreJavaQuestions
a35793f80fa7c571cad5cb9d1fd4f322810fd787
f640eaebffad5771b36dd3f652327e9232d1b88b
refs/heads/main
2023-07-01T18:49:58.200962
2021-08-07T21:42:54
2021-08-07T21:42:54
393,797,445
0
0
null
null
null
null
UTF-8
Java
false
false
1,597
java
package com.java.string; public class StringPunctuation { public static void main(String[] args) { String str = "This is test sting, To find :Punctuations! in the string;."; System.out.println(countPunctsInStr(str)); int count = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == '.' || str.charAt(i) == ',' || str.charAt(i) == ';' || str.charAt(i) == ':') { count++; } } System.out.println("The number of punctuations in the string are : " + count); // Test case 1 : str = "ikbsk;:,.", count = 4 // Test case 2 : str = "ikbs,.,.,.;:,.", count = 10 String str2 = "ikbs,.,.,.;:,."; System.out.println("Executing tests..."); String[] testCases = {str, str2}; int[] validResuts = {4, 10}; int i = 0; for(String testCase : testCases) { int actualCount = countPunctsInStr(testCase); if(actualCount == validResuts[i]) { System.out.println("Test case "+(i+1)+" passed."); } else { System.out.println("Test case "+(i+1)+" failed. Expected value : "+validResuts[i]+" but actual value : "+actualCount); } i++; } } public static int countPunctsInStr(String str) { if(str == null || str.length()==0) return 0; int count = 0; for(int i=0; i<str.length();i++) { if(isPunctuation(str.charAt(i))) count++; } return count; } private static boolean isPunctuation(char c) { return c == '.' || c == ',' || c == ';' || c == ':'; } private static boolean isPunctuation1(char c) { if( c == '.' || c == ',' || c == ';' || c == ':') { return true; } else { return false; } } }
[ "jalbypatel@gmail.com" ]
jalbypatel@gmail.com
e83a9225c50ba267e3a1504acece85b7f67f1fee
9371ae6ec24ad4b9914a43e64befb915d71e34f2
/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/org/apache/http/impl/io/SocketOutputBuffer.java
688280aa7d2a0aa092138113a9aedce37f6ad32c
[]
no_license
kanaida/LG-Esteem-Homeless-Kernel
9fac4c52993798eaf3021d9abb72a5e697464398
a5780f82bef7631fdb43b079e6f9ea6dbd187ac7
refs/heads/master
2020-06-09T06:14:50.214296
2012-02-24T04:23:01
2012-02-24T04:23:01
3,532,548
1
2
null
null
null
null
UTF-8
Java
false
false
308
java
package org.apache.http.impl.io; public class SocketOutputBuffer extends org.apache.http.impl.io.AbstractSessionOutputBuffer { public SocketOutputBuffer(java.net.Socket socket, int buffersize, org.apache.http.params.HttpParams params) throws java.io.IOException { throw new RuntimeException("Stub!"); } }
[ "kanaida.bat@gmail.com" ]
kanaida.bat@gmail.com
4bab5a09690b67fc3b39bd136ddc8e044d097e22
7955201d6825dd63bc12921bf87e56f26d28fbbb
/GeoQuiz/app/src/androidTest/java/com/avalon/ash/geoquiz/ApplicationTest.java
69d5ef5702ea933a749bf3e1955ef5a9479bc54b
[]
no_license
Tachiguishi/AndroidTutorial
b2e59387f7e40b06271a2d66577096782ea2f307
bb00bb1aaf18aa9c7e3853a67f482f1611a4d4dd
refs/heads/master
2021-01-11T02:29:13.061802
2017-04-16T02:52:38
2017-04-16T02:52:38
70,963,797
0
0
null
null
null
null
UTF-8
Java
false
false
353
java
package com.avalon.ash.geoquiz; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "TachiguishiRor@gmail.com" ]
TachiguishiRor@gmail.com
eb87a431330864a1c9186fcf54ebf09d94d561e0
d0e6a77ecd915d3f3184589aa78c81c3269f9f80
/c2c-extension/src/main/java/io/ballerina/c2c/exceptions/KubernetesPluginException.java
8b905d97974cb84c3ec4fb9ba123b6a33d66c931
[ "Apache-2.0" ]
permissive
isurulucky/module-ballerina-c2c
72ea3bdf150c9c78dafda06bbdc3cdc4d765efc7
fd9e80b0f0a789ad629d11c95db5787c6db45359
refs/heads/master
2023-06-01T10:16:10.039280
2021-06-24T06:42:15
2021-06-24T06:42:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,014
java
/* * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package io.ballerina.c2c.exceptions; /** * Custom exception for kubernetes artifact generation errors. */ public class KubernetesPluginException extends Exception { public KubernetesPluginException(String msg) { super(msg); } public KubernetesPluginException(String msg, Throwable e) { super(msg, e); } }
[ "anuruddhal@wso2.com" ]
anuruddhal@wso2.com
e75ca5d574b6c2db1e1452f8f6440ed72298e075
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/30/30_9f8fa6463d33bc756bea4d0c114fd21f34d7c88e/JiraService/30_9f8fa6463d33bc756bea4d0c114fd21f34d7c88e_JiraService_s.java
0403d56d9325295409f27b72db09e31fe87849d3
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
9,755
java
package uk.org.sappho.code.heatmap.issues.jira; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.log4j.Logger; import com.atlassian.jira.rpc.soap.client.RemoteIssue; import com.atlassian.jira.rpc.soap.client.RemoteVersion; import com.google.inject.Inject; import com.google.inject.Singleton; import uk.org.sappho.code.heatmap.config.Configuration; import uk.org.sappho.code.heatmap.config.ConfigurationException; import uk.org.sappho.code.heatmap.issues.IssueManagement; import uk.org.sappho.code.heatmap.issues.IssueManagementException; import uk.org.sappho.code.heatmap.issues.IssueWrapper; import uk.org.sappho.code.heatmap.issues.Releases; import uk.org.sappho.code.heatmap.warnings.Warnings; import uk.org.sappho.jira4j.soap.JiraSoapService; @Singleton public class JiraService implements IssueManagement { protected JiraSoapService jiraSoapService = null; protected Map<String, IssueWrapper> allowedIssues = new HashMap<String, IssueWrapper>(); protected Map<String, String> warnedIssues = new HashMap<String, String>(); protected Map<String, String> releases = new HashMap<String, String>(); protected Map<String, String> versionWarnings = new HashMap<String, String>(); protected Map<String, String> issueTypes = new HashMap<String, String>(); protected Map<String, Integer> issueTypeWeightMultipliers = new HashMap<String, Integer>(); protected Warnings warnings; protected Configuration config; protected static final Pattern SIMPLE_JIRA_REGEX = Pattern.compile("^([a-zA-Z]{2,}-\\d+):.*$"); private static final Logger LOG = Logger.getLogger(JiraService.class); protected static final String ISSUE_FIELDS = "Issue fields"; @Inject public JiraService(Warnings warnings, Configuration config) throws IssueManagementException { LOG.info("Using Jira issue management plugin"); this.warnings = warnings; this.config = config; connect(); getAllowedIssues(); } protected void connect() throws IssueManagementException { String url = config.getProperty("jira.url", "http://example.com"); String username = config.getProperty("jira.username", "nobody"); String password = config.getProperty("jira.password", "nopassword"); LOG.info("Connecting to " + url + " as " + username); try { jiraSoapService = new JiraSoapService(url, username, password); } catch (Throwable t) { throw new IssueManagementException("Unable to log in to Jira at " + url + " as user " + username, t); } } protected void getAllowedIssues() throws IssueManagementException { /** * note: this is a bit rubbish but because jira's soap interface doesn't have a getParent function it's the only way to fake it * making this better will require an installed plugin * **/ LOG.info("Getting list of allowed issues"); try { // get all tasks we're prepared to deal with String jql = config.getProperty("jira.filter.issues.allowed"); LOG.info("Running Jira query: " + jql); RemoteIssue[] remoteIssues = jiraSoapService.getService().getIssuesFromJqlSearch( jiraSoapService.getToken(), jql, 5000); LOG.info("Processing " + remoteIssues.length + " issues returned by query"); // map all subtasks back to their parents Map<String, RemoteIssue> mappedRemoteIssues = new HashMap<String, RemoteIssue>(); Map<String, String> subTaskParents = new HashMap<String, String>(); for (RemoteIssue remoteIssue : remoteIssues) { String issueKey = remoteIssue.getKey(); if (mappedRemoteIssues.get(issueKey) == null) { mappedRemoteIssues.put(issueKey, remoteIssue); } RemoteIssue[] subTasks = jiraSoapService.getService().getIssuesFromJqlSearch( jiraSoapService.getToken(), "parent = " + issueKey, 200); for (RemoteIssue subTask : subTasks) { String subTaskKey = subTask.getKey(); warnings.add("Issue subtask mapping", subTaskKey + " --> " + issueKey); if (mappedRemoteIssues.get(subTaskKey) == null) { mappedRemoteIssues.put(subTaskKey, subTask); } subTaskParents.put(subTaskKey, issueKey); } } // create issue wrappers for all allowed root (non-subtask) issues for (String issueKey : mappedRemoteIssues.keySet()) { String parentKey = subTaskParents.get(issueKey); IssueWrapper issueWrapper = parentKey != null ? createIssueWrapper(mappedRemoteIssues.get(parentKey), issueKey) : createIssueWrapper(mappedRemoteIssues.get(issueKey), null); allowedIssues.put(issueKey, issueWrapper); } LOG.info("Processed " + mappedRemoteIssues.size() + " issues - added subtasks might have inflated this figure"); } catch (Throwable t) { throw new IssueManagementException("Unable to get list of allowed issues", t); } } protected IssueWrapper createIssueWrapper(RemoteIssue issue, String subTaskKey) throws IssueManagementException { Releases issueReleases = new Releases(); Map<String, String> issueReleaseMap = new HashMap<String, String>(); for (RemoteVersion remoteVersion : issue.getFixVersions()) { String remoteVersionName = remoteVersion.getName(); String versionWarning = versionWarnings.get(remoteVersionName); if (versionWarning == null) { versionWarning = config.getProperty("jira.version.status." + remoteVersionName, ""); versionWarnings.put(remoteVersionName, versionWarning); if (versionWarning.length() > 0) { warnings.add("Issue version", remoteVersionName + " " + versionWarning); } } if (versionWarning.length() > 0) { issueReleases.addWarning(remoteVersionName + " " + versionWarning); } String release = releases.get(remoteVersionName); if (release == null) { try { release = config.getProperty("jira.version.map.name." + remoteVersionName); } catch (ConfigurationException e) { release = remoteVersionName; } warnings.add("Version mapping", remoteVersionName + " --> " + release); releases.put(remoteVersionName, release); } issueReleaseMap.put(release, release); } for (String release : issueReleaseMap.keySet()) { issueReleases.addRelease(release); } if (issueReleases.getReleases().size() == 0) { warnings.add(ISSUE_FIELDS, issue.getKey() + " has no fix version"); } else if (issueReleases.getReleases().size() > 1) { warnings.add(ISSUE_FIELDS, issue.getKey() + " has more than one fix version"); } String typeId = issue.getType(); String typeName = issueTypes.get(typeId); if (typeName == null) { typeName = config.getProperty("jira.type.map.id." + typeId, "housekeeping"); warnings.add("Issue type mapping", typeId + " --> " + typeName); issueTypes.put(typeId, typeName); } Integer weight = issueTypeWeightMultipliers.get(typeName); if (weight == null) { String typeNameKey = "jira.type.multiplier." + typeName; try { weight = Integer.parseInt(config.getProperty(typeNameKey, "0")); } catch (Throwable t) { throw new IssueManagementException( "Issue type weight configuration \"" + typeNameKey + "\" is invalid", t); } warnings.add("Issue type weight", typeName + " = " + weight); issueTypeWeightMultipliers.put(typeName, weight); } return new JiraIssueWrapper(issue, subTaskKey, issueReleases, weight); } protected String getIssueKeyFromCommitComment(String commitComment) { String key = null; Matcher matcher = SIMPLE_JIRA_REGEX.matcher(commitComment.split("\n")[0]); if (matcher.matches()) { key = matcher.group(1); } else { warnings.add(ISSUE_FIELDS, "No Jira issue key found in commit comment: " + commitComment); } return key; } public IssueWrapper getIssue(String commitComment) { IssueWrapper issue = null; String key = getIssueKeyFromCommitComment(commitComment); if (key != null) { issue = allowedIssues.get(key); if (issue == null && warnedIssues.get(key) == null) { warnings.add(ISSUE_FIELDS, "No Jira issue found for " + key + " - query specified in jira.filter.issues.allowed configuration too restrictive?"); warnedIssues.put(key, key); } } return issue; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c2256032d8710b9463b8bb884a72fc4838de3709
8ecc32e48668a5939dafd2765896f1ce494c0cd4
/asterixdb/asterix-external-data/target/generated-sources/lexer/org/apache/asterix/runtime/operators/file/adm/AdmLexer.java
b7f7b2634da86c9c155c775c840c6b32b46840b4
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference", "MIT", "Apache-2.0" ]
permissive
kristhiankmilog/AsterixDB-EKETAL
46d665f27f887d6bf89d50e88fb719a79e9963ae
82732c15cf54ee72969eb6ec86c6417086978163
refs/heads/master
2021-05-11T15:11:29.763663
2017-12-29T14:31:36
2017-12-29T14:31:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
47,737
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.asterix.runtime.operators.file.adm; import java.io.IOException; import org.apache.asterix.runtime.operators.file.adm.AdmLexerException; public class AdmLexer { public static final int TOKEN_EOF = 0, TOKEN_AUX_NOT_FOUND = 1 , TOKEN_BOOLEAN_CONS=2 , TOKEN_INT8_CONS=3 , TOKEN_INT16_CONS=4 , TOKEN_INT32_CONS=5 , TOKEN_INT64_CONS=6 , TOKEN_FLOAT_CONS=7 , TOKEN_DOUBLE_CONS=8 , TOKEN_DATE_CONS=9 , TOKEN_DATETIME_CONS=10 , TOKEN_DURATION_CONS=11 , TOKEN_STRING_CONS=12 , TOKEN_HEX_CONS=13 , TOKEN_BASE64_CONS=14 , TOKEN_POINT_CONS=15 , TOKEN_POINT3D_CONS=16 , TOKEN_LINE_CONS=17 , TOKEN_POLYGON_CONS=18 , TOKEN_RECTANGLE_CONS=19 , TOKEN_CIRCLE_CONS=20 , TOKEN_TIME_CONS=21 , TOKEN_INTERVAL_CONS=22 , TOKEN_YEAR_MONTH_DURATION_CONS=23 , TOKEN_DAY_TIME_DURATION_CONS=24 , TOKEN_UUID_CONS=25 , TOKEN_NULL_LITERAL=26 , TOKEN_TRUE_LITERAL=27 , TOKEN_FALSE_LITERAL=28 , TOKEN_CONSTRUCTOR_OPEN=29 , TOKEN_CONSTRUCTOR_CLOSE=30 , TOKEN_START_RECORD=31 , TOKEN_END_RECORD=32 , TOKEN_COMMA=33 , TOKEN_COLON=34 , TOKEN_START_ORDERED_LIST=35 , TOKEN_END_ORDERED_LIST=36 , TOKEN_START_UNORDERED_LIST=37 , TOKEN_STRING_LITERAL=38 , TOKEN_INT_LITERAL=39 , TOKEN_INT8_LITERAL=40 , TOKEN_INT16_LITERAL=41 , TOKEN_INT32_LITERAL=42 , TOKEN_INT64_LITERAL=43 , TOKEN_aux_EXPONENT=44 , TOKEN_DOUBLE_LITERAL=45 , TOKEN_FLOAT_LITERAL=46 ; // Human representation of tokens. Useful for debug. // Is possible to convert a TOKEN_CONSTANT in its image through // AdmLexer.tokenKindToString(TOKEN_CONSTANT); private static final String[] tokenImage = { "<EOF>", "<AUX_NOT_FOUND>" , "<BOOLEAN_CONS>" , "<INT8_CONS>" , "<INT16_CONS>" , "<INT32_CONS>" , "<INT64_CONS>" , "<FLOAT_CONS>" , "<DOUBLE_CONS>" , "<DATE_CONS>" , "<DATETIME_CONS>" , "<DURATION_CONS>" , "<STRING_CONS>" , "<HEX_CONS>" , "<BASE64_CONS>" , "<POINT_CONS>" , "<POINT3D_CONS>" , "<LINE_CONS>" , "<POLYGON_CONS>" , "<RECTANGLE_CONS>" , "<CIRCLE_CONS>" , "<TIME_CONS>" , "<INTERVAL_CONS>" , "<YEAR_MONTH_DURATION_CONS>" , "<DAY_TIME_DURATION_CONS>" , "<UUID_CONS>" , "<NULL_LITERAL>" , "<TRUE_LITERAL>" , "<FALSE_LITERAL>" , "<CONSTRUCTOR_OPEN>" , "<CONSTRUCTOR_CLOSE>" , "<START_RECORD>" , "<END_RECORD>" , "<COMMA>" , "<COLON>" , "<START_ORDERED_LIST>" , "<END_ORDERED_LIST>" , "<START_UNORDERED_LIST>" , "<STRING_LITERAL>" , "<INT_LITERAL>" , "<INT8_LITERAL>" , "<INT16_LITERAL>" , "<INT32_LITERAL>" , "<INT64_LITERAL>" , "<aux_EXPONENT>" , "<DOUBLE_LITERAL>" , "<FLOAT_LITERAL>" }; private static final char EOF_CHAR = 4; protected java.io.Reader inputStream; protected int column; protected int line; protected boolean prevCharIsCR; protected boolean prevCharIsLF; protected boolean containsEscapes; protected char[] buffer; protected int bufsize; protected int bufpos; protected int tokenBegin; protected int endOf_USED_Buffer; protected int endOf_UNUSED_Buffer; protected int maxUnusedBufferSize; // ================================================================================ // Auxiliary functions. Can parse the tokens used in the grammar as partial/auxiliary // ================================================================================ private int parse_aux_EXPONENT(char currentChar) throws IOException { if (currentChar=='e'){ currentChar = readNextChar(); if (currentChar=='+'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } return TOKEN_aux_EXPONENT; }return parseError(TOKEN_aux_EXPONENT); }if (currentChar=='-'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } return TOKEN_aux_EXPONENT; }return parseError(TOKEN_aux_EXPONENT); }if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } return TOKEN_aux_EXPONENT; }return parseError(TOKEN_aux_EXPONENT); }if (currentChar=='E'){ currentChar = readNextChar(); if (currentChar=='+'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } return TOKEN_aux_EXPONENT; }return parseError(TOKEN_aux_EXPONENT); }if (currentChar=='-'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } return TOKEN_aux_EXPONENT; }return parseError(TOKEN_aux_EXPONENT); }if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } return TOKEN_aux_EXPONENT; }return parseError(TOKEN_aux_EXPONENT); }return TOKEN_AUX_NOT_FOUND; } // ================================================================================ // Main method. Return a TOKEN_CONSTANT // ================================================================================ public int next() throws AdmLexerException, IOException { char currentChar = buffer[bufpos]; while (currentChar == ' ' || currentChar=='\t' || currentChar == '\n' || currentChar=='\r') currentChar = readNextChar(); tokenBegin = bufpos; containsEscapes = false; if (currentChar==EOF_CHAR) return TOKEN_EOF; switch(currentChar){ case 'b': currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); return TOKEN_BOOLEAN_CONS; }return parseError(TOKEN_BOOLEAN_CONS); }return parseError(TOKEN_BOOLEAN_CONS); }return parseError(TOKEN_BOOLEAN_CONS); }return parseError(TOKEN_BOOLEAN_CONS); }return parseError(TOKEN_BOOLEAN_CONS); }if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='s'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); if (currentChar=='6'){ currentChar = readNextChar(); if (currentChar=='4'){ currentChar = readNextChar(); return TOKEN_BASE64_CONS; }return parseError(TOKEN_BASE64_CONS); }return parseError(TOKEN_BASE64_CONS); }return parseError(TOKEN_BASE64_CONS); }return parseError(TOKEN_BASE64_CONS); }return parseError(TOKEN_BOOLEAN_CONS,TOKEN_BASE64_CONS); case 'i': currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); switch(currentChar){ case '8': currentChar = readNextChar(); return TOKEN_INT8_CONS; case '1': currentChar = readNextChar(); if (currentChar=='6'){ currentChar = readNextChar(); return TOKEN_INT16_CONS; }return parseError(TOKEN_INT16_CONS); case '3': currentChar = readNextChar(); if (currentChar=='2'){ currentChar = readNextChar(); return TOKEN_INT32_CONS; }return parseError(TOKEN_INT32_CONS); case '6': currentChar = readNextChar(); if (currentChar=='4'){ currentChar = readNextChar(); return TOKEN_INT64_CONS; }return parseError(TOKEN_INT64_CONS); case 'e': currentChar = readNextChar(); if (currentChar=='r'){ currentChar = readNextChar(); if (currentChar=='v'){ currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); return TOKEN_INTERVAL_CONS; }return parseError(TOKEN_INTERVAL_CONS); }return parseError(TOKEN_INTERVAL_CONS); }return parseError(TOKEN_INTERVAL_CONS); }return parseError(TOKEN_INTERVAL_CONS); } return TOKEN_INT64_CONS; }return parseError(TOKEN_INT8_CONS,TOKEN_INT16_CONS,TOKEN_INT32_CONS,TOKEN_INT64_CONS,TOKEN_INT64_CONS,TOKEN_INTERVAL_CONS); }return parseError(TOKEN_INT8_CONS,TOKEN_INT16_CONS,TOKEN_INT32_CONS,TOKEN_INT64_CONS,TOKEN_INT64_CONS,TOKEN_INTERVAL_CONS); case 'f': currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); return TOKEN_FLOAT_CONS; }return parseError(TOKEN_FLOAT_CONS); }return parseError(TOKEN_FLOAT_CONS); }return parseError(TOKEN_FLOAT_CONS); }if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); if (currentChar=='s'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); return TOKEN_FALSE_LITERAL; }return parseError(TOKEN_FALSE_LITERAL); }return parseError(TOKEN_FALSE_LITERAL); }return parseError(TOKEN_FALSE_LITERAL); }return parseError(TOKEN_FLOAT_CONS,TOKEN_FALSE_LITERAL); case 'd': currentChar = readNextChar(); switch(currentChar){ case 'o': currentChar = readNextChar(); if (currentChar=='u'){ currentChar = readNextChar(); if (currentChar=='b'){ currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); return TOKEN_DOUBLE_CONS; }return parseError(TOKEN_DOUBLE_CONS); }return parseError(TOKEN_DOUBLE_CONS); }return parseError(TOKEN_DOUBLE_CONS); }return parseError(TOKEN_DOUBLE_CONS); case 'a': currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='m'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); return TOKEN_DATETIME_CONS; }return parseError(TOKEN_DATETIME_CONS); }return parseError(TOKEN_DATETIME_CONS); }return parseError(TOKEN_DATETIME_CONS); }return TOKEN_DATE_CONS; }return parseError(TOKEN_DATE_CONS,TOKEN_DATETIME_CONS); }if (currentChar=='y'){ currentChar = readNextChar(); if (currentChar=='-'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='m'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); if (currentChar=='-'){ currentChar = readNextChar(); if (currentChar=='d'){ currentChar = readNextChar(); if (currentChar=='u'){ currentChar = readNextChar(); if (currentChar=='r'){ currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); return TOKEN_DAY_TIME_DURATION_CONS; }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DAY_TIME_DURATION_CONS); }return parseError(TOKEN_DATE_CONS,TOKEN_DATETIME_CONS,TOKEN_DAY_TIME_DURATION_CONS); case 'u': currentChar = readNextChar(); if (currentChar=='r'){ currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); return TOKEN_DURATION_CONS; }return parseError(TOKEN_DURATION_CONS); }return parseError(TOKEN_DURATION_CONS); }return parseError(TOKEN_DURATION_CONS); }return parseError(TOKEN_DURATION_CONS); }return parseError(TOKEN_DURATION_CONS); }return parseError(TOKEN_DURATION_CONS); } return parseError(TOKEN_DOUBLE_CONS,TOKEN_DATE_CONS,TOKEN_DATETIME_CONS,TOKEN_DURATION_CONS,TOKEN_DAY_TIME_DURATION_CONS); case 's': currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='r'){ currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); if (currentChar=='g'){ currentChar = readNextChar(); return TOKEN_STRING_CONS; }return parseError(TOKEN_STRING_CONS); }return parseError(TOKEN_STRING_CONS); }return parseError(TOKEN_STRING_CONS); }return parseError(TOKEN_STRING_CONS); }return parseError(TOKEN_STRING_CONS); case 'h': currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); if (currentChar=='x'){ currentChar = readNextChar(); return TOKEN_HEX_CONS; }return parseError(TOKEN_HEX_CONS); }return parseError(TOKEN_HEX_CONS); case 'p': currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='3'){ currentChar = readNextChar(); if (currentChar=='d'){ currentChar = readNextChar(); return TOKEN_POINT3D_CONS; }return parseError(TOKEN_POINT3D_CONS); }return TOKEN_POINT_CONS; }return parseError(TOKEN_POINT_CONS,TOKEN_POINT3D_CONS); }return parseError(TOKEN_POINT_CONS,TOKEN_POINT3D_CONS); }if (currentChar=='l'){ currentChar = readNextChar(); if (currentChar=='y'){ currentChar = readNextChar(); if (currentChar=='g'){ currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); return TOKEN_POLYGON_CONS; }return parseError(TOKEN_POLYGON_CONS); }return parseError(TOKEN_POLYGON_CONS); }return parseError(TOKEN_POLYGON_CONS); }return parseError(TOKEN_POLYGON_CONS); }return parseError(TOKEN_POINT_CONS,TOKEN_POINT3D_CONS,TOKEN_POLYGON_CONS); }return parseError(TOKEN_POINT_CONS,TOKEN_POINT3D_CONS,TOKEN_POLYGON_CONS); case 'l': currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); return TOKEN_LINE_CONS; }return parseError(TOKEN_LINE_CONS); }return parseError(TOKEN_LINE_CONS); }return parseError(TOKEN_LINE_CONS); case 'r': currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); if (currentChar=='c'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); if (currentChar=='g'){ currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); return TOKEN_RECTANGLE_CONS; }return parseError(TOKEN_RECTANGLE_CONS); }return parseError(TOKEN_RECTANGLE_CONS); }return parseError(TOKEN_RECTANGLE_CONS); }return parseError(TOKEN_RECTANGLE_CONS); }return parseError(TOKEN_RECTANGLE_CONS); }return parseError(TOKEN_RECTANGLE_CONS); }return parseError(TOKEN_RECTANGLE_CONS); }return parseError(TOKEN_RECTANGLE_CONS); case 'c': currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='r'){ currentChar = readNextChar(); if (currentChar=='c'){ currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); return TOKEN_CIRCLE_CONS; }return parseError(TOKEN_CIRCLE_CONS); }return parseError(TOKEN_CIRCLE_CONS); }return parseError(TOKEN_CIRCLE_CONS); }return parseError(TOKEN_CIRCLE_CONS); }return parseError(TOKEN_CIRCLE_CONS); case 't': currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='m'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); return TOKEN_TIME_CONS; }return parseError(TOKEN_TIME_CONS); }return parseError(TOKEN_TIME_CONS); }if (currentChar=='r'){ currentChar = readNextChar(); if (currentChar=='u'){ currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); return TOKEN_TRUE_LITERAL; }return parseError(TOKEN_TRUE_LITERAL); }return parseError(TOKEN_TRUE_LITERAL); }return parseError(TOKEN_TIME_CONS,TOKEN_TRUE_LITERAL); case 'y': currentChar = readNextChar(); if (currentChar=='e'){ currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='r'){ currentChar = readNextChar(); if (currentChar=='-'){ currentChar = readNextChar(); if (currentChar=='m'){ currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='h'){ currentChar = readNextChar(); if (currentChar=='-'){ currentChar = readNextChar(); if (currentChar=='d'){ currentChar = readNextChar(); if (currentChar=='u'){ currentChar = readNextChar(); if (currentChar=='r'){ currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='t'){ currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='o'){ currentChar = readNextChar(); if (currentChar=='n'){ currentChar = readNextChar(); return TOKEN_YEAR_MONTH_DURATION_CONS; }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); }return parseError(TOKEN_YEAR_MONTH_DURATION_CONS); case 'u': currentChar = readNextChar(); if (currentChar=='u'){ currentChar = readNextChar(); if (currentChar=='i'){ currentChar = readNextChar(); if (currentChar=='d'){ currentChar = readNextChar(); return TOKEN_UUID_CONS; }return parseError(TOKEN_UUID_CONS); }return parseError(TOKEN_UUID_CONS); }return parseError(TOKEN_UUID_CONS); case 'n': currentChar = readNextChar(); if (currentChar=='u'){ currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); if (currentChar=='l'){ currentChar = readNextChar(); return TOKEN_NULL_LITERAL; }return parseError(TOKEN_NULL_LITERAL); }return parseError(TOKEN_NULL_LITERAL); }return parseError(TOKEN_NULL_LITERAL); case '(': currentChar = readNextChar(); return TOKEN_CONSTRUCTOR_OPEN; case ')': currentChar = readNextChar(); return TOKEN_CONSTRUCTOR_CLOSE; case '{': currentChar = readNextChar(); if (currentChar=='{'){ currentChar = readNextChar(); return TOKEN_START_UNORDERED_LIST; }return TOKEN_START_RECORD; case '}': currentChar = readNextChar(); return TOKEN_END_RECORD; case ',': currentChar = readNextChar(); return TOKEN_COMMA; case ':': currentChar = readNextChar(); return TOKEN_COLON; case '[': currentChar = readNextChar(); return TOKEN_START_ORDERED_LIST; case ']': currentChar = readNextChar(); return TOKEN_END_ORDERED_LIST; case '"': currentChar = readNextChar(); boolean escaped = false; while (currentChar != '"' || escaped) { if(!escaped && currentChar == '\\') { escaped = true; containsEscapes = true; } else { escaped = false; } currentChar = readNextChar(); } if (currentChar == '"') { currentChar = readNextChar(); return TOKEN_STRING_LITERAL; } return parseError(TOKEN_STRING_LITERAL); case '+': currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } if (currentChar=='i'){ currentChar = readNextChar(); switch(currentChar){ case '8': currentChar = readNextChar(); return TOKEN_INT8_LITERAL; case '1': currentChar = readNextChar(); if (currentChar=='6'){ currentChar = readNextChar(); return TOKEN_INT16_LITERAL; }return parseError(TOKEN_INT16_LITERAL); case '3': currentChar = readNextChar(); if (currentChar=='2'){ currentChar = readNextChar(); return TOKEN_INT32_LITERAL; }return parseError(TOKEN_INT32_LITERAL); case '6': currentChar = readNextChar(); if (currentChar=='4'){ currentChar = readNextChar(); return TOKEN_INT64_LITERAL; }return parseError(TOKEN_INT64_LITERAL); } return parseError(TOKEN_INT8_LITERAL,TOKEN_INT16_LITERAL,TOKEN_INT32_LITERAL,TOKEN_INT64_LITERAL); }if (currentChar=='.'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } if (parse_aux_EXPONENT(currentChar)==TOKEN_aux_EXPONENT){currentChar = buffer[bufpos]; switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }else { currentChar = buffer[bufpos];}return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }if (parse_aux_EXPONENT(currentChar)==TOKEN_aux_EXPONENT){currentChar = buffer[bufpos]; switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }else { currentChar = buffer[bufpos];}return TOKEN_INT_LITERAL; }if (currentChar=='.'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }return parseError(TOKEN_INT_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT8_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT16_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT32_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT64_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); case '-': currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } if (currentChar=='i'){ currentChar = readNextChar(); switch(currentChar){ case '8': currentChar = readNextChar(); return TOKEN_INT8_LITERAL; case '1': currentChar = readNextChar(); if (currentChar=='6'){ currentChar = readNextChar(); return TOKEN_INT16_LITERAL; }return parseError(TOKEN_INT16_LITERAL); case '3': currentChar = readNextChar(); if (currentChar=='2'){ currentChar = readNextChar(); return TOKEN_INT32_LITERAL; }return parseError(TOKEN_INT32_LITERAL); case '6': currentChar = readNextChar(); if (currentChar=='4'){ currentChar = readNextChar(); return TOKEN_INT64_LITERAL; }return parseError(TOKEN_INT64_LITERAL); } return parseError(TOKEN_INT8_LITERAL,TOKEN_INT16_LITERAL,TOKEN_INT32_LITERAL,TOKEN_INT64_LITERAL); }if (currentChar=='.'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } if (parse_aux_EXPONENT(currentChar)==TOKEN_aux_EXPONENT){currentChar = buffer[bufpos]; switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }else { currentChar = buffer[bufpos];}return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }if (parse_aux_EXPONENT(currentChar)==TOKEN_aux_EXPONENT){currentChar = buffer[bufpos]; switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }else { currentChar = buffer[bufpos];}return TOKEN_INT_LITERAL; }if (currentChar=='.'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }if (currentChar=='I'){ currentChar = readNextChar(); if (currentChar=='N'){ currentChar = readNextChar(); if (currentChar=='F'){ currentChar = readNextChar(); switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }return parseError(TOKEN_INT_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT8_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT16_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT32_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT64_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); case '.': currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); case 'N': currentChar = readNextChar(); if (currentChar=='a'){ currentChar = readNextChar(); if (currentChar=='N'){ currentChar = readNextChar(); switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); case 'I': currentChar = readNextChar(); if (currentChar=='N'){ currentChar = readNextChar(); if (currentChar=='F'){ currentChar = readNextChar(); switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); } if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } if (currentChar=='i'){ currentChar = readNextChar(); switch(currentChar){ case '8': currentChar = readNextChar(); return TOKEN_INT8_LITERAL; case '1': currentChar = readNextChar(); if (currentChar=='6'){ currentChar = readNextChar(); return TOKEN_INT16_LITERAL; }return parseError(TOKEN_INT16_LITERAL); case '3': currentChar = readNextChar(); if (currentChar=='2'){ currentChar = readNextChar(); return TOKEN_INT32_LITERAL; }return parseError(TOKEN_INT32_LITERAL); case '6': currentChar = readNextChar(); if (currentChar=='4'){ currentChar = readNextChar(); return TOKEN_INT64_LITERAL; }return parseError(TOKEN_INT64_LITERAL); } return parseError(TOKEN_INT8_LITERAL,TOKEN_INT16_LITERAL,TOKEN_INT32_LITERAL,TOKEN_INT64_LITERAL); }if (currentChar=='.'){ currentChar = readNextChar(); if(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); while(currentChar >= '0' && currentChar<='9'){ currentChar = readNextChar(); } switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } if (parse_aux_EXPONENT(currentChar)==TOKEN_aux_EXPONENT){currentChar = buffer[bufpos]; switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }else { currentChar = buffer[bufpos];}return TOKEN_DOUBLE_LITERAL; }return parseError(TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); }if (parse_aux_EXPONENT(currentChar)==TOKEN_aux_EXPONENT){currentChar = buffer[bufpos]; switch(currentChar){ case 'd': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'D': currentChar = readNextChar(); if (currentChar=='f'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }if (currentChar=='F'){ currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; }return TOKEN_DOUBLE_LITERAL; case 'f': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; case 'F': currentChar = readNextChar(); return TOKEN_FLOAT_LITERAL; } return TOKEN_DOUBLE_LITERAL; }else { currentChar = buffer[bufpos];}return TOKEN_INT_LITERAL; }return parseError(TOKEN_BOOLEAN_CONS,TOKEN_INT8_CONS,TOKEN_INT16_CONS,TOKEN_INT32_CONS,TOKEN_INT64_CONS,TOKEN_INT64_CONS,TOKEN_FLOAT_CONS,TOKEN_DOUBLE_CONS,TOKEN_DATE_CONS,TOKEN_DATETIME_CONS,TOKEN_DURATION_CONS,TOKEN_STRING_CONS,TOKEN_HEX_CONS,TOKEN_BASE64_CONS,TOKEN_POINT_CONS,TOKEN_POINT3D_CONS,TOKEN_LINE_CONS,TOKEN_POLYGON_CONS,TOKEN_RECTANGLE_CONS,TOKEN_CIRCLE_CONS,TOKEN_TIME_CONS,TOKEN_INTERVAL_CONS,TOKEN_YEAR_MONTH_DURATION_CONS,TOKEN_DAY_TIME_DURATION_CONS,TOKEN_UUID_CONS,TOKEN_NULL_LITERAL,TOKEN_TRUE_LITERAL,TOKEN_FALSE_LITERAL,TOKEN_CONSTRUCTOR_OPEN,TOKEN_CONSTRUCTOR_CLOSE,TOKEN_START_RECORD,TOKEN_END_RECORD,TOKEN_COMMA,TOKEN_COLON,TOKEN_START_ORDERED_LIST,TOKEN_END_ORDERED_LIST,TOKEN_START_UNORDERED_LIST,TOKEN_STRING_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT8_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT16_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT32_LITERAL,TOKEN_INT_LITERAL,TOKEN_INT64_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_DOUBLE_LITERAL,TOKEN_FLOAT_LITERAL); } // ================================================================================ // Public interface // ================================================================================ public AdmLexer(java.io.Reader stream) throws IOException { reInit(stream); } public AdmLexer() { reInit(); } public void setBuffer(char[] buffer) { this.buffer = buffer; tokenBegin = bufpos = 0; containsEscapes = false; tokenBegin = -1; } public void reInit() { bufsize = Integer.MAX_VALUE; endOf_UNUSED_Buffer = bufsize; endOf_USED_Buffer = bufsize; line = 0; prevCharIsCR = false; prevCharIsLF = false; tokenBegin = -1; maxUnusedBufferSize = bufsize; } public void reInit(java.io.Reader stream) throws IOException { done(); inputStream = stream; bufsize = 4096; line = 1; column = 0; bufpos = -1; endOf_UNUSED_Buffer = bufsize; endOf_USED_Buffer = 0; prevCharIsCR = false; prevCharIsLF = false; buffer = new char[bufsize]; tokenBegin = -1; maxUnusedBufferSize = 4096/2; readNextChar(); } public String getLastTokenImage() { if (bufpos >= tokenBegin) { return new String(buffer, tokenBegin, bufpos - tokenBegin); } else { return new String(buffer, tokenBegin, bufsize - tokenBegin) + new String(buffer, 0, bufpos); } } public int getColumn() { return column; } public int getLine() { return line; } public boolean containsEscapes() { return containsEscapes; } public static String tokenKindToString(int token) { return tokenImage[token]; } public void done(){ buffer = null; } // ================================================================================ // Parse error management // ================================================================================ protected int parseError(int ... tokens) throws AdmLexerException { StringBuilder message = new StringBuilder(); message.append("Parse error at (").append(line).append(", ").append(column).append(")"); if (tokens.length > 0) { message.append(" expecting:"); for (int tokenId : tokens){ message.append(" ").append(AdmLexer.tokenKindToString(tokenId)); } } throw new AdmLexerException(message.toString()); } protected void updateLineColumn(char c){ column++; if (prevCharIsLF) { prevCharIsLF = false; line += (column = 1); } else if (prevCharIsCR) { prevCharIsCR = false; if (c == '\n') { prevCharIsLF = true; } else { line += (column = 1); } } if (c=='\r') { prevCharIsCR = true; } else if (c == '\n') { prevCharIsLF = true; } } // ================================================================================ // Read data, buffer management. It uses a circular (and expandable) buffer // ================================================================================ protected char readNextChar() throws IOException { if (++bufpos >= endOf_USED_Buffer) { fillBuff(); } char c = buffer[bufpos]; updateLineColumn(c); return c; } protected boolean fillBuff() throws IOException { if (endOf_UNUSED_Buffer == endOf_USED_Buffer) { // If no more unused buffer space if (endOf_UNUSED_Buffer == bufsize) { // If the previous unused space was at the end of the buffer if (tokenBegin > maxUnusedBufferSize) { // If the first N bytes before the current token are enough // setup buffer to use that fragment bufpos = endOf_USED_Buffer = 0; endOf_UNUSED_Buffer = tokenBegin; } else if (tokenBegin < 0){ // If no token yet // reuse the whole buffer bufpos = endOf_USED_Buffer = 0; } else { // Otherwise expand buffer after its end ExpandBuff(false); } } else if (endOf_UNUSED_Buffer > tokenBegin){ // If the endOf_UNUSED_Buffer is after the token // set endOf_UNUSED_Buffer to the end of the buffer endOf_UNUSED_Buffer = bufsize; } else if ((tokenBegin - endOf_UNUSED_Buffer) < maxUnusedBufferSize) { // If between endOf_UNUSED_Buffer and the token there is NOT enough space expand the buffer // reorganizing it ExpandBuff(true); } else { // Otherwise there is enough space at the start // so we set the buffer to use that fragment endOf_UNUSED_Buffer = tokenBegin; } } int i; if ((i = inputStream.read(buffer, endOf_USED_Buffer, endOf_UNUSED_Buffer - endOf_USED_Buffer)) == -1) { inputStream.close(); buffer[endOf_USED_Buffer] = (char)EOF_CHAR; endOf_USED_Buffer++; return false; } else { endOf_USED_Buffer += i; } return true; } protected void ExpandBuff(boolean wrapAround) { char[] newbuffer = new char[bufsize + maxUnusedBufferSize]; try { if (wrapAround) { System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); buffer = newbuffer; endOf_USED_Buffer = (bufpos += (bufsize - tokenBegin)); } else { System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); buffer = newbuffer; endOf_USED_Buffer = (bufpos -= tokenBegin); } } catch (Throwable t) { throw new Error(t.getMessage()); } bufsize += maxUnusedBufferSize; endOf_UNUSED_Buffer = bufsize; tokenBegin = 0; } }
[ "mariapaulabn76@gmail.com" ]
mariapaulabn76@gmail.com
b42f111af32e33ce5406935f639f723450177592
d641d77d9c48dbb6e29139cbae8fc5555b5ecee0
/src/com/offer/栈/StackTest.java
134e6e9de944ad0909b88c07c4d84f9ca36c0af8
[]
no_license
lixuehan1129/algorithm
8dbbd68b6b2161ac71ea1297c4600e3fcf7d5e9d
40f1c14b64b239e809f31c228df9b0702e2d7f07
refs/heads/master
2023-01-05T07:08:19.383860
2020-11-09T00:48:18
2020-11-09T00:48:18
294,684,418
0
0
null
null
null
null
UTF-8
Java
false
false
2,755
java
package com.offer.栈; import java.util.Stack; /** * 老爹说过要用魔法打败魔法 * * * * @ClassName: StackTest * @Author 李学翰 * @Description: TODO * @Data: Create in 18:56 2020/7/19 * @Version: * * <p> * 你只管开车办法由老爹来想 */ public class StackTest { public static void main(String[] args) { //TwoStackQueue twoStackQueue = new TwoStackQueue(); Stack<Integer> stack = new Stack<Integer>(); stack.push(1); stack.push(2); stack.push(3); getAndRemoveLastElement(stack); } public static int getAndRemoveLastElement(Stack<Integer> stack){ int result = stack.pop(); System.out.println(result); if(stack.isEmpty()){ return result; }else { int last = getAndRemoveLastElement(stack); System.out.println(last); stack.push(result); return last; } } } class MyStack1{ Stack<Integer> stackData; Stack<Integer> stackMin; public MyStack1() { this.stackData = new Stack<Integer>(); this.stackMin = new Stack<Integer>(); } public void push(int newData){ if(this.stackMin.isEmpty()){ this.stackMin.push(newData); }else{ int popData = this.stackMin.peek(); this.stackMin.push(Math.min(newData, popData)); } this.stackData.push(newData); } public int pop(){ if(this.stackData.isEmpty()){ throw new RuntimeException("empty"); } this.stackMin.pop(); return this.stackData.pop(); } public int getMin(){ if(this.stackMin.isEmpty()){ throw new RuntimeException("empty"); } return this.stackMin.peek(); } } /** * 两个栈组成的队列 */ class TwoStackQueue{ Stack<Integer> stackPush; Stack<Integer> stackPop; public TwoStackQueue() { this.stackPush = new Stack<Integer>(); this.stackPop = new Stack<Integer>(); } public void pushToPop(){ if(this.stackPop.isEmpty()){ while (!this.stackPush.isEmpty()){ this.stackPop.push(this.stackPush.pop()); } } } public void add(int newData){ this.stackPush.push(newData); } public int poll(){ if(this.stackPush.isEmpty() && this.stackPop.isEmpty()){ throw new RuntimeException("empty"); } pushToPop(); return this.stackPop.pop(); } public int peek(){ if(this.stackPush.isEmpty() && this.stackPop.isEmpty()){ throw new RuntimeException("empty"); } pushToPop(); return this.stackPop.peek(); } }
[ "17888836862@163.com" ]
17888836862@163.com
fbe509b43990529d52719f455e55ef66a884d929
503fbed63bf8319165de4db448fd439ab2319b89
/Assignment 1/src/binarysearchtree/Program.java
852d23e1a507ec1dac6fddf798dbd0f19af53b0b
[]
no_license
jrosenqvist/1DV516-Algorithms-and-Advanced-Data-Structures
a33fd322013b70582a9b0e003ad26db5b8c7ddc0
6e83b8b82e6a584d878f559541e30c8dda2a33ec
refs/heads/master
2022-11-21T01:37:01.949189
2020-07-11T18:16:42
2020-07-11T18:16:42
215,030,762
0
0
null
null
null
null
UTF-8
Java
false
false
679
java
package assignment1.binarysearchtree; public class Program { public static void main(String[] args) { MyIntegerBST bst = new MyIntegerBST(); bst.insert(10); bst.insert(7); bst.insert(20); bst.insert(25); bst.insert(9); bst.insert(4); bst.insert(8); System.out.println(bst.mostSimilarValue(18)); System.out.println(bst.mostSimilarValue(21)); System.out.println(bst.mostSimilarValue(24)); System.out.println(bst.mostSimilarValue(1)); System.out.println(bst.mostSimilarValue(9)); System.out.println(bst.mostSimilarValue(15)); bst.printByLevels(); } }
[ "jr222wb@student.lnu.se" ]
jr222wb@student.lnu.se
bff9e2b77a74561a2223d327144a8ee283740439
3c74645a028828a53d747ffe119d4c376cc671cf
/testsforAPP/src/edu/udel/jatlas/gameframework/Action.java
698ad37a899df686d7a1c5c370170f8bba71644e
[]
no_license
nstoltzfus3/testingPredictions
681b42f3163ffb0e0e8343566f8ed054981928ef
65cc087a632c45ddf8f15668255ed2800eb37b4e
refs/heads/master
2021-01-15T22:29:30.662699
2015-05-05T03:46:44
2015-05-05T03:46:44
35,075,798
1
0
null
null
null
null
UTF-8
Java
false
false
555
java
package edu.udel.jatlas.gameframework; /** * An Action is something that a player can perform * on a game model. * * @author jatlas * * @param <G> */ public interface Action<G extends Game> { /** * Returns true if this Action is valid to perform * on the given state of the game * * @param game * @return */ public boolean isValid(G game); /** * Mutates state of the game according to the properties * of this Action * * @param game */ public void update(G game); }
[ "nstoltzfus3@gatech.edu" ]
nstoltzfus3@gatech.edu
3bb72da2844e7ad2dd09616ac88e109ed83ef040
07288ba192b18cd607b5dc803eadf419e66f7562
/src/GameScreen.java
39916091bd068b3fe8fe429b4da45a9ab2d0826d
[]
no_license
Emmaloto/BallPaddleGame
2ba1c0c199386b199eccc7b7510a4fc9165d2697
4352f3cb56efd4931a98538018cd58f24ab9e5cf
refs/heads/master
2020-03-22T06:25:05.704073
2018-07-03T20:21:02
2018-07-03T20:21:02
139,632,405
0
0
null
null
null
null
UTF-8
Java
false
false
1,447
java
import java.awt.Graphics; import java.awt.Image; import javax.swing.ImageIcon; public class GameScreen { private Image box = new ImageIcon(getClass().getResource("pics/pause.png")).getImage(), resume = new ImageIcon(getClass().getResource("pics/sprites/textresume.png")).getImage(); //pausetext = new ImageIcon(getClass().getResource("pics/sprites/textpause.png")).getImage(); private boolean paused = false; private int w, h; public GameScreen(){ //g.drawImage(pausetext, 580, -100, 350, 250, null); w = box.getWidth(null); h = box.getHeight(null); } public void draw(Graphics ga, double scaleX, double scaleY){ /* int scaleX = (int)sx; int scaleY = (int)sy; */ if(paused){ ga.drawImage(box, (int)(90 * scaleX), (int)(150*scaleY), (int)(820 *scaleX), (int)(450*scaleY), null); ga.drawImage(resume, (int)(200 *scaleX), (int)(150*scaleY), (int)(w*scaleX), (int)(h*scaleY), null); /* System.out.println("scaleX => "+ (int)(200 *scaleX)); System.out.println("scaleX factor => "+ scaleX); System.out.println("scaleX factor => "+ scaleX); */ } } public void pauseScreen(){ //if(paused){ /*g.drawString("Press R to Resume", 200, 340); g.drawString("Press P to Pause" , 200, 380);*/ //} paused = true; } public void continueGame(){ paused = false; } public void startScreen(){ } }
[ "icyblaze16@gmail.com" ]
icyblaze16@gmail.com
291d837a12fba4fdaaf20c6d2968d6ecfb0da7c0
d512607699980d46fd43ec733d9d811a7465c4b7
/app/src/main/java/io/almayce/dev/app24awd/global/SchedulersTransformer.java
b9e186cdca457a70f82f6b7a1be303a080c72a71
[]
no_license
almayce/24awd
9103ad055143dcac951ad854b5824e6ade8eb042
b8916187a74ab4a19db7b7f1f767d8cf2e0090f5
refs/heads/master
2021-08-08T07:39:12.684169
2017-11-09T22:02:00
2017-11-09T22:02:00
107,049,404
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
package io.almayce.dev.app24awd.global; import io.reactivex.Observable; import io.reactivex.ObservableSource; import io.reactivex.ObservableTransformer; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; /** * Created by almayce on 26.06.17. */ public class SchedulersTransformer<T> implements ObservableTransformer<T, T> { @Override public ObservableSource<T> apply(Observable<T> upstream) { return upstream .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()); } }
[ "kolchsta@gmail.com" ]
kolchsta@gmail.com
823c34b05a9a86d8765d196c2d08ac9e05437a11
37262bb7acf93b952596896423185e1727606752
/src/main/java/co/junwei/bswabe/Bswabe.java
e29acc4965731b09577ebf35e273bcf7243f408e
[]
no_license
technomad21c/Java_CP-ABE_Encryption
77eca6089cbca943174b20929721f0f1b1d5eb29
c07b69593b3b9505f94bbfda6e022c6d8ddbbb8a
refs/heads/master
2022-02-24T19:24:05.074507
2019-09-17T16:28:26
2019-09-17T16:28:26
209,083,068
1
0
null
null
null
null
UTF-8
Java
false
false
16,443
java
package co.junwei.bswabe; import it.unisa.dia.gas.jpbc.CurveParameters; import it.unisa.dia.gas.jpbc.Element; import it.unisa.dia.gas.jpbc.Pairing; import it.unisa.dia.gas.plaf.jpbc.pairing.DefaultCurveParameters; import it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory; import java.io.ByteArrayInputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; public class Bswabe implements java.io.Serializable { /* * Generate a public key and corresponding master secret key. */ private static String curveParams = "type a\n" + "q 87807107996633125224377819847540498158068831994142082" + "1102865339926647563088022295707862517942266222142315585" + "8769582317459277713367317481324925129998224791\n" + "h 12016012264891146079388821366740534204802954401251311" + "822919615131047207289359704531102844802183906537786776\n" + "r 730750818665451621361119245571504901405976559617\n" + "exp2 159\n" + "exp1 107\n" + "sign1 1\n" + "sign0 1\n"; public static void setup(BswabePub pub, BswabeMsk msk) { Element alpha, beta_inv; CurveParameters params = new DefaultCurveParameters() .load(new ByteArrayInputStream(curveParams.getBytes())); pub.pairingDesc = curveParams; pub.p = PairingFactory.getPairing(params); Pairing pairing = pub.p; pub.g = pairing.getG1().newElement(); pub.f = pairing.getG1().newElement(); pub.h = pairing.getG1().newElement(); pub.gp = pairing.getG2().newElement(); pub.g_hat_alpha = pairing.getGT().newElement(); alpha = pairing.getZr().newElement(); msk.beta = pairing.getZr().newElement(); msk.g_alpha = pairing.getG2().newElement(); alpha.setToRandom(); msk.beta.setToRandom(); pub.g.setToRandom(); pub.gp.setToRandom(); msk.g_alpha = pub.gp.duplicate(); msk.g_alpha.powZn(alpha); beta_inv = msk.beta.duplicate(); beta_inv.invert(); pub.f = pub.g.duplicate(); pub.f.powZn(beta_inv); pub.h = pub.g.duplicate(); pub.h.powZn(msk.beta); pub.g_hat_alpha = pairing.pairing(pub.g, msk.g_alpha); } /* * Generate a private key with the given set of attributes. */ public static BswabePrv keygen(BswabePub pub, BswabeMsk msk, String[] attrs) throws NoSuchAlgorithmException { BswabePrv prv = new BswabePrv(); Element g_r, r, beta_inv; Pairing pairing; /* initialize */ pairing = pub.p; prv.d = pairing.getG2().newElement(); g_r = pairing.getG2().newElement(); r = pairing.getZr().newElement(); beta_inv = pairing.getZr().newElement(); /* compute */ r.setToRandom(); g_r = pub.gp.duplicate(); g_r.powZn(r); prv.d = msk.g_alpha.duplicate(); prv.d.mul(g_r); beta_inv = msk.beta.duplicate(); beta_inv.invert(); prv.d.powZn(beta_inv); int i, len = attrs.length; prv.comps = new ArrayList<BswabePrvComp>(); for (i = 0; i < len; i++) { BswabePrvComp comp = new BswabePrvComp(); Element h_rp; Element rp; comp.attr = attrs[i]; comp.d = pairing.getG2().newElement(); comp.dp = pairing.getG1().newElement(); h_rp = pairing.getG2().newElement(); rp = pairing.getZr().newElement(); elementFromString(h_rp, comp.attr); rp.setToRandom(); h_rp.powZn(rp); comp.d = g_r.duplicate(); comp.d.mul(h_rp); comp.dp = pub.g.duplicate(); comp.dp.powZn(rp); prv.comps.add(comp); } return prv; } /* * Delegate a subset of attribute of an existing private key. */ public static BswabePrv delegate(BswabePub pub, BswabePrv prv_src, String[] attrs_subset) throws NoSuchAlgorithmException, IllegalArgumentException { BswabePrv prv = new BswabePrv(); Element g_rt, rt, f_at_rt; Pairing pairing; /* initialize */ pairing = pub.p; prv.d = pairing.getG2().newElement(); g_rt = pairing.getG2().newElement(); rt = pairing.getZr().newElement(); f_at_rt = pairing.getZr().newElement(); /* compute */ rt.setToRandom(); f_at_rt = pub.f.duplicate(); f_at_rt.powZn(rt); prv.d = prv_src.d.duplicate(); prv.d.mul(f_at_rt); g_rt = pub.g.duplicate(); g_rt.powZn(rt); int i, len = attrs_subset.length; prv.comps = new ArrayList<BswabePrvComp>(); for (i = 0; i < len; i++) { BswabePrvComp comp = new BswabePrvComp(); Element h_rtp; Element rtp; comp.attr = attrs_subset[i]; BswabePrvComp comp_src = new BswabePrvComp(); boolean comp_src_init = false; for (int j = 0; j < prv_src.comps.size(); ++j) { if (prv_src.comps.get(j).attr == comp.attr) { comp_src = prv_src.comps.get(j); comp_src_init = true; break; } } if (comp_src_init == false) { throw new IllegalArgumentException("comp_src_init == false"); } comp.d = pairing.getG2().newElement(); comp.dp = pairing.getG1().newElement(); h_rtp = pairing.getG2().newElement(); rtp = pairing.getZr().newElement(); elementFromString(h_rtp, comp.attr); rtp.setToRandom(); h_rtp.powZn(rtp); comp.d = g_rt.duplicate(); comp.d.mul(h_rtp); comp.d.mul(comp_src.d); comp.dp = pub.g.duplicate(); comp.dp.powZn(rtp); comp.dp.mul(comp_src.dp); prv.comps.add(comp); } return prv; } /* * Pick a random group element and encrypt it under the specified access * policy. The resulting ciphertext is returned and the Element given as an * argument (which need not be initialized) is set to the random group * element. * * After using this function, it is normal to extract the random data in m * using the pbc functions element_length_in_bytes and element_to_bytes and * use it as a key for hybrid encryption. * * The policy is specified as a simple string which encodes a postorder * traversal of threshold tree defining the access policy. As an example, * * "foo bar fim 2of3 baf 1of2" * * specifies a policy with two threshold gates and four leaves. It is not * possible to specify an attribute with whitespace in it (although "_" is * allowed). * * Numerical attributes and any other fancy stuff are not supported. * * Returns null if an error occured, in which case a description can be * retrieved by calling bswabe_error(). */ public static BswabeCphKey enc(BswabePub pub, String policy) throws Exception { BswabeCphKey keyCph = new BswabeCphKey(); BswabeCph cph = new BswabeCph(); Element s, m; /* initialize */ Pairing pairing = pub.p; s = pairing.getZr().newElement(); m = pairing.getGT().newElement(); cph.cs = pairing.getGT().newElement(); cph.c = pairing.getG1().newElement(); cph.p = parsePolicyPostfix(policy); /* compute */ m.setToRandom(); s.setToRandom(); cph.cs = pub.g_hat_alpha.duplicate(); cph.cs.powZn(s); /* num_exps++; */ cph.cs.mul(m); /* num_muls++; */ cph.c = pub.h.duplicate(); cph.c.powZn(s); /* num_exps++; */ fillPolicy(cph.p, pub, s); keyCph.cph = cph; keyCph.key = m; return keyCph; } /* * Decrypt the specified ciphertext using the given private key, filling in * the provided element m (which need not be initialized) with the result. * * Returns true if decryption succeeded, false if this key does not satisfy * the policy of the ciphertext (in which case m is unaltered). */ public static BswabeElementBoolean dec(BswabePub pub, BswabePrv prv, BswabeCph cph) { Element t; Element m; BswabeElementBoolean beb = new BswabeElementBoolean(); m = pub.p.getGT().newElement(); t = pub.p.getGT().newElement(); checkSatisfy(cph.p, prv); if (!cph.p.satisfiable) { System.err .println("cannot decrypt, attributes in key do not satisfy policy"); beb.e = null; beb.b = false; return beb; } pickSatisfyMinLeaves(cph.p, prv); decFlatten(t, cph.p, prv, pub); m = cph.cs.duplicate(); m.mul(t); /* num_muls++; */ t = pub.p.pairing(cph.c, prv.d); t.invert(); m.mul(t); /* num_muls++; */ beb.e = m; beb.b = true; return beb; } private static void decFlatten(Element r, BswabePolicy p, BswabePrv prv, BswabePub pub) { Element one; one = pub.p.getZr().newElement(); one.setToOne(); r.setToOne(); decNodeFlatten(r, one, p, prv, pub); } private static void decNodeFlatten(Element r, Element exp, BswabePolicy p, BswabePrv prv, BswabePub pub) { if (p.children == null || p.children.length == 0) decLeafFlatten(r, exp, p, prv, pub); else decInternalFlatten(r, exp, p, prv, pub); } private static void decLeafFlatten(Element r, Element exp, BswabePolicy p, BswabePrv prv, BswabePub pub) { BswabePrvComp c; Element s, t; c = prv.comps.get(p.attri); s = pub.p.getGT().newElement(); t = pub.p.getGT().newElement(); s = pub.p.pairing(p.c, c.d); /* num_pairings++; */ t = pub.p.pairing(p.cp, c.dp); /* num_pairings++; */ t.invert(); s.mul(t); /* num_muls++; */ s.powZn(exp); /* num_exps++; */ r.mul(s); /* num_muls++; */ } private static void decInternalFlatten(Element r, Element exp, BswabePolicy p, BswabePrv prv, BswabePub pub) { int i; Element t, expnew; t = pub.p.getZr().newElement(); expnew = pub.p.getZr().newElement(); for (i = 0; i < p.satl.size(); i++) { lagrangeCoef(t, p.satl, (p.satl.get(i)).intValue()); expnew = exp.duplicate(); expnew.mul(t); decNodeFlatten(r, expnew, p.children[p.satl.get(i) - 1], prv, pub); } } private static void lagrangeCoef(Element r, ArrayList<Integer> s, int i) { int j, k; Element t; t = r.duplicate(); r.setToOne(); for (k = 0; k < s.size(); k++) { j = s.get(k).intValue(); if (j == i) continue; t.set(-j); r.mul(t); /* num_muls++; */ t.set(i - j); t.invert(); r.mul(t); /* num_muls++; */ } } private static void pickSatisfyMinLeaves(BswabePolicy p, BswabePrv prv) { int i, k, l, c_i; int len; ArrayList<Integer> c = new ArrayList<Integer>(); if (p.children == null || p.children.length == 0) p.min_leaves = 1; else { len = p.children.length; for (i = 0; i < len; i++) if (p.children[i].satisfiable) pickSatisfyMinLeaves(p.children[i], prv); for (i = 0; i < len; i++) c.add(new Integer(i)); Collections.sort(c, new IntegerComparator(p)); p.satl = new ArrayList<Integer>(); p.min_leaves = 0; l = 0; for (i = 0; i < len && l < p.k; i++) { c_i = c.get(i).intValue(); /* c[i] */ if (p.children[c_i].satisfiable) { l++; p.min_leaves += p.children[c_i].min_leaves; k = c_i + 1; p.satl.add(new Integer(k)); } } } } private static void checkSatisfy(BswabePolicy p, BswabePrv prv) { int i, l; String prvAttr; p.satisfiable = false; if (p.children == null || p.children.length == 0) { for (i = 0; i < prv.comps.size(); i++) { prvAttr = prv.comps.get(i).attr; // System.out.println("prvAtt:" + prvAttr); // System.out.println("p.attr" + p.attr); if (prvAttr.compareTo(p.attr) == 0) { // System.out.println("=staisfy="); p.satisfiable = true; p.attri = i; break; } } } else { for (i = 0; i < p.children.length; i++) checkSatisfy(p.children[i], prv); l = 0; for (i = 0; i < p.children.length; i++) if (p.children[i].satisfiable) l++; if (l >= p.k) p.satisfiable = true; } } private static void fillPolicy(BswabePolicy p, BswabePub pub, Element e) throws NoSuchAlgorithmException { int i; Element r, t, h; Pairing pairing = pub.p; r = pairing.getZr().newElement(); t = pairing.getZr().newElement(); h = pairing.getG2().newElement(); p.q = randPoly(p.k - 1, e); if (p.children == null || p.children.length == 0) { p.c = pairing.getG1().newElement(); p.cp = pairing.getG2().newElement(); elementFromString(h, p.attr); p.c = pub.g.duplicate();; p.c.powZn(p.q.coef[0]); p.cp = h.duplicate(); p.cp.powZn(p.q.coef[0]); } else { for (i = 0; i < p.children.length; i++) { r.set(i + 1); evalPoly(t, p.q, r); fillPolicy(p.children[i], pub, t); } } } private static void evalPoly(Element r, BswabePolynomial q, Element x) { int i; Element s, t; s = r.duplicate(); t = r.duplicate(); r.setToZero(); t.setToOne(); for (i = 0; i < q.deg + 1; i++) { /* r += q->coef[i] * t */ s = q.coef[i].duplicate(); s.mul(t); r.add(s); /* t *= x */ t.mul(x); } } private static BswabePolynomial randPoly(int deg, Element zeroVal) { int i; BswabePolynomial q = new BswabePolynomial(); q.deg = deg; q.coef = new Element[deg + 1]; for (i = 0; i < deg + 1; i++) q.coef[i] = zeroVal.duplicate(); q.coef[0].set(zeroVal); for (i = 1; i < deg + 1; i++) q.coef[i].setToRandom(); return q; } private static BswabePolicy parsePolicyPostfix(String s) throws Exception { String[] toks; String tok; ArrayList<BswabePolicy> stack = new ArrayList<BswabePolicy>(); BswabePolicy root; toks = s.split(" "); int toks_cnt = toks.length; for (int index = 0; index < toks_cnt; index++) { int i, k, n; tok = toks[index]; if (!tok.contains("of")) { stack.add(baseNode(1, tok)); } else { BswabePolicy node; /* parse kof n node */ String[] k_n = tok.split("of"); k = Integer.parseInt(k_n[0]); n = Integer.parseInt(k_n[1]); if (k < 1) { System.out.println("error parsing " + s + ": trivially satisfied operator " + tok); return null; } else if (k > n) { System.out.println("error parsing " + s + ": unsatisfiable operator " + tok); return null; } else if (n == 1) { System.out.println("error parsing " + s + ": indentity operator " + tok); return null; } else if (n > stack.size()) { System.out.println("error parsing " + s + ": stack underflow at " + tok); return null; } /* pop n things and fill in children */ node = baseNode(k, null); node.children = new BswabePolicy[n]; for (i = n - 1; i >= 0; i--) node.children[i] = stack.remove(stack.size() - 1); /* push result */ stack.add(node); } } if (stack.size() > 1) { System.out.println("error parsing " + s + ": extra node left on the stack"); return null; } else if (stack.size() < 1) { System.out.println("error parsing " + s + ": empty policy"); return null; } root = stack.get(0); return root; } private static BswabePolicy baseNode(int k, String s) { BswabePolicy p = new BswabePolicy(); p.k = k; if (!(s == null)) p.attr = s; else p.attr = null; p.q = null; return p; } private static void elementFromString(Element h, String s) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA-1"); byte[] digest = md.digest(s.getBytes()); h.setFromHash(digest, 0, digest.length); } private static class IntegerComparator implements Comparator<Integer> { BswabePolicy policy; public IntegerComparator(BswabePolicy p) { this.policy = p; } @Override public int compare(Integer o1, Integer o2) { int k, l; k = policy.children[o1.intValue()].min_leaves; l = policy.children[o2.intValue()].min_leaves; return k < l ? -1 : k == l ? 0 : 1; } } }
[ "brandon@highmarkglobal.tech" ]
brandon@highmarkglobal.tech
87c6bb66dc933e8c53e170b49a61e9cce34048cc
3aae41809d3b00b4e5aec0d00668677966388bb8
/archer-custom-mybatis/src/test/java/com/luo/ibatis/io/ResourcesTest.java
960b72f48a28f2a33e60cf4b6da27f3e8eda054f
[]
no_license
RononoaZoro/mybatis-book
1e7a91d047ae3242d01af9e5ae2e76e2fcdf1a9d
dd701aa8dcbb83d410d6ee7e9d27375a36de1b2c
refs/heads/master
2023-05-25T09:34:13.633092
2021-06-11T06:11:05
2021-06-11T06:11:05
359,652,581
0
0
null
null
null
null
UTF-8
Java
false
false
5,661
java
/** * Copyright 2009-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.luo.ibatis.io; import com.luo.ibatis.BaseDataTest; import org.junit.Test; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.net.URL; import java.nio.charset.Charset; import java.util.Properties; import static org.junit.Assert.*; public class ResourcesTest extends BaseDataTest { private static final ClassLoader CLASS_LOADER = ResourcesTest.class.getClassLoader(); @Test public void shouldGetUrlForResource() throws Exception { URL url = ArcherResources.getResourceURL(JPETSTORE_PROPERTIES); assertTrue(url.toString().endsWith("jpetstore/jpetstore-hsqldb.properties")); } @Test public void shouldGetUrlAsProperties() throws Exception { URL url = ArcherResources.getResourceURL(CLASS_LOADER, JPETSTORE_PROPERTIES); Properties props = ArcherResources.getUrlAsProperties(url.toString()); assertNotNull(props.getProperty("driver")); } @Test public void shouldGetResourceAsProperties() throws Exception { Properties props = ArcherResources.getResourceAsProperties(CLASS_LOADER, JPETSTORE_PROPERTIES); assertNotNull(props.getProperty("driver")); } @Test public void shouldGetUrlAsStream() throws Exception { URL url = ArcherResources.getResourceURL(CLASS_LOADER, JPETSTORE_PROPERTIES); try (InputStream in = ArcherResources.getUrlAsStream(url.toString())) { assertNotNull(in); } } @Test public void shouldGetUrlAsReader() throws Exception { URL url = ArcherResources.getResourceURL(CLASS_LOADER, JPETSTORE_PROPERTIES); try (Reader in = ArcherResources.getUrlAsReader(url.toString())) { assertNotNull(in); } } @Test public void shouldGetResourceAsStream() throws Exception { try (InputStream in = ArcherResources.getResourceAsStream(CLASS_LOADER, JPETSTORE_PROPERTIES)) { assertNotNull(in); } } @Test public void shouldGetResourceAsReader() throws Exception { try(Reader in = ArcherResources.getResourceAsReader(CLASS_LOADER, JPETSTORE_PROPERTIES)) { assertNotNull(in); } } @Test public void shouldGetResourceAsFile() throws Exception { File file = ArcherResources.getResourceAsFile(JPETSTORE_PROPERTIES); assertTrue(file.getAbsolutePath().replace('\\', '/').endsWith("jpetstore/jpetstore-hsqldb.properties")); } @Test public void shouldGetResourceAsFileWithClassloader() throws Exception { File file = ArcherResources.getResourceAsFile(CLASS_LOADER, JPETSTORE_PROPERTIES); assertTrue(file.getAbsolutePath().replace('\\', '/').endsWith("jpetstore/jpetstore-hsqldb.properties")); } @Test public void shouldGetResourceAsPropertiesWithOutClassloader() throws Exception { Properties file = ArcherResources.getResourceAsProperties(JPETSTORE_PROPERTIES); assertNotNull(file); } @Test public void shouldGetResourceAsPropertiesWithClassloader() throws Exception { Properties file = ArcherResources.getResourceAsProperties(CLASS_LOADER, JPETSTORE_PROPERTIES); assertNotNull(file); } @Test public void shouldAllowDefaultClassLoaderToBeSet() { ArcherResources.setDefaultClassLoader(this.getClass().getClassLoader()); assertEquals(this.getClass().getClassLoader(), ArcherResources.getDefaultClassLoader()); } @Test public void shouldAllowDefaultCharsetToBeSet() { ArcherResources.setCharset(Charset.defaultCharset()); assertEquals(Charset.defaultCharset(), ArcherResources.getCharset()); } @Test public void shouldGetClassForName() throws Exception { Class<?> clazz = ArcherResources.classForName(ResourcesTest.class.getName()); assertNotNull(clazz); } @Test(expected = ClassNotFoundException.class) public void shouldNotFindThisClass() throws ClassNotFoundException { ArcherResources.classForName("some.random.class.that.does.not.Exist"); } @Test public void shouldGetReader() throws IOException { // save the value Charset charset = ArcherResources.getCharset(); // charset ArcherResources.setCharset(Charset.forName("US-ASCII")); assertNotNull(ArcherResources.getResourceAsReader(JPETSTORE_PROPERTIES)); // no charset ArcherResources.setCharset(null); assertNotNull(ArcherResources.getResourceAsReader(JPETSTORE_PROPERTIES)); // clean up ArcherResources.setCharset(charset); } @Test public void shouldGetReaderWithClassLoader() throws IOException { // save the value Charset charset = ArcherResources.getCharset(); // charset ArcherResources.setCharset(Charset.forName("US-ASCII")); assertNotNull(ArcherResources.getResourceAsReader(getClass().getClassLoader(), JPETSTORE_PROPERTIES)); // no charset ArcherResources.setCharset(null); assertNotNull(ArcherResources.getResourceAsReader(getClass().getClassLoader(), JPETSTORE_PROPERTIES)); // clean up ArcherResources.setCharset(charset); } @Test public void stupidJustForCoverage() { assertNotNull(new ArcherResources()); } }
[ "luoxz@akulaku.com" ]
luoxz@akulaku.com
2e9a1031118d2ab4961fec12b6d519a0f9a7a372
a53f266293e1fa3eaef5cea3c6d4c3195a2551cb
/src/java_20210510/Employee.java
243be3ae639b3974a550c4bd43e0e740f9e95798
[]
no_license
CHOHEEJEONG/java_fundametal
201528c0861702e46cadf86d66098c1a57e220d4
372914050d8d4ace637338a94d56f14d6f90f34b
refs/heads/master
2023-05-26T21:22:44.582277
2021-06-10T10:56:45
2021-06-10T10:56:45
365,913,801
0
0
null
null
null
null
UTF-8
Java
false
false
145
java
package java_20210510; public class Employee extends Customer { String zipcode; String addr1; String addr2; String id; String pwd; }
[ "chohee0505@gmail.com" ]
chohee0505@gmail.com
f68911450d886cd8297e0647f89810fd40286568
0730dfdd78051dbd21799273ce838891eea94b74
/src/main/java/com/gmail/ak1cec0ld/plugins/spongeexample/storage/UsagePermission.java
fd3fb022a86821147e970b1a7ee661d01c1fcd73
[]
no_license
1cec0ld/spongeexample
1b848fcccef7ca0f7ebd23498beb0ad8a94ede76
eb1e182845914497bca9853346927847f598f923
refs/heads/master
2022-12-26T16:03:42.886288
2020-07-26T04:16:26
2020-07-26T04:16:26
277,622,296
0
0
null
2020-10-13T23:21:55
2020-07-06T18:45:54
Java
UTF-8
Java
false
false
711
java
package com.gmail.ak1cec0ld.plugins.spongeexample.storage; import org.spongepowered.api.Sponge; import org.spongepowered.api.entity.living.player.Player; public class UsagePermission { public static boolean checkPlayer(Player player, String region){ return player.hasPermission(region + ".used"); } public static void setPlayer(Player player, String region){ StringBuilder builder = new StringBuilder(); builder.append("lp user ") .append(player.getName()) .append(" permission set ") .append(region+".used true"); Sponge.getCommandManager().process(Sponge.getServer().getConsole(), builder.toString()); } }
[ "1cew1r3@gmail.com" ]
1cew1r3@gmail.com
a9ec35dfecb6c30495f176cb02ff5c3707d25743
218ac397b44e04ca327740ffebc01e734e1808aa
/linkedlist/Project1.java
330a7547529e56b52e7a9a2c5c68fef81f2ee707
[]
no_license
tyd951/school_projects
b4f39d2fdb92359e86878ca533e852f2f6dded87
67a77d51d45b6b53979b566ba201f0ea500578a0
refs/heads/master
2021-09-14T05:36:37.527323
2018-05-08T18:14:27
2018-05-08T18:14:27
113,699,949
0
0
null
null
null
null
UTF-8
Java
false
false
1,196
java
import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; /** * * @author Yida * */ public class Project1 { public static void main(String[] args) { LinkedList LL = new LinkedList(); Scanner sc = null; BufferedWriter bw = null; FileWriter fw = null; String s; try { sc = new Scanner(new File(args[0])); } catch (FileNotFoundException e) { e.printStackTrace(); System.out.println("Cant find the file" + args[0]); } try { fw = new FileWriter(args[1]); bw = new BufferedWriter(fw); bw.write(LL.print()); bw.newLine(); while(sc.hasNext()) { //System.out.println(LL.print()); LL.insert(sc.next()); bw.write(LL.print()); bw.newLine(); } } catch (IOException e) { e.printStackTrace(); } sc.close(); try { bw.close(); fw.close(); } catch (IOException e) { e.printStackTrace(); } //System.out.println("Done"); /* testing code LL.print(); LL.insert("asdasd"); LL.print(); LL.insert("hello"); LL.print(); LL.insert("aaaa"); LL.print(); */ }//main }//class
[ "tyd951@gmail.com" ]
tyd951@gmail.com
f8640cd840adab1e1b42f011c72e057c2f77e321
3379ab113d77ba33406dbbb38b98aae0309651e3
/app/src/main/java/com/returnlive/app/view/PCDPopUpWindow.java
37595dee09ed5bc2fa1c236781d01305790ff53c
[]
no_license
zhangzibinAndroid/Wuliu
39be46ab72b51615e7ac3723bddac429bb624471
54cc12d3cbe0bd09be4ca63722e4b842c101098b
refs/heads/master
2020-12-30T17:10:40.410892
2017-05-12T06:14:02
2017-05-12T06:14:02
91,057,844
0
0
null
null
null
null
UTF-8
Java
false
false
13,095
java
package com.returnlive.app.view; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.graphics.drawable.ColorDrawable; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.View; import android.view.WindowManager; import android.widget.AdapterView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.PopupWindow; import com.returnlive.app.R; import com.returnlive.app.adapter.PcdGoodsAdapter; import com.returnlive.app.bean.AreaBean; import com.returnlive.app.fragment.goods.GoodsFragment; import java.io.File; import java.util.ArrayList; import java.util.List; /** * Create by phoche on 16-8-12 */ public class PCDPopUpWindow extends PopupWindow implements AdapterView.OnItemClickListener { private final String mTable_province = "province"; private final String mTable_city = "city"; private final String mTable_district = "district"; private final int mLoad_province = 100; private final int mLoad_city = 101; private final int mLoad_district = 102; private File mDbFile; //城市数据库的目录 private Context mContext; private View mView; private ListView mLv_province; // 省列表 private ListView mLv_city; // 城市列表 private ListView mLv_district; // 地区列表 private int proCityPosition = -1; // 上一个城市的索引 private int proProvincePosition = -1; // 上一个省的索引 private int proDistrictPosition = -1; // 上一个地区的索引 private List<AreaBean> mProvinceDatas = new ArrayList<>(); // 省份集合 private List<AreaBean> mCityDatas = new ArrayList<>(); // 城市集合 private List<AreaBean> mDistrictDatas = new ArrayList<>(); // 地区集合 private PcdGoodsAdapter mCityAdapter; private PcdGoodsAdapter mProvinceAdapter; private PcdGoodsAdapter mDistrictAdapter; private final OnCheckChangeListener mOnCheckChangeListener; public static int NUM;//定一个常量,为了点击区、县时关闭对话框 /** * 用来对listview设置adapter的handler */ private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { List<AreaBean> list = (List<AreaBean>) msg.obj; AreaBean bean = new AreaBean("不限---"); switch (msg.what) { case mLoad_province: // 加载省列表 mProvinceDatas.addAll(list); mProvinceAdapter = new PcdGoodsAdapter(mContext, mProvinceDatas); mLv_province.setAdapter(mProvinceAdapter); break; case mLoad_city: // 加载城市列表 mCityDatas.addAll(list); mCityAdapter = new PcdGoodsAdapter(mContext, mCityDatas); mCityAdapter.addDate(0, bean); mLv_city.setAdapter(mCityAdapter); break; case mLoad_district: // 加载地区列表 mDistrictDatas.addAll(list); mDistrictAdapter = new PcdGoodsAdapter(mContext, mDistrictDatas); mDistrictAdapter.addDate(0, bean); mLv_district.setAdapter(mDistrictAdapter); break; } } }; public SQLiteDatabase mDb; private AreaBean provinceAreaBean; private AreaBean cityAreaBean; private AreaBean districtAreaBean; // 因为要先初始化数据库 // 所以数据库文件在创建PopUpWindow时传入 public PCDPopUpWindow(Context context, File file, OnCheckChangeListener listener) { this.mDbFile = file; this.mContext = context; this.mOnCheckChangeListener = listener; // PopUpWindow的布局由三个ListView组成 mView = View.inflate(mContext, R.layout.pop_goods_pcd_listview, null); setContentView(mView); // 设置宽高 setWidth(LinearLayout.LayoutParams.WRAP_CONTENT); setHeight(LinearLayout.LayoutParams.WRAP_CONTENT); // 使其可点击 // 点击外部可以消失 setFocusable(true); setTouchable(true); setOutsideTouchable(true); setBackgroundDrawable(new ColorDrawable()); setOnDismissListener(new PopupWindow.OnDismissListener() { @Override public void onDismiss() { Log.e("6666666666666", "onDismiss: " + mDb); mDb.close(); } }); initView(); initEvent(); // 先初始化省的列表 loadCityData(mTable_province, null); } public void initEvent() { mLv_province.setOnItemClickListener(this); mLv_city.setOnItemClickListener(this); mLv_district.setOnItemClickListener(this); } private void initView() { mLv_province = (ListView) mView.findViewById(R.id.lv_province); mLv_city = (ListView) mView.findViewById(R.id.lv_city); mLv_district = (ListView) mView.findViewById(R.id.lv_district); } /** * 选择地区的事件 * * @param parent * @param view * @param position * @param id */ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { switch (parent.getId()) { case R.id.lv_province: NUM = 1;//定一个常量,为了点击区、县时关闭对话框 // 并将城市的前一个索引设为-1,防止选择城市只有一个的省时发生越界 if (mOnCheckChangeListener != null) { // mOnCheckChangeListener.setCityText(""); // mOnCheckChangeListener.setDistrictText(""); } // 点击省份列表时要将城市和地区的数据清空 mDistrictDatas.clear(); mCityDatas.clear(); proCityPosition = -1; // 根据是否有上一个选择的省份 // 有的话就将上的状态置为false,以改变背景 if (proProvincePosition != -1) { AreaBean proAreaBean = (AreaBean) parent.getItemAtPosition(proProvincePosition); proAreaBean.isChoose = false; } // 将当前的省份赋给上一个省份 // 并把当前的状态设为已选中 proProvincePosition = position; provinceAreaBean = (AreaBean) parent.getItemAtPosition(position); provinceAreaBean.isChoose = true; // 监听选择的省份,把数据用接口传给MainActivity //设置地区 if (mOnCheckChangeListener != null) { mOnCheckChangeListener.setProvinceText("" + provinceAreaBean.name); } // 更新省份的ListView mProvinceAdapter.notifyDataSetChanged(); // 根据当前省数据的code加载城市列表 // 从数据库中查询城市数据 loadCityData(mTable_city, provinceAreaBean.code); break; case R.id.lv_city: NUM = 2;//定一个常量,为了点击区、县时关闭对话框 // 选择城市列表需要将之前选择的地区清除 if (mOnCheckChangeListener != null) { // mOnCheckChangeListener.setDistrictText(""); } // 更新城市item的背景 // 同省份 mDistrictDatas.clear(); if (proCityPosition != -1) { AreaBean cityAreaBean = (AreaBean) parent.getItemAtPosition(proCityPosition); cityAreaBean.isChoose = false; } proCityPosition = position; cityAreaBean = (AreaBean) parent.getItemAtPosition(position); cityAreaBean.isChoose = true; //设置地区 if (mOnCheckChangeListener != null) { mOnCheckChangeListener.setCityText(cityAreaBean.name); } /** * 为了添加第一行“不限” */ if (((AreaBean) parent.getItemAtPosition(position)).name == "不限---") { mOnCheckChangeListener.setCityText(provinceAreaBean.name); PCDPopUpWindow.this.dismiss(); } mCityAdapter.notifyDataSetChanged(); // 根据市级数据的code加载区域列表 loadCityData(mTable_district, cityAreaBean.code); break; // 选择地区的item,同省份 case R.id.lv_district: NUM = 3;//定一个常量,为了点击区、县时关闭对话框 if (proDistrictPosition != -1) { AreaBean districtAreaBean = (AreaBean) parent.getItemAtPosition(proDistrictPosition); districtAreaBean.isChoose = false; } proDistrictPosition = position; districtAreaBean = (AreaBean) parent.getItemAtPosition(position); districtAreaBean.isChoose = true; if (mOnCheckChangeListener != null) { //设置地区 mOnCheckChangeListener.setDistrictText(cityAreaBean.name + "-" + districtAreaBean.name); } /** * 为了添加第一行“不限” */ if (((AreaBean) parent.getItemAtPosition(position)).name == "不限---") { mOnCheckChangeListener.setDistrictText(cityAreaBean.name); PCDPopUpWindow.this.dismiss(); } Log.e("0000000000", "onItemClick: " + provinceAreaBean.name.toString() + " " + provinceAreaBean.code.toString()); mDistrictAdapter.notifyDataSetChanged(); //关闭数据库 if (mDb != null) { mDb.close(); } break; } } // 开启线程来加载数据 public void loadCityData(final String table_name, final String pcode) { new Thread() { @Override public void run() { queryPcdDB(table_name, pcode); } }.start(); } /** * 用来点击选择显示文本的回调 */ public interface OnCheckChangeListener { void setCityText(String text); void setProvinceText(String text); void setDistrictText(String text); } /** * 查询数据库的操作 * * @param table 表名 * @param pcode 省市地区的code * @return 各省名称的数据 */ public void queryPcdDB(String table, String pcode) { // 打开已有的数据库文件 if (mDb == null) { mDb = SQLiteDatabase.openDatabase(mDbFile.getAbsolutePath(), null, SQLiteDatabase.OPEN_READWRITE); } List<AreaBean> datas = new ArrayList<>(); String sql = " select name,code from " + table; String[] selectionArgs = null; // 查询省份数据时不需要pcode if (pcode != null) { sql = " select name,code from " + table + " where pcode=" + pcode; } Cursor cursor = mDb.rawQuery(sql, selectionArgs); if (cursor != null) { while (cursor.moveToNext()) { byte[] blob = cursor.getBlob(cursor.getColumnIndex("name")); String name = ""; try { // 由于是在网络上下载的数据库文件,里面的编码不是UTF8的,这里进行的转码 name = new String(blob, "gbk"); } catch (Exception e) { e.printStackTrace(); } String code = cursor.getString(cursor.getColumnIndex("code")); AreaBean areaBean = new AreaBean(name, code); datas.add(areaBean); } } cursor.close(); // 查询在做是在子线程中的,查询结束后发送message设置adapter Message msg = Message.obtain(); msg.obj = datas; switch (table) { case mTable_province: msg.what = mLoad_province; break; case mTable_city: msg.what = mLoad_city; break; case mTable_district: msg.what = mLoad_district; break; } mHandler.sendMessage(msg); } /* @Override public void setOnDismissListener(OnDismissListener onDismissListener) { super.setOnDismissListener(onDismissListener); mDb.close(); }*/ }
[ "2319867935@qq.com" ]
2319867935@qq.com
4bb2145bcbd0f38ccd53a44353e7ed6b59e4ee19
1201c0b2a1c38a16547e8fe95b6e46c08145aacd
/src/Main.java
71756aab3f9326a494394c3728719d9656c70317
[]
no_license
Sergeygaan/MainStack
0beaf13aa75af54c1143054de6fc1e27d7723bf2
d62aecf763796dbde55cd3614f1d8db18e763ce7
refs/heads/master
2021-01-10T15:37:09.883810
2015-12-23T18:02:32
2015-12-23T18:02:32
48,504,116
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
public class Main { public static void main(String[] args) { Stack myStack = new Stack(); OperationsStack OperationStack = new OperationsStack(); WorkStack CurrentStack = new WorkStack(myStack, OperationStack); CurrentStack.PeekStack(); CurrentStack.PushStack(0); CurrentStack.PushStack(10); CurrentStack.PushStack(54.9); CurrentStack.WithdrawStack(); } }
[ "sergeygaan@mail.ru" ]
sergeygaan@mail.ru
9ef4eaf8a1407f0473efb0936c310c138346c4a1
bf1ca2a840ded67fd61e3b52f20bd9fdfccc76c8
/Labs/Lab1/Names.java
07da5878dd7e0a8a8d47de2a46abc781275499a4
[]
no_license
yuanzheng-li/DataStructure
9204184cb909ee5c88fe70d3b804e441335dd57c
a6b4632c7e69ec4b1f20e6084f8b0fbfb875e3aa
refs/heads/master
2021-05-29T18:02:15.627863
2015-09-28T23:59:48
2015-09-28T23:59:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,783
java
/* Names.java */ import java.io.*; /** The Names class provides a single function, main, that will * perform various manipulations of the name John Fitzgerald Kennedy. * This is a modification of the program on page 43 of Arnow and Weiss. */ class Names { /** Performs various string operations on the name John Fitzgerald Kennedy. * @param arg is not used. */ public static void main(String arg[]) { String first = "John"; String middle = "Fitzgerald"; String last = "Kennedy"; String initials; String firstInit, middleInit, lastInit; firstInit = first.substring(0,1); middleInit = middle.substring(0,1); lastInit = last.substring(0,1); initials = firstInit.concat(middleInit); initials = initials.concat(lastInit); System.out.println(); System.out.println(first + " " + middle + " " + last + " "); System.out.println(initials); System.out.println(last + ", " + first + " " + middle); System.out.println(last + ", " + first + " " + middleInit +"."); System.out.println(first.toUpperCase() + " " + last.toUpperCase()); System.out.println(first + " equals john is " + first.equals("john")); System.out.println(first + " equals john (ignoring case) is " + first.equalsIgnoreCase("john")); System.out.println("The character at index 3 in " + middle + " is " + middle.substring(3,4)); System.out.println("The index of \"gerald\" within " + middle + " is " + middle.indexOf("gerald")); System.out.println("The index of \"gerald\" within " + last + " is " + last.indexOf("gerald")); System.out.println(); } }
[ "lyzcharles@gmail.com" ]
lyzcharles@gmail.com
7c8111c59cb1c5b5f504a8aba0d0764558c7063a
f2814c941abb3dd0f33b7948e96d52ff37b05fd0
/SafeMessenger/gen/com/tmdroid/securemessenger/BuildConfig.java
e640735607e35d48b733fa22d1b84415be4f5cd8
[]
no_license
Tomasz93/PKRY
2bc50717425c3911a70b6209f27b7bc8ac2ae778
45a6300f68b4fcde43bce7d5cb28601fd51c4879
refs/heads/master
2021-01-21T13:41:41.329593
2014-12-14T20:41:30
2014-12-14T20:41:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
169
java
/** Automatically generated file. DO NOT MODIFY */ package com.tmdroid.securemessenger; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "tomasz.najda@hotmail.com" ]
tomasz.najda@hotmail.com
4ae51cf7ce34ab8c70d339692a8a6a3bea38a544
28fdfa586fe7e394b61360f77584ce993131efac
/book-share/src/main/java/com/flaminiovilla/bookshare/model/dto/ProfileDTO.java
9dc990708b8e723c8f88903effdb6c47852a0c9b
[]
no_license
villaflaminio/microservice
cd0795cf3b34821fcd0c821c9b99cb441f24a5ab
42abb812518cb9d71016deff5595474de2af0b90
refs/heads/master
2023-08-29T02:21:42.814086
2021-10-30T12:34:33
2021-10-30T12:34:33
416,026,060
0
0
null
null
null
null
UTF-8
Java
false
false
214
java
package com.flaminiovilla.bookshare.model.dto; import java.util.Date; public class ProfileDTO { public String firstName; public String lastName; public Date birthday; public String phoneNumber; }
[ "vifla01@gmail.com" ]
vifla01@gmail.com
1f8e66464bb40fbcff4a147ccfbc5de505cc80e4
12ced58412c136935cc6685eebd59fe021379532
/src/main/java/me/yes/securityjwttest/domain/User.java
83218cf8233410bcc8085e0d88fa951621e5dfe2
[]
no_license
hsk9210/SpringSecurityJwt
2c330ec6ad612483a22ed1f1eb9733ca8c83a8de
3336493d888f3d6cf381a57de274b2b87c437f63
refs/heads/main
2023-01-22T23:57:36.093060
2020-11-20T07:53:45
2020-11-20T07:53:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,648
java
package me.yes.securityjwttest.domain; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import javax.persistence.*; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; /** * Created by yes on 2020/11/20 */ @Getter @NoArgsConstructor @AllArgsConstructor @Builder @Entity public class User implements UserDetails { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(length = 100, nullable = false, unique = true) private String email; @Column(length = 300, nullable = false) private String password; @ElementCollection(fetch = FetchType.EAGER) @Builder.Default private List<String> roles = new ArrayList<>(); @Override public Collection<? extends GrantedAuthority> getAuthorities() { return this.roles.stream() .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); } @Override public String getUsername() { return email; } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } }
[ "youngeun.seo@wefunding.com" ]
youngeun.seo@wefunding.com
4c39c44da2167137abb52b27ffbf2bad0ab9f700
caaf7861304758dd0e073530d2dab47917c564c1
/src/main/java/com/kbalazsworks/weathersnapshot/entity/HtmlLog.java
26957c265d16ae77d6f491f4d574030b5905967a
[]
no_license
balazskrizsan/weather-snapshot
7ee6e0c12bc0eb147a3d7769474b18b432a64816
9aed238c87ceb568b56d08859829464ba9cf9fa3
refs/heads/master
2022-11-26T19:35:30.152581
2020-08-09T16:47:24
2020-08-09T16:47:24
274,982,120
0
0
null
2020-08-02T04:23:33
2020-06-25T17:59:07
Java
UTF-8
Java
false
false
1,456
java
package com.kbalazsworks.weathersnapshot.entity; import com.kbalazsworks.weathersnapshot.enums.SiteEnum; import com.kbalazsworks.weathersnapshot.enums.SiteUriEnum; import org.jetbrains.annotations.Nullable; import java.time.LocalDateTime; public class HtmlLog { final private @Nullable Long id; final private SiteEnum siteId; final private SiteUriEnum siteUriId; final private int parserVersionId; final private String html; final private LocalDateTime createdAt; public HtmlLog( @Nullable Long id, SiteEnum siteId, SiteUriEnum siteUriId, int parserVersionId, String html, LocalDateTime createdAt ) { this.id = id; this.siteId = siteId; this.siteUriId = siteUriId; this.parserVersionId = parserVersionId; this.html = html; this.createdAt = createdAt; } public @Nullable Long getId() { return id; } public SiteEnum getSiteId() { return siteId; } public SiteUriEnum getSiteUriId() { return siteUriId; } public int getParserVersionId() { return parserVersionId; } public String getHtml() { return html; } public LocalDateTime getCreatedAt() { return createdAt; } }
[ "krizsan.balazs@gmail.com" ]
krizsan.balazs@gmail.com
53b69dd5552a7330250aca4a00c15102d0858505
0951fedbf80ed71798da739933672c81c0959e2e
/src/main/java/com/nfinity/example179/EmailBuilder/domain/EmailTemplate/EmailTemplateManager.java
35eaac15ff6e81d06beba7cc14148cc5d394e7f7
[]
no_license
ChiragDosi/getfastcodebackend
cd4892b5e704af1fd26d3654bffb471801b667f0
5b122134671ef02b570d2f390161c823dd62a1d0
refs/heads/master
2022-09-30T07:23:11.757317
2019-12-18T15:26:23
2019-12-18T15:26:23
228,638,241
0
0
null
2022-02-16T01:03:12
2019-12-17T14:47:54
Java
UTF-8
Java
false
false
1,523
java
package com.nfinity.example179.EmailBuilder.domain.EmailTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheConfig; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import com.nfinity.example179.EmailBuilder.domain.IRepository.IEmailTemplateRepository; import com.nfinity.example179.EmailBuilder.domain.model.EmailTemplateEntity; import com.querydsl.core.types.Predicate; @Repository public class EmailTemplateManager implements IEmailTemplateManager { @Autowired IEmailTemplateRepository _emailTemplateRepository; public EmailTemplateEntity Create(EmailTemplateEntity email) { return _emailTemplateRepository.save(email); } public void Delete(EmailTemplateEntity email) { _emailTemplateRepository.delete(email); } public EmailTemplateEntity Update(EmailTemplateEntity email) { return _emailTemplateRepository.save(email); } public EmailTemplateEntity FindById(Long emailId) { return _emailTemplateRepository.findById(emailId.longValue()); } public Page<EmailTemplateEntity> FindAll(Predicate predicate, Pageable pageable) { return _emailTemplateRepository.findAll(predicate,pageable); } public EmailTemplateEntity FindByName(String name) { return _emailTemplateRepository.findByEmailName(name); } }
[ "repo@socanudos.com.br" ]
repo@socanudos.com.br
5fb9ddc3abf68f2abe0e1bd3f11d967bc7a4448f
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_2f420f316b3ea7d80fc8e490c57b88754c1e9810/myWindow/7_2f420f316b3ea7d80fc8e490c57b88754c1e9810_myWindow_s.java
d6d9faeca780cbdc7c1e26d62494baf5be192c53
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,399
java
import org.eclipse.jface.action.Action; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.StatusLineManager; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.text.TextViewer; import org.eclipse.jface.window.ApplicationWindow; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import weito.Main; import debug.Printer; import debug.TextViewerPrinter; public class myWindow extends ApplicationWindow { private Action newRun; private StyledText styledText; /** * Create the application window. */ public myWindow() { super(null); createActions(); addToolBar(SWT.FLAT | SWT.WRAP); addMenuBar(); addStatusLine(); } /** * Create contents of the application window. * @param parent */ @Override protected Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.V_SCROLL); container.setLayout(new FillLayout(SWT.HORIZONTAL)); { TextViewer textViewer = new TextViewer(container, SWT.BORDER); textViewer.setEditable(false); styledText = textViewer.getTextWidget(); } return container; } /** * Create the actions. */ private void createActions() { // Create the actions { newRun = new Action("Create new Run") { @Override public void run() { Printer.setInstance(new TextViewerPrinter(styledText)); Main.main(null); super.run(); } }; } } /** * Create the menu manager. * @return the menu manager */ @Override protected MenuManager createMenuManager() { MenuManager menuManager = new MenuManager("menu"); { MenuManager menuManager_1 = new MenuManager("File"); menuManager.add(menuManager_1); menuManager_1.add(newRun); } return menuManager; } /** * Create the toolbar manager. * @return the toolbar manager */ @Override protected ToolBarManager createToolBarManager(int style) { ToolBarManager toolBarManager = new ToolBarManager(style); toolBarManager.add(newRun); return toolBarManager; } /** * Create the status line manager. * @return the status line manager */ @Override protected StatusLineManager createStatusLineManager() { StatusLineManager statusLineManager = new StatusLineManager(); return statusLineManager; } /** * Launch the application. * @param args */ public static void main(String args[]) { try { myWindow window = new myWindow(); window.setBlockOnOpen(true); window.open(); Display.getCurrent().dispose(); } catch (Exception e) { e.printStackTrace(); } } /** * Configure the shell. * @param newShell */ @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText("WeitoGUI"); } /** * Return the initial size of the window. */ @Override protected Point getInitialSize() { return new Point(450, 300); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ca8cd81246a6ab6f2834a147105abf4290777d47
e5f9feb6be4160af01a0cb8ab6fb7abdd8ac3fcd
/java/com/kaneri/admin/mywhatsapp/finalchatapp/Registrations.java
cd650cde689e7b881d928047bcbf0fee88ec64b8
[]
no_license
karanfc/MyWhatsapp
44d5f634d43d311de4216fc3ed19185e46cf2c40
2cf785fc3703edc5b28f21287bc2022f5bd4e1b0
refs/heads/master
2021-01-22T18:34:00.121069
2017-03-15T16:23:11
2017-03-15T16:23:11
85,094,811
1
0
null
null
null
null
UTF-8
Java
false
false
879
java
package com.kaneri.admin.mywhatsapp.finalchatapp; /** * Created by dell on 13/03/2017. */ public class Registrations { private String email; private String phone_number; private String name; public Registrations(){ //Required empty constructor } public Registrations(String email,String phonenumber,String name) { this.email = email; this.phone_number = phonenumber; this.name = name; } public String getEmail() { return email; } public String getName(){return name;} public String getPhonenumber() { return phone_number; } public void setName(String name){this.name = name;} public void setEmail(String email){ this.email = email; } public void setPhonenumber(String phonenumber) { this.phone_number = phonenumber; } }
[ "karan12011998@gmail.com" ]
karan12011998@gmail.com
2bf3ba8f6c03610bda799271af8fc0a0dd7e465d
517aba76db3f6f559b4126287e6c601775c5e915
/animationgame/src/animationgame/FirstPanel.java
d400ea3cb06b29d6a249fa2e2a16d584998908a0
[]
no_license
Apfelebaum/animationgame
b3bc71b2cace6114a2eafcb50b80c9bb4399a7d6
48dd70f66afa8df40a1605aabbe2ae3738fc5e47
refs/heads/master
2021-01-13T00:53:40.183083
2015-10-27T12:49:10
2015-10-27T12:49:10
43,539,559
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package animationgame; import javax.swing.*; public class FirstPanel extends JPanel { @Override public void paintComponent(java.awt.Graphics g){ g.fillRect(30, 50, 45, 30); g.fillOval(60, 20, 40, 100); } public static void main(String[] args) { JFrame f=new JFrame(); f.add(new FirstPanel()); f.setVisible(true); } }
[ "Axmann.Paul@SK-0022685948BB" ]
Axmann.Paul@SK-0022685948BB
86afe592f67691c484368b6c811e2a00baa47458
ea29884ce8088157c89d4485a592f6ef7e307a8a
/app/src/main/java/za/co/makuru/makurufx/di/ActivityContext.java
74cc7aa3a34a4b61e795f319fd2c019f05043e44
[]
no_license
carvelle/MukuruFXApp
d7a3212efaa0b917e47d9266d4e70a42f05d44cc
80ca6bbcbf673bd44297e98efd0d48fc5c9d3080
refs/heads/master
2020-05-27T17:26:57.392583
2019-05-27T08:54:30
2019-05-27T08:54:30
188,721,107
0
0
null
null
null
null
UTF-8
Java
false
false
237
java
package za.co.makuru.makurufx.di; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import javax.inject.Qualifier; @Qualifier @Retention(RetentionPolicy.RUNTIME) public @interface ActivityContext { }
[ "sngqondo@hotmail.com" ]
sngqondo@hotmail.com
000c606ed93eb5c6620fbccd28bc1b776e4f9606
969e8ad47d573d8e63f02af5bb0b7a94d4c22366
/src/main/java/com/rk/util/ObjectUtil.java
22050f8461fefa1fc56adaf24e27727b65dc801d
[]
no_license
zxy616049554/blus
57a177f294abc05e82b5e580c42da718c432c5e6
101ec234b0c988a76deb66974800e56df2b28438
refs/heads/master
2022-11-30T08:47:44.059923
2020-08-07T03:50:43
2020-08-07T03:50:43
285,729,534
0
1
null
null
null
null
UTF-8
Java
false
false
5,203
java
/** * @Copyright ®2018 gjmctp Co. Ltd. All rights reserved.<br/> * 项目名称 : 国金金属商品交易平台 * 创建日期 : 2018年5月25日 * 修改历史 : * 1. [2018年5月25日]创建文件 by gjmctp */ package com.rk.util; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.Collection; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.rk.exception.BaseException; public class ObjectUtil { private static final Logger log = LoggerFactory.getLogger(ObjectUtil.class); public static final BigDecimal ZERO = new BigDecimal("0"); /** * 判断对象或对象数组中每一个对象是否为空: 对象为null,字符序列长度为0,集合类、Map为empty * * @param obj * @return */ @SuppressWarnings("rawtypes") public static boolean isNullOrEmpty(Object obj) { if (obj == null) { return true; } if (obj instanceof CharSequence) { return ((CharSequence) obj).length() == 0; } if (obj instanceof Collection) { return ((Collection) obj).isEmpty(); } if (obj instanceof Map) { return ((Map) obj).isEmpty(); } if (obj instanceof Object[]) { Object[] object = (Object[]) obj; if (object.length == 0) { return true; } boolean empty = true; for (int i = 0; i < object.length; i++) { if (!isNullOrEmpty(object[i])) { empty = false; break; } } return empty; } return false; } public static BigDecimal convertValue(BigDecimal decimal) { return decimal != null ? decimal : BigDecimal.valueOf(0); } public static Object getReflectValue(Object item, String name) { Method m; Object value = ""; try { m = item.getClass().getMethod("get" + captureName(name)); value = m.invoke(item); } catch (Exception e) { log.error("系统异常,异常信息为:{}]",e.getMessage()); throw new BaseException(e); } return value; } /** * * @2018年2月20日 * @user caoyk * @Title: captureName * @Description: 将字符串name 转化为首字母大写 * @param @param name * @param @return 设定文件 * @return String 返回类型 * @throws */ public static String captureName(String name) { char[] cs = name.toCharArray(); cs[0] -= 32; return String.valueOf(cs); } public static boolean isUpdateChnName(String basedField, Object target) { boolean flag = false; if (!ObjectUtil.isNullOrEmpty(basedField) && !ObjectUtil.getReflectValue(target, basedField).equals(ZERO)) { flag = true; } return flag; } /** * 将DTO中的值按照参数传递给Entity,要求两边的字段要一致 * @param a 取值的对象 * @param b 存放值的对象 * return Obejct */ @SuppressWarnings("rawtypes") public static Object syncDtoToEntity(Object a, Object b) { try { Class A = a.getClass(); Class B = b.getClass(); Field[] fa = A.getDeclaredFields(); for (int i = 0; i < fa.length; i++) { try { Field f1 = fa[i]; f1.setAccessible(true); Object val = f1.get(a); Field[] fb = B.getDeclaredFields(); for (int j = 0; j < fb.length; j++) { Field f2 = fb[j]; if (f2.getName().equalsIgnoreCase(f1.getName())) { f2.setAccessible(true); f2.set(b, val); } } } catch (Exception ex) { continue; } } } catch (Exception e) { log.error("系统异常,异常信息为:{}]",e.getMessage()); return null; } return b; } /** * @Description: 后台运营 * @Param: * @return: */ public static String toString(Object obj) { if (obj == null) { return null; } return obj.toString(); } public static Long toLong(Object obj) { if (obj == null) { return 0L; } if (obj instanceof Double || obj instanceof Float) { // return Long.valueOf(StringUtils.substringBefore(obj.toString(), ".")); return Long.valueOf(StringUtil.subStringExe(obj.toString(),"",".","")); } if (obj instanceof Number) { return Long.valueOf(obj.toString()); } if (obj instanceof String) { return Long.valueOf(obj.toString()); } else { return 0L; } } public static Integer toInt(Object obj) { return toLong(obj).intValue(); } }
[ "616049554@qq.com" ]
616049554@qq.com
8797da5f44050e5491c3ae2867dc9695bf72376b
1b2478f59a62cafa015208183e0accca1e404192
/src/main/java/com/astra/getyourmusic/service/userService/userServiceImpl/NotificationServiceImpl.java
3ff64b9f82909ac235cb2fb4a5ecdf17563dc519
[]
no_license
DAlembert721/get-your-music-back-end-evo
ad175730e2573b80dcd4f9327ee0cc3af5822059
c64735b30dc52b674b94d6ebc55766ee6e35a7fc
refs/heads/master
2023-01-24T12:12:03.703531
2020-11-27T16:43:26
2020-11-27T16:43:26
305,889,177
0
0
null
null
null
null
UTF-8
Java
false
false
737
java
package com.astra.getyourmusic.service.userService.userServiceImpl; import com.astra.getyourmusic.model.userSystem.Notification; import com.astra.getyourmusic.repository.userRepository.NotificationRepository; import com.astra.getyourmusic.service.userService.NotificationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class NotificationServiceImpl implements NotificationService { @Autowired private NotificationRepository notificationRepository; @Override public List<Notification> getAllNotificationsByProfileId(Long profileId) { return notificationRepository.findByProfileId(profileId); } }
[ "DDMU@users.noreply.github.com" ]
DDMU@users.noreply.github.com
5a76ace73c1aff9d89dd035366af62096746e2d1
b86869723622e60c6389616966632e5c63277af0
/app/src/main/java/freestar/friends/activity/DiscussAtlasDetailActivity.java
973f9ac9be9f800e8222bc6e81c15a6198d769b5
[]
no_license
AngelYHY/Friends
04c3ba5042629ef052a86c63c2754b7fc93675d2
4475cd6a995cc186d15c64fa309a257157583563
refs/heads/master
2020-05-28T03:44:46.211847
2017-09-15T12:59:49
2017-09-15T12:59:49
65,609,122
0
0
null
null
null
null
UTF-8
Java
false
false
7,151
java
package freestar.friends.activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.util.Log; import android.view.View; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.listener.OnItemChildClickListener; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; import cn.bmob.v3.BmobQuery; import cn.bmob.v3.datatype.BmobPointer; import cn.bmob.v3.exception.BmobException; import cn.bmob.v3.listener.FindListener; import freestar.friends.R; import freestar.friends.adapter.DiscussAtlasDetailAdapter; import freestar.friends.bean.Atlas; import freestar.friends.bean.AtlasDis; import freestar.friends.util.status_bar.BaseActivity; import freestar.friends.widget.XRecyclerView; /** * 图集评论 */ public class DiscussAtlasDetailActivity extends BaseActivity implements View.OnClickListener, SwipeRefreshLayout.OnRefreshListener, BaseQuickAdapter.RequestLoadMoreListener { private static final int RESC = 9; @Bind(R.id.recycler_view) XRecyclerView mRecyclerView; @Bind(R.id.swipeLayout) SwipeRefreshLayout mSwipeLayout; private Atlas atlas; int i; private DiscussAtlasDetailAdapter mAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.search_bar_with_padding1); ButterKnife.bind(this); atlas = (Atlas) getIntent().getSerializableExtra("object"); initRV(); mSwipeLayout.setOnRefreshListener(this); onRefresh(); } private void initRV() { mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); mRecyclerView.addOnItemTouchListener(new OnItemChildClickListener() { @Override public void onSimpleItemChildClick(BaseQuickAdapter adapter, View view, int i) { AtlasDis s = (AtlasDis) adapter.getItem(i); Intent intent; switch (view.getId()) { case R.id.line_reply: intent = new Intent(DiscussAtlasDetailActivity.this, DiscussActivity.class); intent.putExtra("object", s); intent.putExtra("user", s.getAuthor()); Log.e("FreeStar", "SearchActivity→→→onClick:" + s.toString()); startActivityForResult(intent, RESC); break; case R.id.sdv_head: intent = new Intent(DiscussAtlasDetailActivity.this, UserDataActivity.class); intent.putExtra("user", s.getCuser()); Log.e("FreeStar", "SearchActivity→→→onClick:" + s.getCuser()); startActivity(intent); break; case R.id.btn_name: intent = new Intent(DiscussAtlasDetailActivity.this, UserDataActivity.class); intent.putExtra("user", s.getFather_user()); Log.e("FreeStar", "SearchActivity→→→onClick:" + s.getFather_user()); startActivity(intent); break; } } }); mAdapter = new DiscussAtlasDetailAdapter(); mAdapter.openLoadAnimation(1); mAdapter.setAutoLoadMoreSize(4); mAdapter.setOnLoadMoreListener(this, mRecyclerView); mRecyclerView.setAdapter(mAdapter); } private void initData() { BmobQuery<AtlasDis> query = new BmobQuery<>(); query.addWhereEqualTo("atlas", new BmobPointer(atlas)); query.include("cuser,comment_father_user,father_user,author"); query.setLimit(10); query.order("-createdAt"); query.findObjects(new FindListener<AtlasDis>() { @Override public void done(List<AtlasDis> list, BmobException e) { mSwipeLayout.post(new Runnable() { @Override public void run() { mSwipeLayout.setRefreshing(false); } }); if (e == null) { mAdapter.setNewData(list); if (list.size() < 10) { mAdapter.loadMoreEnd(); } } else { Log.e("FreeStar", "PageFragment1→→→done:" + e.getMessage()); } } }); i++; } private void startQuery() { Log.e("FreeStar", "SearchActivity→→→run:"); BmobQuery<AtlasDis> query = new BmobQuery<>(); query.addWhereEqualTo("atlas", new BmobPointer(atlas)); query.include("cuser,comment_father_user,father_user"); query.order("-createdAt"); query.setSkip(10 * i); // 忽略前10条数据(即第一页数据结果) query.setLimit(10); query.findObjects(new FindListener<AtlasDis>() { @Override public void done(List<AtlasDis> list, BmobException e) { if (e == null) { if (list.size() < 10) { mAdapter.loadMoreEnd(); } else { mAdapter.addData(list); mAdapter.loadMoreComplete(); } } else { Log.e("FreeStar", "SearchActivity→→→done:" + e.getMessage()); } } }); i++; } @Override public void onRefresh() { mSwipeLayout.post(new Runnable() { @Override public void run() { mSwipeLayout.setRefreshing(true); } }); initData(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RESC && resultCode == RESULT_OK) { String back = data.getStringExtra("OK"); if (back.equals("YES")) { onRefresh(); Intent intent = new Intent(); intent.putExtra("OK", "YES"); setResult(RESULT_OK, intent); } else if (back.equals("fresh")) { onRefresh(); } } } @OnClick({R.id.line_com, R.id.tv_search}) public void onClick(View view) { switch (view.getId()) { case R.id.line_com: Intent intent = new Intent(this, DiscussActivity.class); intent.putExtra("object", atlas); startActivityForResult(intent, RESC); break; case R.id.tv_search: finish(); break; } } @OnClick(R.id.back_dongtai) public void onClick() { finish(); } @Override public void onLoadMoreRequested() { startQuery(); } }
[ "1064389584@qq.com" ]
1064389584@qq.com
d1acf21bad673d7e34acd3efa49108f3c5e454b8
6d0a9da825d9f3d163d78025c41abc0144b4bd97
/src/main/java/by/zapolski/exception/NoMilkException.java
bb53ea9b0fb4408353df567ae125fae91dc118f5
[]
no_license
Zapolski/homework7_3
9827c0abe5bab8f65d5bc811abc276606d62d491
8c044301c707be945649313860756d52b5239fda
refs/heads/master
2020-04-16T23:41:05.164767
2019-01-18T08:48:26
2019-01-18T08:48:26
166,021,422
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package by.zapolski.exception; public class NoMilkException extends CoffeeMachineException{ public NoMilkException(String message) { super(message); } }
[ "nestor.s@mail.ru" ]
nestor.s@mail.ru
4c036acf8ee0f8da782de329773a99a201e55f82
04a60f0f5b7e2e9ce28f16a6b7c0d42734780feb
/src/main/java/jp/gr/java_conf/nenokido2000/sample/App.java
90d5c51978374c838ecb7064bfb429f4a45e6101
[]
no_license
nenokido2000/spring-boot-csrf-sample
a7ed8523da71d83f5e30369638179592d46c4b61
c4a152c4044ea2a52b18665b05242a7212af69e8
refs/heads/master
2021-01-19T04:05:22.023537
2016-06-30T08:47:20
2016-06-30T08:47:20
54,551,404
2
1
null
null
null
null
UTF-8
Java
false
false
311
java
package jp.gr.java_conf.nenokido2000.sample; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class App { public static void main(String[] args) { SpringApplication.run(App.class, args); } }
[ "naoki.enokido@locondo.co.jp" ]
naoki.enokido@locondo.co.jp
a3be4a112729449de2b0ee07e3493fcddcd3c703
dbde38010aee32c5d04e58feca47c0d30abe34f5
/subprojects/opennaef.application/src/main/java/voss/nms/inventory/model/RsvpLspPathHopPoolModel.java
4d12d85d50d2e4f31a7ce9b682dd3327312a0a4d
[ "Apache-2.0" ]
permissive
openNaEF/openNaEF
c2c8d5645b499aae36d90205dbc91421f4d0bd7b
c88f0e17adc8d3f266787846911787f9b8aa3b0d
refs/heads/master
2020-12-30T15:41:09.806501
2017-05-22T22:37:24
2017-05-22T22:38:36
91,155,672
13
0
null
null
null
null
UTF-8
Java
false
false
1,745
java
package voss.nms.inventory.model; import naef.dto.mpls.RsvpLspHopSeriesDto; import naef.dto.mpls.RsvpLspHopSeriesIdPoolDto; import voss.core.server.util.DtoUtil; import voss.nms.inventory.database.MPLSNMS_ATTR; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class RsvpLspPathHopPoolModel implements Serializable { private static final long serialVersionUID = 1L; private final RsvpLspHopSeriesIdPoolDto pool; private final List<String> usedIDs = new ArrayList<String>(); public RsvpLspPathHopPoolModel(RsvpLspHopSeriesIdPoolDto pool) { this.pool = pool; } public void renew() { this.pool.renew(); this.usedIDs.clear(); for (RsvpLspHopSeriesDto dto : pool.getUsers()) { usedIDs.add(dto.getAbsoluteName()); } } public String getRange() { return pool.getConcatenatedIdRangesStr(); } public String getUsed() { return String.valueOf(getUsedIds()); } public int getUsedIds() { return usedIDs.size(); } public String getPoolName() { return pool.getName(); } public String getUsage() { return DtoUtil.getString(pool, MPLSNMS_ATTR.PURPOSE); } public String getStatus() { return DtoUtil.getString(pool, MPLSNMS_ATTR.ADMIN_STATUS); } public String getLastEditor() { return DtoUtil.getStringOrNull(pool, "_LastEditor"); } public String getLastEditTime() { return DtoUtil.getDateTime(pool, "_LastEditTime"); } public String getVersion() { return DtoUtil.getMvoVersionString(pool); } public String getNote() { return DtoUtil.getString(pool, MPLSNMS_ATTR.NOTE); } }
[ "t.yamazaki@ttscweb.jp" ]
t.yamazaki@ttscweb.jp
c64c31f58befa77963fccf52e4b55626b768a5ff
4b25fdf8aefc6035df743141a4e14bbf33c28f47
/src/main/java/com/jvm/FinalizeEscapeGC.java
5d47f102db2b6d5658e48fcd92a513352c5eacba
[]
no_license
Linklmm/thinkInJava
5be0f014c6641ad522f93e816984b529ef08576a
644346757575d87cd35beb1f55d5835f7667d9eb
refs/heads/master
2020-03-26T16:18:02.950337
2019-11-29T03:00:17
2019-11-29T03:00:17
145,092,648
1
0
null
null
null
null
UTF-8
Java
false
false
1,515
java
package com.jvm; /** * 版权声明:Copyright(c) 2019 * * @program: thinkInJava * @Author myFlowerYourGrass * @Date 2019-07-27 20:10 * @Version 1.0 * @Description 此代码演示了两点: * 1、对象可以在被GC时自我拯救 * 2、这种自救的机会只有一次,因为一个对象的finalize()方法最多只会被系统自动调用一次 */ public class FinalizeEscapeGC { public static FinalizeEscapeGC SAVE_HOOK = null; public void isAlive() { System.out.println("yes ,i am still alive:"); } @Override protected void finalize() throws Throwable { super.finalize(); System.out.println("finalize method executed!"); FinalizeEscapeGC.SAVE_HOOK = this; } public static void main(String[] args) throws InterruptedException { SAVE_HOOK = new FinalizeEscapeGC(); //对象第一次成功拯救自己 SAVE_HOOK = null; System.gc(); //因为finalize方法优先级很低,所以暂停0.5秒以等待它 Thread.sleep(500); if (SAVE_HOOK != null) { SAVE_HOOK.isAlive(); } else { System.out.println("no, i am dead :"); } //下面这段代码与上面的完全相同,但是这次自救却失败了 SAVE_HOOK = null; System.gc(); Thread.sleep(500); if (SAVE_HOOK != null) { SAVE_HOOK.isAlive(); } else { System.out.println("no, i am dead :"); } } }
[ "1248332941@qq.com" ]
1248332941@qq.com
d758ef92e5792e30a9fca00f1894cc41a518798c
fa0cf934703768baac2390a0849af9c8141a94e3
/ltybd-baseinfo/src/main/java/com/ltybd/exception/GlobalException.java
4b121498f461db067de638ff0a4c31b1d8c8eb3a
[]
no_license
NONO9527/ltybd-root
44c4a8bbef3d708c82772874fb14ae654ca05229
c8a650f3f204ff1abeecdc9178869e3a47bdde93
refs/heads/master
2021-12-30T09:23:46.933731
2018-02-08T01:24:14
2018-02-08T01:24:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,162
java
package com.ltybd.exception; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import com.ltybd.entity.ResponseData; /** * Description: 异常拦截处理<br/> * Date: 2017年7月30日 下午3:24:35 <br/> * * @author * @version * @see */ @ControllerAdvice public class GlobalException { @ExceptionHandler(value = Exception.class) @ResponseBody public ResponseData defaultErrorHandler(Exception e,HttpServletRequest request, HttpServletResponse response) throws Exception { ResponseData r = new ResponseData(); r.setResult("1"); r.setResPonse("请求异常"); if (e instanceof org.springframework.web.servlet.NoHandlerFoundException) { r.setResultMsg("您请求的接口地址不存在,请确定访问地址是否正确"); } else { r.setResultMsg("请求失败,请检查所传参数是否合法"); } return r; } }
[ "shuai.hong@lantaiyuan.com" ]
shuai.hong@lantaiyuan.com
91c4ffc87e088bada465dc2c1662ff34ec8923bf
b2ff9d9b8098adac648b3695732c9fdabca5a6e3
/clouddo-common/src/main/java/com/bootdo/clouddocommon/intercepter/FeignIntercepter.java
42ba3cf2ecbf2d2b5fe85f74680cd08aaaf7f3a5
[]
no_license
wph1/clouddo
3d3850bf01116685c14e6196ae8ef3fb67f13b62
c8972af98625400d9006a3c13be5666380bd2cbe
refs/heads/master
2020-04-07T12:39:31.806724
2018-11-25T06:28:20
2018-11-25T06:28:20
158,376,000
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package com.bootdo.clouddocommon.intercepter; import com.bootdo.clouddocommon.constants.CommonConstants; import com.bootdo.clouddocommon.context.FilterContextHandler; import feign.RequestInterceptor; import feign.RequestTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class FeignIntercepter implements RequestInterceptor { private static final Logger logger = LoggerFactory.getLogger(RequestInterceptor.class); @Override public void apply(RequestTemplate requestTemplate) { logger.info("------feign设置token" + Thread.currentThread().getId()+",token的值:"+FilterContextHandler.getToken()); requestTemplate.header(CommonConstants.CONTEXT_TOKEN, FilterContextHandler.getToken()); } }
[ "wangpenghao@126.com" ]
wangpenghao@126.com
61b1ac67ff4bd1590387d7c1ad5d8b77550e912e
7ff4992e2f7cc999106d698a260b59cedb57a4ce
/src/main/java/ru/inno/DAO/StudentDAOImpl.java
b935aeff912691d8c602e5045eb32360d5a2c6a2
[]
no_license
IvanZhilyakov/testStudentRest
99f9c561efcc8b2937c552a01ce615c580131a95
804343ce487d6512ce73cf0262a6c372194c19c9
refs/heads/master
2021-08-22T18:46:50.240661
2017-12-01T01:10:52
2017-12-01T01:10:52
112,677,996
0
0
null
null
null
null
UTF-8
Java
false
false
1,302
java
package ru.inno.DAO; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import ru.inno.entities.*; import java.util.List; @Repository public class StudentDAOImpl implements StudentDAO { @Autowired private SessionFactory factory; @Override public List<Student> findAll() { Session session = factory.openSession(); Query query = session.createQuery("select distinct s from Student s"); List<Student> ls = query.list(); session.close(); return ls; } @Override public Student save(Student student) { Session session = factory.openSession(); session.beginTransaction(); session.update(student); session.getTransaction().commit(); session.close(); return student; } @Override public Student getById(Integer id){ Session session = factory.openSession(); Query query = session.createQuery("select s from Student s where s.id=:student_id"); query.setParameter("student_id", id); Student student = (Student) query.list().get(0); session.close(); return student; } }
[ "moi_yas4ik@list.ru" ]
moi_yas4ik@list.ru
ba21ffabcf092ef256c6007d99c7e341a67f68ea
758b328e49419ba85ba8dec88de2d262dfe7e4ed
/app/src/main/java/com/enzonium/efarrariwalls/MySingleton.java
e02163ac1aa7c78ccd0d7ec73dc738905898c0c1
[]
no_license
banjioyewole/hdproject-android
857318dd58ea9e65a57021037423f96f10fb97db
714242d1a5c54af97fad27cea7918fe8b09df862
refs/heads/master
2021-09-05T04:09:43.123340
2018-01-24T03:23:50
2018-01-24T03:23:50
118,701,936
1
0
null
null
null
null
UTF-8
Java
false
false
1,959
java
package com.enzonium.efarrariwalls; import android.content.Context; import android.graphics.Bitmap; import android.util.LruCache; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.ImageLoader; import com.android.volley.toolbox.Volley; /** * Created by banjioyewole on 1/19/16. */ public class MySingleton { private static MySingleton mInstance; private RequestQueue mRequestQueue; private ImageLoader mImageLoader; private static Context mCtx; private MySingleton(Context context) { mCtx = context; mRequestQueue = getRequestQueue(); mImageLoader = new ImageLoader(mRequestQueue, new ImageLoader.ImageCache() { private final LruCache<String, Bitmap> cache = new LruCache<String, Bitmap>(20); @Override public Bitmap getBitmap(String url) { return cache.get(url); } @Override public void putBitmap(String url, Bitmap bitmap) { cache.put(url, bitmap); } }); } public static synchronized MySingleton getInstance(Context context) { if (mInstance == null) { mInstance = new MySingleton(context); } return mInstance; } public RequestQueue getRequestQueue() { if (mRequestQueue == null) { // getApplicationContext() is key, it keeps you from leaking the // Activity or BroadcastReceiver if someone passes one in. mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext()); } return mRequestQueue; } public <T> void addToRequestQueue(Request<T> req) { getRequestQueue().add(req); } public ImageLoader getImageLoader() { return mImageLoader; } }
[ "boyewole@pugetsound.edu" ]
boyewole@pugetsound.edu
bbe8de39481a1f16df31c895e5614a351128dabb
a879d67f23fe9c14f42e01134638def9705bc856
/app/src/main/java/util/CpuManager.java
069fbf551830933eb3addaebec5868bd3746c53c
[ "Apache-2.0" ]
permissive
wgzzgw/UDP
745615174ba601ac459e3eca02c18abae578faa7
1e1d3c12540162102fffdbd12ad773b323b082f8
refs/heads/master
2020-03-21T10:31:55.511847
2018-06-25T07:53:51
2018-06-25T07:53:51
138,456,055
0
0
null
null
null
null
UTF-8
Java
false
false
6,554
java
package util; import android.util.Log; import java.io.BufferedReader; import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.List; import java.util.regex.Pattern; /** * Created by yy on 2018/6/22. */ public class CpuManager { private static final String TAG = "CpuManager"; public static short getThermalInfo() { String path="/sys/class/thermal/thermal_zone9/temp"; File f=new File(path); if(!f.exists()){ Log.d(TAG, "getThermalInfo: "+"enter"); return 0; } else{ FileInputStream fin=null; try { fin = new FileInputStream(f); byte[] result=new byte[1024]; if(fin.read(result)!=-1){ return (short)(Long.parseLong(new String(result,0,result.length).trim())/1000); } }catch (Exception e){ e.printStackTrace(); }finally { try { fin.close(); }catch (IOException e){ e.printStackTrace(); } } } return 0; } /** get CPU rate 不明原因:在三星和模拟器获取总是0 * @return */ public static int getProcessCpuRate() { StringBuilder tv = new StringBuilder(); int rate = 0; try { String Result; Process p; //执行命令 p = Runtime.getRuntime().exec("top -n 1"); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); while ((Result = br.readLine()) != null) { Log.d(TAG, "getProcessCpuRate: "+"enter this"); if (Result.trim().length() < 1) { continue; } else { String[] CPUusr = Result.split("%"); tv.append("USER:" + CPUusr[0] + "\n"); String[] CPUusage = CPUusr[0].split("User"); String[] SYSusage = CPUusr[1].split("System"); tv.append("CPU:" + CPUusage[1].trim() + " length:" + CPUusage[1].trim().length() + "\n"); tv.append("SYS:" + SYSusage[1].trim() + " length:" + SYSusage[1].trim().length() + "\n"); rate = Integer.parseInt(CPUusage[1].trim()) + Integer.parseInt(SYSusage[1].trim()); break; } } } catch (IOException e) { e.printStackTrace(); } Log.d(TAG, "getProcessCpuRate: "+rate); return rate; } /** * 获取当前进程的CPU使用率 * @return CPU的使用率 */ public static float getCurProcessCpuRate() { float totalCpuTime1 = getTotalCpuTime(); float processCpuTime1 = getAppCpuTime(); try { Thread.sleep(360); } catch (Exception e) { } float totalCpuTime2 = getTotalCpuTime(); float processCpuTime2 = getAppCpuTime(); float cpuRate = 100 * (processCpuTime2 - processCpuTime1) / (totalCpuTime2 - totalCpuTime1); return cpuRate; } /** * 获取总的CPU使用率 * @return CPU使用率 */ public static float getTotalCpuRate() { float totalCpuTime1 = getTotalCpuTime(); float totalUsedCpuTime1 = totalCpuTime1 - sStatus.idletime; try { Thread.sleep(360); } catch (InterruptedException e) { e.printStackTrace(); } float totalCpuTime2 = getTotalCpuTime(); float totalUsedCpuTime2 = totalCpuTime2 - sStatus.idletime; float cpuRate = 100 * (totalUsedCpuTime2 - totalUsedCpuTime1) / (totalCpuTime2 - totalCpuTime1); return cpuRate; } /** * 获取系统总CPU使用时间 * @return 系统CPU总的使用时间 */ public static long getTotalCpuTime() { String[] cpuInfos = null; try { BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream("/proc/stat")), 1000); String load = reader.readLine(); reader.close(); cpuInfos = load.split(" "); } catch (IOException ex) { ex.printStackTrace(); } // long totalCpu = Long.parseLong(cpuInfos[2]) // + Long.parseLong(cpuInfos[3]) + Long.parseLong(cpuInfos[4]) // + Long.parseLong(cpuInfos[6]) + Long.parseLong(cpuInfos[5]) // + Long.parseLong(cpuInfos[7]) + Long.parseLong(cpuInfos[8]); sStatus.usertime = Long.parseLong(cpuInfos[2]); sStatus.nicetime = Long.parseLong(cpuInfos[3]); sStatus.systemtime = Long.parseLong(cpuInfos[4]); sStatus.idletime = Long.parseLong(cpuInfos[5]); sStatus.iowaittime = Long.parseLong(cpuInfos[6]); sStatus.irqtime = Long.parseLong(cpuInfos[7]); sStatus.softirqtime = Long.parseLong(cpuInfos[8]); return sStatus.getTotalTime(); } /** * 获取当前进程的CPU使用时间 * @return 当前进程的CPU使用时间 */ public static long getAppCpuTime() { // 获取应用占用的CPU时间 String[] cpuInfos = null; try { int pid = android.os.Process.myPid(); BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream("/proc/" + pid + "/stat")), 1000); String load = reader.readLine(); reader.close(); cpuInfos = load.split(" "); } catch (IOException ex) { ex.printStackTrace(); } long appCpuTime = Long.parseLong(cpuInfos[13]) + Long.parseLong(cpuInfos[14]) + Long.parseLong(cpuInfos[15]) + Long.parseLong(cpuInfos[16]); return appCpuTime; } static Status sStatus = new Status(); static class Status { public long usertime; public long nicetime; public long systemtime; public long idletime; public long iowaittime; public long irqtime; public long softirqtime; public long getTotalTime() { return (usertime + nicetime + systemtime + idletime + iowaittime + irqtime + softirqtime); } } }
[ "975787945@qq.com" ]
975787945@qq.com