blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
066d2c177d271467c1d5da47bc2592716cda738f
44092ff931dfb9bea6d5209de90c9f4ddcbef9e7
/SistVentas/Ventas-EGCC/src/java/pe/egcc/ventasweb/service/mapper/PromocionMapper.java
4ad8306f31a86cdc70cd8c5f7c52b9af0c13958e
[]
no_license
gcoronelc/UCH_ING-SOFT-III_2016-2
ebcf4e41876373318693e7cd0c1821df89226a5e
bd1c02867e94d290599a74f48a9368cd991525b3
refs/heads/master
2020-05-22T01:34:09.215832
2016-11-17T01:37:27
2016-11-17T01:37:27
65,856,185
0
1
null
null
null
null
UTF-8
Java
false
false
946
java
package pe.egcc.ventasweb.service.mapper; import java.sql.ResultSet; import java.sql.SQLException; import pe.egcc.ventasweb.model.Promocion; import pe.egcc.ventasweb.service.espec.RowMapper; /** * * @author Eric Gustavo Coronel Castillo * @blog www.desarrollasoftware.com * @email egcc.usil@gmail.com */ public class PromocionMapper implements RowMapper<Promocion>{ @Override public Promocion mapRow(ResultSet rs) throws SQLException { Promocion bean = new Promocion(); bean.setIdprom(rs.getInt("idprom")); bean.setFecinicio(rs.getDate("fecinicio")); bean.setFecfin(rs.getDate("fecfin")); bean.setIdprod(rs.getInt("idprod")); bean.setNombre(rs.getString("nombre")); bean.setPactual(rs.getDouble("pactual")); bean.setPrecio(rs.getDouble("precio")); bean.setOferta(rs.getDouble("oferta")); bean.setEstado(rs.getInt("estado")); bean.setAnulado(rs.getInt("anulado")); return bean; } }
[ "docente@soporteuch.pe" ]
docente@soporteuch.pe
d7d2744c8bc65f7c21edf998d64cf557f5d36e5b
6a780781492bfe02cbe08a7455e8de83e4998e3d
/src/main/java/com/printmaster/nk/model/entity/MailSendingMessageOption.java
ba5dc4cbef3d01e584c1eb90fd81cb5797de3482
[]
no_license
MykolaKosharnyi/web-printer
992d0ce9d71b6d701ee254a9cd324e27adc0d0cd
2f53f6f99096db504d2fff4a218847bd066dc7a1
refs/heads/master
2023-04-09T04:15:18.452293
2022-08-20T09:28:58
2022-08-20T09:28:58
43,498,058
5
0
null
2023-03-27T22:27:44
2015-10-01T13:31:17
Java
UTF-8
Java
false
false
1,660
java
package com.printmaster.nk.model.entity; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="mail_message_option") public class MailSendingMessageOption implements Serializable{ private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name="id") private int id; @Column(name="showOnMailLetter", columnDefinition = "bit default 1") private boolean showOnMailLetter = true; @Column(name="text", columnDefinition="TEXT") private String text; @Column(name="dateLastChanging") private Date dateLastChanging; @Column(name="optionType") private OptionType optionType; public static enum OptionType{ HEADER, FOOTER } public MailSendingMessageOption(){} public int getId() { return id; } public void setId(int id) { this.id = id; } public String getText() { return text; } public void setText(String text) { this.text = text; } public Date getDateLastChanging() { return dateLastChanging; } public void setDateLastChanging(Date dateLastChanging) { this.dateLastChanging = dateLastChanging; } public OptionType getOptionType() { return optionType; } public void setOptionType(OptionType optionType) { this.optionType = optionType; } public boolean isShowOnMailLetter() { return showOnMailLetter; } public void setShowOnMailLetter(boolean showOnMailLetter) { this.showOnMailLetter = showOnMailLetter; } }
[ "nikolay.kosharniy@gmail.com" ]
nikolay.kosharniy@gmail.com
b3497318e87bacc1a455b3d81738eb6cdaab7534
1acd92a8de398abd96005a1ce7a5b9ed93b8a5cc
/library/src/main/java/com/yanyiyun/function/screenAdaptation/loadviewhelper/LoadViewHelper.java
d92588a445f0155ff12ace8565e218c817f22e5f
[]
no_license
wscoding/BaseUtils
3ddf9a8f8f09a7cc158affa6ea19a4faa1b8a1f0
876450b3bd430e6915132732cde2e09684bbff8f
refs/heads/master
2023-05-10T16:33:14.690981
2020-08-30T18:06:37
2020-08-30T18:06:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,394
java
package com.yanyiyun.function.screenAdaptation.loadviewhelper; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.yanyiyun.function.screenAdaptation.ViewUtils; /** * Created by yatoooon on 2018/2/6. */ public class LoadViewHelper extends AbsLoadViewHelper { public LoadViewHelper(Context context, int designWidth, int designDpi, float fontSize, String unit) { super(context, designWidth, designDpi, fontSize, unit); } @Override public void loadWidthHeightFont(View view) { ViewGroup.LayoutParams layoutParams = view.getLayoutParams(); if (layoutParams.width > 0) { layoutParams.width = setValue(layoutParams.width); } if (layoutParams.height > 0) { layoutParams.height = setValue(layoutParams.height); } loadViewFont(view); } private void loadViewFont(View view) { if ((view instanceof TextView)) { TextView textView = (TextView) view; ((TextView) view).setTextSize(0, setFontSize(textView)); } } private float setFontSize(TextView textView) { return calculateValue(textView.getTextSize() * fontSize); } @Override public void loadPadding(View view) { view.setPadding(setValue(view.getPaddingLeft()), setValue(view.getPaddingTop()), setValue(view.getPaddingRight()), setValue(view.getPaddingBottom())); } @Override public void loadLayoutMargin(View view) { ViewGroup.LayoutParams params = view.getLayoutParams(); ViewGroup.MarginLayoutParams marginLayoutParams; if (params instanceof ViewGroup.MarginLayoutParams) { marginLayoutParams = (ViewGroup.MarginLayoutParams) params; marginLayoutParams.leftMargin = setValue(marginLayoutParams.leftMargin); marginLayoutParams.topMargin = setValue(marginLayoutParams.topMargin); marginLayoutParams.rightMargin = setValue(marginLayoutParams.rightMargin); marginLayoutParams.bottomMargin = setValue(marginLayoutParams.bottomMargin); view.setLayoutParams(marginLayoutParams); } } @Override public void loadMaxWidthAndHeight(View view) { ViewUtils.setMaxWidth(view, setValue(ViewUtils.getMaxWidth(view))); ViewUtils.setMaxHeight(view, setValue(ViewUtils.getMaxHeight(view))); } @Override public void loadMinWidthAndHeight(View view) { ViewUtils.setMinWidth(view, setValue(ViewUtils.getMinWidth(view))); ViewUtils.setMinHeight(view, setValue(ViewUtils.getMinHeight(view))); } @Override public int loadCustomAttrValue(int px) { return setValue(px); } private int setValue(int value) { if (value == 0) { return 0; } else if (value == 1) { return 1; } return (int) calculateValue(value); } @Override public float calculateValue(float value) { if ("px".equals(unit)) { return value * ((float) actualWidth / (float) designWidth); } else if ("dp".equals(unit)) { int dip = (int) (value / actualDensity + 0.5f); value = ((float) designDpi / 160) * dip; return value * ((float) actualWidth / (float) designWidth); } return 0; } }
[ "1206995290@qq.com" ]
1206995290@qq.com
cd9f9379f34cdbffd104f1a47c1013da6b07b8ba
22d970233e64f6a70e55bd859faa40df2167fccf
/org.tb.designpattern.mediator/src/ColleagueA.java
537e082cff786c7a292ddfdadc6de3fab772ec4a
[]
no_license
tb280320889/designpatternstb
4370b70a843be706b77ac9dca475ec5aa4e4093b
04ebee214007263628928c7b2828dc62155d2258
refs/heads/master
2021-03-12T20:09:43.672407
2014-09-29T16:58:51
2014-09-29T16:58:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
/** * IntelliJ IDEA * Created by Administrator * Date : 14-9-9 * Time : 下午12:26 */ public class ColleagueA extends Colleague{ @Override public void action() { System.out.println("Working hard!!!!"); } }
[ "280320889@qq.com" ]
280320889@qq.com
0b74cc3e780e2cc08890f80bc9b9365ba0bc893b
2702455db0688f3d42149fe606a8d96c750c4b72
/basic/concurrence/src/main/java/com/demo/concurrence/test/InterruptStatusClearDemo.java
6077538e36460e846c6e0241c674ddce950986e8
[]
no_license
JiaMingLiu93/homegrown
eefb8bc4dde5459a7eea6105d19fe1d41a34e70b
a5990f2c13d99f37fe256583f760063c935eaca5
refs/heads/master
2023-06-28T08:44:01.199388
2022-07-08T00:04:24
2022-07-08T00:04:24
114,544,065
0
1
null
2023-06-14T22:19:40
2017-12-17T14:44:15
Java
UTF-8
Java
false
false
1,344
java
package com.demo.concurrence.test; import java.util.concurrent.TimeUnit; /** * @author jam * @description * @create 2018-10-10 **/ public class InterruptStatusClearDemo { public static void main(String[] args) { Thread thread = new Thread(() -> { for (;;){ try { TimeUnit.SECONDS.sleep(2); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(Thread.currentThread().isInterrupted()); if (Thread.currentThread().isInterrupted()){ System.out.println("i am interrupted."); try { InterruptStatusClearDemo.class.wait(); } catch (InterruptedException e) { e.printStackTrace(); } continue; } System.out.println("not interrupted."); } }); thread.start(); try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("before thread"+thread.isInterrupted()); thread.interrupt(); System.out.println("after thread"+thread.isInterrupted()); } }
[ "626345665@qq.com" ]
626345665@qq.com
a91f2f6ac3a8115077067f7f6ac1296032d61f90
40ae71e6eec9df2432c81ef7b6d1470f31f1bee9
/slidefinishlayout/src/main/java/com/github/sunrise/slidefinishlayout/SlideFinishManager.java
c8993c0902d8f03aa7e0bc92c3b77f21c6afd5bc
[ "Apache-2.0" ]
permissive
sunrise10/Slidefinish
13fd23a228ab0fbef71487067ab55084463111d6
f218fa3df4a136174c578e6278f3decbb4a34155
refs/heads/master
2021-05-02T01:57:52.997479
2018-02-11T08:28:31
2018-02-11T08:28:31
120,878,326
7
0
null
null
null
null
UTF-8
Java
false
false
2,887
java
package com.github.sunrise.slidefinishlayout; import android.app.Activity; import java.util.Stack; /** * Created by yf on 2017/12/29. * 描述:滑动finish管理 */ public class SlideFinishManager { private SlideFinishLayout mSlideFinishLayout; private static SlideFinishManager mSlideFinishManager; public static Stack<SlideFinishLayout> mSlideFinishLayoutList = new Stack<>(); //阴影方向 public static final int NON = 0; public static final int LEFT = 1; public static final int RIGHT = 2; //滑动效果 public static final int FOLLOW = 1; public static final int SCALE = 2; public static final int ROTATE = 3; private SlideFinishManager() { } public static SlideFinishManager getInstance() { if (mSlideFinishManager == null) { synchronized (SlideFinishManager.class) { if (mSlideFinishManager == null) { mSlideFinishManager = new SlideFinishManager(); } } } return mSlideFinishManager; } /** * 与activity绑定 * * @param activity */ public SlideFinishManager bind(Activity activity) { mSlideFinishLayout = new SlideFinishLayout(activity); mSlideFinishLayout.bind(); mSlideFinishLayoutList.push(mSlideFinishLayout); return this; } /** * 与activity解绑定 */ public void unbind() { mSlideFinishLayout.unBind(); mSlideFinishLayoutList.pop(); } /** * 设置当前activity是否可以滑动退出 * @param enable */ public SlideFinishManager setSlideEnable(boolean enable) { mSlideFinishLayout.setSlideEnable(enable); return this; } /** * 设置滑动的效果 * * @param slideEffectCode 0:无效果 1:微信效果 2:酷狗或今日头条效果 3:酷狗旋转效果 */ public SlideFinishManager setSlideEffect(int slideEffectCode) { mSlideFinishLayout.setSlideEffect(slideEffectCode); return this; } /** * 设置activity的左边缘是否有阴影,增加层次感 * * @param edgeShadow */ public SlideFinishManager setEdgeShadow(boolean edgeShadow) { mSlideFinishLayout.setEdgeShadow(edgeShadow); return this; } /** * 设置activity的左边缘阴影大小 * * @param edgeShadowSize */ public SlideFinishManager setEdgeShadowSize(int edgeShadowSize) { mSlideFinishLayout.setEdgeShadowSize(edgeShadowSize); return this; } /** * 设置阴影的方向 * * @param shadowOrientation 0:无阴影 1:左边 2:右边 */ public SlideFinishManager setShadowOrientation(int shadowOrientation) { mSlideFinishLayout.setShadowOrientation(shadowOrientation); return this; } }
[ "yf@lyf.local" ]
yf@lyf.local
0fd1a6617f4f3f192601e539545b9fcb38ad60e6
cfa11b7288a10dd9bf005637798228943f98059f
/meeting/src/main/java/ro/trc/office/meeting/domain/PersistentAuditEvent.java
a845d0d8efd14de68f504bce4a1266769ba3fbac
[]
no_license
dgks0n/jhipster-kubernetes-istio
aec179640c18c3a4c21e8539999e343c7c94420a
67bd589b42466ee46a0ca787f643045e8d5cfa63
refs/heads/master
2020-12-18T19:49:45.506862
2019-05-14T09:02:14
2019-05-14T09:02:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,389
java
package ro.trc.office.meeting.domain; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Field; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.time.Instant; import java.util.HashMap; import java.util.Objects; import java.util.Map; /** * Persist AuditEvent managed by the Spring Boot actuator. * * @see org.springframework.boot.actuate.audit.AuditEvent */ @Document(collection = "jhi_persistent_audit_event") public class PersistentAuditEvent implements Serializable { private static final long serialVersionUID = 1L; @Id @Field("event_id") private String id; @NotNull private String principal; @Field("event_date") private Instant auditEventDate; @Field("event_type") private String auditEventType; private Map<String, String> data = new HashMap<>(); public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPrincipal() { return principal; } public void setPrincipal(String principal) { this.principal = principal; } public Instant getAuditEventDate() { return auditEventDate; } public void setAuditEventDate(Instant auditEventDate) { this.auditEventDate = auditEventDate; } public String getAuditEventType() { return auditEventType; } public void setAuditEventType(String auditEventType) { this.auditEventType = auditEventType; } public Map<String, String> getData() { return data; } public void setData(Map<String, String> data) { this.data = data; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PersistentAuditEvent)) { return false; } return id != null && id.equals(((PersistentAuditEvent) o).id); } @Override public int hashCode() { return 31; } @Override public String toString() { return "PersistentAuditEvent{" + "principal='" + principal + '\'' + ", auditEventDate=" + auditEventDate + ", auditEventType='" + auditEventType + '\'' + '}'; } }
[ "razvan.simion@trencadis.ro" ]
razvan.simion@trencadis.ro
afb66bce691b9c874b32570f3303c0c9e7ca01ca
17e8438486cb3e3073966ca2c14956d3ba9209ea
/dso/tags/2.3.0/code/base/dso-l2/src/com/tc/l2/handler/L2ObjectSyncHandler.java
e5f0273b2498cf4636ed17de63696efad8ecb6bd
[]
no_license
sirinath/Terracotta
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
00a7662b9cf530dfdb43f2dd821fa559e998c892
refs/heads/master
2021-01-23T05:41:52.414211
2015-07-02T15:21:54
2015-07-02T15:21:54
38,613,711
1
0
null
null
null
null
UTF-8
Java
false
false
5,003
java
/* * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright * notice. All rights reserved. */ package com.tc.l2.handler; import com.tc.async.api.AbstractEventHandler; import com.tc.async.api.ConfigurationContext; import com.tc.async.api.EventContext; import com.tc.async.api.Sink; import com.tc.l2.context.ManagedObjectSyncContext; import com.tc.l2.context.SyncObjectsRequest; import com.tc.l2.msg.ObjectSyncMessage; import com.tc.l2.msg.RelayedCommitTransactionMessage; import com.tc.l2.msg.ServerTxnAckMessage; import com.tc.l2.msg.ServerTxnAckMessageFactory; import com.tc.l2.objectserver.L2ObjectStateManager; import com.tc.l2.objectserver.ServerTransactionFactory; import com.tc.net.groups.NodeID; import com.tc.net.protocol.tcm.ChannelID; import com.tc.objectserver.api.ObjectManager; import com.tc.objectserver.core.api.ServerConfigurationContext; import com.tc.objectserver.tx.ServerTransaction; import com.tc.objectserver.tx.TransactionBatchReader; import com.tc.objectserver.tx.TransactionBatchReaderFactory; import com.tc.objectserver.tx.TransactionalObjectManager; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; public class L2ObjectSyncHandler extends AbstractEventHandler { private final L2ObjectStateManager l2ObjectStateMgr; private ObjectManager objectManager; private TransactionalObjectManager txnObjectMgr; private TransactionBatchReaderFactory batchReaderFactory; private Sink dehydrateSink; private Sink sendSink; public L2ObjectSyncHandler(L2ObjectStateManager l2StateManager) { l2ObjectStateMgr = l2StateManager; } public void handleEvent(EventContext context) { if (context instanceof SyncObjectsRequest) { SyncObjectsRequest request = (SyncObjectsRequest) context; doSyncObjectsRequest(request); } else if (context instanceof ObjectSyncMessage) { ObjectSyncMessage syncMsg = (ObjectSyncMessage) context; doSyncObjectsResponse(syncMsg); } else if (context instanceof RelayedCommitTransactionMessage) { RelayedCommitTransactionMessage commitMessage = (RelayedCommitTransactionMessage) context; Set serverTxnIDs = processCommitTransactionMessage(commitMessage); ackTransactions(commitMessage, serverTxnIDs); } else { throw new AssertionError("Unknown context type : " + context.getClass().getName() + " : " + context); } } //TODO:: Implement throttling between active/passive private void ackTransactions(RelayedCommitTransactionMessage commitMessage, Set serverTxnIDs) { ServerTxnAckMessage msg = ServerTxnAckMessageFactory.createServerTxnAckMessage(commitMessage, serverTxnIDs); sendSink.add(msg); } // TODO::recycle msg after use private Set processCommitTransactionMessage(RelayedCommitTransactionMessage commitMessage) { try { final TransactionBatchReader reader = batchReaderFactory.newTransactionBatchReader(commitMessage); ServerTransaction txn; List txns = new ArrayList(reader.getNumTxns()); Set serverTxnIDs = new HashSet(reader.getNumTxns()); while ((txn = reader.getNextTransaction()) != null) { txns.add(txn); serverTxnIDs.add(txn.getServerTransactionID()); } // TODO:: remove channelID.NULL_ID thingy txnObjectMgr.addTransactions(ChannelID.NULL_ID, txns, Collections.EMPTY_LIST); return serverTxnIDs; } catch (IOException e) { throw new AssertionError(e); } } private void doSyncObjectsResponse(ObjectSyncMessage syncMsg) { ArrayList txns = new ArrayList(1); ServerTransaction txn = ServerTransactionFactory.createTxnFrom(syncMsg); txns.add(txn); // TODO:: remove channelID.NULL_ID thingy txnObjectMgr.addTransactions(ChannelID.NULL_ID, txns, Collections.EMPTY_LIST); } // TODO:: Update stats so that admin console reflects these data private void doSyncObjectsRequest(SyncObjectsRequest request) { NodeID nodeID = request.getNodeID(); ManagedObjectSyncContext lookupContext = l2ObjectStateMgr.getSomeObjectsToSyncContext(nodeID, 500, dehydrateSink); // TODO:: Remove ChannelID from ObjectManager interface if (lookupContext != null) { objectManager.lookupObjectsAndSubObjectsFor(ChannelID.NULL_ID, lookupContext, -1); } } public void initialize(ConfigurationContext context) { super.initialize(context); ServerConfigurationContext oscc = (ServerConfigurationContext) context; this.batchReaderFactory = oscc.getTransactionBatchReaderFactory(); this.objectManager = oscc.getObjectManager(); this.txnObjectMgr = oscc.getTransactionalObjectManager(); this.dehydrateSink = oscc.getStage(ServerConfigurationContext.OBJECTS_SYNC_DEHYDRATE_STAGE).getSink(); this.sendSink = oscc.getStage(ServerConfigurationContext.OBJECTS_SYNC_SEND_STAGE).getSink(); } }
[ "jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864" ]
jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864
5572839de56a95c6697b9f88ac47126c2fe08de6
fd3341a3aff59195f717f575b3582ea6767f3564
/oop/src/ke0212/LinkGameTest.java
f86ba5cd0fd086486795712f9e6f7fad31e5fc42
[]
no_license
PK-git27/C86-Ppk
7963324e807195ad2624b611fe8afd985e232dcd
d8c7c0f1645aa1d40ca5902eddf0dc094f11af03
refs/heads/master
2022-12-12T14:10:45.395010
2020-09-14T12:07:47
2020-09-14T12:07:47
285,532,225
0
0
null
null
null
null
UTF-8
Java
false
false
139
java
package ke0212; public class LinkGameTest { public static void main(String[] args) { LinkGame lg = new LinkGame(); lg.start(); } }
[ "pk@DESKTOP-V98436E" ]
pk@DESKTOP-V98436E
67350bba3b80e9e5316c1a6482c4ea8508011aa0
3d7fc85a8bae34c421e98c9911435300529fbf17
/ClientBackend/src/main/java/com/backend/controller/BookingController.java
6e969a75bfe45de94609a8a77fd5086a2287be91
[]
no_license
trasher1-0/clientSideBackend
095b724b1f12400c24a6cf351e491f97ff745373
45426f8b928a7ac10f5ca312fc3b3c595dd9249d
refs/heads/master
2020-05-17T18:32:16.307692
2019-05-20T05:11:41
2019-05-20T05:11:41
181,232,850
0
0
null
null
null
null
UTF-8
Java
false
false
2,211
java
package com.backend.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.backend.model.Booking; import com.backend.service.BookingService; @CrossOrigin(origins = "*") @RestController @RequestMapping("/api") public class BookingController { @Autowired private BookingService bookingService; /*---Add new booking---*/ @PostMapping("/booking") public ResponseEntity<?> save(@RequestBody Booking booking) { long id = bookingService.save(booking); return ResponseEntity.ok().body("New Booking has been saved with ID:" + id); } /*---Get a booking by id---*/ @GetMapping("/booking/{id}") public ResponseEntity<Booking> get(@PathVariable("id") long id) { Booking booking = bookingService.get(id); return ResponseEntity.ok().body(booking); } /*---get all bookings---*/ @GetMapping("/booking") public ResponseEntity<List<Booking>> list() { List<Booking> bookings = bookingService.list(); return ResponseEntity.ok().body(bookings); } /*---Update a booking by id---*/ @PutMapping("/booking/{id}") public ResponseEntity<?> update(@PathVariable("id") long id, @RequestBody Booking booking) { bookingService.update(id, booking); return ResponseEntity.ok().body("Booking has been updated successfully."); } /*---Delete a booking by id---*/ @DeleteMapping("/booking/{id}") public ResponseEntity<?> delete(@PathVariable("id") long id) { bookingService.delete(id); return ResponseEntity.ok().body("Booking has been deleted successfully."); } }
[ "haseeamarathunga@gmail.com" ]
haseeamarathunga@gmail.com
af7829f2c7bee56d092f2c781b17a73cc3776ad8
ac94ac4e2dca6cbb698043cef6759e328c2fe620
/providers/glesys/src/main/java/org/jclouds/glesys/functions/ParseTemplatesFromHttpResponse.java
60738f3eb1485102d2fc81adf9a5d07b1fd1929a
[ "Apache-2.0" ]
permissive
andreisavu/jclouds
25c528426c8144d330b07f4b646aa3b47d0b3d17
34d9d05eca1ed9ea86a6977c132665d092835364
refs/heads/master
2021-01-21T00:04:41.914525
2012-11-13T18:11:04
2012-11-13T18:11:04
2,503,585
2
0
null
2012-10-16T21:03:12
2011-10-03T09:11:27
Java
UTF-8
Java
false
false
2,209
java
/** * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. jclouds licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.jclouds.glesys.functions; import static com.google.common.base.Preconditions.checkNotNull; import java.util.Map; import java.util.Set; import javax.inject.Singleton; import org.jclouds.glesys.domain.OSTemplate; import org.jclouds.http.HttpResponse; import org.jclouds.http.functions.ParseFirstJsonValueNamed; import org.jclouds.json.internal.GsonWrapper; import com.google.common.base.Function; import com.google.common.collect.FluentIterable; import com.google.common.collect.Iterables; import com.google.inject.Inject; import com.google.inject.TypeLiteral; /** * @author Adrian Cole */ @Singleton public class ParseTemplatesFromHttpResponse implements Function<HttpResponse, FluentIterable<OSTemplate>> { private final ParseFirstJsonValueNamed<Map<String, Set<OSTemplate>>> parser; @Inject public ParseTemplatesFromHttpResponse(GsonWrapper gsonView) { this.parser = new ParseFirstJsonValueNamed<Map<String, Set<OSTemplate>>>(checkNotNull(gsonView, "gsonView"), new TypeLiteral<Map<String, Set<OSTemplate>>>() { }, "templates"); } public FluentIterable<OSTemplate> apply(HttpResponse response) { checkNotNull(response, "response"); Map<String, Set<OSTemplate>> toParse = parser.apply(response); checkNotNull(toParse, "parsed result from %s", response); return FluentIterable.from(Iterables.concat(toParse.values())); } }
[ "adrian@jclouds.org" ]
adrian@jclouds.org
d30bbfc83dd4ea2b431bcc9c96faad2ccb0fa5f7
2bd5ffe6437cc1bdfbbd99564226005bfab548cb
/src/main/java/com/bjpowernode/dao/OrderDao.java
c034615a69c1a316cef8fcd96367ede085d2a340
[]
no_license
Chris-Tao-XY/BookStore
1621c04e8d72d8ac66500183649e32c46944a478
4826082ac703ba8fd462884df19db51629cccba4
refs/heads/master
2023-06-11T18:31:49.726677
2021-07-06T09:18:59
2021-07-06T09:18:59
383,405,919
0
0
null
null
null
null
UTF-8
Java
false
false
572
java
package com.bjpowernode.dao; import com.alibaba.druid.sql.dialect.mysql.visitor.transform.OrderByResolve; import com.bjpowernode.pojo.*; import org.apache.ibatis.annotations.Param; import java.util.List; public interface OrderDao { int createOrder(Order order); int addOrderItem(OrderItem orderItem); int updateStatues(Order order, @Param("newStatus") String newStatus); List<Cart> queryForBookByOrder(Order order); int queryOrderId(); int cancelOrder(Order order); List<Order> queryOrderById(User user); List<Order> queryAllOrder(); }
[ "txy_0620@163.com" ]
txy_0620@163.com
266e6d7c7174709998c65b2c353430391d5a9ac1
2ee938c711000d7c50efc2b3bbdb4c69cc6dcf8d
/src/CtdPoint.java
869943c5a63c99ee7fbff3a85e2c2d8dd0ff64ac
[]
no_license
Harlan-Howe/ConnectTheDots
e37cb4234925595fd919e62ba391eb581afe169e
1483d81d71e80f9bd93551055826d002a751abd2
refs/heads/master
2023-02-14T16:53:53.226813
2021-01-14T16:11:23
2021-01-14T16:11:23
326,347,399
0
0
null
null
null
null
UTF-8
Java
false
false
1,219
java
import java.util.Objects; public class CtdPoint { private int x, y; private double angle; public CtdPoint() { this(0,0,Math.PI/4); } public CtdPoint(int x, int y) { this(x,y,Math.PI/4); } public CtdPoint(int x, int y, double angle) { this.x = x; this.y = y; this.angle = angle; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public double getAngle() { return angle; } public void setAngle(double angle) { this.angle = angle; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CtdPoint ctdPoint = (CtdPoint) o; return x == ctdPoint.x && y == ctdPoint.y; } @Override public String toString() { return "CtdPoint{" + "(" + x + ", " + y + ") @"+String.format("%3.2f",angle)+"radians }"; } }
[ "hhowe7@gatech.edu" ]
hhowe7@gatech.edu
741d7a8a9b233baf6c7096a004299eef45961fcd
bb97667f73a4c43305fe66e78a83abc39dca31eb
/src/test/java/WaitTypes/WaitTypes.java
966db7ef6e8f920602726cca4086e83784a0f5ae
[]
no_license
Partizan19880101/SeleniumLearning
db0c340d1b43250638b971db2987a07f60fe73fe
9ea42f44df969440928837e57c7a838f91879443
refs/heads/master
2021-12-14T22:15:29.393451
2019-11-10T19:44:53
2019-11-10T19:44:53
220,841,322
1
1
null
2021-12-14T21:36:11
2019-11-10T19:43:27
Java
UTF-8
Java
false
false
1,360
java
package WaitTypes; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; public class WaitTypes { WebDriver driver; public WaitTypes(WebDriver driver) { this.driver = driver; } public WebElement waitForElement(By locator, int timeout) { WebElement element = null; try { System.out.println("Waiting for max:: " + timeout + " seconds for element to be available"); WebDriverWait wait = new WebDriverWait(driver, 3); element = wait.until( ExpectedConditions.visibilityOfElementLocated(locator)); System.out.println("Element appeared on the web page"); } catch(Exception e) { System.out.println("Element not appeared on the web page"); } return element; } public void clickWhenReady(By locator, int timeout) { WebElement element = null; try { System.out.println("Waiting for max:: " + timeout + " seconds for element to be clicable"); WebDriverWait wait = new WebDriverWait(driver, 3); element = wait.until( ExpectedConditions.elementToBeClickable(locator)); element.click(); System.out.println("Element click on the web page"); } catch(Exception e) { System.out.println("Element not appeared on the web page"); } } }
[ "zuyonok@mail.ru" ]
zuyonok@mail.ru
dba9e93490a2cfa5a27610466dc0cd9f4b73baab
e610956720bbc257486e12f144ec1a331fea955a
/src/main/java/com/pgyer/simple/pinpoint/trans/filter/DefaultClassFileFilter.java
022fb0d1262f3614aca2b3763e76f6b5a84ffa4e
[]
no_license
huangweii/pgyer
75e55193370b2f442dc7287e2be533eb583f9dc4
5cd6ade418eff9aeefffa895b8b7f09b488577f3
refs/heads/master
2021-07-06T15:21:51.260858
2019-06-19T07:15:58
2019-06-19T07:15:58
192,678,753
0
0
null
2020-10-13T14:00:41
2019-06-19T07:11:22
Java
UTF-8
Java
false
false
1,374
java
package com.pgyer.simple.pinpoint.trans.filter; import java.security.ProtectionDomain; public class DefaultClassFileFilter implements ClassFileFilter { private final ClassLoader agentLoader; public DefaultClassFileFilter(ClassLoader agentLoader) { if (agentLoader == null) { //throw new NullPointerException("agentLoader must not be null"); } this.agentLoader = agentLoader; } @Override public boolean doFilter(ClassLoader classLoader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classFileBuffer) { // if (!className.startsWith("com/first")){ // return SKIP; // } // skip java classes if (className.startsWith("java")||className.startsWith("jdk")||className.startsWith("sun")||className.startsWith("org")||className.startsWith("com/sun") ||className.startsWith("ch")||className.startsWith("com/mchange")||className.startsWith("com/fasterxml")||className.startsWith("com/mysql")) { return SKIP; } if (classLoader == null) { // skip classes loaded by agent class loader. return SKIP; } // Skip pinpoint packages too. if (className.startsWith("com/pgyer/simple/pinpoint/")) { return SKIP; } return CONTINUE; } }
[ "huangwei@pgyer.com" ]
huangwei@pgyer.com
4b902f8949ccbaeb7e60420208389003baef298f
f207855941bcc4e2f89a568ca1404e3f5d7eda90
/QuanLyTienDienNuoc/src/KhachHang.java
d14ed05b2a58b96541df29caa548731733d0bef1
[]
no_license
duongmien/CuoiKyJava_Nhom7_QuanLyTienDienNuoc
3be50ac79d41b9ada6da5606271902d13d178234
68fe217c71b8c806290abbdc2a61e9303f7ac389
refs/heads/master
2023-05-08T03:17:56.093458
2021-06-04T06:23:13
2021-06-04T06:23:13
368,913,507
2
1
null
null
null
null
UTF-8
Java
false
false
30,839
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. */ /** * * @author ADMIN */ import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import static ketnoiSQL.JDBCConnection.getJDBCConnection; import net.proteanit.sql.DbUtils; public class KhachHang extends javax.swing.JFrame { /** * Creates new form KhachHang */ Connection con = getJDBCConnection(); Statement st = null; ResultSet rs = null; public KhachHang() { initComponents(); DisplayNVInTable(); } public void DisplayNVInTable() { try { st = con.createStatement(); rs = st.executeQuery("Select *from KhachHang"); BangNhanVien.setModel(DbUtils.resultSetToTableModel(rs)); } catch (Exception e) { e.printStackTrace(); } } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel2 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); makh = new javax.swing.JTextField(); tenkh = new javax.swing.JTextField(); gt = new javax.swing.JComboBox<>(); Edit = new javax.swing.JButton(); Delete = new javax.swing.JButton(); Clear = new javax.swing.JButton(); AddBt = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); BangNhanVien = new javax.swing.JTable(); jLabel10 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); ngaysinh = new javax.swing.JTextField(); jLabel11 = new javax.swing.JLabel(); sdt = new javax.swing.JTextField(); dc = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); phuong = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); quan = new javax.swing.JComboBox<>(); jLabel1 = new javax.swing.JLabel(); back2 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setUndecorated(true); jPanel2.setBackground(new java.awt.Color(255, 102, 51)); jPanel4.setBackground(new java.awt.Color(255, 255, 255)); jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel3.setBackground(new java.awt.Color(255, 102, 102)); jLabel3.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 102, 51)); jLabel3.setText("QUẢN LÝ KHÁCH HÀNG"); jLabel4.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel4.setForeground(new java.awt.Color(255, 102, 51)); jLabel4.setText("Mã khách hàng:"); jLabel5.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel5.setForeground(new java.awt.Color(255, 102, 51)); jLabel5.setText("Tên khách hàng:"); jLabel6.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel6.setForeground(new java.awt.Color(255, 102, 51)); jLabel6.setText("Giới tính:"); makh.setEnabled(false); gt.setForeground(new java.awt.Color(255, 102, 51)); gt.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Nam", "Nữ", " " })); Edit.setBackground(new java.awt.Color(255, 102, 0)); Edit.setText("Sửa"); Edit.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { EditMouseClicked(evt); } }); Delete.setBackground(new java.awt.Color(255, 102, 0)); Delete.setText("Xóa"); Delete.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { DeleteMouseClicked(evt); } }); Clear.setBackground(new java.awt.Color(255, 102, 0)); Clear.setText("Làm mới"); Clear.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { ClearMouseClicked(evt); } }); AddBt.setBackground(new java.awt.Color(255, 102, 0)); AddBt.setText("Thêm"); AddBt.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { AddBtMouseClicked(evt); } }); BangNhanVien.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null} }, new String [] { "MÃ NHÂN VIÊN", "TÊN NHÂN VIÊN", "GIỚI TÍNH", "MẬT KHẨU" } )); BangNhanVien.setIntercellSpacing(new java.awt.Dimension(0, 0)); BangNhanVien.setRowHeight(25); BangNhanVien.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { BangNhanVienMouseClicked(evt); } }); jScrollPane1.setViewportView(BangNhanVien); jLabel10.setBackground(new java.awt.Color(255, 102, 102)); jLabel10.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N jLabel10.setForeground(new java.awt.Color(255, 102, 51)); jLabel10.setText("DANH SÁCH KHÁCH HÀNG"); jLabel7.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel7.setForeground(new java.awt.Color(255, 102, 51)); jLabel7.setText("Ngày sinh:"); ngaysinh.setText("dd/MM/yyyy"); jLabel11.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel11.setForeground(new java.awt.Color(255, 102, 51)); jLabel11.setText("Số điện thoại:"); jLabel14.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel14.setForeground(new java.awt.Color(255, 102, 51)); jLabel14.setText("Địa chỉ:"); jLabel12.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel12.setForeground(new java.awt.Color(255, 102, 51)); jLabel12.setText("Tên phường:"); jLabel13.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel13.setForeground(new java.awt.Color(255, 102, 51)); jLabel13.setText("Tên quận:"); quan.setForeground(new java.awt.Color(255, 102, 51)); quan.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Sơn Trà", "Hải Châu", "Ngũ Hành Sơn", "Liên Chiểu", "Thanh Khê" })); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(22, 22, 22) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(makh, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(83, 83, 83) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tenkh, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(53, 53, 53) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(sdt, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(phuong, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ngaysinh, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 53, Short.MAX_VALUE) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(gt, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(56, 56, 56)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(651, 651, 651) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(quan, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(56, 56, 56)) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(45, 45, 45) .addComponent(dc, javax.swing.GroupLayout.PREFERRED_SIZE, 905, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 301, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(347, 347, 347)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 981, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(44, 44, 44)))))) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(256, 256, 256) .addComponent(AddBt, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(85, 85, 85) .addComponent(Edit, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(73, 73, 73) .addComponent(Delete, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(102, 102, 102) .addComponent(Clear, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(384, 384, 384) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel3) .addGap(24, 24, 24) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tenkh, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(makh, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ngaysinh, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(gt, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(29, 29, 29) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(phuong, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(sdt, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(dc, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(quan, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Clear, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Delete, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Edit, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(AddBt, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(jLabel10) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(50, Short.MAX_VALUE)) ); back2.setBackground(new java.awt.Color(255, 255, 255)); back2.setText("Trở lại"); back2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { back2MouseClicked(evt); } }); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imgs_QLTD/customer.png"))); // NOI18N jLabel2.setText("jLabel2"); jButton3.setBackground(new java.awt.Color(255, 255, 255)); jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imgs_QLTD/x.png"))); // NOI18N jButton3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton3MouseClicked(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(41, 41, 41) .addComponent(back2) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(38, 38, 38))) .addGap(25, 25, 25)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1)) .addComponent(jButton3)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(back2, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(72, 72, 72)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void EditMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_EditMouseClicked if (tenkh.getText().isEmpty() || phuong.getText().isEmpty() || ngaysinh.getText().isEmpty() || dc.getText().isEmpty()) { JOptionPane.showMessageDialog(this, "Thieu thong tin"); } else { try { String sql = "Update KhachHang set TenKH=N'" + tenkh.getText() + "'" + ",TenPhuong=N'" + phuong.getText() + "'" + ",GioiTinh=N'" + gt.getSelectedItem().toString() + "'" + ",TenQuan=N'" + quan.getSelectedItem().toString() + "'" + ",ngaysinh=N'" + ngaysinh.getText() + "'" + ",sdt=N'" + sdt.getText() + "'" + "where MaKH=" + makh.getText(); Statement Add = con.createStatement(); Add.executeUpdate(sql); DisplayNVInTable(); JOptionPane.showMessageDialog(this, "Sửa Thành Công Khách Hàng"); } catch (SQLException e) { e.printStackTrace(); } } }//GEN-LAST:event_EditMouseClicked private void DeleteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DeleteMouseClicked // TODO add your handling code here: if (makh.getText().isEmpty()) { JOptionPane.showMessageDialog(this, "Vui lòng nhập mã khách hàng để xóa"); } else { try { String id = makh.getText(); String sql = "Delete from KhachHang where MaKH=" + id; Statement Add = con.createStatement(); Add.executeUpdate(sql); JOptionPane.showMessageDialog(this, "Xóa Thành Công"); DisplayNVInTable(); } catch (Exception e) { e.printStackTrace(); } } }//GEN-LAST:event_DeleteMouseClicked private void ClearMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ClearMouseClicked // TODO add your handling code here: tenkh.setText(""); makh.setText(""); phuong.setText(""); ngaysinh.setText(""); dc.setText(""); sdt.setText(""); }//GEN-LAST:event_ClearMouseClicked private void AddBtMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AddBtMouseClicked // TODO add your handling code here: if (tenkh.getText().isEmpty() || phuong.getText().isEmpty() || ngaysinh.getText().isEmpty() || dc.getText().isEmpty()) { JOptionPane.showMessageDialog(this, "Không được để trống! Mời bạn nhập lại!"); } else { try { PreparedStatement add = con.prepareStatement("Set dateformat dmy insert into KhachHang values (?,?,?,?,?,?,?)"); add.setString(1, tenkh.getText()); add.setString(2, ngaysinh.getText()); add.setString(3, gt.getSelectedItem().toString()); add.setString(4, sdt.getText()); add.setString(5, dc.getText()); add.setString(6, phuong.getText()); add.setString(7, quan.getSelectedItem().toString()); int row = add.executeUpdate(); JOptionPane.showMessageDialog(this, "Thêm nhân viên thành công!"); DisplayNVInTable(); } catch (Exception e) { e.printStackTrace(); } } }//GEN-LAST:event_AddBtMouseClicked private void BangNhanVienMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BangNhanVienMouseClicked DefaultTableModel model = (DefaultTableModel) BangNhanVien.getModel(); int Myindex = BangNhanVien.getSelectedRow(); makh.setText(model.getValueAt(Myindex, 0).toString()); tenkh.setText(model.getValueAt(Myindex, 1).toString()); ngaysinh.setText(model.getValueAt(Myindex, 2).toString()); sdt.setText(model.getValueAt(Myindex, 4).toString()); dc.setText(model.getValueAt(Myindex, 5).toString()); phuong.setText(model.getValueAt(Myindex, 6).toString()); }//GEN-LAST:event_BangNhanVienMouseClicked private void back2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_back2MouseClicked // TODO add your handling code here: new TrangChuNhanVien().setVisible(true); this.dispose(); }//GEN-LAST:event_back2MouseClicked private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked // TODO add your handling code here: this.dispose(); }//GEN-LAST:event_jButton3MouseClicked /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(KhachHang.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(KhachHang.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(KhachHang.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(KhachHang.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new KhachHang().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton AddBt; private javax.swing.JTable BangNhanVien; private javax.swing.JButton Clear; private javax.swing.JButton Delete; private javax.swing.JButton Edit; private javax.swing.JButton back2; private javax.swing.JTextField dc; private javax.swing.JComboBox<String> gt; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel4; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextField makh; private javax.swing.JTextField ngaysinh; private javax.swing.JTextField phuong; private javax.swing.JComboBox<String> quan; private javax.swing.JTextField sdt; private javax.swing.JTextField tenkh; // End of variables declaration//GEN-END:variables }
[ "duongthimien7@gmail.com" ]
duongthimien7@gmail.com
412b32719538d4f059aeb2b83f1b42ac5f1cb760
8a5c2fe943aaa87ca3bc03e039362a9525df9597
/src/main/java/com/matey/bootwebservice/config/oauth/SecurityConfig.java
8315f8afc471456f0ee71b2d884fcde150244083
[]
no_license
darkhorizon12/springboot-webservice
37ba4a5036cd93bb63932bd2bf16d2efbf71b2d4
c6a8a858fc3511e12517241c9714beee3656284e
refs/heads/master
2020-12-02T12:48:43.240302
2020-01-09T05:35:57
2020-01-09T05:35:57
231,010,996
0
0
null
null
null
null
UTF-8
Java
false
false
1,773
java
package com.matey.bootwebservice.config.oauth; import com.matey.bootwebservice.domain.user.Role; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @EnableWebSecurity // 스프링 시큐리티 설정정보 활성화 public class SecurityConfig extends WebSecurityConfigurerAdapter { private final CustomOAuth2UserService customOAuth2UserService; public SecurityConfig(CustomOAuth2UserService customOAuth2UserService) { this.customOAuth2UserService = customOAuth2UserService; } @Override protected void configure(HttpSecurity http) throws Exception { http .csrf().disable() .headers().frameOptions().disable() // h2-console 사용하기 위해 해당 옵션 비활성화 .and() .authorizeRequests() // url별 권한 관리 설정 옵션의 진입점 .antMatchers("/", "/css/**", "/images/**", "/js/**", "/h2-console/**", "/profile").permitAll() .antMatchers("/api/v1/**").hasRole(Role.USER.name()) // USER 권한을 가진 사용자에게만 허용 .anyRequest().authenticated() // 그외는 인증된 사용자(로그인한)에게만 허용 .and() .logout() .logoutSuccessUrl("/") .and() .oauth2Login() .userInfoEndpoint() // 로그인 성공이후 사용자 정보를 가져올 설정 담당 .userService(customOAuth2UserService); // UserService 인터페이스 구현체 등록. } }
[ "kimjuon12@gmail.com" ]
kimjuon12@gmail.com
632e0e9a3c4c8fca672690f307489aaeaf81cf41
95a2919168d94bbe8a104bb74ac53b8fe5bc74c1
/org.xtext.example.mydsl1.ui/src/org/xtext/example/mydsl1/ui/outline/MyDslOutlineTreeProvider.java
0831e5a13bd8f3e198659077e24d9fbcab1ae6f3
[]
no_license
TAndrian/xtext-dsl-compiler-example
168a3ad72c1808e8652ba10a6bd01c0e296391ef
5e3264d1d878a1193161e85e7dd674c18d8f04d1
refs/heads/main
2023-01-06T10:55:54.663023
2020-11-03T14:53:26
2020-11-03T14:53:26
437,822,457
1
0
null
2021-12-13T10:05:46
2021-12-13T10:05:46
null
UTF-8
Java
false
false
383
java
/* * generated by Xtext 2.21.0 */ package org.xtext.example.mydsl1.ui.outline; import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider; /** * Customization of the default outline structure. * * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline */ public class MyDslOutlineTreeProvider extends DefaultOutlineTreeProvider { }
[ "mathieu.acher@irisa.fr" ]
mathieu.acher@irisa.fr
6559cd248605c7720d06f140c9c4fe0d3797ca86
c885ef92397be9d54b87741f01557f61d3f794f3
/results/JacksonDatabind-109/com.fasterxml.jackson.databind.ser.std.NumberSerializers/BBC-F0-opt-80/tests/1/com/fasterxml/jackson/databind/ser/std/NumberSerializers_ESTest_scaffolding.java
6a081f4b0b561853c78e2098a8587fd6ed3fe8fd
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
59,821
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Oct 13 19:52:49 GMT 2021 */ package com.fasterxml.jackson.databind.ser.std; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class NumberSerializers_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "com.fasterxml.jackson.databind.ser.std.NumberSerializers"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("java.io.tmpdir", "/tmp"); java.lang.System.setProperty("user.dir", "/experiment"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(NumberSerializers_ESTest_scaffolding.class.getClassLoader() , "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonBooleanFormatVisitor", "com.fasterxml.jackson.databind.MappingIterator", "com.fasterxml.jackson.core.JsonFactoryBuilder", "com.fasterxml.jackson.databind.deser.BeanDeserializerModifier", "com.fasterxml.jackson.databind.deser.impl.FieldProperty", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$ShortSerializer", "com.fasterxml.jackson.annotation.ObjectIdGenerators$Base", "com.fasterxml.jackson.annotation.JsonFormat$Features", "com.fasterxml.jackson.databind.deser.std.EnumDeserializer", "com.fasterxml.jackson.databind.introspect.AnnotatedConstructor", "com.fasterxml.jackson.databind.cfg.MapperConfigBase", "com.fasterxml.jackson.databind.deser.UnresolvedForwardReference", "com.fasterxml.jackson.databind.ser.impl.UnknownSerializer", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWithSerializerProvider", "com.fasterxml.jackson.databind.deser.std.StdKeyDeserializers", "com.fasterxml.jackson.core.async.ByteArrayFeeder", "com.fasterxml.jackson.databind.type.MapLikeType", "com.fasterxml.jackson.databind.type.MapType", "com.fasterxml.jackson.databind.annotation.JsonTypeResolver", "com.fasterxml.jackson.databind.ser.std.UUIDSerializer", "com.fasterxml.jackson.databind.ObjectWriter", "com.fasterxml.jackson.databind.type.TypeBase", "com.fasterxml.jackson.core.util.BufferRecyclers", "com.fasterxml.jackson.databind.node.TextNode", "com.fasterxml.jackson.core.util.Instantiatable", "com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase", "com.fasterxml.jackson.core.json.UTF8DataInputJsonParser", "com.fasterxml.jackson.annotation.Nulls", "com.fasterxml.jackson.core.util.DefaultPrettyPrinter$Indenter", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonAnyFormatVisitor", "com.fasterxml.jackson.annotation.JsonSetter$Value", "com.fasterxml.jackson.databind.node.DecimalNode", "com.fasterxml.jackson.databind.introspect.AnnotationCollector$EmptyCollector", "com.fasterxml.jackson.databind.util.Annotations", "com.fasterxml.jackson.databind.deser.Deserializers", "com.fasterxml.jackson.databind.ser.std.CollectionSerializer", "com.fasterxml.jackson.databind.deser.KeyDeserializers", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable", "com.fasterxml.jackson.databind.introspect.VisibilityChecker$Std", "com.fasterxml.jackson.databind.type.CollectionLikeType", "com.fasterxml.jackson.core.FormatFeature", "com.fasterxml.jackson.core.TreeNode", "com.fasterxml.jackson.databind.node.NumericNode", "com.fasterxml.jackson.annotation.ObjectIdGenerators$StringIdGenerator", "com.fasterxml.jackson.databind.deser.ValueInstantiator", "com.fasterxml.jackson.databind.ser.std.StaticListSerializerBase", "com.fasterxml.jackson.databind.type.ResolvedRecursiveType", "com.fasterxml.jackson.databind.introspect.AnnotatedClass$Creators", "com.fasterxml.jackson.databind.ext.CoreXMLSerializers", "com.fasterxml.jackson.databind.introspect.BasicClassIntrospector", "com.fasterxml.jackson.core.base.ParserMinimalBase", "com.fasterxml.jackson.databind.deser.std.MapEntryDeserializer", "com.fasterxml.jackson.databind.deser.BeanDeserializerBase", "com.fasterxml.jackson.databind.ObjectMapper$DefaultTyping", "com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition", "com.fasterxml.jackson.databind.util.Converter", "com.fasterxml.jackson.databind.ser.std.FileSerializer", "com.fasterxml.jackson.core.SerializableString", "com.fasterxml.jackson.databind.deser.ValueInstantiators", "com.fasterxml.jackson.core.Versioned", "com.fasterxml.jackson.databind.introspect.VirtualAnnotatedMember", "com.fasterxml.jackson.databind.introspect.BasicBeanDescription", "com.fasterxml.jackson.databind.deser.std.EnumSetDeserializer", "com.fasterxml.jackson.databind.introspect.AnnotatedMember", "com.fasterxml.jackson.databind.JsonSerializable", "com.fasterxml.jackson.databind.BeanDescription", "com.fasterxml.jackson.databind.deser.impl.TypeWrappedDeserializer", "com.fasterxml.jackson.core.filter.JsonPointerBasedFilter", "com.fasterxml.jackson.databind.introspect.AnnotatedWithParams", "com.fasterxml.jackson.core.Base64Variant", "com.fasterxml.jackson.databind.ser.SerializerFactory", "com.fasterxml.jackson.databind.ext.CoreXMLSerializers$XMLGregorianCalendarSerializer", "com.fasterxml.jackson.databind.type.SimpleType", "com.fasterxml.jackson.databind.ser.ContextualSerializer", "com.fasterxml.jackson.databind.DeserializationConfig", "com.fasterxml.jackson.databind.MapperFeature", "com.fasterxml.jackson.core.TSFBuilder", "com.fasterxml.jackson.databind.ser.std.ClassSerializer", "com.fasterxml.jackson.databind.Module$SetupContext", "com.fasterxml.jackson.databind.ext.Java7SupportImpl", "com.fasterxml.jackson.databind.util.ClassUtil", "com.fasterxml.jackson.databind.node.ContainerNode", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$LongSerializer", "com.fasterxml.jackson.databind.deser.BeanDeserializerFactory", "com.fasterxml.jackson.databind.ser.std.StdSerializer", "com.fasterxml.jackson.databind.ser.BeanSerializerFactory", "com.fasterxml.jackson.databind.PropertyNamingStrategy", "com.fasterxml.jackson.databind.jsonschema.SchemaAware", "com.fasterxml.jackson.databind.AbstractTypeResolver", "com.fasterxml.jackson.databind.introspect.AnnotatedClassResolver", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$DoubleSerializer", "com.fasterxml.jackson.databind.BeanProperty$Bogus", "com.fasterxml.jackson.databind.ser.std.ByteBufferSerializer", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonMapFormatVisitor", "com.fasterxml.jackson.databind.node.InternalNodeMapper", "com.fasterxml.jackson.core.Base64Variants", "com.fasterxml.jackson.databind.deser.std.StdDelegatingDeserializer", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor", "com.fasterxml.jackson.databind.deser.std.ArrayBlockingQueueDeserializer", "com.fasterxml.jackson.databind.ser.std.IterableSerializer", "com.fasterxml.jackson.databind.ser.std.StdJdkSerializers$AtomicIntegerSerializer", "com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter", "com.fasterxml.jackson.core.io.IOContext", "com.fasterxml.jackson.core.PrettyPrinter", "com.fasterxml.jackson.databind.util.RawValue", "com.fasterxml.jackson.core.base.GeneratorBase", "com.fasterxml.jackson.databind.exc.PropertyBindingException", "com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector", "com.fasterxml.jackson.databind.ser.BeanSerializer", "com.fasterxml.jackson.databind.ser.DefaultSerializerProvider", "com.fasterxml.jackson.databind.node.NullNode", "com.fasterxml.jackson.databind.deser.ValueInstantiator$Base", "com.fasterxml.jackson.core.util.Separators", "com.fasterxml.jackson.databind.ser.BeanSerializerModifier", "com.fasterxml.jackson.databind.jsontype.NamedType", "com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder", "com.fasterxml.jackson.databind.introspect.ObjectIdInfo", "com.fasterxml.jackson.core.json.JsonWriteContext", "com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector", "com.fasterxml.jackson.databind.ser.impl.MapEntrySerializer", "com.fasterxml.jackson.annotation.ObjectIdGenerators$PropertyGenerator", "com.fasterxml.jackson.core.io.UTF8Writer", "com.fasterxml.jackson.databind.BeanProperty", "com.fasterxml.jackson.core.Version", "com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector", "com.fasterxml.jackson.databind.ser.std.StdDelegatingSerializer", "com.fasterxml.jackson.core.io.InputDecorator", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat", "com.fasterxml.jackson.databind.introspect.TypeResolutionContext", "com.fasterxml.jackson.core.base.ParserBase", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$IntLikeSerializer", "com.fasterxml.jackson.databind.node.BinaryNode", "com.fasterxml.jackson.databind.ser.std.ToStringSerializer", "com.fasterxml.jackson.databind.deser.DataFormatReaders", "com.fasterxml.jackson.core.JsonGenerator", "com.fasterxml.jackson.databind.deser.DefaultDeserializationContext", "com.fasterxml.jackson.databind.ser.Serializers", "com.fasterxml.jackson.databind.type.ClassStack", "com.fasterxml.jackson.core.JsonEncoding", "com.fasterxml.jackson.databind.ObjectWriter$Prefetch", "com.fasterxml.jackson.core.JsonGenerationException", "com.fasterxml.jackson.databind.ser.std.JsonValueSerializer", "com.fasterxml.jackson.core.TreeCodec", "com.fasterxml.jackson.annotation.JsonAutoDetect$Value", "com.fasterxml.jackson.databind.deser.impl.SetterlessProperty", "com.fasterxml.jackson.core.json.UTF8JsonGenerator", "com.fasterxml.jackson.databind.ser.std.EnumSetSerializer", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonIntegerFormatVisitor", "com.fasterxml.jackson.databind.ser.std.SerializableSerializer", "com.fasterxml.jackson.databind.introspect.Annotated", "com.fasterxml.jackson.core.type.WritableTypeId", "com.fasterxml.jackson.databind.deser.std.StdKeyDeserializer$DelegatingKD", "com.fasterxml.jackson.databind.ser.impl.ReadOnlyClassToSerializerMap", "com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase", "com.fasterxml.jackson.databind.util.TokenBuffer", "com.fasterxml.jackson.core.JsonParser$NumberType", "com.fasterxml.jackson.core.util.DefaultPrettyPrinter$NopIndenter", "com.fasterxml.jackson.databind.type.PlaceholderForType", "com.fasterxml.jackson.core.json.WriterBasedJsonGenerator", "com.fasterxml.jackson.databind.node.LongNode", "com.fasterxml.jackson.databind.deser.CreatorProperty", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonStringFormatVisitor", "com.fasterxml.jackson.databind.deser.std.StdKeyDeserializer$StringCtorKeyDeserializer", "com.fasterxml.jackson.core.io.NumberOutput", "com.fasterxml.jackson.databind.ObjectWriter$GeneratorSettings", "com.fasterxml.jackson.core.type.TypeReference", "com.fasterxml.jackson.core.JsonParseException", "com.fasterxml.jackson.databind.annotation.JacksonStdImpl", "com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase", "com.fasterxml.jackson.databind.ser.std.TokenBufferSerializer", "com.fasterxml.jackson.databind.exc.ValueInstantiationException", "com.fasterxml.jackson.databind.type.TypeBindings$TypeParamStash", "com.fasterxml.jackson.annotation.JsonBackReference", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonArrayFormatVisitor", "com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig", "com.fasterxml.jackson.databind.ser.std.MapSerializer", "com.fasterxml.jackson.databind.ser.std.SqlDateSerializer", "com.fasterxml.jackson.databind.util.RootNameLookup", "com.fasterxml.jackson.databind.introspect.AnnotatedClass", "com.fasterxml.jackson.databind.ser.impl.ReadOnlyClassToSerializerMap$Bucket", "com.fasterxml.jackson.databind.deser.std.AtomicReferenceDeserializer", "com.fasterxml.jackson.databind.ser.impl.FailingSerializer", "com.fasterxml.jackson.databind.JsonMappingException", "com.fasterxml.jackson.core.io.OutputDecorator", "com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer", "com.fasterxml.jackson.databind.ser.impl.TypeWrappedSerializer", "com.fasterxml.jackson.annotation.JsonTypeInfo$As", "com.fasterxml.jackson.databind.ser.std.SqlTimeSerializer", "com.fasterxml.jackson.databind.DatabindContext", "com.fasterxml.jackson.databind.node.ObjectNode", "com.fasterxml.jackson.databind.cfg.ConfigOverride", "com.fasterxml.jackson.core.JsonParser$Feature", "com.fasterxml.jackson.core.JsonPointer", "com.fasterxml.jackson.annotation.JsonMerge", "com.fasterxml.jackson.core.io.SerializedString", "com.fasterxml.jackson.core.util.DefaultPrettyPrinter$FixedSpaceIndenter", "com.fasterxml.jackson.databind.deser.DeserializationProblemHandler", "com.fasterxml.jackson.annotation.JsonFormat$Shape", "com.fasterxml.jackson.databind.introspect.AnnotationCollector", "com.fasterxml.jackson.annotation.PropertyAccessor", "com.fasterxml.jackson.databind.introspect.AnnotatedField", "com.fasterxml.jackson.annotation.JsonFormat$Feature", "com.fasterxml.jackson.databind.deser.std.ContainerDeserializerBase", "com.fasterxml.jackson.databind.deser.ContextualDeserializer", "com.fasterxml.jackson.databind.ser.std.ArraySerializerBase", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes", "com.fasterxml.jackson.databind.cfg.HandlerInstantiator", "com.fasterxml.jackson.annotation.ObjectIdGenerator", "com.fasterxml.jackson.databind.ser.std.CalendarSerializer", "com.fasterxml.jackson.databind.ext.Java7Support", "com.fasterxml.jackson.databind.ser.std.BooleanSerializer$AsNumber", "com.fasterxml.jackson.databind.exc.InvalidDefinitionException", "com.fasterxml.jackson.databind.ser.std.BooleanSerializer", "com.fasterxml.jackson.databind.introspect.ClassIntrospector", "com.fasterxml.jackson.databind.JsonSerializable$Base", "com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer", "com.fasterxml.jackson.databind.cfg.ConfigOverride$Empty", "com.fasterxml.jackson.databind.node.TreeTraversingParser", "com.fasterxml.jackson.databind.deser.std.CollectionDeserializer", "com.fasterxml.jackson.databind.jsontype.TypeSerializer", "com.fasterxml.jackson.databind.jsonschema.JsonSchema", "com.fasterxml.jackson.core.json.JsonReadFeature", "com.fasterxml.jackson.databind.type.TypeFactory", "com.fasterxml.jackson.databind.type.ArrayType", "com.fasterxml.jackson.databind.util.Named", "com.fasterxml.jackson.core.util.JsonParserDelegate", "com.fasterxml.jackson.databind.cfg.ConfigOverrides", "com.fasterxml.jackson.databind.ser.std.StdScalarSerializer", "com.fasterxml.jackson.databind.type.CollectionType", "com.fasterxml.jackson.databind.deser.std.StringCollectionDeserializer", "com.fasterxml.jackson.core.StreamWriteFeature", "com.fasterxml.jackson.annotation.JsonAutoDetect", "com.fasterxml.jackson.core.StreamReadFeature", "com.fasterxml.jackson.core.format.InputAccessor", "com.fasterxml.jackson.databind.node.ValueNode", "com.fasterxml.jackson.databind.ser.impl.IteratorSerializer", "com.fasterxml.jackson.databind.ser.BasicSerializerFactory", "com.fasterxml.jackson.databind.deser.std.EnumMapDeserializer", "com.fasterxml.jackson.databind.util.ClassUtil$Ctor", "com.fasterxml.jackson.databind.ext.NioPathDeserializer", "com.fasterxml.jackson.databind.node.JsonNodeCreator", "com.fasterxml.jackson.databind.deser.SettableBeanProperty", "com.fasterxml.jackson.core.async.NonBlockingInputFeeder", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper", "com.fasterxml.jackson.core.json.ReaderBasedJsonParser", "com.fasterxml.jackson.databind.exc.MismatchedInputException", "com.fasterxml.jackson.databind.node.IntNode", "com.fasterxml.jackson.databind.node.FloatNode", "com.fasterxml.jackson.databind.type.TypeParser", "com.fasterxml.jackson.databind.jsontype.SubtypeResolver", "com.fasterxml.jackson.core.ObjectCodec", "com.fasterxml.jackson.databind.ser.std.EnumSerializer", "com.fasterxml.jackson.databind.cfg.ContextAttributes$Impl", "com.fasterxml.jackson.core.util.DefaultPrettyPrinter", "com.fasterxml.jackson.databind.KeyDeserializer", "com.fasterxml.jackson.core.util.BufferRecycler", "com.fasterxml.jackson.databind.deser.impl.ErrorThrowingDeserializer", "com.fasterxml.jackson.databind.deser.impl.PropertyBasedObjectIdGenerator", "com.fasterxml.jackson.databind.ser.impl.StringCollectionSerializer", "com.fasterxml.jackson.annotation.ObjectIdResolver", "com.fasterxml.jackson.databind.DeserializationContext", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$Base", "com.fasterxml.jackson.databind.ser.std.InetSocketAddressSerializer", "com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer", "com.fasterxml.jackson.databind.node.DoubleNode", "com.fasterxml.jackson.databind.ser.PropertyWriter", "com.fasterxml.jackson.core.util.ByteArrayBuilder", "com.fasterxml.jackson.databind.type.ReferenceType", "com.fasterxml.jackson.databind.ser.impl.IndexedStringListSerializer", "com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer$TableInfo", "com.fasterxml.jackson.databind.ser.std.NumberSerializer", "com.fasterxml.jackson.databind.introspect.AnnotationCollector$NoAnnotations", "com.fasterxml.jackson.databind.Module", "com.fasterxml.jackson.annotation.JsonView", "com.fasterxml.jackson.databind.AnnotationIntrospector", "com.fasterxml.jackson.databind.ser.std.DateSerializer", "com.fasterxml.jackson.databind.ser.ContainerSerializer", "com.fasterxml.jackson.databind.ser.std.NullSerializer", "com.fasterxml.jackson.databind.deser.std.StringDeserializer", "com.fasterxml.jackson.databind.deser.std.StringArrayDeserializer", "com.fasterxml.jackson.databind.exc.InvalidTypeIdException", "com.fasterxml.jackson.databind.DeserializationFeature", "com.fasterxml.jackson.annotation.JacksonAnnotation", "com.fasterxml.jackson.databind.node.POJONode", "com.fasterxml.jackson.databind.ObjectReader", "com.fasterxml.jackson.databind.node.BaseJsonNode", "com.fasterxml.jackson.databind.node.BigIntegerNode", "com.fasterxml.jackson.databind.util.LRUMap", "com.fasterxml.jackson.databind.JsonDeserializer", "com.fasterxml.jackson.databind.util.SimpleBeanPropertyDefinition", "com.fasterxml.jackson.databind.deser.impl.MethodProperty", "com.fasterxml.jackson.annotation.JsonRawValue", "com.fasterxml.jackson.core.util.DefaultIndenter", "com.fasterxml.jackson.databind.node.ArrayNode", "com.fasterxml.jackson.annotation.JsonAutoDetect$Visibility", "com.fasterxml.jackson.databind.ser.impl.AttributePropertyWriter", "com.fasterxml.jackson.databind.exc.InvalidFormatException", "com.fasterxml.jackson.databind.deser.std.MapDeserializer", "com.fasterxml.jackson.core.io.CharacterEscapes", "com.fasterxml.jackson.databind.deser.std.TokenBufferDeserializer", "com.fasterxml.jackson.core.type.ResolvedType", "com.fasterxml.jackson.databind.ser.std.NumberSerializers", "com.fasterxml.jackson.databind.annotation.JsonSerialize", "com.fasterxml.jackson.databind.ser.impl.PropertyBasedObjectIdGenerator", "com.fasterxml.jackson.databind.introspect.AnnotatedMethod", "com.fasterxml.jackson.databind.util.ConstantValueInstantiator", "com.fasterxml.jackson.databind.introspect.VisibilityChecker", "com.fasterxml.jackson.core.JsonParser", "com.fasterxml.jackson.databind.introspect.AnnotatedParameter", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$FloatSerializer", "com.fasterxml.jackson.databind.ser.BeanPropertyWriter", "com.fasterxml.jackson.core.JsonProcessingException", "com.fasterxml.jackson.core.JsonStreamContext", "com.fasterxml.jackson.core.format.MatchStrength", "com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer$Bucket", "com.fasterxml.jackson.databind.cfg.MutableConfigOverride", "com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer", "com.fasterxml.jackson.core.TokenStreamFactory", "com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl", "com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException", "com.fasterxml.jackson.core.filter.TokenFilter", "com.fasterxml.jackson.databind.util.ArrayIterator", "com.fasterxml.jackson.core.io.CharTypes", "com.fasterxml.jackson.databind.ser.std.StdJdkSerializers$AtomicBooleanSerializer", "com.fasterxml.jackson.databind.ser.std.StdJdkSerializers$AtomicLongSerializer", "com.fasterxml.jackson.databind.ser.std.InetAddressSerializer", "com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver", "com.fasterxml.jackson.annotation.JsonInclude$Include", "com.fasterxml.jackson.databind.deser.std.StdDeserializer", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper$Base", "com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer$TableInfo", "com.fasterxml.jackson.databind.JsonSerializer", "com.fasterxml.jackson.databind.JsonNode", "com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig", "com.fasterxml.jackson.databind.ser.ResolvableSerializer", "com.fasterxml.jackson.databind.PropertyName", "com.fasterxml.jackson.core.json.async.NonBlockingJsonParser", "com.fasterxml.jackson.databind.json.JsonMapper", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormatVisitor", "com.fasterxml.jackson.databind.deser.BasicDeserializerFactory", "com.fasterxml.jackson.databind.ser.std.ReferenceTypeSerializer", "com.fasterxml.jackson.databind.node.JsonNodeFactory", "com.fasterxml.jackson.databind.ser.impl.StringArraySerializer", "com.fasterxml.jackson.databind.cfg.MapperConfig", "com.fasterxml.jackson.databind.deser.std.StdKeyDeserializer$StringFactoryKeyDeserializer", "com.fasterxml.jackson.annotation.JsonManagedReference", "com.fasterxml.jackson.databind.annotation.JsonDeserialize", "com.fasterxml.jackson.databind.MappingJsonFactory", "com.fasterxml.jackson.databind.InjectableValues", "com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer", "com.fasterxml.jackson.databind.ser.std.TimeZoneSerializer", "com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase", "com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair", "com.fasterxml.jackson.databind.ext.NioPathSerializer", "com.fasterxml.jackson.databind.ser.Serializers$Base", "com.fasterxml.jackson.databind.ser.std.StringSerializer", "com.fasterxml.jackson.databind.JavaType", "com.fasterxml.jackson.databind.deser.BeanDeserializer", "com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonNullFormatVisitor", "com.fasterxml.jackson.databind.node.JsonNodeType", "com.fasterxml.jackson.databind.deser.NullValueProvider", "com.fasterxml.jackson.core.util.TextBuffer", "com.fasterxml.jackson.annotation.JacksonAnnotationValue", "com.fasterxml.jackson.core.JsonFactory", "com.fasterxml.jackson.databind.util.NameTransformer", "com.fasterxml.jackson.databind.node.MissingNode", "com.fasterxml.jackson.databind.node.ShortNode", "com.fasterxml.jackson.databind.node.BooleanNode", "com.fasterxml.jackson.databind.deser.std.StdKeyDeserializer$EnumKD", "com.fasterxml.jackson.databind.util.StdDateFormat", "com.fasterxml.jackson.core.util.MinimalPrettyPrinter", "com.fasterxml.jackson.databind.SerializationConfig", "com.fasterxml.jackson.annotation.JsonFormat$Value", "com.fasterxml.jackson.databind.ser.std.BeanSerializerBase", "com.fasterxml.jackson.databind.PropertyMetadata", "com.fasterxml.jackson.annotation.JsonInclude$Value", "com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer", "com.fasterxml.jackson.databind.deser.ResolvableDeserializer", "com.fasterxml.jackson.core.json.DupDetector", "com.fasterxml.jackson.databind.deser.std.StdKeyDeserializer", "com.fasterxml.jackson.databind.ext.DOMSerializer", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonNumberFormatVisitor", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$1", "com.fasterxml.jackson.databind.util.TypeKey", "com.fasterxml.jackson.databind.ser.FilterProvider", "com.fasterxml.jackson.databind.introspect.SimpleMixInResolver", "com.fasterxml.jackson.annotation.JsonFormat", "com.fasterxml.jackson.databind.ser.std.StdJdkSerializers", "com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer", "com.fasterxml.jackson.databind.deser.DeserializerFactory", "com.fasterxml.jackson.annotation.JsonTypeInfo", "com.fasterxml.jackson.annotation.JsonUnwrapped", "com.fasterxml.jackson.core.filter.FilteringParserDelegate", "com.fasterxml.jackson.databind.introspect.ClassIntrospector$MixInResolver", "com.fasterxml.jackson.core.json.JsonGeneratorImpl", "com.fasterxml.jackson.databind.deser.AbstractDeserializer", "com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer", "com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer", "com.fasterxml.jackson.databind.type.TypeBindings$AsKey", "com.fasterxml.jackson.core.JsonFactory$Feature", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$IntegerSerializer", "com.fasterxml.jackson.databind.ser.SerializerCache", "com.fasterxml.jackson.core.io.DataOutputAsStream", "com.fasterxml.jackson.core.io.SegmentedStringWriter", "com.fasterxml.jackson.databind.ser.impl.WritableObjectId", "com.fasterxml.jackson.databind.type.TypeBindings", "com.fasterxml.jackson.databind.deser.std.JsonLocationInstantiator", "com.fasterxml.jackson.databind.SerializerProvider", "com.fasterxml.jackson.core.JsonToken", "com.fasterxml.jackson.databind.cfg.ContextAttributes", "com.fasterxml.jackson.annotation.JsonIdentityInfo", "com.fasterxml.jackson.core.JsonGenerator$Feature", "com.fasterxml.jackson.databind.deser.ValueInstantiator$Gettable", "com.fasterxml.jackson.databind.cfg.BaseSettings", "com.fasterxml.jackson.databind.ObjectMapper", "com.fasterxml.jackson.core.exc.StreamReadException", "com.fasterxml.jackson.databind.ser.DefaultSerializerProvider$Impl", "com.fasterxml.jackson.databind.deser.DeserializerCache", "com.fasterxml.jackson.databind.cfg.ConfigFeature", "com.fasterxml.jackson.core.FormatSchema", "com.fasterxml.jackson.databind.ser.PropertyFilter", "com.fasterxml.jackson.databind.SerializationFeature", "com.fasterxml.jackson.annotation.ObjectIdGenerators", "com.fasterxml.jackson.core.json.JsonWriteFeature", "com.fasterxml.jackson.databind.introspect.AnnotationCollector$OneCollector" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(NumberSerializers_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "com.fasterxml.jackson.databind.ser.std.NumberSerializers", "com.fasterxml.jackson.databind.JsonSerializer", "com.fasterxml.jackson.databind.ser.std.StdSerializer", "com.fasterxml.jackson.databind.ser.std.StdScalarSerializer", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$Base", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$IntegerSerializer", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$LongSerializer", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$DoubleSerializer", "com.fasterxml.jackson.core.JsonParser$NumberType", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$FloatSerializer", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$IntLikeSerializer", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$ShortSerializer", "com.fasterxml.jackson.annotation.JsonCreator$Mode", "com.fasterxml.jackson.databind.DatabindContext", "com.fasterxml.jackson.databind.ser.impl.FailingSerializer", "com.fasterxml.jackson.databind.ser.impl.UnknownSerializer", "com.fasterxml.jackson.databind.SerializerProvider", "com.fasterxml.jackson.databind.ser.DefaultSerializerProvider", "com.fasterxml.jackson.databind.ser.DefaultSerializerProvider$Impl", "com.fasterxml.jackson.databind.ser.std.NullSerializer", "com.fasterxml.jackson.databind.ser.SerializerCache", "com.fasterxml.jackson.databind.BeanProperty$Bogus", "com.fasterxml.jackson.annotation.JsonFormat$Shape", "com.fasterxml.jackson.annotation.JsonFormat$Features", "com.fasterxml.jackson.annotation.JsonFormat$Value", "com.fasterxml.jackson.databind.ser.std.NumberSerializers$1", "com.fasterxml.jackson.core.util.BufferRecycler", "com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase", "com.fasterxml.jackson.databind.ser.std.CalendarSerializer", "com.fasterxml.jackson.databind.ext.CoreXMLSerializers$XMLGregorianCalendarSerializer", "com.fasterxml.jackson.core.io.IOContext", "com.fasterxml.jackson.core.TreeCodec", "com.fasterxml.jackson.core.ObjectCodec", "com.fasterxml.jackson.core.type.ResolvedType", "com.fasterxml.jackson.databind.JavaType", "com.fasterxml.jackson.databind.type.TypeBindings", "com.fasterxml.jackson.databind.type.TypeBase", "com.fasterxml.jackson.databind.type.SimpleType", "com.fasterxml.jackson.databind.AnnotationIntrospector", "com.fasterxml.jackson.databind.ext.Java7SupportImpl", "com.fasterxml.jackson.databind.util.ClassUtil", "com.fasterxml.jackson.databind.ext.Java7Support", "com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector", "com.fasterxml.jackson.databind.util.LRUMap", "com.fasterxml.jackson.databind.cfg.BaseSettings", "com.fasterxml.jackson.databind.type.TypeParser", "com.fasterxml.jackson.databind.type.TypeFactory", "com.fasterxml.jackson.databind.util.StdDateFormat", "com.fasterxml.jackson.core.Base64Variant", "com.fasterxml.jackson.core.Base64Variants", "com.fasterxml.jackson.databind.ObjectMapper", "com.fasterxml.jackson.core.TokenStreamFactory", "com.fasterxml.jackson.core.io.SerializedString", "com.fasterxml.jackson.core.util.DefaultPrettyPrinter", "com.fasterxml.jackson.core.JsonFactory", "com.fasterxml.jackson.databind.MappingJsonFactory", "com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer", "com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer$TableInfo", "com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer", "com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer$TableInfo", "com.fasterxml.jackson.databind.jsontype.SubtypeResolver", "com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver", "com.fasterxml.jackson.databind.util.RootNameLookup", "com.fasterxml.jackson.databind.introspect.SimpleMixInResolver", "com.fasterxml.jackson.databind.introspect.ClassIntrospector", "com.fasterxml.jackson.databind.introspect.AnnotationCollector$NoAnnotations", "com.fasterxml.jackson.databind.introspect.AnnotationCollector", "com.fasterxml.jackson.databind.introspect.AnnotatedClassResolver", "com.fasterxml.jackson.databind.introspect.Annotated", "com.fasterxml.jackson.databind.introspect.AnnotatedClass$Creators", "com.fasterxml.jackson.databind.introspect.AnnotatedClass", "com.fasterxml.jackson.databind.BeanDescription", "com.fasterxml.jackson.databind.introspect.BasicBeanDescription", "com.fasterxml.jackson.databind.introspect.BasicClassIntrospector", "com.fasterxml.jackson.databind.cfg.ConfigOverrides", "com.fasterxml.jackson.annotation.JsonInclude$Include", "com.fasterxml.jackson.annotation.JsonInclude$Value", "com.fasterxml.jackson.annotation.Nulls", "com.fasterxml.jackson.annotation.JsonSetter$Value", "com.fasterxml.jackson.databind.introspect.VisibilityChecker$Std", "com.fasterxml.jackson.databind.cfg.MapperConfig", "com.fasterxml.jackson.databind.cfg.ConfigOverride", "com.fasterxml.jackson.databind.cfg.ConfigOverride$Empty", "com.fasterxml.jackson.databind.MapperFeature", "com.fasterxml.jackson.databind.cfg.MapperConfigBase", "com.fasterxml.jackson.core.util.DefaultPrettyPrinter$NopIndenter", "com.fasterxml.jackson.core.util.DefaultPrettyPrinter$FixedSpaceIndenter", "com.fasterxml.jackson.core.util.DefaultIndenter", "com.fasterxml.jackson.core.util.Separators", "com.fasterxml.jackson.core.PrettyPrinter", "com.fasterxml.jackson.databind.SerializationConfig", "com.fasterxml.jackson.databind.cfg.ContextAttributes", "com.fasterxml.jackson.databind.cfg.ContextAttributes$Impl", "com.fasterxml.jackson.databind.DeserializationConfig", "com.fasterxml.jackson.databind.node.JsonNodeFactory", "com.fasterxml.jackson.databind.DeserializationContext", "com.fasterxml.jackson.databind.deser.DefaultDeserializationContext", "com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl", "com.fasterxml.jackson.databind.deser.DeserializerFactory", "com.fasterxml.jackson.databind.PropertyName", "com.fasterxml.jackson.databind.deser.BasicDeserializerFactory", "com.fasterxml.jackson.databind.deser.std.StdKeyDeserializers", "com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig", "com.fasterxml.jackson.databind.deser.BeanDeserializerFactory", "com.fasterxml.jackson.databind.deser.DeserializerCache", "com.fasterxml.jackson.databind.ser.SerializerFactory", "com.fasterxml.jackson.databind.ser.std.StringSerializer", "com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase", "com.fasterxml.jackson.databind.ser.std.ToStringSerializer", "com.fasterxml.jackson.databind.ser.std.BooleanSerializer", "com.fasterxml.jackson.databind.ser.std.NumberSerializer", "com.fasterxml.jackson.databind.ser.std.DateSerializer", "com.fasterxml.jackson.databind.ser.std.StdJdkSerializers", "com.fasterxml.jackson.databind.ser.std.UUIDSerializer", "com.fasterxml.jackson.databind.ser.BasicSerializerFactory", "com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig", "com.fasterxml.jackson.databind.ser.BeanSerializerFactory", "com.fasterxml.jackson.databind.ObjectReader", "com.fasterxml.jackson.core.util.InternCache", "com.fasterxml.jackson.core.JsonGenerator", "com.fasterxml.jackson.core.base.GeneratorBase", "com.fasterxml.jackson.core.io.CharTypes", "com.fasterxml.jackson.core.json.JsonGeneratorImpl", "com.fasterxml.jackson.core.json.UTF8JsonGenerator", "com.fasterxml.jackson.core.JsonStreamContext", "com.fasterxml.jackson.core.json.JsonWriteContext", "com.fasterxml.jackson.databind.ext.DOMSerializer", "com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper$Base", "com.fasterxml.jackson.databind.type.PlaceholderForType", "com.fasterxml.jackson.databind.type.TypeBindings$TypeParamStash", "com.fasterxml.jackson.databind.deser.DataFormatReaders", "com.fasterxml.jackson.core.format.MatchStrength", "com.fasterxml.jackson.core.TSFBuilder", "com.fasterxml.jackson.core.JsonFactoryBuilder", "com.fasterxml.jackson.core.util.BufferRecyclers", "com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper", "com.fasterxml.jackson.core.JsonParser", "com.fasterxml.jackson.core.base.ParserMinimalBase", "com.fasterxml.jackson.core.base.ParserBase", "com.fasterxml.jackson.core.json.UTF8StreamJsonParser", "com.fasterxml.jackson.core.util.TextBuffer", "com.fasterxml.jackson.core.json.JsonReadContext", "com.fasterxml.jackson.databind.JsonSerializable$Base", "com.fasterxml.jackson.databind.JsonNode", "com.fasterxml.jackson.databind.node.BaseJsonNode", "com.fasterxml.jackson.databind.node.ContainerNode", "com.fasterxml.jackson.databind.node.ObjectNode", "com.fasterxml.jackson.databind.node.ValueNode", "com.fasterxml.jackson.databind.node.TextNode", "com.fasterxml.jackson.databind.json.JsonMapper", "com.fasterxml.jackson.core.util.MinimalPrettyPrinter", "com.fasterxml.jackson.databind.ObjectWriter", "com.fasterxml.jackson.databind.ObjectWriter$GeneratorSettings", "com.fasterxml.jackson.databind.ObjectWriter$Prefetch", "com.fasterxml.jackson.databind.node.InternalNodeMapper", "com.fasterxml.jackson.core.io.SegmentedStringWriter", "com.fasterxml.jackson.core.json.WriterBasedJsonGenerator", "com.fasterxml.jackson.databind.ser.impl.ReadOnlyClassToSerializerMap", "com.fasterxml.jackson.databind.util.TypeKey", "com.fasterxml.jackson.databind.type.ClassStack", "com.fasterxml.jackson.databind.type.ResolvedRecursiveType", "com.fasterxml.jackson.databind.type.TypeBindings$AsKey", "com.fasterxml.jackson.databind.introspect.AnnotationCollector$EmptyCollector", "com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector", "com.fasterxml.jackson.databind.util.ArrayIterator", "com.fasterxml.jackson.databind.ser.std.SerializableSerializer", "com.fasterxml.jackson.core.io.CharacterEscapes", "com.fasterxml.jackson.core.JsonpCharacterEscapes", "com.fasterxml.jackson.core.util.ByteArrayBuilder", "com.fasterxml.jackson.core.json.ReaderBasedJsonParser", "com.fasterxml.jackson.core.type.TypeReference", "com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder", "com.fasterxml.jackson.databind.ObjectMapper$DefaultTypeResolverBuilder", "com.fasterxml.jackson.annotation.JsonTypeInfo$Id", "com.fasterxml.jackson.core.util.JsonGeneratorDelegate", "com.fasterxml.jackson.databind.ext.NioPathSerializer", "com.fasterxml.jackson.databind.ser.impl.ReadOnlyClassToSerializerMap$Bucket", "com.fasterxml.jackson.databind.jsontype.NamedType", "com.fasterxml.jackson.databind.node.NumericNode", "com.fasterxml.jackson.databind.node.LongNode", "com.fasterxml.jackson.core.io.NumberOutput", "com.fasterxml.jackson.databind.type.MapLikeType", "com.fasterxml.jackson.databind.type.MapType", "com.fasterxml.jackson.databind.ser.std.BeanSerializerBase", "com.fasterxml.jackson.databind.ser.BeanSerializer", "com.fasterxml.jackson.databind.jsontype.TypeSerializer", "com.fasterxml.jackson.databind.jsontype.impl.TypeSerializerBase", "com.fasterxml.jackson.databind.jsontype.impl.AsArrayTypeSerializer", "com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeSerializer", "com.fasterxml.jackson.databind.ext.OptionalHandlerFactory", "com.fasterxml.jackson.databind.JsonDeserializer", "com.fasterxml.jackson.databind.deser.std.StdDeserializer", "com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer", "com.fasterxml.jackson.databind.deser.std.FromStringDeserializer", "com.fasterxml.jackson.databind.deser.std.JdkDeserializers", "com.fasterxml.jackson.databind.jsontype.impl.SubTypeValidator", "com.fasterxml.jackson.databind.deser.impl.CreatorCollector", "com.fasterxml.jackson.databind.introspect.CollectorBase", "com.fasterxml.jackson.databind.introspect.AnnotatedFieldCollector", "com.fasterxml.jackson.databind.introspect.TypeResolutionContext$Basic", "com.fasterxml.jackson.databind.introspect.AnnotatedFieldCollector$FieldBuilder", "com.fasterxml.jackson.databind.introspect.AnnotatedMember", "com.fasterxml.jackson.databind.introspect.AnnotatedField", "com.fasterxml.jackson.databind.introspect.AnnotationMap", "com.fasterxml.jackson.annotation.PropertyAccessor", "com.fasterxml.jackson.annotation.JsonAutoDetect$1", "com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition", "com.fasterxml.jackson.databind.AnnotationIntrospector$ReferenceProperty", "com.fasterxml.jackson.databind.AnnotationIntrospector$ReferenceProperty$Type", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$Linked", "com.fasterxml.jackson.databind.introspect.AnnotatedMethodCollector", "com.fasterxml.jackson.databind.introspect.MemberKey", "com.fasterxml.jackson.databind.introspect.AnnotatedMethodCollector$MethodBuilder", "com.fasterxml.jackson.databind.introspect.AnnotationCollector$OneCollector", "com.fasterxml.jackson.databind.introspect.AnnotatedWithParams", "com.fasterxml.jackson.databind.introspect.AnnotatedMethod", "com.fasterxml.jackson.databind.introspect.AnnotatedMethodMap", "com.fasterxml.jackson.databind.util.BeanUtil", "com.fasterxml.jackson.databind.introspect.AnnotatedCreatorCollector", "com.fasterxml.jackson.databind.util.ClassUtil$Ctor", "com.fasterxml.jackson.databind.introspect.AnnotatedConstructor", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$9", "com.fasterxml.jackson.annotation.JsonProperty$Access", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$10", "com.fasterxml.jackson.databind.deser.impl.CreatorCollector$StdTypeConstructor", "com.fasterxml.jackson.databind.deser.ValueInstantiator", "com.fasterxml.jackson.databind.deser.std.StdValueInstantiator", "com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder", "com.fasterxml.jackson.annotation.JsonIgnoreProperties$Value", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$4", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$5", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$6", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$7", "com.fasterxml.jackson.databind.PropertyMetadata", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$2", "com.fasterxml.jackson.databind.deser.impl.BeanPropertyMap", "com.fasterxml.jackson.databind.deser.BeanDeserializerBase", "com.fasterxml.jackson.databind.deser.BeanDeserializer", "com.fasterxml.jackson.databind.util.LinkedNode", "com.fasterxml.jackson.annotation.JsonFormat$Feature", "com.fasterxml.jackson.core.json.DupDetector", "com.fasterxml.jackson.databind.type.ClassKey", "com.fasterxml.jackson.databind.ser.FilterProvider", "com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider", "com.fasterxml.jackson.annotation.JsonAutoDetect$Value", "com.fasterxml.jackson.core.io.DataOutputAsStream", "com.fasterxml.jackson.databind.ser.BeanSerializerBuilder", "com.fasterxml.jackson.databind.deser.ValueInstantiator$Base", "com.fasterxml.jackson.core.filter.TokenFilter", "com.fasterxml.jackson.core.filter.FilteringGeneratorDelegate", "com.fasterxml.jackson.core.filter.TokenFilterContext", "com.fasterxml.jackson.databind.jsontype.impl.AsExistingPropertyTypeSerializer", "com.fasterxml.jackson.databind.deser.std.StringDeserializer", "com.fasterxml.jackson.databind.deser.DeserializationProblemHandler", "com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase", "com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver", "com.fasterxml.jackson.databind.util.NameTransformer$NopTransformer", "com.fasterxml.jackson.databind.util.NameTransformer", "com.fasterxml.jackson.databind.util.NameTransformer$1", "com.fasterxml.jackson.core.type.WritableTypeId", "com.fasterxml.jackson.databind.jsontype.TypeSerializer$1", "com.fasterxml.jackson.core.type.WritableTypeId$Inclusion", "com.fasterxml.jackson.databind.node.BooleanNode", "com.fasterxml.jackson.databind.util.NameTransformer$Chained", "com.fasterxml.jackson.databind.jsontype.impl.AsExternalTypeSerializer", "com.fasterxml.jackson.core.JsonProcessingException", "com.fasterxml.jackson.core.JsonGenerationException", "com.fasterxml.jackson.databind.Module", "com.fasterxml.jackson.databind.module.SimpleModule", "com.fasterxml.jackson.core.Version", "com.fasterxml.jackson.databind.ser.BeanSerializerModifier", "com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase", "com.fasterxml.jackson.core.json.async.NonBlockingJsonParser", "com.fasterxml.jackson.databind.util.ArrayBuilders", "com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer", "com.fasterxml.jackson.databind.type.CollectionLikeType", "com.fasterxml.jackson.databind.type.CollectionType", "com.fasterxml.jackson.databind.deser.impl.CreatorCandidate", "com.fasterxml.jackson.databind.introspect.AnnotatedParameter", "com.fasterxml.jackson.databind.deser.impl.CreatorCandidate$Param", "com.fasterxml.jackson.databind.deser.std.ContainerDeserializerBase", "com.fasterxml.jackson.databind.deser.std.CollectionDeserializer", "com.fasterxml.jackson.databind.util.AccessPattern", "com.fasterxml.jackson.databind.deser.impl.NullsConstantProvider", "com.fasterxml.jackson.databind.deser.std.MapDeserializer", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers$NumberDeserializer", "com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla", "com.fasterxml.jackson.databind.ser.Serializers$Base", "com.fasterxml.jackson.databind.module.SimpleSerializers", "com.fasterxml.jackson.databind.JsonMappingException", "com.fasterxml.jackson.databind.exc.MismatchedInputException", "com.fasterxml.jackson.databind.exc.InvalidTypeIdException", "com.fasterxml.jackson.databind.deser.ValueInstantiators$Base", "com.fasterxml.jackson.databind.module.SimpleValueInstantiators", "com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector$1", "com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector", "com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair", "com.fasterxml.jackson.annotation.ObjectIdGenerator", "com.fasterxml.jackson.annotation.ObjectIdGenerators$Base", "com.fasterxml.jackson.annotation.ObjectIdGenerators$StringIdGenerator", "com.fasterxml.jackson.annotation.ObjectIdGenerators$IntSequenceGenerator", "com.fasterxml.jackson.databind.module.SimpleKeyDeserializers", "com.fasterxml.jackson.databind.KeyDeserializer", "com.fasterxml.jackson.databind.deser.std.StdKeyDeserializer", "com.fasterxml.jackson.core.format.InputAccessor$Std", "com.fasterxml.jackson.databind.jsontype.impl.AsWrapperTypeSerializer", "com.fasterxml.jackson.databind.deser.BeanDeserializerModifier", "com.fasterxml.jackson.databind.InjectableValues", "com.fasterxml.jackson.databind.InjectableValues$Std", "com.fasterxml.jackson.databind.deser.AbstractDeserializer", "com.fasterxml.jackson.databind.type.ArrayType", "com.fasterxml.jackson.databind.type.ReferenceType", "com.fasterxml.jackson.databind.ext.CoreXMLDeserializers$Std", "com.fasterxml.jackson.databind.ObjectMapper$3", "com.fasterxml.jackson.databind.type.TypeModifier", "com.fasterxml.jackson.databind.ext.DOMDeserializer", "com.fasterxml.jackson.databind.ext.DOMDeserializer$DocumentDeserializer", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers$PrimitiveOrWrapperDeserializer", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers$DoubleDeserializer", "com.fasterxml.jackson.databind.exc.InvalidDefinitionException", "com.fasterxml.jackson.databind.util.NameTransformer$3", "com.fasterxml.jackson.databind.node.POJONode", "com.fasterxml.jackson.databind.node.ArrayNode", "com.fasterxml.jackson.core.JsonPointer", "com.fasterxml.jackson.databind.JsonMappingException$Reference", "com.fasterxml.jackson.databind.node.JsonNodeType", "com.fasterxml.jackson.databind.AbstractTypeResolver", "com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver", "com.fasterxml.jackson.databind.module.SimpleDeserializers", "com.fasterxml.jackson.core.filter.JsonPointerBasedFilter", "com.fasterxml.jackson.annotation.SimpleObjectIdResolver", "com.fasterxml.jackson.databind.deser.std.DateDeserializers", "com.fasterxml.jackson.databind.deser.std.FromStringDeserializer$Std", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer", "com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase", "com.fasterxml.jackson.databind.deser.impl.FailingDeserializer", "com.fasterxml.jackson.databind.deser.SettableBeanProperty", "com.fasterxml.jackson.databind.deser.impl.MethodProperty", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$8", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$1", "com.fasterxml.jackson.databind.type.TypeParser$MyTokenizer", "com.fasterxml.jackson.databind.ObjectMapper$1", "com.fasterxml.jackson.databind.exc.InvalidFormatException", "com.fasterxml.jackson.databind.PropertyNamingStrategy$PropertyNamingStrategyBase", "com.fasterxml.jackson.databind.PropertyNamingStrategy$SnakeCaseStrategy", "com.fasterxml.jackson.databind.PropertyNamingStrategy$UpperCamelCaseStrategy", "com.fasterxml.jackson.databind.PropertyNamingStrategy$LowerCaseStrategy", "com.fasterxml.jackson.databind.PropertyNamingStrategy$KebabCaseStrategy", "com.fasterxml.jackson.databind.PropertyNamingStrategy$LowerDotCaseStrategy", "com.fasterxml.jackson.databind.PropertyNamingStrategy", "com.fasterxml.jackson.databind.BeanProperty$Std", "com.fasterxml.jackson.databind.PropertyMetadata$MergeInfo", "com.fasterxml.jackson.databind.util.NameTransformer$2", "com.fasterxml.jackson.core.exc.StreamReadException", "com.fasterxml.jackson.core.JsonParseException", "com.fasterxml.jackson.core.JsonLocation", "com.fasterxml.jackson.databind.node.NullNode", "com.fasterxml.jackson.databind.introspect.ObjectIdInfo", "com.fasterxml.jackson.databind.BeanProperty", "com.fasterxml.jackson.databind.deser.impl.SetterlessProperty", "com.fasterxml.jackson.databind.introspect.VisibilityChecker$1", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers$ByteDeserializer", "com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter", "com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter$FilterExceptFilter", "com.fasterxml.jackson.databind.ser.impl.ObjectIdWriter", "com.fasterxml.jackson.databind.introspect.VirtualAnnotatedMember", "com.fasterxml.jackson.databind.deser.impl.ReadableObjectId", "com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter$SerializeExceptFilter", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers$FloatDeserializer", "com.fasterxml.jackson.core.util.VersionUtil", "com.fasterxml.jackson.core.json.PackageVersion", "com.fasterxml.jackson.databind.jsontype.TypeDeserializer", "com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase", "com.fasterxml.jackson.databind.jsontype.impl.AsArrayTypeDeserializer", "com.fasterxml.jackson.databind.jsontype.impl.AsExternalTypeDeserializer", "com.fasterxml.jackson.databind.deser.CreatorProperty", "com.fasterxml.jackson.core.util.JsonParserDelegate", "com.fasterxml.jackson.core.filter.FilteringParserDelegate", "com.fasterxml.jackson.databind.introspect.AnnotationCollector$OneAnnotation", "com.fasterxml.jackson.databind.deser.Deserializers$Base", "com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers$ShortDeserializer", "com.fasterxml.jackson.core.io.JsonStringEncoder", "com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer", "com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer", "com.fasterxml.jackson.databind.ser.ContainerSerializer", "com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase", "com.fasterxml.jackson.databind.ser.std.CollectionSerializer", "com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap", "com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap$Empty", "com.fasterxml.jackson.databind.deser.std.NumberDeserializers$LongDeserializer", "com.fasterxml.jackson.databind.ser.std.EnumSerializer", "com.fasterxml.jackson.databind.util.EnumValues", "com.fasterxml.jackson.databind.node.MissingNode", "com.fasterxml.jackson.databind.jsontype.impl.AsWrapperTypeDeserializer", "com.fasterxml.jackson.databind.deser.impl.ObjectIdReader", "com.fasterxml.jackson.databind.node.BigIntegerNode", "com.fasterxml.jackson.core.JsonGenerator$1", "com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer", "com.fasterxml.jackson.core.util.JsonParserSequence", "com.fasterxml.jackson.annotation.ObjectIdGenerator$IdKey", "com.fasterxml.jackson.databind.node.TreeTraversingParser", "com.fasterxml.jackson.databind.node.NodeCursor", "com.fasterxml.jackson.databind.node.NodeCursor$RootCursor", "com.fasterxml.jackson.databind.ser.PropertyWriter", "com.fasterxml.jackson.databind.ser.BeanPropertyWriter", "com.fasterxml.jackson.databind.JsonNode$1", "com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer", "com.fasterxml.jackson.core.io.UTF32Reader", "com.fasterxml.jackson.databind.util.TokenBuffer", "com.fasterxml.jackson.databind.util.TokenBuffer$Segment", "com.fasterxml.jackson.databind.util.TokenBuffer$Parser", "com.fasterxml.jackson.databind.util.TokenBufferReadContext", "com.fasterxml.jackson.databind.deser.std.EnumDeserializer", "com.fasterxml.jackson.databind.util.EnumResolver", "com.fasterxml.jackson.databind.util.CompactStringObjectMap", "com.fasterxml.jackson.databind.MappingIterator", "com.fasterxml.jackson.core.io.MergedStream", "com.fasterxml.jackson.databind.ser.PropertyBuilder", "com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder$3", "com.fasterxml.jackson.databind.ser.PropertyBuilder$1", "com.fasterxml.jackson.databind.cfg.PackageVersion", "com.fasterxml.jackson.databind.ser.std.ClassSerializer", "com.fasterxml.jackson.databind.node.IntNode", "com.fasterxml.jackson.databind.node.FloatNode", "com.fasterxml.jackson.databind.deser.impl.PropertyValue", "com.fasterxml.jackson.databind.deser.impl.PropertyValue$Regular", "com.fasterxml.jackson.core.JsonFactory$Feature", "com.fasterxml.jackson.core.JsonParser$Feature", "com.fasterxml.jackson.core.JsonGenerator$Feature", "com.fasterxml.jackson.annotation.JsonAutoDetect$Visibility", "com.fasterxml.jackson.databind.SerializationFeature", "com.fasterxml.jackson.core.JsonToken" ); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
ff7a8fbfb423275eca6147f811bd86db6193902c
6b90ff603ca49c8857d4cc3bdbda248a731b1034
/mobi/MobileServices/src/main/java/com/apos/mobile/HomeController.java
9c9a166ee2b1f04532c500e1c30c38a5098fbec4
[]
no_license
ygoron/mobile-services
fecd83033de03e008970b36ae6c89739d704e3f8
eadf27ded0cc8c03341b1e6cd3bd7ef52874a9c6
refs/heads/master
2016-09-06T03:34:09.841269
2013-10-05T21:59:01
2013-10-05T21:59:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,716
java
package com.apos.mobile; import java.text.DateFormat; import java.util.Date; import java.util.Locale; import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.apos.model.SessionInfo; import com.crystaldecisions.sdk.framework.CrystalEnterprise; import com.crystaldecisions.sdk.framework.IEnterpriseSession; import com.crystaldecisions.sdk.occa.infostore.IInfoObject; import com.crystaldecisions.sdk.occa.infostore.IInfoStore; import com.crystaldecisions.sdk.occa.infostore.IRemoteFile; import com.crystaldecisions.sdk.plugin.desktop.common.IReportFormatOptions; import com.crystaldecisions.sdk.plugin.desktop.common.IReportProcessingInfo; /** * Handles requests for the application home page. */ @Controller public class HomeController { private static final Logger Log = LoggerFactory .getLogger(HomeController.class); private static final String STR_VERSION = "1.0.04.01"; public static final String SAP_TOKEN = "X-SAP-LogonToken"; private static final String CMS_QUERY_FILES = "SELECT SI_FILES,SI_MIME_TYPE, SI_PROCESSINFO.SI_FORMAT_INFO,SI_PROGID, SI_PROGID_MACHINE,SI_FILES FROM CI_INFOOBJECTS WHERE SI_ID="; // private static final String CMS_QUERY_FILES = // "SELECT * FROM CI_INFOOBJECTS WHERE SI_ID="; public static final String CMS_PROG_ID_PDF = "CrystalEnterprise.Pdf"; public static final String CMS_PROG_ID_EXCEL = "CrystalEnterprise.Excel"; public static final String CMS_PROG_ID_CSV = "CrystalEnterprise.Txt"; public static final String CMS_PROG_ID_WORD = "CrystalEnterprise.Word"; public static final String CMS_PROG_ID_RTF = "CrystalEnterprise.Rtf"; public static final String CMS_PROG_ID_CRYSTALREPORT = "CrystalEnterprise.Report"; public static final String CMS_PROG_ID_WEBI = "CrystalEnterprise.Webi"; public static final String CMS_PROG_ID_FULLCLIENT = "CrystalEnterprise.FullClient"; public static final String CMS_PROG_ID_AGNOSTIC = "CrystalEnterprise.Agnostic"; /** * Simply selects the home view to render by returning its name. */ @RequestMapping(value = "/", method = RequestMethod.GET) public String home(Locale locale, Model model) { Log.info("Welcome home! The client locale is {}.", locale); Date date = new Date(); DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); String formattedDate = dateFormat.format(date); model.addAttribute("serverTime", formattedDate); return "home"; } @RequestMapping(value = "/session.info", method = RequestMethod.GET) @ResponseBody public ResponseEntity<SessionInfo> getSessioninfo( @RequestHeader(SAP_TOKEN) String token) { IEnterpriseSession enterpriseSession = null; // token = token.split("\"")[1]; Log.debug("Token:" + token); String temp[] = token.split("\""); if (temp.length > 1) token = temp[1]; else token = temp[0]; Log.debug("Actual Token:" + token); SessionInfo sessionInfo = new SessionInfo(); try { enterpriseSession = CrystalEnterprise.getSessionMgr() .logonWithToken(token); sessionInfo = new SessionInfo(); sessionInfo.setMobileServiceVersion(STR_VERSION); sessionInfo.setBiPlatformVersion(enterpriseSession .getEnterpriseVersion()); sessionInfo.setHttpCode(HttpStatus.CREATED.value()); return new ResponseEntity<SessionInfo>(sessionInfo, HttpStatus.CREATED); } catch (Exception ee) { Log.error(ee.getLocalizedMessage(), ee); sessionInfo.setMessage(ee.getLocalizedMessage()); sessionInfo.setHttpCode(HttpStatus.FORBIDDEN.value()); return new ResponseEntity<SessionInfo>(sessionInfo, HttpStatus.FORBIDDEN); } finally { if (enterpriseSession != null) enterpriseSession.logoff(); } } @RequestMapping(value = "/instance.content/{id}", method = RequestMethod.GET) @ResponseBody public ResponseEntity<byte[]> getInstanceContent( @RequestHeader(SAP_TOKEN) String token, @PathVariable("id") String id, HttpServletResponse response) { IEnterpriseSession enterpriseSession = null; Log.debug("Token:" + token); try { String temp[] = token.split("\""); if (temp.length > 1) token = temp[1]; else token = temp[0]; Log.debug("Actual Token:" + token); enterpriseSession = CrystalEnterprise.getSessionMgr() .logonWithToken(token); IInfoStore infoStore = (IInfoStore) enterpriseSession .getService("InfoStore"); String cmsQuery = CMS_QUERY_FILES + id; Log.debug("CMS Query:" + cmsQuery); IInfoObject infoObject = (IInfoObject) infoStore.query(cmsQuery) .get(0); HttpHeaders httpHeaders = new HttpHeaders(); Log.debug("Info Object ProgId:" + infoObject.getProgID()); if (infoObject.getProgID().equalsIgnoreCase(CMS_PROG_ID_PDF)) { httpHeaders .setContentType(MediaType.valueOf("application/pdf")); Log.debug("Format Pdf"); } else if (infoObject.getProgID().equalsIgnoreCase( CMS_PROG_ID_EXCEL)) { // httpHeaders.setContentType(MediaType // .valueOf("application/vnd.ms-excel")); if (infoObject.properties().getProperty("SI_PROGID_MACHINE") .toString().equalsIgnoreCase(CMS_PROG_ID_CRYSTALREPORT)) { IReportProcessingInfo reportProcInfo = (IReportProcessingInfo) infoObject; Log.debug("Excel Format:" + reportProcInfo.getReportFormatOptions() .getFormat()); switch (reportProcInfo.getReportFormatOptions().getFormat()) { case IReportFormatOptions.CeReportFormat.EXCEL: case IReportFormatOptions.CeReportFormat.EXCEL_DATA_ONLY: httpHeaders.setContentType(MediaType .valueOf("application/vnd.ms-excel")); break; default: Log.debug("Default"); httpHeaders .setContentType(MediaType .valueOf("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")); } } else if (infoObject.properties() .getProperty("SI_PROGID_MACHINE").toString() .equalsIgnoreCase(CMS_PROG_ID_WEBI)) { String mimeType = infoObject.properties() .getProperty("SI_MIME_TYPE").toString(); Log.debug("Mime type:" + mimeType); if (mimeType != null) { httpHeaders.setContentType(MediaType.valueOf(mimeType)); } } else if (infoObject.properties() .getProperty("SI_PROGID_MACHINE").toString() .equalsIgnoreCase(CMS_PROG_ID_FULLCLIENT)) { Log.debug("Full Client"); httpHeaders.setContentType(MediaType .valueOf("application/vnd.ms-excel")); } Log.debug("Format Excel"); } else if (infoObject.getProgID().equalsIgnoreCase(CMS_PROG_ID_CSV)) { httpHeaders.setContentType(MediaType.valueOf("text/plain")); Log.debug("Format Plain"); } else if (infoObject.getProgID().equalsIgnoreCase( CMS_PROG_ID_AGNOSTIC)) { String mimeType = infoObject.properties() .getProperty("SI_MIME_TYPE").toString(); Log.debug("Mime type:" + mimeType); if (mimeType != null) { httpHeaders.setContentType(MediaType.valueOf(mimeType)); } Log.debug("Format Agnostic"); } else if (infoObject.getProgID().equalsIgnoreCase(CMS_PROG_ID_WORD) || infoObject.getProgID().equalsIgnoreCase(CMS_PROG_ID_RTF)) { // httpHeaders // .setContentType(MediaType // .valueOf("application/vnd.openxmlformats-officedocument.wordprocessingml.document")); httpHeaders .setContentType(MediaType.valueOf("application/rtf")); Log.debug("Format Word"); } IRemoteFile file = (IRemoteFile) infoObject.getFiles().get(0); Log.debug("File Size:" + file.getSize()); // IContent content = (IContent) infoObject; // byte[] contentBytes = content.getContent(); // Log.debug("Content Size:" + contentBytes.length); // ResponseEntity<byte[]> responseEntity = new ResponseEntity<byte[]>( IOUtils.toByteArray(file.getInputStream()), httpHeaders, HttpStatus.CREATED); return responseEntity; } catch (Exception ee) { Log.error(ee.getLocalizedMessage(), ee); return new ResponseEntity<byte[]>(new byte[0], HttpStatus.FORBIDDEN); } finally { if (enterpriseSession != null) enterpriseSession.logoff(); } } }
[ "ygoron@gmail.com" ]
ygoron@gmail.com
96fb28b7c2b6bee3c2372e242bc1d171a2f3dac7
f8cec9b5127b4ebf007325d4c2aafe69014a05d3
/jsystem-core-projects/jsystemAnt/src/main/java/com/aqua/anttask/jsystem/ForTask.java
86ea885a9b6d6cc782febd95811744dc7513d4c5
[ "Apache-2.0" ]
permissive
doronzuker/jsystem
d8f49001029f5e0bb41a74d239f7a90d19c526dd
2b48ce0e0d9bd44b5f7dfb760fff1dccb79a45fe
refs/heads/master
2021-01-16T22:34:01.594350
2013-12-01T15:13:05
2013-12-01T15:13:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,074
java
package com.aqua.anttask.jsystem; /* * Copyright (c) 2003-2005 Ant-Contrib project. 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. */ import java.io.File; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.StringTokenizer; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.taskdefs.MacroDef; import org.apache.tools.ant.taskdefs.MacroInstance; import org.apache.tools.ant.taskdefs.Parallel; import org.apache.tools.ant.types.DirSet; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.Path; /*** * ITAI: We had to copy the class to our project in order to allow passing the * FOR operation properties in the properties file instead of in the XML file. * See the doSequentialIteration method. * * Task definition for the for task. This is based on the foreach task but takes * a sequential element instead of a target and only works for ant >= 1.6Beta3 * * @author Peter Reilly */ public class ForTask extends Task { private String list; private String param; private String delimiter = ","; private Path currPath; private boolean trim; private boolean keepgoing = false; private MacroDef macroDef; private List hasIterators = new ArrayList(); private boolean parallel = false; private Integer threadCount; private Parallel parallelTasks; private int begin = 0; private Integer end = null; private int step = 1; private int taskCount = 0; private int errorCount = 0; /** * Creates a new <code>For</code> instance. */ public ForTask() { } /** * Attribute whether to execute the loop in parallel or in sequence. * * @param parallel * if true execute the tasks in parallel. Default is false. */ public void setParallel(boolean parallel) { this.parallel = parallel; } /*** * Set the maximum amount of threads we're going to allow to execute in * parallel * * @param threadCount * the number of threads to use */ public void setThreadCount(int threadCount) { if (threadCount < 1) { throw new BuildException("Illegal value for threadCount " + threadCount + " it should be > 0"); } this.threadCount = new Integer(threadCount); } /** * Set the trim attribute. * * @param trim * if true, trim the value for each iterator. */ public void setTrim(boolean trim) { this.trim = trim; } /** * Set the keepgoing attribute, indicating whether we should stop on errors * or continue heedlessly onward. * * @param keepgoing * a boolean, if <code>true</code> then we act in the keepgoing * manner described. */ public void setKeepgoing(boolean keepgoing) { this.keepgoing = keepgoing; } /** * Set the list attribute. * * @param list * a list of delimiter separated tokens. */ public void setList(String list) { this.list = list; } /** * Set the delimiter attribute. * * @param delimiter * the delimiter used to separate the tokens in the list * attribute. The default is ",". */ public void setDelimiter(String delimiter) { this.delimiter = delimiter; } /** * Set the param attribute. This is the name of the macrodef attribute that * gets set for each iterator of the sequential element. * * @param param * the name of the macrodef attribute. */ public void setParam(String param) { this.param = param; } private Path getOrCreatePath() { if (currPath == null) { currPath = new Path(getProject()); } return currPath; } /** * This is a path that can be used instread of the list attribute to * interate over. If this is set, each path element in the path is used for * an interator of the sequential element. * * @param path * the path to be set by the ant script. */ public void addConfigured(Path path) { getOrCreatePath().append(path); } /** * This is a path that can be used instread of the list attribute to * interate over. If this is set, each path element in the path is used for * an interator of the sequential element. * * @param path * the path to be set by the ant script. */ public void addConfiguredPath(Path path) { addConfigured(path); } /** * @return a MacroDef#NestedSequential object to be configured */ public Object createSequential() { macroDef = new MacroDef(); macroDef.setProject(getProject()); return macroDef.createSequential(); } /** * Set begin attribute. * * @param begin * the value to use. */ public void setBegin(int begin) { this.begin = begin; } /** * Set end attribute. * * @param end * the value to use. */ public void setEnd(Integer end) { this.end = end; } /** * Set step attribute. * */ public void setStep(int step) { this.step = step; } /** * Run the for task. This checks the attributes and nested elements, and if * there are ok, it calls doTheTasks() which constructes a macrodef task and * a for each interation a macrodef instance. */ public void execute() { if (parallel) { parallelTasks = (Parallel) getProject().createTask("parallel"); if (threadCount != null) { parallelTasks.setThreadCount(threadCount.intValue()); } } if (list == null && currPath == null && hasIterators.size() == 0 && end == null) { throw new BuildException( "You must have a list or path or sequence to iterate through"); } if (param == null) { throw new BuildException( "You must supply a property name to set on" + " each iteration in param"); } if (macroDef == null) { throw new BuildException("You must supply an embedded sequential " + "to perform"); } if (end != null) { int iEnd = end.intValue(); if (step == 0) { throw new BuildException("step cannot be 0"); } else if (iEnd > begin && step < 0) { throw new BuildException("end > begin, step needs to be > 0"); } else if (iEnd <= begin && step > 0) { throw new BuildException("end <= begin, step needs to be < 0"); } } doTheTasks(); if (parallel) { parallelTasks.perform(); } } private void doSequentialIteration(String val) { MacroInstance instance = new MacroInstance(); instance.setProject(getProject()); instance.setOwningTarget(getOwningTarget()); instance.setMacroDef(macroDef); /**** ITAI:This line was added in order to pass correctly the parameters to the JSystem task ******/ getProject().setProperty(param, val); /**************************************************************************************************/ instance.setDynamicAttribute(param.toLowerCase(), val); if (!parallel) { instance.execute(); } else { parallelTasks.addTask(instance); } } private void doToken(String tok) { try { taskCount++; doSequentialIteration(tok); } catch (BuildException bx) { if (keepgoing) { log(tok + ": " + bx.getMessage(), Project.MSG_ERR); errorCount++; } else { throw bx; } } } private void doTheTasks() { errorCount = 0; taskCount = 0; // Create a macro attribute if (macroDef.getAttributes().isEmpty()) { MacroDef.Attribute attribute = new MacroDef.Attribute(); attribute.setName(param); macroDef.addConfiguredAttribute(attribute); } // Take Care of the list attribute if (list != null) { StringTokenizer st = new StringTokenizer(list, delimiter); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (trim) { tok = tok.trim(); } doToken(tok); } } // Take care of the begin/end/step attributes if (end != null) { int iEnd = end.intValue(); if (step > 0) { for (int i = begin; i < (iEnd + 1); i = i + step) { doToken("" + i); } } else { for (int i = begin; i > (iEnd - 1); i = i + step) { doToken("" + i); } } } // Take Care of the path element String[] pathElements = new String[0]; if (currPath != null) { pathElements = currPath.list(); } for (int i = 0; i < pathElements.length; i++) { File nextFile = new File(pathElements[i]); doToken(nextFile.getAbsolutePath()); } // Take care of iterators for (Iterator i = hasIterators.iterator(); i.hasNext();) { Iterator it = ((HasIterator) i.next()).iterator(); while (it.hasNext()) { doToken(it.next().toString()); } } if (keepgoing && (errorCount != 0)) { throw new BuildException("Keepgoing execution: " + errorCount + " of " + taskCount + " iterations failed."); } } /** * Add a Map, iterate over the values * * @param map * a Map object - iterate over the values. */ public void add(Map map) { hasIterators.add(new MapIterator(map)); } /** * Add a fileset to be iterated over. * * @param fileset * a <code>FileSet</code> value */ public void add(FileSet fileset) { getOrCreatePath().addFileset(fileset); } /** * Add a fileset to be iterated over. * * @param fileset * a <code>FileSet</code> value */ public void addFileSet(FileSet fileset) { add(fileset); } /** * Add a dirset to be iterated over. * * @param dirset * a <code>DirSet</code> value */ public void add(DirSet dirset) { getOrCreatePath().addDirset(dirset); } /** * Add a dirset to be iterated over. * * @param dirset * a <code>DirSet</code> value */ public void addDirSet(DirSet dirset) { add(dirset); } /** * Add a collection that can be iterated over. * * @param collection * a <code>Collection</code> value. */ public void add(Collection collection) { hasIterators.add(new ReflectIterator(collection)); } /** * Add an iterator to be iterated over. * * @param iterator * an <code>Iterator</code> value */ public void add(Iterator iterator) { hasIterators.add(new IteratorIterator(iterator)); } /** * Add an object that has an Iterator iterator() method that can be iterated * over. * * @param obj * An object that can be iterated over. */ public void add(Object obj) { hasIterators.add(new ReflectIterator(obj)); } /** * Interface for the objects in the iterator collection. */ private interface HasIterator { Iterator iterator(); } private static class IteratorIterator implements HasIterator { private Iterator iterator; public IteratorIterator(Iterator iterator) { this.iterator = iterator; } public Iterator iterator() { return this.iterator; } } private static class MapIterator implements HasIterator { private Map map; public MapIterator(Map map) { this.map = map; } public Iterator iterator() { return map.values().iterator(); } } private static class ReflectIterator implements HasIterator { private Object obj; private Method method; public ReflectIterator(Object obj) { this.obj = obj; try { method = obj.getClass().getMethod("iterator", new Class[] {}); } catch (Throwable t) { throw new BuildException("Invalid type " + obj.getClass() + " used in For task, it does" + " not have a public iterator method"); } } public Iterator iterator() { try { return (Iterator) method.invoke(obj, new Object[] {}); } catch (Throwable t) { throw new BuildException(t); } } } }
[ "itai.agmon@gmail.com" ]
itai.agmon@gmail.com
295233426cc586f93ce3ff2e83bda8735451eb4f
82113d98e949d4790fe1cd374019dee4e2bc6214
/src/com/test/bookjuck/dao/EBookDAO.java
4d6b6f96852975d67d2ccf4b830f1503694d11ef
[]
no_license
kimdeagle/servlet-jsp-project
f82264409763ca641493c000a65819ebe993c931
f1782ec36f5f457c917383bd12f3a5b634992d37
refs/heads/master
2023-03-26T01:51:22.915078
2021-03-02T14:20:45
2021-03-02T14:20:45
344,331,668
0
2
null
null
null
null
UTF-8
Java
false
false
16,908
java
package com.test.bookjuck.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import com.test.bookjuck.DBUtil; import com.test.bookjuck.dto.BookDTO; import com.test.bookjuck.dto.EBookDTO; /** * EBook 관련 DB 작업 담당 클래스 * @author 김주혁 * */ public class EBookDAO { private Connection conn; private Statement stat; private PreparedStatement pstat; private ResultSet rs; public EBookDAO() { // DB 연결 conn = DBUtil.open(); } public void close() { try { conn.close(); } catch (Exception e) { System.out.println("EBookDAO.close()"); e.printStackTrace(); } } //############# 주혁 시작 /** * (사용자) EBook 리스트 반환 메서드 * @param map 카테고리 및 페이징 관련 데이터를 담은 객체 * @return EBook 리스트 */ public ArrayList<EBookDTO> getEBookList(HashMap<String, String> map) { try { String sql = ""; String innerSql = ""; if (map.get("seqSCategory") == null) { //E-Book 리스트 첫 화면 //innerSql = "select eb.*, lc.seq as seqLCategory, mc.seq as seqMCategory, lc.lCategory as lCategory, mc.mCategory as mCategory, sc.sCategory as sCategory, (select name from tblAuthor where seq = eb.seqAuthor) as author from tblEbook eb inner join tblSCategory sc on eb.seqSCategory = sc.seq inner join tblMCategory mc on sc.seqMCategory = mc.seq inner join tblLCategory lc on mc.seqLCategory = lc.seq order by eb.pubDate desc, eb.title asc"; innerSql = "select * from viewEBook order by pubDate desc, title asc"; } else { //도서 리스트 좌측 소분류 선택 //innerSql = String.format("select eb.*, lc.seq as seqLCategory, mc.seq as seqMCategory, lc.lCategory as lCategory, mc.mCategory as mCategory, sc.sCategory as sCategory, (select name from tblAuthor where seq = eb.seqAuthor) as author from tblEbook eb inner join tblSCategory sc on eb.seqSCategory = sc.seq inner join tblMCategory mc on sc.seqMCategory = mc.seq inner join tblLCategory lc on mc.seqLCategory = lc.seq where eb.seqSCategory = %s order by eb.pubDate desc, eb.title asc", map.get("seqSCategory")); innerSql = String.format("select * from viewEBook where seqSCategory = %s order by pubDate desc, title asc", map.get("seqSCategory")); } sql = String.format("select * from (select a.*, rownum as rnum from (%s) a) where rnum between %s and %s", innerSql, map.get("begin"), map.get("end")); pstat = conn.prepareStatement(sql); rs = pstat.executeQuery(); ArrayList<EBookDTO> eblist = new ArrayList<EBookDTO>(); while (rs.next()) { EBookDTO dto = new EBookDTO(); dto.setSeq(rs.getString("seq")); dto.setImage(rs.getString("image")); dto.setTitle(rs.getString("title")); dto.setAuthor(rs.getString("author")); dto.setPublisher(rs.getString("publisher")); dto.setPubDate(rs.getString("pubDate")); dto.setIntro(rs.getString("intro")); dto.setPrice(rs.getInt("price")); dto.setSalePrice(rs.getInt("salePrice")); dto.setSeqLCategory(rs.getString("seqLCategory")); dto.setSeqMCategory(rs.getString("seqMCategory")); dto.setSeqSCategory(rs.getString("seqSCategory")); dto.setlCategory(rs.getString("lCategory")); dto.setmCategory(rs.getString("mCategory")); dto.setsCategory(rs.getString("sCategory")); eblist.add(dto); } return eblist; } catch (Exception e) { System.out.println("EBookDAO.getEBookList()"); e.printStackTrace(); } return null; } /** * (사용자) EBook 상세 정보 반환 메서드 * @param seq EBook 번호 * @return EBook 상세 정보 */ public EBookDTO getEBookDetail(String seq) { try { String sql = "select eb.*, lc.seq as seqLCategory, mc.seq as seqMCategory, lc.lCategory as lCategory, mc.mCategory as mCategory, sc.sCategory as sCategory, (select name from tblAuthor where seq = eb.seqAuthor) as author, (select intro from tblAuthor where seq = eb.seqAuthor) as authorIntro from tblEBook eb inner join tblSCategory sc on eb.seqSCategory = sc.seq inner join tblMCategory mc on sc.seqMCategory = mc.seq inner join tblLCategory lc on mc.seqLCategory = lc.seq where eb.seq = ?"; pstat = conn.prepareStatement(sql); pstat.setString(1, seq); rs = pstat.executeQuery(); EBookDTO dto = new EBookDTO(); if (rs.next()) { dto.setSeq(rs.getString("seq")); dto.setSeqAuthor(rs.getString("seqAuthor")); dto.setSeqSCategory(rs.getString("seqSCategory")); dto.setTitle(rs.getString("title")); dto.setPublisher(rs.getString("publisher")); dto.setPrice(rs.getInt("price")); dto.setSalePrice(rs.getInt("salePrice")); dto.setPubDate(rs.getString("pubDate")); dto.setIntro(rs.getString("intro")); dto.setIsbn(rs.getString("isbn")); dto.setCopy(rs.getString("copy")); dto.setImage(rs.getString("image")); dto.setContents(rs.getString("contents")); dto.seteFile(rs.getString("eFile")); dto.setAuthor(rs.getString("author")); dto.setAuthorIntro(rs.getString("authorIntro")); dto.setSeqLCategory(rs.getString("seqLCategory")); dto.setSeqMCategory(rs.getString("seqMCategory")); dto.setsCategory(rs.getString("sCategory")); dto.setmCategory(rs.getString("mCategory")); dto.setlCategory(rs.getString("lCategory")); return dto; } } catch (Exception e) { System.out.println("EBookDAO.getEBookDetail()"); e.printStackTrace(); } return null; } /** * (사용자) EBook 수 반환 메서드 * @param map 카테고리 및 페이징 관련 데이터를 담은 객체 * @return EBook 수 */ public int getEBookCount(HashMap<String, String> map) { try { String where = ""; if (map.get("seqSCategory") != null) { //소분류 선택 where = String.format("where seqSCategory = %s", map.get("seqSCategory")); } String sql = String.format("select count(*) as cnt from tblEBook %s", where); stat = conn.createStatement(); rs = stat.executeQuery(sql); if (rs.next()) { return rs.getInt("cnt"); } } catch (Exception e) { System.out.println("EBookDAO.getEBookCount()"); e.printStackTrace(); } return 0; } /** * (관리자) EBook 리스트 반환 메서드 * @param map 카테고리 및 페이징 관련 데이터를 담은 객체 * @return EBook 리스트 */ public ArrayList<EBookDTO> getAdminEBookList(HashMap<String, String> map) { try { String where = ""; if (map.get("seqLCategory") != null) { where = "where veb.seqLCategory = " + map.get("seqLCategory"); } String sql = String.format("select * from (select a.*, rownum as rnum from (select veb.* from viewEBook veb %s) a) where rnum between %s and %s" , where , map.get("begin") , map.get("end")); stat = conn.createStatement(); rs = stat.executeQuery(sql); ArrayList<EBookDTO> list = new ArrayList<EBookDTO>(); while (rs.next()) { EBookDTO dto = new EBookDTO(); dto.setSeq(rs.getString("seq")); dto.setTitle(rs.getString("title")); dto.setSeqAuthor(rs.getString("seqAuthor")); dto.setPublisher(rs.getString("publisher")); dto.setPubDate(rs.getString("pubDate")); dto.setPrice(rs.getInt("price")); dto.setSalePrice(rs.getInt("salePrice")); dto.setCopy(rs.getString("copy")); dto.setIsbn(rs.getString("isbn")); dto.setIntro(rs.getString("intro")); dto.setImage(rs.getString("image")); dto.seteFile(rs.getString("eFile")); dto.setContents(rs.getString("contents")); dto.setAuthor(rs.getString("author")); dto.setAuthorIntro(rs.getString("authorIntro")); dto.setSeqLCategory(rs.getString("seqLCategory")); dto.setlCategory(rs.getString("lCategory")); dto.setSeqMCategory(rs.getString("seqMCategory")); dto.setmCategory(rs.getString("mCategory")); dto.setSeqSCategory(rs.getString("seqSCategory")); dto.setsCategory(rs.getString("sCategory")); list.add(dto); } return list; } catch (Exception e) { System.out.println("EBookDAO.getAdminEBookList()"); e.printStackTrace(); } return null; } /** * (관리자) 페이징을 위한 EBook 수 반환 메서드 * @param map 카테고리 및 페이징 관련 데이터를 담은 객체 * @return EBook 수 */ public int getAdminEBookCount(HashMap<String, String> map) { try { String where = ""; if (map.get("seqLCategory") != null) { //대분류 선택 where = String.format("where seqLCategory = %s", map.get("seqLCategory")); } String sql = String.format("select count(*) as cnt from viewEBook %s", where); stat = conn.createStatement(); rs = stat.executeQuery(sql); if (rs.next()) { return rs.getInt("cnt"); } } catch (Exception e) { System.out.println("EBookDAO.getAdminEBookCount()"); e.printStackTrace(); } return 0; } /** * (관리자) 총 EBook 수 반환 메서드 * @return 총 EBook 수 */ public int getWholeEBookCount() { try { String sql = "select count(*) as cnt from viewEBook"; stat = conn.createStatement(); rs = stat.executeQuery(sql); if (rs.next()) { return rs.getInt("cnt"); } } catch (Exception e) { System.out.println("EBookDAO.getWholeEBookCount()"); e.printStackTrace(); } return 0; } /** * (관리자) 국내 EBook 수 반환 메서드 * @return 국내 EBook 수 */ public int getInternalEBookCount() { try { String sql = "select count(*) as cnt from viewEBook where seqLCategory = 1"; stat = conn.createStatement(); rs = stat.executeQuery(sql); if (rs.next()) { return rs.getInt("cnt"); } } catch (Exception e) { System.out.println("EBookDAO.getInternalEBookCount()"); e.printStackTrace(); } return 0; } /** * (관리자) 해외 EBook 수 반환 메서드 * @return 해외 EBook 수 */ public int getExternalEBookCount() { try { String sql = "select count(*) as cnt from viewEBook where seqLCategory = 2"; stat = conn.createStatement(); rs = stat.executeQuery(sql); if (rs.next()) { return rs.getInt("cnt"); } } catch (Exception e) { System.out.println("EBookDAO.getExternalEBookCount()"); e.printStackTrace(); } return 0; } /** * (관리자) EBook 추가 메서드 * @param ebdto 추가할 EBook 정보 * @return 추가 성공 여부 */ public int add(EBookDTO ebdto) { try { String sql = "insert into tblEBook (seq, seqAuthor, seqSCategory, title, publisher, price, salePrice, pubDate, intro, isbn, copy, image, eFile, contents) values (seqBook.nextVal, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; pstat = conn.prepareStatement(sql); pstat.setString(1, ebdto.getSeqAuthor()); pstat.setString(2, ebdto.getSeqSCategory()); pstat.setString(3, ebdto.getTitle()); pstat.setString(4, ebdto.getPublisher()); pstat.setInt(5, ebdto.getPrice()); pstat.setInt(6, (ebdto.getPrice() / 10) * 9); pstat.setString(7, ebdto.getPubDate()); pstat.setString(8, ebdto.getIntro()); pstat.setString(9, ebdto.getIsbn()); pstat.setString(10, ebdto.getCopy()); pstat.setString(11, ebdto.getImage()); pstat.setString(12, ebdto.geteFile()); pstat.setString(13, ebdto.getContents()); return pstat.executeUpdate(); } catch (Exception e) { System.out.println("EBookDAO.add()"); e.printStackTrace(); } return 0; } /** * (관리자) EBook 상세 정보 반환 메서드 * @param seq EBook 번호 * @return EBook 상세 정보 */ public EBookDTO getAdminEBookDetail(String seq) { try { String sql = "select * from viewEBook where seq = ?"; pstat = conn.prepareStatement(sql); pstat.setString(1, seq); rs = pstat.executeQuery(); if (rs.next()) { EBookDTO dto = new EBookDTO(); dto.setSeq(rs.getString("seq")); dto.setTitle(rs.getString("title")); dto.setSeqAuthor(rs.getString("seqAuthor")); dto.setPublisher(rs.getString("publisher")); dto.setPubDate(rs.getString("pubDate")); dto.setPrice(rs.getInt("price")); dto.setSalePrice(rs.getInt("salePrice")); dto.setCopy(rs.getString("copy")); dto.setIsbn(rs.getString("isbn")); dto.setIntro(rs.getString("intro")); dto.setImage(rs.getString("image")); dto.seteFile(rs.getString("eFile")); dto.setContents(rs.getString("contents")); dto.setAuthor(rs.getString("author")); dto.setAuthorIntro(rs.getString("authorIntro")); dto.setSeqLCategory(rs.getString("seqLCategory")); dto.setSeqMCategory(rs.getString("seqMCategory")); dto.setSeqSCategory(rs.getString("seqSCategory")); dto.setlCategory(rs.getString("lCategory")); dto.setmCategory(rs.getString("mCategory")); dto.setsCategory(rs.getString("sCategory")); return dto; } } catch (Exception e) { System.out.println("EBookDAO.getAdminEBookDetail()"); e.printStackTrace(); } return null; } /** * (관리자) EBook 수정 시 이미지 수정 안 한 경우 이미지 파일명 반환 메서드 * @param seq EBook 번호 * @return 이미지 파일명 */ public String getImageFileName(String seq) { try { String sql = "select image from tblEBook where seq = ?"; pstat = conn.prepareStatement(sql); pstat.setString(1, seq); rs = pstat.executeQuery(); if (rs.next()) { return rs.getString("image"); } } catch (Exception e) { System.out.println("EBookDAO.getImageFileName()"); e.printStackTrace(); } return null; } /** * (관리자) EBook 수정 시 eFile명 수정 안 한 경우 eFile명 반환 메서드 * @param seq EBook 번호 * @return eFile명 */ public String getEBookFileName(String seq) { try { String sql = "select eFile from tblEBook where seq = ?"; pstat = conn.prepareStatement(sql); pstat.setString(1, seq); rs = pstat.executeQuery(); if (rs.next()) { return rs.getString("eFile"); } } catch (Exception e) { System.out.println("EBookDAO.getEBookFileName()"); e.printStackTrace(); } return null; } /** * (관리자) EBook 수정 메서드 * @param ebdto 수정할 EBook 정보 * @return 수정 성공 여부 */ public int edit(EBookDTO ebdto) { try { String sql = "update tblEBook set seqAuthor = ?, seqSCategory = ?, title = ?, publisher = ?, price = ?, salePrice = ?, pubDate = ?, intro = ?, isbn = ?, copy = ?, image = ?, eFile = ?, contents = ? where seq = ?"; pstat = conn.prepareStatement(sql); pstat.setString(1, ebdto.getSeqAuthor()); pstat.setString(2, ebdto.getSeqSCategory()); pstat.setString(3, ebdto.getTitle()); pstat.setString(4, ebdto.getPublisher()); pstat.setInt(5, ebdto.getPrice()); pstat.setInt(6, (ebdto.getPrice() / 10) * 9); pstat.setString(7, ebdto.getPubDate()); pstat.setString(8, ebdto.getIntro()); pstat.setString(9, ebdto.getIsbn()); pstat.setString(10, ebdto.getCopy()); pstat.setString(11, ebdto.getImage()); pstat.setString(12, ebdto.geteFile()); pstat.setString(13, ebdto.getContents()); pstat.setString(14, ebdto.getSeq()); return pstat.executeUpdate(); } catch (Exception e) { System.out.println("EBookDAO.edit()"); e.printStackTrace(); } return 0; } /** * (관리자) EBook 삭제 시 주문 내역 확인 메서드 * @param seq EBook 번호 * @return 주문 내역 존재 여부 */ public boolean isOrder(String seq) { try { String sql = "select distinct seqEBook from tblEOrderDetail where seqEBook = ?"; pstat = conn.prepareStatement(sql); pstat.setString(1, seq); rs = pstat.executeQuery(); if (rs.next()) { //주문내역 있으면 return true; } } catch (Exception e) { System.out.println("EBookDAO.isOrder()"); e.printStackTrace(); } return false; } /** * (관리자) EBook 삭제 메서드 * @param seq EBook 번호 * @return 삭제 성공 여부 */ public int del(String seq) { try { //EBook 장바구니에서 삭제 (장바구니에 없을 수도 있음) String sql = "delete from tblECart where seqEBook = ?"; pstat = conn.prepareStatement(sql); pstat.setString(1, seq); pstat.executeUpdate(); //E-Book테이블에서 삭제 sql = "delete from tblEBook where seq = ?"; pstat = conn.prepareStatement(sql); pstat.setString(1, seq); return pstat.executeUpdate(); } catch (Exception e) { System.out.println("EBookDAO.del()"); e.printStackTrace(); } return 0; } //############# 주혁 끝 } //EBookDAO
[ "terran0526@naver.com" ]
terran0526@naver.com
27442e2041a60537dadbcd0483ae6afe124384b8
253c60d2e977168d63b883e8a886272885f796d3
/src/SimulationCards/ImperialResources_Sim.java
09e4acfd80a663345e2ebf7c0b75bd8809cf3f10
[]
no_license
noHero123/sllorcs
c3103f39f1b7187f709eddd7101cb6df6ce52fa9
04c75c79547065c30f28688c9a38d9574b6881c9
refs/heads/master
2016-09-05T17:41:56.585758
2015-07-31T15:35:08
2015-07-31T15:35:08
39,224,493
4
4
null
null
null
null
UTF-8
Java
false
false
1,025
java
package SimulationCards; import java.util.ArrayList; import BattleStuff.AttackType; import BattleStuff.Board; import BattleStuff.UColor; import BattleStuff.DamageType; import BattleStuff.Kind; import BattleStuff.Minion; import BattleStuff.UPosition; import BattleStuff.ResourceName; import BattleStuff.SubType; import BattleStuff.tileSelector; public class ImperialResources_Sim extends Simtemplate { //"id":157,"name":"Imperial Resources","description":"Draw 2 scrolls. Your idols are [healed] by 1. Increase Order by 1." public tileSelector getTileSelectorForFirstSelection() { return tileSelector.None; } public void onCardPlay(Board b, UColor player , ArrayList<UPosition> targets, Minion playedCard) { //add neighbours and position itself b.drawCards(playedCard.position.color, 2); for(Minion m: b.getPlayerIdols(playedCard.position.color)) { m.healMinion(1, b); } b.changeMaxRessource(ResourceName.ORDER, playedCard.position.color, 1); return; } }
[ "warseppl@googlemail.com" ]
warseppl@googlemail.com
7740d25678fada3485468c5de2c8b89414c78cdc
3aeb2f5d97226748b9ddd77890454417620981e5
/src/Tester.java
fab698a2a2084c7475ec39cf852c06804bbb41bc
[]
no_license
MrsSpeirs/Tester
f02bc523becc3629cb1f93a7e2679ded0e202b12
d972c927a9a3b9118ff61515b5ee12612cf9ba91
refs/heads/master
2022-12-15T13:27:15.927807
2020-09-03T03:28:39
2020-09-03T03:28:39
292,455,644
0
0
null
null
null
null
UTF-8
Java
false
false
144
java
/*sspeirs * 9/2/2020, 11:25 PM */ public class Tester { public static void main(String args[]) { //start writing code here } }
[ "sspeirs@dasd.org" ]
sspeirs@dasd.org
1dc98631e4298b17f80c8b6407e1797ee7960dfc
86ad33a37d5a0b2a5784f6a89fef9476d352c1d2
/app/src/main/java/com/lilinzhen/qduamapplication/Bean/Sys/GuideBean.java
4b19dbd15af22f03709406b12a9462c898fe67c1
[]
no_license
chkinglee/qduam-app
2c1d0795e914f1700013929450eef2731f5a1223
bfd70f27e50199c8e380aad88b14cf030b543bcc
refs/heads/master
2020-03-23T19:14:57.430687
2018-09-18T09:18:59
2018-09-18T09:18:59
141,962,983
0
0
null
null
null
null
UTF-8
Java
false
false
619
java
package com.lilinzhen.qduamapplication.Bean.Sys; import com.lilinzhen.qduamapplication.Bean.SuperBean; import java.util.List; /** * Created by lilinzhen on 2018/1/5. */ public class GuideBean extends SuperBean { private GuideBody body; public GuideBody getBody() { return body; } public void setBody(GuideBody body) { this.body = body; } public class GuideBody { private List<Guide> list; public List<Guide> getList() { return list; } public void setList(List<Guide> list) { this.list = list; } } }
[ "627021415@qq.com" ]
627021415@qq.com
7c2e2fe43f4424438d15bdd764f0b406b05b5d09
0190537f605ea45c90392fbb17b2bab94b2194d1
/987 Vertical Order Traversal of a Binary Tree.java
d25400548762461f6172dcb88e0559677a8c0e4e
[]
no_license
xil222/leetcode
0e9d17c94c005396e020996aee705f9cf744a49b
eafa7000a205bb0fa1b1b23bf15c0a6ac056d454
refs/heads/master
2020-06-08T08:09:56.878311
2019-10-10T23:33:00
2019-10-10T23:33:00
193,193,466
1
1
null
null
null
null
UTF-8
Java
false
false
1,930
java
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { class Node { int x, y, val; public Node(int x, int y, int val) { this.x = x; this.y = y; this.val = val; } } //O(nlogn) time complexity, O(n) space complexity public List<List<Integer>> verticalTraversal(TreeNode root) { //this problem is sorting each list based on x, y, and val if (root == null) { return new ArrayList<List<Integer>>(); } PriorityQueue<Node> pq = new PriorityQueue<Node>(new Comparator<Node>() { @Override public int compare(Node a, Node b) { if (a.x < b.x) return -1; if (a.x > b.x) return 1; if (a.y > b.y) return -1; if (a.y < b.y) return 1; return a.val - b.val; } }); helper(root, 0, 0, pq); Node prev = null; List<List<Integer>> result = new ArrayList<>(); List<Integer> list = new ArrayList<>(); while (!pq.isEmpty()) { Node tmp = pq.poll(); if (prev != null && tmp.x != prev.x) { result.add(list); list = new ArrayList<>(); } list.add(tmp.val); prev = tmp; } //by comparing each element with its previous x to decide whether in the same array if (list.size() > 0) { result.add(list); } return result; } private void helper(TreeNode node, int x, int y, PriorityQueue<Node> pq) { if (node == null) { return; } pq.offer(new Node(x,y,node.val)); helper(node.left, x-1, y-1, pq); helper(node.right, x+1, y-1, pq); } }
[ "xil222@ucsd.edu" ]
xil222@ucsd.edu
49c69138a7c9ef588029860ee5e66f1a5e9e2cd2
39c1943490ac398b91b8ec11f3c34b2419bd2724
/lib/src/main/java/com/fuwafuwa/dependences/opengles/AnimateImageRender.java
c6ef1d28c002202c984db9bf7861b0724c9c2307
[ "Apache-2.0" ]
permissive
sunshengfei/workflow-corex
3fa6ffbece687f64d7a280c19044fe4390df95fe
0fab2e4a29cc2812d602df28b2c15bdfbe82bfc2
refs/heads/main
2023-04-01T00:07:38.620136
2021-04-01T04:20:03
2021-04-01T04:20:03
353,565,852
0
0
null
null
null
null
UTF-8
Java
false
false
1,767
java
package com.fuwafuwa.dependences.opengles; import android.opengl.GLES30; import android.opengl.GLSurfaceView; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; public class AnimateImageRender implements GLSurfaceView.Renderer { // 控件视图大小 protected int mViewWidth; protected int mViewHeight; @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { //初始化 GLES30.glDisable(GL10.GL_DITHER); //设置清屏(背景)颜色 : 透明 GLES30.glClearColor(0, 0, 0, 0); GLES30.glEnable(GL10.GL_CULL_FACE); GLES30.glEnable(GL10.GL_DEPTH_TEST); } @Override public void onSurfaceChanged(GL10 gl, int width, int height) { mViewWidth = width; mViewHeight = height; //设置视图大小 GLES30.glViewport(0, 0, width, height); } @Override public void onDrawFrame(GL10 gl) { //清屏 GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT); } final static String V_P = "attribute vec4 vPosition;\n" + "attribute vec2 vCoordinate;\n" + "uniform mat4 vMatrix;\n" + "\n" + "varying vec2 aCoordinate;\n" + "\n" + "void main(){\n" + " gl_Position=vMatrix*vPosition;\n" + " aCoordinate=vCoordinate;\n" + "}"; final static String F_P = "precision mediump float;\n" + "\n" + "uniform sampler2D vTexture;\n" + "varying vec2 aCoordinate;\n" + "\n" + "void main(){\n" + " gl_FragColor=texture2D(vTexture,aCoordinate);\n" + "}"; }
[ "gsiner@live.com" ]
gsiner@live.com
acc472d3b43cee5244dcda0861b07a3164d56c0d
41fc59140261f4ccd1225e710722ff3ff892b52e
/springApp/src/main/java/com/config/user2/UserService.java
7ed687a127384b033bcd4bfa0f126a5aafaaab22
[]
no_license
dldudgjs31/Spring
1ca89bd5344e9d45c60a8bb39575b0f8084962b8
047beceaea657fa5a3f550913c630bc0ccbf2706
refs/heads/main
2023-01-21T22:37:58.484442
2020-12-06T13:29:29
2020-12-06T13:29:29
315,158,703
0
0
null
null
null
null
UTF-8
Java
false
false
88
java
package com.config.user2; public interface UserService { public String message(); }
[ "dldudgjs31@naver.com" ]
dldudgjs31@naver.com
ef1ad83317ec67ef75389de9fad9de142e0c88c0
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.systemux-SystemUX/sources/com/oculus/panelapp/androiddialog/databinding/FilePreviewerDialogBinding.java
4d6f856d8fd22aa5ccd18e3718f15c3c70c4d720
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
3,097
java
package com.oculus.panelapp.androiddialog.databinding; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.databinding.Bindable; import androidx.databinding.DataBindingUtil; import androidx.databinding.ViewDataBinding; import com.oculus.panelapp.androiddialog.R; import com.oculus.panelapp.androiddialog.dialogs.filepreviewer.FilePreviewerDialog; import com.oculus.panelapp.androiddialog.dialogs.filepreviewer.FilePreviewerViewModel; public abstract class FilePreviewerDialogBinding extends ViewDataBinding { @NonNull public final FilePreviewerDialog filePreviewerDialog; @Bindable protected FilePreviewerViewModel mViewModel; @NonNull public final FilePreviewerPreviewBinding previewLayout; @NonNull public final FilePreviewerToolbarBinding previewToolbar; public abstract void setViewModel(@Nullable FilePreviewerViewModel filePreviewerViewModel); protected FilePreviewerDialogBinding(Object obj, View view, int i, FilePreviewerDialog filePreviewerDialog2, FilePreviewerPreviewBinding filePreviewerPreviewBinding, FilePreviewerToolbarBinding filePreviewerToolbarBinding) { super(obj, view, i); this.filePreviewerDialog = filePreviewerDialog2; this.previewLayout = filePreviewerPreviewBinding; setContainedBinding(this.previewLayout); this.previewToolbar = filePreviewerToolbarBinding; setContainedBinding(this.previewToolbar); } @Nullable public FilePreviewerViewModel getViewModel() { return this.mViewModel; } @NonNull public static FilePreviewerDialogBinding inflate(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, boolean z) { return inflate(layoutInflater, viewGroup, z, DataBindingUtil.getDefaultComponent()); } @NonNull @Deprecated public static FilePreviewerDialogBinding inflate(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, boolean z, @Nullable Object obj) { return (FilePreviewerDialogBinding) ViewDataBinding.inflateInternal(layoutInflater, R.layout.file_previewer_dialog, viewGroup, z, obj); } @NonNull public static FilePreviewerDialogBinding inflate(@NonNull LayoutInflater layoutInflater) { return inflate(layoutInflater, DataBindingUtil.getDefaultComponent()); } @NonNull @Deprecated public static FilePreviewerDialogBinding inflate(@NonNull LayoutInflater layoutInflater, @Nullable Object obj) { return (FilePreviewerDialogBinding) ViewDataBinding.inflateInternal(layoutInflater, R.layout.file_previewer_dialog, null, false, obj); } public static FilePreviewerDialogBinding bind(@NonNull View view) { return bind(view, DataBindingUtil.getDefaultComponent()); } @Deprecated public static FilePreviewerDialogBinding bind(@NonNull View view, @Nullable Object obj) { return (FilePreviewerDialogBinding) bind(obj, view, R.layout.file_previewer_dialog); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
bab8fdc56e0a8ffb18f5b1631d56b0ebcfd98037
86505462601eae6007bef6c9f0f4eeb9fcdd1e7b
/bin/platform/ext/processing/testsrc/de/hybris/platform/task/impl/TaskScriptingIntegrationTest.java
116b44424f2a5076f3737c01916ba9fc294599fc
[]
no_license
jp-developer0/hybrisTrail
82165c5b91352332a3d471b3414faee47bdb6cee
a0208ffee7fee5b7f83dd982e372276492ae83d4
refs/heads/master
2020-12-03T19:53:58.652431
2020-01-02T18:02:34
2020-01-02T18:02:34
231,430,332
0
4
null
2020-08-05T22:46:23
2020-01-02T17:39:15
null
UTF-8
Java
false
false
4,679
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.task.impl; import static org.fest.assertions.Assertions.assertThat; import de.hybris.bootstrap.annotations.IntegrationTest; import de.hybris.platform.servicelayer.ServicelayerBaseTest; import de.hybris.platform.servicelayer.model.ModelService; import de.hybris.platform.servicelayer.user.daos.TitleDao; import de.hybris.platform.task.TaskConditionModel; import de.hybris.platform.task.TaskService; import de.hybris.platform.task.model.ScriptingTaskModel; import de.hybris.platform.task.utils.NeedsTaskEngine; import de.hybris.platform.testframework.TestUtils; import de.hybris.platform.util.Config; import java.util.Collections; import javax.annotation.Resource; import org.junit.Before; import org.junit.Test; /** * Integration tests for task scripting */ @IntegrationTest @NeedsTaskEngine public class TaskScriptingIntegrationTest extends ServicelayerBaseTest { @Resource private TaskService taskService; @Resource private ModelService modelService; @Resource TitleDao titleDao; ScriptingTaskModel scriptingTaskForExistingScript; ScriptingTaskModel scriptingTaskForNotExistingScript; ScriptingTaskModel scriptingTaskForBadScript; private static final String CORRECT_TITLE = "CorrectGroovyTitle"; private static final String ERROR_TITLE = "ErrorGroovyTitle"; final double timeFactor = Math.max(15.0, Config.getDouble("platform.test.timefactor", 15.0)); @Before public void setUp() throws Exception { scriptingTaskForExistingScript = modelService.create(ScriptingTaskModel.class); scriptingTaskForExistingScript.setScriptURI("classpath://task/test/test-script-correct-task-interface.groovy"); scriptingTaskForNotExistingScript = modelService.create(ScriptingTaskModel.class); scriptingTaskForNotExistingScript.setScriptURI("model://myGroovyScriptDoesNotExist"); scriptingTaskForBadScript = modelService.create(ScriptingTaskModel.class); scriptingTaskForBadScript.setScriptURI("classpath://task/test/test-script-error-task-interface.groovy"); assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNull(); assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull(); assertThat(taskService.getEngine().isRunning()).isTrue(); } @Test public void testRunTaskForCorrectScript() throws Exception { taskService.scheduleTask(scriptingTaskForExistingScript); Thread.sleep((long) (1000 * timeFactor)); assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNotNull(); assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull(); } @Test public void testRunTaskForCorrectScriptEventBased() throws Exception { final TaskConditionModel condition = modelService.create(TaskConditionModel.class); condition.setUniqueID("MyEvent"); scriptingTaskForExistingScript.setConditions(Collections.singleton(condition)); taskService.scheduleTask(scriptingTaskForExistingScript); Thread.sleep((long) (1000 * timeFactor)); // not triggered yet - nothing happens assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNull(); assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull(); taskService.triggerEvent("MyEvent"); Thread.sleep((long) (1000 * timeFactor)); assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNotNull(); assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull(); } @Test public void testRunTaskForNonExistingScript() throws Exception { taskService.scheduleTask(scriptingTaskForNotExistingScript); Thread.sleep((long) (1000 * timeFactor)); // during script lookup - ScripNotFoundException is thrown but the task execution logic swallows it // This way the Exception is not visible inside the taskRunner (only error logs) assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNull(); assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull(); } @Test public void testRunTaskScriptThrowingException() throws Exception { TestUtils.disableFileAnalyzer( "de.hybris.platform.task.impl.TaskScriptingIntegrationTest.testRunTaskScriptThrowingException()"); try { taskService.scheduleTask(scriptingTaskForBadScript); Thread.sleep((long) (1000 * timeFactor)); assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNull(); assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNotNull(); } finally { TestUtils.enableFileAnalyzer(); } } }
[ "juan.gonzalez.working@gmail.com" ]
juan.gonzalez.working@gmail.com
30cc1c96beeed392756e4d41b477285fe50e11e8
7c8fc99147afff7c20a04cfee561eebfcd90c3de
/BarChartDemo/src/main/java/skinsenor/jcgf/com/barchartdemo/wy/Main2Activity.java
511a799e9dd060cdeff4b249baf27c08a18f1eec
[]
no_license
jsondroid/LoadLayoutDemo
3556601c3298106453d2ae98781bae79522b2da5
1b40ec3d02f1c45ce6bf0e6ddb27917c1b87db06
refs/heads/master
2021-05-06T03:43:17.582709
2017-12-20T10:24:40
2017-12-20T10:24:40
114,873,998
0
0
null
null
null
null
UTF-8
Java
false
false
4,238
java
package skinsenor.jcgf.com.barchartdemo.wy; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.Toast; import com.github.mikephil.charting.charts.LineChart; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import skinsenor.jcgf.com.barchartdemo.R; public class Main2Activity extends AppCompatActivity { RealtimeChartConfig realtimeChartConfig; private LineChart mChart; private ImageView imageview; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); mChart= (LineChart) findViewById(R.id.linechart); imageview= (ImageView) findViewById(R.id.imageview); realtimeChartConfig=new RealtimeChartConfig(this,mChart); realtimeChartConfig.initlineChart(); } private float x=0.1f; public void addEntry(View view){ // realtimeChartConfig.addEntry(x,(float) ((Math.random() * 40) + 30f)); // x=x+0.1f; imageview.setImageBitmap(getStorePic("id","img")); } public void clearValues(View view){ // mChart.clearValues(); // imageview.setImageBitmap(mChart.getChartBitmap()); storePic("id","img",mChart.getChartBitmap()); Toast.makeText(this, "Chart cleared!", Toast.LENGTH_SHORT).show(); } public void feedMultiple(View view){ feedMultiple(); } private Thread thread; private boolean b=false; private void feedMultiple() { if (thread != null) thread.interrupt(); final Runnable runnable = new Runnable() { @Override public void run() { float y=0; if(b){ y= (float) ((Math.random() * 40) + 30f); b=false; }else{ y= -(float) ((Math.random() * 40) + 30f); b=true; } realtimeChartConfig.addEntry(0,y); } }; thread = new Thread(new Runnable() { @Override public void run() { for (int i = 0; i < 1000; i++) { // Don't generate garbage runnables inside the loop. runOnUiThread(runnable); try { Thread.sleep(25); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }); thread.start(); } public void storePic(String tabid, String key, Bitmap bitmap) { if(tabid == null || key == null || tabid.isEmpty() || key.isEmpty() || bitmap == null) { return; } FileOutputStream fos = null; try { fos = this.openFileOutput(tabid + "_" + key, Context.MODE_PRIVATE); bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos); } catch (FileNotFoundException e) { Log.e("storePic", "storePic FileNotFoundException e = " +e); } finally { if(fos != null) { try { fos.flush(); fos.close(); } catch (IOException e) { Log.e("storePic", "storePic IOException e = " +e); } } } } public Bitmap getStorePic(String tabid, String key) { if(tabid == null || key == null || tabid.isEmpty() || key.isEmpty()) { return null; } FileInputStream fin = null; Bitmap bitmap = null; try { fin = openFileInput(tabid + "_" + key); bitmap = BitmapFactory.decodeStream(fin); } catch (FileNotFoundException e) { Log.e("storePic", "getStorePic FileNotFoundException e = " + e); } return bitmap; } }
[ "you@example.com" ]
you@example.com
72d1687a18315fcf001c57ec790dc7d0282bba86
8f8dabf9c3cb3b058a7db87015b8d1394acfaa17
/todayinformation/src/com/todayinfo/model/TextArticleItem.java
c40ccef9d70c645abed5e797b4c9df347fffa964
[]
no_license
zeke123/todayinformation
20e4727bd20bb677f9787e78b87c53d40577b1ae
5e2337be5a1ee50521e833b30548da9289f3f7dc
refs/heads/master
2021-04-15T15:05:07.869210
2016-06-03T02:43:05
2016-06-03T02:43:05
60,313,088
0
0
null
null
null
null
UTF-8
Java
false
false
2,103
java
package com.todayinfo.model; /** * 每一篇纯文字文章 * * @author zhou.ni 2015年5月20日 */ public class TextArticleItem extends SuperBean { /** * */ private static final long serialVersionUID = 1L; private String content; private String docid; private String title; private String docUrl; private String date; private String type;// 返回doc是普通文章浏览形式 返回pic是文章图片浏览形式 private String cid; // 收藏分类id,1为谍报收藏 2为生活收藏 3为图片收藏 private int isCollected; // 表示是否收藏,1为收藏,0为未收藏 public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getDocid() { return docid; } public void setDocid(String docid) { this.docid = docid; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDocUrl() { return docUrl; } public void setDocUrl(String docUrl) { this.docUrl = docUrl; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getCid() { return cid; } public void setCid(String cid) { this.cid = cid; } public int getIsCollected() { return isCollected; } public void setIsCollected(int isCollected) { this.isCollected = isCollected; } @Override public String toString() { return "TextArticleItem [content=" + content + ", docid=" + docid + ", title=" + title + ", docUrl=" + docUrl + ", date=" + date + ", type=" + type + ", cid=" + cid + ", isCollected=" + isCollected + "]"; } @Override public boolean equals(Object o) { if ( o instanceof TextArticleItem ) { TextArticleItem item = (TextArticleItem) o; return this.docid.equals(item.docid); } return super.equals(o); } }
[ "zekezhoujian@163.com" ]
zekezhoujian@163.com
5145637dcf17df96d45ce2de86ee7c32f4af0ec5
733b6ef2897799dd86e0bc06f06366fae373a2f6
/android/app/src/main/java/com/reduxchat/MainActivity.java
7079cc04f836451814835886a37affe759726f0b
[]
no_license
randytorres/ReactNative-ReduxChat
e76445f74b6ca5c78b6267bd92a6120d7401060f
d5d43aafdaca9b5fc76c75c9964d9e4f5c5fc4c4
refs/heads/master
2021-01-12T09:39:12.602640
2016-12-20T06:30:09
2016-12-20T06:30:09
76,217,244
2
0
null
null
null
null
UTF-8
Java
false
false
363
java
package com.reduxchat; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "ReduxChat"; } }
[ "torresr14@gmail.com" ]
torresr14@gmail.com
3e5104d3a2aba8c8f672b9622a9ad8c5c2f6f76e
f735cb990aeecc542c96b3aeeade2ad4a087bdb4
/IPJ/IPJ7_ImageProcessing/src/main/java/Process.java
15a9bcafc65bc76f62dc26612f40b8136ce838be
[]
no_license
lukaszkutylowski/learnJavaProgramming2019
062ed94b45a00a551f593b0e92f63866018d0352
bf7e8d8fc65c99643b634de8594ee7120923485a
refs/heads/master
2022-12-26T23:50:49.203851
2019-06-14T11:15:10
2019-06-14T11:15:10
168,341,085
0
0
null
2020-10-13T13:54:24
2019-01-30T12:41:59
Java
UTF-8
Java
false
false
2,943
java
import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; public class Process { public int[] convertImageToMatrix(String path) throws IOException { int matrix[] = new int[786432]; //read image File f = new File(path); BufferedImage img = ImageIO.read(f); //get image width and heigth int width = img.getWidth(); int heigth = img.getHeight(); //convert to matrix int i = 0; for (int y = 0; y < heigth; y++) { for (int x = 0; x < width; x++) { matrix[i] = img.getRGB(x, y); i++; } } return matrix; } public int[] toGrayScale(int[] matrix, String newPath, int width, int height, String fileFormat) throws IOException { BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); int blue, green, red, average; for (int j = 0; j < matrix.length; j++) { blue = matrix[j] & 0xff; green = (matrix[j] & 0xff00) >> 8; red = (matrix[j] & 0xff0000) >> 16; average = (blue + green + red) / 3; matrix[j] = (average<<16) | (average<<8) | average; } int z = 0; for(int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { image.setRGB(x, y, matrix[z]); z++; } } //show all RBG pixels for (int j = 350000; j < 350100; j++) { System.out.println(matrix[j]); } File outputPicture = new File(newPath); ImageIO.write(image, fileFormat, outputPicture); return matrix; } public void thresholding(int[] grayMatrix, String newPath, int width, int height, String fileFormat, int threshold) throws IOException { BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); int blue, green, red, average; for (int j = 0; j < grayMatrix.length; j++) { blue = grayMatrix[j] & 0xff; green = (grayMatrix[j] & 0xff00) >> 8; red = (grayMatrix[j] & 0xff0000) >> 16; average = (blue + green + red) / 3; if (average < threshold) { average = 0; } else { average = 255; } grayMatrix[j] = (average<<16) | (average<<8) | average; } int z = 0; for(int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { image.setRGB(x, y, grayMatrix[z]); z++; } } //show all RBG pixels for (int j = 350000; j < 350100; j++) { System.out.println(grayMatrix[j]); } File outputPicture = new File(newPath); ImageIO.write(image, fileFormat, outputPicture); } }
[ "kutylowski.lukasz.1@gmail.com" ]
kutylowski.lukasz.1@gmail.com
ab40cec4e5106019b8f736059a6ca41834d82160
3846a6f915ea6a718299c98aa15008c0739d2e29
/src/main/java/com/jrcx/ads/controller/MainController.java
cffebed571fa9c87c20980df82437eafbb0a44ae
[]
no_license
wdjxysc/ads
a02177f9dd559175edff2d731cd9654ef6aad862
ca3845aff58cedd9a37a78033bd4c443eb8b0370
refs/heads/master
2021-08-23T19:51:22.452017
2017-12-06T08:54:41
2017-12-06T08:54:41
111,989,826
0
0
null
null
null
null
UTF-8
Java
false
false
570
java
package com.jrcx.ads.controller; import com.jrcx.ads.interceptor.LoginCheckInterceptor; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.SessionAttribute; /** * @author Administrator. * @date 2017/12/1 */ @Controller public class MainController { // @RequestMapping("/index") // public String index() { // return "views/index.html"; // } }
[ "wdjxysc@163.com" ]
wdjxysc@163.com
c81367f8110052f2a8536c1d71c5f8fad18332e2
c83f250584db1b5acb47d792a2e54d40d10a096e
/src/com/record/collection/RecordServlet.java
7fea646206576e60182ff9f4a5e29e2a2e5d69b8
[]
no_license
acrosshistory/AlbumMachine
6f11169da960576a151ebdc06780c7ae984f88d4
76531e7d32f56699ca43e64281ca9ee6509573dc
refs/heads/master
2020-05-16T18:26:47.311938
2014-06-12T17:12:54
2014-06-12T17:12:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
764
java
package com.record.collection; import java.io.IOException; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/") public class RecordServlet extends HttpServlet { private static final long serialVersionUID = 1L; public RecordServlet(){ super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setAttribute("artist", "album"); request.setAttribute("now", new Date()); request.getRequestDispatcher("/WEB-INF/Record.jsp").forward(request, response); } }
[ "mvjensenphotography@gmail.com" ]
mvjensenphotography@gmail.com
bafe99f84d9523ced1be39e366632d0096b2e5e8
5b82764f924fdf38a48e5d5869a9599f05e66196
/TugasMAD1/app/src/main/java/com/example/tugasmad1/NasiGoreng.java
854baba3a613f276cf61d91a66ff47de21674492
[]
no_license
Shal-M/RestaurantCity
2581b84b7c1b6dd747bb0eabdcc290381291cccb
780a6ebc200251ce24681d0e5abb81fc1f1aa753
refs/heads/master
2020-07-28T17:28:49.015630
2019-09-23T15:46:30
2019-09-23T15:46:30
209,479,238
0
0
null
null
null
null
UTF-8
Java
false
false
816
java
package com.example.tugasmad1; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class NasiGoreng extends AppCompatActivity implements View.OnClickListener{ Button btnPesan; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_nasi_goreng); btnPesan = findViewById(R.id.btnPesan); btnPesan.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()){ case R.id.btnPesan: Toast.makeText(this, "Nasi Goreng telah dipesan", Toast.LENGTH_SHORT).show(); break; } } }
[ "faishal_ilkom@apps.ipb.ac.id" ]
faishal_ilkom@apps.ipb.ac.id
b4ed3e761e30a5e1ced3418d1c8b89c787a90ced
61e959a3921023b613037b7b81ce18bf272ddea5
/src/main/java/com/semantic/Model/BookResults.java
231870af6e6605632bfc9aa65f48eb4ec72b546a
[]
no_license
sahebjohar92/semantic-api
4268f95660202e06a1fb4ff4c0fe7e58557a6b2d
bd10e9ce91992f1fdd95dcbb5a9c3a5f4c6415cd
refs/heads/master
2020-04-02T02:53:47.521517
2018-10-20T18:11:51
2018-10-20T18:11:51
153,934,267
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package com.semantic.Model; import java.io.Serializable; import java.util.List; import java.util.Map; public class BookResults implements Serializable { List<Map<String, List<String>>> friendBookList; List<Map<String, List<String>>> allBookList; public List<Map<String, List<String>>> getFriendBookList() { return friendBookList; } public void setFriendBookList(List<Map<String, List<String>>> friendBookList) { this.friendBookList = friendBookList; } public List<Map<String, List<String>>> getAllBookList() { return allBookList; } public void setAllBookList(List<Map<String, List<String>>> allBookList) { this.allBookList = allBookList; } }
[ "sahebsingh10@gmail.com" ]
sahebsingh10@gmail.com
355d492c8a287e4be944a1cdaddb1c8dc8a2d5e7
dd553e6e17a3bcdc6e4723de56a28f41c45c3108
/androidimgprolibmaster/src/main/java/net/akhyar/android/imgpro/filters/XProcess.java
d1b178a2c5d4a5cea34463972d17a9a504527919
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
anashish/imagePic
6f0743a5592659e72f0b355bd57e368a134791da
96d12cd0864ed25f7a4144f7f0cc8a3d3b23020e
refs/heads/master
2021-01-20T03:14:25.603895
2017-04-26T18:36:14
2017-04-26T18:36:14
89,514,367
1
0
null
null
null
null
UTF-8
Java
false
false
277
java
package net.akhyar.android.imgpro.filters; import net.akhyar.android.imgpro.Filter; import android.graphics.Bitmap; public class XProcess extends Filter { @Override public void onBitmapSet(Bitmap bitmap) { } @Override public String getName() { return "X-Pro"; } }
[ "ashish.mishra1@tothenew.com" ]
ashish.mishra1@tothenew.com
62282ed45c17eccd99655b8e657bbc5182dd72ea
76f6ee4dea978b35b3effcda26f810073baffc5d
/IJPay-WxPay/src/main/java/com/ijpay/wxpay/enums/v2/ProfitSharingApiEnum.java
06abd5501c40510406c379c683a52a352a3e4f60
[ "Apache-2.0", "LicenseRef-scancode-mulanpsl-1.0-en", "MulanPSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Bears852/IJPay
b649971e6aa427b624949d7a58e4e232fd548d1b
3e0f61665746a62bea774e246641a4c9a4383614
refs/heads/master
2022-11-05T09:26:31.111720
2022-09-22T12:32:41
2022-09-22T12:32:41
250,148,830
0
0
NOASSERTION
2020-03-26T03:09:34
2020-03-26T03:09:33
null
UTF-8
Java
false
false
2,476
java
package com.ijpay.wxpay.enums.v2; import com.ijpay.wxpay.enums.WxApiEnum; /** * <p>IJPay 让支付触手可及,封装了微信支付、支付宝支付、银联支付常用的支付方式以及各种常用的接口。</p> * * <p>不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。 </p> * * <p>IJPay 交流群: 723992875</p> * <p>IJPay 自由交流群: 864988890</p> * * <p>Node.js 版: <a href="https://gitee.com/javen205/TNWX">Node.js 版</a></p> * * <p>微信支付 v2 版本-分账接口枚举</p> * * @author Javen */ public enum ProfitSharingApiEnum implements WxApiEnum { /** * 请求单次分账 */ PROFIT_SHARING("/secapi/pay/profitsharing", "请求单次分账"), /** * 请求多次分账 */ MULTI_PROFIT_SHARING("/secapi/pay/multiprofitsharing", "请求多次分账"), /** * 查询分账结果 */ PROFIT_SHARING_QUERY("/pay/profitsharingquery", "查询分账结果"), /** * 添加分账接收方 */ PROFIT_SHARING_ADD_RECEIVER("/pay/profitsharingaddreceiver", "添加分账接收方"), /** * 删除分账接收方 */ PROFIT_SHARING_REMOVE_RECEIVER("/pay/profitsharingremovereceiver", "删除分账接收方"), /** * 完结分账 */ PROFIT_SHARING_FINISH("/secapi/pay/profitsharingfinish", "完结分账"), /** * 查询订单待分账金额 */ PROFIT_SHARING_ORDER_AMOUNT_QUERY("/pay/profitsharingorderamountquery", "查询订单待分账金额"), /** * 分账回退 */ PROFIT_SHARING_RETURN("/secapi/pay/profitsharingreturn", "分账回退"), /** * 分账回退结果查询 */ PROFIT_SHARING_RETURN_QUERY("/pay/profitsharingreturnquery", "分账回退结果查询"), ; /** * 接口URL */ private final String url; /** * 接口描述 */ private final String desc; ProfitSharingApiEnum(String url, String desc) { this.url = url; this.desc = desc; } /** * 获取枚举URL * * @return 枚举编码 */ @Override public String getUrl() { return url; } /** * 获取详细的描述信息 * * @return 描述信息 */ @Override public String getDesc() { return desc; } @Override public String toString() { return url; } }
[ "javendev@126.com" ]
javendev@126.com
a3f2a1f375f0417155ded4ea8eb56f05c4bec8a5
799c885dfac9d6801bc25954e0fa029c72dd0f36
/src/chap06/excercise/PrinterEx.java
1ed902144df90441846ec138ca4575b4791f56eb
[]
no_license
dmswldi/20200929java
30dbe41a1321d4930a09b020e202d3111bf668aa
7166ac75faa8c5cd76a6052362054abc517e73b5
refs/heads/master
2023-01-23T08:25:04.734223
2020-12-03T10:58:56
2020-12-03T10:58:56
299,485,614
0
0
null
null
null
null
UTF-8
Java
false
false
277
java
package chap06.excercise; public class PrinterEx { // 16, 17 public static void main(String[] args) { // main 까먹지마 // Printer printer = new Printer(); Printer.println(10); Printer.println(true); Printer.println(5.7); Printer.println("홍길동"); } }
[ "eeeunzz20@gmail.com" ]
eeeunzz20@gmail.com
812c0238b0fde478f4cbc100d50c6e2f3ffb8d6c
a38405107709a958c16cfa1e3e9382968a280fd4
/app/src/main/java/com/example/wtl/mymusic/OnLineMusic/ChildernControl/Singer/Presenter/Adapter/SingerCountriesAdapter.java
2a6f38819b9efe261235f78b63c9db3d8085903b
[]
no_license
WeiTianLiang/MyMusic
67136ce563ed9fd10be5d9d4eca4498fd2b588d9
9aaf0c84d7d4973b8b9e434a964318426127ffa3
refs/heads/master
2020-03-25T06:18:00.394422
2018-08-04T03:19:01
2018-08-04T03:19:02
143,493,913
0
0
null
null
null
null
UTF-8
Java
false
false
3,489
java
package com.example.wtl.mymusic.OnLineMusic.ChildernControl.Singer.Presenter.Adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import com.example.wtl.mymusic.R; import java.util.ArrayList; import java.util.List; /** * 歌手城市适配器 * Created by WTL on 2018/6/21. */ public class SingerCountriesAdapter extends RecyclerView.Adapter<SingerCountriesAdapter.ViewHolder> { private List<String> stringList; private Context context; private List<Boolean> booleanlist = new ArrayList<>(); private OnGetCityLocat onGetCityLocat; public SingerCountriesAdapter(Context context, List<String> stringList) { this.context = context; this.stringList = stringList; for (int i = 0; i < stringList.size(); i++) { if (i == 0) { booleanlist.add(true); } else { booleanlist.add(false); } } } @Override public SingerCountriesAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(context).inflate(R.layout.textcarditem, null); ViewHolder viewHolder = new ViewHolder(view); return viewHolder; } @Override public void onBindViewHolder(final SingerCountriesAdapter.ViewHolder holder, final int position) { holder.text.setText(stringList.get(position)); if(booleanlist.get(position)) { holder.text.setTextColor(context.getResources().getColor(R.color.singerChange)); } else { holder.text.setTextColor(context.getResources().getColor(R.color.singerNo)); } holder.texttouch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { for (int i = 0; i < stringList.size(); i++) { booleanlist.set(i, false); } booleanlist.set(position, true); notifyDataSetChanged(); onGetCityLocat.getCityLocat(getLocat()); } }); } private String getLocat() { for(int i = 0 ; i < booleanlist.size() ; i++) { if(booleanlist.get(i)) { switch (i) { case 0: return "10"; case 1: return "20"; case 2: return "60"; case 3: return "70"; case 4: return "40"; default: return null; } } } return null; } @Override public int getItemCount() { return stringList.size(); } class ViewHolder extends RecyclerView.ViewHolder { TextView text; LinearLayout texttouch; public ViewHolder(View itemView) { super(itemView); text = itemView.findViewById(R.id.text); texttouch = itemView.findViewById(R.id.texttouch); } } public interface OnGetCityLocat { void getCityLocat(String p); } public void setOnGetCityLocat(OnGetCityLocat onGetCityLocat) { this.onGetCityLocat = onGetCityLocat; } }
[ "15291065925@163.com" ]
15291065925@163.com
0b5154fb8359acd8cdb20cf09b8ef30c21c31458
1ea4f8a4135d0ebdd6e94536c85d9978bb9ab534
/src/java/co/com/duck/behavior/MuteQuack.java
0ea8a40084f96fd72e39054f73dfcd3d181ee0d2
[]
no_license
csdavidg/StrategyPatternDucks
aee3a7f2f9c05d7d6382b4da693ababc0eeadecb
94d54a0b37e6bf5283306cb23dd7b29882adf0ae
refs/heads/master
2020-04-08T13:23:46.592887
2018-11-27T19:43:10
2018-11-27T19:43:10
159,389,141
0
0
null
null
null
null
UTF-8
Java
false
false
425
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 co.com.duck.behavior; import co.com.duck.interfaces.QuackBehavior; /** * * @author Usuario */ public class MuteQuack implements QuackBehavior { public void quack() { System.out.println(" << Silence >> "); } }
[ "csdavidg@hotmail.com" ]
csdavidg@hotmail.com
f8763897b9cbaa0ba771e61338a3fd989008c0d8
83dbd433aeed1f15f6501f39fe152abc0dc803d9
/imooc_study/imooc_seckill/src/main/java/com/bd/imooc/seckill/access/AccessLimit.java
c1add98103db40f82a5381bbb6d467c09a90bbac
[]
no_license
pylrichard/web_service_study
d0d42ea0c511b9b15a235a99cde5b4b025c33c6d
c1bd8753c6aee69c87707db7f3fb8e0d7f5ddbc0
refs/heads/master
2021-09-14T23:31:12.454640
2018-05-22T06:26:14
2018-05-22T06:26:14
104,879,563
1
0
null
null
null
null
UTF-8
Java
false
false
379
java
package com.bd.imooc.seckill.access; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Retention(RUNTIME) @Target(METHOD) public @interface AccessLimit { int seconds(); int maxCount(); boolean needLogin() default true; }
[ "pylrichard@qq.com" ]
pylrichard@qq.com
5a92ccbab27b9aa4f7d991c88919cd5b9bb04ebe
61c6164c22142c4369d525a0997b695875865e29
/SpiritTools/src/main/java/ImportarBasicosYdatClientes/automateImportTxtMySQL.java
6a5bc5be9aa03ac63c0c1cc97c563569f45b1aa2
[]
no_license
xruiz81/spirit-creacional
e5a6398df65ac8afa42be65886b283007d190eae
382ee7b1a6f63924b8eb895d4781576627dbb3e5
refs/heads/master
2016-09-05T14:19:24.440871
2014-11-10T17:12:34
2014-11-10T17:12:34
26,328,756
1
0
null
null
null
null
UTF-8
Java
false
false
7,998
java
package ImportarBasicosYdatClientes; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import java.sql.ResultSet; public class automateImportTxtMySQL { public static void main(String[] args) { DBase db = new DBase(); Connection conn = db.connect( "jdbc:mysql://localhost:3306/SPIRIT_UMA","root","master"); //"jdbc:mysql://192.168.100.9:3306/SPIRIT_UMA","desarrollo","desarrollo"); //******************LINUX***********************// //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/oficina.txt","OFICINA",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/departamento.txt","DEPARTAMENTO",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_empleado.txt","TIPO_EMPLEADO",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_contrato.txt","TIPO_CONTRATO",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/empleado.txt","EMPLEADO",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/linea.txt","LINEA",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/cuenta_bancaria.txt","CUENTA_BANCARIA",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_proveedor.txt","TIPO_PROVEEDOR",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_negocio.txt","TIPO_NEGOCIO",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/corporacion.txt","CORPORACION",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/cliente.txt","CLIENTE",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/cliente_oficina.txt","CLIENTE_OFICINA",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_cuenta.txt","TIPO_CUENTA",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_resultado.txt","TIPO_RESULTADO",false); //db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/cuenta.txt","CUENTA",false); // db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/familia_generico.txt","FAMILIA_GENERICO",false); // db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_producto.txt","TIPO_PRODUCTO",false); //db.importData(conn,"/usr/java/ejemploImportacionEmpresa.txt","EMPRESA",false); //******************WINDOWS***********************// //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//oficina.txt","OFICINA",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//departamento.txt","DEPARTAMENTO",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//tipo_empleado.txt","TIPO_EMPLEADO",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//tipo_contrato.txt","TIPO_CONTRATO",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//empleado.txt","EMPLEADO",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//linea.txt","LINEA",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//cuenta_bancaria.txt","CUENTA_BANCARIA",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//tipo_proveedor.txt","TIPO_PROVEEDOR",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//tipo_negocio.txt","TIPO_NEGOCIO",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//corporacion.txt","CORPORACION",false); //db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//cliente.txt","CLIENTE",false); // db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//cliente_oficina.txt","CLIENTE_OFICINA",false); db.importData(conn,"C://SQL_UMA//cuentas3.txt","CUENTA",false); } } class DBase { public DBase() { } public Connection connect(String db_connect_str, String db_userid, String db_password) { Connection conn; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); conn = DriverManager.getConnection(db_connect_str,db_userid, db_password); } catch(Exception e) { e.printStackTrace(); conn = null; } return conn; } public void importData(Connection conn,String filename,String tableName,boolean validar) { Statement stmt; String query; try { if(tableName.equals("CLIENTE")) { String[] args=null; ImportarClientes.main(args); } if(!validar){ stmt = conn.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); query = "LOAD DATA INFILE '"+filename+ //empresa //"' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,RUC,EMAIL_CONTADOR,RUC_CONTADOR);"; //oficina // "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID,CIUDAD_ID,DIRECCION,TELEFONO,FAX,PREIMPRESO_SERIE);"; //departamento // "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID);"; //tipo_empleado: // "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,VENDEDOR,EMPRESA_ID);"; //tipo_contrato // "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID);"; //empleado /* "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRES,APELLIDOS,TIPOIDENTIFICACION_ID ,IDENTIFICACION ,EMPRESA_ID ,PROFESION" + " ,DIRECCION_DOMICILIO ,TELEFONO_DOMICILIO ,CELULAR ,EMAIL_OFICINA,DEPARTAMENTO_ID,JEFE_ID,TIPOEMPLEADO_ID ," + "EXTENSION_OFICINA,NIVEL,ESTADO,OFICINA_ID,TIPOCONTRATO_ID );";*/ //linea // "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID,NIVEL,ACEPTAITEM);"; //cuenta_bancaria// //"' INTO TABLE "+tableName+";"; //tipo_proveedor// //"' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,TIPO,EMPRESA_ID);"; //tipo_negocio //"' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID);"; //corporacion// //"' INTO TABLE "+tableName+";"; //cliente// /* "'INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,TIPOIDENTIFICACION_ID,IDENTIFICACION,NOMBRE_LEGAL,RAZON_SOCIAL," + "REPRESENTANTE,CORPORACION_ID,FECHA_CREACION,ESTADO,TIPOCLIENTE_ID,TIPOPROVEEDOR_ID," + "TIPONEGOCIO_ID,OBSERVACION,USUARIOFINAL,CONTRIBUYENTE_ESPECIAL,TIPO_PERSONA,LLEVA_CONTABILIDAD);"; */ //cliente_oficina// /*"'INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,CLIENTE_ID,CIUDAD_ID,DIRECCION," + "TELEFONO,FAX,EMAIL,FECHA_CREACION,MONTO_CREDITO,MONTO_GARANTIA,CALIFICACION," + "OBSERVACION,ESTADO,DESCRIPCION);";*/ //CUENTA// "'INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,PLANCUENTA_ID,CODIGO,NOMBRE,NOMBRE_CORTO,TIPOCUENTA_ID," + "PADRE_ID,RELACIONADA,IMPUTABLE,NIVEL,TIPORESULTADO_ID,EFECTIVO,ACTIVOFIJO,DEPARTAMENTO,LINEA," + "EMPLEADO,CENTROGASTO,CLIENTE,GASTO,ESTADO,CUENTA_BANCO);"; //FAMILIA GENERICO, TIPO PRODUCTO, /*"' INTO TABLE "+tableName+";";*/ stmt.executeUpdate(query); } } catch(Exception e) { e.printStackTrace(); stmt = null; } } };
[ "xruiz@creacional.com" ]
xruiz@creacional.com
4c8fd88b93a9135f70293462e5ac75497d4a7dbb
4df3e7dbfde7f886d4d232a0d06309d58a4aff3b
/src/main/java/org/jbpm/ee/config/ConfigurationFactory.java
0a748b3470f8916c5e7921cf67c05abc7e15a371
[]
no_license
jtian30/jbpm-ee
4905ea3cde99f29aabbc0c7b8f8781c2bc088ff9
f021f8ad23a1884388e71419b79d0e09fbf2d38a
refs/heads/master
2021-01-21T03:45:17.885918
2013-11-08T18:31:55
2013-11-08T18:31:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,219
java
package org.jbpm.ee.config; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Produces; import javax.enterprise.inject.spi.InjectionPoint; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @ApplicationScoped public class ConfigurationFactory { private static final String ENVIRONMENT_NAME_KEY = "environment.name"; private static final String DEFAULT_PROPS_FILENAME = "environment.properties"; private static final String PROPS_FILENAME_FORMAT = "environment_%s.properties"; private Properties environmentProps; private static final Logger LOG = LoggerFactory.getLogger(ConfigurationFactory.class); @PostConstruct public void initEnvironmentProps() throws IOException { environmentProps = new Properties(); String propsFilename = DEFAULT_PROPS_FILENAME; String environmentName = System.getProperty(ENVIRONMENT_NAME_KEY); if (environmentName != null) { propsFilename = String.format(PROPS_FILENAME_FORMAT, environmentName); } InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propsFilename); if (inputStream == null) { throw new FileNotFoundException("Properties file for environment " + environmentName + " not found in the classpath: " + propsFilename); } environmentProps.load(inputStream); LOG.info("Reading Parameters:"); } @Produces @Configuration public String getConfigValueAsString(InjectionPoint ip) { Configuration config = ip.getAnnotated().getAnnotation(Configuration.class); String configKey = config.value(); if (configKey.isEmpty()) { throw new IllegalArgumentException("Properties value key is required."); } return environmentProps.getProperty(configKey); } @Produces @Configuration public Long getConfigValueAsLong(InjectionPoint ip) { String configValue = getConfigValueAsString(ip); return Long.valueOf(configValue); } }
[ "abaxter@redhat.com" ]
abaxter@redhat.com
ca8ec9653fbd935df98e6091cce9c68486774c3b
734323871b3a3b07f10c3cb60824b37a94bd3715
/testGit/src/sample/Sub.java
7e5576bb0f84932625a9f3002fd997ed6078214c
[]
no_license
amimiyazaki/javabase
1889c574756f5e98a8ff16e69e46363ade0f458a
f917e46736863fcf7301b1f0e2a2d4757e3f5924
refs/heads/master
2022-11-21T01:20:34.468621
2020-07-16T04:19:05
2020-07-16T04:19:05
280,010,355
0
0
null
2020-07-16T04:19:06
2020-07-16T00:09:27
Java
UTF-8
Java
false
false
113
java
package sample; public class Sub { public void msg() { System.out.println("繋がったね!"); } }
[ "ami.miyazaki31@gmail.com" ]
ami.miyazaki31@gmail.com
99f4dfda996b92fa696bf291a49545d45128c2d5
b4e306eaa86db3aa11132433ee6ad7fa6464db7b
/project-test/src14/main/java/bitcamp/java106/pms/controller/BoardController.java
268720642db9641ac1712b97a28861d24d81225e
[]
no_license
donhee/test
b00279dde77ff5e7482e7a018efe91ff54d4f677
897f301a557325932afc0e4cd19e33f103d74dae
refs/heads/master
2021-07-01T00:13:06.085468
2020-09-10T13:26:18
2020-09-10T13:26:18
154,077,010
0
0
null
null
null
null
UTF-8
Java
false
false
4,214
java
package bitcamp.java106.pms.controller; import java.sql.Date; import java.util.Scanner; import bitcamp.java106.pms.dao.BoardDao; import bitcamp.java106.pms.domain.Board; import bitcamp.java106.pms.util.Console; public class BoardController { // 이 클래스를 사용하기 전에 App 클래스에서 준비한 Scanner 객체를 // keyScan 변수에 저장하라! Scanner keyScan; BoardDao boardDao = new BoardDao(); public BoardController(Scanner scanner) { this.keyScan = scanner; } public void service(String menu, String option) { if (menu.equals("board/add")) { this.onBoardAdd(); } else if (menu.equals("board/list")) { this.onBoardList(); } else if (menu.equals("board/view")) { this.onBoardView(option); } else if (menu.equals("board/update")) { this.onBoardUpdate(option); } else if (menu.equals("board/delete")) { this.onBoardDelete(option); } else { System.out.println("명령어가 올바르지 않습니다."); } } void onBoardAdd() { System.out.println("[게시물 입력]"); Board board = new Board(); System.out.print("제목? "); board.title = keyScan.nextLine(); System.out.print("내용? "); board.content = keyScan.nextLine(); System.out.print("등록일? "); board.createDate = Date.valueOf(keyScan.nextLine()); boardDao.insert(board); } void onBoardList() { System.out.println("[게시물 목록]"); Board[] list = boardDao.list(); for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; System.out.printf("%d, %s, %s\n", i, list[i].title, list[i].createDate); } } void onBoardView(String option) { System.out.println("[게시물 조회]"); if (option == null) { System.out.println("번호를 입력하시기 바랍니다."); return; } Board board = boardDao.get(Integer.parseInt(option)); if (board == null) { System.out.println("해당 게시물 번호가 없습니다."); } else { System.out.printf("제목: %s\n", board.title); System.out.printf("내용: %s\n", board.content); System.out.printf("시작일: %s\n", board.createDate); } } void onBoardUpdate(String option) { System.out.println("[게시물 변경]"); if (option == null) { System.out.println("번호를 입력하시기 바랍니다."); return; } Board board = boardDao.get(Integer.parseInt(option)); // Board board = boards[1]; if (board == null) { System.out.println("해당 게시물 번호가 없습니다."); } else { Board updateBoard = new Board(); System.out.printf("제목(%s)? ", board.title); updateBoard.title = keyScan.nextLine(); System.out.printf("내용(%s)? ", board.content); updateBoard.content = keyScan.nextLine(); System.out.printf("시작일(%s)? ", board.createDate); updateBoard.createDate = Date.valueOf(keyScan.nextLine()); updateBoard.no = board.no; boardDao.update(updateBoard); System.out.println("변경하였습니다."); } } void onBoardDelete(String option) { System.out.println("[게시물 삭제]"); if (option == null) { System.out.println("번호를 입력하시기 바랍니다."); return; } int i = Integer.parseInt(option); Board board = boardDao.get(i); if (board == null) { System.out.println("해당 게시물이 없습니다."); } else { if (Console.confirm("정말 삭제하시겠습니까?")) { boardDao.delete(i); System.out.println("삭제하였습니다."); } } } }
[ "231313do@gmail.com" ]
231313do@gmail.com
004a92212127f1c2c1a1572d92a4a761146d6b0f
a1b7a3a9bc9bcd637e9e12044c502eb03ddf46af
/app/src/main/java/com/example/taks/presenters/LoginView.java
6429bcfbbd8a65d7e72931fd33c3fa42e18b09d0
[]
no_license
ahmedmohamedkhedr/task
c4c2b7ce1ef5dd12dff06b6af7ae7201d08e3db0
eb262a429e5e9fe937107d20edee4e62e563b9ac
refs/heads/master
2022-04-21T10:38:24.256468
2020-04-24T00:59:02
2020-04-24T00:59:02
256,852,625
0
0
null
null
null
null
UTF-8
Java
false
false
240
java
package com.example.taks.presenters; import com.example.taks.models.ApiResponse; public interface LoginView { void onLogin(String errorMessage , ApiResponse response); void onLogout(String message); void onClickDashboard(); }
[ "mkhedr6@gmail.com" ]
mkhedr6@gmail.com
27e3307101efdba633701315fd20b24b44b03a52
23c050fb9c170979923a28bca78e01520131672f
/src/main/java/ari/nuryadi/testingbackend/entity/model/Challenge.java
a7b661e41b919f89cf9a197ab921609832023d7f
[]
no_license
anuryadi/testing-backend
8bb111a11a441812310103712604f75a35acaf17
1ef5237906d1161a3219b6bee3b997513b67500c
refs/heads/main
2023-08-01T06:37:56.914600
2021-09-15T10:08:04
2021-09-15T10:08:04
406,373,277
0
0
null
null
null
null
UTF-8
Java
false
false
616
java
package ari.nuryadi.testingbackend.entity.model; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import javax.persistence.*; import java.util.HashSet; import java.util.List; import java.util.Set; @Entity @Table(name = "challenge") @Data public class Challenge { @Id private Long id; private String judul; private String deskripsi; private Integer point; private String kriteria; // @JsonIgnore // @OneToMany(targetEntity = DetailChallenge.class, mappedBy = "challenge", fetch = FetchType.LAZY) // private List<DetailChallenge> detailChallengeList; }
[ "nuryadiari8@gmail.com" ]
nuryadiari8@gmail.com
667fd33efe7e6b5377a588b821e4554de8774ed6
78bab54f3a2155dd82f2a9c25c6bfa153d1160e9
/app/src/main/java/com/example/myapplication/util/LoadingDialog.java
efe63ee3a6b38de2ecb7359f4f36ba20571bcb89
[]
no_license
TsilvaLeite/FirebaseApp
51ddc5ce87ecb067e24e78384ec6849eb3ef81ea
a0f184b5e26fa2326d5f700266adbb17f55e54e2
refs/heads/main
2023-06-09T21:59:20.287025
2021-07-01T01:33:32
2021-07-01T01:33:32
377,315,138
0
0
null
null
null
null
UTF-8
Java
false
false
844
java
package com.example.myapplication.util; import android.app.Activity; import android.app.AlertDialog; import android.view.LayoutInflater; public class LoadingDialog { private Activity activity; private AlertDialog dialog; private int layoutId; public LoadingDialog(Activity activity, int layoutId){ // Layout -> R.layout.custom_dialog.xml this.activity = activity; this.layoutId = layoutId; } public void startLoadingDialog(){ AlertDialog.Builder builder = new AlertDialog.Builder(activity); LayoutInflater inflater = activity.getLayoutInflater(); builder.setView(inflater.inflate(layoutId, null)); builder.setCancelable(false); dialog = builder.create(); dialog.show(); } public void dismissDialog(){ dialog.dismiss(); } }
[ "Aluno" ]
Aluno
68e8d25fb1863dffe8b8969d5714eb807aafd49c
2c316aa87b3f0d04ccd82d2831dd56b0ac4c773a
/src/main/java/fr/unice/polytech/cpo/leroux/Launch.java
981e14ba4192f717d8bd675099a06932a2048f46
[]
no_license
bennour/EstimationRecursive
6534ec6700d00f65e8daf572d11ad391fd33a327
b4ee60c5c236b2c65b8c30dee0958ac1059d1479
refs/heads/master
2020-12-24T16:05:54.881192
2015-05-23T13:31:46
2015-05-23T13:31:46
33,547,889
0
0
null
null
null
null
UTF-8
Java
false
false
2,597
java
package fr.unice.polytech.cpo.leroux; import org.jblas.DoubleMatrix; import org.jfree.ui.RefineryUtilities; public class Launch { public static void main(String[] args) { System.out.println("******************************************************"); System.out.println("**** SANS BRUIT ****"); System.out.println("******************************************************"); launch(false); System.out.println("\n\n"); System.out.println("******************************************************"); System.out.println("**** AVEC BRUIT ****"); System.out.println("******************************************************"); launch(true); } public static void launch(boolean bruit) { Observateur observeur = new Observateur(20, 20, 0.2, 50, bruit); Mobile mobile = new Mobile(10, 10, 2, 2.5); Simulateur simulateur = new Simulateur(20, observeur, mobile); System.out.println("Angles entre l'observeur et le mobile aux temps t :"); for(int i = 0; i < simulateur.getAngles().length; i++) { System.out.println("theta(" + i + ") : " + simulateur.getAngles()[i] + " rad = " + enDegrees(simulateur.getAngles()[i]) + "°"); } String titre = "Simulation " + (bruit ? "avec" : "sans") + " bruit"; Vue demo = new Vue(titre, observeur.positions, mobile.positions); demo.pack(); RefineryUtilities.centerFrameOnScreen(demo); demo.setVisible(true); System.out.println("\n*************** Resolution *****************\n"); simulateur.resolutionParametres(Resolution.Methode.GRADIANT_CONJUGUE); System.out.println("\nPar la methode du gradiant conjugue : "); System.out.println(simulateur.toString()); simulateur.resolutionParametres(Resolution.Methode.MOINDRES_CARRES); System.out.println("\nPar la methode des moindres carees : "); System.out.println(simulateur.toString()); simulateur.resolutionParametres(Resolution.Methode.INVERSE); System.out.println("\nPar la methode inverse : "); System.out.println(simulateur.toString()); System.out.println("\n*************** Matrices *****************\n"); System.out.println("A\n" + printMatrix(simulateur.getA())); System.out.println("B\n" + printMatrix(simulateur.getB())); } public static String printMatrix(DoubleMatrix m) { String str = ""; for(int i = 0; i < m.rows; i++) { str += "| "; for(int j = 0; j < m.columns; j++) str += m.get(i, j) + " "; str += " |\n"; } return str; } public static int enDegrees(double radian) { return (int) (radian * 180 / Math.PI); } }
[ "amir.benslimane@gmail.com" ]
amir.benslimane@gmail.com
cdfb7a01797b25cb47517a14f37a26725c7d14aa
8eb0fce25ca09f60b594d9940538fcc721671374
/src/atps_programacaoconcorrente/Consumer.java
4025fda7ee0f6fcb1ef9365ec146c3de58150922
[]
no_license
gvsrepins/ATPS_ProducerConsumer
bf320abde4d02c4dba1f589c92a001f86413d4b5
da60496c59a9fca751d1bb27985a5b9830c94fce
refs/heads/master
2020-05-16T23:42:51.730571
2012-05-29T01:55:24
2012-05-29T01:55:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,805
java
package atps_programacaoconcorrente; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; /** * * @author gvsrepins */ public class Consumer extends Thread implements Runnable { private Buffer buffer; private int countConsumedItens = 0; public Consumer(String str) { super(str); this.buffer = Buffer.getInstance(); } public void run() { int item; do { try { item = this.buffer.get(); } catch (InterruptedException e) { return; } //sets a dateFormat DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); //get current date time and past to a String Date dateBegin = new Date(); String begin = dateFormat.format(dateBegin); try { Thread.sleep(5000); // sleep for a randomly chosen time } catch (InterruptedException e) { return; } //wait producer finish while (this.buffer.isEmpty()) { try { System.out.print("Consumer waiting... \n"); Thread.sleep(100); } catch (InterruptedException e) { return; } } String line = "\n" + "-----------------------------------------------------" + "\n"; String bufferUsed = "\nBuffer used: " + this.buffer.container.size(); //get current date time and past to a String Date dateEnd = new Date(); String end = dateFormat.format(dateEnd); String strConsumedCount = "\nConsumed: " + (++this.buffer.consumedCount); System.out.print("Consumer" + " got... " + (item) + " From: " + begin + "." + " To: " + end + bufferUsed + strConsumedCount + line); } while (!this.buffer.isEmpty()); } }
[ "gvsrepins@gmail.com" ]
gvsrepins@gmail.com
2eb77910bf1ee3442559243902c0350f054d58ec
886ac0f8758785ba80ed1c46a94e296a070c9e69
/仿网易新闻v4.4侧滑菜单/gen/com/example/netease/BuildConfig.java
deae1cf5724c9ea5831db97ee94d12b32c310255
[]
no_license
L-value/magic
a1cf693e5b2a669c03f8bd0390bfba9a94717e80
a7e4a61253efa3269bcc9fb908db01cc997c81dc
refs/heads/master
2016-09-14T12:56:40.396166
2016-05-04T06:56:47
2016-05-04T06:56:47
58,029,571
0
0
null
null
null
null
UTF-8
Java
false
false
161
java
/** Automatically generated file. DO NOT MODIFY */ package com.example.netease; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "icysmile@vip.qq.com" ]
icysmile@vip.qq.com
a4ea3170ac45a890c10a9be251456396153112bb
55962423ac115dc765ac2df56457e75e917477a6
/src/main/java/com/itwx/druid/servlet/DruidStatServlet.java
95d27557a33ad814c6f3fa31e86fef89d4a89e6b
[ "Apache-2.0" ]
permissive
baixiaofei1002/springboot
cc1ef43810ecb414d9978336c78684663fb0824c
9e9594a77b99f3dab523aa8ac721cbcdd992433d
refs/heads/master
2022-07-04T03:43:46.995153
2019-11-27T01:08:38
2019-11-27T01:08:38
224,162,012
0
0
Apache-2.0
2022-06-21T02:19:14
2019-11-26T10:16:20
Java
UTF-8
Java
false
false
802
java
package com.itwx.druid.servlet; import com.alibaba.druid.support.http.StatViewServlet; import javax.servlet.annotation.WebInitParam; import javax.servlet.annotation.WebServlet; /** * @Author:wx * @Date:2019/2/13 11:12 * 监控视图配置 */ @WebServlet(urlPatterns = "/druid/*",initParams = { @WebInitParam(name="allow",value = ""),//IP白名单(没有设置或者为空,则允许所有访问) @WebInitParam(name="deny",value = "192.168.16.111"),//IP黑名单(存在时,deny优于allow) @WebInitParam(name="loginUsername",value = "zhuyunlong"), @WebInitParam(name="loginPassword",value = "123456"), @WebInitParam(name="resetEnable",value = "true")//禁用HTML页面上的Reset All }) public class DruidStatServlet extends StatViewServlet { }
[ "1114334327@qq.com" ]
1114334327@qq.com
d64d3cac1fac50e2b292e35d8de0e633376acc07
841cce8ec740a5cc31db980b673c2ccf245a779b
/src/main/java/microservicelearning/bootstrap/UserInitializationRunner.java
04947179e1d2a1eee65e1831cd059836c8be3493
[]
no_license
ahadahmed/microservice-junit-testing
789cd1378c10f1bf2827fd5f7a82136e6aaaf4fd
d9c4d1c3b29cbc32dc100892b4e778c547b9d15c
refs/heads/master
2020-08-08T20:17:43.037614
2019-10-09T12:08:57
2019-10-09T12:08:57
213,908,319
0
0
null
null
null
null
UTF-8
Java
false
false
1,225
java
package microservicelearning.bootstrap; import microservicelearning.domain.Users; import microservicelearning.repository.UsersRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @Component @Profile("dev") public class UserInitializationRunner implements CommandLineRunner { @Autowired private UsersRepository usersRepository; @Override @Profile("dev") public void run(String... args) throws Exception { Users user = new Users(); user.setUserName("test1"); user.setUserMail("test@testmail.com"); user.setCreateDate(LocalDateTime.now()); Users user1 = new Users(); user1.setUserName("test2"); user1.setUserMail("test2@testmail.com"); user1.setCreateDate(LocalDateTime.now()); List<Users> usersList = new ArrayList<>(); usersList.add(user); usersList.add(user1); // usersRepository.save(user); usersRepository.saveAll(usersList); } }
[ "ahad@surecash.net" ]
ahad@surecash.net
fa131aa2ef2a70e9efb15afe5a8032c03935f455
d5488dbb177594800f9c7d6871b87d348755ff30
/so-iot-resources/src/main/java/com/pineone/icbms/so/iot/resources/vo/IDevice.java
8e0f6712d9449c549a4498f9f2fc8553f647a4a4
[ "BSD-2-Clause" ]
permissive
existmaster-sub/SO
5e848054243c15e2b83274d38620f1d53473ae84
d415493867c455e93dadbd82f800cc788a17ffe6
refs/heads/master
2021-01-18T10:38:47.731926
2016-02-02T05:56:45
2016-02-02T05:56:45
50,897,914
0
0
null
2016-02-02T05:56:02
2016-02-02T05:56:01
null
UTF-8
Java
false
false
249
java
package com.pineone.icbms.so.iot.resources.vo; import com.pineone.icbms.so.resources.vo.IVirtualObject; /** * Device interface.<BR/> * Created by uni4love on 2015. 08. 17.. */ public interface IDevice extends IVirtualObject<String, String> { }
[ "existmaster@naver.com" ]
existmaster@naver.com
77fa2809b399f40aaeff35dbed3258db3cafb530
612b1b7f5201f3ff1a550b09c96218053e195519
/modules/global/src/com/haulmont/cuba/core/sys/jpql/QueryBuilder.java
ae6ace5aca9de5cd6e9ca7071a3facd773d4d0ef
[ "Apache-2.0" ]
permissive
cuba-platform/cuba
ffb83fe0b089056e8da11d96a40c596d8871d832
36e0c73d4e3b06f700173c4bc49c113838c1690b
refs/heads/master
2023-06-24T02:03:12.525885
2023-06-19T14:13:06
2023-06-19T14:13:06
54,624,511
1,434
303
Apache-2.0
2023-08-31T18:57:38
2016-03-24T07:55:56
Java
UTF-8
Java
false
false
1,573
java
/* * Copyright (c) 2008-2016 Haulmont. * * 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.haulmont.cuba.core.sys.jpql; public class QueryBuilder { private StringBuilder sb = new StringBuilder(); public void appendSpace() { if (sb.length() != 0 && sb.charAt(sb.length() - 1) != ' ') sb.append(' '); } public void appendChar(char c) { if (sb.length() != 0 && getLast() == ' ' && (c == ' ' || c == ')' || c == ',')) { deleteLast(); } sb.append(c); } public void appendString(String s) { if (s != null) { if (sb.length() != 0 && getLast() == ' ' && (s.charAt(0) == ' ' || s.charAt(0) == ')' || s.charAt(0) == ',')) { deleteLast(); } sb.append(s); } } public char getLast() { return sb.charAt(sb.length() - 1); } public void deleteLast() { sb.deleteCharAt(sb.length() - 1); } @Override public String toString() { return sb.toString(); } }
[ "artamonov@haulmont.com" ]
artamonov@haulmont.com
4641607d7d1b3f950bf8e617bf98c1b658fdcd2f
8ceaf1235b207d21cec84d73b6f1d1b5fbd584ca
/cloud+/src/main/java/com/cloudrail/fileviewer/Home.java
b3ee915b985f8c376e6c519360315d987f8cf3a7
[]
no_license
rushikeshdixit/Cloudplus-Android
54fd1f0b28296080b70f31c9ab3f9194cb1e96d3
827218cba6ff4c7766fa56b670ece246564922ce
refs/heads/master
2021-06-16T04:53:52.907086
2017-02-13T05:01:19
2017-02-13T05:01:19
81,772,786
1
0
null
null
null
null
UTF-8
Java
false
false
1,558
java
package com.cloudrail.fileviewer; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.app.Fragment; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.TextView; //On clicking Home it will display file explorer containing files from all the storages /** * A simple {@link Fragment} subclass. * to handle interaction events. * Use the {@link Home#newInstance} factory method to * create an instance of this fragment. */ public class Home extends Fragment { public Home() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @return A new instance of fragment Home. */ public static Home newInstance() { return new Home(); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_home, container, false); TextView tv = (TextView) v.findViewById(R.id.link); tv.setMovementMethod(LinkMovementMethod.getInstance()); return v; } @Override public void onDetach() { super.onDetach(); } }
[ "Rushi@Rushikesh.local" ]
Rushi@Rushikesh.local
3fc79477a61067b5bf3f2397a800aacc37a00d11
75950d61f2e7517f3fe4c32f0109b203d41466bf
/modules/tags/fabric3-modules-parent-pom-1.9.5/kernel/api/fabric3-spi/src/main/java/org/fabric3/spi/security/BasicSecuritySubject.java
3c4abd946a859d4b77ff65465d32ec9a3f280244
[]
no_license
codehaus/fabric3
3677d558dca066fb58845db5b0ad73d951acf880
491ff9ddaff6cb47cbb4452e4ddbf715314cd340
refs/heads/master
2023-07-20T00:34:33.992727
2012-10-31T16:32:19
2012-10-31T16:32:19
36,338,853
0
0
null
null
null
null
UTF-8
Java
false
false
3,430
java
/* * Fabric3 * Copyright (c) 2009-2012 Metaform Systems * * Fabric3 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, with the * following exception: * * Linking this software statically or dynamically with other * modules is making a combined work based on this software. * Thus, the terms and conditions of the GNU General Public * License cover the whole combination. * * As a special exception, the copyright holders of this software * give you permission to link this software with independent * modules to produce an executable, regardless of the license * terms of these independent modules, and to copy and distribute * the resulting executable under terms of your choice, provided * that you also meet, for each linked independent module, the * terms and conditions of the license of that module. An * independent module is a module which is not derived from or * based on this software. If you modify this software, you may * extend this exception to your version of the software, but * you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * * Fabric3 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 Fabric3. * If not, see <http://www.gnu.org/licenses/>. */ package org.fabric3.spi.security; import java.security.Principal; import java.util.Collections; import java.util.HashSet; import java.util.Set; import javax.security.auth.Subject; import org.fabric3.api.Role; import org.fabric3.api.SecuritySubject; /** * SecuritySubject for the Fabric3 basic security implementation. * * @version $Rev$ $Date$ */ public class BasicSecuritySubject implements SecuritySubject, Principal { private String username; private String password; private Set<Role> roles; private Subject jaasSubject; public BasicSecuritySubject(String username, String password, Set<Role> roles) { this.username = username; this.password = password; this.roles = roles; Set<Principal> principals = new HashSet<Principal>(roles); principals.add(this); jaasSubject = new Subject(true, principals, Collections.emptySet(), Collections.emptySet()); } public String getUsername() { return username; } public String getPassword() { return password; } public Set<Role> getRoles() { return roles; } @SuppressWarnings({"SuspiciousMethodCalls"}) public boolean hasRole(String name) { return roles.contains(new Role(name)); } public <T> T getDelegate(Class<T> type) { if (!BasicSecuritySubject.class.equals(type)) { throw new IllegalArgumentException("Unknown delegate type: " + type); } return type.cast(this); } public Subject getJaasSubject() { return jaasSubject; } public String getName() { return username; } @Override public String toString() { return username; } }
[ "jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf" ]
jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf
8a0d218d849a03e159a6055841dbf1d1673fa59b
cc1dfea595bf1b5cbc4a04cab0d7566002f5d759
/build/tmp/expandedArchives/forge-1.16.5-36.2.0_mapped_snapshot_20201028-1.16.3-sources.jar_01b4d1c8f834534ca7e6dc7b4d669b38/net/minecraft/client/gui/recipebook/RecipeWidget.java
a165f66a29849810f6cd0244054c376ae481a50b
[]
no_license
N-Wither/OmniworldEssentials
7d4527bac7eddc471f45957cbd0adf5c7d4ebefa
9abf6cdf6fbca53ca07f2b51b271b1f38f586a9e
refs/heads/main
2023-07-15T02:24:06.154413
2021-08-29T08:57:59
2021-08-29T08:57:59
400,991,514
0
0
null
null
null
null
UTF-8
Java
false
false
4,959
java
package net.minecraft.client.gui.recipebook; import com.google.common.collect.Lists; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.Widget; import net.minecraft.inventory.container.RecipeBookContainer; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.RecipeBook; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class RecipeWidget extends Widget { private static final ResourceLocation RECIPE_BOOK = new ResourceLocation("textures/gui/recipe_book.png"); private static final ITextComponent field_243412_b = new TranslationTextComponent("gui.recipebook.moreRecipes"); private RecipeBookContainer<?> field_203401_p; private RecipeBook book; private RecipeList list; private float time; private float animationTime; private int currentIndex; public RecipeWidget() { super(0, 0, 25, 25, StringTextComponent.EMPTY); } public void func_203400_a(RecipeList p_203400_1_, RecipeBookPage p_203400_2_) { this.list = p_203400_1_; this.field_203401_p = (RecipeBookContainer)p_203400_2_.func_203411_d().player.openContainer; this.book = p_203400_2_.func_203412_e(); List<IRecipe<?>> list = p_203400_1_.getRecipes(this.book.func_242141_a(this.field_203401_p)); for(IRecipe<?> irecipe : list) { if (this.book.isNew(irecipe)) { p_203400_2_.recipesShown(list); this.animationTime = 15.0F; break; } } } public RecipeList getList() { return this.list; } public void setPosition(int p_191770_1_, int p_191770_2_) { this.x = p_191770_1_; this.y = p_191770_2_; } public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { if (!Screen.hasControlDown()) { this.time += partialTicks; } Minecraft minecraft = Minecraft.getInstance(); minecraft.getTextureManager().bindTexture(RECIPE_BOOK); int i = 29; if (!this.list.containsCraftableRecipes()) { i += 25; } int j = 206; if (this.list.getRecipes(this.book.func_242141_a(this.field_203401_p)).size() > 1) { j += 25; } boolean flag = this.animationTime > 0.0F; if (flag) { float f = 1.0F + 0.1F * (float)Math.sin((double)(this.animationTime / 15.0F * (float)Math.PI)); RenderSystem.pushMatrix(); RenderSystem.translatef((float)(this.x + 8), (float)(this.y + 12), 0.0F); RenderSystem.scalef(f, f, 1.0F); RenderSystem.translatef((float)(-(this.x + 8)), (float)(-(this.y + 12)), 0.0F); this.animationTime -= partialTicks; } this.blit(matrixStack, this.x, this.y, i, j, this.width, this.height); List<IRecipe<?>> list = this.getOrderedRecipes(); this.currentIndex = MathHelper.floor(this.time / 30.0F) % list.size(); ItemStack itemstack = list.get(this.currentIndex).getRecipeOutput(); int k = 4; if (this.list.hasSingleResultItem() && this.getOrderedRecipes().size() > 1) { minecraft.getItemRenderer().renderItemAndEffectIntoGUI(itemstack, this.x + k + 1, this.y + k + 1); --k; } minecraft.getItemRenderer().renderItemAndEffectIntoGuiWithoutEntity(itemstack, this.x + k, this.y + k); if (flag) { RenderSystem.popMatrix(); } } private List<IRecipe<?>> getOrderedRecipes() { List<IRecipe<?>> list = this.list.getDisplayRecipes(true); if (!this.book.func_242141_a(this.field_203401_p)) { list.addAll(this.list.getDisplayRecipes(false)); } return list; } public boolean isOnlyOption() { return this.getOrderedRecipes().size() == 1; } public IRecipe<?> getRecipe() { List<IRecipe<?>> list = this.getOrderedRecipes(); return list.get(this.currentIndex); } public List<ITextComponent> getToolTipText(Screen p_191772_1_) { ItemStack itemstack = this.getOrderedRecipes().get(this.currentIndex).getRecipeOutput(); List<ITextComponent> list = Lists.newArrayList(p_191772_1_.getTooltipFromItem(itemstack)); if (this.list.getRecipes(this.book.func_242141_a(this.field_203401_p)).size() > 1) { list.add(field_243412_b); } return list; } public int getWidth() { return 25; } protected boolean isValidClickButton(int button) { return button == 0 || button == 1; } }
[ "nwither2333@gmail.com" ]
nwither2333@gmail.com
88f313904ade554c8be36efaee7ee7540ea2d3ec
6a7b3516f7e8c40e268d691667d38fd0c913d37d
/src/me/cyberstalk/plugin/sunburn/SunburnItem.java
4ae2a90dd4754fb97e474deb25b50294747ed159
[]
no_license
mikenon/Sunburn
92ad021bdefa3c330ddddbf3001677f7c3921fbc
9b8329322ababefcbecba5363ae78e024c482df3
refs/heads/master
2020-03-24T23:34:31.638836
2012-06-23T00:46:37
2012-06-23T00:46:37
4,644,346
1
0
null
null
null
null
UTF-8
Java
false
false
411
java
package me.cyberstalk.plugin.sunburn; import org.bukkit.plugin.Plugin; import org.getspout.spoutapi.material.item.GenericCustomItem; public class SunburnItem extends GenericCustomItem{ String itemSound; String itemName; ItemType itemType; public SunburnItem(Plugin plugin, String name, String texture, ItemType type){ super(plugin, name, texture); itemName = name; itemType = type; } }
[ "mike@cyberstalk.me" ]
mike@cyberstalk.me
e037392e9c8e8f5a8b660fd8428b61015e238783
f5cecc84ef5656bf1a817faa0dfdfb9e850df594
/generics/model/entities/ClienteHash.java
527dc07a9969d1798a2935727764e8e538f9192e
[]
no_license
Rayllanderson/curso-java
57dcd37c703ac462e27a562d31d141b8ee0715ff
44fbf439c221404985499b703df88690316e2a7b
refs/heads/master
2022-11-13T03:55:43.055041
2020-06-15T20:17:54
2020-06-15T20:17:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,219
java
package model.entities; public class ClienteHash { private String nome; private String email; public ClienteHash(String nome, String email) { this.nome = nome; this.email = email; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((email == null) ? 0 : email.hashCode()); result = prime * result + ((nome == null) ? 0 : nome.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ClienteHash other = (ClienteHash) obj; if (email == null) { if (other.email != null) return false; } else if (!email.equals(other.email)) return false; if (nome == null) { if (other.nome != null) return false; } else if (!nome.equals(other.nome)) return false; return true; } }
[ "rayllanderson@gmail.com" ]
rayllanderson@gmail.com
d35849bca03789ceaa4617b0276d4fce6ecb106f
5d12acb27ef070049f36c327343a95e5732718d4
/src/main/java/array/ThreeSum15.java
ae2519b9f7a6339d0ae7bd527cf454637fbb37f3
[]
no_license
wh14274493/leetcode
1e3287e8107fa1e5ddc3fc1136d5413a4e7e731b
d2ca11d3c69b8b5e6479f77aaa3ba7805b0c762d
refs/heads/master
2020-11-27T11:02:51.410730
2019-12-28T10:17:09
2019-12-28T10:17:09
229,413,171
0
0
null
null
null
null
UTF-8
Java
false
false
1,789
java
package array; import common.Printer; import java.util.*; /** * @author wang hao * @created 2019/12/26 21:25 * @contact 14274493 */ public class ThreeSum15 { public static List<List<Integer>> threeSum(int[] nums) { int length = nums.length; Sort.quickSort(nums, 0, length - 1); Set<Integer> set = new HashSet<>(); List<List<Integer>> result = new ArrayList<>(); for (int i = 0; i < length - 2; i++) { if (!set.contains(nums[i])) { set.add(nums[i]); int left = i + 1; int right = length - 1; int point = nums[i]; int temp = 0 - point; Set<Integer> data = new HashSet<>(); while (left < right) { if (nums[left] + nums[right] < temp) { left++; } else if (nums[left] + nums[right] > temp) { right--; } else { if (!data.contains(nums[left])) { List<Integer> element = new ArrayList<>(); element.add(point); element.add(nums[left]); element.add(nums[right]); result.add(element); data.add(nums[left]); data.add(nums[right]); } left++; right--; } } } } return result; } public static void main(String[] args) { int[] nums = {-1, 0, 1, 2, -1, -4}; List<List<Integer>> result = threeSum(nums); Printer.print(result); } }
[ "14274493@qq.com" ]
14274493@qq.com
c58c29b448e3afe178533f6d3bb0a230d023be3c
ca622874fac2fcdade8eea723edfd65764b54fec
/src/main/java/AppConfig.java
22542603f46d8881c4a8ddab223591ff69b4ef20
[]
no_license
JavaWebKen/ps-spring-fundamentals-java
550007052bfff46f95b7592fd245824e34599af2
b0fd63bb3a5d19b09297af6b42a1029bdd8ec7d9
refs/heads/master
2022-09-26T17:36:14.861942
2020-06-01T21:53:31
2020-06-01T21:53:31
268,581,765
0
0
null
null
null
null
UTF-8
Java
false
false
1,257
java
import com.pluralsight.util.CalendarFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import java.util.Calendar; @Configuration @ComponentScan({"com.pluralsight"}) public class AppConfig { @Bean(name = "cal") public CalendarFactory calFactory() { CalendarFactory factory = new CalendarFactory(); factory.addDays(2); return factory; } @Bean public Calendar cal() throws Exception{ return calFactory().getObject(); } /* @Bean(name = "speakerService") @Scope(value= BeanDefinition.SCOPE_SINGLETON) //@Scope(value= BeanDefinition.SCOPE_PROTOTYPE) public SpeakerService getSpeakerService() { //SpeakerServiceImpl service = new SpeakerServiceImpl(getSpeakerRepository()); SpeakerServiceImpl service = new SpeakerServiceImpl(); //service.setRepository(getSpeakerRepository()); return service; //return new SpeakerServiceImpl(); } */ /* @Bean(name = "speakerRepository") public SpeakerRepository getSpeakerRepository() { return new HibernateSpeakerRepositoryImpl(); } */ }
[ "javawebken@gmail.com" ]
javawebken@gmail.com
d21cd863e6c143d9ea6d5b1eeeb353866a2d6c6c
1d3d1b54f6ba9c61f18ccfc4ce79e06de0381f48
/src/examples/page2/Converter.java
cc30a381dde620440edbacea893ec3ede208a5fa
[]
no_license
Vygovsky/MyTask
3add2d219011d209037f6d0465a98db5d45cafff
c5955b7036435023bcf5858a5fce25651d22aa63
refs/heads/master
2021-01-23T09:47:05.670878
2018-08-20T13:17:15
2018-08-20T13:17:15
102,602,006
0
0
null
2018-05-08T10:00:16
2017-09-06T11:46:19
Java
UTF-8
Java
false
false
139
java
package examples.page2; /** * Created by Roman_v on 11.09.2017. */ @FunctionalInterface interface Converter<F, T> { T con(F from); }
[ "vigmol@ukr.net" ]
vigmol@ukr.net
2b17bf3f43dd41407f4931ab307f51a0d159130d
51c3291fcb9276a21a25e2a05070b54dda1f2d23
/app/src/main/java/com/recette/lfm/lfmrecette/CoupeMartiniqueDeuxActivity.java
cf3fcb84bd6f79bbf0dd9a60e3d9cde840ae6b80
[]
no_license
Sam-Tek/LFM_Calcule_Feuille_Recette
47262813f129f8f9c4e2c3996f724b1adf170205
d63d0e0e85e758aec90f18ae3f2a18afa04560f2
refs/heads/master
2021-01-01T03:37:54.897916
2017-01-20T18:37:53
2017-01-20T18:37:53
56,514,889
2
0
null
null
null
null
UTF-8
Java
false
false
10,059
java
package com.recette.lfm.lfmrecette; import android.content.Intent; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.EditText; import android.widget.RadioButton; import android.widget.Toast; public class CoupeMartiniqueDeuxActivity extends AppCompatActivity { public final static String IDNBTICKETTRIBUNE= "com.recette.lfm.lfmrecette.IDNBTICKETTRIBUNE"; public final static String IDPRIXTICKETTRIBUNE= "com.recette.lfm.lfmrecette.IDPRIXTICKETTRIBUNE"; public final static String IDNBTICKETGRADIN= "com.recette.lfm.lfmrecette.IDNBTICKETGRADIN"; public final static String IDPRIXTICKETGRADIN= "com.recette.lfm.lfmrecette.IDPRIXTICKETGRADIN"; public final static String IDNBTICKETPELOUSE= "com.recette.lfm.lfmrecette.IDNBTICKETPELOUSE"; public final static String IDPRIXTICKETPELOUSE= "com.recette.lfm.lfmrecette.IDPRIXTICKETPELOUSE"; public final static String IDLOCATIONTERRAIN= "com.recette.lfm.lfmrecette.IDLOCATIONTERRAIN"; public final static String IDFRAISECLAIRAGE= "com.recette.lfm.lfmrecette.IDFRAISECLAIRAGE"; public final static String IDCLUBRECEVEUR= "com.recette.lfm.lfmrecette.IDCLUBRECEVEUR"; public final static String IDCLUBVISITEUR= "com.recette.lfm.lfmrecette.IDCLUBVISITEUR"; public final static String IDDELEGUE= "com.recette.lfm.lfmrecette.IDDELEGUE"; private String valeurLocation="10"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_coupe_martinique_deux); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_coupe_martinique_deux, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement /*if (id == R.id.action_settings) { return true; }*/ return super.onOptionsItemSelected(item); } public void calculeChampionnat(View view) { boolean ok=true; Intent intent = new Intent(this,CalculeCoupeMartiniqueDeuxRecetteActivity.class); //recuperer les edittext EditText nbticketTribune=(EditText) findViewById(R.id.nbticketTribune); EditText prixticketTribune=(EditText) findViewById(R.id.prixticketTribune); EditText nbticketGradin=(EditText) findViewById(R.id.nbticketGradin); EditText prixticketGradin=(EditText) findViewById(R.id.prixticketGradin); EditText nbticketPelouse=(EditText) findViewById(R.id.nbticketPelouse); EditText prixticketPelouse=(EditText) findViewById(R.id.prixticketPelouse); EditText fraiseclairage =(EditText) findViewById(R.id.fraisEclairage); EditText clubreceveur=(EditText) findViewById(R.id.clubReceveur); EditText clubvisiteur=(EditText) findViewById(R.id.clubVisiteur); EditText fraisdelegue=(EditText) findViewById(R.id.fraisDelegue); //verifier si les champs sont vides ou trop gros if (nbticketTribune.getText().toString().length() < 10) { String valeurnbticketTribune; if (nbticketTribune.getText().toString().length() > 0){ //recuperer la valeur du edittext valeurnbticketTribune = nbticketTribune.getText().toString(); }else{ valeurnbticketTribune="0"; } //inserer les valeurs des edittext dans le intent pour la vue suivante intent.putExtra(IDNBTICKETTRIBUNE, valeurnbticketTribune); }else { ok=false; } //verifier si le champ prix tribune est vide ou trop gros if (prixticketTribune.getText().toString().length() < 10){ String valeurprixticketTribune; if (prixticketTribune.getText().toString().length() > 0){ valeurprixticketTribune= prixticketTribune.getText().toString(); }else{ valeurprixticketTribune="0"; } //inserer les valeurs des edittext dans le intent pour la vue suivante intent.putExtra(IDPRIXTICKETTRIBUNE, valeurprixticketTribune); }else { ok=false; } //verifier si les champs sont vides ou trop gros if (nbticketGradin.getText().toString().length() < 10) { String valeurnbticketGradin; if (nbticketGradin.getText().toString().length()>0){ //recuperer la valeur du edittext valeurnbticketGradin = nbticketGradin.getText().toString(); }else{ valeurnbticketGradin="0"; } //inserer les valeurs des edittext dans le intent pour la vue suivante intent.putExtra(IDNBTICKETGRADIN,valeurnbticketGradin); }else { ok=false; } //verifier si les champs sont vides ou trop gros if (prixticketGradin.getText().toString().length() < 10) { String valeurprixticketGradin; if (prixticketGradin.getText().toString().length()>0){ //recuperer la valeur du edittext valeurprixticketGradin = prixticketGradin.getText().toString(); }else{ valeurprixticketGradin="0"; } //inserer les valeurs des edittext dans le intent pour la vue suivante intent.putExtra(IDPRIXTICKETGRADIN,valeurprixticketGradin); }else { ok=false; } //verifier si les champs sont vides ou trop gros if (nbticketPelouse.getText().toString().length() < 10) { String valeurnbticketPelouse; //verifier si c vide par defaut c = a 0 if (nbticketPelouse.getText().toString().length()>0){ //recuperer la valeur du edittext valeurnbticketPelouse = nbticketPelouse.getText().toString(); }else{ valeurnbticketPelouse="0"; } //inserer les valeurs des edittext dans le intent pour la vue suivante intent.putExtra(IDNBTICKETPELOUSE, valeurnbticketPelouse); }else{ ok=false; } //verifier si les champs sont vides ou trop gros if (prixticketPelouse.getText().toString().length() < 10) { String valeurprixticketPelouse; //verifier si c vide par defaut c = a 0 if (prixticketPelouse.getText().toString().length()>0){ //recuperer la valeur du edittext valeurprixticketPelouse = prixticketPelouse.getText().toString(); }else{ valeurprixticketPelouse="0"; } //inserer les valeurs des edittext dans le intent pour la vue suivante intent.putExtra(IDPRIXTICKETPELOUSE, valeurprixticketPelouse); }else{ ok=false; } if (fraiseclairage.getText().toString().length()<10){ String valeurfraiseclairage; if (fraiseclairage.getText().toString().length()>0){ valeurfraiseclairage=fraiseclairage.getText().toString(); }else{ valeurfraiseclairage="0"; } intent.putExtra(IDFRAISECLAIRAGE,valeurfraiseclairage); }else{ ok=false; } if (clubreceveur.getText().toString().length()<10){ String valeurclubreceveur; if (clubreceveur.getText().toString().length()>0){ valeurclubreceveur=clubreceveur.getText().toString(); }else{ valeurclubreceveur="0"; } intent.putExtra(IDCLUBRECEVEUR,valeurclubreceveur); }else{ ok=false; } if (clubvisiteur.getText().toString().length()<10){ String valeurclubvisiteur; if (clubvisiteur.getText().toString().length()>0){ valeurclubvisiteur=clubvisiteur.getText().toString(); }else{ valeurclubvisiteur="0"; } intent.putExtra(IDCLUBVISITEUR,valeurclubvisiteur); }else{ ok=false; } //verifier si les champs sont vides ou trop gros if (fraisdelegue.getText().toString().length() < 10) { String valeurfraisdelegue; if (fraisdelegue.getText().toString().length() > 0){ //recuperer la valeur du edittext valeurfraisdelegue = fraisdelegue.getText().toString(); }else{ valeurfraisdelegue="0"; } //inserer les valeurs des edittext dans le intent pour la vue suivante intent.putExtra(IDDELEGUE, valeurfraisdelegue); }else { ok=false; } intent.putExtra(IDLOCATIONTERRAIN,valeurLocation); //lancer lactivite si tout est ok if (ok==true) { startActivity(intent); }else{ //affichier un message d'erreur Toast.makeText(this, R.string.erreurSaisie, Toast.LENGTH_SHORT).show(); } } //evenement lorsque le bouton radio est valide public void onRadioButtonClicked(View view){ boolean checked= ((RadioButton) view).isChecked(); switch (view.getId()){ case R.id.radio10: if (checked) valeurLocation="10"; break; case R.id.radio15: if (checked) valeurLocation="15"; break; } } }
[ "sonny.foot@hotmail.com" ]
sonny.foot@hotmail.com
ef797ca50acae0eaa8dbae5c340f54eb20840d6d
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/elastic--elasticsearch/4ab268bab2cfd7fc3cb4c4808f706d5049c1fae5/after/RestPutRepositoryAction.java
c3dfcd9a97069e9cd8c1667cf97916194e7c3b69
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
2,592
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.rest.action.admin.cluster.repositories.put; import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest; import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.rest.*; import org.elasticsearch.rest.action.support.AcknowledgedRestListener; import static org.elasticsearch.client.Requests.putRepositoryRequest; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.PUT; /** * Registers repositories */ public class RestPutRepositoryAction extends BaseRestHandler { @Inject public RestPutRepositoryAction(Settings settings, RestController controller, Client client) { super(settings, controller, client); controller.registerHandler(PUT, "/_snapshot/{repository}", this); controller.registerHandler(POST, "/_snapshot/{repository}", this); } @Override public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) { PutRepositoryRequest putRepositoryRequest = putRepositoryRequest(request.param("repository")); putRepositoryRequest.listenerThreaded(false); putRepositoryRequest.source(request.content().toUtf8()); putRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putRepositoryRequest.masterNodeTimeout())); putRepositoryRequest.timeout(request.paramAsTime("timeout", putRepositoryRequest.timeout())); client.admin().cluster().putRepository(putRepositoryRequest, new AcknowledgedRestListener<PutRepositoryResponse>(channel)); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
882986eb4eed65dafdccc6f635e8f8ac0c6a7547
6dde6f5b3786b67b6b96fefc00e5244a4dc1ae5a
/app/src/main/java/com/example/studentteachercollaborations/StudentsPortal/StudentSemesterListAdapter.java
8db957e81dba4e086ca7d6a670dea1a7480df006
[]
no_license
rakibHridoy206/student-faculty-collaboration
32e97f76d8975b8b6c2f94af2f18234e8549e721
08f2a53900b34e5caba7c27e77f4738c386e5400
refs/heads/master
2023-03-26T14:52:14.218115
2021-03-23T12:17:14
2021-03-23T12:17:14
305,989,546
0
0
null
null
null
null
UTF-8
Java
false
false
4,602
java
package com.example.studentteachercollaborations.StudentsPortal; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.cardview.widget.CardView; import androidx.recyclerview.widget.RecyclerView; import com.example.studentteachercollaborations.R; import com.example.studentteachercollaborations.SemesterList; public class StudentSemesterListAdapter extends RecyclerView.Adapter<StudentSemesterListAdapter.ViewHolder> { private Context context; private SemesterList[] semesterLists; private StudentsBooksSemesterList.OnStudentsSemesterNoClick studentsSemesterNoClick; public StudentSemesterListAdapter(Context context, SemesterList[] semesterLists, StudentsBooksSemesterList.OnStudentsSemesterNoClick studentsSemesterNoClick) { this.context = context; this.semesterLists = semesterLists; this.studentsSemesterNoClick = studentsSemesterNoClick; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); View listItem = layoutInflater.inflate(R.layout.layout_list_books, parent, false); StudentSemesterListAdapter.ViewHolder viewHolder = new StudentSemesterListAdapter.ViewHolder(listItem); return viewHolder; } @Override public void onBindViewHolder(ViewHolder holder, final int position) { final SemesterList semesterListData = semesterLists[position]; holder.semesterNoTV.setText(semesterLists[position].getSemesterNo()); holder.booksCardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String semesterNo = semesterLists[position].getSemesterNo(); switch (semesterNo){ case "First Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("First"); break; case "Second Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Second"); break; case "Third Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Third"); break; case "Fourth Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Fourth"); break; case "Fifth Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Fifth"); break; case "Sixth Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Sixth"); break; case "Seventh Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Seventh"); break; case "Eighth Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Eighth"); break; case "Ninth Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Ninth"); break; case "Tenth Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Tenth"); break; case "Eleventh Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Eleventh"); break; case "Twelfth Semester": studentsSemesterNoClick.onStudentsSemesterNoClickSuccessful("Twelfth"); break; } } }); } @Override public int getItemCount() { return semesterLists.length; } public class ViewHolder extends RecyclerView.ViewHolder { private TextView semesterNoTV; private CardView booksCardView; public ViewHolder(View itemView) { super(itemView); this.semesterNoTV = itemView.findViewById(R.id.semesterNo); this.booksCardView = itemView.findViewById(R.id.booksCard); } } }
[ "rakib.hridoy206@gmail.com" ]
rakib.hridoy206@gmail.com
7957430683fe3c58d66b6ad82a245fd910208c11
ea2fe07a05c4b35f837fa4e5491c38ff96a37309
/org.marc.everest/src/main/java/org/marc/everest/connectors/interfaces/ISendReceiveConnector.java
f9e851fb0303b3f7fc716a015e021b0e27adeda9
[ "Apache-2.0" ]
permissive
pmanko/jeverest
813e0dda4642869323cb694f4425d5b02dc8389e
5b0891d6e36555d2a0c645c73f4a4dfe662fc817
refs/heads/master
2022-04-13T00:09:36.168368
2020-04-09T21:21:15
2020-04-09T21:21:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,071
java
/** * Copyright 2008-2013 Mohawk College of Applied Arts and Technology * * 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. * * User: Justin Fyfe * Date: 12-14-2012 */ package org.marc.everest.connectors.interfaces; /** * Represents a connector that can send messages to a remote system and then * receive a response, correlating the response with the request */ public interface ISendReceiveConnector extends ISendingConnector { /** * Receive the response to a message that has been sent */ IReceiveResult receive(ISendResult correlate); }
[ "justin.fyfe@ecgroupinc.com" ]
justin.fyfe@ecgroupinc.com
50e7b26dc99d598898eb3c64d9524d9e326e3c35
fe02ca79bc36fea997f7fdfeda0f8d52e69414e0
/java/1542. 找出最长的超赞子字符串/src/Main.java
bada9802acf4bd15435daf84d88240a27b80f92f
[]
no_license
Joenhle/leetcode
4e474a46712d56dc2639115742486cf329489e81
dfabec60216b87c563e0cf1b6bb3a35fee296ea7
refs/heads/master
2023-03-15T19:09:42.691491
2023-01-31T12:44:32
2023-01-31T12:44:32
595,606,512
0
0
null
null
null
null
UTF-8
Java
false
false
892
java
import java.util.HashMap; public class Main { public static int longestAwesome(String s) { HashMap<Integer,Integer> hashMap = new HashMap<>(); int pre = 0; int ans = 0; hashMap.put(0,-1); for (int i = 0; i < s.length(); ++i){ char ch = s.charAt(i); pre = pre ^ (1 << (ch-'0')); for (int j = 0; j < 10; ++j){ int next = pre ^ (1 << j); if (hashMap.containsKey(next)){ ans = Math.max(ans,i - hashMap.get(next)); } } if (!hashMap.containsKey(pre)){ hashMap.put(pre,i); }else { ans = Math.max(ans,i - hashMap.get(pre)); } } return ans; } public static void main(String[] args) { System.out.println(longestAwesome("00")); } }
[ "820863776@qq.com" ]
820863776@qq.com
d392603b5959305fd799301b140ed1fbe3428eb1
70b433ac99c81d1119583497afc411cbb93c2a08
/app/src/main/java/br/com/teste/xofome/xofomeadmin/service/ItemPedidoService.java
338c815a7687c1a0e9d69580197468e32ea4a1ff
[]
no_license
marcosflavio/xofomeadmin
34bfd58d6f0ff7dfef36991277fc6942ff1605f0
be99c5c0607242dd9d38e831205a49ec5fdc4eac
refs/heads/master
2021-01-11T22:16:49.811679
2017-01-14T14:20:14
2017-01-14T14:20:14
78,943,886
0
0
null
2017-01-14T14:20:14
2017-01-14T14:09:38
Java
UTF-8
Java
false
false
1,113
java
package br.com.teste.xofome.xofomeadmin.service; import android.content.Context; import java.util.List; import br.com.teste.xofome.xofomeadmin.dao.ItemPedidoDAO; import br.com.teste.xofome.xofomeadmin.model.ItemPedido; /** * Created by marcosf on 23/11/2016. */ public class ItemPedidoService { public static void save (ItemPedido itemPedido, Context context){ ItemPedidoDAO dao = new ItemPedidoDAO(context); dao.save(itemPedido); } public static void update (ItemPedido itemPedido, Context context){ ItemPedidoDAO dao = new ItemPedidoDAO(context); dao.update(itemPedido); } public static void delete (ItemPedido itemPedido, Context context){ ItemPedidoDAO dao = new ItemPedidoDAO(context); dao.delete(itemPedido); } public static ItemPedido find (int id, Context context){ ItemPedidoDAO dao = new ItemPedidoDAO(context); return dao.findById(id); } public static List<ItemPedido> findAll( Context context){ ItemPedidoDAO dao = new ItemPedidoDAO(context); return dao.findAll(); } }
[ "marcosflaviosilveira@gmail.com" ]
marcosflaviosilveira@gmail.com
a5a80d65fae419134f0d8773f27b8fafcb44af95
5ebea747c77bc4ef914415fb8c9a518534359aa1
/coinpurse/MoneyFactory.java
211631060c766c18386cadf7939f8020221ec756
[]
no_license
ammeter/stopwatch
b68f60d344181a54353bc006ba9609f551ad19bf
3747105413bda78e50f391b7fe116674f6e78b77
refs/heads/master
2021-01-23T08:15:53.454719
2017-03-03T05:32:14
2017-03-03T05:32:14
80,531,316
0
0
null
null
null
null
UTF-8
Java
false
false
743
java
package coinpurse; /** * A class to * @author Pannapat Panpakdee * */ import java.util.ArrayList; import java.util.List; public abstract class MoneyFactory { protected static MoneyFactory factory = null; protected MoneyFactory ( ) { } /** * To get an instance * * @return object of ThaiMoneyFactory */ public static MoneyFactory getInstance() { if ( factory == null ) factory = new ThaiMoneyFactory( ); return factory; } /** * Create money object * * @param value * @return */ public abstract Valuable createMoney (double value); /** * Create money object * * @param value * @return */ public Valuable createMoney (String value) { return createMoney(Double.parseDouble(value)); } }
[ "pannapat.pa@ku.th" ]
pannapat.pa@ku.th
7bc253db7e47ca1480b9a6c1de40469d2c945ecc
3c2d2c06d85abb9c7a1a84fefe9b72399c201f85
/phlocjavacc-maven-plugin/src/main/java/org/javacc/parser/LookaheadCalc.java
9b850c8d0bfa93bc2485a652bb052d1638d0dfc9
[]
no_license
phlocbg/phloc-css
2240754f778d06fa95be411abf21544ecb0ac768
215a945f4ec585b0d24d65a5f39666fb8a67e124
refs/heads/master
2022-07-16T02:04:41.954879
2019-08-22T23:10:14
2019-08-22T23:10:14
41,243,652
1
0
null
2022-07-01T22:17:57
2015-08-23T09:27:32
Java
UTF-8
Java
false
false
12,115
java
/* Copyright (c) 2006, Sun Microsystems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Sun Microsystems, Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ package org.javacc.parser; import java.util.ArrayList; import java.util.List; public class LookaheadCalc extends JavaCCGlobals { static MatchInfo overlap (final List v1, final List v2) { MatchInfo m1, m2, m3; int size; boolean diff; for (int i = 0; i < v1.size (); i++) { m1 = (MatchInfo) v1.get (i); for (int j = 0; j < v2.size (); j++) { m2 = (MatchInfo) v2.get (j); size = m1.firstFreeLoc; m3 = m1; if (size > m2.firstFreeLoc) { size = m2.firstFreeLoc; m3 = m2; } if (size == 0) return null; // we wish to ignore empty expansions and the JAVACODE stuff here. diff = false; for (int k = 0; k < size; k++) { if (m1.match[k] != m2.match[k]) { diff = true; break; } } if (!diff) return m3; } } return null; } static boolean javaCodeCheck (final List v) { for (int i = 0; i < v.size (); i++) { if (((MatchInfo) v.get (i)).firstFreeLoc == 0) { return true; } } return false; } static String image (final MatchInfo m) { String ret = ""; for (int i = 0; i < m.firstFreeLoc; i++) { if (m.match[i] == 0) { ret += " <EOF>"; } else { final RegularExpression re = (RegularExpression) rexps_of_tokens.get (new Integer (m.match[i])); if (re instanceof RStringLiteral) { ret += " \"" + add_escapes (((RStringLiteral) re).image) + "\""; } else if (re.label != null && !re.label.equals ("")) { ret += " <" + re.label + ">"; } else { ret += " <token of kind " + i + ">"; } } } if (m.firstFreeLoc == 0) { return ""; } else { return ret.substring (1); } } public static void choiceCalc (final Choice ch) { final int first = firstChoice (ch); // dbl[i] and dbr[i] are lists of size limited matches for choice i // of ch. dbl ignores matches with semantic lookaheads (when force_la_check // is false), while dbr ignores semantic lookahead. final List [] dbl = new ArrayList [ch.getChoices ().size ()]; final List [] dbr = new ArrayList [ch.getChoices ().size ()]; final int [] minLA = new int [ch.getChoices ().size () - 1]; final MatchInfo [] overlapInfo = new MatchInfo [ch.getChoices ().size () - 1]; final int [] other = new int [ch.getChoices ().size () - 1]; MatchInfo m; List v; boolean overlapDetected; for (int la = 1; la <= Options.getChoiceAmbiguityCheck (); la++) { MatchInfo.laLimit = la; LookaheadWalk.considerSemanticLA = !Options.getForceLaCheck (); for (int i = first; i < ch.getChoices ().size () - 1; i++) { LookaheadWalk.sizeLimitedMatches = new ArrayList (); m = new MatchInfo (); m.firstFreeLoc = 0; v = new ArrayList (); v.add (m); LookaheadWalk.genFirstSet (v, (Expansion) ch.getChoices ().get (i)); dbl[i] = LookaheadWalk.sizeLimitedMatches; } LookaheadWalk.considerSemanticLA = false; for (int i = first + 1; i < ch.getChoices ().size (); i++) { LookaheadWalk.sizeLimitedMatches = new ArrayList (); m = new MatchInfo (); m.firstFreeLoc = 0; v = new ArrayList (); v.add (m); LookaheadWalk.genFirstSet (v, (Expansion) ch.getChoices ().get (i)); dbr[i] = LookaheadWalk.sizeLimitedMatches; } if (la == 1) { for (int i = first; i < ch.getChoices ().size () - 1; i++) { final Expansion exp = (Expansion) ch.getChoices ().get (i); if (Semanticize.emptyExpansionExists (exp)) { JavaCCErrors.warning (exp, "This choice can expand to the empty token sequence " + "and will therefore always be taken in favor of the choices appearing later."); break; } else if (javaCodeCheck (dbl[i])) { JavaCCErrors.warning (exp, "JAVACODE non-terminal will force this choice to be taken " + "in favor of the choices appearing later."); break; } } } overlapDetected = false; for (int i = first; i < ch.getChoices ().size () - 1; i++) { for (int j = i + 1; j < ch.getChoices ().size (); j++) { if ((m = overlap (dbl[i], dbr[j])) != null) { minLA[i] = la + 1; overlapInfo[i] = m; other[i] = j; overlapDetected = true; break; } } } if (!overlapDetected) { break; } } for (int i = first; i < ch.getChoices ().size () - 1; i++) { if (explicitLA ((Expansion) ch.getChoices ().get (i)) && !Options.getForceLaCheck ()) { continue; } if (minLA[i] > Options.getChoiceAmbiguityCheck ()) { JavaCCErrors.warning ("Choice conflict involving two expansions at"); System.err.print (" line " + ((Expansion) ch.getChoices ().get (i)).getLine ()); System.err.print (", column " + ((Expansion) ch.getChoices ().get (i)).getColumn ()); System.err.print (" and line " + ((Expansion) ch.getChoices ().get (other[i])).getLine ()); System.err.print (", column " + ((Expansion) ch.getChoices ().get (other[i])).getColumn ()); System.err.println (" respectively."); System.err.println (" A common prefix is: " + image (overlapInfo[i])); System.err.println (" Consider using a lookahead of " + minLA[i] + " or more for earlier expansion."); } else if (minLA[i] > 1) { JavaCCErrors.warning ("Choice conflict involving two expansions at"); System.err.print (" line " + ((Expansion) ch.getChoices ().get (i)).getLine ()); System.err.print (", column " + ((Expansion) ch.getChoices ().get (i)).getColumn ()); System.err.print (" and line " + ((Expansion) ch.getChoices ().get (other[i])).getLine ()); System.err.print (", column " + ((Expansion) ch.getChoices ().get (other[i])).getColumn ()); System.err.println (" respectively."); System.err.println (" A common prefix is: " + image (overlapInfo[i])); System.err.println (" Consider using a lookahead of " + minLA[i] + " for earlier expansion."); } } } static boolean explicitLA (final Expansion exp) { if (!(exp instanceof Sequence)) { return false; } final Sequence seq = (Sequence) exp; final Object obj = seq.units.get (0); if (!(obj instanceof Lookahead)) { return false; } final Lookahead la = (Lookahead) obj; return la.isExplicit (); } static int firstChoice (final Choice ch) { if (Options.getForceLaCheck ()) { return 0; } for (int i = 0; i < ch.getChoices ().size (); i++) { if (!explicitLA ((Expansion) ch.getChoices ().get (i))) { return i; } } return ch.getChoices ().size (); } private static String image (final Expansion exp) { if (exp instanceof OneOrMore) { return "(...)+"; } else if (exp instanceof ZeroOrMore) { return "(...)*"; } else /* if (exp instanceof ZeroOrOne) */{ return "[...]"; } } public static void ebnfCalc (final Expansion exp, final Expansion nested) { // exp is one of OneOrMore, ZeroOrMore, ZeroOrOne MatchInfo m, m1 = null; List v, first, follow; int la; for (la = 1; la <= Options.getOtherAmbiguityCheck (); la++) { MatchInfo.laLimit = la; LookaheadWalk.sizeLimitedMatches = new ArrayList (); m = new MatchInfo (); m.firstFreeLoc = 0; v = new ArrayList (); v.add (m); LookaheadWalk.considerSemanticLA = !Options.getForceLaCheck (); LookaheadWalk.genFirstSet (v, nested); first = LookaheadWalk.sizeLimitedMatches; LookaheadWalk.sizeLimitedMatches = new ArrayList (); LookaheadWalk.considerSemanticLA = false; LookaheadWalk.genFollowSet (v, exp, Expansion.nextGenerationIndex++); follow = LookaheadWalk.sizeLimitedMatches; if (la == 1) { if (javaCodeCheck (first)) { JavaCCErrors.warning (nested, "JAVACODE non-terminal within " + image (exp) + " construct will force this construct to be entered in favor of " + "expansions occurring after construct."); } } if ((m = overlap (first, follow)) == null) { break; } m1 = m; } if (la > Options.getOtherAmbiguityCheck ()) { JavaCCErrors.warning ("Choice conflict in " + image (exp) + " construct " + "at line " + exp.getLine () + ", column " + exp.getColumn () + "."); System.err.println (" Expansion nested within construct and expansion following construct"); System.err.println (" have common prefixes, one of which is: " + image (m1)); System.err.println (" Consider using a lookahead of " + la + " or more for nested expansion."); } else if (la > 1) { JavaCCErrors.warning ("Choice conflict in " + image (exp) + " construct " + "at line " + exp.getLine () + ", column " + exp.getColumn () + "."); System.err.println (" Expansion nested within construct and expansion following construct"); System.err.println (" have common prefixes, one of which is: " + image (m1)); System.err.println (" Consider using a lookahead of " + la + " for nested expansion."); } } }
[ "ph@phloc.com" ]
ph@phloc.com
552ba72d8cfb41b822bd214b58166db3a80424d8
a1c1e057c4be2882a5e4652923efec864c61c373
/iExtractor/app/src/androidTest/java/com/iextractor/ExampleInstrumentedTest.java
2fc9b61c78e280744dd7d97af2918ab6433104db
[]
no_license
Chuongnguyenchuongdannguyen/chuong
84373345d6d5587a85ccaca8f210398082fd2387
4a0e84b5488f3a8d168c6630b3ee1cfbfbad48e4
refs/heads/master
2020-06-22T23:38:37.969608
2019-07-23T13:20:14
2019-07-23T13:20:14
198,433,001
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
package com.iextractor; import android.content.Context; import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.iextractor", appContext.getPackageName()); } }
[ "50919295+Chuongnguyenchuongdannguyen@users.noreply.github.com" ]
50919295+Chuongnguyenchuongdannguyen@users.noreply.github.com
c308bc769590b752650af46fb98ba1dbf292e9df
c7d9d281de9b0e09681b31cc1c38d810fbdc3aec
/app/src/test/java/com/example/administrator/mesuretest/ExampleUnitTest.java
f4f588529de7368b1f621109b1845ac78e298514
[]
no_license
ybb13/MesureTest
09c9262cf5b6dcbae1cff1e78019f1accec6f71c
c0274e722477c32945de51006169bd237578a866
refs/heads/master
2021-01-22T18:33:10.440375
2017-08-16T09:01:30
2017-08-16T09:01:30
100,469,718
0
0
null
null
null
null
UTF-8
Java
false
false
414
java
package com.example.administrator.mesuretest; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "2207877178@qq.com" ]
2207877178@qq.com
6cafb1ca44356324e143e3346bd42c76f429e3b3
61498053a08328f53b351230b5f2abec2f4a7651
/src/test/java/StationTest.java
0213311652adc23cdf7738d18d51a3b231efab8c
[]
no_license
DavCampagna/java_stereo_lab
9d8146bccd05e87477d24a78bffca20843e38991
878eae4269778011f76efa59afdf2e58743a1ede
refs/heads/master
2020-08-27T05:09:05.722262
2019-10-15T13:06:46
2019-10-15T13:06:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; public class StationTest { private Station station1; @Before public void before() { station1 = new Station(StationType.RADIO_ONE); } @Test public void hasStationType() { assertEquals(StationType.RADIO_ONE, station1.getStationType()); } @Test public void canGetWelcomeMessage() { assertEquals("You are listening to Radio One", station1.getWelcomeMessage()); } }
[ "haydenwb@gmail.com" ]
haydenwb@gmail.com
c1393c605280a85b90157aa825246c5c44f024af
071a9fa7cfee0d1bf784f6591cd8d07c6b2a2495
/corpus/norm-class/ecf/275.java
b9822d8e95d4ad50357bf406350ee04a59cfc2cb
[ "MIT" ]
permissive
masud-technope/ACER-Replication-Package-ASE2017
41a7603117f01382e7e16f2f6ae899e6ff3ad6bb
cb7318a729eb1403004d451a164c851af2d81f7a
refs/heads/master
2021-06-21T02:19:43.602864
2021-02-13T20:44:09
2021-02-13T20:44:09
187,748,164
0
0
null
null
null
null
UTF-8
Java
false
false
805
java
org eclipse ecf internal bullet inboard bulletinboard commons parsing java util regex pattern default pattern descriptor defaultpatterndescriptor i pattern descriptor ipatterndescriptor default id and name defaultidandname pattern pattern base pattern descriptor basepatterndescriptor pattern string i pattern descriptor ipatterndescriptor param i pattern descriptor ipatterndescriptor param i pattern descriptor ipatterndescriptor reverse id and name reverseidandname pattern pattern base pattern descriptor basepatterndescriptor pattern string i pattern descriptor ipatterndescriptor param i pattern descriptor ipatterndescriptor param i pattern descriptor ipatterndescriptor default custom defaultcustom pattern pattern string parameters base pattern descriptor basepatterndescriptor pattern parameters
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
a62c6a1a22e5310ae791747964fceea38ae385d5
6253283b67c01a0d7395e38aeeea65e06f62504b
/decompile/app/Settings/src/main/java/com/android/settings/AppListPreferenceWithSettings.java
41f54b98ca36a63d1817149fd7096632f424bae8
[]
no_license
sufadi/decompile-hw
2e0457a0a7ade103908a6a41757923a791248215
4c3efd95f3e997b44dd4ceec506de6164192eca3
refs/heads/master
2023-03-15T15:56:03.968086
2017-11-08T03:29:10
2017-11-08T03:29:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,693
java
package com.android.settings; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.support.v7.preference.PreferenceViewHolder; import android.util.AttributeSet; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; public class AppListPreferenceWithSettings extends AppListPreference { private ComponentName mSettingsComponent; private View mSettingsIcon; public AppListPreferenceWithSettings(Context context, AttributeSet attrs) { super(context, attrs); setLayoutResource(2130968977); setWidgetLayoutResource(2130968998); } public void onBindViewHolder(PreferenceViewHolder view) { super.onBindViewHolder(view); this.mSettingsIcon = view.findViewById(2131886968); ((ViewGroup) this.mSettingsIcon.getParent()).setPaddingRelative(0, 0, 0, 0); updateSettingsVisibility(); } private void updateSettingsVisibility() { if (!(this.mSettingsIcon == null || this.mSettingsComponent == null)) { this.mSettingsIcon.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent("android.intent.action.MAIN"); intent.setComponent(AppListPreferenceWithSettings.this.mSettingsComponent); AppListPreferenceWithSettings.this.getContext().startActivity(new Intent(intent)); } }); } } protected void setSettingsComponent(ComponentName settings) { this.mSettingsComponent = settings; updateSettingsVisibility(); } }
[ "liming@droi.com" ]
liming@droi.com
3a513e15d2d5cdb5d9c82f7a48ecf57c04fa326f
d7307d249a3157c7757be75e22b365cb40c61ec5
/app/src/androidTest/java/com/wordpress/dixontechnologies/Mycashflow/firstTest.java
4c9abad6fe700e1c41502a792e71a51a4f3710a9
[]
no_license
kaizoku010/nusu-repo
8b2f9f37997a502281d0acd748ce630595f05c35
c56df4d251e5ce20ca362c0f1d2a110b5706a661
refs/heads/master
2020-09-16T07:56:49.747720
2019-11-24T15:48:35
2019-11-24T15:48:35
223,703,776
0
0
null
null
null
null
UTF-8
Java
false
false
2,745
java
package com.wordpress.dixontechnologies.Mycashflow; import android.support.test.espresso.DataInteraction; import android.support.test.espresso.ViewInteraction; import android.support.test.filters.LargeTest; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import static android.support.test.InstrumentationRegistry.getInstrumentation; import static android.support.test.espresso.Espresso.onData; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.Espresso.pressBack; import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static android.support.test.espresso.action.ViewActions.*; import static android.support.test.espresso.assertion.ViewAssertions.*; import static android.support.test.espresso.matcher.ViewMatchers.*; import com.wordpress.dixontechnologies.Mycashflow.R; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; import org.hamcrest.core.IsInstanceOf; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.anything; import static org.hamcrest.Matchers.is; @LargeTest @RunWith(AndroidJUnit4.class) public class firstTest { @Rule public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class); @Test public void firstTest() { ViewInteraction view = onView( allOf(childAtPosition( allOf(withId(R.id.drawer_layout), childAtPosition( withId(android.R.id.content), 0)), 0), isDisplayed())); view.check(matches(isDisplayed())); } private static Matcher<View> childAtPosition( final Matcher<View> parentMatcher, final int position) { return new TypeSafeMatcher<View>() { @Override public void describeTo(Description description) { description.appendText("Child at position " + position + " in parent "); parentMatcher.describeTo(description); } @Override public boolean matchesSafely(View view) { ViewParent parent = view.getParent(); return parent instanceof ViewGroup && parentMatcher.matches(parent) && view.equals(((ViewGroup) parent).getChildAt(position)); } }; } }
[ "dixontheworldvsy@gmail.com" ]
dixontheworldvsy@gmail.com
4b7755d18d8c308cfdf602076fb22bb71827c431
79cca9fdb341869a75ff0d165c8ce94a5e5d828b
/src/main/java/com/codeclan/example/filingsystem/FilingsystemApplication.java
dd0892acb1ccf77e163d53036ba7d64bb222ddf4
[]
no_license
ChikaKanu/hw_filingsystem
c24d32a6fffe47e78bf7ffb7ee34c438d1bf9253
8d97ef1b558c50ef235e4e680442b6c6993e0774
refs/heads/master
2020-05-07T11:35:00.572824
2019-04-10T09:15:02
2019-04-10T09:15:02
180,467,499
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.codeclan.example.filingsystem; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class FilingsystemApplication { public static void main(String[] args) { SpringApplication.run(FilingsystemApplication.class, args); } }
[ "chika.kanu@procompletions.com" ]
chika.kanu@procompletions.com
6798d8e0e7c25370f9a53f84f1d25c57278ae367
5591190509962cac061a5cbd7689a0c10cce6849
/KotlinLab05/src/main/java/JavaAnnotaion.java
d5ae23ad30a011e78197ce82fcb94aeaf01bbe8e
[]
no_license
khpproud/AndroidStudy-Kotlin-
46e255aad4c84f7fad902f7765aece31ff721eb2
23a29ebd532540a4bfe9a1f4b0ce5f4bccabc2f9
refs/heads/master
2022-06-27T18:57:12.801437
2020-02-02T07:23:14
2020-02-02T07:23:14
156,101,069
0
0
null
2022-06-20T22:41:42
2018-11-04T16:19:26
Kotlin
UTF-8
Java
false
false
82
java
public @interface JavaAnnotaion { int intValue(); String stringValue(); }
[ "proudkhp1@gmail.com" ]
proudkhp1@gmail.com
490bcdb0ebeea9e75745f5e9bb98d72a26a713a2
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
/tags/2007-06-29/seasar2-2.4.14/s2-framework/src/main/java/org/seasar/framework/convention/impl/PersistenceConventionImpl.java
deb2cfd8839ecf6009c31f1393c9dd55931d0c78
[ "Apache-2.0" ]
permissive
svn2github/s2container
54ca27cf0c1200a93e1cb88884eb8226a9be677d
625adc6c4e1396654a7297d00ec206c077a78696
refs/heads/master
2020-06-04T17:15:02.140847
2013-08-09T09:38:15
2013-08-09T09:38:15
10,850,644
0
1
null
null
null
null
UTF-8
Java
false
false
3,414
java
/* * Copyright 2004-2007 the Seasar Foundation and the Others. * * 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.seasar.framework.convention.impl; import org.seasar.framework.convention.PersistenceConvention; import org.seasar.framework.util.AssertionUtil; import org.seasar.framework.util.StringUtil; /** * {@link PersistenceConvention}の実装クラスです。 * * @author higa * */ public class PersistenceConventionImpl implements PersistenceConvention { private String ignoreTablePrefix; private boolean noNameConversion = false; /** * 無視するテーブルの<code>prefix</code>を返します。 * * @return 無視するテーブルの<code>prefix</code> */ public String getIgnoreTablePrefix() { return ignoreTablePrefix; } /** * 無視するテーブルの<code>prefix</code>を設定します。 * * @param ignoreTablePrefix */ public void setIgnoreTablePrefix(String ignoreTablePrefix) { this.ignoreTablePrefix = ignoreTablePrefix; } /** * 名前を変換しないかどうかを返します。 * * @return 名前を変換しないかどうか */ public boolean isNoNameConversion() { return noNameConversion; } /** * 名前を変換しないかどうかを設定します。 * * @param noNameConversion */ public void setNoNameConversion(boolean noNameConversion) { this.noNameConversion = noNameConversion; } public String fromTableNameToEntityName(String tableName) { AssertionUtil.assertNotNull("tableName", tableName); if (noNameConversion) { return tableName; } return StringUtil.camelize(StringUtil.trimPrefix(tableName, ignoreTablePrefix)); } public String fromEntityNameToTableName(String entityName) { AssertionUtil.assertNotNull("entityName", entityName); if (noNameConversion) { return entityName; } String tableName = StringUtil.decamelize(entityName); if (ignoreTablePrefix != null) { tableName = ignoreTablePrefix + tableName; } return tableName; } public String fromColumnNameToPropertyName(String columnName) { AssertionUtil.assertNotNull("columnName", columnName); if (noNameConversion) { return columnName; } return StringUtil.decapitalize(StringUtil.camelize(columnName)); } public String fromPropertyNameToColumnName(String propertyName) { AssertionUtil.assertNotNull("propertyName", propertyName); if (noNameConversion) { return propertyName; } return StringUtil.decamelize(propertyName); } }
[ "koichik@319488c0-e101-0410-93bc-b5e51f62721a" ]
koichik@319488c0-e101-0410-93bc-b5e51f62721a
0b825e38de776264bcb0216549ccad6e80c596b3
41f797af8a3a21881fedae0e0352dd867fd78faf
/singleton/src/main/java/strategy/model/PayState.java
b6b062428a659d4476384cd25a17f51a7144cd20
[]
no_license
dby521103/mywork
309879ca854bde096197700deed82e6e3b9ab28e
f46907926b18000b87988baa9817c6edd7cc2a4d
refs/heads/master
2020-03-26T05:25:14.316543
2018-08-15T09:07:28
2018-08-15T09:07:28
144,556,202
0
0
null
null
null
null
UTF-8
Java
false
false
399
java
package strategy.model; import strategy.pay.Pay; /** * 支付状态 */ public class PayState { private String code; public PayState(String code) { this.code = code; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } @Override public String toString() { return code; } }
[ "596963475@qq.com" ]
596963475@qq.com
42beda0ef114e19efae21b3de415066ae4440750
6da4fdcb5d447f04df5bdb81dd0a187a23ac330a
/src/main/java/codingdojo/parkingboy/exceotion/CarDuplicationException.java
d1dfecaa1b3c1caad2b5a56776f396bba024e0fe
[]
no_license
zhangzexing789/parkingboy
a53491b2462fb2d816b4a1a3aea6b195ef782ffa
dac4e5a75aceaf14acdfcadae37f375392409227
refs/heads/master
2020-03-24T01:04:45.298290
2018-09-11T15:12:24
2018-09-11T15:12:24
142,321,354
0
0
null
null
null
null
UTF-8
Java
false
false
108
java
package codingdojo.parkingboy.exceotion; public class CarDuplicationException extends RuntimeException { }
[ "1010761538@qq.com" ]
1010761538@qq.com
141a64115ad1607fbeacfe04d7170ace99c0abfe
0ccb46f085986808639013ceb945508fd13561b2
/heifeng-mall/heifeng-item/heifeng-item-interface/src/main/java/com/heifeng/item/api/BrandApi.java
f4e930655e637a84e481d282b8de8ccd326d6689
[]
no_license
LingFengX-code/items
c3c90514c88ab226e22b2677662bcb577c825c74
f309618f6788a6374746d4b70863fca7b5edfb31
refs/heads/master
2023-04-22T18:16:27.719601
2021-05-04T10:26:49
2021-05-04T10:26:49
364,217,445
0
0
null
null
null
null
UTF-8
Java
false
false
1,491
java
package com.heifeng.item.api; import com.heifeng.common.pojo.PageResult; import com.heifeng.item.pojo.Brand; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @RequestMapping("brand") public interface BrandApi { /* /page?key=&page=1&rows=5&sortBy=id&desc=false - page:当前页,int - rows:每页大小,int - sortBy:排序字段,String - desc:是否为降序,boolean - key:搜索关键词,String */ @GetMapping("/page") public PageResult<Brand> queryAll( @RequestParam(name = "key",required = false) String key, @RequestParam(name = "page",defaultValue = "1") Integer page, @RequestParam(name = "rows",defaultValue = "5") Integer rows, @RequestParam(name = "sortBy",required = false) String sortBy, @RequestParam(name = "desc",required = false) Boolean desc ); /* 根据商品分类id查询对应品牌(分类表和品牌表是多对多的关系) /cid/76 */ @GetMapping("/cid/{cid}") public List<Brand> queryBrandsByCid(@PathVariable(name = "cid") Long cid); /** * 根据品牌id查询品牌 * @param id * @return */ @GetMapping("/{id}") public Brand queryBrandById(@PathVariable("id")Long id); }
[ "1244535329@qq.com" ]
1244535329@qq.com
57f26f8639be17519114f3319fade7d104225702
a1036295b9dd861be94b952e1a73ba5e25bbbe53
/src/test/java/net/webpdf/ant/task/files/IterativeTaskFileTest.java
9e89ce24378e6050a0ff20ddd919bd2107fb81f3
[ "Apache-2.0" ]
permissive
softvision-dev/webpdf-ant
cf8f3656d49bc13247f72ba27eda7f532edcf728
35cf1a42b2398a04676df54ce7efce2264b1f168
refs/heads/master
2022-06-01T00:45:21.567902
2019-10-14T12:20:15
2019-10-14T12:20:15
113,323,196
0
0
Apache-2.0
2022-05-20T21:10:47
2017-12-06T13:57:24
Java
UTF-8
Java
false
false
8,643
java
package net.webpdf.ant.task.files; import net.webpdf.ant.TestResources; import net.webpdf.ant.task.Task; import net.webpdf.ant.task.TaskName; import net.webpdf.ant.task.variable.Variable; import net.webpdf.ant.task.variable.VariableRole; import org.apache.commons.io.FileUtils; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.File; import static org.junit.Assert.*; public class IterativeTaskFileTest { private final TestResources testResources = new TestResources(IterativeTaskFileTest.class); private TempDir tempDir; @Before public void prepare() { tempDir = new TempDir(); } @After public void cleanup() { tempDir.cleanTemp(); } @Test(expected = BuildException.class) public void invalidNullSource() { new IterativeTaskFile(null, "donald-duck.pdf", tempDir); } @Test(expected = BuildException.class) public void invalidNullTarget() { new IterativeTaskFile(testResources.getResource("donald-duck.jpg"), null, tempDir); } @Test(expected = BuildException.class) public void invalidNullTempDir() { new IterativeTaskFile(testResources.getResource("donald-duck.jpg"), "donald-duck.pdf", null); } @Test public void tempFileCreation() throws Exception { File source = testResources.getResource("donald-duck.jpg"); IterativeTaskFile iterativeTaskFile = new IterativeTaskFile(source, "donald-duck.pdf", tempDir); File target = iterativeTaskFile.getCurrentTarget(); assertTrue("The current target is not valid.", target.getAbsolutePath().startsWith(tempDir.getTempDir().getAbsolutePath()) && target.exists() && target.isFile() && target.canRead() && target.canWrite() && !target.equals(source)); } @Test public void tempFileIteration() throws Exception { File source = testResources.getResource("donald-duck.jpg"); IterativeTaskFile iterativeTaskFile = new IterativeTaskFile(source, "donald-duck.pdf", tempDir); iterativeTaskFile.prepareNextOperation(); assertEquals("Iteration before first call to target should do nothing.", iterativeTaskFile.getCurrentSource(), source); File target = iterativeTaskFile.getCurrentTarget(); assertTrue("The current target is not valid.", target.getAbsolutePath().startsWith(tempDir.getTempDir().getAbsolutePath()) && target.exists() && target.isFile() && target.canRead() && target.canWrite() && !target.equals(source)); iterativeTaskFile.prepareNextOperation(); File target2 = iterativeTaskFile.getCurrentTarget(); assertTrue("The current target is not valid.", target2.getAbsolutePath().startsWith(tempDir.getTempDir().getAbsolutePath()) && target2.exists() && target2.isFile() && target2.canRead() && target2.canWrite() && !target2.equals(source) && !target.equals(target2)); iterativeTaskFile.prepareNextOperation(); assertFalse("First target should have been deleted now.", target.exists()); assertEquals("Targets shall be used as sources of following steps.", target2, iterativeTaskFile.getCurrentSource()); iterativeTaskFile.reset(); assertEquals("OriginalSource should be regeneratable.", source, iterativeTaskFile.getCurrentSource()); } @Test public void dropTarget() throws Exception { File source = testResources.getResource("donald-duck.jpg"); IterativeTaskFile iterativeTaskFile = new IterativeTaskFile(source, "donald-duck.pdf", tempDir); File target = iterativeTaskFile.getCurrentTarget(); assertTrue("The current target is not valid.", target.getAbsolutePath().startsWith(tempDir.getTempDir().getAbsolutePath()) && target.exists() && target.isFile() && target.canRead() && target.canWrite() && !target.equals(source)); iterativeTaskFile.dropCurrentTarget(); assertTrue("Target should have been dropped and deleted.", !target.exists() && !target.equals(iterativeTaskFile.getCurrentTarget())); } @Test public void finalizeAndReset() throws Exception { File source = testResources.getResource("donald-duck.jpg"); IterativeTaskFile iterativeTaskFile = new IterativeTaskFile(source, "donald-duck.pdf", tempDir); File targetFile = new File(tempDir.getTempDir(), "out.pdf"); File previousTarget = iterativeTaskFile.getCurrentTarget(); File resultFile = iterativeTaskFile.finalizeAndReset(targetFile, null); assertTrue("Result should have been created in place of given file.", targetFile.exists() && targetFile.isFile() && targetFile.canRead() && targetFile.canWrite() && resultFile.equals(targetFile)); assertTrue("Source and target should have been reset.", iterativeTaskFile.getCurrentSource().equals(source) && !iterativeTaskFile.getCurrentTarget().equals(previousTarget) && !previousTarget.exists() ); targetFile = new File(tempDir.getTempDir(), "donald-duck.pdf"); previousTarget = iterativeTaskFile.getCurrentTarget(); resultFile = iterativeTaskFile.finalizeAndReset(null, tempDir.getTempDir()); assertTrue("Result should have been created in place of given file.", targetFile.exists() && targetFile.isFile() && targetFile.canRead() && targetFile.canWrite() && resultFile.equals(targetFile)); assertTrue("Source and target should have been reset.", iterativeTaskFile.getCurrentSource().equals(source) && !iterativeTaskFile.getCurrentTarget().equals(previousTarget) && !previousTarget.exists() ); assertEquals("The last processed file should have been returned.", iterativeTaskFile.getLastProcessed(), iterativeTaskFile.finalizeAndReset(null, null)); } @Test public void testChangeSource() throws Exception { File source = testResources.getResource("donald-duck.jpg"); File source2 = testResources.getResource("bmw_435.jpg"); FileUtils.copyFileToDirectory(source2, tempDir.getTempDir()); File copiedSource = new File(tempDir.getTempDir(), source2.getName()); IterativeTaskFile iterativeTaskFile = new IterativeTaskFile(source, "donald-duck.pdf", tempDir); iterativeTaskFile.setCurrentSource(copiedSource, false); iterativeTaskFile.getCurrentTarget(); assertEquals("Source should have been altered.", iterativeTaskFile.getCurrentSource(), copiedSource); iterativeTaskFile.prepareNextOperation(); assertFalse("Source should not have been preserved.", copiedSource.exists()); FileUtils.copyFileToDirectory(source2, tempDir.getTempDir()); iterativeTaskFile.setCurrentSource(copiedSource, true); iterativeTaskFile.getCurrentTarget(); assertEquals("Source should have been altered.", iterativeTaskFile.getCurrentSource(), copiedSource); iterativeTaskFile.prepareNextOperation(); assertTrue("Source should have been preserved.", copiedSource.exists()); iterativeTaskFile.reset(); assertEquals("Original source should have been restored.", source, iterativeTaskFile.getCurrentSource()); assertTrue(copiedSource.delete()); } @Test public void testPublish() throws Exception { File source = testResources.getResource("donald-duck.jpg"); IterativeTaskFile iterativeTaskFile = new IterativeTaskFile(source, "donald-duck.pdf", tempDir); File currentTarget = iterativeTaskFile.getCurrentTarget(); Variable var = new Variable(); var.setName("name"); var.setRole(VariableRole.OUTPUT); final Project proj = new Project(); Task task = new Task(TaskName.OPERATION) { @Override public void execute() throws BuildException { //DO NOTHING } @Override public Project getProject() { return proj; } }; var.setOwningTask(task); iterativeTaskFile.tryPublish(var); assertEquals("Value should have been published to project.", currentTarget.getAbsolutePath().replaceAll("\\\\", "/"), proj.getProperty("name")); } }
[ "cap@softvision.de" ]
cap@softvision.de
704ab59a94205cb33cfd4b98b400ef49cc72ed6c
15306edcc04b4bc34c6941a54d8e609bf3d774e4
/src/main/java/com/covoiturage/sn/service/MailService.java
6d37cefad07acd84c628b16ae18257a2b30e35cd
[]
no_license
L4p1ns/covoiturageJhipsterReact
bfe8c89580b2bb8f4b0cbe4e57a578be5c6716c7
30af15e6aec32ba2abccb192962dcf7d1790ce87
refs/heads/master
2022-12-26T13:15:00.807201
2019-09-17T11:19:16
2019-09-17T11:19:16
208,755,859
0
0
null
2022-12-16T05:03:28
2019-09-16T09:03:31
Java
UTF-8
Java
false
false
3,911
java
package com.covoiturage.sn.service; import com.covoiturage.sn.domain.User; import io.github.jhipster.config.JHipsterProperties; import java.nio.charset.StandardCharsets; import java.util.Locale; import javax.mail.internet.MimeMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.MessageSource; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.thymeleaf.context.Context; import org.thymeleaf.spring5.SpringTemplateEngine; /** * Service for sending emails. * <p> * We use the {@link Async} annotation to send emails asynchronously. */ @Service public class MailService { private final Logger log = LoggerFactory.getLogger(MailService.class); private static final String USER = "user"; private static final String BASE_URL = "baseUrl"; private final JHipsterProperties jHipsterProperties; private final JavaMailSender javaMailSender; private final MessageSource messageSource; private final SpringTemplateEngine templateEngine; public MailService(JHipsterProperties jHipsterProperties, JavaMailSender javaMailSender, MessageSource messageSource, SpringTemplateEngine templateEngine) { this.jHipsterProperties = jHipsterProperties; this.javaMailSender = javaMailSender; this.messageSource = messageSource; this.templateEngine = templateEngine; } @Async public void sendEmail(String to, String subject, String content, boolean isMultipart, boolean isHtml) { log.debug("Send email[multipart '{}' and html '{}'] to '{}' with subject '{}' and content={}", isMultipart, isHtml, to, subject, content); // Prepare message using a Spring helper MimeMessage mimeMessage = javaMailSender.createMimeMessage(); try { MimeMessageHelper message = new MimeMessageHelper(mimeMessage, isMultipart, StandardCharsets.UTF_8.name()); message.setTo(to); message.setFrom(jHipsterProperties.getMail().getFrom()); message.setSubject(subject); message.setText(content, isHtml); javaMailSender.send(mimeMessage); log.debug("Sent email to User '{}'", to); } catch (Exception e) { if (log.isDebugEnabled()) { log.warn("Email could not be sent to user '{}'", to, e); } else { log.warn("Email could not be sent to user '{}': {}", to, e.getMessage()); } } } @Async public void sendEmailFromTemplate(User user, String templateName, String titleKey) { Locale locale = Locale.forLanguageTag(user.getLangKey()); Context context = new Context(locale); context.setVariable(USER, user); context.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl()); String content = templateEngine.process(templateName, context); String subject = messageSource.getMessage(titleKey, null, locale); sendEmail(user.getEmail(), subject, content, false, true); } @Async public void sendActivationEmail(User user) { log.debug("Sending activation email to '{}'", user.getEmail()); sendEmailFromTemplate(user, "mail/activationEmail", "email.activation.title"); } @Async public void sendCreationEmail(User user) { log.debug("Sending creation email to '{}'", user.getEmail()); sendEmailFromTemplate(user, "mail/creationEmail", "email.activation.title"); } @Async public void sendPasswordResetMail(User user) { log.debug("Sending password reset email to '{}'", user.getEmail()); sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title"); } }
[ "bayendemba.seye@koonda.fr" ]
bayendemba.seye@koonda.fr
14849719aa695a4a2b0979e17e2a3e0e0ecd397f
78e8fb13adfbc44855c6a39f18add4d50178efeb
/template_android/app/src/main/java/com/example/template/utils/LanguageUtil.java
b972970b68a09f7b105b87468c6518c86c3a8bdf
[]
no_license
mostafatantawy99/template-android-with-backend
6f6c07e4b4ce1acff56089059fa92799063346e0
87eb545e450e3f79b8dc360a36585e755577a043
refs/heads/master
2021-05-06T16:06:08.569976
2017-12-07T17:42:26
2017-12-07T17:42:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,367
java
package com.example.template.utils; import android.content.Context; import android.content.res.Configuration; import android.util.Log; import com.example.template.R; import com.example.template.model.shareddata.Prefs; import java.util.Locale; /** * Created by omar on 6/15/2016. */ public class LanguageUtil { public static void setAppLanguage(Context context, String localeLang) { Prefs.putString(context.getString(R.string.language_prefs), localeLang); setDeviceLocale(context, localeLang); } public static String getAppLanguage(Context context) { String appLanguage = Prefs.getString(context.getString(R.string.language_prefs), context.getString(R.string.arabiclanguage_prefs)); setDeviceLocale(context, appLanguage); return appLanguage; } public static String getDeviceLocale() { Log.e("getDeviceLocale", Locale.getDefault().getISO3Language()); return Locale.getDefault().getISO3Language(); } private static void setDeviceLocale(Context context, String localeLang) { Locale locale = new Locale(localeLang); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics()); } }
[ "Net22@aratmgdomain.corp" ]
Net22@aratmgdomain.corp
98117d73c34113a755f45255b274e4589e3cda30
e2c5b17fad8cbe2099b1dff4258d344af5eec0fe
/src/com/biz/grade/dao/ScoreDaoImp.java
3fb7d1fe5b624556f1f625138dbddab8a7cb54ad
[]
no_license
haileyan/DBGrade_01
660ed3689b3b232c9cf871a9714b9ee1569ef92c
3e8f527232b97f070720b003d36ea9cc9fed6cce
refs/heads/master
2020-04-14T19:44:02.354953
2019-01-04T06:46:08
2019-01-04T06:46:08
164,069,282
0
0
null
null
null
null
UTF-8
Java
false
false
1,974
java
package com.biz.grade.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import com.biz.grade.vo.ScoreVO; public class ScoreDaoImp implements ScoreDao { Connection dbConn; public ScoreDaoImp() { // TODO Auto-generated constructor stub this.dbConnection(); } private void dbConnection() { String dbDriver = "oracle.jdbc.driver.OracleDriver"; try { // Driver Loading Class.forName(dbDriver); // DB 접속 profile String url = "jdbc:oracle:thin:@localhost:1521:xe"; String user = "gradeuser"; String password = "1234"; dbConn = DriverManager.getConnection(url, user, password); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void insert(ScoreVO vo) { // TODO Auto-generated method stub } @Override public List<ScoreVO> selectAll() { // TODO Auto-generated method stub return null; } @Override public ScoreVO findByNum(String sc_num) { // TODO 학생의 학번으로 점수조회 String sql = " SELECT * FROM tbl_score "; sql += " WHERE sc_num = '" + sc_num + "'"; PreparedStatement ps; try { ps = dbConn.prepareStatement(sql); ResultSet rs = ps.executeQuery(); if(rs.next()) { ScoreVO vo = new ScoreVO( rs.getString("sc_num"), rs.getInt("sc_kor"), rs.getInt("sc_eng"), rs.getInt("sc_math") ); return vo; } return null; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } @Override public int update(ScoreVO vo) { // TODO Auto-generated method stub return 0; } @Override public int delete(String sc_num) { // TODO Auto-generated method stub return 0; } }
[ "cocojey02@gmail.com" ]
cocojey02@gmail.com
24a3f285661c8a02dd448f227b1866c26c03f253
e84f11095bd5ed061065ceed972fbc71f2699ab8
/src/com/util/FileManager.java
336abd55b93ad213ddd1c0c215a12c79517c0768
[]
no_license
kimseunghyun-bg/semiProject_2nd
35dbe718e42af50d9b32b9e9c00c18e1449c1ff9
52ccb104861600563af6c5931f18068a02101a3e
refs/heads/master
2020-09-12T11:16:28.378873
2016-09-30T06:48:14
2016-09-30T06:48:14
67,651,495
0
0
null
null
null
null
UTF-8
Java
false
false
3,150
java
package com.util; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.OutputStream; import java.util.Calendar; import javax.servlet.http.HttpServletResponse; public class FileManager { /** * 파일 다운로드 메소드 * @param saveFilename 서버에저장된파일명 * @param originalFilename 클라이언트가업로드한파일명 * @param pathname 서버에저장된경로 * @param resp HttpServletResponse 객체 * @return 다운로드성공여부 */ public static boolean doFiledownload(String saveFilename, String originalFilename, String pathname, HttpServletResponse resp) { boolean flag=false; if(pathname==null || saveFilename==null || saveFilename.length()==0 || originalFilename==null || originalFilename.length()==0) { return flag; } try { originalFilename=new String( originalFilename.getBytes("euc-kr"), "8859_1"); pathname=pathname+File.separator+saveFilename; File f=new File(pathname); if(! f.exists()) { return flag; } // 클라이언트에게 전송할 문서타입이 스트림이라고 설정 resp.setContentType("application/octet-stream"); // 파일명은 헤더에 resp.setHeader("Content-disposition", "attachment;filename="+originalFilename); // 클라이언트에게 파일의 내용을 전송 byte[] b=new byte[1024]; BufferedInputStream bis= new BufferedInputStream( new FileInputStream(f)); // 클라이언트에게 전송할 출력 스트림 OutputStream os=resp.getOutputStream(); int n; while((n=bis.read(b, 0, b.length))!=-1) { os.write(b, 0, n); } os.flush(); os.close(); bis.close(); flag=true; } catch (Exception e) { System.out.println(e.toString()); } return flag; } /** * 파일 이름 변경(년월일시분초나노초) * @param pathname 파일이저장된 경로 * @param filename 변경할 파일명 * @return 새로운파일명 */ public static String doFilerename(String pathname, String filename) { String newname=""; String fileExt = filename.substring( filename.lastIndexOf(".")); String s = String.format( "%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", Calendar.getInstance()); s += System.nanoTime(); s += fileExt; try { File f1=new File(pathname+File.separator+filename); File f2=new File(pathname+File.separator+s); f1.renameTo(f2); newname = s; }catch(Exception e) { } return newname; } /** * 파일 삭제 * @param pathname 파일이 저장된 경로 * @param filename 삭제할 파일명 * @return 파일 삭제 성공 여부 */ public static boolean doFiledelete(String pathname, String filename) { String path=pathname+File.separator+filename; try { File f=new File(path); if(! f.exists()) // 파일이 없으면 return false; f.delete(); } catch (Exception e) { } return true; } }
[ "kimseunghyun.bg@gmail.com" ]
kimseunghyun.bg@gmail.com
9eacb886e674a2fd1cb1e83105e5276b3d58c1d8
16e346d6bad5cff796740af36ec4237946169f7f
/GoogleTraining/app/src/main/java/devrari/sandeep/googletraining/ReceiverFragment.java
5bd8111c7fb7fa0c243582a5703046c1a7d58052
[]
no_license
SandeepDevrari/android_code
6b61689d3baf0778fa8b9dc49b978595672314a1
f6136ec883830152bc7a272d612387052f0b0f4a
refs/heads/master
2020-06-14T04:22:29.672559
2019-07-02T16:17:26
2019-07-02T16:17:26
194,896,615
0
0
null
null
null
null
UTF-8
Java
false
false
1,972
java
package devrari.sandeep.googletraining; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; /** * Created by user on 24/3/18. */ public class ReceiverFragment extends Fragment { private View root; private TextView tv; private String flagName,flagDescreption; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { root=inflater.inflate(R.layout.fragment_receiver_layout,container,false); addTextView(); return root; } private void addTextView() { tv=root.findViewById(R.id.recieverScrollText); } @Override public void onResume() { super.onResume(); ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle("Flag Description ->"); } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); Bundle bundle=getArguments(); if(bundle!=null){ flagName=bundle.getString(FragmentToFragmentInterface.GET_THE_VALUE); //String tt="R.string."+flagName; flagDescreption=getResources().getString(getStringId()); tv.setText(flagDescreption); } } public int getStringId() { if(flagName.equals("United_Kingdom")){ return R.string.United_Kingdom; }else if(flagName.equals("Austria")){ return R.string.Austria; } else if(flagName.equals("Bangladesh")){ return R.string.Bangladesh; } return R.string.Bangladesh; } }
[ "sandeepdevrari77@gmail.com" ]
sandeepdevrari77@gmail.com
3f68eb3d996543ea9dea40f09d885b9f795aeb90
a06d7c64721f91f5f262ad8ff8d474ce0e46ff69
/Project/Practice/src/com/cyq7on/practice/other/Cisco.java
783c6029da08ba8e9f1f43fede4b4bcb68192c80
[ "Apache-2.0" ]
permissive
cyq7on/DataStructureAndAlgorithm
99ad9123598e4b49f4ccde5357d40fc65509b51d
aa1ee0cd4c8756ad345430f38b2a38a407716d6d
refs/heads/master
2021-01-22T07:25:17.298062
2020-10-19T12:37:30
2020-10-19T12:37:30
81,808,591
0
0
null
null
null
null
UTF-8
Java
false
false
880
java
package com.cyq7on.practice.other; import java.util.Scanner; public class Cisco { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String line = scanner.nextLine(); String[] split = line.substring(1, line.length() - 1).split(","); int[] arr = new int[split.length]; for (int i = 0; i < split.length; i++) { arr[i] = Integer.valueOf(split[i]); } System.out.println(canJump(arr)); } public static boolean canJump(int[] nums) { if (nums == null || nums.length == 0) { return false; } //pos表示需要到达的位置 int pos = nums.length - 1; for (int i = nums.length - 2; i >= 0; i--) { if (nums[i] + i >= pos) { pos = i; } } return pos == 0; } }
[ "cyq7on@qq.com" ]
cyq7on@qq.com
52944e8ebe628137ab2d072ee01484dcab0df797
03513b58b6b98a89bba6223bd41626db147af254
/src/l1j/server/server/model/item/function/WhiteThunderWand.java
375a847416561e00729ca516e420384d624ee5a6
[]
no_license
damageDown/ChoLong_KOR_Gamja_0805
9ea1ab6e3967fc95e546e163e8bd77f211696ad0
43261d5dde31b41a9852d19bfb3e09e7463793e6
refs/heads/master
2021-01-11T07:07:58.571241
2016-10-31T10:52:22
2016-10-31T10:52:22
72,427,743
0
2
null
null
null
null
UHC
Java
false
false
14,172
java
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package l1j.server.server.model.item.function; import static l1j.server.server.model.skill.L1SkillId.ABSOLUTE_BARRIER; import static l1j.server.server.model.skill.L1SkillId.COOKING_NEW_닭고기; import static l1j.server.server.model.skill.L1SkillId.COOKING_NEW_연어; import static l1j.server.server.model.skill.L1SkillId.COOKING_NEW_칠면조; import static l1j.server.server.model.skill.L1SkillId.COOKING_NEW_한우; import static l1j.server.server.model.skill.L1SkillId.COUNTER_MAGIC; import static l1j.server.server.model.skill.L1SkillId.DRAGON_SKIN; import static l1j.server.server.model.skill.L1SkillId.EARTH_BIND; import static l1j.server.server.model.skill.L1SkillId.ERASE_MAGIC; import static l1j.server.server.model.skill.L1SkillId.FEATHER_BUFF_A; import static l1j.server.server.model.skill.L1SkillId.FEATHER_BUFF_B; import static l1j.server.server.model.skill.L1SkillId.ICE_LANCE; import static l1j.server.server.model.skill.L1SkillId.MOB_BASILL; import static l1j.server.server.model.skill.L1SkillId.PATIENCE; import static l1j.server.server.model.skill.L1SkillId.REDUCTION_ARMOR; import static l1j.server.server.model.skill.L1SkillId.SPECIAL_COOKING; import static l1j.server.server.model.skill.L1SkillId.SPECIAL_COOKING2; import static l1j.server.server.model.skill.L1SkillId.STATUS_FREEZE; import static l1j.server.server.model.skill.L1SkillId.메티스정성스프; import static l1j.server.server.model.skill.L1SkillId.메티스정성요리; import static l1j.server.server.model.skill.L1SkillId.메티스축복주문서; import static l1j.server.server.model.skill.L1SkillId.싸이매콤한라면; import static l1j.server.server.model.skill.L1SkillId.싸이시원한음료; import java.util.Random; import l1j.server.server.clientpackets.ClientBasePacket; import l1j.server.server.model.Broadcaster; import l1j.server.server.model.CharPosUtil; import l1j.server.server.model.L1Character; import l1j.server.server.model.L1ItemDelay; import l1j.server.server.model.L1Object; import l1j.server.server.model.L1PcInventory; import l1j.server.server.model.L1PinkName; import l1j.server.server.model.L1World; import l1j.server.server.model.Instance.L1DollInstance; import l1j.server.server.model.Instance.L1ItemInstance; import l1j.server.server.model.Instance.L1MonsterInstance; import l1j.server.server.model.Instance.L1NpcInstance; import l1j.server.server.model.Instance.L1NpcShopInstance; import l1j.server.server.model.Instance.L1PcInstance; import l1j.server.server.model.skill.L1SkillId; import l1j.server.server.serverpackets.S_ItemName; import l1j.server.server.serverpackets.S_ServerMessage; import l1j.server.server.serverpackets.S_SkillSound; import l1j.server.server.serverpackets.S_UseAttackSkill; import l1j.server.server.templates.L1EtcItem; import l1j.server.server.templates.L1Item; @SuppressWarnings("serial") public class WhiteThunderWand extends L1ItemInstance { private static Random _random = new Random(System.nanoTime()); public WhiteThunderWand(L1Item item) { super(item); } @Override public void clickItem(L1Character cha, ClientBasePacket packet) { if (cha instanceof L1PcInstance) { L1PcInstance pc = (L1PcInstance) cha; if (pc.attacking) return; L1ItemInstance useItem = pc.getInventory().getItem(this.getId()); int spellsc_objid = 0; int spellsc_x = 0; int spellsc_y = 0; spellsc_objid = packet.readD(); spellsc_x = packet.readH(); spellsc_y = packet.readH(); int delay_id = 0; delay_id = ((L1EtcItem) useItem.getItem()).get_delayid(); if (delay_id != 0) { // 지연 설정 있어 if (pc.hasItemDelay(delay_id) == true) { return; } } if (pc.isInvisble()) { pc.sendPackets(new S_ServerMessage(1003), true); return; } L1Object target = L1World.getInstance().findObject(spellsc_objid); pc.cancelAbsoluteBarrier(); int heding = CharPosUtil.targetDirection(pc, spellsc_x, spellsc_y); pc.getMoveState().setHeading(heding); if (target != null) { doWandAction(pc, target); } else { pc.sendPackets(new S_UseAttackSkill(pc, 0, 11736, spellsc_x, spellsc_y, 17), true); Broadcaster.broadcastPacket(pc, new S_UseAttackSkill(pc, 0, 11736, spellsc_x, spellsc_y, 17), true); } pc.플레이어상태 = pc.공격_상태; pc.상태시간 = System.currentTimeMillis() + 2000; pc.getInventory().updateItem(useItem, L1PcInventory.COL_COUNT); L1ItemDelay.onItemUse(pc, useItem); // 아이템 지연 개시 pc.getInventory().removeItem(useItem, 1); /** 2011.07.01 고정수 수량성 아이템 미확인으로 되는 문제 */ if (useItem.isIdentified()) { useItem.setIdentified(true); pc.sendPackets(new S_ItemName(useItem), true); } } } private void doWandAction(L1PcInstance user, L1Object target) { if (!(target instanceof L1Character)) { return; } if (CharPosUtil.isAreaAttack(user, target.getX(), target.getY(), target.getMapId()) == false) { return; // 직선상에 장애물이 있다 } if (CharPosUtil.isAreaAttack((L1Character) target, user.getX(), user.getY(), user.getMapId()) == false) { return; // 직선상에 장애물이 있다 } // XXX 적당한 데미지 계산, 요점 수정 int dmg = ((_random.nextInt(11) + 1) + user.getAbility().getTotalStr() / 4) * 2; dmg = Math.max(22, dmg); if (target instanceof L1PcInstance) { L1PcInstance pc = (L1PcInstance) target; /* * if (user.getId() == target.getId()) { return; // 자기 자신에게 맞혔다 } */ if (CharPosUtil.getZoneType(pc) == 1 || user.checkNonPvP(user, pc) || CharPosUtil.getZoneType(user) == 1 || (pc.getSkillEffectTimerSet().hasSkillEffect( SPECIAL_COOKING) && pc.getSkillEffectTimerSet() .hasSkillEffect(SPECIAL_COOKING2))) { // 스페셜요리에 의한 // 데미지 경감) { if (!pc.isGmInvis() && pc.isInvisble()) { pc.delInvis(); } // user.sendPackets(new S_AttackPacket(user, pc.getId(), // ActionCodes.ACTION_Wand)); // Broadcaster.broadcastPacket(user, new S_AttackPacket(user, // pc.getId(), ActionCodes.ACTION_Wand)); user.sendPackets(new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc.getY(), 17, 0), true); Broadcaster.broadcastPacket(user, new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc.getY(), 17, 0), true); L1PinkName.onAction(pc, user); return; } if (pc.getSkillEffectTimerSet().hasSkillEffect( L1SkillId.FOG_OF_SLEEPING)) pc.getSkillEffectTimerSet().removeSkillEffect( L1SkillId.FOG_OF_SLEEPING); if (isFreeze(pc) || isUseCounterMagic(pc)) { // user.sendPackets(new S_AttackPacket(user, pc.getId(), // ActionCodes.ACTION_Wand)); // Broadcaster.broadcastPacket(user, new S_AttackPacket(user, // pc.getId(), ActionCodes.ACTION_Wand)); user.sendPackets(new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc.getY(), 17, 0), true); Broadcaster.broadcastPacket(user, new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc.getY(), 17, 0), true); L1PinkName.onAction(pc, user); return; } if (pc.getSkillEffectTimerSet().hasSkillEffect(ERASE_MAGIC)) pc.getSkillEffectTimerSet().removeSkillEffect(ERASE_MAGIC); L1PinkName.onAction(pc, user); int 리덕 = 리덕(pc); if (리덕 > 100) { user.sendPackets(new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc.getY(), 17, 0), true); Broadcaster.broadcastPacket(user, new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc.getY(), 17, 0), true); return; } user.sendPackets( new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc .getY(), 17), true); Broadcaster.broadcastPacket( user, new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc .getY(), 17), true); int newHp = pc.getCurrentHp() - dmg; if (newHp > 0) { if (!pc.isGmInvis() && pc.isInvisble()) { pc.delInvis(); } // pc.sendPackets(new S_AttackPacket(pc, 0, // ActionCodes.ACTION_Damage)); // Broadcaster.broadcastPacket(pc, new S_AttackPacket(pc, 0, // ActionCodes.ACTION_Damage)); pc.setCurrentHp(newHp); } else if (newHp <= 0 && pc.isGm()) { pc.setCurrentHp(pc.getMaxHp()); } else if (newHp <= 0 && !pc.isGm()) { pc.death(user); } } else if (target instanceof L1MonsterInstance) { L1MonsterInstance mob = (L1MonsterInstance) target; user.sendPackets( new S_UseAttackSkill(user, mob.getId(), 11736, mob.getX(), mob.getY(), 17), true); Broadcaster.broadcastPacket(user, new S_UseAttackSkill(user, mob.getId(), 11736, mob.getX(), mob.getY(), 17), true); // Broadcaster.broadcastPacket(mob, new S_AttackPacketForNpc(user, // mob.getId(), 2)); mob.receiveDamage(user, dmg); } else if (target instanceof L1NpcInstance) { L1NpcInstance npc = (L1NpcInstance) target; if (npc instanceof L1NpcShopInstance) { L1NpcShopInstance pc = (L1NpcShopInstance) npc; if (CharPosUtil.getZoneType(pc) == 1 || user.checkNonPvP(user, pc) || CharPosUtil.getZoneType(user) == 1) { user.sendPackets(new S_UseAttackSkill(user, pc.getId(), 11736, pc.getX(), pc.getY(), 17, 0), true); Broadcaster.broadcastPacket(user, new S_UseAttackSkill( user, pc.getId(), 11736, pc.getX(), pc.getY(), 17, 0), true); return; } } user.sendPackets( new S_UseAttackSkill(user, npc.getId(), 11736, npc.getX(), npc.getY(), 17), true); Broadcaster.broadcastPacket(user, new S_UseAttackSkill(user, npc.getId(), 11736, npc.getX(), npc.getY(), 17), true); // Broadcaster.broadcastPacket(npc, new S_DoActionGFX(npc.getId(), // ActionCodes.ACTION_Damage)); } } private boolean isUseCounterMagic(L1Character cha) { if (cha.getSkillEffectTimerSet().hasSkillEffect(COUNTER_MAGIC)) { cha.getSkillEffectTimerSet().removeSkillEffect(COUNTER_MAGIC); Broadcaster.broadcastPacket(cha, new S_SkillSound(cha.getId(), 10702), true); if (cha instanceof L1PcInstance) { L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_SkillSound(pc.getId(), 10702), true); } return true; } return false; } private int 리덕(L1PcInstance pc) { // TODO 자동 생성된 메소드 스텁 int 리덕 = 0; /** 마법인형 돌골램 **/ if (pc.getDollList().size() > 0) { for (L1DollInstance doll : pc.getDollList()) { 리덕 += doll.getDamageReductionByDoll(); } } 리덕 += pc.getDamageReductionByArmor(); // 방어용 기구에 의한 데미지 경감 if (pc.getSkillEffectTimerSet().hasSkillEffect(SPECIAL_COOKING)) { // 스페셜요리에 // 의한 // 데미지 // 경감 리덕 += 5; } if (pc.getSkillEffectTimerSet().hasSkillEffect(SPECIAL_COOKING2)) { 리덕 += 5; } if (pc.getSkillEffectTimerSet().hasSkillEffect(COOKING_NEW_닭고기) || pc.getSkillEffectTimerSet().hasSkillEffect(COOKING_NEW_연어) || pc.getSkillEffectTimerSet().hasSkillEffect(COOKING_NEW_칠면조) || pc.getSkillEffectTimerSet().hasSkillEffect(COOKING_NEW_한우)) { 리덕 += 2; } if (pc.getSkillEffectTimerSet().hasSkillEffect(메티스정성스프) || pc.getSkillEffectTimerSet().hasSkillEffect(싸이시원한음료)) 리덕 += 5; if (pc.getSkillEffectTimerSet().hasSkillEffect(메티스정성요리) || pc.getSkillEffectTimerSet().hasSkillEffect(싸이매콤한라면)) 리덕 += 5; if (pc.getSkillEffectTimerSet().hasSkillEffect(메티스축복주문서) || pc.getSkillEffectTimerSet().hasSkillEffect(L1SkillId.흑사의기운)) 리덕 += 3; // 키링크 아닐때만 추가 if (pc.getSkillEffectTimerSet().hasSkillEffect(REDUCTION_ARMOR)) { int targetPcLvl = pc.getLevel(); if (targetPcLvl < 50) { targetPcLvl = 50; } int dmg2 = (targetPcLvl - 40) / 3 - 3; 리덕 += dmg2 > 0 ? dmg2 : 0;// +1 } L1ItemInstance 반역자의방패 = pc.getInventory().checkEquippedItem(21093); if (반역자의방패 != null) { int chance = 반역자의방패.getEnchantLevel() * 2; if (_random.nextInt(100) <= chance) { 리덕 += 50; pc.sendPackets(new S_SkillSound(pc.getId(), 6320)); Broadcaster.broadcastPacket(pc, new S_SkillSound(pc.getId(), 6320)); } } if (pc.getSkillEffectTimerSet().hasSkillEffect(DRAGON_SKIN)) { 리덕 += 5; } if (pc.getSkillEffectTimerSet().hasSkillEffect(PATIENCE)) { 리덕 += 2; } if (pc.getSkillEffectTimerSet().hasSkillEffect(FEATHER_BUFF_A)) { 리덕 += 3; } if (pc.getSkillEffectTimerSet().hasSkillEffect(FEATHER_BUFF_B)) { 리덕 += 2; } if (pc.isAmorGaurd) { // 아머가드에의한 데미지감소 int d = pc.getAC().getAc() / 10; if (d < 0) { 리덕 -= d; } else { 리덕 += d; } } return 리덕; } public boolean isFreeze(L1PcInstance pc) { if (pc.getSkillEffectTimerSet().hasSkillEffect(STATUS_FREEZE) || pc.getSkillEffectTimerSet().hasSkillEffect(ABSOLUTE_BARRIER) || pc.getSkillEffectTimerSet().hasSkillEffect(ICE_LANCE) || pc.getSkillEffectTimerSet().hasSkillEffect(EARTH_BIND) || pc.getSkillEffectTimerSet().hasSkillEffect( L1SkillId.STATUS_안전모드) || pc.getSkillEffectTimerSet().hasSkillEffect(MOB_BASILL)) { return true; } return false; } }
[ "noorygo@gmail.com" ]
noorygo@gmail.com
5914382c6c1248dc45996581b4cffb7085905567
7d5920809b5628e775d34c4b09315c135fdbcf1f
/transportable-udfs-hive/src/main/java/com/linkedin/transport/hive/typesystem/HiveTypeInference.java
fdafd2445827cce3b4d37cd3102040fa954447d9
[ "Apache-2.0", "BSD-2-Clause" ]
permissive
linkedin/transport
124d54f2232709ae755edb99c47b0a7f0c736c8e
1adf4f4a7d38a5a46d9f57f38e1d68f348b9ad44
refs/heads/master
2023-09-06T09:09:45.627966
2023-06-08T12:26:38
2023-06-08T12:26:38
157,273,136
285
79
BSD-2-Clause
2023-06-08T20:41:00
2018-11-12T20:34:12
Java
UTF-8
Java
false
false
1,247
java
/** * Copyright 2018 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.transport.hive.typesystem; import com.linkedin.transport.api.StdFactory; import com.linkedin.transport.hive.HiveFactory; import com.linkedin.transport.typesystem.AbstractBoundVariables; import com.linkedin.transport.typesystem.AbstractTypeFactory; import com.linkedin.transport.typesystem.AbstractTypeInference; import com.linkedin.transport.typesystem.AbstractTypeSystem; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; public class HiveTypeInference extends AbstractTypeInference<ObjectInspector> { @Override protected AbstractTypeSystem<ObjectInspector> getTypeSystem() { return new HiveTypeSystem(); } @Override protected AbstractBoundVariables<ObjectInspector> createBoundVariables() { return new HiveBoundVariables(); } @Override protected StdFactory createStdFactory(AbstractBoundVariables<ObjectInspector> boundVariables) { return new HiveFactory(boundVariables); } @Override protected AbstractTypeFactory<ObjectInspector> getTypeFactory() { return new HiveTypeFactory(); } }
[ "wmoustafa@linkedin.com" ]
wmoustafa@linkedin.com
a514847906bfdb98c7b154cde1f5e6bbc6c6bf8e
749dd3ec820ea0969ce31579841a47a0519170d8
/BinarySearchTree/src/LowestCommonAncestorOfABinarySearchTree.java
fdba4e0713e9adb1d22ffffd5f8e74a4ee657c54
[]
no_license
ylu6/leet
5d5441f10f89779458b0bb46e435655af2852a35
0a45094e2c3041d0600783dd7445b798ea0cda06
refs/heads/master
2020-03-25T15:55:18.250594
2018-09-14T17:49:45
2018-09-14T17:49:45
143,907,113
0
0
null
null
null
null
UTF-8
Java
false
false
1,573
java
public class LowestCommonAncestorOfABinarySearchTree { // if root.val < p.val, candidate must in the right sub-tree: root.right // if root.val > q.val, candidate must in the left sub-tree: root.left // if root.val >= p.val && root.val <= q.val, root must be the lowest common ancestor, why? // if we go lower, to root.left, then q is not in this sub-tree, because there is no duplicate // if we go root.right, then p is not in this sub-tree public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { if(p.val > q.val) return lowestCommonAncestor(root, q, p); if(root.val > q.val) { return lowestCommonAncestor(root.left, p, q); // go left } else if (root.val < p.val) { return lowestCommonAncestor(root.right, p, q); } else{ return root; } } // v2: iterative approach public TreeNode lowestCommonAncestor2(TreeNode root, TreeNode p, TreeNode q) { if (p.val > q.val) return lowestCommonAncestor(root, q, p); while(true) { if(root.val > q.val) root = root.left; else if (root.val < p.val) root = root.right; else break; } return root; } public static void main(String[] args) { TreeNode root = new TreeNode(1); root.right = new TreeNode(2); LowestCommonAncestorOfABinarySearchTree sol = new LowestCommonAncestorOfABinarySearchTree(); System.out.println(sol.lowestCommonAncestor(root, new TreeNode(1), new TreeNode(2)).val); } }
[ "snakelu28@gmail.com" ]
snakelu28@gmail.com
0c24ed4ee242a9c6189a14a93b6e00d0cfb87d29
c9a6bef0acd2c704ba0c7dc25a964b6bd08e78a4
/app/src/main/java/com/driver/hire_me/WaveDrawable.java
5cb62e0f883b22478bdee45a8270cde07a105409
[]
no_license
bluesky66-dev/HireMe-Driver
a97fa64ec5933869c80b8b61903c99816cff8ca5
863f3c3e0ae011025cc1bd69e61e2f48ee3a2555
refs/heads/master
2022-02-25T18:27:58.145909
2019-11-14T13:15:17
2019-11-14T13:15:17
221,701,362
1
0
null
null
null
null
UTF-8
Java
false
false
3,794
java
package com.driver.hire_me; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.view.animation.Animation; import android.view.animation.Interpolator; public class WaveDrawable extends Drawable { private Paint wavePaint; private int color; private int radius; private long animationTime = 2000; protected float waveScale; protected int alpha; private Interpolator waveInterpolator; private Interpolator alphaInterpolator; private Animator animator; private AnimatorSet animatorSet; /** * @param color color * @param radius radius * @param animationTime time */ public WaveDrawable(int color, int radius, long animationTime) { this(color, radius); this.animationTime = animationTime; } /** * @param color colro * @param radius radius */ public WaveDrawable(int color, int radius) { this.color = color; this.radius = radius; this.waveScale = 0f; this.alpha = 255; wavePaint = new Paint(Paint.ANTI_ALIAS_FLAG); animatorSet = new AnimatorSet(); } @Override public void draw(Canvas canvas) { final Rect bounds = getBounds(); // circle wavePaint.setStyle(Paint.Style.FILL); wavePaint.setColor(color); wavePaint.setAlpha(alpha); canvas.drawCircle(bounds.centerX(), bounds.centerY(), radius * waveScale, wavePaint); } /** * @param interpolator interpolator */ public void setWaveInterpolator(Interpolator interpolator) { this.waveInterpolator = interpolator; } public void setAlphaInterpolator(Interpolator interpolator) { this.alphaInterpolator = interpolator; } public void startAnimation() { animator = generateAnimation(); animator.start(); } public void stopAnimation() { if (animator.isRunning()) { animator.end(); } } public boolean isAnimationRunning() { if (animator != null) { return animator.isRunning(); } return false; } @Override public void setAlpha(int alpha) { this.alpha = alpha; invalidateSelf(); } @Override public void setColorFilter(ColorFilter cf) { wavePaint.setColorFilter(cf); } @Override public int getOpacity() { return wavePaint.getAlpha(); } protected void setWaveScale(float waveScale) { this.waveScale = waveScale; invalidateSelf(); } protected float getWaveScale() { return waveScale; } private Animator generateAnimation() { //Wave animation ObjectAnimator waveAnimator = ObjectAnimator.ofFloat(this, "waveScale", 0f, 1f); waveAnimator.setDuration(animationTime); if (waveInterpolator != null) { waveAnimator.setInterpolator(waveInterpolator); } //The animation is repeated waveAnimator.setRepeatCount(Animation.INFINITE); waveAnimator.setRepeatMode(Animation.INFINITE); //alpha animation ObjectAnimator alphaAnimator = ObjectAnimator.ofInt(this, "alpha", 255, 0); alphaAnimator.setDuration(animationTime); if (alphaInterpolator != null) { alphaAnimator.setInterpolator(alphaInterpolator); } alphaAnimator.setRepeatCount(Animation.INFINITE); alphaAnimator.setRepeatMode(Animation.INFINITE); animatorSet.playTogether(waveAnimator, alphaAnimator); return animatorSet; } }
[ "newstar@gmail.com" ]
newstar@gmail.com
2bdfd08ed677cc97e0e96ce026eabfdcd29a216f
4fec891b42d8d9b0d52d271214fc71862ad38099
/app/src/main/java/com/deepshooter/solidprinciples/lsp/withlsp/Member.java
5faa371cb258b29f98bbabc1cff7d90e7e23a73a
[]
no_license
deepshooter/SolidPrinciples
ca3c452df3f1c9bb87f63ba9f99e8caef3fb0172
2d7d7036c2e088a4665c69d990ebf250537747c2
refs/heads/master
2020-04-14T07:24:03.054889
2019-01-06T04:27:57
2019-01-06T04:27:57
163,710,958
0
0
null
null
null
null
UTF-8
Java
false
false
2,041
java
package com.deepshooter.solidprinciples.lsp.withlsp; import java.util.Calendar; import java.util.Date; /** * Created by avinashmishra on 28/12/18. */ public abstract class Member implements IDatabase,IBooking { String name; String memberType; Date startDate; Date endDate; public Member(String name) { this.name = name; } public static class LifeTimeMember extends Member { public LifeTimeMember(String name,Date mStartDate) { super(name); this.memberType = "LifeTime"; this.startDate = mStartDate; Calendar calendar = Calendar.getInstance(); calendar.setTime(this.startDate); calendar.add(Calendar.YEAR,70); this.endDate = calendar.getTime(); } @Override public void addToDatabase() { System.out.println("Added the LifeTime Member info to DB"); } @Override public void MakeBooking() { System.out.println("Court is Booked for the LifeTime Member"); } } public static class AnnualMember extends Member { public AnnualMember(String name,Date mStartDate) { super(name); this.memberType = "Annual"; this.startDate = mStartDate; Calendar calendar = Calendar.getInstance(); calendar.setTime(this.startDate); calendar.add(Calendar.YEAR,1); this.endDate = calendar.getTime(); } @Override public void addToDatabase() { System.out.println("Added the Annual Member info to DB"); } @Override public void MakeBooking() { System.out.println("Court is Booked for the Annual Member"); } } public static class Enquiry implements IDatabase { public Enquiry(String name) { } @Override public void addToDatabase() { System.out.println("Added the Enquiry info to DB"); } } }
[ "avinashm720@gmail.com" ]
avinashm720@gmail.com
fd1ce91367e035021db22ca82cd56eebd98ff205
0e1797116f64c31d17b595f51f36a4bf3514c99b
/WayneDowrs/android/app/src/main/java/com/waynedowrs/MainApplication.java
21383c19711aa22973f1b862902fef8e559fbd09
[]
no_license
lixanfajardo/MyTrainingRepo
36da186c77e10dc509cab420cf2b80f6f971bbe1
900458ec55d17600302bd55f04eadada18589b9b
refs/heads/master
2021-10-11T02:07:32.454734
2019-01-21T10:14:36
2019-01-21T10:14:36
106,519,504
0
0
null
null
null
null
UTF-8
Java
false
false
1,238
java
package com.waynedowrs; import android.app.Application; import com.facebook.react.ReactApplication; import com.oblador.vectoricons.VectorIconsPackage; import org.devio.rn.splashscreen.SplashScreenReactPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new SplashScreenReactPackage(), new VectorIconsPackage() ); } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }
[ "lixan@bywave.com.au" ]
lixan@bywave.com.au
77598ef6743259867c0229f6b32cf497daa43f04
bbfd72803aa4861bd5db40475dfcf3b1aa830320
/shiro-easy/src/main/java/co/goho/qingxu/easy/shiro/service/PasswordService.java
f8ddf083bd67e8e68832814b041e5c48be941add
[]
no_license
qingxu520/spring-boot
6838a8c2540b91b0c274a5b104bf6b991dfecc36
d07cd96bfd24ad4ba45828cb929b2fae783e809a
refs/heads/master
2022-11-03T10:39:42.189480
2019-10-17T01:40:16
2019-10-17T01:40:16
211,595,962
0
0
null
2022-10-12T20:32:44
2019-09-29T03:15:43
HTML
UTF-8
Java
false
false
2,166
java
package co.goho.qingxu.easy.shiro.service; import co.goho.qingxu.easy.bean.SysUser; import co.goho.qingxu.easy.conmmon.constant.ShiroConstants; import co.goho.qingxu.easy.exception.user.UserPasswordNotMatchException; import co.goho.qingxu.easy.exception.user.UserPasswordRetryLimitCountException; import org.apache.shiro.cache.Cache; import org.apache.shiro.cache.CacheManager; import org.apache.shiro.crypto.hash.Md5Hash; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; import java.util.concurrent.atomic.AtomicInteger; @Component public class PasswordService { @Autowired private CacheManager cacheManager; private Cache<String, AtomicInteger> loginRecordCache; @Value(value = "${user.password.maxRetryCount}") private Integer maxRetryCount; @PostConstruct public void init(){ loginRecordCache=cacheManager.getCache(ShiroConstants.LOGINRECORDCACHE); } public void validate(SysUser sysUser,String passWord){ String userName=sysUser.getUserName(); AtomicInteger retryCount = loginRecordCache.get(userName); if(retryCount==null){ retryCount=new AtomicInteger(0); loginRecordCache.put(userName,retryCount); } //递增 if(retryCount.incrementAndGet()>maxRetryCount){ throw new UserPasswordRetryLimitCountException(maxRetryCount); } if(!matches(sysUser,passWord)){ throw new UserPasswordNotMatchException(); }else { loginRecordCache.remove(userName); } } public boolean matches(SysUser user, String newPassword) { return user.getPassWord().equals(encryptPassword(user.getUserName(), newPassword, user.getSalt())); } /** * 加密 * @param username * @param password * @param salt * @return */ public String encryptPassword(String username, String password, String salt) { return new Md5Hash(username + password + salt).toHex().toString(); } }
[ "342643974@qq.com" ]
342643974@qq.com