blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
955007adc87123fe9020568055a29bd87d67fedd
dcc132deb90d675f5889d34c728a0f7edb882895
/performance/src/main/java/victor/training/performance/leaks/Leak2.java
8b1495aa8782248dbf3f21f739cd73a87f27824a
[ "MIT" ]
permissive
Oleksandr82/performance
e61c621150ab9c36bf9eabb0dde8e9fc985c8980
390c84e19f8a61b7162c93ca031cf8604a5119d7
refs/heads/master
2023-01-30T16:44:54.339874
2020-12-09T20:35:14
2020-12-09T20:35:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
701
java
package victor.training.performance.leaks; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @RestController @RequestMapping("leak2") public class Leak2 { @GetMapping public String test(HttpServletRequest request) { // Clear JSESSIONID cookie HttpSession session = request.getSession(); System.out.println("Just created a new session: " + session.isNew()); session.setAttribute("rights",new BigObject80MB()); return "subtle, hard to find before stress tests"; } }
[ "victorrentea@gmail.com" ]
victorrentea@gmail.com
f8b94670537dd09514edc4a58bcdccf747758747
75dd52e23f8952c30cc05603701df1950698ce34
/Deck.java
b221d9fa73c3be0377a2643063075b49d3f4fef9
[]
no_license
Hunter493/PalaceGame
13ee061150a93cf5ea3d658f0ca4a58ff8415c81
108bdf23c9f2ceb43b33c8865b3d6268e534889d
refs/heads/master
2016-09-13T03:24:45.818764
2016-05-24T22:58:27
2016-05-24T22:58:27
59,385,822
0
0
null
null
null
null
UTF-8
Java
false
false
863
java
import java.util.*; /** * Created by Tarsaril on 5/21/2016. */ public class Deck { private List<Card> cards = new ArrayList<>(); public Deck(){ for (Suits s : Suits.values()){ for (Ranks r : Ranks.values()){ Card c = new Card(s, r); cards.add(c); } } for (int i = 0; i < 100; i++) { shuffle(); } } public void shuffle() { Collections.shuffle(this.cards); } public boolean isEmpty(){ return cards.isEmpty(); } public int getSize(){ return cards.size(); } public Card deal() { if (this.isEmpty()){ return null; } Card card = this.cards.get(cards.size() - 1); cards.remove(card); return card; } }
[ "thomas.curtis@mac.com" ]
thomas.curtis@mac.com
3ca9cce52dba315182dad17ffd24b52ace35e3b5
bed0cc6603b18099af4b46e560dbd7713975e794
/src/main/java/com/codeup/services/PostSvc.java
16fe0a689e494b802b0bb18a6a15403d0c184e0c
[]
no_license
hooks325/blog
07ec130a9452ee03357083d46765d71675f0e318
b8ad9c66c65bd95405221f976d1a5e4979dfa318
refs/heads/master
2021-01-11T14:14:38.326732
2017-02-15T16:35:13
2017-02-15T16:35:13
81,236,287
0
0
null
null
null
null
UTF-8
Java
false
false
810
java
package com.codeup.services; import com.codeup.models.Post; import org.springframework.asm.Label; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; /** * Created by nedwaldie on 2/8/17. */ @Service("postService") public class PostSvc { private List<Post> posts = new ArrayList<>(); public PostSvc() { createPost(); } public List<Post> findAll() { return posts; } public Post findOne(int id) { return posts.get(id - 1); } public Post save(Post post) { post.setId(posts.size()+1); posts.add(post); return post; } private void createPost() { for (int i = 0; i < 50; i++) { save(new Post(i+1, "Title " + (i+1), "Body " + (i+1))); } } }
[ "nw_waldie3@yahoo.com" ]
nw_waldie3@yahoo.com
838692826f73db58ba9bf7e0aaeca76c32c9ac19
4f0c41eaf7bd626e2cd5c4a89a221f23ebb4b9cb
/app/src/main/java/com/mozeeb/nanduryok/model/user/UserItem.java
eb2d7d5ca87bc6f93e16de4401dffdad6963431a
[]
no_license
MozeeB/Nandur-Yok
4c14251ae280f288a389286068eac3846b13a3e9
cad67a7473fa03375558d105b4dba79147c87374
refs/heads/master
2021-06-30T21:36:43.132657
2019-04-23T00:58:25
2019-04-23T00:58:25
182,891,737
0
1
null
2020-10-17T13:22:23
2019-04-23T00:52:00
Java
UTF-8
Java
false
false
877
java
package com.mozeeb.nanduryok.model.user; import com.google.gson.annotations.SerializedName; import java.io.Serializable; public class UserItem implements Serializable { @SerializedName("password") private String password; @SerializedName("nama") private String nama; @SerializedName("foto") private String foto; @SerializedName("no_telp") private String noTelp; @SerializedName("email") private String email; @SerializedName("username") private String username; @SerializedName("alamat") private String alamat; public String getPassword(){ return password; } public String getNama(){ return nama; } public String getFoto(){ return foto; } public String getNoTelp(){ return noTelp; } public String getEmail(){ return email; } public String getUsername(){ return username; } public String getAlamat(){ return alamat; } }
[ "mujibnewbie5@gmail.com" ]
mujibnewbie5@gmail.com
2a0484d619486a0bf8823c3aaa2ca4968974b929
f962a2b1d47e803fd750c9c66b9af55dd0ae9e1f
/src/main/java/cn/zedongw/springmvcstudy/app1/UserAction.java
188a6a10554962880691b6507d9f31766cb87705
[]
no_license
ZeDongW/SpringMVCStudy
e20e376acbb1552a2b251b71bfe47ddb7ab047f1
87dac39530d46c037d8e53eba00639059c874dca
refs/heads/master
2022-12-23T21:26:14.821088
2020-09-29T14:28:39
2020-09-29T14:28:39
298,829,048
0
0
null
null
null
null
UTF-8
Java
false
false
1,508
java
package cn.zedongw.springmvcstudy.app1; import cn.zedongw.springmvcstudy.entity.User; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.ServletRequestDataBinder; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import java.text.SimpleDateFormat; import java.util.AbstractCollection; import java.util.Date; import java.util.Iterator; /** * @ClassName: UserAction * @Description: 用户action * @Author: ZeDongW * @Date: 2020/9/27 0027 22:24 * @Version: v1.0 * @Modified By: * @Modified Time: **/ @Controller @RequestMapping("/user") public class UserAction { @InitBinder public void initBinder(ServletRequestDataBinder binder){ binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), false)); } /** * Description: 使用注解定义action * @methodName: addMethod * @param user 1 * @param model 2 * @throws * @return: java.lang.String * @author: ZeDongW * @date: 2020/9/28 0028 20:25 */ @RequestMapping(method = {RequestMethod.POST, RequestMethod.GET}, value = "/add") public String addMethod(User user, Model model){ model.addAttribute("user", user); return "/jsp/success.jsp"; } }
[ "878201217@qq.com" ]
878201217@qq.com
ee54bd559e88eee9f641f8981e60dac958d569ee
be3657c0c27ed5c2d8578a60aa465a4eeb81af32
/model/src/main/java/data/Service/Sundry/GatheringStorageService.java
fc24d7a9fa34a1a5b278ab49820b7fbbe4cdf1b1
[]
no_license
ChristineNJU/LogisticsManageSystem
622762359e01749db4d5fa2c63737345d323e507
9a2674e9f8c2763a5a025f293e676855ecf866c4
refs/heads/master
2021-01-21T18:11:14.433584
2016-01-05T05:10:11
2016-01-05T05:10:11
44,171,761
0
0
null
null
null
null
UTF-8
Java
false
false
1,326
java
package data.Service.Sundry; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.ArrayList; import PO.GatheringStoragePO; import State.AddState; import State.DeleteState; // TODO: Auto-generated Javadoc /** * The Interface GatheringStorageService. * * @author 尹子越 * @version 1.0.0 */ public interface GatheringStorageService extends Remote { /** * 获取需要建立收款单的快递 * * @param DB_URL 数据库连接 * @return 所有需要建立收款单的数据 * @throws RemoteException the remote exception */ public ArrayList<GatheringStoragePO> getGatheringStorage(String DB_URL) throws RemoteException; /** * 添加需要建立收款单的快递 * * @param bar_code 快递编号 * @param amount 运费 * @param DB_URL 数据库连接 * @return 添加状态 * @throws RemoteException the remote exception */ public AddState addGatheringStorage(String bar_code, double amount, String courier, String date, String DB_URL) throws RemoteException; /** * 删除需要建立收款单的快递 * * @param bar_code 快递编号 * @param DB_URL 数据库连接 * @return 删除状态 * @throws RemoteException the remote exception */ public DeleteState deleteGatheringStorage(String bar_code, String DB_URL) throws RemoteException; }
[ "yzy627@126.com" ]
yzy627@126.com
3a789136c4f6df3deaa198e7a473a9c6a1141ea0
aa9375cd50ea40b28c17b36f6007f10572929afd
/micro_sbdata/src/main/java/com/louhwz/sbdata/service/OrderServiceImpl.java
0335c76c354e00d0b99a24ee5f9528865b971ab3
[]
no_license
Louhwz/micro_cloud
4c1f0a89c16f95dfe7ad9997a96189b8a4b69749
dda1b7c19039396bd63e428d9c5296a3e73278e6
refs/heads/master
2022-06-28T17:09:29.405868
2020-03-25T11:31:26
2020-03-25T11:31:26
223,359,850
0
0
null
2022-06-21T02:29:43
2019-11-22T08:38:17
Java
UTF-8
Java
false
false
1,190
java
package com.louhwz.sbdata.service; import com.alibaba.fastjson.JSONObject; import com.louhwz.sbdata.repository.second.SandboxDAO; import com.louhwz.sbdata.utils.HotelOrder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class OrderServiceImpl implements OrderService { @Autowired SandboxDAO sandboxDAO; @Override public List<HotelOrder> getHotelOrder(Integer groupId) { return sandboxDAO.getHotelOrder(groupId); } @Override public List<Integer> getGroupList(Integer expId) { return null; } @Override public boolean readyStatus(Integer integer) { return false; } @Override public void addOrder(List<JSONObject> jsonObject) { for (int i = 0; i < jsonObject.size(); i++) { JSONObject t = jsonObject.get(i); HotelOrder increment = new HotelOrder(t.getInteger("expid"),t.getInteger("groupid"),t.getInteger("round"), t.getInteger("customer_id"),t.getInteger("room_id"),t.getInteger("price")); sandboxDAO.addOrder(increment); } } }
[ "872188659@qq.com" ]
872188659@qq.com
8e757f8aac30f2c91e842dffbaa4a5725b68a06b
1dedae65700e2887f93a94730a26c6b06d63b824
/src/net/moraleboost/flux/eval/expr/BaseExpression.java
708ba799e1c54690c0bb4d1f49ea1844dc6575db
[]
no_license
takscape/solrflux
fbbbf73abe4ce434f75e445e638716c7adb06322
5a623fe6aaac14f29aa8aa168fe4829742945326
refs/heads/master
2021-01-19T00:46:54.030736
2010-11-19T04:54:02
2010-11-19T04:54:02
32,239,291
2
0
null
null
null
null
UTF-8
Java
false
false
6,511
java
package net.moraleboost.flux.eval.expr; import java.lang.reflect.Array; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Collection; import java.util.Date; import java.util.List; import net.moraleboost.flux.eval.EvalException; import net.moraleboost.flux.eval.Expression; import net.moraleboost.flux.eval.expr.func.Function; public abstract class BaseExpression implements Expression { public BaseExpression() { } public boolean isNumber(Object o) { return (o instanceof Number); } public boolean isBigDecimal(Object o) { return (o instanceof BigDecimal); } public boolean isBigInteger(Object o) { return (o instanceof BigInteger); } public boolean isDouble(Object o) { return (o instanceof Double); } public boolean isFloat(Object o) { return (o instanceof Float); } public boolean isLong(Object o) { return (o instanceof Long); } public boolean isInteger(Object o) { return (o instanceof Integer); } public boolean isString(Object o) { return (o instanceof String); } public boolean isDate(Object o) { return (o instanceof Date); } public boolean isIndexable(Object o) { return (isList(o) || isArray(o)); } public boolean isList(Object o) { return (o instanceof List<?>); } public boolean isCollection(Object o) { return (o instanceof Collection<?>); } public boolean isArray(Object o) { return o.getClass().isArray(); } public boolean isExpression(Object o) { return (o instanceof Expression); } public boolean isFunction(Object o) { return (o instanceof Function); } public boolean isLiteralExpression(Object o) { return (o instanceof LiteralExpression); } public boolean isIdLiteral(Object o) { return (o instanceof IdLiteral); } public boolean isLiteralExpressionExcludingId(Object o) { return ((o instanceof LiteralExpression) && !(o instanceof IdLiteral)); } public boolean isValueLiteralExpression(Object o) { return ((o instanceof LiteralExpression) && !(o instanceof IdLiteral) && !(o instanceof NullLiteral) && !(o instanceof WildcardLiteral)); } public boolean isNumberLiteralExpression(Object o) { return (o instanceof NumberLiteralExpression); } public boolean isStringLiteral(Object o) { return (o instanceof StringLiteral); } public boolean isNullLiteral(Object o) { return (o instanceof NullLiteral); } public boolean isWildcardLiteral(Object o) { return (o instanceof WildcardLiteral); } public String convertToString(Object obj) { if (obj == null) { return null; } return obj.toString(); } public Boolean convertToBoolean(Object obj) { // nullは常にfalse if (obj == null) { return false; } if (obj instanceof Boolean) { // そのまま return (Boolean)obj; } else if (obj instanceof Number) { // 0でなければtrue return (0.0 == ((Number)obj).doubleValue()); } else if (obj instanceof String) { // 空でなければtrue return !((String)obj).equals(""); } else if (obj.getClass().isArray()) { // 空でなければtrue return (Array.getLength(obj) > 0); } else if (obj instanceof Collection<?>) { // 空でなければtrue return !((Collection<?>)obj).isEmpty(); } else { // nullでなければtrue(したがって、常にtrue) return true; } } public BigDecimal convertToBigDecimal(Number n) throws EvalException { if (n == null) { return null; } if (n instanceof BigDecimal) { return (BigDecimal)n; } else if (n instanceof BigInteger) { return new BigDecimal((BigInteger)n); } else if (n instanceof Double) { return new BigDecimal((Double)n); } else if (n instanceof Float) { return new BigDecimal((Float)n); } else if (n instanceof Long) { return new BigDecimal((Long)n); } else if (n instanceof Integer) { return new BigDecimal((Integer)n); } else { return new BigDecimal(n.longValue()); } } public BigInteger convertToBigInteger(Number n) { if (n == null) { return null; } if (n instanceof BigDecimal) { return ((BigDecimal)n).toBigInteger(); } else if (n instanceof BigInteger) { return (BigInteger)n; } else if (n instanceof Double) { return new BigDecimal((Double)n).toBigInteger(); } else if (n instanceof Float) { return new BigDecimal((Float)n).toBigInteger(); } else if (n instanceof Long) { return BigInteger.valueOf((Long)n); } else if (n instanceof Integer) { return BigInteger.valueOf((Integer)n); } else { return BigInteger.valueOf(n.longValue()); } } public Double convertToDouble(Number n) { if (n == null) { return null; } return n.doubleValue(); } public Float convertToFloat(Number n) { if (n == null) { return null; } return n.floatValue(); } public Long convertToLong(Number n) { if (n == null) { return null; } return n.longValue(); } public Integer convertToInteger(Number n) { if (n == null) { return null; } return n.intValue(); } }
[ "takscape@aacb1928-e75e-14ca-b3b3-5b78ae780eb8" ]
takscape@aacb1928-e75e-14ca-b3b3-5b78ae780eb8
be1f4805887f086bc1324ecfc4d9b106ce41c920
d650580c551cf5ea87c972b7b7ff9a85cf0e1bd6
/app/src/main/java/com/example/btl1server/Model/User.java
678ab4cce1fec098816553a3db728ad2c86b0331
[]
no_license
nguyenvantinh06/smartfcserver
42b8ea5b3f433249c540a6b9ee797074bb945fd2
99806bf382da101dc21e16f1fa0d2958c2b8b537
refs/heads/master
2023-08-13T20:44:58.037263
2021-09-21T04:44:39
2021-09-21T04:44:39
283,809,151
0
0
null
null
null
null
UTF-8
Java
false
false
1,023
java
package com.example.btl1server.Model; public class User { private String Name; private String Password; private String Phone; private String IsStaff; private String secureCode; public User() { } public User(String Name, String Password, String secureCode) { this.Name = Name; this.Password = Password; this.secureCode = secureCode; } public String getSecureCode(){ return secureCode;} public String getIsStaff() { return IsStaff; } public void setIsStaff(String isStaff) { IsStaff = isStaff; } public String getPhone() { return Phone; } public void setPhone(String phone) { Phone = phone; } public String getName() { return this.Name; } public void setName(String Name) { this.Name = Name; } public String getPassword() { return this.Password; } public void setPassword(String Password) { this.Password = Password; } }
[ "nguyenvantinh06@gmail.com" ]
nguyenvantinh06@gmail.com
6a673faf37ddab38a737655f06eaf7ebdcaee5b2
93ef75138eeee4cc550bac93db8bc932c5784610
/src/main/java/top/graduation/rs/repository/datajpa/VoteRepository.java
adeafaaffcb19bc3e3cb707ccf83c6397f5dd98a
[]
no_license
arshadalisoomro/voting-system
7bd8aafc92b8278d935d1255022cfb3be8b3d516
e6d75bca98028f508cb236efb7b6eb4974ab47b2
refs/heads/master
2020-04-03T08:34:10.279475
2018-10-28T22:33:26
2018-10-28T22:33:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
874
java
package top.graduation.rs.repository.datajpa; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.transaction.annotation.Transactional; import top.graduation.rs.model.Vote; import java.util.List; import java.util.Optional; /** * Created by Joanna Pakosh on Авг., 2018 */ @Transactional(readOnly = true) public interface VoteRepository extends JpaRepository<Vote, Integer> { @Override @Transactional Vote save(Vote vote); @Transactional(readOnly = true) @Query("SELECT v FROM Vote v WHERE v.user.id=:userId AND v.date=CURRENT_DATE") Optional<Vote> getTodayUserVote(@Param("userId") int userId); @Query("SELECT v FROM Vote v WHERE v.user.id=?1") List<Vote> getVotesByUser(int id); }
[ "morlineday@ukr.net" ]
morlineday@ukr.net
c150d71e403d5a686840a592612ab450d3c81a66
cb78f024dee92c8ebd365a5b27743e1de15f4115
/app/src/main/java/Tacktile/CustomView_xLarge.java
e7333cdf92ba311e93db2b01344492f33265f4de
[]
no_license
ejahn1213/test2
c4c1132c468524a85ed37a2175eed88f43b177cd
2638f14cbd1ad707d8649600705a104cbf8f97de
refs/heads/master
2021-01-23T01:34:28.438472
2017-03-23T07:24:54
2017-03-23T07:24:54
85,919,155
0
0
null
null
null
null
UTF-8
Java
false
false
6,366
java
package Tacktile; import android.content.Context; import android.content.res.Configuration; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.widget.Toast; import mirshod.braille_pad.R; /** * Created by Mirshod on 12/9/2016. */ public class CustomView_xLarge extends View { boolean check = false; String data = ""; Paint paint; Paint p ; Paint pBackground ; Paint p_white ; Paint p_red; Paint p_black; int width=0; int height=0; int wx=0; int wy=0; public CustomView_xLarge(Context context) { super(context); } public CustomView_xLarge(Context context, AttributeSet attrs) { super(context, attrs); init(); getStyleableAttributes(context, attrs); } public void setDataToCustomView(boolean m_check , String m_byte) { this.check= m_check; this.data = m_byte; invalidate(); requestLayout(); } protected void onDraw(Canvas canvas) { //TODO Auto-generated method stub super.onDraw(canvas); Log.d("CustomViewWidth" , String.valueOf(wx)); Log.d("CustomViewHeight" , String.valueOf(wy)); char[] x_test = data.toCharArray(); int x = wx/88; int y = wx/88; int radius = wx/88; int paddingW = wx/46; int paddingH = wx/46; paint.setColor(Color.parseColor("#dedede")); canvas.drawPaint(paint); paint.setColor(Color.parseColor("#000000")); p.setColor(Color.parseColor("#0000ff")); p.setStrokeWidth(10); p_white.setColor(Color.parseColor("#FFFFFF")); p_red.setColor(Color.parseColor("#FF0000")); p_black.setColor(Color.parseColor("#000000")); x = 44; int z = 0; if(check) { for (int i = 1; i < 37; i++) { //3x12 = 36 for (int j = 0; j < 24; j++) { //y = x * 12 = 24 if(j<2){ //파란선 외부 if (x_test[z] == '1') { p.setColor((Color.RED)); } else { p.setColor(Color.parseColor("#FFFFFF")); } if (j % 2 == 0) { canvas.drawCircle(x, y, radius, p); x += 44; } else { canvas.drawCircle(x, y, radius, p); x += 70; } z++; //파란선 내부 }else { if (x_test[z] == '1') { p.setColor(Color.parseColor("#000000")); } else { p.setColor(Color.parseColor("#FFFFFF")); } if (j % 2 == 0) { canvas.drawCircle(x, y, radius, p); x += 44; } else { canvas.drawCircle(x, y, radius, p); x += 70; } z++; } } if (i % 3 == 0) { x = 44; y += 58; } else { x = 44; y += 35; } } } Paint p_horizontal = new Paint(); p_horizontal.setColor(Color.parseColor("#0000ff")); p_horizontal.setStrokeWidth(7); p.setColor(Color.parseColor("#0000ff")); double horizontal_line = (double)(int)(wy/ (double)1.1); double vertical_line_wy = (double)(int)(wy/ (double)0.98); Log.d("down_line" , String.valueOf(horizontal_line)); canvas.drawLine(128,2,128, Float.parseFloat(String.valueOf(vertical_line_wy)) ,p); canvas.drawLine(128,Float.parseFloat(String.valueOf(horizontal_line)),wx,Float.parseFloat(String.valueOf(horizontal_line)),p_horizontal); // //점자 셀 그리는 부분 // if(x_test.length<833 && x_test.length > 433){ //12x12로 데이터 들어올때 그려주는 부분 // // } } protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); int widthMode = MeasureSpec.getMode(widthMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); height = MeasureSpec.getSize(heightMeasureSpec); if (widthMode != MeasureSpec.EXACTLY) { width = Integer.MAX_VALUE; } if (heightMode != MeasureSpec.EXACTLY) { height = Integer.MAX_VALUE; } this.setMeasuredDimension(width, height); wx = width; wy = height; } private void getStyleableAttributes(Context context, AttributeSet attrs) { TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.CustomView, 0, 0); } public void init() { // checkToClick(); paint = new Paint(); pBackground = new Paint(); p = new Paint(); p_white = new Paint(); p_red = new Paint(); p_black = new Paint(); } public boolean [] bytesToBooleans(byte [] bytes){ boolean [] bools = new boolean[bytes.length * 8]; for(int i = 0; i < bytes.length; i++){ int j = i * 8; bools[j] = (bytes[i] & 0x80) != 0; bools[j + 1] = (bytes[i] & 0x40) != 0; bools[j + 2] = (bytes[i] & 0x20) != 0; bools[j + 3] = (bytes[i] & 0x10) != 0; bools[j + 4] = (bytes[i] & 0x8) != 0; bools[j + 5] = (bytes[i] & 0x4) != 0; bools[j + 6] = (bytes[i] & 0x2) != 0; bools[j + 7] = (bytes[i] & 0x1) != 0; } return bools; } }
[ "nobody@4eba4c7c-4861-47f5-9413-e49eb50617bd" ]
nobody@4eba4c7c-4861-47f5-9413-e49eb50617bd
fb7eabd689aed2f553be368d4677ccd457407ff8
2bc2eadc9b0f70d6d1286ef474902466988a880f
/branches/mule-2.1.x/core/src/main/java/org/mule/transformer/wire/TransformerPairWireFormat.java
d792cdcf218925452f0d88dbe8fa1361a35910f2
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
4,330
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.transformer.wire; import org.mule.api.MuleException; import org.mule.api.DefaultMuleException; import org.mule.api.transformer.Transformer; import org.mule.api.transformer.TransformerException; import org.mule.api.transformer.wire.WireFormat; import org.mule.config.i18n.CoreMessages; import org.mule.util.IOUtils; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * TODO */ public class TransformerPairWireFormat implements WireFormat { /** * logger used by this class */ protected transient Log logger = LogFactory.getLog(getClass()); protected Transformer inboundTransformer; protected Transformer outboundTransformer; protected Class transferObjectClass; public Object read(InputStream in) throws MuleException { if (inboundTransformer == null) { throw new IllegalArgumentException(CoreMessages.objectIsNull("inboundTransformer").getMessage()); } if (inboundTransformer.isSourceTypeSupported(InputStream.class)) { return inboundTransformer.transform(in); } else { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); IOUtils.copy(in, baos); return inboundTransformer.transform(baos.toByteArray()); } catch (IOException e) { throw new DefaultMuleException(CoreMessages.failedToReadPayload(), e); } } } public void write(OutputStream out, Object o, String encoding) throws MuleException { if (outboundTransformer == null) { throw new IllegalArgumentException(CoreMessages.objectIsNull("outboundTransformer").getMessage()); } try { Class returnClass = outboundTransformer.getReturnClass(); if (returnClass == null) { logger.warn("No return class was set on transformer: " + outboundTransformer + ". Attempting to work out how to treat the result transformation"); Object result = outboundTransformer.transform(o); byte[] bytes; if (result instanceof byte[]) { bytes = (byte[]) result; } else { bytes = result.toString().getBytes(encoding); } out.write(bytes); } else if (returnClass.equals(byte[].class)) { byte[] b = (byte[]) outboundTransformer.transform(o); out.write(b); } else if (returnClass.equals(String.class)) { String s = (String) outboundTransformer.transform(o); out.write(s.getBytes(encoding)); } else { throw new TransformerException(CoreMessages.transformFailedFrom(o.getClass())); } } catch (IOException e) { throw new TransformerException(CoreMessages.transformFailedFrom(o.getClass()), e); } } public Transformer getInboundTransformer() { return inboundTransformer; } public void setInboundTransformer(Transformer inboundTransformer) { this.inboundTransformer = inboundTransformer; } public Transformer getOutboundTransformer() { return outboundTransformer; } public void setOutboundTransformer(Transformer outboundTransformer) { this.outboundTransformer = outboundTransformer; } public void setTransferObjectClass(Class clazz) { transferObjectClass = clazz; } }
[ "dfeist@bf997673-6b11-0410-b953-e057580c5b09" ]
dfeist@bf997673-6b11-0410-b953-e057580c5b09
a85b3c715bd83f7c1434a43e8ff5a9f4688bef67
edad408ccd0932360d70f72c2414ccfbe3c72033
/src/main/java/com/tutorial/java8/concurrent/CompletableFutureExample.java
89b73c61abf9c377544b2cca8cffe19096b03f13
[]
no_license
xiecong0213/java8example
30eaa52a7c3af1f98692c4781b96868fb655bdad
72dd3f88d57aa5892117cb5c4ed0994611b5a4f1
refs/heads/master
2021-01-20T20:52:16.556603
2016-07-23T13:54:37
2016-07-23T13:54:37
61,217,458
10
3
null
2016-07-23T13:54:40
2016-06-15T15:07:42
Java
UTF-8
Java
false
false
2,092
java
package com.tutorial.java8.concurrent; import java.util.Random; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Future; /** * Created by xiecong on 16/6/17. */ public class CompletableFutureExample { private static Random rand = new Random(); private static long t = System.currentTimeMillis(); static int getMoreData() { System.out.println("begin to start compute"); try { Thread.sleep(10000); } catch (InterruptedException e) { throw new RuntimeException(e); } System.out.println("end to start compute. passed " + (System.currentTimeMillis() - t)/1000 + " seconds"); return rand.nextInt(1000); } public static void main(String[] args) throws Exception { // CompletableFuture<Integer> future = CompletableFuture.supplyAsync(CompletableFutureExample::getMoreData); // Future<Integer> f = future.whenComplete((v, e) -> { // System.out.println(v); // System.out.println(e); // }); // System.out.println("hello world"); // System.out.println(f.get()); // System.in.read(); CompletableFuture<Integer> future = CompletableFuture.supplyAsync(() -> { try { Thread.sleep(3000); } catch (InterruptedException e) { throw new RuntimeException(e); } return 100; }); CompletableFuture<String> f = future.thenApplyAsync(i -> { System.out.println("i*10"); try { Thread.sleep(3000); } catch (InterruptedException e) { throw new RuntimeException(e); } return i * 10;}).thenApply(i -> { System.out.println("toString"); try { Thread.sleep(3000); } catch (InterruptedException e) { throw new RuntimeException(e); } return i.toString();}); System.out.println("hello world"); System.out.println(f.get()); //"1000" } }
[ "xiecong.xc@alibaba-inc.com" ]
xiecong.xc@alibaba-inc.com
b1f91efb21d2192eb714cfabc1e433f7d217ec89
629ab0c8886cf74af6de436461b31f12aca0c7b4
/CS142/MergeSort/src/polymorhysm/Student.java
4bc5b0b49b4c4437910dfe9c263518cfb1ed2cb7
[]
no_license
chryodem/homework
33676f107ae824dd4dd63fe6ca6823a7bbc6d444
6116847503ad1532818f75432d5db73f5fac610f
refs/heads/master
2020-08-21T08:55:26.583450
2016-01-02T02:54:27
2016-01-02T02:54:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
53
java
package polymorhysm; public class Student { }
[ "andrew.rybin@gmail.com" ]
andrew.rybin@gmail.com
8cbcb684453e28dd7086e9f492aab1432dcb7dbd
eeb4f59b8a1bac85685d1c628475a369d9bb6b80
/hoichoiAutomation/src/test/java/hoichoiAutomation/DescriptionPage.java
4ec3900694d016f6a94d618d888a591bf7dd620a
[]
no_license
vaibhavAhlawat04/TestngAutomation
97032edf1f328f68f354f84ce45cb8a8f139392d
123cc5f34169d12d0ae750d570bccb6a14dc59a5
refs/heads/master
2023-04-18T22:15:18.934301
2021-04-30T10:51:29
2021-04-30T10:51:29
350,676,916
0
0
null
null
null
null
UTF-8
Java
false
false
2,300
java
package hoichoiAutomation; import java.time.Duration; import org.openqa.selenium.By; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.Test; import io.appium.java_client.TouchAction; import io.appium.java_client.android.Activity; import io.appium.java_client.touch.WaitOptions; import io.appium.java_client.touch.offset.PointOption; public class DescriptionPage extends BaseClass { public static void main(String[] args) { BaseClass base = new BaseClass(); base.setUp(); } @Test public void Description_Page() { WebDriverWait wait = new WebDriverWait(driver,120); Activity act = new Activity("com.viewlift.hoichoi","com.viewlift.hoichoi.framework.presentation.splash.SplashActivity"); driver.startActivity(act); try { driver.findElementByAccessibilityId("Skip and Browse").click(); }catch(Exception edddd) { System.out.println("User is not loggedIn!!!!"); } wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.View/android.widget.ImageView[3]"))); scroll(); driver.findElementByXPath("//android.widget.FrameLayout/android.view.ViewGroup/android.view.View/android.view.View[10]").click(); try { driver.findElementByXPath("//android.view.ViewGroup/android.view.View/android.widget.ImageView[1]").isDisplayed(); wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@text='Play Now']"))); driver.findElementByXPath("//*[@text='Watchlist']").isDisplayed(); driver.findElementByXPath("//*[@text='Like']").isDisplayed(); driver.findElementByXPath("//*[@text='Play Trailer']").isDisplayed(); driver.findElementByXPath("//*[@text='WhatsApp']").isDisplayed(); driver.findElementByXPath("//*[@text='Share']").isDisplayed(); System.out.println("All Elements are visible."); }catch(Exception es) { System.out.println("All Elements are not Visible!!!!!!"); } } public void scroll(){ TouchAction action = new TouchAction(driver); action.press(PointOption.point(588,1418)) .waitAction(new WaitOptions().withDuration(Duration.ofMillis(3000))) .moveTo(PointOption.point(588,742)) .release() .perform(); } }
[ "vaibhav@machine" ]
vaibhav@machine
3306a9f915962b4f6d55bb2faa6861bf77320800
a1c04f4cc8380505fd990817c793e156823bf5fb
/banking-application-be/src/main/java/com/mehtas/bankingapplication/BankingApplication.java
cefdc50e498870e4f73ab353a223d46b558353d7
[]
no_license
sudarshanmehta/BankFullStackApplication
a98b9ad4335d6fe060b9dfbbeefe8ceb67322e64
d22d17ce673295d3324031fae337954080811488
refs/heads/main
2023-02-05T00:17:03.507056
2020-12-24T11:48:54
2020-12-24T11:48:54
324,138,960
0
0
null
null
null
null
UTF-8
Java
false
false
1,530
java
package com.mehtas.bankingapplication; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @SpringBootApplication @EnableWebMvc @ComponentScan(basePackages = "com.mehtas") @EntityScan("com.mehtas.models") @EnableJpaRepositories("com.mehtas.repositories") public class BankingApplication extends SpringBootServletInitializer { @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**").allowedMethods("*").allowedOrigins("*"); } }; } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(BankingApplication.class); } public static void main(String[] args) { SpringApplication.run(BankingApplication.class, args); } }
[ "sudarshan.mehtacs@gmail.com" ]
sudarshan.mehtacs@gmail.com
da540173b5a8c662d1320c07678428fb4c7bc91a
51dc42e6d17ba7a9a0ebf47bcd665b2fed9c7b34
/Number28.java
033f3153993e4521e112b31a4fe8aab22c644b11
[]
no_license
sudha-d/NumberPattern
23bd5db6d0717d831a00626e6217a26a5e0a5bbd
5dee0b7565bfc64bba2957af146ebb1c3369fc77
refs/heads/main
2023-08-22T23:43:01.596707
2021-10-11T09:49:52
2021-10-11T09:49:52
415,848,092
0
0
null
null
null
null
UTF-8
Java
false
false
460
java
package com.company; import java.util.Scanner; public class Number28 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the n value "); int n = sc.nextInt(); for (int i = n; i >= 1; i--) { for (int j = 1; j <= i; j++) { System.out.print(i + " "); } System.out.println(); } } }
[ "you@exampleSudharshan.dp@gmail.com" ]
you@exampleSudharshan.dp@gmail.com
491c5036e6b285447a26a40d9fab21ee37939833
f108c31bf39bf5047dd8c0e80e164f3b24c54a77
/cmmn-xml/cmmn-xml-core/src/main/java/org/omg/spec/cmmn/_20151109/model/TAssociationDirection.java
f120907ddcc84de1a4a8c9d948ad774ab15914e1
[ "Apache-2.0" ]
permissive
sotty/cmmn-xml
d071feebe9e0685cb893ce25c5de436f90357a53
949eeebcd7f7f77e013d6aab5836b6e1188ba167
refs/heads/master
2021-07-09T08:43:29.153541
2018-05-18T23:01:59
2018-05-18T23:01:59
96,401,870
0
0
null
2017-07-06T07:32:28
2017-07-06T07:32:28
null
UTF-8
Java
false
false
1,302
java
package org.omg.spec.cmmn._20151109.model; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for tAssociationDirection. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="tAssociationDirection"&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt; * &lt;enumeration value="None"/&gt; * &lt;enumeration value="One"/&gt; * &lt;enumeration value="Both"/&gt; * &lt;/restriction&gt; * &lt;/simpleType&gt; * </pre> * */ @XmlType(name = "tAssociationDirection") @XmlEnum public enum TAssociationDirection { @XmlEnumValue("None") NONE("None"), @XmlEnumValue("One") ONE("One"), @XmlEnumValue("Both") BOTH("Both"); private final String value; TAssociationDirection(String v) { value = v; } public String value() { return value; } public static TAssociationDirection fromValue(String v) { for (TAssociationDirection c: TAssociationDirection.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "dsotty@gmail.com" ]
dsotty@gmail.com
de07121f8909ba663e202c76cfbc43aaaedc7b1e
7711b0308855f5908d58ef5c712b4cf817c97437
/src/main/java/src/Strategy/BuscaSala/BuscaSalaNome.java
3e65e50783e976969f02b220d1736d2ed7240314
[]
no_license
lucasdantas2014/MobileCleaner
f8639bf0b98eeae98b5ae5589e127c62481802ce
ade87c418cf7524251d668e9dbdde196b24a3e2a
refs/heads/main
2023-02-23T00:52:18.960005
2021-01-27T05:24:10
2021-01-27T05:24:10
319,547,243
0
0
null
null
null
null
UTF-8
Java
false
false
537
java
package src.Strategy.BuscaSala; import src.model.Sala; import java.util.ArrayList; import java.util.List; public class BuscaSalaNome implements BuscaSalaStrategy{ @Override public List<Sala> buscar(List<Sala> listaSalas, String nome) { List<Sala> salasAchadas = new ArrayList<Sala>(); for(Sala sala: listaSalas){ if(sala.getNome().toUpperCase().contains(nome.toUpperCase())){ salasAchadas.add(sala); } } return salasAchadas; } }
[ "noreply@github.com" ]
noreply@github.com
9e318da5d892379977ac57c080264398ce4a96b4
b592aae5b8798987905a75c84c1eddcc82b7039d
/Helix/src/ua/mamamusic/accountancy/gui/TracksList.java
76be1eadd211567a7b3e9b016e61f981ebbe4a03
[]
no_license
BigStarUa/Helix
a52a0131e26deaa66b6b77f17b738530da0dc750
c9eb5dfd5c5f38790663edc42ce41071368eb690
refs/heads/master
2021-01-18T16:28:03.995048
2014-01-28T14:47:20
2014-01-28T14:47:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,651
java
package ua.mamamusic.accountancy.gui; import java.awt.BorderLayout; import java.awt.Dialog; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.List; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.JToolBar; import javax.swing.ListSelectionModel; import javax.swing.RowFilter; import javax.swing.RowSorter; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; import ua.mamamusic.accountancy.AbstractJPanel; import ua.mamamusic.accountancy.ArtistsListListener; import ua.mamamusic.accountancy.DistributorsListListener; import ua.mamamusic.accountancy.IconFactory; import ua.mamamusic.accountancy.TracksListListener; import ua.mamamusic.accountancy.model.Artist; import ua.mamamusic.accountancy.model.ArtistsListTableModel; import ua.mamamusic.accountancy.model.Distributor; import ua.mamamusic.accountancy.model.DistributorsListTableModel; import ua.mamamusic.accountancy.model.Track; import ua.mamamusic.accountancy.model.TracksListTableModel; import ua.mamamusic.accountancy.session.ArtistManager; import ua.mamamusic.accountancy.session.ArtistManagerImpl; import ua.mamamusic.accountancy.session.DistributorManager; import ua.mamamusic.accountancy.session.DistributorManagerImpl; import ua.mamamusic.accountancy.session.TrackManager; import ua.mamamusic.accountancy.session.TrackManagerImpl; import java.awt.Font; import java.awt.Color; public class TracksList extends AbstractJPanel implements TracksListListener{ /** * */ private static final long serialVersionUID = 1L; private static TracksList artistList; private JTable table; private Window window; private TableRowSorter<TableModel> sorter; private JTextField filterText; private JToolBar toolBar; private JButton editButton; private JButton delButton; private TracksListTableModel model; private TrackManagerImpl tm; private TracksList(){ setLayout(new BorderLayout()); filterText = new JTextField(); window = SwingUtilities.getWindowAncestor(TracksList.this); // Getting list of product from database tm = new TrackManagerImpl(); List<Track> list = tm.loadAllTracksOrderedBy("name"); //list = new ArrayList<>(); //Creating table model from list of products model = new TracksListTableModel(list); //Creating table table = new JTable(model); table.setGridColor(Color.LIGHT_GRAY); table.setFont(new Font("Tahoma", Font.PLAIN, 14)); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setFillsViewportHeight(true); table.setRowHeight(20); table.getColumnModel().getColumn(0).setPreferredWidth(250); table.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { JTable table = (JTable) e.getSource(); int row = table.rowAtPoint(e.getPoint()); if(row > -1 && e.getButton() == MouseEvent.BUTTON1){ if (e.getClickCount() == 2){ RowSorter<? extends TableModel> rowSorter = table.getRowSorter(); row = rowSorter.convertRowIndexToModel(row); Track track = (Track) table.getModel().getValueAt(row, -1); JDialog pf = new TrackForm(window, "Track form", track, TracksList.this); pf.setVisible(true); } } } }); ListSelectionModel listSelectionModel = table.getSelectionModel(); listSelectionModel.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if(!e.getValueIsAdjusting()){ //toolBar = getToolBar(); editButton.setEnabled(true); delButton.setEnabled(true); toolBar.repaint(); toolBar.revalidate(); } } }); //make table sortable sorter = new TableRowSorter<TableModel>(model); toolBar = getToolBar(); add(toolBar, BorderLayout.NORTH); table.setRowSorter(sorter); JScrollPane scrollPane = new JScrollPane(table); add(scrollPane, BorderLayout.CENTER); } public static synchronized TracksList getInstance(){ if(artistList == null){ artistList = new TracksList(); } return artistList; } private JToolBar getToolBar() { JToolBar toolBar = new JToolBar(); JButton addButton = new JButton(); addButton.setIcon(IconFactory.ADD32_ICON); addButton.setToolTipText("Add Distributor"); addButton.setFocusable(false); addButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { Track track = new Track(); JDialog pf = new TrackForm(window, "Track form", track, TracksList.this); pf.setVisible(true); } }); toolBar.add(addButton); editButton = new JButton(); editButton.setIcon(IconFactory.EDIT32_ICON); editButton.setToolTipText("Edit Distributor"); editButton.setFocusable(false); editButton.setEnabled(false); editButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { int row = table.getSelectedRow(); RowSorter<? extends TableModel> rowSorter = table.getRowSorter(); row = rowSorter.convertRowIndexToModel(row); if(row > -1){ Track track = (Track) table.getModel().getValueAt(row, -1); JDialog pf = new TrackForm(window, "Track form", track, TracksList.this); pf.setVisible(true); } } }); if(table.getSelectedRow() > -1){ //editButton.setEnabled(true); } toolBar.add(editButton); delButton = new JButton(); delButton.setIcon(IconFactory.DELETE32_ICON); delButton.setToolTipText("Delete Distributor"); delButton.setFocusable(false); delButton.setEnabled(false); delButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { int row = table.getSelectedRow(); RowSorter<? extends TableModel> rowSorter = table.getRowSorter(); row = rowSorter.convertRowIndexToModel(row); if(row > -1){ int selection = JOptionPane.showOptionDialog(null, "Are you sure want to delete?", "Congratulations!", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null); if(selection == JOptionPane.YES_OPTION) { } } } }); if(table.getSelectedRow() > -1){ //editButton.setEnabled(true); } toolBar.add(delButton); filterText.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent ke) { String text = filterText.getText(); if (text.length() == 0) { sorter.setRowFilter(null); } else { sorter.setRowFilter(RowFilter.regexFilter("(?i)" + text)); } if(table.getSelectedRow() == -1){ editButton.setEnabled(false); TracksList.this.toolBar.repaint(); TracksList.this.toolBar.revalidate(); } //getListener().fireUpdate(); //filterText.requestFocusInWindow(); } }); toolBar.add(filterText); return toolBar; } @Override public void saveTrack(Track track) { TrackManager tm = new TrackManagerImpl(); if(track.getId() > 0){ tm.updateTrack(track); System.out.println("Product updated"); }else{ tm.saveNewTrack(track); model.addTrack(track); System.out.println("Product saved"); } } }
[ "hleborezk@bigmir.net" ]
hleborezk@bigmir.net
c03d3c15a7ce596ea8ce1bbad1c7fcc61f503ae7
0f25c402b6fec40505327d9c9776ae8241f90322
/mynewtest1/src/test/java/Selenium/Demo2.java
c69307cda44c875ea784e2684383c2212708ca45
[]
no_license
aravindkumarguggilla5813/mynewtestrepository
1f20b10db8cd18863b0087aa4746ce0f57777426
373a5a88fbe5be50ae47f899f1f77f9655d00c51
refs/heads/master
2020-04-03T19:06:42.052497
2018-10-31T06:25:28
2018-10-31T06:25:28
155,510,572
0
0
null
null
null
null
UTF-8
Java
false
false
1,161
java
package Selenium; import java.io.File; import org.openqa.selenium.By; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.testng.Assert; import org.testng.annotations.Test; public class Demo2 { WebDriver driver =null; @Test public void f() { WebDriver driver =DriverUtility.getDriver("chrome"); driver.manage().window().maximize(); driver.get("http://demowebshop.tricentis.com/"); driver.findElement(By.linkText("Log in")).click(); driver.findElement(By.xpath("//*[@id='Email']")).sendKeys("aravind.guggilla57@gmail.com"); driver.findElement(By.xpath("//*[@id='Password']")).sendKeys("aravind"); String s1=driver.getTitle(); System.out.println(s1); Assert.assertTrue("Demo Web Shop. Login".startsWith("Demo")); driver.findElement(By.xpath("html/body/div[4]/div[1]/div[4]/div[2]/div/div[2]/div[1]/div[2]/div[2]/form/div[5]/input")).click(); //File scrFile=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); //FileUtils.copyFile(scrFile, new File("C:\\Users\\aravind.g.kumar\\Desktop\\Mercury Tours\\screenshot.png")); } }
[ "aravind.g.kumar@BDC4-L-1SL6QQ2.dir.svc.accenture.com" ]
aravind.g.kumar@BDC4-L-1SL6QQ2.dir.svc.accenture.com
4c8a1808cba2b1b89c2a072d9e0b9e17e91670e3
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/facebook/imagepipeline/transcoder/ImageTranscoder.java
86d0f5160fe6c79abc5172505f8813dd38790858
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
759
java
package com.facebook.imagepipeline.transcoder; import com.facebook.imageformat.ImageFormat; import com.facebook.imagepipeline.common.ResizeOptions; import com.facebook.imagepipeline.common.RotationOptions; import com.facebook.imagepipeline.image.EncodedImage; import java.io.IOException; import java.io.OutputStream; public interface ImageTranscoder { boolean canResize(EncodedImage encodedImage, RotationOptions rotationOptions, ResizeOptions resizeOptions); boolean canTranscode(ImageFormat imageFormat); String getIdentifier(); ImageTranscodeResult transcode(EncodedImage encodedImage, OutputStream outputStream, RotationOptions rotationOptions, ResizeOptions resizeOptions, ImageFormat imageFormat, Integer num) throws IOException; }
[ "noiz354@gmail.com" ]
noiz354@gmail.com
26dde4aae5c3a5c1f63d4ac10f46765a067d529e
4848f4f788393344129fab9d00b0e7e5a96a06b4
/commonslibrary/src/main/java/com/geekandroid/sdk/sample/commonslibrary/utils/ViewUtils.java
d48cb2efb24010ed2ee3797c9c2cfc8f4fde6a3c
[]
no_license
915767647/geeksdk
444c370c1135c04e6e9f7492509acbb1d1ee86f8
8001d1107a2a82bd326943c74e537cfa7ef36579
refs/heads/master
2020-12-28T23:24:09.748727
2016-04-27T14:25:21
2016-04-27T14:25:21
57,936,078
0
0
null
2016-05-03T02:37:32
2016-05-03T02:37:32
null
UTF-8
Java
false
false
1,183
java
package com.geekandroid.sdk.sample.commonslibrary.utils; import android.view.View; import android.view.animation.AlphaAnimation; /** * date : 2016-02-24 15:07 * author : Mickaecle gizthon * description : */ public class ViewUtils { /** * 显示布局 */ public static void showView(View view) { if (view != null && view.getVisibility() == View.GONE) { view.setVisibility(View.VISIBLE); setShowAnimation(view, 400); } } /** * 隐藏布局 */ public static void hideView(View view) { if (view != null && view.getVisibility() == View.VISIBLE) { view.setVisibility(View.GONE); } } /** * 渐现动画 * * @param view * @param duration */ public static void setShowAnimation(View view, int duration) { AlphaAnimation mShowAnimation = null; if (null == view || duration < 0) { return; } mShowAnimation = new AlphaAnimation(0.0f, 1.0f); mShowAnimation.setDuration(duration); mShowAnimation.setFillAfter(true); view.startAnimation(mShowAnimation); } }
[ "719007146@qq.com" ]
719007146@qq.com
15d5c14f1788917b6a8fac0d8f2979fc425b44ec
d418cd85c274add99c026bdeb9578125de0c0966
/shopping cart for resturant/src/main/java/filter/GeneralFilter.java
e257be34fb4ab229b9eacbc6bbc8415ecd1751fd
[]
no_license
SamuelTesfabruk/SamuelTesfabruk.github.io
8bbbcc6033447768ab8aefcf23a9d2e2ae01aa46
a05bae2b06e6413781ba3df0b38f41855356043e
refs/heads/master
2022-11-28T21:06:08.131548
2019-07-20T21:43:27
2019-07-20T21:43:27
193,566,173
0
0
null
null
null
null
UTF-8
Java
false
false
1,186
java
package filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import dao.ShoppingCartDao; @WebFilter({"*"}) public class GeneralFilter implements Filter{ @Override public void destroy() { } @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) servletRequest; ShoppingCartDao shoppingCartDao = (ShoppingCartDao) req.getSession().getAttribute("shoppingCartDao"); if(shoppingCartDao == null){ req.getSession().setAttribute("numItems", 0); }else{ req.getSession().setAttribute("numItems", shoppingCartDao.getMyCart().size()); } filterChain.doFilter(servletRequest, servletResponse); } }
[ "samyyasm@gmail.com" ]
samyyasm@gmail.com
b03c67956c98f8d2b550b430a1d0dde99d7118c0
7fc2aa79d5dbadda97dba57be81db973f20a12d8
/app/src/main/java/com/example/tema1/MainActivity.java
4e15131eec3529614e5d1b555b7a5150334dc037
[]
no_license
octavian00/SMA
3b98724218f03adf9a5eec1274cf49b471452cff
abe094d376bf19e7155daab7b4e6e1cc74e6d9e9
refs/heads/master
2023-01-31T13:28:27.288560
2020-12-14T07:47:54
2020-12-14T07:47:54
303,392,900
0
0
null
null
null
null
UTF-8
Java
false
false
4,096
java
package com.example.tema1; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.Toast; public class MainActivity extends AppCompatActivity { LinearLayout ll_dialog; Button btn_ok,btn_cancel,btn_arataDialogul, btn_sharedPreferences,btn_file,btn_room,btn_login,btn_fireaseLogin, btn_addBook; EditText edt_Text; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setViews(); onClickButtons(); } private void setViews(){ ll_dialog=findViewById(R.id.linearLayout_Dialog); btn_arataDialogul = findViewById(R.id.btn_showDialog); btn_ok = findViewById(R.id.btn_OK); btn_cancel = findViewById(R.id.btn_Cancel); edt_Text = findViewById(R.id.edt_Text); btn_sharedPreferences = findViewById(R.id.btn_sharedPreferences); btn_file = findViewById(R.id.btn_file); btn_room = findViewById(R.id.btn_room); btn_login = findViewById(R.id.btn_login); btn_fireaseLogin = findViewById(R.id.btn_loginFirebase); btn_addBook = findViewById(R.id.btn_addBookFirebase); } private void onClickButtons(){ btn_arataDialogul.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ll_dialog.setVisibility(LinearLayout.VISIBLE); } }); btn_cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(getApplicationContext(),"Operatie anulata",Toast.LENGTH_SHORT).show(); ll_dialog.setVisibility(LinearLayout.INVISIBLE); } }); btn_ok.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String text= edt_Text.getText().toString(); if(text.isEmpty()){ Toast.makeText(getApplicationContext(),"Introuceti un text",Toast.LENGTH_SHORT).show(); }else{ newActivity(text); ll_dialog.setVisibility(LinearLayout.INVISIBLE); } } }); btn_sharedPreferences.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sharedActivity(SharedPreference.class); } }); btn_file.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sharedActivity(File.class); } }); btn_room.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sharedActivity(RoomPlusSQL.class); } }); btn_login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sharedActivity(LoginActivity.class); } }); btn_fireaseLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sharedActivity(LoginFirebase.class); } }); btn_addBook.setOnClickListener((new View.OnClickListener() { @Override public void onClick(View v) { sharedActivity(AddShowFirebaseData.class); } })); } private void newActivity(String text){ Intent intent = new Intent(this,SecondActivity.class); intent.putExtra("text",text); startActivity(intent); } private void sharedActivity(Class classs){ Intent intent = new Intent(this, classs); startActivity(intent); } }
[ "vilceanuoctavian06@gmail.com" ]
vilceanuoctavian06@gmail.com
03610127b92a5423d83d8a3a5ba25a6cd202ca54
03330a651aaf4b7d3f2cb774ea33d50efebd240b
/rulesCoverageTest/src/main/java/com/acme/brms/engine/GenericRuleEngineImpl.java
7b81ee9db4473e2d4192cd300000ec6d90779e24
[ "Apache-2.0" ]
permissive
lichyc/BRMS-RulesCoverageTest
b8c93f4f7b3bb20197e7db4c6c5b0c7cfe43a8ca
ca095e4da15c28c6c42d0b0d6669cc279efade18
refs/heads/master
2021-11-29T00:29:59.069537
2016-01-27T16:02:16
2016-01-27T16:02:16
24,323,181
0
0
null
null
null
null
UTF-8
Java
false
false
2,991
java
/** * JBoss, Home of Professional Open Source * Copyright 2013, Red Hat, Inc. and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package com.acme.brms.engine; import java.util.HashMap; import com.acme.brms.domain.SimpleFact; import com.redhat.gps.util.properties.PropertiesManager; /** * Implementation of a generic rules engine as Singleton making use of {@link GenericJBossBRMSEngineManager}. * * @author <a href="mailto:clichybi@redhat.com">Carsten Lichy-Bittendorf</a> * @version $Revision$ */ public class GenericRuleEngineImpl implements GenericRuleEngine { static GenericRuleEngine me = null; HashMap<String, GenericJBossBRMSEngineManager> kbaseMap; private GenericRuleEngineImpl(){ super(); kbaseMap = new HashMap<String, GenericJBossBRMSEngineManager>(); } public static GenericRuleEngine getInstance(){ if (me == null) { me = new GenericRuleEngineImpl(); } return me; } private GenericJBossBRMSEngineManager getGenericJBossBRMSEngineManager( String ruleSetName) throws Exception { if (kbaseMap.containsKey(ruleSetName)) { return kbaseMap.get(ruleSetName); } else { // String ruleBase = PropertiesManager.getInstance("com.acme.brms").getProperty(ruleSetName); // if(ruleBase != null && !ruleBase.isEmpty()) { GenericJBossBRMSEngineManager nextManager = new GenericJBossBRMSEngineManager(ruleSetName); kbaseMap.put(ruleSetName, nextManager); return nextManager; // } else { // throw new Exception(String.format("No rule base location found for name: %s.", ruleSetName)); // } } } public SimpleFact executeRulesOnWorkpackage(SimpleFact facts, String ruleSetName) throws Exception { GenericJBossBRMSEngineManager engineManager = getGenericJBossBRMSEngineManager(ruleSetName); return engineManager.executeRulesOnWorkpackage(facts); } public SimpleFact[] executeRulesOnWorkpackages(SimpleFact[] facts, String ruleSetName) throws Exception { GenericJBossBRMSEngineManager engineManager = getGenericJBossBRMSEngineManager(ruleSetName); return engineManager.executeRulesOnWorkpackage(facts); } }
[ "clichybi@redhat.com" ]
clichybi@redhat.com
8f5ed17bf360a3b98e06f946e46010c9637c41e6
37c4fb7f0ea2fe941004ed1762c7ea26c01d08bf
/src/com/codeonline/publicString/PublicString.java
bf19492a2c0b51343c4ba568861175ecb172ed05
[]
no_license
justinzhf/Compiler-Online
fa6a549cdaf2cdbaa0ace3afd590e65c214ecfaf
0a27d32751f1dae7d843348bdf6c989211e6a0a1
refs/heads/master
2021-01-18T23:49:03.062342
2019-02-13T02:57:12
2019-02-13T02:57:12
50,432,812
0
0
null
2016-08-06T12:55:20
2016-01-26T14:10:51
JavaScript
UTF-8
Java
false
false
736
java
/** * Created by zhf on 2016/8/1. */ package com.codeonline.publicString; public class PublicString { public static final String USERNAME="your visitor"; public static final String PASSWORD="your password"; public static final String SHELLSESSION="shellSession"; public static final String PRINTWRITER="printWriter"; public static final String CONNECTION="connection"; public static final String SOURCEFILEPUBLICPATH="/home/visitor/sourcefiles/"; public static final String STDOUT="stdout"; public static final String STDERR="stderr"; public static final String WEBSOCKET_ADDRESS="ws://139.129.95.147:40966/CodeOnline/websocket"; public static final String SSH_SERVER_ADDRESS="192.168.0.2"; }
[ "zhang huaifeng" ]
zhang huaifeng
e80c400dd81b7ac3c819d8aa85bc7948ac651678
e26086dbe3a354f1948f06d310bd893591ae827c
/app/src/main/java/com/example/user/finish_project/activities/MainActivity.java
c4f32b767803ca98cb0ecfa29715138c1cd5bbd3
[]
no_license
veronika667700/Weather
a3f75204fd58ebcb37f9a9f2871e08378353a2ff
1283df0af9f57148f80aaa22e694e069574aa704
refs/heads/master
2021-01-10T02:00:15.550018
2015-12-24T19:10:37
2015-12-24T19:10:37
48,499,323
0
0
null
null
null
null
UTF-8
Java
false
false
8,310
java
package com.example.user.finish_project.activities; import android.app.AlertDialog; import android.app.Fragment; import android.app.FragmentTransaction; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.widget.Toast; import com.example.user.finish_project.FormatWeather; import com.example.user.finish_project.NetworkHelper; import com.example.user.finish_project.PreferenceHelper; import com.example.user.finish_project.R; import com.example.user.finish_project.ResourceHelper; import com.example.user.finish_project.Weather; import com.example.user.finish_project.fragments.DetailFragment; import com.example.user.finish_project.fragments.SettingsFragment; import com.example.user.finish_project.fragments.WeatherFragment; public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, WeatherFragment.OnItemPressed, WeatherFragment.OnRefresh { private Boolean exitNow; private SettingsFragment settingsFragment; private WeatherFragment weatherFragment; private DetailFragment detailWeatherFragment; private Boolean isSettingsFragmentActive; private Boolean isWeatherFragmentActive; /* ============================================ onCreate ======================================== */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); exitNow = false; toolbarAndNavigationDrawerInit(); setContexts(); initSharedPreferences(); initFragments(); setWeatherFragment(); } private void toolbarAndNavigationDrawerInit() { // toolbar - ссылка на виджет Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); // вызов setSupportActionBar() - чтобы Toolbar отобразился в методе onCreate() setSupportActionBar(toolbar); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); } private void setContexts() { FormatWeather.setContext(this); PreferenceHelper.setContext(this); NetworkHelper.setContext(this); ResourceHelper.setContext(this); } private void initSharedPreferences() { if (PreferenceHelper.getPreference(R.string.metric) == null) { PreferenceHelper.setPreference(R.string.metric, getString(R.string.celsium)); } if (PreferenceHelper.getPreference(R.string.city) == null) { if (getString(R.string.lang).equals("en")) { PreferenceHelper.setPreference(R.string.city, "Koeln"); } else { PreferenceHelper.setPreference(R.string.city, "Koeln"); } } } private void initFragments() { settingsFragment = new SettingsFragment(); weatherFragment = new WeatherFragment(); detailWeatherFragment = new DetailFragment(); } /* ======================================= onBackPressed ======================================== */ @Override public void onBackPressed() { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START)) { exitNow = false; drawer.closeDrawer(GravityCompat.START); } else { onFragmentBackPressed(); } } // При смене города, или при смене метрики, или попадении на экран настроек, // старая БД удаляется, создается новая и заполняется новыми данными private void onFragmentBackPressed() { if (!isWeatherFragmentActive) { if (isSettingsFragmentActive) { refresh(); } else { setWeatherFragment(); } } else { if (exitNow) { super.onBackPressed(); } else { Toast.makeText(this, getString(R.string.back), Toast.LENGTH_SHORT).show(); exitNow = true; } } } /* =============================== onNavigationItemSelected ===================================== */ @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (getFragmentManager().getBackStackEntryCount() > 0) { getFragmentManager().popBackStack(); } switch (id) { case R.id.nav_restart: refresh(); break; case R.id.nav_settings: setSettingsFragment(); break; } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } private void refresh() { setWeatherFragment(); weatherFragment.refresh(); } /* ======================================== setFragment ========================================= */ // при запуске приложения MainActivity загружает фрагмент weatherFragment private void setWeatherFragment() { setCurrentFragment(weatherFragment); isWeatherFragmentActive = true; isSettingsFragmentActive = false; } private void setSettingsFragment() { setCurrentFragment(settingsFragment); isSettingsFragmentActive = true; isWeatherFragmentActive = false; } private void setFragment(Fragment fragment) { setCurrentFragment(fragment); isWeatherFragmentActive = false; isSettingsFragmentActive = false; } // подгрузка нужного фрагмента private void setCurrentFragment(Fragment fragment) { FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.main_container, fragment); fragmentTransaction.commit(); exitNow = false; } /* ====================================== Interfaces ============================================ */ @Override protected void onPause() { super.onPause(); weatherFragment.removeOnItemPressedListener(); weatherFragment.removeOnRefreshListener(); } @Override protected void onResume() { super.onResume(); weatherFragment.setOnItemPressedListener(this); weatherFragment.setOnRefreshListener(this); } public void itemPressed(Weather weather) { detailWeatherFragment.getWeather(weather); setFragment(detailWeatherFragment); } // Интернет public void showAlertDialog(Context context, String title, String message, Boolean status) { AlertDialog alertDialog = new AlertDialog.Builder(context).create(); //Настраиваем название Alert Dialog: alertDialog.setTitle(title); //Настраиваем сообщение: alertDialog.setMessage(message); //Настраиваем кнопку OK alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); //Отображаем сообщение диалога: alertDialog.show(); } }
[ "veronika-saakova@rambler.ru" ]
veronika-saakova@rambler.ru
b231e4c3eafaef0caa13c37787694c28b61f9126
9270ad3576e85a1733b2c7d857daf215bd61b165
/src/main/java/ParadigmaFuncional/interfacesFuncionais/Consumidores.java
58e295aa3ca473773565102357a867ddae9c55e2
[]
no_license
AlanPoveda/AprendendoJavaAvancado
633069fa92a185918c1267b94597f971bc87eb13
950a1142ddc7e80f1bbf24ba999ee1258a128f62
refs/heads/master
2023-06-06T08:36:36.528541
2021-06-25T02:46:28
2021-06-25T02:46:28
379,689,631
1
0
null
null
null
null
UTF-8
Java
false
false
354
java
package ParadigmaFuncional.interfacesFuncionais; import java.util.function.Consumer; public class Consumidores { public static void main(String[] args) { //Usando consumers Consumer<String> imprimirUmaFrase = System.out::println; //necessário ter um accept imprimirUmaFrase.accept("Olá como estas?"); } }
[ "alsepoveda@gmail.com" ]
alsepoveda@gmail.com
e6bdc943939f7c8c4dcb5a407f1b5d5b7837e09f
fc388adac5feae2f3ad60761e0afc31cb59054a3
/Java/Spring/RabbitMQ/RabbitMQFirst/src/test/java/com/spring/amqp/rabbit/AppTest.java
5b4d1367291d9ffd419d16fcdb759407eb055605
[]
no_license
danelumax/yoga
74e81fe2be8b8b0303737ab6f4e66d6376dc2079
392b59d9748b7e67d4634902f0101fe3f3bc3e42
refs/heads/master
2020-04-06T04:59:53.426037
2017-04-22T15:28:01
2017-04-22T15:28:01
64,764,037
2
0
null
null
null
null
UTF-8
Java
false
false
688
java
package com.spring.amqp.rabbit; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "474198699@qq.com" ]
474198699@qq.com
f062b73c6e4e0a288763083bad8b5495eec5f06c
06127a2937d3dca62781b1fee588b8f7abb69594
/app/src/main/java/com/externie/cqulecture/BaseActivity.java
346c82bceb5e1227fba409dedcdc1f75530688ca
[]
no_license
externIE/CQULecture
4f5aca8706e986248512f4fd480e9733807084fc
c931b041a65eafe5182712ae9281ee6185d05b70
refs/heads/master
2021-01-21T14:02:04.218809
2016-05-23T01:15:35
2016-05-23T01:15:35
54,456,516
0
0
null
null
null
null
UTF-8
Java
false
false
2,345
java
package com.externie.cqulecture; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import butterknife.ButterKnife; import de.greenrobot.event.EventBus; /** * Created by externIE on 16/5/12. */ public class BaseActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public void setContentView(int layoutResID) { super.setContentView(layoutResID); ButterKnife.bind(this); onViewCreated(); } @Override public void setContentView(View view) { super.setContentView(view); ButterKnife.bind(this); onViewCreated(); } @Override public void setContentView(View view, ViewGroup.LayoutParams params) { super.setContentView(view, params); ButterKnife.bind(this); onViewCreated(); } @Override protected void onResume() { super.onResume(); EventBus.getDefault().register(this); } @Override protected void onPause() { super.onPause(); EventBus.getDefault().unregister(this); } protected void onViewCreated() {} protected boolean filterException(Exception e) { if (e != null) { e.printStackTrace(); toast(e.getMessage()); return false; } else { return true; } } protected void toast(String str) { Toast.makeText(this, str, Toast.LENGTH_SHORT).show(); } protected void showToast(String content) { Toast.makeText(this, content, Toast.LENGTH_SHORT).show(); } protected void showToast(int resId) { Toast.makeText(this, resId, Toast.LENGTH_SHORT).show(); } protected void startActivity(Class<?> cls) { Intent intent = new Intent(this, cls); startActivity(intent); } protected void startActivity(Class<?> cls, String... objs) { Intent intent = new Intent(this, cls); for (int i = 0; i < objs.length; i++) { intent.putExtra(objs[i], objs[++i]); } startActivity(intent); } // public void onEvent(EmptyEvent event) {} }
[ "externIE@outlook.com" ]
externIE@outlook.com
5606b7a4fe3632fd9669458acf7768feb80a29c2
7a8262797d4428ff119a24b255e582c171f539b4
/week5/myserver/RMIDeploy.java
61069213db3b8b7abb20180579d11e37db0ef3fb
[]
no_license
NazerkeBS/Distributed-Systems
93afbbdd124bc01b166ff4dcb5443f25bb40a241
d7e445eaf2129e9a4f0175fe1dbefa59ac308a6c
refs/heads/master
2020-04-22T23:37:50.422248
2019-05-28T21:12:32
2019-05-28T21:12:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
import java.rmi.registry.*; public class RMIDeploy { public static void main(String[] args) throws Exception{ final int PORT = 12345; Registry registry = LocateRegistry.createRegistry(PORT); registry.rebind("rmiAppendGuy", new AppendText("tomato")); registry.rebind("rmiAppendGirl", new AppendText("girl")); } }
[ "nazerke.seidan@cloudera.com" ]
nazerke.seidan@cloudera.com
4fa04721bf58d9e31e8b181b47e0fe47a8f1052e
9af2fa3262e73899614dfc60b8ba72f3c2f25260
/GithubAndroidprojects/ShootMyShow/app/src/main/java/com/Shootmyshow/praful/shootmyshow/CompletedBookings.java
4ca542d4fb1884cffbd764d2dc0e81af2c4cd424
[]
no_license
praful67/My-android-apps
d59dc762b48f6191d74ab639965adea2917241f8
8e0cb24d52690146af715f82d2ae4eae33b25262
refs/heads/master
2020-04-09T11:49:41.171887
2018-12-04T14:25:59
2018-12-04T14:25:59
160,325,287
0
0
null
null
null
null
UTF-8
Java
false
false
3,147
java
package com.Shootmyshow.praful.shootmyshow; import android.content.pm.ActivityInfo; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ListView; import android.widget.TextView; import com.Shootmyshow.praful.shootmyshow.Common.Common; import com.Shootmyshow.praful.shootmyshow.Model.Bookings; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; import com.google.firebase.FirebaseApp; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.List; public class CompletedBookings extends AppCompatActivity { FirebaseDatabase firebaseDatabase; DatabaseReference databaseReference; ListView listdata; List<Bookings> bookingsList = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_completed_bookings); FirebaseApp.initializeApp(this); firebaseDatabase = FirebaseDatabase.getInstance(); databaseReference = firebaseDatabase.getReference(); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); getWindow().getAttributes().windowAnimations = R.style.Dialogslide2; AdView adView = (AdView) findViewById(R.id.ad_banner); AdRequest adRequest = new AdRequest.Builder().build(); adView.loadAd(adRequest); FloatingActionButton back = (FloatingActionButton) findViewById(R.id.back); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); listdata = (ListView)findViewById(R.id.listofcompletedbookings); addEventFirebaselistener(); } private void addEventFirebaselistener() { databaseReference.child("CompletedcustomerBookings").child(Common.userid).orderByKey().addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if (bookingsList.size() > 0) bookingsList.clear(); for (DataSnapshot dataSnapshot1:dataSnapshot.getChildren()){ Bookings users = dataSnapshot1.getValue(Bookings.class); bookingsList.add(users); } CompletedbookingsAdapter adapter = new CompletedbookingsAdapter(CompletedBookings.this , bookingsList); TextView t = (TextView)findViewById(R.id.t); listdata.setEmptyView(t); listdata.setAdapter(adapter); // showt(); } @Override public void onCancelled(DatabaseError databaseError) { } }); } }
[ "prafulbykr@gmail.com" ]
prafulbykr@gmail.com
6ce6940c049e0a260a90336d3059300b0416a577
7a87860293197f2484a671c1cd1fe09bf4cf3236
/src/main/java/com/bookStore/admin/notice/service/impl/AdminNoticeService.java
7171cfeb769eb13830408669a000bc99d0d39503
[]
no_license
liuziwen1998/maven
9457f888aef42437e0034116b4559f06bf07df1b
621c130f69197c3c6992c3fb248077eb2aa8c217
refs/heads/master
2020-03-21T00:22:16.016490
2018-06-19T12:47:07
2018-06-19T12:47:07
137,889,655
0
0
null
null
null
null
UTF-8
Java
false
false
1,371
java
package com.bookStore.admin.notice.service.impl; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bookStore.admin.notice.dao.IAdminNoticeDao; import com.bookStore.admin.notice.service.IAdminNoticeService; import com.bookStore.commons.beans.Notice; import com.bookStore.utils.PageModel; @Service public class AdminNoticeService implements IAdminNoticeService { @Autowired private IAdminNoticeDao adminNoticeDao; @Override public List<Notice> findListNotice(PageModel pageModel) { Map map = new HashMap(); map.put("start", pageModel.getFirstLimitParam()); map.put("pageSize", pageModel.getPageSize()); return adminNoticeDao.selectListNotice(map); } @Override public int addNotice(Notice notice) { return adminNoticeDao.insertNotice(notice); } @Override public Notice findNoticeById(Integer id) { return adminNoticeDao.selectNoticeById(id); } @Override public int modifyNotice(Notice notice) { return adminNoticeDao.updateNotice(notice); } @Override public int removeNoticeById(Integer id) { return adminNoticeDao.deleteNoticeById(id); } @Override public int findNoticeCount() { return adminNoticeDao.selectNoticeCount(); } }
[ "Administrator@XTZ-01805151102" ]
Administrator@XTZ-01805151102
eeeade28ca5eeb7789095db9ce75013b32d41648
6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386
/google/cloud/tasks/v2beta3/google-cloud-tasks-v2beta3-java/proto-google-cloud-tasks-v2beta3-java/src/main/java/com/google/cloud/tasks/v2beta3/PurgeQueueRequest.java
894999cda27d012ecfe008a548310a32bea6fe6a
[ "Apache-2.0" ]
permissive
oltoco/googleapis-gen
bf40cfad61b4217aca07068bd4922a86e3bbd2d5
00ca50bdde80906d6f62314ef4f7630b8cdb6e15
refs/heads/master
2023-07-17T22:11:47.848185
2021-08-29T20:39:47
2021-08-29T20:39:47
null
0
0
null
null
null
null
UTF-8
Java
false
true
20,672
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/tasks/v2beta3/cloudtasks.proto package com.google.cloud.tasks.v2beta3; /** * <pre> * Request message for [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue]. * </pre> * * Protobuf type {@code google.cloud.tasks.v2beta3.PurgeQueueRequest} */ public final class PurgeQueueRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2beta3.PurgeQueueRequest) PurgeQueueRequestOrBuilder { private static final long serialVersionUID = 0L; // Use PurgeQueueRequest.newBuilder() to construct. private PurgeQueueRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private PurgeQueueRequest() { name_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new PurgeQueueRequest(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private PurgeQueueRequest( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.tasks.v2beta3.CloudTasksProto.internal_static_google_cloud_tasks_v2beta3_PurgeQueueRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.tasks.v2beta3.CloudTasksProto.internal_static_google_cloud_tasks_v2beta3_PurgeQueueRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.tasks.v2beta3.PurgeQueueRequest.class, com.google.cloud.tasks.v2beta3.PurgeQueueRequest.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** * <pre> * Required. The queue name. For example: * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * </pre> * * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code> * @return The name. */ @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <pre> * Required. The queue name. For example: * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * </pre> * * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code> * @return The bytes for name. */ @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.tasks.v2beta3.PurgeQueueRequest)) { return super.equals(obj); } com.google.cloud.tasks.v2beta3.PurgeQueueRequest other = (com.google.cloud.tasks.v2beta3.PurgeQueueRequest) obj; if (!getName() .equals(other.getName())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.cloud.tasks.v2beta3.PurgeQueueRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * Request message for [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue]. * </pre> * * Protobuf type {@code google.cloud.tasks.v2beta3.PurgeQueueRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2beta3.PurgeQueueRequest) com.google.cloud.tasks.v2beta3.PurgeQueueRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.tasks.v2beta3.CloudTasksProto.internal_static_google_cloud_tasks_v2beta3_PurgeQueueRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.tasks.v2beta3.CloudTasksProto.internal_static_google_cloud_tasks_v2beta3_PurgeQueueRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.tasks.v2beta3.PurgeQueueRequest.class, com.google.cloud.tasks.v2beta3.PurgeQueueRequest.Builder.class); } // Construct using com.google.cloud.tasks.v2beta3.PurgeQueueRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); name_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.tasks.v2beta3.CloudTasksProto.internal_static_google_cloud_tasks_v2beta3_PurgeQueueRequest_descriptor; } @java.lang.Override public com.google.cloud.tasks.v2beta3.PurgeQueueRequest getDefaultInstanceForType() { return com.google.cloud.tasks.v2beta3.PurgeQueueRequest.getDefaultInstance(); } @java.lang.Override public com.google.cloud.tasks.v2beta3.PurgeQueueRequest build() { com.google.cloud.tasks.v2beta3.PurgeQueueRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.tasks.v2beta3.PurgeQueueRequest buildPartial() { com.google.cloud.tasks.v2beta3.PurgeQueueRequest result = new com.google.cloud.tasks.v2beta3.PurgeQueueRequest(this); result.name_ = name_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.tasks.v2beta3.PurgeQueueRequest) { return mergeFrom((com.google.cloud.tasks.v2beta3.PurgeQueueRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.tasks.v2beta3.PurgeQueueRequest other) { if (other == com.google.cloud.tasks.v2beta3.PurgeQueueRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.tasks.v2beta3.PurgeQueueRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.tasks.v2beta3.PurgeQueueRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object name_ = ""; /** * <pre> * Required. The queue name. For example: * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * </pre> * * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code> * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Required. The queue name. For example: * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * </pre> * * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code> * @return The bytes for name. */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * Required. The queue name. For example: * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * </pre> * * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code> * @param value The name to set. * @return This builder for chaining. */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * <pre> * Required. The queue name. For example: * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * </pre> * * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code> * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * <pre> * Required. The queue name. For example: * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` * </pre> * * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code> * @param value The bytes for name to set. * @return This builder for chaining. */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.tasks.v2beta3.PurgeQueueRequest) } // @@protoc_insertion_point(class_scope:google.cloud.tasks.v2beta3.PurgeQueueRequest) private static final com.google.cloud.tasks.v2beta3.PurgeQueueRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.tasks.v2beta3.PurgeQueueRequest(); } public static com.google.cloud.tasks.v2beta3.PurgeQueueRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<PurgeQueueRequest> PARSER = new com.google.protobuf.AbstractParser<PurgeQueueRequest>() { @java.lang.Override public PurgeQueueRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new PurgeQueueRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<PurgeQueueRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<PurgeQueueRequest> getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.tasks.v2beta3.PurgeQueueRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "bazel-bot-development[bot]@users.noreply.github.com" ]
bazel-bot-development[bot]@users.noreply.github.com
e91817f154311b9f0c07c337a313927a3b37cabb
7bfa77a8dee5f3882ad0f441a87a8ef4752139be
/core/src/main/java/by/bsuir/runets/runetwork/core/database/model/Task.java
a09c5cfb5736e5030ba93f0cdb5d1b3f328c422b
[]
no_license
EkaterinaRunets/run-et-work
042cd8598d3d25c831caf04647e956d2940ae4a9
6e3fcc3eb7cf856e6bb0d37eae6b6fcccd51e134
refs/heads/master
2021-01-09T20:08:10.344407
2017-02-26T11:11:27
2017-02-26T11:11:27
81,236,346
0
0
null
null
null
null
UTF-8
Java
false
false
2,716
java
package by.bsuir.runets.runetwork.core.database.model; import by.bsuir.runets.runetwork.core.database.model.enums.TaskStatus; import javax.persistence.*; import java.util.Date; @Entity @Table(name = "Task") public class Task { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Integer id; @Column(name = "name") private String name; @Column(name = "description") private String description; @Column(name = "status") @Enumerated(EnumType.STRING) private TaskStatus status; @Column(name = "result") private String result; @Column(name = "creation_date") private Date creationDate; @Column(name = "update_date") private Date updateDate; @Column(name = "deadline_date") private Date deadlineDate; @ManyToOne @JoinColumn(name = "creator_id") private User creator; @ManyToOne @JoinColumn(name = "assignee_id") private User assignee; @ManyToOne @JoinColumn(name = "course_id") private Course course; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public TaskStatus getStatus() { return status; } public void setStatus(TaskStatus status) { this.status = status; } public String getResult() { return result; } public void setResult(String result) { this.result = result; } public Date getCreationDate() { return creationDate; } public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } public Date getUpdateDate() { return updateDate; } public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } public Date getDeadlineDate() { return deadlineDate; } public void setDeadlineDate(Date deadlineDate) { this.deadlineDate = deadlineDate; } public User getCreator() { return creator; } public void setCreator(User creator) { this.creator = creator; } public User getAssignee() { return assignee; } public void setAssignee(User assignee) { this.assignee = assignee; } public Course getCourse() { return course; } public void setCourse(Course course) { this.course = course; } }
[ "ekaterina_runec@mail.ru" ]
ekaterina_runec@mail.ru
b94073e879b7b2cd7547d74a3670e8541014d18e
cbcc40ec8b116bd53cf8da070666858accb88e9b
/src/main/java/de/ugoe/cs/tcs/simparameter/softgraph/MethodMember.java
c83b6f5c1270047091f794f2409f15c6c959a41f
[ "Apache-2.0" ]
permissive
dhonsel/SimParameter
f324633d0d0233d033a7a84ef0f1f41c4bcdf2f7
0fdb27ccc532f434ef34bf62c673913e73b2079a
refs/heads/main
2022-12-20T02:08:57.246585
2020-10-22T12:26:30
2020-10-22T12:26:30
305,702,067
0
0
null
null
null
null
UTF-8
Java
false
false
437
java
package de.ugoe.cs.tcs.simparameter.softgraph; import org.jgrapht.graph.DefaultEdge; public class MethodMember extends DefaultEdge { private SoftwareClass c; private SoftwareMethod m; public MethodMember(SoftwareClass c, SoftwareMethod m) { this.c = c; this.m = m; } public SoftwareClass getSoftwareClass() { return c; } public SoftwareMethod getSoftwareMethod() { return m; } }
[ "daniel.honsel@gmail.com" ]
daniel.honsel@gmail.com
e694d9ab0b5f53005781c14e0d36473a137256a8
3f8a54d861f363b6c2d8ed5ca1016419644b6f9b
/first-jpa/src/main/java/com/cg/dao/EmpDeptDao.java
0f484e897291b67e0735b6241511dbbcc17df1a0
[]
no_license
Arvish0609/MavenExample
3efbc14344ce896ea504d833076ec0378855a6bb
637e197caa0766dadfc5bde1d576902b9f989310
refs/heads/master
2021-07-13T20:31:46.539798
2019-10-10T09:55:42
2019-10-10T09:55:42
214,146,276
0
0
null
2020-10-13T16:37:17
2019-10-10T09:50:36
Java
UTF-8
Java
false
false
215
java
package com.cg.dao; import com.cg.entity.Department; import com.cg.entity.Employee; public interface EmpDeptDao { void save(Object e); Employee fetch(int id); Department fetchDept(int id); }
[ "=" ]
=
53ffc2b0cf2e3137e8000a7d35fdc68a0acdef03
20ba83249756b90d030d54c533f0270a849dd9f9
/src/main/java/it/euris/academy/LibraryProject/Service/Impl/AuthorServiceImpl.java
be8f63acb888ce816f57104634e31a6e1388fef1
[]
no_license
atlassers/aca_sei_gg
826681837ba07a4e7a3902c793f402162ebf703c
ac4d29bbae480e6586d14465e5502543208f594f
refs/heads/main
2023-08-02T06:26:04.763482
2021-09-29T07:51:53
2021-09-29T07:51:53
411,283,642
0
0
null
null
null
null
UTF-8
Java
false
false
2,390
java
package it.euris.academy.LibraryProject.Service.Impl; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import it.euris.academy.LibraryProject.Repository.AuthorRepository; import it.euris.academy.LibraryProject.Service.AuthorService; import it.euris.academy.LibraryProject.data.Dto.AuthorDto; import it.euris.academy.LibraryProject.data.Model.Author; @Service public class AuthorServiceImpl implements AuthorService{ @Autowired private AuthorRepository authorRepository; @Override public List<AuthorDto> getAll(){ return authorRepository.findAll().stream().map(Author::toDto).collect(Collectors.toList()); } @Override public AuthorDto get(Long id) { Optional<Author> author = authorRepository.findById(id); return author.isPresent() ? author.get().toDto() : null; } @Override public AuthorDto insert(AuthorDto authorDto) { if(authorDto.getAuthorId() != null) throw new RuntimeException(); return authorRepository.save(authorDto.toModel()).toDto(); } @Override public AuthorDto update(AuthorDto authorDto) { if(authorDto.getAuthorId() == null) throw new RuntimeException(); return authorRepository.save(authorDto.toModel()).toDto(); } @Override public Boolean delete(Long id) { authorRepository.deleteById(id); return authorRepository.findById(id).isEmpty(); } @Override public List<AuthorDto> getAuthorByName(String name) { return authorRepository.findAuthorByName(name). stream(). map(Author::toDto) .collect(Collectors.toList()); } @Override public List<AuthorDto> getAuthorByCountry(String country) { return authorRepository.findAuthorByCountry(country) .stream() .map(Author::toDto) .collect(Collectors.toList()); } @Override public List<AuthorDto> getAuthorByGender(String gender) { return authorRepository.findAuthorByGender(gender). stream(). map(Author::toDto). collect(Collectors.toList()); } @Override public Long getTotalAuthorRows() { return authorRepository.getAuthorTotalRows(); } @Override public Long getTotalAuthorRowsDeleted() { return authorRepository.getAuthorTotalRowsDeleted(); } @Override public Long getTotalAuthorRowsNotDeleted() { return authorRepository.getAuthorTotalRowsNotDeleted(); } }
[ "gabrielegriecomusician@gmail.com" ]
gabrielegriecomusician@gmail.com
894bf2ceb437e657378dd27d7aa66abb8df9b8ce
cd8b4a01820743c56f9d00998e77c5e2b132a29e
/src/android/Unifypay.java
7636b082f03aec89366b6306af2cfe0fa1353270
[]
no_license
jackxu2011/cordova-plugin-unify-pay
313c110052d1c0393381104db2229c0af7087c3a
ce32c4c351b91253bfd5196d132ef3d326c6dfc9
refs/heads/master
2020-04-05T19:33:58.136523
2019-09-29T06:31:15
2019-09-29T06:31:15
157,140,473
0
0
null
null
null
null
UTF-8
Java
false
false
8,429
java
package com.linkcld.cordova; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.util.Log; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaArgs; import org.apache.cordova.CordovaPlugin; import org.apache.cordova.PluginResult; import org.json.JSONException; import java.util.ArrayList; import java.util.concurrent.CountDownLatch; import com.chinaums.pppay.unify.UnifyPayListener; import com.chinaums.pppay.unify.UnifyPayPlugin; import com.chinaums.pppay.unify.UnifyPayRequest; public class Unifypay extends CordovaPlugin implements UnifyPayListener { public static String TAG = "cordova-plugin-unify-pay"; public static final String ERROR_WECHAT_NOT_INSTALLED = "未安装微信"; public static final String ERROR_INVALID_PARAMETERS = "参数格式错误"; public static final String ERROR_SEND_REQUEST_FAILED = "发送请求失败"; public static final String ERROR_WECHAT_RESPONSE_COMMON = "普通错误"; public static final String ERROR_WECHAT_RESPONSE_USER_CANCEL = "用户点击取消并返回"; public static final String ERROR_WECHAT_RESPONSE_SENT_FAILED = "发送失败"; public static final String ERROR_WECHAT_RESPONSE_AUTH_DENIED = "授权失败"; public static final String ERROR_WECHAT_RESPONSE_UNSUPPORT = "微信不支持"; public static final String ERROR_WECHAT_RESPONSE_UNKNOWN = "未知错误"; public static final String ERROR_PERMISSION_DENIED_ERROR = "权限请求被拒绝"; public static final String SEND_PAY_REQUEST = "支付请求已发送"; public static final String UP_PAY = "00"; public static final String UP_PAY_MODE = "00"; /** * 安卓6以上动态权限相关 */ private static final int REQUEST_CODE = 1100001; public static final String[] permissions = { Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE }; protected static CallbackContext currentCallbackContext; private CountDownLatch countDownLatch; @Override protected void pluginInitialize() { super.pluginInitialize(); UnifyPayPlugin.getInstance(cordova.getActivity()).setListener(this); Log.d(TAG, "plugin initialized."); } public static boolean isAlipayInstalled(Context context) { PackageManager packageManager = context.getPackageManager(); try { return packageManager.getPackageInfo("com.eg.android.AlipayGphone", 0) != null; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); return false; } } private boolean hasPermissions() { for(String p : permissions) { if(!cordova.hasPermission(p)) { return false; } } return true; } private void requestPermission() { ArrayList<String> permissionsToRequire = new ArrayList<String>(); for(String p : permissions) { if(!cordova.hasPermission(p)) { permissionsToRequire.add(p); } } String[] _permissionsToRequire = new String[permissionsToRequire.size()]; _permissionsToRequire = permissionsToRequire.toArray(_permissionsToRequire); cordova.requestPermissions(this, REQUEST_CODE, _permissionsToRequire); } public void onRequestPermissionResult(int requestCode, String[] permissions, int[] grantResults) { if (requestCode != REQUEST_CODE) { return; } countDownLatch.countDown(); } @Override public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) { Log.i(TAG, "Execute:" + action + " with :" + args.toString()); if(action.equals("isUppayAppInstalled")) { isUppayAppInstalled(callbackContext); return true; } if(action.equals("pay")) { try{ String channel = getChannel(args.getString(0)); if(channel == null) { callbackContext.error("参数错误"); return true; } if(channel.equals(UnifyPayRequest.CHANNEL_WEIXIN)) { callbackContext.error("本插件不支付微信,请使用微信插件支付"); return true; } } catch (JSONException e) { Log.i(TAG, e.getMessage()); callbackContext.error("参数错误"); return true; } cordova.getThreadPool().execute(new Runnable() { public void run() { if(!hasPermissions()) { countDownLatch = new CountDownLatch(1); requestPermission(); try { countDownLatch.await(); if(!hasPermissions()) { Log.e(TAG, ERROR_PERMISSION_DENIED_ERROR); getCurrentCallbackContext().error(ERROR_PERMISSION_DENIED_ERROR); return; } } catch (InterruptedException e) { Log.e(TAG, e.getMessage()); getCurrentCallbackContext().error(e.getMessage()); } } try{ String channel = getChannel(args.getString(0)); String payData = args.getString(1); if(channel == null || payData == null) { callbackContext.error("参数错误"); return; } sendPaymentRequest(channel, payData, callbackContext); } catch (JSONException e) { Log.i(TAG, e.getMessage()); callbackContext.error("参数错误"); } } }); return true; } return false; } private void isUppayAppInstalled(CallbackContext callbackContext) { callbackContext.success(UPPayAssistEx.UPPayAssistEx(cordova.getActivity())); } protected void sendPaymentRequest(String channel, String payData, CallbackContext callbackContext) { currentCallbackContext = callbackContext; if(channel.equals(UP_PAY)) { String tn = ""; try { JSONObject e = new JSONObject(payData); tn = e.getString("tn"); } catch (JSONException e1) { Log.i(TAG, e1.getMessage()); callbackContext.error("参数错误"); return; } UPPayAssistEx.startPay (cordova.getActivity(), null, null, tn, UP_PAY_MODE); } else { UnifyPayRequest msg = new UnifyPayRequest(); msg.payChannel = channel; msg.payData = payData; UnifyPayPlugin.getInstance(cordova.getActivity()).sendPayRequest(msg); } sendNoResultPluginResult(callbackContext); } private String getChannel(String channel) { switch (channel) { case UnifyPayRequest.CHANNEL_ALIPAY: return UnifyPayRequest.CHANNEL_ALIPAY; case UnifyPayRequest.CHANNEL_WEIXIN: return UnifyPayRequest.CHANNEL_WEIXIN; case UnifyPayRequest.CHANNEL_UMSPAY: return UnifyPayRequest.CHANNEL_UMSPAY; case UP_PAY: return UP_PAY; default: return null; } } @Override public void onResult(String resultCode, String resultInfo) { Log.i(TAG, resultInfo); if(UnifyPayListener.ERR_OK.equals(resultCode)) { currentCallbackContext.success(); } else { currentCallbackContext.error(resultInfo); } currentCallbackContext = null; } public static CallbackContext getCurrentCallbackContext() { return currentCallbackContext; } private void sendNoResultPluginResult(CallbackContext callbackContext) { // send no result and keep callback PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT); result.setKeepCallback(true); callbackContext.sendPluginResult(result); } }
[ "xulingcom@126.com" ]
xulingcom@126.com
710e0b96f6da7b44e12b0bfe720a2c4fabc6ab0c
ef48998106ca08aacd40f3ab01feb3c8c3cbb1a2
/SmartPhoneSuperPlus/SmartPhoneAppPlus/src/main/java/toyoko/inn/com/smartphoneappplus/adapter/G05_ExpandableListAdapter.java
305cd007eff7a254deaf8dfe65ef4693cd5a6afd
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
faridaub/HotelReservationApp
a2746a140c35bc32e4d8d9eb86faa65e402c5a92
31119a6ff7fef921740950304679a37598725f21
refs/heads/master
2020-06-04T22:18:54.749087
2015-06-11T02:17:05
2015-06-11T02:17:05
37,233,934
0
0
null
null
null
null
UTF-8
Java
false
false
6,457
java
package toyoko.inn.com.smartphoneappplus.adapter; /** * Created by Farid on 2014/11/12. */ import java.util.List; import java.util.Map; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Color; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.BaseExpandableListAdapter; import android.widget.ImageView; import android.widget.TextView; import toyoko.inn.com.smartphoneappplus.R; public class G05_ExpandableListAdapter extends BaseExpandableListAdapter { private Activity context; private Map<String, List<String>> prefectureCollections; private List<String> countryListData; private List<String> countryCodeListData; private List<String> areaListData; private List<String> areaCodeListData; private List<String> stateListData; private List<String> stateCodeListData; private List<String> numHoelListData; public G05_ExpandableListAdapter(Activity context,List<String> countryListPram,List<String> countryCodeListPram, List<String> areaListPram, List<String> areaCodeListPram, List<String> stateListPram,List<String> stateCodeListPram, List<String> hotelnumListPram, Map<String, List<String>> fulldataCollections) { this.context = context; this.countryListData = countryListPram; this.countryCodeListData=countryCodeListPram; this.areaListData = areaListPram; this.areaCodeListData =areaCodeListPram; this.stateListData = stateListPram; this.stateCodeListData = stateCodeListPram; this.numHoelListData =hotelnumListPram; this.prefectureCollections = fulldataCollections; } public Object getChild(int groupPosition, int childPosition) { return prefectureCollections.get(areaListData.get(groupPosition)).get(childPosition); } public long getChildId(int groupPosition, int childPosition) { return childPosition; } public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { final String prefecture = (String) getChild(groupPosition, childPosition); LayoutInflater inflater = context.getLayoutInflater(); if (convertView == null) { // convertView = inflater.inflate(R.layout.child_item, null); convertView = inflater.inflate(R.layout.g05_child,null); } TextView item = (TextView) convertView.findViewById(R.id.g05_child_area_name); item.setTextColor(Color.BLACK); ImageView delete = (ImageView) convertView.findViewById(R.id.g05_child_right_arrow); delete.setOnClickListener(new OnClickListener() { public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage("Do you want to remove?"); builder.setCancelable(false); builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { List<String> child = prefectureCollections.get(areaListData.get(groupPosition)); child.remove(childPosition); notifyDataSetChanged(); } }); builder.setNegativeButton("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alertDialog = builder.create(); alertDialog.show(); } }); item.setText(prefecture); return convertView; } public int getChildrenCount(int groupPosition) { return prefectureCollections.get(areaListData.get(groupPosition)).size(); } public Object getGroup(int groupPosition) { return areaListData.get(groupPosition); } public Object getAreaCode(int groupPosition) { return areaCodeListData.get(groupPosition); } public Object getGroupHotelNum(int groupPosition) { return numHoelListData.get(groupPosition); } public Object getCountry(int groupPosition) { return countryListData.get(groupPosition); } public Object getCountryCode(int groupPosition) { return countryCodeListData.get(groupPosition); } public Object getState(int groupPosition) { return stateListData.get(groupPosition); } public Object getStateCode(int groupPosition) { return stateCodeListData.get(groupPosition); } public int getGroupCount() { return areaListData.size(); } public long getGroupId(int groupPosition) { return groupPosition; } //Group Method public View getGroupView(int groupPosition, boolean isExpanded,View convertView, ViewGroup parent) { String areaName = (String) getGroup(groupPosition); String numHotel = (String) getGroupHotelNum(groupPosition); if (convertView == null) { LayoutInflater infalInflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = infalInflater.inflate(R.layout.g05_group, null); } //Number Of Group TextView groupName = (TextView) convertView.findViewById(R.id.g05_group_area_name); groupName.setTypeface(null, Typeface.BOLD); groupName.setTextColor(Color.BLACK); groupName.setText(areaName); //Number of Hotel TextView nmbrHotel = (TextView)convertView.findViewById(R.id.g05_group_numberofhotel); nmbrHotel.setTypeface(null, Typeface.BOLD); nmbrHotel.setTextColor(Color.RED); nmbrHotel.setText(numHotel); return convertView; } public boolean hasStableIds() { return true; } public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } }
[ "faridjapan112@gmail.com" ]
faridjapan112@gmail.com
e2424284a29667f465ec063c54897507323947da
5380d690a7aa87188d6f4eea0cc4a15f39fe9bf6
/baseabner/src/main/java/com/abner/ming/base/BaseAppCompatActivity.java
de54298bfaa508e6b32edce691c77be25d85ab4b
[]
no_license
ming723/baseabner
ba2ef37965abc1d39fed885141612459d9ba8a86
750aba6b5068d797c1953b68625307d8a35d0044
refs/heads/master
2020-06-01T22:24:45.615922
2019-09-29T01:25:45
2019-09-29T01:25:45
190,950,281
2
0
null
null
null
null
UTF-8
Java
false
false
5,005
java
package com.abner.ming.base; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.util.SparseArray; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.abner.ming.base.R; import com.abner.ming.base.mvp.model.BaseModelIml; import com.abner.ming.base.mvp.presenter.BasePresenterIml; import com.abner.ming.base.mvp.view.BaseView; import java.util.HashMap; import java.util.Map; /** * author:AbnerMing * date:2019/4/18 */ public abstract class BaseAppCompatActivity extends AppCompatActivity implements BaseView { private RelativeLayout titleLayout; private TextView baseTitle, titleRight; private ImageView baseBack; private BasePresenterIml basePresenter; /** * 设置标题 */ protected void setTitle(String title) { baseTitle.setText(title); } //是否显示返回键 protected void isShowBack(boolean showBack) { if (showBack) { baseBack.setVisibility(View.VISIBLE); } else { baseBack.setVisibility(View.GONE); } } protected void setShowTitle(boolean isShow) { if (isShow) { titleLayout.setVisibility(View.GONE); } else { titleLayout.setVisibility(View.VISIBLE); } } @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_base); titleLayout = (RelativeLayout) findViewById(R.id.base_layout_title); baseTitle = (TextView) findViewById(R.id.base_title); baseBack = (ImageView) findViewById(R.id.base_view_back); titleRight = (TextView) findViewById(R.id.base_title_right); //创建用于添加子类传递的布局 LinearLayout baseView = (LinearLayout) findViewById(R.id.base_view); //拿到子类布局 View childView = View.inflate(this, getLayoutId(), null); baseView.addView(childView); initView(); initData(); baseBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); } //初始化View protected abstract void initData(); //初始化View protected abstract void initView(); //子类传递的一个layout public abstract int getLayoutId(); protected void toast(String msg) { Toast.makeText(this, msg, Toast.LENGTH_LONG).show(); } //获取BasePresenterIml null为获取字符串,获取JavaBean需要传JavaBean public BasePresenterIml getPresenter(Class cls) { BaseModelIml baseModel = new BaseModelIml(cls); baseModel.isShowLoading(isShowLoading); baseModel.isReadCache(isReadCache); baseModel.setContext(this); baseModel.setHead(headMap); basePresenter = new BasePresenterIml(baseModel, this); return basePresenter; } //isShowLoading 是否显示加载框 isReadCache 是否阅读缓存 获取String protected BasePresenterIml net(boolean isShowLoading, boolean isReadCache) { return doHttp(null, isShowLoading, isReadCache); } //获取JavaBean protected BasePresenterIml net(boolean isShowLoading, boolean isReadCache, Class cls) { return doHttp(cls, isShowLoading, isReadCache); } protected BasePresenterIml doHttp(Class cls, boolean isShowLoading, boolean isReadCache) { isShowLoading(isShowLoading); isReadCache(isReadCache); return getPresenter(cls); } //是否读取缓存 private boolean isReadCache; public void isReadCache(boolean isReadCache) { this.isReadCache = isReadCache; } //是否显示加载框 private boolean isShowLoading; public void isShowLoading(boolean isShowLoading) { this.isShowLoading = isShowLoading; } private Map<String, String> headMap = new HashMap<>(); public void setHead(Map<String, String> headMap) { this.headMap = headMap; } @Override public void success(int type, String data) { } @Override public void successBean(int type, Object o) { } @Override public void fail(int type, String error) { } private SparseArray<View> sparseArray = new SparseArray<>(); //用于获取控件的方法 public View get(int id) { View view = sparseArray.get(id); if (view == null) { view = findViewById(id); sparseArray.put(id, view); } return view; } @Override protected void onDestroy() { super.onDestroy(); if (basePresenter != null) { basePresenter.destory(); } } }
[ "598254259@qq.com" ]
598254259@qq.com
35ec4b54965cae120f798d48f87a692650fa69d6
dc963f275a62e91a53d695317081faacf887d9b5
/src/main/java/com/mohan/project/easytools/file/FileTools.java
2922ee7ae00525c4b20223cf3af4e361e806d4c0
[]
no_license
wangyao88/EasyTools
632a15f4ab4dd575a0cb66fbeffdf148c159633a
a27e90ac014ee2bb10c093e1681a730cbe9ea033
refs/heads/master
2021-07-09T07:10:25.821289
2020-09-27T03:32:55
2020-09-27T03:32:55
195,818,752
0
0
null
null
null
null
UTF-8
Java
false
false
2,208
java
package com.mohan.project.easytools.file; import com.mohan.project.easytools.common.StringTools; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.LineNumberReader; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Optional; /** * File工具类 * @author mohan * @date 2018-08-29 13:15:22 */ public final class FileTools { /** * 系统换行符 */ public static final String LF = java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction("line.separator")); private FileTools() {} /** * 获取指定文件内容 * @param path 文件路径 * @return 指定文件内容 */ public static Optional<List<String>> getLines(String path) { try { File file = new File(path); if(!file.exists() || file.isDirectory()) { return Optional.empty(); } return Optional.ofNullable(Files.readAllLines(Paths.get(path), StandardCharsets.UTF_8)); } catch (IOException e) { return Optional.empty(); } } /** * 获取指定文件内容 * @param path 文件路径 * @return 指定文件内容 */ public static Optional<String> getContent(String path) { Optional<List<String>> optional = getLines(path); List<String> lines = optional.orElse(new ArrayList<>()); if(lines.isEmpty()) { return Optional.empty(); } return Optional.of(StringTools.appendJoinLF(lines)); } /** * 获取文件行数 * @param filePath 文件路径 * @return */ public static int getFileLineNum(String filePath) { try (LineNumberReader lineNumberReader = new LineNumberReader(new FileReader(filePath))){ lineNumberReader.skip(Long.MAX_VALUE); int lineNumber = lineNumberReader.getLineNumber(); //实际上是读取换行符数量 , 所以需要+1 return lineNumber + 1; } catch (IOException e) { return -1; } } }
[ "wangyao@cis.com.cn" ]
wangyao@cis.com.cn
331bf98b2882de39a4d4e9edaac275fa87fed06a
9b75d8540ff2e55f9ff66918cc5676ae19c3bbe3
/bazaar8.apk-decompiled/sources/b/i/k/r.java
fb2c20bac64f17653239de8b6a4adaa330a2d5d2
[]
no_license
BaseMax/PopularAndroidSource
a395ccac5c0a7334d90c2594db8273aca39550ed
bcae15340907797a91d39f89b9d7266e0292a184
refs/heads/master
2020-08-05T08:19:34.146858
2019-10-06T20:06:31
2019-10-06T20:06:31
212,433,298
2
0
null
null
null
null
UTF-8
Java
false
false
1,739
java
package b.i.k; import android.view.View; import android.view.ViewTreeObserver; /* compiled from: OneShotPreDrawListener */ public final class r implements ViewTreeObserver.OnPreDrawListener, View.OnAttachStateChangeListener { /* renamed from: a reason: collision with root package name */ public final View f2824a; /* renamed from: b reason: collision with root package name */ public ViewTreeObserver f2825b; /* renamed from: c reason: collision with root package name */ public final Runnable f2826c; public r(View view, Runnable runnable) { this.f2824a = view; this.f2825b = view.getViewTreeObserver(); this.f2826c = runnable; } public static r a(View view, Runnable runnable) { if (view == null) { throw new NullPointerException("view == null"); } else if (runnable != null) { r rVar = new r(view, runnable); view.getViewTreeObserver().addOnPreDrawListener(rVar); view.addOnAttachStateChangeListener(rVar); return rVar; } else { throw new NullPointerException("runnable == null"); } } public boolean onPreDraw() { a(); this.f2826c.run(); return true; } public void onViewAttachedToWindow(View view) { this.f2825b = view.getViewTreeObserver(); } public void onViewDetachedFromWindow(View view) { a(); } public void a() { if (this.f2825b.isAlive()) { this.f2825b.removeOnPreDrawListener(this); } else { this.f2824a.getViewTreeObserver().removeOnPreDrawListener(this); } this.f2824a.removeOnAttachStateChangeListener(this); } }
[ "MaxBaseCode@gmail.com" ]
MaxBaseCode@gmail.com
3cdbc9348669a0755d6e84eede53ae3e869cecf1
ebdcaff90c72bf9bb7871574b25602ec22e45c35
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201802/cm/LabelServiceInterfacemutate.java
762c05cbb28aba68f079cd4d52f061910efc45e8
[ "Apache-2.0" ]
permissive
ColleenKeegan/googleads-java-lib
3c25ea93740b3abceb52bb0534aff66388d8abd1
3d38daadf66e5d9c3db220559f099fd5c5b19e70
refs/heads/master
2023-04-06T16:16:51.690975
2018-11-15T20:50:26
2018-11-15T20:50:26
158,986,306
1
0
Apache-2.0
2023-04-04T01:42:56
2018-11-25T00:56:39
Java
UTF-8
Java
false
false
2,971
java
// Copyright 2018 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.api.ads.adwords.jaxws.v201802.cm; 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.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * * Applies the list of mutate operations. * * @param operations The operations to apply. The same {@link Label} cannot be specified in * more than one operation. * @return The applied {@link Label}s. * @throws ApiException when there is at least one error with the request * * * <p>Java class for mutate element declaration. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;element name="mutate"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="operations" type="{https://adwords.google.com/api/adwords/cm/v201802}LabelOperation" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "operations" }) @XmlRootElement(name = "mutate") public class LabelServiceInterfacemutate { protected List<LabelOperation> operations; /** * Gets the value of the operations 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 operations property. * * <p> * For example, to add a new item, do as follows: * <pre> * getOperations().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link LabelOperation } * * */ public List<LabelOperation> getOperations() { if (operations == null) { operations = new ArrayList<LabelOperation>(); } return this.operations; } }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
4d5f7724c6afd457710f42723cb8257ae78309ca
ccd5b90672415a38f099ec715e4b3b7dbfce0c24
/trunk/src/citibob/jschema/SqlGen.java
44f4d35a2093f241c679e7a604bd89c114fbe194
[]
no_license
BackupTheBerlios/jschema-svn
93e4787c9d4a9caa70a13f9700ef3f8e12419bb9
b60ab57155ca42843171fb627850e2771d482efa
refs/heads/master
2020-12-30T10:36:24.590485
2008-01-06T07:00:06
2008-01-06T07:00:06
40,802,931
0
0
null
null
null
null
UTF-8
Java
false
false
3,161
java
/* JSchema: library for GUI-based database applications This file Copyright (c) 2006-2007 by Robert Fischer This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package citibob.jschema; import java.sql.*; import citibob.sql.ConsSqlQuery; import static citibob.jschema.RowStatusConst.*; /** NOTE: Implementations of this interface do not NECESSARILY have to be Schema-based; however, it is expected that most will be. */ public interface SqlGen // extends RowStatusConst //, citibob.swing.table.JTypeTableModel { int getRowCount(); /** Has the given row changed value since it was loaded with data? */ boolean valueChanged(int row); /** Was the given row inserted or deleted since being read from database? */ public int getStatus(int row); /** After we've updated the DB, use this to clear status bits. */ public void setStatus(int row, int status); // ============================================================== // Interface as a Table or portion of a SQL query public void setColPrefix(String colPrefix); public String getDefaultTable(); // =============================================================== // Read rows from the database /** Adds a row, but doesn't fire any events; it's the caller's responsibility to fire events when all rows are added. */ public int addRowNoFire(ResultSet rs, int rowIndex) throws SQLException; /** Fire event after addRowNoFire() calls. Generally will be implemented by AbstractTableModel */ public void fireTableRowsInserted(int firstRow, int lastRow); /** Add a new row from the current place in a result set */ void addRow(ResultSet rs) throws SQLException; /** Add all the rows from a result set, starting with rs.next(), then close the result set. */ void addAllRows(ResultSet rs) throws SQLException; /** Removes a row from the buffer... */ void removeRow(int row); /** Undoes any edits... */ //public void resetRow(int row); ///** Convenience functions for single-row SchemaBufs */ //void setOneRow(ResultSet rs); // =============================================================== // Write rows to the database /** Makes update query update column(s) represented by this object. */ void getUpdateCols(int row, ConsSqlQuery q, boolean updateUnchanged); void getInsertCols(int row, ConsSqlQuery q, boolean insertUnchanged); /** Adds the where clauses corresponding to the currently stored keyfield values. */ void getWhereKey(int row, ConsSqlQuery q, String table); //void getInsertKey(int row, SqlQuery q); /** If schema-based, just a passthrough to the underlying Schema. */ void getSelectCols(ConsSqlQuery q, String table); }
[ "citibob@d6ec988e-330a-0410-a053-bb7e04c116e2" ]
citibob@d6ec988e-330a-0410-a053-bb7e04c116e2
86baa8a8e1201cbbd29222b376d82cb9db52b302
4975fc633e881f7d3a7bffebdf0b2e2c09b48811
/src/main/java/com/kk/springbootjpa/param/UserParam.java
bf1fd0a098ad32ece335c5876ff1e1aa9c5a8932
[]
no_license
zhaokuankuan/springboot-jpa
66c1ed8cd8054ccc07d918992d4abbe49a5f6386
e0a7cedafa1a93025deefe58eca9d2a85c2eb544
refs/heads/master
2021-04-12T11:42:29.555733
2018-03-23T08:16:49
2018-03-23T08:16:49
126,453,340
0
0
null
null
null
null
UTF-8
Java
false
false
922
java
package com.kk.springbootjpa.param; import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.NotEmpty; import javax.validation.constraints.Max; import javax.validation.constraints.Min; public class UserParam { @NotEmpty(message = "用户姓名不能为空!") private String userName; @NotEmpty(message = "密码不能为空!") @Length(min = 6,message = "密码不能小于6位!") private String passWord; private int age; public void setUserName(String userName) { this.userName = userName; } public void setPassWord(String passWord) { this.passWord = passWord; } public void setAge(int age) { this.age = age; } public String getUserName() { return userName; } public String getPassWord() { return passWord; } public int getAge() { return age; } }
[ "zhaokk@yonyou.com" ]
zhaokk@yonyou.com
f33276a9df28168d16ab5470fbeb1a624ba4e43e
530f82d7a34fbb126e8d6fb0e8e36b1654af11b7
/Session3/3.7/src/Starter.java
97f4feb7544684a66eebfd5451102a7a18ed3ec3
[]
no_license
Nissen99/SDJ2
785e44a4709e97cb92d2ff2c9304ae22ebaf96bc
2fefa7fee4dbc0c0dad1508bd0401993823c9d1b
refs/heads/main
2023-04-04T14:35:38.758302
2021-04-10T23:47:58
2021-04-10T23:47:58
337,340,932
2
0
null
null
null
null
UTF-8
Java
false
false
116
java
public class Starter { public static void main(String[] args) { // THIS NEED JAVA FX 2 SO IT GONE BOI } }
[ "Mikkelnj411@gmail.com" ]
Mikkelnj411@gmail.com
43bc32d7274aefc3b24a066a63da03928ceaf45e
eef7020ccdbd720c1927208007aad71258a4e049
/app/src/main/java/com/cdiving/cdiving/entity/UserInfo.java
b2f973c0a407d6384745cde32138656f1f90819f
[]
no_license
myxiao7/cDiving
25a1002f1904ccb05742f97b8dc17f080f4a9cfe
20e44999591127e4e2adb32705258391101fc7d1
refs/heads/master
2020-04-03T15:16:31.923404
2018-11-22T07:27:51
2018-11-22T07:28:02
155,196,471
0
0
null
null
null
null
UTF-8
Java
false
false
2,766
java
package com.cdiving.cdiving.entity; import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Generated; import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Transient; /** * 用户信息 * @author zhanghao * @date 2018-08-23. */ @Entity public class UserInfo { @Id private Long ids; private int code; private String message; private String uid; private String uname; private String email; private String portrait; private String oauth_token; private String oauth_token_secret; private boolean isLogin; @Generated(hash = 33299582) public UserInfo(Long ids, int code, String message, String uid, String uname, String email, String portrait, String oauth_token, String oauth_token_secret, boolean isLogin) { this.ids = ids; this.code = code; this.message = message; this.uid = uid; this.uname = uname; this.email = email; this.portrait = portrait; this.oauth_token = oauth_token; this.oauth_token_secret = oauth_token_secret; this.isLogin = isLogin; } @Generated(hash = 1279772520) public UserInfo() { } public Long getIds() { return this.ids; } public void setIds(Long ids) { this.ids = ids; } public int getCode() { return this.code; } public void setCode(int code) { this.code = code; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public String getUid() { return this.uid; } public void setUid(String uid) { this.uid = uid; } public String getUname() { return this.uname; } public void setUname(String uname) { this.uname = uname; } public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } public String getPortrait() { return this.portrait; } public void setPortrait(String portrait) { this.portrait = portrait; } public String getOauth_token() { return this.oauth_token; } public void setOauth_token(String oauth_token) { this.oauth_token = oauth_token; } public String getOauth_token_secret() { return this.oauth_token_secret; } public void setOauth_token_secret(String oauth_token_secret) { this.oauth_token_secret = oauth_token_secret; } public boolean getIsLogin() { return this.isLogin; } public void setIsLogin(boolean isLogin) { this.isLogin = isLogin; } }
[ "494643819@qq.com" ]
494643819@qq.com
b7f266b65a42321cda412c94bcf1afd546f49a71
17fd29e93f084aeec8a8c8969b5a19e1663c36e0
/athene/src/main/java/com/qinyin/athene/util/ExcelUtils.java
d37d76520c1db5b651d348ab7fc2d37351992945
[]
no_license
singer1026/glacier
d869843274adb6afb4376c519518fe8ee4592f8b
932a8e335db69ce2e93a5e2840ded2bd2543734c
refs/heads/master
2021-01-22T18:18:15.266111
2014-04-21T01:32:14
2014-04-21T01:32:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,956
java
/** * @author zhaolie * @version 1.0 * @create-time 11-9-8 * @email zhaolie43@gmail.com */ package com.qinyin.athene.util; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFWorkbook; public class ExcelUtils { public static HSSFCellStyle getCellCCStyle(HSSFWorkbook workbook) { HSSFFont cellFont = workbook.createFont(); cellFont.setFontName("宋体"); cellFont.setFontHeightInPoints((short) 10); HSSFCellStyle cellStyle = workbook.createCellStyle(); cellStyle.setFont(cellFont); cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中 cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中 cellStyle.setWrapText(true); cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); return cellStyle; } public static HSSFCellStyle getCellCommonStyle(HSSFWorkbook workbook) { //设置普通单元格字体 HSSFFont cellFont = workbook.createFont(); cellFont.setFontName("宋体"); cellFont.setFontHeightInPoints((short) 10); //设置普通单元格样式 HSSFCellStyle cellStyle = workbook.createCellStyle(); cellStyle.setFont(cellFont); cellStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);// 左右居中 cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP);// 上下居中 cellStyle.setWrapText(true); cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); return cellStyle; } }
[ "wangyj0898@126.com" ]
wangyj0898@126.com
1cb8aee375c45a0aaa6fe01fd5620a5e52dbff9f
8f8961fcb17be9eb283eda1f66a5309d3198c9be
/branches/sandbox/src/main/java/es/us/lsi/tdg/fast/core/roles/discovery/tracker/TrackerInquirerAdaptor.java
62a89ba6043b27783105a0e2d806c072af57a836
[]
no_license
raina070/fast-trading
a98b453ddf0917e1459a30d225fe30c725f6a29c
38e569225199d88a6a68f85ab12d395db48ac89f
refs/heads/master
2016-09-06T21:35:28.613272
2012-09-21T20:17:17
2012-09-21T20:17:17
35,436,737
0
0
null
null
null
null
MacCentralEurope
Java
false
false
424
java
/** * */ package es.us.lsi.tdg.fast.core.roles.discovery.tracker; import es.us.lsi.tdg.fast.core.roles.RoleAdaptor; import es.us.lsi.tdg.fast.core.roles.discovery.Tracker; import es.us.lsi.tdg.fast.core.roles.information.Inquirer; /** * @author Pablo Fernandez Montes * @author Josť Antonio Parejo Maestre * */ public interface TrackerInquirerAdaptor extends Tracker, Inquirer, RoleAdaptor { }
[ "pafmon@1dd39048-c632-0410-b676-f7962134b12f" ]
pafmon@1dd39048-c632-0410-b676-f7962134b12f
79fe3f0d66138a7a489022a3c127216c8c5c63a4
856f406b34ecad3f8f9640868552a10b97c8378b
/proyecto_apiWeb/src/proyecto_apiWeb/BeanFacultad.java
6313cf94f494b0f56a951f62868c3baaf8d694c4
[]
no_license
roserodc/proyecto_api
a46065425c963ccf54cf0471d4490885ecf2c958
2474809a27736ef0555e9f1e12dfb80aec1ed9bc
refs/heads/master
2020-06-19T16:28:11.895023
2019-07-29T12:54:52
2019-07-29T12:54:52
196,782,641
0
0
null
null
null
null
UTF-8
Java
false
false
2,564
java
package proyecto_apiWeb; import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.enterprise.context.SessionScoped; import javax.inject.Named; import proyecto_api.model.entities.Club; import proyecto_api.model.entities.Facultad; import proyecto_api.model.entities.Prueba; import proyecto_api.model.manager.ManagerClub; import proyecto_api.model.manager.ManagerFacultad; import proyecto_api.model.manager.ManagerPrueba; import java.io.Serializable; import java.util.List; @Named @SessionScoped public class BeanFacultad implements Serializable { private static final long serialVersionUID = 1L; @EJB private ManagerFacultad managerFacultad; private List<Facultad> lista; private Facultad facultad; private boolean panelColapsado; private Facultad selecionada; @PostConstruct public void inicalizar() { lista = managerFacultad.findAll(); facultad = new Facultad(); panelColapsado = true; } public void actionListenerColapsarPanerl() { panelColapsado = !panelColapsado; } public void actionListenerInsertar() { try { managerFacultad.insertar(facultad); lista = managerFacultad.findAll(); facultad = new Facultad(); JSFUtil.createMensajeInfo("insertados"); } catch (Exception e) { JSFUtil.createMensajeError("error"); e.printStackTrace(); } } public void actionListenerEliminar(Integer id) { managerFacultad.eliminar(id); lista=managerFacultad.findAll(); JSFUtil.createMensajeInfo("Eliminado"); } public void actionListenerSeleccionado(Facultad facultad) { selecionada = facultad; } public void actionListenerActualizar() { try { managerFacultad.actualizar(selecionada); lista=managerFacultad.findAll(); JSFUtil.createMensajeInfo("Acualizado"); } catch (Exception e) { // TODO: handle exception JSFUtil.createMensajeError(e.getMessage()); e.printStackTrace(); } } public List<Facultad> getLista() { return lista; } public void setLista(List<Facultad> lista) { this.lista = lista; } public boolean isPanelColapsado() { return panelColapsado; } public void setPanelColapsado(boolean panelColapsado) { this.panelColapsado = panelColapsado; } public Facultad getSelecionada() { return selecionada; } public void setSelecionada(Facultad selecionada) { this.selecionada = selecionada; } public Facultad getFacultad() { return facultad; } public void setFacultad(Facultad facultad) { this.facultad = facultad; } }
[ "dianita2698@gmail.com" ]
dianita2698@gmail.com
374893f625561a23c67eb9f5d8decd6b0f9a8077
fcbbfe4aa83c1f59dffa8cf76f02ceb2a8077ea1
/src/main/java/com/facetofront/Factory/CashRebate.java
e03326a0b9699735d058653dc51dc9b58686f24b
[]
no_license
wangjie147/DesignPattern
a08379c0ccd478284fd88628a9a776ee7bd03323
7d9dede7e1b8859b09e1c488cd081fb607b08c1e
refs/heads/master
2020-03-18T19:06:08.079442
2018-05-28T09:21:57
2018-05-28T09:21:57
135,134,079
0
0
null
null
null
null
UTF-8
Java
false
false
325
java
package com.facetofront.Factory; public class CashRebate extends CashSuper { private double moneyRebate = 1d; public CashRebate(String moneyRebate){ this.moneyRebate =Integer.parseInt(moneyRebate)*0.1; } @Override public double acceptCash(double money) { return money*moneyRebate; } }
[ "wangle1988918@163.com" ]
wangle1988918@163.com
9e9836ee84d45d468f1fb693396e37dc9bbf4fb3
b4d0861fda0a68a946bf276736adda46cd9b69a1
/wetrainAndroid/app/src/main/java/com/wetrain/client/customviews/DateTimePickerWheel/WheelScroller.java
996cfef4ef9291357e38e1eb81b5bb6c6709a123
[]
no_license
WTGH/WTAndroid_SC
601765d7e0f9de91c8978fe38c5d8e0e8e72338e
b3903e7fa49df592306feac3c15e0e0b682c6a57
refs/heads/master
2016-09-14T00:03:41.455929
2016-05-04T05:14:55
2016-05-04T05:14:55
58,024,089
0
0
null
null
null
null
UTF-8
Java
false
false
7,324
java
/* * Android Wheel Control. * https://code.google.com/p/android-wheel/ * * Copyright 2011 Yuri Kanivets * * 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.wetrain.client.customviews.DateTimePickerWheel; import android.content.Context; import android.os.Handler; import android.os.Message; import android.view.GestureDetector; import android.view.GestureDetector.SimpleOnGestureListener; import android.view.MotionEvent; import android.view.animation.Interpolator; import android.widget.Scroller; /** * Scroller class handles scrolling events and updates the */ public class WheelScroller { /** * Scrolling listener interface */ public interface ScrollingListener { /** * Scrolling callback called when scrolling is performed. * @param distance the distance to scroll */ void onScroll(int distance); /** * Starting callback called when scrolling is started */ void onStarted(); /** * Finishing callback called after justifying */ void onFinished(); /** * Justifying callback called to justify a view when scrolling is ended */ void onJustify(); } /** Scrolling duration */ private static final int SCROLLING_DURATION = 400; /** Minimum delta for scrolling */ public static final int MIN_DELTA_FOR_SCROLLING = 1; // Listener private ScrollingListener listener; // Context private Context context; // Scrolling private GestureDetector gestureDetector; private Scroller scroller; private int lastScrollY; private float lastTouchedY; private boolean isScrollingPerformed; /** * Constructor * @param context the current context * @param listener the scrolling listener */ public WheelScroller(Context context, ScrollingListener listener) { gestureDetector = new GestureDetector(context, gestureListener); gestureDetector.setIsLongpressEnabled(false); scroller = new Scroller(context); this.listener = listener; this.context = context; } /** * Set the the specified scrolling interpolator * @param interpolator the interpolator */ public void setInterpolator(Interpolator interpolator) { scroller.forceFinished(true); scroller = new Scroller(context, interpolator); } /** * Scroll the wheel * @param distance the scrolling distance * @param time the scrolling duration */ public void scroll(int distance, int time) { scroller.forceFinished(true); lastScrollY = 0; scroller.startScroll(0, 0, 0, distance, time != 0 ? time : SCROLLING_DURATION); setNextMessage(MESSAGE_SCROLL); startScrolling(); } /** * Stops scrolling */ public void stopScrolling() { scroller.forceFinished(true); } /** * Handles Touch event * @param event the motion event * @return */ public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: lastTouchedY = event.getY(); scroller.forceFinished(true); clearMessages(); break; case MotionEvent.ACTION_MOVE: // perform scrolling int distanceY = (int)(event.getY() - lastTouchedY); if (distanceY != 0) { startScrolling(); listener.onScroll(distanceY); lastTouchedY = event.getY(); } break; } if (!gestureDetector.onTouchEvent(event) && event.getAction() == MotionEvent.ACTION_UP) { justify(); } return true; } // gesture listener private SimpleOnGestureListener gestureListener = new SimpleOnGestureListener() { public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { // Do scrolling in onTouchEvent() since onScroll() are not call immediately // when user touch and move the wheel return true; } public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { lastScrollY = 0; final int maxY = 0x7FFFFFFF; final int minY = -maxY; scroller.fling(0, lastScrollY, 0, (int) -velocityY, 0, 0, minY, maxY); setNextMessage(MESSAGE_SCROLL); return true; } }; // Messages private final int MESSAGE_SCROLL = 0; private final int MESSAGE_JUSTIFY = 1; /** * Set next message to queue. Clears queue before. * * @param message the message to set */ private void setNextMessage(int message) { clearMessages(); animationHandler.sendEmptyMessage(message); } /** * Clears messages from queue */ private void clearMessages() { animationHandler.removeMessages(MESSAGE_SCROLL); animationHandler.removeMessages(MESSAGE_JUSTIFY); } // animation handler private Handler animationHandler = new Handler() { public void handleMessage(Message msg) { scroller.computeScrollOffset(); int currY = scroller.getCurrY(); int delta = lastScrollY - currY; lastScrollY = currY; if (delta != 0) { listener.onScroll(delta); } // scrolling is not finished when it comes to final Y // so, finish it manually if (Math.abs(currY - scroller.getFinalY()) < MIN_DELTA_FOR_SCROLLING) { currY = scroller.getFinalY(); scroller.forceFinished(true); } if (!scroller.isFinished()) { animationHandler.sendEmptyMessage(msg.what); } else if (msg.what == MESSAGE_SCROLL) { justify(); } else { finishScrolling(); } } }; /** * Justifies wheel */ private void justify() { listener.onJustify(); setNextMessage(MESSAGE_JUSTIFY); } /** * Starts scrolling */ private void startScrolling() { if (!isScrollingPerformed) { isScrollingPerformed = true; listener.onStarted(); } } /** * Finishes scrolling */ void finishScrolling() { if (isScrollingPerformed) { listener.onFinished(); isScrollingPerformed = false; } } }
[ "sempercon@comcast.net" ]
sempercon@comcast.net
e6d5d0372e96e2967f74f5b51b57d35ec44669fa
e877a43ad7b43ec33f8fb79074b4e306d545b440
/src/test/java/org/eclipse/jetty/reactive/client/internal/SingleProcessorTest.java
bb55d413a8c258298bdc16b7641a4bba01a0dc38
[ "Apache-2.0" ]
permissive
scottjohnson/jetty-reactive-httpclient
3ec4de849fa98814491c2bf0806c4146d1c4baad
b7f2fbd34003fd95668b38f2caf411cc806aca6b
refs/heads/master
2020-05-25T11:24:54.700070
2019-04-04T10:14:11
2019-04-04T10:14:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,970
java
/* * Copyright (c) 2017-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.eclipse.jetty.reactive.client.internal; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.IntStream; import io.reactivex.Flowable; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class SingleProcessorTest { @BeforeMethod public void printTestName(Method method) { System.err.printf("Running %s.%s()%n", getClass().getName(), method.getName()); } @Test public void testDemandWithoutUpStreamIsRemembered() throws Exception { AbstractSingleProcessor<String, String> processor = new AbstractSingleProcessor<String, String>() { @Override public void onNext(String item) { downStreamOnNext(item); } }; // First link a Subscriber, calling request(1) - no upStream yet. CountDownLatch latch = new CountDownLatch(1); List<String> items = new ArrayList<>(); processor.subscribe(new Subscriber<String>() { private Subscription subscription; @Override public void onSubscribe(Subscription subscription) { this.subscription = subscription; subscription.request(1); } @Override public void onNext(String item) { items.add(item); subscription.request(1); } @Override public void onError(Throwable throwable) { } @Override public void onComplete() { latch.countDown(); } }); // Now create an upStream Publisher and subscribe the processor. int count = 16; Flowable.range(0, count) .map(String::valueOf) .subscribe(processor); Assert.assertTrue(latch.await(5, TimeUnit.SECONDS)); List<String> expected = IntStream.range(0, count) .mapToObj(String::valueOf) .collect(Collectors.toList()); Assert.assertEquals(items, expected); } }
[ "simone.bordet@gmail.com" ]
simone.bordet@gmail.com
8afd0838b01ca7ae8d02ce1765d806e570b04b1a
8cf983678f51c68ffa45c4798a8758db298ce83d
/xueqing_sourceCode/HBaseStorage.java
a84eb3aab302de65cd519f4fc3d388817ee0115a
[]
no_license
jokefrelon/java-learn
73868b30a006f1e97cdf208780672e4c131b72eb
651047e3a0c535cba37e8ffbb6fe2ad58300da9f
refs/heads/master
2022-12-22T10:06:19.159982
2021-10-20T13:11:23
2021-10-20T13:11:23
216,274,503
2
0
null
2022-12-16T00:02:57
2019-10-19T21:47:13
Java
UTF-8
Java
false
false
4,080
java
package com.xiandian.douxue.insight.server.dao; import java.io.IOException; import java.util.List; import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; import org.apache.hadoop.hbase.util.Bytes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.xiandian.douxue.insight.server.utils.UtilTools; /** * HBase存储操作类(保存RAWData、PerceptData)。 目前阶段只有互联网。 * * @since v1.0 * @date 20170815 * @author XianDian Cloud Team */ public class HBaseStorage { private Logger logger = LoggerFactory.getLogger(getClass()); // 与HBase数据库的连接对象 static Connection connection; // 数据库元数据操作对象 private static Admin admin; /** * 构造 */ private static HBaseStorage instance; /** * 获得单例。 * @return */ public static synchronized HBaseStorage getInstance() { if (instance == null) { instance = new HBaseStorage(); } return instance; } /** * 连接。 * @param url * @param port * @param path */ public void setUp(String url, String port,String path) { // 取得一个数据库连接的配置参数对象 Configuration conf = HBaseConfiguration.create(); // 设置连接参数:HBase数据库所在的主机IP conf.set("hbase.zookeeper.quorum", url); // 设置连接参数:HBase数据库使用的端口 conf.set("hbase.zookeeper.property.clientPort", port); // conf.set("hbase.master", "192.168.137.25:9001"); conf.set("zookeeper.znode.parent", path); // 取得一个数据库连接对象 try { connection = ConnectionFactory.createConnection(conf); admin = connection.getAdmin(); // 取得一个数据库元数据操作对象 logger.info("HBase connection successfully!"); } catch (Exception exc) { logger.error(exc.toString()); } } public void closeHbase() { try { admin.close(); } catch (IOException e) { logger.error(e.toString()); } } /** * 创建表 */ public void createTable(String tablename,String families) throws IOException { // 新建一个数据表表名对象 TableName tableName = TableName.valueOf(tablename); // 如果需要新建的表已经存在 if (admin.tableExists(tableName)) { logger.info("表已经存在!"); } else { logger.info("表创建start"); // 数据表描述对象 HTableDescriptor hTableDescriptor = new HTableDescriptor(tableName); // 列族描述对象 for (String fam:families.split(",")) { HColumnDescriptor family = new HColumnDescriptor(fam); // 在数据表中新建一个列族 hTableDescriptor.addFamily(family); } // 新建数据表 admin.createTable(hTableDescriptor); logger.info("表创建成功"); } } public static void main(String[] args) { HBaseStorage baseStorage=HBaseStorage.getInstance(); baseStorage.setUp("172.24.2.110", "2181","/hbase"); try { baseStorage.createTable("job_internet", "RAW_DATA,TAG_DATA,PERCEPT_DATA"); baseStorage.createTable("job_cloud", "cloud"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "lixuanliming@gmail.com" ]
lixuanliming@gmail.com
8fa23a9b719e96fc326a056fb9ec5b95666cbb44
50add8286b791d2a1ed21f3fe807c1cf87d64173
/kettle5.0.1-src-eclipse/engine/org/pentaho/di/core/listeners/SubComponentExecutionAdapter.java
c5560874d4d8f6a671b4a3c38b2ef471cc60d44b
[ "Apache-2.0" ]
permissive
Piouy/pentaho-kettle-serial
418f63d981429eeab56160169deb0555a91008f6
5a915839de1ee5b0435f3fb6dbe9657f638d36a8
refs/heads/master
2021-09-10T06:11:54.094488
2018-03-21T09:58:15
2018-03-21T09:58:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
613
java
package org.pentaho.di.core.listeners; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.job.Job; import org.pentaho.di.trans.Trans; public class SubComponentExecutionAdapter implements SubComponentExecutionListener { @Override public void beforeTransformationExecution(Trans trans) throws KettleException { } @Override public void afterTransformationExecution(Trans trans) throws KettleException { } @Override public void beforeJobExecution(Job job) throws KettleException { } @Override public void afterJobExecution(Job job) throws KettleException { } }
[ "sct1302120@163.com" ]
sct1302120@163.com
25773069f55306497ea2573f5a0ce512c4650c02
2041f86e9105e27f95bf87026f9fd196ff42d10c
/app/src/main/java/com/cleanup/todocmaster/model/Task.java
8252d9206ada77a31ffee83ebe08d7b05462dad8
[]
no_license
vincent582/todoc-master
e81f3314d166fe80f320253ad45aad1d911e4969
eaa69d29a898513ea716047c80db756c7830ea71
refs/heads/master
2020-09-12T15:30:34.777004
2019-12-24T17:47:23
2019-12-24T17:47:23
222,466,211
0
0
null
null
null
null
UTF-8
Java
false
false
4,192
java
package com.cleanup.todocmaster.model; import android.arch.persistence.room.Entity; import android.arch.persistence.room.ForeignKey; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import java.util.Comparator; /** * <p>Model for the tasks of the application.</p> * * @author Gaëtan HERFRAY * Update By Vincent Pasdeloup */ @Entity(foreignKeys = @ForeignKey(entity = Project.class, parentColumns = "id", childColumns = "projectId")) public class Task { /** * The unique identifier of the task */ @PrimaryKey(autoGenerate = true) private long id; /** * The unique identifier of the project associated to the task */ private long projectId; public long getProjectId() { return projectId; } /** * The name of the task */ // Suppress warning because setName is called in constructor @SuppressWarnings("NullableProblems") @NonNull private String name; public long getCreationTimestamp() { return creationTimestamp; } /** * The timestamp when the task has been created */ private long creationTimestamp; /** * Instantiates a new Task. * * @param projectId the unique identifier of the project associated to the task to set * @param name the name of the task to set * @param creationTimestamp the timestamp when the task has been created to set */ public Task(long projectId, @NonNull String name, long creationTimestamp) { this.setProjectId(projectId); this.setName(name); this.setCreationTimestamp(creationTimestamp); } /** * Returns the unique identifier of the task. * * @return the unique identifier of the task */ public long getId() { return id; } /** * Sets the unique identifier of the task. * * @param id the unique idenifier of the task to set */ public void setId(long id) { this.id = id; } /** * Sets the unique identifier of the project associated to the task. * * @param projectId the unique identifier of the project associated to the task to set */ private void setProjectId(long projectId) { this.projectId = projectId; } /** * Returns the name of the task. * * @return the name of the task */ @NonNull public String getName() { return name; } /** * Sets the name of the task. * * @param name the name of the task to set */ public void setName(@NonNull String name) { this.name = name; } /** * Sets the timestamp when the task has been created. * * @param creationTimestamp the timestamp when the task has been created to set */ private void setCreationTimestamp(long creationTimestamp) { this.creationTimestamp = creationTimestamp; } /** * Comparator to sort task from A to Z */ public static class TaskAZComparator implements Comparator<Task> { @Override public int compare(Task left, Task right) { return left.name.compareTo(right.name); } } /** * Comparator to sort task from Z to A */ public static class TaskZAComparator implements Comparator<Task> { @Override public int compare(Task left, Task right) { return right.name.compareTo(left.name); } } /** * Comparator to sort task from last created to first created */ public static class TaskRecentComparator implements Comparator<Task> { @Override public int compare(Task left, Task right) { return (int) (right.creationTimestamp - left.creationTimestamp); } } /** * Comparator to sort task from first created to last created */ public static class TaskOldComparator implements Comparator<Task> { @Override public int compare(Task left, Task right) { return (int) (left.creationTimestamp - right.creationTimestamp); } } }
[ "pasdeloupvincent@live.fr" ]
pasdeloupvincent@live.fr
e876c430d1811637edb21d9366a745a6cde3a789
dc36e7af8cdc8d0308fa330887abac46dc87ef92
/3 - JMS e ActiveMQ Mensageria com Java/3 - Recebendo mensagens com MessageListener/jms/src/br/com/caelum/jms/TesteConsumidor.java
da1532fc3ef74244813683b228ac35cd03686497
[]
no_license
andreluis7/Formacao-Expert-em-Integracao-de-Aplicacoes-Java
206fd7aa98a1cbe7b4cc3a5d0820afb06e9bee10
d50ff68eec5ecdafbb08aeced900a4f67ec18040
refs/heads/main
2023-04-13T16:08:19.547219
2021-04-26T20:50:05
2021-04-26T20:50:05
357,700,671
0
1
null
null
null
null
UTF-8
Java
false
false
1,338
java
package br.com.caelum.jms; import java.util.Scanner; import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageListener; import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.InitialContext; public class TesteConsumidor { @SuppressWarnings("resource") public static void main(String[] args) throws Exception { InitialContext context = new InitialContext(); ConnectionFactory factory = (ConnectionFactory) context.lookup("ConnectionFactory"); Connection connection = factory.createConnection(); connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Destination fila = (Destination) context.lookup("financeiro"); MessageConsumer consumer = session.createConsumer(fila ); consumer.setMessageListener(new MessageListener() { @Override public void onMessage(Message message) { TextMessage textMessage = (TextMessage)message; try { System.out.println(textMessage.getText()); } catch (JMSException e) { e.printStackTrace(); } } }); new Scanner(System.in).nextLine(); session.close(); connection.close(); context.close(); } }
[ "adrluis7@gmail.com" ]
adrluis7@gmail.com
7f2287d8f98c4468d98871a9710846ed11f88b1d
bd665ec87be13ac6f5b7a77398b8d2cc9ccecda8
/minicad1/src/minicad/utils/Point.java
ef6fa04b4b7158b9b3d63f2e309c504aa6413534
[]
no_license
APS-Batatal/minicad
eb94394b7c0a3810bf31d29559de344b08e106e5
084db2f0f325c492fbd3b4d2ce69b47eff2204e3
refs/heads/master
2021-01-17T07:14:31.602829
2016-06-05T04:01:18
2016-06-05T04:01:18
55,362,269
0
0
null
null
null
null
UTF-8
Java
false
false
536
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 minicad.utils; /** * * @author Diego */ public class Point { public int x; public int y; public Point() { this.x = 0; this.y = 0; } public Point(int x, int y) { this.x = x; this.y = y; } public void setPosition(int x, int y) { this.x = x; this.y = y; } }
[ "dihgg@dihgg.com" ]
dihgg@dihgg.com
23b25e4fb7abf74829f28dbaf803fbaa22598a9b
18f5e4ed03525b327c94912527cdbcfd79900a9a
/app/src/main/java/com/example/hv/listmanager/ListViewActivity.java
7eae750c008f4e5bea324f689647f0a7ac19077b
[]
no_license
aik117/ListManager
8353082c49cb1fead2d5f8fab7595b618f3ce082
393ce8556b111e13733e5f6f9a6baabb877631ae
refs/heads/master
2021-01-12T13:49:39.838557
2016-03-28T10:53:11
2016-03-28T10:53:11
53,187,686
0
0
null
null
null
null
UTF-8
Java
false
false
789
java
package com.example.hv.listmanager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; import java.util.ArrayList; public class ListViewActivity extends AppCompatActivity { private ListView listView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list_view); listView = (ListView) findViewById(R.id.listView); DBHelper helper = new DBHelper(this); ArrayList array_list = helper.getAllCotacts(); ArrayAdapter arrayAdapter=new ArrayAdapter(this,android.R.layout.simple_list_item_1, array_list); listView.setAdapter(arrayAdapter); } }
[ "aamish@gmail.com" ]
aamish@gmail.com
77d2429d6d8ab6390fcf2a000067cd3c63d525b4
02aab295a98116beb3e273ed14c610af7115400f
/src/joueurs/JoueurOrdinateurT0.java
172514623cc20115ae2073acb1783fb6f71c0d35
[]
no_license
Sayoden/Labyrinthe-S2
9c3230ece765786fa33707d21448af75338601ce
22c73d0d30e402f910a6f9a060bd9b0721d7181c
refs/heads/main
2023-05-23T09:44:52.151529
2021-06-02T17:06:14
2021-06-02T17:06:14
358,873,507
0
0
null
null
null
null
UTF-8
Java
false
false
1,538
java
package joueurs; import composants.Objet; import composants.Plateau; import composants.Utils; import partie.ElementsPartie; /** * * Cette classe permet de représenter un joueur ordinateur de type T0. * * @author Jean-François Condotta - 2021 * */ public class JoueurOrdinateurT0 extends JoueurOrdinateur { /** * * Constructeur permettant de créer un joueur. * * @param numJoueur Le numéro du joueur. * @param nomJoueur Le nom du joueur. * @param numeroImagePersonnage Le numéro de l'image représentant le joueur. * @param posLignePlateau La ligne du plateau sur laquelle est positionnée le joueur. * @param posColonnePlateau La colonne du plateau sur laquelle est positionnée le joueur. */ public JoueurOrdinateurT0(int numJoueur,String nomJoueur, int numeroImagePersonnage,int posLignePlateau,int posColonnePlateau) { super(numJoueur,nomJoueur, numeroImagePersonnage,posLignePlateau,posColonnePlateau); } @Override public String getCategorie() { return "OrdiType0"; } @Override public Joueur copy(Objet objets[]){ Joueur nouveauJoueur=new JoueurOrdinateurT0(getNumJoueur(),getNomJoueur(), getNumeroImagePersonnage(),getPosLigne(),getPosColonne()); nouveauJoueur.setObjetsJoueur(this.getObjetsJoueurGeneral(objets)); while (nouveauJoueur.getNombreObjetsRecuperes()!=this.getNombreObjetsRecuperes()) nouveauJoueur.recupererObjet(); return nouveauJoueur; } }
[ "stanwisepala@gmail.com" ]
stanwisepala@gmail.com
2428d209ae8385b42f0d964b5d0f517ee66b7ff1
624125f63b39e17ef79fb603c6f6df7be9e0476c
/src/main/java/com/kata/tictactoe/Game.java
450fcf534a5d556b68183754417c7de1242403ee
[]
no_license
rastorius/white-belt-exam
e9b37201be322653b4593fc926e778e4923ff84f
82d2b4f953db45571cca53fdc23506ab0f708697
refs/heads/master
2023-06-27T13:03:03.544958
2021-08-01T13:05:42
2021-08-01T13:05:42
391,596,975
0
0
null
null
null
null
UTF-8
Java
false
false
3,582
java
package com.kata.tictactoe; import java.util.Arrays; public class Game { Mark[] board = new Mark[]{Mark.EMPTY, Mark.EMPTY, Mark.EMPTY, Mark.EMPTY, Mark.EMPTY, Mark.EMPTY, Mark.EMPTY, Mark.EMPTY, Mark.EMPTY}; private Status status = Status.X_NEXT; public void print() { System.out.println(board[0] + "|" + board[1] + "|" + board[2]); System.out.println("-+-+-"); System.out.println(board[3] + "|" + board[4] + "|" + board[5]); System.out.println("-+-+-"); System.out.println(board[6] + "|" + board[7] + "|" + board[8]); } public boolean canMark(int position) { return board[position] == Mark.EMPTY; } public void placeMark(int i) { if (status == Status.X_NEXT) { board[i] = Mark.X; status = Status.O_NEXT; } else if (status == Status.O_NEXT) { board[i] = Mark.O; status = Status.X_NEXT; } Mark winner = checkVerticalWin1(); if (winner == Mark.EMPTY) { winner = checkVerticalWin2(); } if (winner == Mark.EMPTY) { winner = checkVerticalWin3(); } if (winner == Mark.EMPTY) { winner = checkHorizontalWin1(); } if (winner == Mark.EMPTY) { winner = checkHorizontalWin2(); } if (winner == Mark.EMPTY) { winner = checkHorizontalWin3(); } if (winner == Mark.EMPTY) { winner = checkDiagonalWin1(); } if (winner == Mark.EMPTY) { winner = checkDiagonalWin2(); } if (winner == Mark.X) { status = Status.X_WON; } if (winner == Mark.O) { status = Status.O_WON; } if (winner == Mark.EMPTY && isFull()) { status = Status.DRAW; } } private boolean isFull() { return Arrays.stream(board).allMatch(m -> m != Mark.EMPTY); } private Mark checkDiagonalWin1() { if (board[0] == board[4] && board[4] == board[8]) { return board[0]; } else { return Mark.EMPTY; } } private Mark checkDiagonalWin2() { if (board[2] == board[4] && board[4] == board[6]) { return board[2]; } else { return Mark.EMPTY; } } private Mark checkHorizontalWin1() { if (board[0] == board[1] && board[1] == board[2]) { return board[0]; } else { return Mark.EMPTY; } } private Mark checkHorizontalWin2() { if (board[3] == board[4] && board[4] == board[5]) { return board[3]; } else { return Mark.EMPTY; } } private Mark checkHorizontalWin3() { if (board[6] == board[7] && board[7] == board[8]) { return board[6]; } else { return Mark.EMPTY; } } private Mark checkVerticalWin1() { if (board[0] == board[3] && board[3] == board[6]) { return board[0]; } else { return Mark.EMPTY; } } private Mark checkVerticalWin2() { if (board[1] == board[4] && board[4] == board[7]) { return board[1]; } else { return Mark.EMPTY; } } private Mark checkVerticalWin3() { if (board[2] == board[5] && board[5] == board[8]) { return board[2]; } else { return Mark.EMPTY; } } public Status getStatus() { return status; } }
[ "david.mark.meszaros@ibm.com" ]
david.mark.meszaros@ibm.com
2bbc9303b521e284525fa0daaf7790fee3205a86
9438cad98cfb83dc30e57f8ed1762ba782594fe9
/Problem1.java
cc7af437097808a89210e1fc67fc0a4c8d609155
[]
no_license
producktivemary/dailycodingproblem
a15988dd4102e8f98f239cd1cd2248846c4c4191
d0fb421aae782cd53110c8b2da52fe4bc6e7e23d
refs/heads/main
2023-07-18T12:51:09.727483
2021-08-20T16:00:21
2021-08-20T16:00:21
398,324,106
0
0
null
null
null
null
UTF-8
Java
false
false
1,297
java
package com.school; import java.math.BigInteger; import java.util.ArrayList; public class Main { public static void main(String[] args) { int[] numbers = {10, 15, 3, 7}; anyMembersAddUpTo(numbers, 17); // write your code here } public static void anyMembersAddUpTo(int[] numberList, int k) { // get a list of numbers // get a number "k" ArrayList<String> possibleCombinationsForK = new ArrayList<String>(); for (int index = 0; index < numberList.length; index++) { int secondSummandIndex = 0; do { if (secondSummandIndex != index) { int result = numberList[index] + numberList[secondSummandIndex]; //return whether any two numbers from the list when added return k if (result == k) { possibleCombinationsForK.add("" + numberList[index] +"+" + numberList[secondSummandIndex]); } secondSummandIndex++; } else { secondSummandIndex++; } } while (secondSummandIndex < numberList.length); } System.out.println(possibleCombinationsForK); } }
[ "noreply@github.com" ]
noreply@github.com
91a1d6b276b3fbc5256c590abc0d202221c989c6
1de3c32d8d8d29359ada086d2c519c0b78545631
/DependencyInversion/DependencyPattern/src/dependencypattern/DependencyPattern.java
fdbb30be137513ae95dd5f53e70c89442b5724a8
[]
no_license
onurkaplann/Software-Desing-Patterns
a22e8afd3cad7a431fba002754d3af870a94e92c
64366bc5793d5570246fdebca6d7d7602d0c78dc
refs/heads/master
2022-11-21T16:48:40.868644
2020-07-17T22:55:47
2020-07-17T22:55:47
280,503,177
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package dependencypattern; public class DependencyPattern { public static void main(String[] args) { İmalat kazak = new İmalat(new Kazak()); kazak.Yap(); İmalat pantalon = new İmalat(new Pantolon()); pantalon.Yap(); İmalat mont = new İmalat(new Mont()); mont.Yap(); } }
[ "onurkaplan1907@gmail.com" ]
onurkaplan1907@gmail.com
44499f65951bf8c2a895eb49bd43501170cf3a9f
eb1961c0bf1f626c2d85ec43e0331108f2797b14
/Movie/src/main/java/dto/MovieDTO.java
1e620d9dbb3815f04dd1fb28c016ba6c10b9002a
[]
no_license
etlos/Week37
38ed5a76691575eca2117400b44da63949d97301
be98c92fc6e3661e550c962dce4454c69abd7af3
refs/heads/master
2023-02-21T18:07:37.554141
2020-09-12T10:57:29
2020-09-12T10:57:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
package dto; import entities.Movie; public class MovieDTO { private Long id; private int year; private String title; private String[] actors; public MovieDTO(){} public MovieDTO(Movie movie) { this.id = movie.getId(); this.year = movie.getYear(); this.title = movie.getTitle(); this.actors = movie.getActors(); } public MovieDTO(Long id, int year, String title, String[] actors) { this.id = id; this.year = year; this.title = title; this.actors = actors; } public Long getId() { return id; } public int getYear() { return year; } public String getTitle() { return title; } public String[] getActors() { return actors; } }
[ "etlos01@gmail.com" ]
etlos01@gmail.com
7d33d5adad7d8d3f9ac0f7aab27332b4cb9b96a7
a450afc6231760735e5c57808c2d21d559924ab4
/EndOfYearCSProj2016-master/src/app/util/RestrictedLengthDocument.java
2593c20b43c2e34cdbab818c449d3d9b985d83dc
[]
no_license
Nixxos/blah
6662e3805f01b122afd8b88e9adfd4581ab9a617
7988a30502f2a966f7ba81c71abbec1fe0c2c587
refs/heads/master
2016-09-14T04:18:19.571675
2016-05-20T00:17:16
2016-05-20T00:17:16
59,251,966
0
0
null
null
null
null
UTF-8
Java
false
false
552
java
package app.util; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.PlainDocument; public class RestrictedLengthDocument extends PlainDocument { private final int max; public RestrictedLengthDocument(int maxCharacters) { max = maxCharacters; } @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if(str != null && getLength() + str.length() <= max) super.insertString(offs, str, a); } }
[ "nixxos123@gmail.com" ]
nixxos123@gmail.com
573b89f5e098273516f5ba96df368b90d8c844ed
0691be188104c5e2fa1386729f15d919f19e06d0
/2014spring/cs316/TJ/CS316ex14.java
571bcf50866055b9182e503fbb68d758e472ff81
[]
no_license
haijunsu/QC
4bdcd07ad210cf072debc12461de2b0852dc50b7
7d88cd2fa32b32fb396ac3f40355faec7149eda4
refs/heads/master
2020-06-04T00:47:33.396804
2015-05-08T21:04:41
2015-05-08T21:04:41
13,135,568
0
3
null
null
null
null
UTF-8
Java
false
false
2,865
java
import java.util.Scanner; class CS316ex14 { static int mat[][]; static int threeDmat[][][] = new int[5][][]; public static void main (String args[]) { int r[] = new int[5], c[] = new int[5], n = 1; int layer = -1; while (n == 1) { if (layer < 4) layer = layer + 1; else layer = 0; Scanner input = new Scanner(System.in); System.out.print("Enter number of rows: "); r[layer] = input.nextInt(); System.out.print("Enter number of columns: "); c[layer] = input.nextInt(); mat = new int [r[layer]][]; threeDmat[layer] = mat; int i = 0; while (i < r[layer]) { mat[i] = new int[c[layer]]; readRow(i + 1, mat[i], c[layer]); i = i + 1; } int h = 0; while (h <= layer) { System.out.println("\nMatrix: "); writeOut(r[h], c[h], threeDmat[h]); System.out.println("Transposed matrix: "); writeOut(c[h], r[h], transpose(threeDmat[h], r[h], c[h])); h = h + 1; } if (layer > 0) System.out.println("\nDoubled matrices: "); else System.out.println("\nDoubled matrix: "); h = 0; while (h <= layer) { i = 0; while (i < r[h]) { int j = 0; while (j < c[h]) { threeDmat[h][i][j] = threeDmat[h][i][j] * 2; System.out.print(threeDmat[h][i][j]); System.out.print(" "); j = j + 1; } System.out.println(); i = i + 1; } h = h + 1; System.out.println("\n"); } System.out.print("\n\nType 1 to continue, 0 to quit: "); n = input.nextInt(); } } static void readRow(int rowNum, int m[], int c) { System.out.print("Row "); System.out.println(rowNum); int i = 0; while (i < c) { Scanner input = new Scanner(System.in); System.out.print("Enter value in column "); System.out.print(i+1); System.out.print(": "); m[i] = input.nextInt(); i = i + 1; } } static int[][] transpose(int m[][], int r, int c) { int k, i; int m1[][] = new int[c][]; k = 0; while (k < c) { m1[k] = new int[r]; k = k + 1; } i = 0; while (i < r) { int j = 0; while (j < c) { m1[j][i] = m[i][j]; j = j + 1; } i = i + 1; } return m1; } static void writeOut (int rows, int cols, int matrix[][]) { int i = 0; while (i < rows) { int j = 0; while (j < cols) { System.out.print(matrix[i][j]); System.out.print(" "); j = j + 1; } System.out.println(); i = i + 1; } } }
[ "navysu@gmail.com" ]
navysu@gmail.com
db8f80695f8b3694ea831613fab8d294af18bd59
0703b0945b639a2c2e5f7460f6abcf8b156f85c5
/src/main/java/com/hzyice/demo/excelOK/CreateExcel.java
8a747a0ee80798e6f9d0c60cf076c896b9bd16ad
[]
no_license
clanthunder/ExcelDynamicWatermark
5d7abd8acdde080a49142ac8c25e74d9aee4ff01
25260081f2ecc64b57394f24a5b782fcaa61346e
refs/heads/master
2023-07-09T12:02:59.137557
2018-08-03T09:21:15
2018-08-03T09:21:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,330
java
package com.hzyice.demo.excelOK; import lombok.extern.slf4j.Slf4j; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.xssf.streaming.SXSSFCell; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.io.*; import java.util.Arrays; import java.util.List; /** * @Discreption 根据已有的Excel模板,修改模板内容生成新Excel */ @Slf4j public class CreateExcel { public static void main(String[] args) throws IOException { //excle 2003 //createXLS(); //excle 2007 //createXLSX(); // OK //projectCreateXLSX(); /*int a = 1; int b = a; b += 2; System.out.println(a); System.out.println(b);*/ //testSetSheestName(); //log.info("水印模板生成完成..."); String file = "c:abc\\e"; String substring = file.substring(file.lastIndexOf("\\") + 1, file.length()); System.out.println(substring.length()); } /** * *(2003 xls后缀 导出) * @return void 返回类型 * @author xsw * @2016-12-7上午10:44:00 */ public static void createXLS() throws IOException{ //excel模板路径 File fi=new File("D:\\offer_template.xls"); POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(fi)); //读取excel模板 HSSFWorkbook wb = new HSSFWorkbook(fs); //读取了模板内所有sheet内容 HSSFSheet sheet = wb.getSheetAt(0); //如果这行没有了,整个公式都不会有自动计算的效果的 sheet.setForceFormulaRecalculation(true); //在相应的单元格进行赋值 HSSFCell cell = sheet.getRow(11).getCell(6);//第11行 第6列 cell.setCellValue(1); HSSFCell cell2 = sheet.getRow(11).getCell(7); cell2.setCellValue(2); sheet.getRow(12).getCell(6).setCellValue(12); sheet.getRow(12).getCell(7).setCellValue(12); //修改模板内容导出新模板 FileOutputStream out = new FileOutputStream("D:/export.xls"); wb.write(out); out.close(); } /** * *(2007 xlsx后缀 导出) * @return void 返回类型 * @author xsw * @2016-12-7上午10:44:30 */ public static void createXLSX() throws IOException{ //excel模板路径 File fi=new File("D:\\excel\\base\\style.xlsx"); InputStream in = new FileInputStream(fi); //读取excel模板 XSSFWorkbook wb = new XSSFWorkbook(in); //读取了模板内所有sheet内容 XSSFSheet sheet = wb.getSheetAt(0); //如果这行没有了,整个公式都不会有自动计算的效果的 sheet.setForceFormulaRecalculation(true); sheet.createRow(6).createCell(6).setCellValue(66); //修改模板内容导出新模板 FileOutputStream out = new FileOutputStream("D:\\excel\\idea\\export.xlsx"); wb.write(out); out.close(); } // 按项目中 public static void projectCreateXLSX() throws IOException{ //excel模板路径 File fi=new File("D:\\excel\\base\\style.xlsx"); InputStream in = new FileInputStream(fi); XSSFWorkbook xssfSheets = new XSSFWorkbook(in); //读取excel模板 //SXSSFWorkbook wb = new SXSSFWorkbook(xssfSheets); //读取了模板内所有sheet内容 //Sheet sheet = wb.getSheetAt(0); //HSSFWorkbook workbook = new HSSFWorkbook(in); //workbook.cloneSheet(1); List<String> strings = Arrays.asList("abc", "def", "ghi", "jkl", "mno"); //wb.cloneSheet(1); //wb.c for (int i = 0; i < 5; i++) { xssfSheets.cloneSheet(0); xssfSheets.setSheetName(i, strings.get(i)); log.info("i = ", i); //workbook.cloneSheet(0); //SXSSFSheet sheetAt = (SXSSFSheet)wb.createSheet(strings.get(i)); //SXSSFSheet sheetAt = (SXSSFSheet)wb.getSheetAt(i); //sheetAt = (SXSSFSheet)wb.getSheetAt(0); //Sheet sheet = wb.cloneSheet(5); //wb.setSheetName(i, strings.get(i)); } xssfSheets.removeSheetAt(5); //如果这行没有了,整个公式都不会有自动计算的效果的 //sheet.setForceFormulaRecalculation(true); //sheet.createRow(6).createCell(6).setCellValue(66); SXSSFWorkbook wb = new SXSSFWorkbook(xssfSheets); //修改模板内容导出新模板 FileOutputStream out = new FileOutputStream("D:\\excel\\idea\\export.xlsx"); wb.write(out); //workbook.write(out); //xssfSheets.write(out); out.close(); } public static void testSetSheestName() { //excel模板路径 File fi=new File("D:\\excel\\base\\style.xlsx"); XSSFWorkbook xssfSheets = null; try { InputStream in = new FileInputStream(fi); xssfSheets = new XSSFWorkbook(in); } catch (IOException e) { log.error("加载字节流异常..."); } xssfSheets.setSheetName(0, "message"); SXSSFWorkbook sxssfWorkbook = new SXSSFWorkbook(xssfSheets); SXSSFSheet sheet = (SXSSFSheet) sxssfWorkbook.getSheetAt(0); SXSSFCell cell = (SXSSFCell) sheet.createRow(0).createCell(0); cell.setCellType(SXSSFCell.CELL_TYPE_STRING); cell.setCellValue("错误了..."); CellStyle messStyle = sxssfWorkbook.createCellStyle(); cell.setCellStyle(messStyle); messStyle.setWrapText(true); Font font = sxssfWorkbook.createFont(); messStyle.setFont(font); font.setColor(Font.COLOR_RED); sheet.autoSizeColumn(0); //修改模板内容导出新模板 FileOutputStream out = null; try { out = new FileOutputStream("D:\\excel\\idea\\export.xlsx"); sxssfWorkbook.write(out); //workbook.write(out); //xssfSheets.write(out); out.close(); } catch (Exception e) { e.printStackTrace(); } } public static void testExcelName() { File tempFile2 = new File("D:\\excel\\base\\style.xlsx");; XSSFWorkbook xssfSheets = null; try { InputStream in = new FileInputStream(tempFile2); xssfSheets = new XSSFWorkbook(in); } catch (IOException e) { log.error("加载字节流异常..."); } xssfSheets.setSheetName(0, "message"); SXSSFWorkbook sxssfWorkbook = new SXSSFWorkbook(xssfSheets); //写入临时xlsx FileOutputStream fileOutputStream = null; try { fileOutputStream = new FileOutputStream(tempFile2); sxssfWorkbook.write(fileOutputStream); } catch (Exception e) { e.printStackTrace(); } } }
[ "hzyice@126.com" ]
hzyice@126.com
17c475507365d887e710068856ba8e450090b3dc
4fc0ebf4008b6b0db7bf9a8061452c8b276558c0
/JavaSim/src/main/java/arjuna/JavaSim/Distributions/ExponentialStream.java
6130bf36e4dfe96cb04393c87a822e585b6be44c
[]
no_license
gfrymer/FreeMMG3
6e919f63744a9bda7fb2051f85d5723c254d530e
4f37bcdec00eb665f4f9b3ebba97b65cc82e828a
refs/heads/master
2021-03-12T21:19:36.590039
2015-05-27T12:57:10
2015-05-27T12:57:10
6,573,907
3
0
null
null
null
null
UTF-8
Java
false
false
1,144
java
package arjuna.JavaSim.Distributions; import java.io.IOException; /** Returns a number from an exponential distribution with the given mean. */ public class ExponentialStream extends RandomStream { /** Create stream with mean 'm'. */ public ExponentialStream (double m) { super(); Mean = m; } /** Create stream with mean 'm'. Skip the first 'StreamSelect' stream values. */ public ExponentialStream (double m, int StreamSelect) { super(); Mean = m; for (int i = 0; i < StreamSelect*1000; i++) Uniform(); } /** Create stream with mean 'm'. Skip the first 'StreamSelect' stream values. Pass seeds 'MGSeed' and 'LCGSeed' to the base class. */ public ExponentialStream (double m, int StreamSelect, long MGSeed, long LCGSeed) { super(MGSeed, LCGSeed); Mean = m; for (int i = 0; i < StreamSelect*1000; i++) Uniform(); } /** Return stream number. */ public double getNumber () throws IOException, ArithmeticException { return -Mean*Math.log(Uniform()); } private double Mean; };
[ "gfrymer@fi.uba.ar" ]
gfrymer@fi.uba.ar
0803962404d894c70e7795b6140dfaf905246119
1754f600abd98788eb14db1114133f1644b091c9
/src/GameEngine/Adam.java
8f570f089e3e1d00340e817878a4aee8c3165060
[]
no_license
DiSharko/UnforeseenPlatformer
8245dc5bbde9c56014c5bb5a4ecbb3a718a1d9ee
05d32b543dc9b82a440ebc8b7a94c0d6639f01ee
refs/heads/master
2021-01-01T17:47:30.620932
2014-01-15T18:23:37
2014-01-15T18:23:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,713
java
package GameEngine; public class Adam extends CharacterTemplate { public Adam(Board b, int t, double xpos, double ypos){ board = b; if (t == 0){ controlled = true; } else { controlled = false; } team = t; x = xpos; y = ypos; //setupHourglass(); setupUnforeseen(); } public void setupUnforeseen(){ name = "adam"; nickname = "Adam"; //weapons.add(new FireSet1()); //weapons.add(new FireSet2()); importSequence("still"); importSequence("run"); importSequence("jump"); importSequence("fall"); importSequence("climb"); importSequence("attack1"); importSequence("attack2"); importSequence("punch"); //importSequence("walk"); //importSequence("wallClimb"); originalW = 26; originalH = 30; w = originalW; h = originalH; drawW = w; drawH = h; totalJumps = 1; canJump = true; xAcceleration = 0.2; xMaxSpeed = 4.3; jumpAcceleration = 3.6; jumpMaxSpeed = 80000.2; fallSpeed = 0.7; fallMaxSpeed = 7; moveState = MoveState.STILL; moveStateFrame = 0; facing = 1; healthMax = 25; health = healthMax; energyMax = 100; energyRechargeSpeed = 0.4; energy = energyMax; //manaMax = 100; //manaRechargeSpeed = 0.01; //mana = manaMax; invincibleMaxTime = 150; hitBox[0] = 3; // taken off the left side (each side) hitBox[1] = 1; // lower than head hitBox[2] = w-hitBox[0]; // so that it takes the same off the right side hitBox[3] = h; // so that it rests on the bottom exactly inventory = new Inventory(board, this); } public void setupHourglass(){ name = "main_boy"; //weapons.add(new FireSet1()); //weapons.add(new FireSet2()); //weapons.add(new AgilitySet1()); importSequence("still"); importSequence("run"); importSequence("jump"); importSequence("fall"); importSequence("attack1"); importSequence("attack2"); //importSequence("walk"); //importSequence("wallClimb"); originalW = 26; originalH = 30; w = originalW; h = originalH; drawW = w; drawH = h; totalJumps = 1; canJump = true; xAcceleration = 0.07; xMaxSpeed = 2.0; jumpAcceleration = 1.9; jumpMaxSpeed = 4.2; fallSpeed = 0.2; fallMaxSpeed = 2.9; moveState = MoveState.STILL; moveStateFrame = 0; facing = 1; healthMax = 25; health = healthMax; energyMax = 100; energyRechargeSpeed = 0.4; energy = energyMax; //manaMax = 100; //manaRechargeSpeed = 0.01; //mana = manaMax; invincibleTime = 150; hitBox[0] = 3; // taken off the left side (each side) hitBox[1] = 1; // lower than head hitBox[2] = w-hitBox[0]; // so that it takes the same off the right side hitBox[3] = h; // so that it rests on the bottom exactly inventory = new Inventory(board, this); } }
[ "dimarc217@gmail.com" ]
dimarc217@gmail.com
762ae42bbedb28110c9ede6ed56201246af04e3f
879f2a4cd2307192591f4c1a5af6fb87a21baa90
/src/main/java/com/denyskozii/meetingcounter/repository/UserRepository.java
a835a4d0581686ebd938339c2ebb672f970cee8d
[]
no_license
DenysKozii/MeetingCounter
a7bdf337022f7ed573708c9af84a50ad9a5c37c4
82d67caf5cc4b90b2d7e511d00514d5b23148a1d
refs/heads/master
2023-01-08T17:51:25.368170
2020-11-14T14:39:16
2020-11-14T14:39:16
293,606,035
0
0
null
null
null
null
UTF-8
Java
false
false
1,397
java
package com.denyskozii.meetingcounter.repository; import com.denyskozii.meetingcounter.model.Role; import com.denyskozii.meetingcounter.model.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.transaction.annotation.Transactional; import javax.validation.constraints.Email; import java.util.List; import java.util.Optional; /** * Date: 07.09.2020 * * @author Denys Kozii */ public interface UserRepository extends JpaRepository<User, Long> { // @Query(value = // "SELECT * FROM user u " + // "WHERE u.id IN( " + // " SELECT me.user_id " + // " FROM meeting_user me" + // " WHERE me.meeting_id =:meetingId" + // ")", nativeQuery = true) // List<User> getAllByMeetingId(@Param("meetingId") Long meetingId); Optional<User> findByEmail(@Email(message = "Wrong email format") String email); List<User> getAllByRole(Role role); Optional<User> findByEmailAndFirstNameAndLastName(String email, String firstName, String lastName); @Transactional @Query(value = "SELECT COUNT(*) FROM meeting_user " + "WHERE user_id = :userId AND meeting_id = :meetingId", nativeQuery = true) boolean isUserSubscribedToMeeting(Long userId, Long meetingId); }
[ "denys.kozii@gmail.com" ]
denys.kozii@gmail.com
3931a9e8f0a307d6f29f1ee61c48edd2bfcdb0ab
6252c165657baa6aa605337ebc38dd44b3f694e2
/org.eclipse.epsilon.egl.sync/Scalability-Tests/boiler-To-Generate-1000-Files/boiler-To-Generate-1000-Files/syncregions-1000Files/TemperatureController968.java
b8d88d4affc36f1e8c909554663179fc7ca8ed35
[]
no_license
soha500/EglSync
00fc49bcc73f7f7f7fb7641d0561ca2b9a8ea638
55101bc781349bb14fefc178bf3486e2b778aed6
refs/heads/master
2021-06-23T02:55:13.464889
2020-12-11T19:10:01
2020-12-11T19:10:01
139,832,721
0
1
null
2019-05-31T11:34:02
2018-07-05T10:20:00
Java
UTF-8
Java
false
false
368
java
package syncregions; public class TemperatureController968 { public int execute(int temperature968, int targetTemperature968) { //sync _bfpnFUbFEeqXnfGWlV2968, behaviour 1-if(temperatureDifference > 0 && boilerStatus == true) { return 1; } else if (temperatureDifference < 0 && boilerStatus == false) { return 2; } else return 0; //endSync } }
[ "sultanalmutairi@172.20.10.2" ]
sultanalmutairi@172.20.10.2
68a664af51f5db2d3443313a4a9b3e91c9320c26
d41fe632666e5bf1de0f8257207986f92b45ed28
/SBQL4J_Examples/dist/pl/wcislo/sbql4j/examples/java_heap/linq/LinqQueriesJavaHeap_SbqlQuery70.java
b2bffd2380ffe0e1bc1eaec057dc98f38e9b08ab
[]
no_license
asassello/JPS2015
5ec8ac73ba9afbe61fb6d655bf7ee4a31180a048
18529b175e057b8e8764cfe0b93e0524d426da45
refs/heads/master
2020-03-30T07:57:09.440145
2015-01-20T23:49:52
2015-01-20T23:49:52
28,887,764
0
0
null
null
null
null
UTF-8
Java
false
false
2,902
java
package pl.wcislo.sbql4j.examples.java_heap.linq; import org.apache.commons.collections.CollectionUtils; import pl.wcislo.sbql4j.examples.*; import pl.wcislo.sbql4j.examples.model.*; import pl.wcislo.sbql4j.examples.model.linq.*; import pl.wcislo.sbql4j.exception.*; import pl.wcislo.sbql4j.java.model.compiletime.Signature.SCollectionType; import pl.wcislo.sbql4j.java.model.runtime.*; import pl.wcislo.sbql4j.java.model.runtime.Struct; import pl.wcislo.sbql4j.java.model.runtime.factory.*; import pl.wcislo.sbql4j.java.utils.ArrayUtils; import pl.wcislo.sbql4j.java.utils.OperatorUtils; import pl.wcislo.sbql4j.java.utils.Pair; import pl.wcislo.sbql4j.lang.codegen.nostacks.*; import pl.wcislo.sbql4j.lang.codegen.simple.*; import pl.wcislo.sbql4j.lang.db4o.*; import pl.wcislo.sbql4j.lang.db4o.codegen.*; import pl.wcislo.sbql4j.lang.db4o.codegen.interpreter.*; import pl.wcislo.sbql4j.lang.db4o.codegen.nostacks.*; import pl.wcislo.sbql4j.lang.parser.expression.*; import pl.wcislo.sbql4j.lang.parser.expression.OrderByParamExpression.SortType; import pl.wcislo.sbql4j.lang.parser.terminals.*; import pl.wcislo.sbql4j.lang.parser.terminals.operators.*; import pl.wcislo.sbql4j.lang.types.*; import pl.wcislo.sbql4j.lang.xml.*; import pl.wcislo.sbql4j.model.*; import pl.wcislo.sbql4j.model.collections.*; import pl.wcislo.sbql4j.util.*; import pl.wcislo.sbql4j.util.Utils; import pl.wcislo.sbql4j.xml.model.*; import pl.wcislo.sbql4j.xml.parser.store.*; import java.io.Console; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.*; public class LinqQueriesJavaHeap_SbqlQuery70 { private List<java.lang.String> words; public LinqQueriesJavaHeap_SbqlQuery70(final java.lang.String[] words) { this.words = ArrayUtils.toList(words); } /** * original query='avg(words.length())' * * query after optimization=' avg(words.length())' */ public java.lang.Double executeQuery() { java.util.List<java.lang.String> _ident_words = words; java.util.List<java.lang.Integer> _dotResult = new java.util.ArrayList<java.lang.Integer>(); int _dotIndex = 0; for (java.lang.String _dotEl : _ident_words) { if (_dotEl == null) { continue; } java.lang.Integer _mth_lengthResult = _dotEl.length(); _dotResult.add(_mth_lengthResult); _dotIndex++; } java.lang.Double _queryResult = 0d; if ((_dotResult != null) && !_dotResult.isEmpty()) { Number _avgSum1 = null; for (Number _avgEl1 : _dotResult) { _avgSum1 = MathUtils.sum(_avgSum1, _avgEl1); } _queryResult = _avgSum1.doubleValue() / _dotResult.size(); } return _queryResult; } }
[ "user@user-THINK" ]
user@user-THINK
ca830a5d1508e3a4d13e3c4209979936b62deabf
3c29303a028016fee56c161d7892b72f853fab05
/MunchkinEventResolution/src/strategy/IStrategyContext.java
17ad889bfc664660180eb9d7bd7e599173ac9ca9
[]
no_license
kevinfjbecker/loot-monger
101a6accc8c275f56ab2454c703d9eb7d6766e5d
b4989311f754f876c85534e0bc29d7c1d03c1085
refs/heads/master
2021-03-12T22:23:02.310412
2008-09-27T22:24:06
2008-09-27T22:24:06
33,750,195
0
0
null
null
null
null
UTF-8
Java
false
false
271
java
package strategy; public interface IStrategyContext { void putStrategy(AStrategy strategy); AStrategy getStrategy(IStrategyType type); boolean containsStrategyType(IStrategyType type); AStrategy replaceEquivalentStrategyWith(AStrategy strategy); }
[ "kevinfjbecker@96f814b5-8e46-0410-8938-e1327941a63d" ]
kevinfjbecker@96f814b5-8e46-0410-8938-e1327941a63d
45fc8ac065c7836406f86a5da5c7d404c6d84ec5
5211671df21080b45c8459877bd929f6a55f3deb
/app/src/main/java/com/example/mayn/myapp/UI/CameraSurfaceView.java
4eb6834ad516c7e047d81dc6674c3e6c65d28a60
[]
no_license
shuqinggang/MyApp
cb6660ff10f0f01c696bf085fa22c0d24683c553
9af74b658c9edde554679e3b0cda727dc8ef72f8
refs/heads/master
2020-03-16T17:30:52.291671
2018-07-31T10:02:59
2018-07-31T10:02:59
132,835,611
1
0
null
null
null
null
UTF-8
Java
false
false
1,344
java
package com.example.mayn.myapp.UI; import android.content.Context; import android.util.AttributeSet; import android.view.SurfaceHolder; import android.view.SurfaceView; /** * Created by shuqinggang on 2018/7/30. * 自定义相机 */ public class CameraSurfaceView extends SurfaceView implements SurfaceHolder.Callback { private final static String TAG=CameraSurfaceView.class.getName(); private SurfaceHolder surfaceHolder; public CameraSurfaceView(Context context) { super(context); inite(); } public CameraSurfaceView(Context context, AttributeSet attrs) { super(context, attrs); inite(); } public CameraSurfaceView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); inite(); } public void inite(){ surfaceHolder=getHolder(); surfaceHolder.addCallback(this); } @Override public void surfaceCreated(SurfaceHolder holder) { CameraUtils.openFrontalCamera(CameraUtils.DESIRED_PREVIEW_FPS); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { CameraUtils.startPreviewDisplay(holder); } @Override public void surfaceDestroyed(SurfaceHolder holder) { CameraUtils.releaseCamera(); } }
[ "429035093@qq.com" ]
429035093@qq.com
9574f97b2466ec2d51d853cd3f9720e4dd3beb80
7ef25781e7bf4f99f0ac08c42186bcd0a8e8b427
/Onilne1/src/onilne1/BubbleSorting.java
2b682460aac8d6aaae0c5fd6b5e029ca422ed289
[]
no_license
siamislam1603/Data-Structures
0710678bc88f24e175e4d7addd8582f024e56276
abf115c1df823c7aea8e112798ffdbcb59ea74bd
refs/heads/master
2020-06-04T22:55:37.130938
2019-06-16T18:25:11
2019-06-16T18:25:11
192,222,554
1
0
null
null
null
null
UTF-8
Java
false
false
431
java
package onilne1; public class BubbleSorting { BubbleSorting(int a[],int k){ int m=0; int len=a.length; while(m>=0){ int t=0; for(int i=0;i<len-1;i++){ if(a[i]>a[i+1]){ int temp = a[i]; a[i] = a[i+1]; a[i+1] = temp; } t=i; } m=t; } } }
[ "siamislam1603@gmail.com" ]
siamislam1603@gmail.com
7fb0eba5d3efbc02c549853f6de8d6554dc95f91
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module342/src/main/java/module342packageJava0/Foo173.java
e7427af48aa3ea8eda729320b58e429b769b80e1
[ "Apache-2.0" ]
permissive
uber-common/android-build-eval
448bfe141b6911ad8a99268378c75217d431766f
7723bfd0b9b1056892cef1fef02314b435b086f2
refs/heads/master
2023-02-18T22:25:15.121902
2023-02-06T19:35:34
2023-02-06T19:35:34
294,831,672
83
7
Apache-2.0
2021-09-24T08:55:30
2020-09-11T23:27:37
Java
UTF-8
Java
false
false
511
java
package module342packageJava0; import java.lang.Integer; public class Foo173 { Integer int0; Integer int1; public void foo0() { new module342packageJava0.Foo172().foo8(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } public void foo6() { foo5(); } public void foo7() { foo6(); } public void foo8() { foo7(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
72000c3d9546e5300205e4e77ea196072d4cebc6
b12b852a30e048a680c5d57a0e07f08700d63f7c
/exceptions4.java
8cd0a0bc52e30e249be7e824fa51812e869b8e97
[]
no_license
rlikhita/Java-Codes
5804967af3149b21d65ff01a4b163206f55acd3a
29ef8ec655ff5aca1ce869d5661937023c3d2a08
refs/heads/master
2022-04-26T10:37:23.349757
2020-04-29T07:16:40
2020-04-29T07:16:40
259,851,404
1
0
null
null
null
null
UTF-8
Java
false
false
1,202
java
import java.util.*; public class exceptions4 { public static void main(String[] args) { System.out.println("**Calculator**"); try { String numb1,numb2,operator; Scanner sc= new Scanner(System.in); System.out.println("Input the first number"); numb1=sc.next(); int number1 = Integer.parseInt(numb1); System.out.println("Input the second number"); numb2=sc.next(); int number2 = Integer.parseInt(numb2); System.out.println("Enter the option as to which operation has to be performed"); operator=sc.next(); int operation= Integer.parseInt(operator); if(operation==1) { System.out.println("Addition::"+ (number1+number2)); } else if(operation==2) { System.out.println("Substraction::"+ (number1-number2)); } else if(operation==3) { System.out.println("Multiplication::"+ (number1*number2)); } else if(operation==4) { System.out.println("Division::"+ (number1/number2)); } else { System.out.println("Select a valid option"); } } catch(NumberFormatException f) { System.out.println("***PLEASE ENTER A NUMBER***"); } } }
[ "noreply@github.com" ]
noreply@github.com
12770f69b6f20f8d389e0ffd727fbaf2504073a3
0d190fa3fcfa18754a94edb93affe29e12e2e314
/src/main/java/ru/yusdm/javacore/lesson12up13xml/autoservice/model/exception/ModelExceptionMeta.java
c80c0cb18b21ba7b660ec8e84f5f6f612adc37ae
[]
no_license
DmitryYusupov/javacore
758a736393ddff81576461b3f221dd3d86bbea85
1a61d8ac9f3764725374848ca914bd6915a16e7e
refs/heads/master
2020-04-22T20:44:28.691624
2019-04-20T20:36:13
2019-04-20T20:36:13
170,650,587
7
7
null
null
null
null
UTF-8
Java
false
false
517
java
package ru.yusdm.javacore.lesson12up13xml.autoservice.model.exception; public enum ModelExceptionMeta { DELETE_MODEL_CONSTRAINT_ERROR(1, "Error while delete model. There is constraint violation!"); private int code; private String description; ModelExceptionMeta(int code, String description) { this.code = code; this.description = description; } public int getCode() { return code; } public String getDescription() { return description; } }
[ "usikovich@mail.ru" ]
usikovich@mail.ru
19eb07c0108217bfd17dfe5e61bdbdedd0390242
2c42d04cba77776514bc15407cd02f6e9110b554
/src/org/processmining/exporting/petrinet/PnmlExport.java
010207f3c170fd529f246ab65a212fcf7c4ebdd1
[]
no_license
pinkpaint/BPMNCheckingSoundness
7a459b55283a0db39170c8449e1d262e7be21e11
48cc952d389ab17fc6407a956006bf2e05fac753
refs/heads/master
2021-01-10T06:17:58.632082
2015-06-22T14:58:16
2015-06-22T14:58:16
36,382,761
0
1
null
2015-06-14T10:15:32
2015-05-27T17:11:29
null
UTF-8
Java
false
false
2,300
java
/*********************************************************** * This software is part of the ProM package * * http://www.processmining.org/ * * * * Copyright (c) 2003-2006 TU/e Eindhoven * * and is licensed under the * * Common Public License, Version 1.0 * * by Eindhoven University of Technology * * Department of Information Systems * * http://is.tm.tue.nl * * * **********************************************************/ package org.processmining.exporting.petrinet; import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import org.processmining.exporting.ExportPlugin; import org.processmining.framework.models.petrinet.PetriNet; import org.processmining.framework.models.petrinet.algorithms.PnmlWriter; import org.processmining.framework.plugin.ProvidedObject; /** * @author Peter van den Brand * @version 1.0 */ public class PnmlExport implements ExportPlugin { public PnmlExport() {} public String getName() { return "PNML 1.3.2 file"; } public boolean accepts(ProvidedObject object) { Object[] o = object.getObjects(); for (int i = 0; i < o.length; i++) { if (o[i] instanceof PetriNet) { return true; } } return false; } public void export(ProvidedObject object, OutputStream output) throws IOException { Object[] o = object.getObjects(); for (int i = 0; i < o.length; i++) { if (o[i] instanceof PetriNet) { BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(output)); PnmlWriter.write(false, true, (PetriNet) o[i], bw); bw.close(); return; } } } public String getFileExtension() { return "pnml"; } public String getHtmlDescription() { return "<p> <b>Plug-in: PNML 1.3.2 export</b>"+ "<p>This Plug-in allows the user export a Petri net to a version of "+ "<a href=\"http://www2.informatik.hu-berlin.de/top/pnml/about.html\">PNML</a> "+ "which can be read by <a href=\"http://www.yasper.org/\">YASPER</a>."; } }
[ "pinkpaint.ict@gmail.com" ]
pinkpaint.ict@gmail.com
454e60cee56fce4d9979e09ae26a6e31c455b6cc
1742f391fee6347b9ec96ef70d8f87032f7d81eb
/abstract/src/serializaton/Reciver.java
ebeb5950b7b88005a4b3d9c5aa938f63b019b943
[]
no_license
aryanakshay-v/DXCtraining
aacf2e030c629233620a472250132842fbac963e
7a956ab321e157a1b3e5a9c61aceb96d8fe2a491
refs/heads/master
2023-04-17T19:32:28.566483
2021-04-19T05:54:58
2021-04-19T05:54:58
354,727,067
0
0
null
null
null
null
UTF-8
Java
false
false
344
java
package serializaton; import java.io.*; public class Reciver { public static void main(String[] args) throws Exception { FileInputStream fis = new FileInputStream("wild.txt"); ObjectInputStream ois = new ObjectInputStream(fis); Tiger tiger = (Tiger)ois.readObject(); System.out.println("Tiger Variables are: "+ tiger.a); } }
[ "varyanakshay.com" ]
varyanakshay.com
fa1311818f46132dc17267d0252c451dee624afc
3f8f343a868b1fbcefe525ee96830f4c2a2e7ac1
/src/argonavis/dtd/parsers/AttributeParserTest.java
2243598b3f4bae409e3e7cb233aa03de76946c82
[]
no_license
helderdarocha/dtdreader
b7d5c482d5d04f34756fe0b93d3e9c197deeb294
5ac20c15f65e13691fe256f2709a2fa612b8208b
refs/heads/master
2021-01-18T21:33:26.569275
2014-02-11T22:31:27
2014-02-11T22:31:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,551
java
package argonavis.dtd.parsers; import argonavis.dtd.*; import argonavis.dtd.tagdata.*; import java.io.*; import java.util.*; import junit.framework.*; public class AttributeParserTest extends TestCase { public AttributeParserTest(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite(AttributeParserTest.class); return suite; } AttributeParser parser; public void setUp() { parser = AttributeParser.getInstance(); } public void testParse() throws ParseException { String elementName = "elephant"; String[] attStrings = {"name CDATA #REQUIRED", "sex (male | female) #IMPLIED", "parents IDREFS #REQUIRED", "weight NMTOKEN #IMPLIED", "species (african | indian) \"african\"", "status CDATA #FIXED 'endangered'", "country NOTATION (sa | in) #REQUIRED", "photo ENTITY #REQUIRED"}; String[] notations = {"sa", "in"}; String[] notationValues = {"South Africa", "India"}; NotationTagParser notationParser = NotationTagParser.getInstance(); for (int i = 0; i < notations.length; i++) { notationParser.addNotation(new NotationTag(notations[i], notationValues[i])); } String[] sexValues = {"male", "female"}; String[] eleSpValues = {"african", "indian"}; Attribute[] atts = { new Attribute("name", AttributeType.CDATA, DefaultValueDeclaration.REQUIRED), new Attribute("sex", new AttributeEnumeration(sexValues), DefaultValueDeclaration.IMPLIED), new Attribute("parents", AttributeType.IDREFS, DefaultValueDeclaration.REQUIRED), new Attribute("weight", AttributeType.NMTOKEN, DefaultValueDeclaration.IMPLIED), new Attribute("species", new AttributeEnumeration(eleSpValues), new DefaultValueDeclaration("african")), new Attribute("status", AttributeType.CDATA, new DefaultValueDeclaration("endangered", true)), new Attribute("country", new AttributeNotationEnumeration(notations), DefaultValueDeclaration.REQUIRED), new Attribute("photo", AttributeType.ENTITY, DefaultValueDeclaration.REQUIRED) }; for (int i = 0; i < atts.length; i++) { assertEquals(atts[i], parser.parse(attStrings[i])); } } // String[] parseChoiceList(String string) public void testParseEnumeration() throws ParseException { // three test strings that should result in the same array String[] testStr = {"( one | two | three | four )", "(one|\ntwo\t | three \n|four )", "(one|two|three|four)"}; String[] expected = {"one", "two", "three", "four"}; for (int i = 0; i < testStr.length; i++) { String[] result = parser.parseEnumeration(testStr[i]); assertEquals(expected.length, result.length); for (int j = 0; j < result.length; j++) { assertEquals(result[j], expected[j]); } } } }
[ "helder.darocha@gmail.com" ]
helder.darocha@gmail.com
1c4ec719837e90c3782230391c2aa3f2c0542cf0
1fc091aa0130fb8c9ff0baa8a47feb61a65c1319
/spring-project-tracker/src/main/java/com/spring/springprojecttracker/dto/block/BlockDto.java
f52cf5ba9f7a86e9079d50c9087832401054ca98
[]
no_license
jaejin1/spring
dbadd96db4907523dd1cb4d49162f85e42a89034
a6eb1733d64d37e01564d37d294d951fb4179d12
refs/heads/master
2020-11-28T08:18:19.639151
2020-01-13T01:33:26
2020-01-13T01:33:26
229,754,367
0
0
null
null
null
null
UTF-8
Java
false
false
1,959
java
package com.spring.springprojecttracker.dto.block; import com.spring.springprojecttracker.domain.block.Block; import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import java.time.LocalDateTime; public class BlockDto { @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) public static class RegistBlockReq { private Long blockHeight; private String channel; private String peerId; private String signature; private String blockHash; private LocalDateTime timestamp; @Builder public RegistBlockReq(Long blockHeight, String channel, String peerId, String signature, String blockHash, LocalDateTime timestamp) { this.blockHeight = blockHeight; this.channel = channel; this.peerId = peerId; this.signature = signature; this.blockHash = blockHash; this.timestamp = timestamp; } public Block toEntity() { return Block.builder() .blockHeight(blockHeight) .channel(channel) .peerId(peerId) .signature(signature) .blockHash(blockHash) .timestamp(timestamp) .build(); } } @Getter public static class Res { private Long blockHeight; private String channel; private String peerId; private String signature; private String blockHash; private LocalDateTime timestamp; public Res(Block block) { this.blockHeight = block.getBlockHeight(); this.channel = block.getChannel(); this.peerId = block.getPeerId(); this.signature = block.getSignature(); this.blockHash = block.getBlockHash(); this.timestamp = block.getTimestamp(); } } }
[ "opiximeo@gmail.com" ]
opiximeo@gmail.com
31da19a7834ea515f8e852aaff5e5912b1c01459
377a161d5319b7af59590f6919523fd89cace93c
/src/edu/ucla/library/libservices/reserves/generators/DepartmentGenerator.java
a76a304d6540bb7fa50d3317df0cc8fd9b16a942
[]
no_license
DRickard/ReservesService
b23543726386997621ea58b0c6af1ad2e9e330f6
cc2f942e60eef5b2d994dcd1ea4ae4db1cbecde6
refs/heads/master
2020-12-25T21:12:37.704421
2016-04-20T18:00:26
2016-04-20T18:00:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,285
java
package edu.ucla.library.libservices.reserves.generators; import edu.ucla.library.libservices.reserves.beans.Department; import edu.ucla.library.libservices.reserves.db.mappers.DepartmentMapper; import edu.ucla.library.libservices.reserves.db.mappers.DistinctDepartmentMapper; import edu.ucla.library.libservices.reserves.db.utiltiy.DataSourceFactory; import java.util.List; import javax.sql.DataSource; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import org.springframework.jdbc.core.JdbcTemplate; //import org.springframework.jdbc.datasource.DriverManagerDataSource; @XmlRootElement( name = "departmentList" ) public class DepartmentGenerator { //private DriverManagerDataSource ds; private DataSource ds; @XmlElement( name = "department" ) private List<Department> departments; private String quarter; private String dbName; private static final String DEPT_QUERY = "SELECT DISTINCT department_id,department_code,department_name " + "FROM vger_support.reserve_departments WHERE quarter = " + "vger_support.get_current_quarter() ORDER BY department_name"; private static final String QUARTER_QUERY = "SELECT DISTINCT department_id,department_code,department_name, quarter" + " FROM vger_support.reserve_departments WHERE quarter = ? " + "ORDER BY department_name"; public DepartmentGenerator() { super(); } public List<Department> getDepartments() { return departments; } public void setQuarter( String quarter ) { this.quarter = quarter; } private String getQuarter() { return quarter; } private void makeConnection() { ds = DataSourceFactory.createDataSource( getDbName() ); //ds = DataSourceFactory.createVgerSource(); } public void prepCurrentDepts() { makeConnection(); departments = new JdbcTemplate( ds ).query( DEPT_QUERY, new DistinctDepartmentMapper() ); } public void prepDeptsByQuarter() { makeConnection(); departments = new JdbcTemplate( ds ).query( QUARTER_QUERY, new Object[] { getQuarter() }, new DepartmentMapper() ); } public void setDbName( String dbName ) { this.dbName = dbName; } private String getDbName() { return dbName; } }
[ "drickard1967@library.ucla.edu" ]
drickard1967@library.ucla.edu
dbf05baa37f099a9d044fd900acc5acde70916cb
e80cb4531f8a4caeae1d25761bdc42cb660ac6c5
/jsaga-engine/src/fr/in2p3/jsaga/impl/job/instance/stream/Stdout.java
341029d2f2c3dbe11fa5fc9c3e74dc9a5c4a00f6
[]
no_license
ccin2p3/jsaga
67cfbc8f00a4ff8336ec1c977caffdc60108e0cf
040e268f1a80cb44a4cf449a694b33ac415eac3d
refs/heads/master
2021-01-20T17:12:30.074376
2017-04-25T11:13:18
2017-04-25T11:13:18
62,138,791
1
0
null
null
null
null
UTF-8
Java
false
false
701
java
package fr.in2p3.jsaga.impl.job.instance.stream; import org.ogf.saga.error.*; import java.io.InputStream; /* *************************************************** * *** Centre de Calcul de l'IN2P3 - Lyon (France) *** * *** http://cc.in2p3.fr/ *** * *************************************************** * File: Stdout * Author: Sylvain Reynaud (sreynaud@in2p3.fr) * Date: 23 mai 2008 * *************************************************** * Description: */ /** * */ public abstract class Stdout extends InputStream { public abstract void closeJobIOHandler() throws PermissionDeniedException, TimeoutException, NoSuccessException; }
[ "Sylvain.Reynaud@in2p3.fr" ]
Sylvain.Reynaud@in2p3.fr
4d4e0422279f116ccfd5300e5be98d4dfa978efd
c583f9fe8281c526acabba0fe1a0419679cf7145
/DinaWebMaven/DinaeWebMaven-ejb/src/main/java/co/gov/policia/dinae/modelo/ViajesProyectoVersion.java
25c5dbff23b951277bc8c876d8f74c8439173b0b
[]
no_license
afzamorag/DinaeWebSIGACII
38d71cd96619829f4c9b4aecc84f7436371c6746
be1004d0658aed2c1d59c21fa73ef1ebb3eef31e
refs/heads/main
2023-07-15T00:13:00.371156
2021-08-30T19:39:14
2021-08-30T19:39:14
375,842,663
1
0
null
null
null
null
UTF-8
Java
false
false
5,628
java
package co.gov.policia.dinae.modelo; import co.gov.policia.dinae.interfaces.IDataModel; import java.io.Serializable; import java.math.BigDecimal; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.persistence.Transient; /** * * @author Rafael Guillermo Blanco Banquez <rafaelg.blancob@gmail.com> */ @Entity @Table(name = "VIAJES_PROYECTO_VERSION") @NamedQueries({ @NamedQuery(name = "ViajesProyectoVersion.findAll", query = "SELECT v From ViajesProyectoVersion v"), @NamedQuery(name = "ViajesProyectoVersion.findById", query = "SELECT v From ViajesProyectoVersion v WHERE v.idViajeProyecto = :idViajeProyecto"), @NamedQuery(name = "ViajesProyectoVersion.findViajesByProyecto", query = "SELECT v From ViajesProyectoVersion v WHERE v.fuenteProyectoVersion.proyectoVersion.idProyecto = :idProyecto"), @NamedQuery(name = "ViajesProyectoVersion.findViajesByProyectoDTO", query = "SELECT NEW co.gov.policia.dinae.dto.ViajesProyectoDTO(v.idViajeProyecto, v.evento, v.costosPasajes, v.costosViaticos, v.investigadoresProyectoVersion.idInvestigadorProyecto, v.investigadoresProyectoVersion.nombreCompleto, v.investigadoresProyectoVersion.grado, v.fuenteProyectoVersion.idFuenteProyecto, v.fuenteProyectoVersion.proyectoVersion.idProyecto, v.fuenteProyectoVersion.nombreFuente, v.codigoCiudadOrigen, v.nombreCiudadOrigen, v.codigoCiudadDestino, v.nombreCiudadDestino) From ViajesProyectoVersion v WHERE v.fuenteProyectoVersion.proyectoVersion.idProyecto = :idProyecto") }) public class ViajesProyectoVersion implements IDataModel, Serializable { private static final long serialVersionUID = 1L; @Id @Column(name = "ID_VIAJE_PROYECTO") private Long idViajeProyecto; @Column(name = "EVENTO", nullable = false, length = 512) private String evento; @Column(name = "COSTOS_PASAJES", nullable = false) private BigDecimal costosPasajes; @Column(name = "COSTOS_VIATICOS", nullable = false) private BigDecimal costosViaticos; @JoinColumn(name = "ID_INVESTIGADOR_PROYECTO", referencedColumnName = "ID_INVESTIGADOR_PROYECTO") @ManyToOne(optional = false) private InvestigadorProyectoVersion investigadoresProyectoVersion; @JoinColumn(name = "ID_FUENTE_PROYECTO", referencedColumnName = "ID_FUENTE_PROYECTO") @ManyToOne private FuenteProyectoVersion fuenteProyectoVersion; @Column(name = "CODIGO_CIUDAD_ORIGEN") private String codigoCiudadOrigen; @Column(name = "NOMBRE_CIUDAD_ORIGEN") private String nombreCiudadOrigen; @Column(name = "CODIGO_CIUDAD_DESTINO") private String codigoCiudadDestino; @Column(name = "NOMBRE_CIUDAD_DESTINO") private String nombreCiudadDestino; @Transient private boolean seleccionable; public ViajesProyectoVersion() { } public ViajesProyectoVersion(Long idViajeProyecto) { this.idViajeProyecto = idViajeProyecto; } public Long getIdViajeProyecto() { return idViajeProyecto; } public void setIdViajeProyecto(Long idViajeProyecto) { this.idViajeProyecto = idViajeProyecto; } public String getEvento() { return evento; } public void setEvento(String evento) { this.evento = evento; } public BigDecimal getCostosPasajes() { return costosPasajes; } public void setCostosPasajes(BigDecimal costosPasajes) { this.costosPasajes = costosPasajes; } public BigDecimal getCostosViaticos() { return costosViaticos; } public void setCostosViaticos(BigDecimal costosViaticos) { this.costosViaticos = costosViaticos; } public String getCodigoCiudadOrigen() { return codigoCiudadOrigen; } public void setCodigoCiudadOrigen(String codigoCiudadOrigen) { this.codigoCiudadOrigen = codigoCiudadOrigen; } public String getNombreCiudadOrigen() { return nombreCiudadOrigen; } public void setNombreCiudadOrigen(String nombreCiudadOrigen) { this.nombreCiudadOrigen = nombreCiudadOrigen; } public String getCodigoCiudadDestino() { return codigoCiudadDestino; } public void setCodigoCiudadDestino(String codigoCiudadDestino) { this.codigoCiudadDestino = codigoCiudadDestino; } public String getNombreCiudadDestino() { return nombreCiudadDestino; } public void setNombreCiudadDestino(String nombreCiudadDestino) { this.nombreCiudadDestino = nombreCiudadDestino; } public boolean isSeleccionable() { return seleccionable; } public void setSeleccionable(boolean seleccionable) { this.seleccionable = seleccionable; } @Override public int hashCode() { int hash = 0; hash += (idViajeProyecto != null ? idViajeProyecto.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof ViajesProyectoVersion)) { return false; } ViajesProyectoVersion other = (ViajesProyectoVersion) object; if ((this.idViajeProyecto == null && other.idViajeProyecto != null) || (this.idViajeProyecto != null && !this.idViajeProyecto.equals(other.idViajeProyecto))) { return false; } return true; } @Override public String toString() { return "co.gov.policia.dinae.modelo.ViajesProyecto[ idViajeProyecto=" + idViajeProyecto + " ]"; } @Override public String getLlaveModel() { if (idViajeProyecto == null) { return null; } return idViajeProyecto.toString(); } }
[ "juan.cifuentes.11c@gmail.com" ]
juan.cifuentes.11c@gmail.com
429ea8bd439d0717b2c4422e602d973f03a34b4d
f139ad2948073c6c4858c923d5da3d9fc4f6a3c7
/src/main/java/com/xc/dao/FundsTradingAccountMapper.java
789ecc46f5b831b4e9bb37903bac07b25179340e
[]
no_license
wangwensheng001/st-api-java
875e52d59139755f5e5f7c94c678fd38834450f9
30c118a55f14a74a95bd7f2d17bd807a742f890d
refs/heads/master
2023-03-18T23:29:53.969020
2020-11-26T18:52:08
2020-11-26T18:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,596
java
package com.xc.dao; import com.xc.pojo.FundsTradingAccount; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; import java.util.List; /** * 配资交易账户 * @author lr * @date 2020/07/24 */ @Mapper @Repository public interface FundsTradingAccountMapper { /** * [新增] * @author lr * @date 2020/07/24 **/ int insert(FundsTradingAccount fundsTradingAccount); /** * [刪除] * @author lr * @date 2020/07/24 **/ int delete(int id); /** * [更新] * @author lr * @date 2020/07/24 **/ int update(FundsTradingAccount fundsTradingAccount); /** * [查询] 根据主键 id 查询 * @author lr * @date 2020/07/24 **/ FundsTradingAccount load(int id); /** * [查询] 分页查询 count * @author lr * @date 2020/07/24 **/ int pageListCount(int offset,int pagesize); /** * [查询] 分页查询 * @author lr * @date 2020/07/24 **/ List<FundsTradingAccount> pageList(@Param("pageNum") int pageNum,@Param("pageSize") int pageSize,@Param("keyword") String keyword,@Param("status") Integer status); /** * [查询最新交易账户编号] * @author lr * @date 2020/07/24 **/ int getMaxNumber(); /** * [查询] 根据子账户编号查询详细信息 * @author lr * @date 2020/07/24 **/ FundsTradingAccount getAccountByNumber(@Param("subaccountNumber") Integer subaccountNumber); }
[ "mikhail.an06@yandex.com" ]
mikhail.an06@yandex.com
bc40b5c958ab0bc7fc6a425bec52891bb82c2d39
eb63b69688cd4b6b05a1a26e22ca3af51b2ed427
/latte_ui/src/main/java/example/com/latte_ui/refresh/PagingBean.java
074120ee8f6942c228793a2a9167b0ba6704f9bb
[]
no_license
1223101871/CommerceApp
dce0a2eb77d346f1665fa0edc18a894483253b83
a36e0a5d096541afce5db320f1458cca3a56a85b
refs/heads/master
2020-04-17T13:46:41.452875
2019-04-16T02:19:59
2019-04-16T02:19:59
166,629,952
0
0
null
null
null
null
UTF-8
Java
false
false
1,364
java
package example.com.latte_ui.refresh; /** * created by xcy on 2019/1/25 **/ public final class PagingBean { //当前是第几页 private int mPageIndex = 0; //总共有多少条数据 private int mTotal = 0; //一页显示多少条数据 private int mPageSize = 0; //当前已经显示了多少条数据 private int mCurrentCount = 0; //加载延迟 private int mDelayed = 0; public int getPageIndex() { return mPageIndex; } public PagingBean setPageIndex(int pageIndex) { mPageIndex = pageIndex; return this; } public int getTotal() { return mTotal; } public PagingBean setTotal(int total) { mTotal = total; return this; } public int getPageSize() { return mPageSize; } public PagingBean setPageSize(int pageSize) { mPageSize = pageSize; return this; } public int getCurrentCount() { return mCurrentCount; } public PagingBean setCurrentCount(int currentCount) { mCurrentCount = currentCount; return this; } public int getDelayed() { return mDelayed; } public PagingBean setDelayed(int delayed) { mDelayed = delayed; return this; } PagingBean addIndex(){ mPageIndex++; return this; } }
[ "1223101871@qq.com" ]
1223101871@qq.com
ec35e58c90f631d9601ab75e9aaf0fcb4fcdabb8
5209b1f05940f099eeace164d1c205139245e083
/springboot-juint/src/main/java/com/fd/springboot/entity/Employee.java
b2519683869ae3496b57e8c5e54b0cd1a8a2387d
[]
no_license
Cjuvenile/springboot-demo-f
b3dc97eb60c3e9a533d342174d106048a3bea08d
30eb735099e3c6a8ca2a42756fdb5d54ecddde95
refs/heads/master
2022-04-22T00:59:07.614502
2020-04-23T02:04:32
2020-04-23T02:04:32
258,066,476
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
package com.fd.springboot.entity; public class Employee { private Integer id; private String lastName; private String email; private Integer gender; private Integer age; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Integer getGender() { return gender; } public void setGender(Integer gender) { this.gender = gender; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } @Override public String toString() { return "Employee{" + "id=" + id + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", gender=" + gender + ", age=" + age + '}'; } }
[ "1337428676@qq.com" ]
1337428676@qq.com
3fa71ef2fa98d4df4ea1e060bc9af652e59ff0d2
251b4e03d9511912b80e33fb9a899a5edbbb2506
/src/main/java/com/github/model/Order.java
3c741c0976a93237af4d5d6c9901063444f3c5cd
[]
no_license
zloydadka/Derby
e6e8d53d680d37489f687261b2bfe4c07c839c21
5576ef7925f1d080ee79ecced520552829916b6a
refs/heads/master
2020-04-05T19:22:53.477638
2013-06-27T11:24:15
2013-06-27T11:24:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,314
java
package main.java.com.github.model; import java.util.Date; import com.j256.ormlite.field.DataType; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; @DatabaseTable(tableName = "orders") public class Order extends AbstractModel{ @DatabaseField(columnName="start_date", dataType=DataType.DATE) private Date startDate; @DatabaseField(columnName="end_date", dataType=DataType.DATE) private Date endDate; @DatabaseField(columnName="executer_id", dataType=DataType.INTEGER_OBJ) private Integer executerId; @DatabaseField(columnName="driver_id", dataType=DataType.INTEGER_OBJ) private Integer driverId; @DatabaseField(columnName="client_id", dataType=DataType.INTEGER_OBJ) private Integer clientId; @DatabaseField(columnName="object_id", dataType=DataType.INTEGER_OBJ) private Integer objectId; @DatabaseField(columnName="load", dataType=DataType.STRING) private String load; @DatabaseField(columnName="bill_passed", dataType=DataType.BOOLEAN_OBJ) private Boolean billPassed; @DatabaseField(columnName="waybill_passed", dataType=DataType.BOOLEAN_OBJ) private Boolean waybillPassed; public Integer getExecuter() { return executerId; } public void setExecuter(Integer executerId) { this.executerId = executerId; } public Integer getDriver() { return driverId; } public void setDriver(Integer driverId) { this.driverId = driverId; } public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } public Date getEndDate() { return endDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } public Integer getClient() { return clientId; } public void setClient(Integer clientId) { this.clientId = clientId; } public Integer getObject() { return objectId; } public void setObject(Integer objectId) { this.objectId = objectId; } public String getLoad() { return load; } public void setLoad(String load) { this.load = load; } public Boolean getBillPassed() { return billPassed; } public void setBillPassed(Boolean billPassed) { this.billPassed = billPassed; } public Boolean getWaybillPassed() { return waybillPassed; } public void setWaybillPassed(Boolean waybillPassed) { this.waybillPassed = waybillPassed; } }
[ "foofest@gmail.com" ]
foofest@gmail.com
727156711d7dea8949da46ec32b053dfa38b397d
24d02e5e525b037bd6cfe6efd5a22bd9226ea819
/src/main/java/org/wannagoframework/frontend/config/MyPingUrl.java
928c0277b8f7dd0f7e423050672a6d9b74d8b07b
[]
no_license
wannagodev1/app-frontend-application
c82ba6f69412930541a23a8af12ca3f5682e3349
a83874610f12666dbfe8766c913cb2a6e2b16468
refs/heads/master
2021-09-11T07:33:38.115182
2020-04-22T12:13:16
2020-04-22T12:13:16
237,974,779
0
0
null
null
null
null
UTF-8
Java
false
false
3,937
java
/* * This file is part of the WannaGo distribution (https://github.com/wannago). * Copyright (c) [2019] - [2020]. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.wannagoframework.frontend.config; import com.netflix.appinfo.InstanceInfo; import com.netflix.loadbalancer.IPing; import com.netflix.loadbalancer.Server; import com.netflix.niws.loadbalancer.DiscoveryEnabledServer; import java.io.IOException; import java.util.Map; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; import org.springframework.boot.json.JsonParser; import org.springframework.boot.json.JsonParserFactory; import org.wannagoframework.commons.utils.HasLogger; /** * Ping implementation if you want to do a "health check" kind of Ping. This will be a "real" ping. * As in a real http/s call is made to this url e.g. http://ec2-75-101-231-85.compute-1.amazonaws.com:7101/cs/hostRunning * * Some services/clients choose PingDiscovery - which is quick but is not a real ping. i.e It just * asks discovery (eureka) in-memory cache if the server is present in its Roster PingUrl on the * other hand, makes an actual call. This is more expensive - but its the "standard" way most VIPs * and other services perform HealthChecks. * * Choose your Ping based on your needs. * * @author stonse */ public class MyPingUrl implements IPing, HasLogger { public MyPingUrl() { } public boolean isAlive(Server server) { String loggerPrefix = getLoggerPrefix("isAlive", server.getHost()); boolean isAlive = false; if (server != null && server instanceof DiscoveryEnabledServer) { DiscoveryEnabledServer dServer = (DiscoveryEnabledServer) server; InstanceInfo instanceInfo = dServer.getInstanceInfo(); String appName = instanceInfo.getAppName(); String instanceStatus = instanceInfo.getStatus().toString(); String urlStr = instanceInfo.getHealthCheckUrl(); HttpClient httpClient = new DefaultHttpClient(); HttpUriRequest getRequest = new HttpGet(urlStr); String content = null; try { HttpResponse response = httpClient.execute(getRequest); content = EntityUtils.toString(response.getEntity()); logger().trace(loggerPrefix + "content:" + content); if (response.getStatusLine().getStatusCode() == 200) { JsonParser springParser = JsonParserFactory.getJsonParser(); Map<String, Object> map = springParser.parseMap(content); isAlive = map.get("status").equals("UP"); logger().trace(loggerPrefix + appName + " server OK"); } else { logger().trace(loggerPrefix + appName + " server KO"); } } catch (IOException e) { logger() .error(loggerPrefix + "IO Exception with server '" + appName + "', instance status is '" + instanceStatus + "', url = '" + urlStr + "' : " + e.getLocalizedMessage()); } catch (Exception e) { logger().error(loggerPrefix + "Unknown Exception with server url " + urlStr + " : " + e.getLocalizedMessage(), e); } finally { // Release the connection. getRequest.abort(); } } return isAlive; } }
[ "wannago.dev1@gmail.com" ]
wannago.dev1@gmail.com
7d00fdd4bf9a1c25016dbf8b0fe3219acb06986c
69e3d1a50abff8cca9ac1cd1956c97f1f17c95d0
/src/br/com/caelum/livraria/dao/AutorDao.java
303fdba97228019d66ac077c9af511e50d1080d5
[]
no_license
j19791/livraria_ejb
01425fe9decbcfadd0db9ae03619215aca233a36
ba337a1ecdfa09d0aa12e64308989ade2e0746c7
refs/heads/master
2021-01-24T16:52:58.589635
2018-03-17T03:21:39
2018-03-17T03:21:39
123,218,093
0
0
null
null
null
null
UTF-8
Java
false
false
3,441
java
package br.com.caelum.livraria.dao; import java.util.List; import javax.annotation.PostConstruct; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.ejb.TransactionManagement; import javax.ejb.TransactionManagementType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import br.com.caelum.livraria.modelo.Autor; //Utilizando a arquitetura EJB, as regras de negócio são implementadas em componentes específicos - //Session Beans. O EJB Container administra esses componentes oferecendo diversos recursos. @Stateless // Para transformar a classe AutorDao em um EJB: acesso aos serviços do EJB // Server Container, como transação, persistência com JPA ou tratamento de erro. // Thread safety: Apenas um thread pode usar o nosso Session Bean AutorDao ao // mesmo tempo para melhor o desempenho. // standalone.xml configura a qtd de threads (pool de objetos) q podem limitar o // uso da aplicação @TransactionManagement(TransactionManagementType.CONTAINER) // O JTA é a forma padrão de gerenciar a transação dentro do // servidor JavaEE e funciona sem nenhuma configuração (a // config CONTAINER É OPCIONAL): // CONTAINER MANAGED TRANSACTION (CMT). // @Interceptors({ LogInterceptador.class }) // o EJB Container deve saber que // queremos interceptar as chamadas da classe // comentado o interceptor para utilizar a configuração do xml ejb-jar.xml public class AutorDao { // private Banco banco = new Banco(); // @Inject // Banco é ejb stateless // private Banco banco; @PersistenceContext // EJB Container administrará o JPA - o EJB Container injete o EntityManager - // serve para gerenciar os dados armazenados pelos sistemas. EntityManager manager; @PostConstruct // Callback: Este método não será chamado pela AutorBean. @PostConstruct será // chamado pelo próprio EJB Container. apenas um Session Bean é criada por aba void aposCriacao() { System.out.println("AutorDao foi criado"); } // @TransactionAttribute(TransactionAttributeType.REQUIRED) // opcional - O jta // JÁ CONFIGURA ESSA opção como padrão @TransactionAttribute(TransactionAttributeType.MANDATORY) // o dao nao pode ter controle de transacao - o controle // deverá vir de outros ejb (autorservice) public void salva(Autor autor) { System.out.println("antes de salvar autor:" + autor.getNome()); /* * try { Thread.sleep(20000);// travar a execução da thread atual por 20s } * catch (InterruptedException e) { // TODO Auto-generated catch block * e.printStackTrace(); } */ // banco.save(autor); manager.persist(autor); // substitudo p/ usar o jpa System.out.println("depois de salvar autor: " + autor.getNome()); // throw new RuntimeException("Serviço externo deu erro!"); // exceção foi "embrulhada" em uma outra do tipo // EJBTransactionRollbackException: foi feito um rollback da transação. // unchecked., System Exception, algo grave e imprevisto. } public List<Autor> todosAutores() { // return banco.listaAutores(); return manager.createQuery("select a from Autor a", Autor.class).getResultList(); } public Autor buscaPelaId(Integer autorId) { // Autor autor = this.banco.buscaPelaId(autorId); Autor autor = this.manager.find(Autor.class, autorId); return autor; } }
[ "jeffrm@gmail.com" ]
jeffrm@gmail.com
84fc6b3bcf0ab79ec4cccbb33c64942b168736f9
ba6b95d5d0f7223267c94f252ea0534e1e738121
/src/main/java/plittr/service/PlitterService.java
d0e20f2f035ef98bafbcc114b1cf129a41b9d8d8
[]
no_license
olehmv/SocialClub
1a0073e3320c7054d125d19545449ac34ed4654f
01b5412a6078374d6b2c53e6b44eccd777723379
refs/heads/master
2021-01-19T02:56:44.764438
2017-04-18T07:16:32
2017-04-18T07:16:32
87,300,716
0
0
null
null
null
null
UTF-8
Java
false
false
887
java
package plittr.service; import java.util.List; import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.Cacheable; import plittr.entity.Plitter; @CacheConfig(cacheNames="plitterCache") public interface PlitterService { @Cacheable(value="plitterCache") public List<Plitter>getPlitters(); @Cacheable(value="plitterCache") public Plitter getPlitter(long id); @Cacheable public Plitter savePlitter(String ip,Plitter plitter); public void deletePlitter(Plitter plitter); @CachePut(value="plitterCache",key="#result.id") public Plitter savePlitter(Plitter plitter); public Plitter updatePlitter(Plitter entity); @Cacheable public Plitter findById(Integer id); public boolean isPlitterUsernameUnique(Long id, String username); public Plitter findByUsername(String username); }
[ "oleg@19850405@hotmail.com" ]
oleg@19850405@hotmail.com
dc847a8b0ea212cf300c445df55f970cac958e96
8b46a6fb72860ae77836febaf5c4609cd367fbb6
/src/main/java/com/renjian/blog/dao/BlogRepository.java
26a14aacd5540d596520996bdf6988c0a98560de
[]
no_license
2456259409/java_blog
36eda0d4a29283d5e6a565b189b4f7060ad2a9a9
f85c89193a0e2941bf6552e6c21fc9ece3db7972
refs/heads/master
2021-03-18T00:29:05.447343
2020-03-13T09:37:22
2020-03-13T09:37:22
247,030,588
0
0
null
null
null
null
UTF-8
Java
false
false
1,546
java
package com.renjian.blog.dao; import com.renjian.blog.module.Blog; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.transaction.annotation.Transactional; import java.util.List; public interface BlogRepository extends JpaRepository<Blog,Long> , JpaSpecificationExecutor<Blog> { Blog getById(Long id); @Query("select b from Blog b where b.recommend=true") List<Blog> findTop(Pageable pageable); @Query("select b from Blog b where b.title like ?1 or b.content like ?1") Page<Blog> findByQuery(String query,Pageable pageable); @Modifying @Transactional(rollbackFor = Exception.class) @Query("update Blog b set b.views = b.views+1 where b.id = ?1") void updateViews(Long id); List<Blog> getByTypeId(Long typeId); @Query("select function('date_format',b.updateTime,'%Y') as year from Blog b group by function('date_format',b.updateTime,'%Y') order by year desc ") List<String> findGroupByYear(); @Query("select b from Blog b where function('date_format',b.updateTime,'%Y')=?1") List<Blog> findByYear(String year); @Query("select b from Blog b where b.user.id=?1") Page<Blog> getByUserId(Long id,Pageable pageable); }
[ "2456259409@qq.com" ]
2456259409@qq.com
f9498f87607b01183d8e07ab3757295ddbe2fa20
06eb59d91495a2b9568d21019e4dcb61ff236b7a
/izpack-src/tags/3.10.2/src/lib/com/izforge/izpack/util/SummaryProcessor.java
b86e006873366c2d42dcba471370e9dcdbe6eba6
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jponge/izpack-full-svn-history-copy
8fa773fb3f9f4004e762d29f708273533ba0ff1f
7a521ccd6ce0dd1a0664eaae12fd5bba5571d231
refs/heads/master
2016-09-01T18:24:14.656773
2010-03-01T07:38:22
2010-03-01T07:38:22
551,191
1
1
null
null
null
null
UTF-8
Java
false
false
3,375
java
/* * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved. * * http://izpack.org/ * http://developer.berlios.de/projects/izpack/ * * Copyright 2005 Klaus Bartz * * 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.izforge.izpack.util; import java.util.Iterator; import com.izforge.izpack.installer.AutomatedInstallData; import com.izforge.izpack.installer.IzPanel; /** * A helper class which creates a summary from all panels. This class calls all declared panels for * a summary To differ between caption and message, HTML is used to draw caption in bold and indent * messaged a little bit. * * @author Klaus Bartz * */ public class SummaryProcessor { private static String HTML_HEADER; private static String HTML_FOOTER = "</body>\n</html>\n"; private static String BODY_START = "<div class=\"body\">"; private static String BODY_END = "</div>"; private static String HEAD_START = "<h1>"; private static String HEAD_END = "</h1>\n"; static { // Initialize HTML header and footer. StringBuffer sb = new StringBuffer(256); sb.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n").append( "<html>\n" + "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">" + "<head>\n<STYLE TYPE=\"text/css\" media=screen,print>\n").append( "h1{\n font-size: 100%;\n margin: 1em 0 0 0;\n padding: 0;\n}\n").append( "div.body {\n font-size: 100%;\n margin: 0mm 2mm 0 8mm;\n padding: 0;\n}\n") .append("</STYLE>\n</head>\n<body>\n"); HTML_HEADER = sb.toString(); } /** * Returns a HTML formated string which contains the summary of all panels. To get the summary, * the methods * {@link IzPanel#getSummaryCaption} and {@link IzPanel#getSummaryBody()} of all * panels are called. * * @param idata AutomatedInstallData which contains the panel references * @return a HTML formated string with the summary of all panels */ public static String getSummary(AutomatedInstallData idata) { Iterator iter = idata.panels.iterator(); StringBuffer sb = new StringBuffer(2048); sb.append(HTML_HEADER); while (iter.hasNext()) { IzPanel panel = (IzPanel) iter.next(); String caption = panel.getSummaryCaption(); String msg = panel.getSummaryBody(); // If no caption or/and message, ignore it. if (caption == null || msg == null) { continue; } sb.append(HEAD_START).append(caption).append(HEAD_END); sb.append(BODY_START).append(msg).append(BODY_END); } sb.append(HTML_FOOTER); return (sb.toString()); } }
[ "jponge@7d736ef5-cfd4-0310-9c9a-b52d5c14b761" ]
jponge@7d736ef5-cfd4-0310-9c9a-b52d5c14b761
182420572894abcd4af90625872e99d2eb5922a5
4cd11310e9e94ad153bfdf4efa443002dc8af5f0
/Ejercicio3/src/org/hmis/ejercicio3/Ej3test.java
ae080681dd67082c47dce2b040a96f20cd248729
[]
no_license
dmr372/ejecicio3examen
225fadb1c5f270c39aea195c0e50cd94c78a4173
e68e2bb2abadf2dfbbc78228c66bd5ac16def3e2
refs/heads/master
2022-09-16T22:06:22.444746
2020-06-04T17:41:07
2020-06-04T17:41:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package org.hmis.ejercicio3; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; class Ej3test { @ParameterizedTest @CsvSource({"0", "1", "2", "3", "4", "5", "6", "7", "8"}) void notaTest(int dia) { Ejercicio3 ej = new Ejercicio3(); ej.diaSemana(dia); } }
[ "daniporre@hotmail.es" ]
daniporre@hotmail.es
87a5a8b3a1577dc8b8a16bd998ba1771b26a5753
9e20645e45cc51e94c345108b7b8a2dd5d33193e
/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/pk/RequestExPkPenaltyList.java
a9fb5589d88b6416da63ae78ab79952fc90a3149
[]
no_license
Enryu99/L2jMobius-01-11
2da23f1c04dcf6e88b770f6dcbd25a80d9162461
4683916852a03573b2fe590842f6cac4cc8177b8
refs/heads/master
2023-09-01T22:09:52.702058
2021-11-02T17:37:29
2021-11-02T17:37:29
423,405,362
2
2
null
null
null
null
UTF-8
Java
false
false
1,523
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.l2jmobius.gameserver.network.clientpackets.pk; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.serverpackets.pk.ExPkPenaltyList; /** * @author Mobius */ public class RequestExPkPenaltyList implements IClientIncomingPacket { @Override public boolean read(GameClient client, PacketReader packet) { return true; } @Override public void run(GameClient client) { final PlayerInstance player = client.getPlayer(); if (player == null) { return; } player.sendPacket(new ExPkPenaltyList()); } }
[ "MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b" ]
MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b
ac643dcc6564e1487f7a578a53f71e3667b291d6
d08bc3356dd636858fdb305e4ab8c8a71ab8d9f8
/src/main/java/gasStation/PetrolLoader.java
1773f5e540e1af51627098cdf13d293a5be0e5b5
[]
no_license
VladSquared/IT-Talents_OOP-Task_GasStation
6ff006ef8eefa6ae2f2d85cbe3efa525a8a07d72
d25e758a7f44165247a8d6e2939124991023bdaa
refs/heads/master
2023-03-15T07:50:46.985432
2021-03-13T22:45:52
2021-03-13T22:45:52
347,288,631
0
0
null
null
null
null
UTF-8
Java
false
false
639
java
package gasStation; class PetrolLoader extends Staff implements Runnable{ public PetrolLoader(GasStation gasStation, String name) { super(gasStation, name); } @Override public void run() { while(true){ FuelPump pump = this.gasStation.getCarToRefuel(); try { Thread.sleep(5000); System.out.println("Car " + pump.getFirstCar().getCarId() + " was filled up!"); pump.getFirstCar().notifyToPay(); } catch (InterruptedException e) { e.printStackTrace(); } } } }
[ "vladimirov.vp@gmail.com" ]
vladimirov.vp@gmail.com
f76b735dd0f16e22cd8404087560e078e13fd78b
3d242b5e81e75fb82edb27fecd64f0222f50c3f3
/subprojects/griffon-pivot/src/main/java/org/codehaus/griffon/runtime/pivot/controller/PivotActionFactory.java
e74b5e0fa14119a81cfa2018ebc424b1c44b1004
[ "Apache-2.0" ]
permissive
pgremo/griffon
d7105330ad5c3969bfa56d84d632a9d5bbcb9f59
4c19a3cc2af3dbb8e489e64f82bde99ff7e773e8
refs/heads/master
2022-12-07T02:42:49.102745
2018-11-06T13:12:10
2018-11-06T13:12:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,526
java
/* * SPDX-License-Identifier: Apache-2.0 * * Copyright 2008-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 org.codehaus.griffon.runtime.pivot.controller; import griffon.core.artifact.GriffonController; import griffon.core.controller.Action; import griffon.core.controller.ActionFactory; import griffon.core.controller.ActionManager; import griffon.core.controller.ActionMetadata; import griffon.core.threading.UIThreadManager; import javax.annotation.Nonnull; import javax.inject.Inject; /** * @author Andres Almiray * @since 2.11.0 */ public class PivotActionFactory implements ActionFactory { @Inject private UIThreadManager uiThreadManager; @Inject private ActionManager actionManager; @Nonnull @Override public Action create(@Nonnull GriffonController controller, @Nonnull ActionMetadata actionMetadata) { return new PivotGriffonControllerAction(uiThreadManager, actionManager, controller, actionMetadata); } }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com