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
09a1e6faae00e5d751d8ebcf460e8005c97a37be
78a0e02c72cae1bad1d077934d6d2c8986ae8bf2
/src/main/java/com/ruyicai/analyze/controller/ResponseData.java
42d51b116a2760cdce9ca73f8996c6c8134773cb
[]
no_license
xiaowaizhuanshu/analyze
82c4c6d949563e200755695063cccfee465f71f2
1eb5300170c8885e34077016ec4e06d9e3f4e0bc
refs/heads/master
2016-09-06T18:15:45.985144
2013-07-24T05:50:38
2013-07-24T05:50:38
11,918,572
1
1
null
null
null
null
UTF-8
Java
false
false
385
java
package com.ruyicai.analyze.controller; public class ResponseData { private String errorCode; private Object value; public String getErrorCode() { return errorCode; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public Object getValue() { return value; } public void setValue(Object value) { this.value = value; } }
[ "dongxiaozhe@boyacai.com" ]
dongxiaozhe@boyacai.com
b1acca040c1a1d6c917f1c9388e4a73d1a1398fe
fb97dfed9c7e6218093c3761e494ce027b4c8bcf
/PROZchat/ServerAppChat/src/pl/krzyszczak/mikolaj/serverchat/exceptions/UserNotFoundException.java
378506d7153d1df7ce5c53e1fbb7323c09c4b4a4
[]
no_license
miki285/PROZchat
d3684e5634f6df40e06713fbe3d8deed1266e4e7
d8e5f22af98da79b9b0c2f7861f4b3e23cbbcba8
refs/heads/master
2020-12-31T06:56:21.858726
2018-05-15T14:49:58
2018-05-15T14:49:58
35,534,343
0
0
null
null
null
null
UTF-8
Java
false
false
179
java
package pl.krzyszczak.mikolaj.serverchat.exceptions; public class UserNotFoundException extends Exception{ /** * */ private static final long serialVersionUID = 1L; }
[ "miwo.krzyszczak@gmail.com" ]
miwo.krzyszczak@gmail.com
2a090cae7bfd83a18afb99a7dfb8843468767ae5
36d524907b16ccfe370ff4af7fa52488dd6834e4
/simple-paging/src/web/DetailServlet.java
9330744dea8a5cac750bcd3be083d035d5bb157d
[]
no_license
astute22/web-p
4d08f254e22086e24874d5434840a35e0d9b262d
18e1138dea0fe32602d35333fde72c9ff1620ffe
refs/heads/master
2021-01-21T12:16:13.358428
2017-10-16T08:45:55
2017-10-16T08:45:55
102,056,062
0
0
null
null
null
null
UTF-8
Java
false
false
2,688
java
package web; import java.io.IOException; import java.io.PrintWriter; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import dao.EmployeeDao; import util.StringUtils; import vo.Employee; @WebServlet("/detail.html") public class DetailServlet extends HttpServlet{ @Override protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { int employeeId = StringUtils.strToNumber(req.getParameter("id")); int p = StringUtils.strToNumber(req.getParameter("p"), 1); try { EmployeeDao dao = new EmployeeDao(); Employee employee = dao.getEmployeeById(employeeId); res.setContentType("text/html;charset=utf-8"); PrintWriter pw = res.getWriter(); pw.println("<!DOCTYPE html>"); pw.println("<html lang='ko'>"); pw.println("<head>"); pw.println("<meta charset='UTF-8'>"); pw.println("<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>"); pw.println("<title>게시판 :: 상세정보</title>"); pw.println("</head>"); pw.println("<body>"); pw.println("<div class='container'>"); pw.println(" <h1>상세정보</h1>"); pw.println(" <table class='table table-bordered table condensed'>"); pw.println(" <tr>"); pw.println(" <th>id</th><td>"+employee.getId()+"</td>"); pw.println(" <th>department</th><td>"+employee.getDepartmentId()+"</td>"); pw.println(" </tr>"); pw.println(" <tr>"); pw.println(" <th>first name</th><td>"+employee.getFirstname()+"</td>"); pw.println(" <th>last name</th><td>"+employee.getLastname()+"</td>"); pw.println(" </tr>"); pw.println(" <tr>"); pw.println(" <th>email</th><td>"+employee.getEmail()+"</td>"); pw.println(" <th>phone</th><td>"+employee.getPhoneNumber()+"</td>"); pw.println(" </tr>"); pw.println(" <tr>"); pw.println(" <th>salary</th><td>"+employee.getSalary()+"</td>"); pw.println(" <th>commission pct</th><td>"+employee.getCommissionPct()+"</td>"); pw.println(" </tr>"); pw.println(" </table>"); pw.println(" <div class='text-right'>"); pw.println(" <a href='delete.html?id="+employeeId+"&p="+p+"' class='btn btn-danger'>delete</a>"); pw.println(" <a href='list.html?p="+p+"' class='btn btn-primary'>list</a>"); pw.println(" </div>"); pw.println("</div>"); pw.println("</body>"); pw.println("</html>"); } catch (SQLException e) { e.printStackTrace(); throw new ServletException(e); } } }
[ "appointment211@gmail.com" ]
appointment211@gmail.com
45b478034efc09491c2480eb86c2eb97cf067957
6fd182bb3e1bb991ba57398b34b3df71dfa1f3a0
/spring-rabbitmq-consumer/src/main/java/com/example/mq/CustomMessage.java
533607db27170e7f04748f3d3cf82f46e217ebf5
[]
no_license
shobhakamath/project
552f722f06cadd73d1957d34dd88ae3e2cdcb8af
552c09d9ceb6de52e38ac6e49762fdf88d7ecd77
refs/heads/main
2023-06-19T07:33:00.321873
2021-07-15T13:17:14
2021-07-15T13:17:14
386,261,611
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package com.example.mq; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; import java.util.Date; @Data @NoArgsConstructor @AllArgsConstructor @ToString public class CustomMessage { private String messageId; private String message; private Date messageDate; }
[ "shobha.s.kamath@gmail.com" ]
shobha.s.kamath@gmail.com
592a0704ef47cf39e6242a7199bd1a4d4553c556
dc6e338a7766e1de6724039561ccd394ee14b966
/spring-cloud/account-management/src/main/java/rudaks/springcloud/AccountManagementApplication.java
5ca4940e5b19d1f1833c1ffabe28f70ebe877612
[]
no_license
rudaks-han/javastudy
e23ad09766222fd8fbbbf4327432e643287d0164
5a67105e3727813b75d6ed38c21987138667a091
refs/heads/master
2022-12-29T15:29:49.641967
2021-06-18T12:41:15
2021-06-18T12:41:15
194,954,092
0
0
null
2022-12-09T22:12:37
2019-07-03T00:50:23
Java
UTF-8
Java
false
false
344
java
package rudaks.springcloud; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class AccountManagementApplication { public static void main(String[] args) { SpringApplication.run(AccountManagementApplication.class, args); } }
[ "rudaks94@gmail.com" ]
rudaks94@gmail.com
bd750f3b53dc8cc9a848f9f42bc5d6076df75bc2
be38fd20a8f6b95506e614a40389c8c4add07c28
/PracticedJavaPrograms/testing/SystemClass.java
8d3cef90a8e9ddea93b3b23618a663d4175c25e4
[]
no_license
sriramsrikanth1985/LearningsByPractice
951f9c9464482583e3ac13a522daa2b65604166f
de34d6cf9c6011bece92b9e46dac852456322b59
refs/heads/master
2021-01-10T03:27:04.984386
2019-10-03T10:03:56
2019-10-03T10:03:56
50,078,102
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
package testing; public class SystemClass { public static void main(String args[]){ System.out.println(System.getProperty("java.version")); System.out.println(System.getProperty("java.vendor")); System.setProperty("java.vendor1", "Oracle"); System.out.println(System.getProperty("java.vendor1")); Runtime rt = Runtime.getRuntime(); System.out.println("Total memory: "+rt.totalMemory()/(1024*1024)); System.out.println("Free memory: "+rt.freeMemory()/(1024*1024)); System.out.println("Used memory: "+(rt.totalMemory()-rt.freeMemory())/(1024*1024)); String str = new String("Hello"); for(int i=0;i<50000;i++){ str = str+"Hi"; } System.out.println("Total memory after: "+rt.totalMemory()/(1024*1024)); System.out.println("Free memory after: "+rt.freeMemory()/(1024*1024)); System.out.println("Used memory after: "+(rt.totalMemory()-rt.freeMemory())/(1024*1024)); rt.gc(); System.out.println("Total memory after gc: "+rt.totalMemory()/(1024*1024)); System.out.println("Free memory after gc: "+rt.freeMemory()/(1024*1024)); System.out.println("Used memory after gc: "+(rt.totalMemory()-rt.freeMemory())/(1024*1024)); } }
[ "sriramsrikanth1985@gmail.com" ]
sriramsrikanth1985@gmail.com
e7e415d3485109386339a6540b626d28a143f876
378c9e2944068fe99bdc581690d08d26e0c38374
/userservice/src/main/java/com/pnc/onboarding/domain/User.java
4f3e70aa691547ac643a28c3e077a715e435e307
[]
no_license
akhilsai25/PNC_Onboaring_Assignment
7ef80212c10d342e670b99a77fb9f4104f5d46ee
2a651daff87306c680545f5d82e228a9560aad3d
refs/heads/master
2021-04-21T21:50:49.992980
2020-04-01T00:16:32
2020-04-01T00:16:32
249,819,154
0
0
null
null
null
null
UTF-8
Java
false
false
1,438
java
package com.pnc.onboarding.domain; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import javax.persistence.*; @Entity @Table(name="users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @Column(name="FIRST_NAME") private String first_name; private String last_name; private long ssn; private String address; private long phone; public User() { } public User(String first_name, String last_name) { this.first_name = first_name; this.last_name = last_name; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getFirst_name() { return first_name; } public void setFirst_name(String first_name) { this.first_name = first_name; } public String getLast_name() { return last_name; } public void setLast_name(String last_name) { this.last_name = last_name; } public long getSsn() { return ssn; } public void setSsn(long ssn) { this.ssn = ssn; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public long getPhone() { return phone; } public void setPhone(long phone) { this.phone = phone; } }
[ "adevunoori@Virtusa.com" ]
adevunoori@Virtusa.com
de232fbb49d267f96e9239b6ccd683399071caf0
3a79bb35e20c75d9a3d412f5c64e89421ecd84db
/servermiddleware/src/main/java/com/federlizer/servermiddleware/exceptions/ProjectAlreadyExistsException.java
29c38c458cf7134ca3b44187104a7ea70462fe17
[]
no_license
make-sans/android-developool-middleware
7436b3f15ffdbc856508047e91ef2d13e13711f0
e70f0946b8d8479c7b652cbab549890b2276a28e
refs/heads/master
2020-05-31T16:21:52.438629
2019-06-05T11:09:12
2019-06-05T11:09:12
190,379,413
0
0
null
null
null
null
UTF-8
Java
false
false
404
java
package com.federlizer.servermiddleware.exceptions; public class ProjectAlreadyExistsException extends Exception { private String key; public ProjectAlreadyExistsException(String key) { this.key = key; } public String getKey() { return key; } @Override public String getMessage() { return super.getMessage() + System.lineSeparator() + key; } }
[ "nikola@velichkov-bg.com" ]
nikola@velichkov-bg.com
9e63ec7f9a4ec39f7b2021741f6681e344810c98
8523563143e69b9ca0326acafdaa646f1b57bb94
/tags/plantuml-7931/src/net/sourceforge/plantuml/graph/EntityImageDefault.java
5e148670614167c14fe9d5b4d0ae714644a73ca8
[]
no_license
svn2github/plantuml
d372e8c5f4b1c5d990b190e2989cd8e5a86ed8fc
241b60a9081a25079bf73f12c08c476e16993384
refs/heads/master
2023-09-03T13:20:47.638892
2012-11-20T22:08:10
2012-11-20T22:08:10
10,839,094
0
0
null
null
null
null
UTF-8
Java
false
false
3,000
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2012, Arnaud Roques * * Project Info: http://plantuml.sourceforge.net * * This file is part of PlantUML. * * PlantUML 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. * * PlantUML 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * Original Author: Arnaud Roques * * Revision $Revision: 7947 $ * */ package net.sourceforge.plantuml.graph; import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Dimension2D; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.SpriteContainerEmpty; import net.sourceforge.plantuml.cucadiagram.IEntity; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignement; import net.sourceforge.plantuml.graphic.HtmlColorUtils; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounderUtils; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.ugraphic.ColorMapper; class EntityImageDefault extends AbstractEntityImage { final private TextBlock textBlock; public EntityImageDefault(IEntity entity) { super(entity); this.textBlock = TextBlockUtils.create(entity.getDisplay2(), new FontConfiguration(getFont14(), HtmlColorUtils.BLACK), HorizontalAlignement.CENTER, new SpriteContainerEmpty()); } @Override public Dimension2D getDimension(StringBounder stringBounder) { final Dimension2D dim = textBlock.calculateDimension(stringBounder); return new Dimension2DDouble(dim.getWidth(), dim.getHeight()); } @Override public void draw(ColorMapper colorMapper, Graphics2D g2d) { final Dimension2D dim = textBlock.calculateDimension(StringBounderUtils.asStringBounder(g2d)); final int width = (int) dim.getWidth(); final int height = (int) dim.getHeight(); g2d.setColor(Color.BLACK); g2d.drawRect(0, 0, width, height); // textBlock.drawTOBEREMOVED(colorMapper, g2d, 0, 0); } }
[ "arnaud_roques@28b6c6c1-be0e-40f3-8fed-77912e9d39c1" ]
arnaud_roques@28b6c6c1-be0e-40f3-8fed-77912e9d39c1
4ae16b8bcd4279483153755b19f7431c60beacf9
7c1e1be937cba017e630b0117e88ef4af0a17b27
/src/main/java/ua/edu/sumdu/j2se/mykhailenko/tasks/controller/NotificationController.java
9a56e7e51c02ec8beec4f26b0a400695ddc089af
[]
no_license
Yulia998/NCTaskManager
fe0de416a38ad3291bc655b262c154176815331d
4c56ab2afa9c8809e18427db03e891042e9a2322
refs/heads/master
2022-06-02T03:21:44.052970
2020-01-28T07:21:21
2020-01-28T07:21:21
232,534,301
0
0
null
2022-05-20T21:23:30
2020-01-08T10:07:38
Java
UTF-8
Java
false
false
1,486
java
package ua.edu.sumdu.j2se.mykhailenko.tasks.controller; import org.apache.log4j.Logger; import ua.edu.sumdu.j2se.mykhailenko.tasks.model.AbstractTaskList; import ua.edu.sumdu.j2se.mykhailenko.tasks.model.Task; import ua.edu.sumdu.j2se.mykhailenko.tasks.view.NotificationView; import java.time.Duration; import java.time.LocalDateTime; public class NotificationController extends Thread { private static final Logger LOGGER = Logger.getLogger(NotificationController.class); private NotificationView view; private AbstractTaskList taskList; public NotificationController(NotificationView view, AbstractTaskList taskList) { this.view = view; this.taskList = taskList; } @Override public void run() { LocalDateTime next, now;; while (true) { now = LocalDateTime.now().withSecond(0).withNano(0); for (Task task : taskList) { next = task.nextTimeAfter(now.minusMinutes(1)); if (next != null) { if (next.equals(now)) { view.printInfo(task); } } } try { if (now.equals(LocalDateTime.now().withSecond(0).withNano(0))) { Thread.sleep(Duration.between(LocalDateTime.now(), now.plusMinutes(1)).toMillis()); } } catch (InterruptedException e) { LOGGER.error(e); } } } }
[ "mykhailenkoyulia98@gmail.com" ]
mykhailenkoyulia98@gmail.com
e4f5a0dadda296ca23f945128d6a5ac3fe6030d5
96002d95959e92ba4f1f09c58303c763364ce5f8
/src/main/java/com/cynapsys/demo/controllers/PoleController.java
c4c2723b5b56b51fbb0ff2bdc7f97c2b75799a33
[]
no_license
ineshariz/Annuaire_backend
c98b5e5b0a714d51bf83b1c2b51a6ea12df48344
da328746a247a6ac797a5afd0fe552f4d4a1bafe
refs/heads/master
2020-09-07T13:43:27.162753
2019-11-10T14:10:53
2019-11-10T14:10:53
220,799,085
0
0
null
null
null
null
UTF-8
Java
false
false
1,705
java
package com.cynapsys.demo.controllers; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.cynapsys.demo.models.Pole; import com.cynapsys.demo.service.PoleService; @RestController @RequestMapping("/pole") @CrossOrigin("*") public class PoleController { @Autowired private PoleService poleService; @RequestMapping(method=RequestMethod.GET) public List<Pole> getListPoles(){ return poleService.getListPoleActivated(); } @RequestMapping(value="/",method=RequestMethod.POST) public Pole addPoles(@RequestBody Pole pole) { poleService.addPole(pole); return pole; } @RequestMapping(value="/{id}",method=RequestMethod.GET) public Pole find(@PathVariable Integer id) { return poleService.findById(id); } @RequestMapping(value="/update",method=RequestMethod.PUT) public Pole update(@RequestBody Pole pole) { return poleService.addPole(pole); } @RequestMapping(value="/disable",method=RequestMethod.PUT) public Pole disable(@RequestBody Pole pole) { if(pole.getEtat()==true) pole.setEtat(false); else pole.setEtat(true); return poleService.addPole(pole); } @RequestMapping(value="/{id}",method=RequestMethod.DELETE) public void delete(@PathVariable Integer id) { poleService.deletePole(id); } }
[ "ines.benhariz@esprit.tn" ]
ines.benhariz@esprit.tn
88e52b1b3edce205c5b37cdf89f001bd04211122
a138e0bb6e59fa930aeffd755c3a34ffad2f8348
/android/app/src/main/java/com/rnactivityindicatordemo/MainActivity.java
783f1df0241f2367aad1190a93d8b0b2c9d13521
[]
no_license
qwer4301/RNActivityIndicatorDemo
7598dda963c78118662de4dfe8237e468a1d6599
16501aadc7a3cb00bb779d8af47035a6da2678e6
refs/heads/master
2021-06-29T03:47:27.915972
2017-09-20T12:33:38
2017-09-20T12:33:38
104,213,013
0
0
null
2017-09-20T12:32:49
2017-09-20T12:32:48
null
UTF-8
Java
false
false
391
java
package com.rnactivityindicatordemo; 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 "RNActivityIndicatorDemo"; } }
[ "cloudox@foxmail.com" ]
cloudox@foxmail.com
c2dd3a68f3d9bf60a9c04fcaf006200c1e9a19df
3f3496dd61b6a3ddc9eab30b0e8689cd425666d1
/lastfm.Android/obj/Debug/android/src/lastfm/android/activities/SplashActivity.java
d13182e19452e7c414e75f6aedbebcbd22a7cb10
[]
no_license
jonteho/last.fm-appcrossplat
18b08512842942e96b970c1f85368c81b221b4ce
6188440a074287e0a22c21c64c58a1e61e655839
refs/heads/master
2020-04-06T07:01:18.350880
2014-04-25T06:57:36
2014-04-25T06:57:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,188
java
package lastfm.android.activities; public class SplashActivity extends android.app.Activity implements mono.android.IGCUserPeer { static final String __md_methods; static { __md_methods = "n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler\n" + ""; mono.android.Runtime.register ("lastfm.Android.Activities.SplashActivity, lastfm.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", SplashActivity.class, __md_methods); } public SplashActivity () throws java.lang.Throwable { super (); if (getClass () == SplashActivity.class) mono.android.TypeManager.Activate ("lastfm.Android.Activities.SplashActivity, lastfm.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { }); } public void onCreate (android.os.Bundle p0) { n_onCreate (p0); } private native void n_onCreate (android.os.Bundle p0); java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
[ "jonathan.holm@hotmail.com" ]
jonathan.holm@hotmail.com
f88d204fdf3485f8b6edb345ebe111f5f024d337
ee766e59341216cb95b58990f1ce2886575e6e5c
/src/main/java/com/bubi/connect/BumoKit.java
2df91ea7fc92f9e14a8bc62fa4f6dff31008a379
[]
no_license
zixian5/blockchain_hospital
a324ff51c92ddd848706628bcec5a5ddbe11095d
15a4400ed44c92699e00a5d820ff45191a26638a
refs/heads/master
2020-05-17T06:29:23.401120
2019-04-26T04:54:06
2019-04-26T04:54:06
183,559,258
1
0
null
null
null
null
UTF-8
Java
false
false
4,659
java
package com.bubi.connect; import io.bumo.SDK; import io.bumo.model.request.AccountGetNonceRequest; import io.bumo.model.request.TransactionBuildBlobRequest; import io.bumo.model.request.TransactionSignRequest; import io.bumo.model.request.TransactionSubmitRequest; import io.bumo.model.request.operation.BaseOperation; import io.bumo.model.request.operation.ContractCreateOperation; import io.bumo.model.request.operation.ContractInvokeByAssetOperation; import io.bumo.model.response.AccountGetNonceResponse; import io.bumo.model.response.TransactionBuildBlobResponse; import io.bumo.model.response.TransactionSignResponse; import io.bumo.model.response.TransactionSubmitResponse; import io.bumo.model.response.result.AccountGetNonceResult; import io.bumo.model.response.result.TransactionBuildBlobResult; import io.bumo.model.response.result.data.Signature; public class BumoKit { public static Signature[] signTransaction(String privateKey,SDK sdk,String transactionBlob) { Signature[] signatures = null; // Sign transaction BLob TransactionSignRequest transactionSignRequest = new TransactionSignRequest(); transactionSignRequest.setBlob(transactionBlob); transactionSignRequest.addPrivateKey(privateKey); TransactionSignResponse transactionSignResponse = sdk.getTransactionService().sign(transactionSignRequest); if (transactionSignResponse.getErrorCode() == 0) { signatures = transactionSignResponse.getResult().getSignatures(); } else { System.out.println("SignError: " + transactionSignResponse.getErrorDesc()); } return signatures; } public static ContractCreateOperation conctractCreateOperation(String payload,String sourceAddress) { ContractCreateOperation operation = new ContractCreateOperation(); operation.setPayload(payload); operation.setInitBalance(1000000000000000L); return operation; } public static ContractInvokeByAssetOperation contractInvokeByAssetOperation(String input ,String contractAddress) { ContractInvokeByAssetOperation operation= new ContractInvokeByAssetOperation(); operation.setContractAddress(contractAddress); operation.setInput(input); return operation; } public static String seralizeTransaction(SDK sdk,String senderAddress, BaseOperation operation) { AccountGetNonceRequest getNonceRequest = new AccountGetNonceRequest(); getNonceRequest.setAddress(senderAddress); AccountGetNonceResponse getNonceResponse = sdk.getAccountService().getNonce(getNonceRequest); // 赋值nonce long nonce = 0l; if (getNonceResponse.getErrorCode() == 0) { AccountGetNonceResult result = getNonceResponse.getResult(); System.out.println("nonce: " + result.getNonce()); nonce = result.getNonce(); } else { System.out.println("error" + getNonceResponse.getErrorDesc()); } TransactionBuildBlobRequest request = new TransactionBuildBlobRequest(); request.addOperation(operation); request.setNonce(nonce+1); request.setSourceAddress(senderAddress); request.setGasPrice(1000L); request.setFeeLimit(10000000000000000l); TransactionBuildBlobResponse response = sdk.getTransactionService().buildBlob(request); String hash =null; if (response.getErrorCode() == 0) { TransactionBuildBlobResult result = response.getResult(); // transactionBlob = result.getTransactionBlob(); // System.out.println(JSON.toJSONString(result, true)); hash = response.getResult().getTransactionBlob(); } else { System.out.println("BuildError: " + response.getErrorDesc()); } return hash; } public static String submitTransaction(SDK sdk,String transactionBlob, Signature[] signatures) { String hash = null; // Submit transaction TransactionSubmitRequest transactionSubmitRequest = new TransactionSubmitRequest(); transactionSubmitRequest.setTransactionBlob(transactionBlob); transactionSubmitRequest.setSignatures(signatures); TransactionSubmitResponse transactionSubmitResponse = sdk.getTransactionService().submit(transactionSubmitRequest); if (0 == transactionSubmitResponse.getErrorCode()) { hash = transactionSubmitResponse.getResult().getHash(); } else { System.out.println("submitError: " + transactionSubmitResponse.getErrorDesc()); } return hash ; } }
[ "406964409@qq.com" ]
406964409@qq.com
43c8e3d839a78ecdd081a1e394e1cd786e557680
82fb2d1301dab8a6949ee53a245737091d081204
/src/main/java/elasticsql/ElasticSQLController.java
f2a5c7188c47eaa7140075f323986238cdeb443f
[ "MIT" ]
permissive
410-dev-archive/ElasticSQL
378a6255585db7ac754e44c948acf1b18b6171ed
393a6aeecb7f30150ce413aaaaf7e6c902a78a35
refs/heads/main
2023-07-19T12:33:37.429959
2021-09-02T08:01:59
2021-09-02T08:01:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,368
java
package elasticsql; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import java.sql.SQLException; import java.util.ArrayList; public class ElasticSQLController { private SQLController controller; public ElasticSQLController(String protocol, String address, String port, String databaseName, String tableName, String username, String password, String driverName) { controller = new SQLController(protocol, address, port, databaseName, tableName, username, password, driverName); } public ElasticSQLController(String databaseName, String tableName, String username, String password) { controller = new SQLController(databaseName, tableName, username, password); } public ElasticSQLResultSet select() throws Exception { return new ElasticSQLResultSet(controller.getAllRows()); } public ElasticSQLResultSet select(int limit) throws Exception { return new ElasticSQLResultSet(controller.getAllRows(limit)); } public ElasticSQLResultSet select(String key, String data) throws Exception { ElasticSQLResultSet nrs = selectWhereKey(key); return equalsSelectionProcess(key, data, nrs); } public ElasticSQLResultSet select(String key, String data, int limit) throws Exception { ElasticSQLResultSet nrs = selectWhereKey(key, limit); return equalsSelectionProcess(key, data, nrs); } private ElasticSQLResultSet equalsSelectionProcess(String key, String data, ElasticSQLResultSet nrs) throws Exception { ArrayList<String> _id = new ArrayList<>(); ArrayList<String> _data = new ArrayList<>(); ArrayList<String> _keys = new ArrayList<>(); JSONParser parser = new JSONParser(); while(nrs.next()) { String innerJSON = nrs.getEntireData(); JSONObject jsonData = (JSONObject) parser.parse(innerJSON); String innerData = jsonData.get(key).toString(); if (innerData.equals(data)) { _id.add(nrs.getID()); _data.add(nrs.getEntireData()); _keys.add(nrs.getIndex()); } } return new ElasticSQLResultSet(_id, _data, _keys); } public ElasticSQLResultSet selectSimilar(String key, String data) throws Exception { ElasticSQLResultSet nrs = selectWhereKey(key); return similarSelectionProcess(key, data, nrs); } public ElasticSQLResultSet selectSimilar(String key, String data, int limit) throws Exception { ElasticSQLResultSet nrs = selectWhereKey(key, limit); return similarSelectionProcess(key, data, nrs); } private ElasticSQLResultSet similarSelectionProcess(String key, String data, ElasticSQLResultSet nrs) throws Exception { JSONParser parser = new JSONParser(); ArrayList<String> _id = new ArrayList<>(); ArrayList<String> _data = new ArrayList<>(); ArrayList<String> _keys = new ArrayList<>(); while(nrs.next()) { String innerJSON = nrs.getEntireData(); JSONObject jsonData = (JSONObject) parser.parse(innerJSON); String innerData = jsonData.get(key).toString(); if (innerData.contains(data)) { _id.add(nrs.getID()); _data.add(nrs.getEntireData()); _keys.add(nrs.getIndex()); } } return new ElasticSQLResultSet(_id, _data, _keys); } public ElasticSQLResultSet selectAt(String id) throws Exception { return new ElasticSQLResultSet(controller.getRow(ElasticSQLResultSet.COLUMN_ID, id)); } public ElasticSQLResultSet selectWhereKey(String key) throws Exception { return new ElasticSQLResultSet(controller.getSimilarRow(ElasticSQLResultSet.COLUMN_INDEX, key + ",")); } public ElasticSQLResultSet selectWhereKey(String key, int limit) throws Exception { return new ElasticSQLResultSet(controller.getSimilarRow(ElasticSQLResultSet.COLUMN_INDEX, key + ",", limit)); } public ElasticSQLResultSet selectByID(String Id) throws Exception { return new ElasticSQLResultSet(controller.getRow(ElasticSQLResultSet.COLUMN_ID, Id)); } public void insert(String[] keys, String[] data) throws Exception { JSONObject jsonData = new JSONObject(); String allIndex = ""; for(int i = 0; i < keys.length; i++) { if (keys[i].contains(",")) { throw new ElasticSQLException("Including comma (,) in key is not allowed."); } jsonData.put(keys[i], data[i]); allIndex += keys[i] + ","; } String[] columns = {ElasticSQLResultSet.COLUMN_DATA, ElasticSQLResultSet.COLUMN_INDEX}; String[] datas = {jsonData.toString().replace("\"", "\\\""), allIndex}; controller.insertRow(columns, datas); } public void update(String selectionKey, String selectionValue, String updateKey, String newValue, int limit) throws Exception { ElasticSQLResultSet nrs = select(selectionKey, selectionValue, limit); updateProc(updateKey, newValue, nrs); } public void update(String selectionKey, String selectionValue, String updateKey, String newValue) throws Exception { ElasticSQLResultSet nrs = select(selectionKey, selectionValue); updateProc(updateKey, newValue, nrs); } private void updateProc(String key, String newValue, ElasticSQLResultSet nrs) throws ElasticSQLException, ParseException, SQLException { while(nrs.next()) { String localID = nrs.getID(); String localData = nrs.getEntireData(); JSONParser parser = new JSONParser(); JSONObject obj = (JSONObject) parser.parse(localData); obj.remove(key); obj.put(key, newValue); controller.updateRow(ElasticSQLResultSet.COLUMN_ID, localID, ElasticSQLResultSet.COLUMN_DATA, obj.toString().replace("\"", "\\\""), 1); } } public void addData(String selectionKey, String selectionValue, String newKey, String newValue, int limit) throws Exception { ElasticSQLResultSet nrs = select(selectionKey, selectionValue, limit); while(nrs.next()) { addData(nrs.getID(), newKey, newValue); } } public void addData(String selectionKey, String selectionValue, String newKey, String newValue) throws Exception { ElasticSQLResultSet nrs = select(selectionKey, selectionValue); while(nrs.next()) { addData(nrs.getID(), newKey, newValue); } } public void addData(String selectionID, String newKey, String newValue) throws Exception { ElasticSQLResultSet nrs = new ElasticSQLResultSet(controller.getRow(ElasticSQLResultSet.COLUMN_ID, selectionID)); if (!nrs.next()) { throw new ElasticSQLException("Unable to find element of ID " + selectionID + "."); } if (nrs.getIndex().contains("," + newKey + ",") || nrs.getIndex().startsWith(newKey + ",")) { throw new ElasticSQLException("Element of ID " + nrs.getID() + " already has key of \"" + newKey + "\"."); } if (newKey.contains(",")) { throw new ElasticSQLException("Including comma (,) in key is not allowed."); } String newKeysIndex = nrs.getIndex() + newKey + ","; String newJSON = nrs.getEntireData(); JSONParser parser = new JSONParser(); JSONObject json = (JSONObject) parser.parse(newJSON); json.put(newKey, newValue); newJSON = json.toString(); controller.updateRow(ElasticSQLResultSet.COLUMN_ID, selectionID, ElasticSQLResultSet.COLUMN_DATA, newJSON.replace("\"", "\\\"")); controller.updateRow(ElasticSQLResultSet.COLUMN_ID, selectionID, ElasticSQLResultSet.COLUMN_INDEX, newKeysIndex); } public void popData(String selectionKey, String selectionValue, String popKey, int limit) throws Exception { ElasticSQLResultSet nrs = select(selectionKey, selectionValue, limit); while(nrs.next()) { popData(nrs.getID(), popKey); } } public void popData(String selectionKey, String selectionValue, String popKey) throws Exception { ElasticSQLResultSet nrs = select(selectionKey, selectionValue); while(nrs.next()) { popData(nrs.getID(), popKey); } } public void popData(String selectionID, String popKey) throws Exception { ElasticSQLResultSet nrs = new ElasticSQLResultSet(controller.getRow(ElasticSQLResultSet.COLUMN_ID, selectionID)); if (!nrs.next()) { throw new ElasticSQLException("Unable to find element of ID " + selectionID + "."); } if (!nrs.getIndex().contains("," + popKey + ",") && !nrs.getIndex().startsWith(popKey + ",")) { throw new ElasticSQLException("Element of ID " + nrs.getID() + " does not have key of \"" + popKey + "\"."); } String newKeysIndex = nrs.getIndex().replace( popKey + ",", ""); String newJSON = nrs.getEntireData(); JSONParser parser = new JSONParser(); JSONObject json = (JSONObject) parser.parse(newJSON); json.remove(popKey); newJSON = json.toString(); controller.updateRow(ElasticSQLResultSet.COLUMN_ID, selectionID, ElasticSQLResultSet.COLUMN_DATA, newJSON.replace("\"", "\\\"")); controller.updateRow(ElasticSQLResultSet.COLUMN_ID, selectionID, ElasticSQLResultSet.COLUMN_INDEX, newKeysIndex); } public void delete(String key, String data) throws Exception { ElasticSQLResultSet nrs = select(key, data); while(nrs.next()) { controller.deleteRow(ElasticSQLResultSet.COLUMN_ID, nrs.getID()); } } public void delete(String key, String data, int limit) throws Exception { ElasticSQLResultSet nrs = select(key, data, limit); while(nrs.next()) { controller.deleteRow(ElasticSQLResultSet.COLUMN_ID, nrs.getID(), limit); } } public void delete(String selectionID) throws Exception { ElasticSQLResultSet nrs = select(ElasticSQLResultSet.COLUMN_ID, selectionID); while(nrs.next()) { controller.deleteRow(ElasticSQLResultSet.COLUMN_ID, nrs.getID()); } } }
[ "58301450+410-dev@users.noreply.github.com" ]
58301450+410-dev@users.noreply.github.com
0efbe438700ca7fa9fe83fe8e97e35950f5f0eab
45ab347e48d94d6bb39e7e9b1b47288375c1d812
/hr-eureka-server/src/main/java/com/flavio/estudos/spring/hrpayload/hreurekaserver/HrEurekaServerApplication.java
39482f73efec19929c28ea511ba6cb925523bb02
[]
no_license
FlavioRoberto/estudo-springboot
3fe246bfdfe53344d45315179a4175967070f55a
396724a51dabdc48e3951cbf600afb7cf26ef890
refs/heads/main
2023-06-17T18:59:43.149366
2021-06-29T00:03:03
2021-06-29T00:03:03
376,332,674
0
0
null
2021-06-29T00:03:04
2021-06-12T16:10:05
Java
UTF-8
Java
false
false
454
java
package com.flavio.estudos.spring.hrpayload.hreurekaserver; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @EnableEurekaServer @SpringBootApplication public class HrEurekaServerApplication { public static void main(String[] args) { SpringApplication.run(HrEurekaServerApplication.class, args); } }
[ "flaviolive3@hotmail.com" ]
flaviolive3@hotmail.com
87b5705bef64c80ffc8f168b66d78cf615bf4a00
b173d4072b2551eb3d4df0274e4297c0117163ce
/marcos_dalmasso_mod0_ej1.jar/src/main/java/com/globant/training/marcos_dalmasso/pages/CalendarDatesPost.java
3b125921cb5f9814f55a42c1267e1859d3a3dad9
[]
no_license
marcosadriandalmasso/automation_training
59daff33deaf050e0865a72b56cdb0abbca0aae2
0f4a2f43e3413ab4a1b24c25a0ec237a566415f2
refs/heads/master
2016-09-05T15:47:51.213491
2015-03-12T23:21:23
2015-03-12T23:21:23
31,560,733
0
0
null
null
null
null
UTF-8
Java
false
false
1,401
java
package com.globant.training.marcos_dalmasso.pages; import java.util.Calendar; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class CalendarDatesPost { @FindBy(id="home-nav") private WebElement goToCalendarDatesPost; public void goToCalendarDatesPost(WebDriver driver) { HomePage homePage = PageFactory.initElements(driver, HomePage.class); homePage.goToBlogPage(driver); goToCalendarDatesPost.click(); } public String getActualMonth() { String[] actualMonth = {"January "+Calendar.getInstance().get(Calendar.YEAR), "February "+Calendar.getInstance().get(Calendar.YEAR), "March "+Calendar.getInstance().get(Calendar.YEAR), "April "+Calendar.getInstance().get(Calendar.YEAR), "May "+Calendar.getInstance().get(Calendar.YEAR), "June "+Calendar.getInstance().get(Calendar.YEAR), "July "+Calendar.getInstance().get(Calendar.YEAR), "August "+Calendar.getInstance().get(Calendar.YEAR), "September "+Calendar.getInstance().get(Calendar.YEAR), "October "+Calendar.getInstance().get(Calendar.YEAR), "November "+Calendar.getInstance().get(Calendar.YEAR), "December "+Calendar.getInstance().get(Calendar.YEAR)}; return actualMonth[Calendar.getInstance().get(Calendar.MONTH)]; } }
[ "marcosadriandalmasso@hotmail.com" ]
marcosadriandalmasso@hotmail.com
b448e9404947bfd4518976ef95a4cd6dba4ffb9d
c6d93152ab18b0e282960b8ff224a52c88efb747
/huntkey/code/biz-class/src/main/java/com/huntkey/rx/edm/service/EnteEnteEnteSetbService.java
9b549c1c5810146c45fa69da9ba8632af4cebab2
[]
no_license
BAT6188/company-database
adfe5d8b87b66cd51efd0355e131de164b69d3f9
40d0342345cadc51ca2555840e32339ca0c83f51
refs/heads/master
2023-05-23T22:18:22.702550
2018-12-25T00:58:15
2018-12-25T00:58:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
480
java
package com.huntkey.rx.edm.service; import java.io.Serializable; import java.util.*; import com.huntkey.rx.base.BaseService; import org.springframework.stereotype.Service; import com.huntkey.rx.base.PropertyBaseEntity; import com.huntkey.rx.commons.utils.rest.Result; import com.huntkey.rx.sceo.method.register.plugin.entity.ParamsVo; import com.huntkey.rx.sceo.method.register.plugin.util.ExecUtil; /** * * 实体 * */ @Service public class EnteEnteEnteSetbService { }
[ "729235023@qq.com" ]
729235023@qq.com
800ae20995ee4bfcc3730fb4d40c6aeab761b1ef
d37be7f16fc7ba51b6eb1fa6cd30d9943c79aeaa
/app/src/main/java/com/kafi/andrroidlifecycle/MainActivity.java
5777647b0e48c62c6f2077cd15726a0c39e5e80b
[]
no_license
KAFIIIUC/AndrroidLifeCycle
a8004026f1f5d42dabecc0ab4ed516981892de76
24eeb7797e44e6951115c82831ec9799b862faf9
refs/heads/master
2020-03-24T04:08:15.590863
2018-07-26T13:32:12
2018-07-26T13:32:12
142,445,232
0
0
null
null
null
null
UTF-8
Java
false
false
1,381
java
package com.kafi.andrroidlifecycle; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toast.makeText(this, "On Create Show", Toast.LENGTH_SHORT).show(); } @Override protected void onStart() { super.onStart(); Toast.makeText(this, "On Start Show", Toast.LENGTH_SHORT).show(); } @Override protected void onResume() { super.onResume(); Toast.makeText(this, "On Resume Show", Toast.LENGTH_SHORT).show(); } @Override protected void onPause() { super.onPause(); Toast.makeText(this, "On Pause Show", Toast.LENGTH_SHORT).show(); } @Override protected void onStop() { super.onStop(); Toast.makeText(this, "On Stop Show", Toast.LENGTH_SHORT).show(); } @Override protected void onRestart() { super.onRestart(); Toast.makeText(this, "On Restart Show", Toast.LENGTH_SHORT).show(); } @Override protected void onDestroy() { super.onDestroy(); Toast.makeText(this, "On Destroy Show", Toast.LENGTH_SHORT).show(); } }
[ "shamimunbindelowarkafi@gmail.com" ]
shamimunbindelowarkafi@gmail.com
3d366cb61a2ab0ee14fb2b8b0f87e46997600efa
97fc870a8e9cf61ccbd6930a9f68771dcb50bd13
/src/main/java/me/ktar/utilities/misc/ReflectionUtil.java
1e6b444f68fe834620d0ff7214de53491e455f4c
[]
no_license
Ktar5/MC-Utilities
fafcb6dcb5f75f33896923c2ab1eef0e0cb893f7
65e29ab89eb7ad2e2a05c24e2c6579e764d98a23
refs/heads/master
2021-01-13T06:49:39.142038
2018-10-01T19:33:36
2018-10-01T19:33:36
81,158,354
0
0
null
2018-10-01T19:33:37
2017-02-07T02:45:35
Java
UTF-8
Java
false
false
6,385
java
package me.ktar.utilities.misc; /* * Copyright (C) 2013-Current Carter Gale (Ktar5) <ktarfive@gmail.com> * * This file is part of Utilities. * * Utilities can not be copied and/or distributed without the express * permission of the aforementioned owner. */ import org.bukkit.Bukkit; import org.bukkit.entity.Player; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; public final class ReflectionUtil { /* * The server version string to location NMS & OBC classes */ private static String versionString; /* * Cache of NMS classes that we've searched for */ private static final Map<String, Class<?>> LOADED_NMS_CLASSES = new HashMap<>(); /* * Cache of OBS classes that we've searched for */ private static final Map<String, Class<?>> LOADED_OBC_CLASSES = new HashMap<>(); /* * Cache of methods that we've found in particular classes */ private static final Map<Class<?>, Map<String, Method>> LOADED_METHODS; static { LOADED_METHODS = new HashMap<>(); } /* * Cache of fields that we've found in particular classes */ private static final Map<Class<?>, Map<String, Field>> LOADED_FIELDS = new HashMap<>(); private ReflectionUtil() { } /** * Gets the version string for NMS & OBC class paths * * @return The version string of OBC and NMS packages */ public static String getVersion() { if (versionString == null) { String name = Bukkit.getServer().getClass().getPackage().getName(); versionString = name.substring(name.lastIndexOf('.') + 1) + '.'; } return versionString; } /** * Get an NMS Class * * @param nmsClassName The name of the class * @return The class */ public static Class<?> getNMSClass(String nmsClassName) { if (LOADED_NMS_CLASSES.containsKey(nmsClassName)) { return LOADED_NMS_CLASSES.get(nmsClassName); } String clazzName = "net.minecraft.server." + getVersion() + nmsClassName; Class<?> clazz; try { clazz = Class.forName(clazzName); } catch (Throwable t) { t.printStackTrace(); return LOADED_NMS_CLASSES.put(nmsClassName, null); } LOADED_NMS_CLASSES.put(nmsClassName, clazz); return clazz; } /** * Get a class from the org.bukkit.craftbukkit package * * @param obcClassName the path to the class * @return the found class at the specified path */ public static synchronized Class<?> getOBCClass(String obcClassName) { if (LOADED_OBC_CLASSES.containsKey(obcClassName)) { return LOADED_OBC_CLASSES.get(obcClassName); } String clazzName = "org.bukkit.craftbukkit." + getVersion() + obcClassName; Class<?> clazz; try { clazz = Class.forName(clazzName); } catch (Throwable t) { t.printStackTrace(); LOADED_OBC_CLASSES.put(obcClassName, null); return null; } LOADED_OBC_CLASSES.put(obcClassName, clazz); return clazz; } /** * Get a Bukkit {@link Player} players NMS playerConnection object * * @param player The player * @return The players connection */ public static Object getConnection(Player player) { Method getHandleMethod = getMethod(player.getClass(), "getHandle"); if (getHandleMethod != null) { try { Object nmsPlayer = getHandleMethod.invoke(player); Field playerConField = getField(nmsPlayer.getClass(), "playerConnection"); return playerConField.get(nmsPlayer); } catch (Exception e) { e.printStackTrace(); } } return null; } /** * Get a classes constructor * * @param clazz The constructor class * @param params The parameters in the constructor * @return The constructor object */ public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... params) { try { return clazz.getConstructor(params); } catch (NoSuchMethodException e) { return null; } } /** * Get a method from a class that has the specific parameters * * @param clazz The class we are searching * @param methodName The name of the method * @param params Any parameters that the method has * @return The method with appropriate parameters */ public static Method getMethod(Class<?> clazz, String methodName, Class<?>... params) { if (!LOADED_METHODS.containsKey(clazz)) { LOADED_METHODS.put(clazz, new HashMap<>()); } Map<String, Method> methods = LOADED_METHODS.get(clazz); if (methods.containsKey(methodName)) { return methods.get(methodName); } try { Method method = clazz.getMethod(methodName, params); methods.put(methodName, method); LOADED_METHODS.put(clazz, methods); return method; } catch (Exception e) { e.printStackTrace(); methods.put(methodName, null); LOADED_METHODS.put(clazz, methods); return null; } } /** * Get a field with a particular name from a class * * @param clazz The class * @param fieldName The name of the field * @return The field object */ public static Field getField(Class<?> clazz, String fieldName) { if (!LOADED_FIELDS.containsKey(clazz)) { LOADED_FIELDS.put(clazz, new HashMap<>()); } Map<String, Field> fields = LOADED_FIELDS.get(clazz); if (fields.containsKey(fieldName)) { return fields.get(fieldName); } try { Field field = clazz.getField(fieldName); fields.put(fieldName, field); LOADED_FIELDS.put(clazz, fields); return field; } catch (Exception e) { e.printStackTrace(); fields.put(fieldName, null); LOADED_FIELDS.put(clazz, fields); return null; } } }
[ "ktarfive@gmail.com" ]
ktarfive@gmail.com
3f3bacaaea07357fba47b5847df3acf4a24ec0ec
a31e02e3919a9f18d69cdcdeea950b7a38e33eca
/src/main/java/com/my/api/Pet.java
5039664d7e9b9caae7c5185e8d208c044e0d0102
[]
no_license
sajith4u/spring-boot-sample
4cb7ebd5d17703c4632cbc25201a37dbc5c15c4d
384fab430822ff4d4b24f41c66fae30e4840a378
refs/heads/master
2021-01-15T20:52:50.985611
2016-06-30T04:42:35
2016-06-30T04:42:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
932
java
package com.my.api; import javax.persistence.GeneratedValue; import javax.persistence.Id; /** * Created by isuru on 6/29/2016. */ public class Pet { private long id; private String name; private String status; private String type; private String breed; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getBreed() { return breed; } public void setBreed(String breed) { this.breed = breed; } }
[ "Isuru Wijesinghe" ]
Isuru Wijesinghe
ac4302ef830d524a085b57256825fbeebb576ad6
a00326c0e2fc8944112589cd2ad638b278f058b9
/src/main/java/000/133/678/CWE197_Numeric_Truncation_Error__short_PropertiesFile_73b.java
39b24af0f7ea998d257f8a6169fff9e7fe657fa0
[]
no_license
Lanhbao/Static-Testing-for-Juliet-Test-Suite
6fd3f62713be7a084260eafa9ab221b1b9833be6
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
refs/heads/master
2020-08-24T13:34:04.004149
2019-10-25T09:26:00
2019-10-25T09:26:00
216,822,684
0
1
null
2019-11-08T09:51:54
2019-10-22T13:37:13
Java
UTF-8
Java
false
false
1,375
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE197_Numeric_Truncation_Error__short_PropertiesFile_73b.java Label Definition File: CWE197_Numeric_Truncation_Error__short.label.xml Template File: sources-sink-73b.tmpl.java */ /* * @description * CWE: 197 Numeric Truncation Error * BadSource: PropertiesFile Read data from a .properties file (in property named data) * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: to_byte * BadSink : Convert data to a byte * Flow Variant: 73 Data flow: data passed in a LinkedList from one method to another in different source files in the same package * * */ import java.util.LinkedList; public class CWE197_Numeric_Truncation_Error__short_PropertiesFile_73b { public void badSink(LinkedList<Short> dataLinkedList ) throws Throwable { short data = dataLinkedList.remove(2); { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(LinkedList<Short> dataLinkedList ) throws Throwable { short data = dataLinkedList.remove(2); { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } }
[ "anhtluet12@gmail.com" ]
anhtluet12@gmail.com
8e812edba5e24e6bbf35fcbf0833a3caef5454dc
1a8874a11675ad306b11779300c49478a456cf03
/java_basic/data_types_and_variables/Exercise.java
68253683edb240dc23e06acc9891320013c36464
[]
no_license
riKHOKON/java_resources
050d11c02a2eb94befb576a72ce6b56e86b942b9
4eeee04b0e6b231d956339a954bdf1ef2b2f7efa
refs/heads/master
2020-05-27T22:40:26.008129
2019-05-27T09:03:00
2019-05-27T09:03:00
188,807,923
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package java_basic.data_types_and_variables; public class Exercise { public static void main(String[] args) { String name = "khokon"; String greeting = "Hello"; System.out.println(greeting+" "+name+"!"); name = "Mary"; System.out.println(greeting+" "+name+"!"); greeting = "Goodbye"; System.out.println(greeting+" "+name+"!"); } }
[ "0120.rashedul@gmail.com" ]
0120.rashedul@gmail.com
605bdbf2a7e68dc9b982f1af2feea869ec59db8d
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14227-19-25-SPEA2-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/XWiki_ESTest.java
79e5d10a460218c22fb73df3fd8b2a2fdd9c29ee
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
530
java
/* * This file was automatically generated by EvoSuite * Sun Jan 19 01:23:37 UTC 2020 */ package com.xpn.xwiki; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class XWiki_ESTest extends XWiki_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
a54af0c5b8ca939413d942881a9b2698af60355b
9787fe89e7f220c2b0513f869f3bd7f960d6d30a
/src/main/java/com/bun133/bigsword/crafter/ContainerCrafter.java
a8c01f502258fc1c6e0699a8d34b72b50073a646
[]
no_license
TeamKun/BigSwordMod
c3ace99f4b8e32add215996a6bc3daffdeccdccf
6c234652914e699581386d72692ef9bd674b2a98
refs/heads/master
2022-11-27T00:01:55.212062
2020-07-31T05:53:59
2020-07-31T05:53:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,733
java
package com.bun133.bigsword.crafter; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; import javax.annotation.Nonnull; public class ContainerCrafter extends Container { private final TileEntityCrafter tileEntity; private final int guiXSize = 199; public final int guiXCentre = guiXSize / 2; private final int guiYSize = 222; public final int guiYCentre = guiYSize / 2; private final int xSize = 176; public final double zoom_x = guiXSize / xSize; private final int ySize = 166; public final double zoom_y = guiYSize / ySize; public ContainerCrafter(InventoryPlayer player, TileEntityCrafter tileEntity) { this.tileEntity = tileEntity; IItemHandler handler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); for (int x = 0; x < 7; x++) { for (int y = 0; y < 7; y++) { this.addSlotToContainer(new SlotItemHandler(handler, x + y * 7, convertPos_x(6 + x * 18), convertPos_y(8 + y * 18))); } } this.addSlotToContainer(new SlotItemHandler(handler,49,convertPos_x(170),convertPos_y(63)){ @Override public boolean isItemValid(@Nonnull ItemStack stack) { return false; } }); for (int y = 0; y < 3; y++) { for (int x = 0; x < 9; x++) { this.addSlotToContainer(new Slot(player, x + y * 9 + 9, convertPos_x(6 + x * 18), convertPos_y(143 + y * 18))); } } for (int x = 0; x < 9; x++) { this.addSlotToContainer(new Slot(player, x, convertPos_x(6 + x * 18), convertPos_y(201))); } } @Override public boolean canInteractWith(EntityPlayer playerIn) { return this.tileEntity.isUsableByPlayer(playerIn); } public final int shift_x=11; public final int shift_y=28; public int convertPos_x(int before_x) { return before_x-shift_x; // return (int) (guiXCentre + (before_x - guiXCentre) * zoom_x); // return before_x/**xSize/guiXSize*/; } public int convertPos_y(int before_y) { return before_y-shift_y; // return (int) (guiYCentre + (before_y - guiYCentre) * zoom_y); // return before_y/**ySize/guiYSize*/; } @Override public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { return ItemStack.EMPTY; } }
[ "57163334+Bun133@users.noreply.github.com" ]
57163334+Bun133@users.noreply.github.com
0245c8e59e168dc2c634365e7d6bd6ec7fb34bae
75e50a281a57bf63b9aa51a806663b0c8e22a7e7
/InariBot/src/view/swingwindows/InfoWindow.java
9b59b6b79b7a0b64a4752866540c5f8be2da8eaa
[]
no_license
Terenco12345/InariBot
8609f41bf9265aea3d87e5b9fc5fb267914adfb0
3ad69b97ab8c562bdb2283e66d450e6c54c88860
refs/heads/master
2020-04-18T11:01:05.381923
2019-05-01T06:14:53
2019-05-01T06:14:53
167,485,849
1
0
null
null
null
null
UTF-8
Java
false
false
501
java
package view.swingwindows; import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; public class InfoWindow extends JFrame{ private static final long serialVersionUID = -7202170466165380381L; public InfoWindow(String title, String message) { this.setTitle(title); this.getContentPane().setLayout(new FlowLayout()); this.add(new JLabel(message)); this.setSize(450, 100); this.setLocationRelativeTo(null); this.setVisible(true); } }
[ "Terenco12345@gmail.com" ]
Terenco12345@gmail.com
b4fe68a773dd4b1080f03577ace6531c10d76fa4
00a8f2274f9ea5b82715b6d6f02c52c8c67098d3
/src/com/esprit/techevent/entities/Interaction.java
7cf758e246aba0b40947a98363a938f1a58fbf5d
[]
no_license
cyberghostspidev/TechEvent
ccf905ea0182e4d46c34aa8d4d7e5b9b0ffb8ece
2e1e3965a34ebde23b74932db85dd5b3761eabe0
refs/heads/master
2020-05-18T14:06:03.637194
2019-05-04T15:56:41
2019-05-04T15:56:41
184,460,824
1
1
null
null
null
null
UTF-8
Java
false
false
437
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.esprit.techevent.entities; /** * * @author Yacine Ben Ouirane */ public class Interaction { private int idInteraction; private float rating; private String avis; private int idEvenement; private int idUtilisateur; }
[ "yacine.benouirane@esprit.tn" ]
yacine.benouirane@esprit.tn
22dcbf7e894a3a1c3c758331ad0b45d8490dedf4
203922d5923c95ab8ebdcf1b809d4b870e7c891d
/src/main/java/com/witmoon/xmb/activity/card/CardActivity.java
b53b5f391d9e98b53023f6995b5b3d7e13119091
[]
no_license
LaymanInCoding/workspace
e17de245f7f9108f44283c7e7e5c7ca7b8f40e7e
e7b24edf218caba3c91c2519180ab47fefe63e46
refs/heads/master
2021-01-13T08:24:52.646709
2017-05-17T07:15:11
2017-05-17T07:15:11
71,868,877
0
0
null
null
null
null
UTF-8
Java
false
false
5,557
java
package com.witmoon.xmb.activity.card; import android.content.Intent; import android.content.res.AssetManager; import android.graphics.Typeface; import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; import com.witmoon.xmb.R; import com.witmoon.xmb.util.SystemBarTintManager; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import butterknife.Unbinder; import info.hoang8f.android.segmented.SegmentedGroup; /** * Created by ming on 2017/3/20. */ public class CardActivity extends AppCompatActivity implements RadioGroup.OnCheckedChangeListener { @BindView(R.id.mabao_gongxiang_btn) RadioButton mMabaoGongxiangBtn; @BindView(R.id.welfare_btn) RadioButton mWelfareBtn; @BindView(R.id.card_use_help) TextView mCardUseHelp; @BindView(R.id.segmented1) SegmentedGroup mSegmentedGroup; @BindView(R.id.view_pager) ViewPager mViewPager; private WelfareCardFragment mWelfareCardFragment; private GiftCardFragment mGiftCardFragment; private Unbinder mButterKnife; private List<Fragment> mFragments = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mabao_card); mButterKnife = ButterKnife.bind(this); setFont(); setTitleColor_(R.color.main_kin); mMabaoGongxiangBtn.performClick(); mSegmentedGroup.setOnCheckedChangeListener(this); mWelfareCardFragment = new WelfareCardFragment(); mGiftCardFragment = new GiftCardFragment(); mFragments.add(mWelfareCardFragment); mFragments.add(mGiftCardFragment); mViewPager.setAdapter(new PagerAdapter(getSupportFragmentManager(), mFragments)); mViewPager.addOnPageChangeListener(new mOnPageChangeListener()); mViewPager.setCurrentItem(0); } private void setFont() { AssetManager mgr = getAssets();//得到AssetManager Typeface tf = Typeface.createFromAsset(mgr, "fonts/font.otf");//根据路径得到Typeface mMabaoGongxiangBtn.setTypeface(tf); mWelfareBtn.setTypeface(tf); mCardUseHelp.setTypeface(tf); } @Override protected void onDestroy() { super.onDestroy(); mButterKnife.unbind(); } @OnClick({R.id.card_use_help, R.id.toolbar_left_img}) public void onClick(View view) { switch (view.getId()) { case R.id.card_use_help: startActivity(new Intent(this, ElecCardHelpActivity.class)); break; case R.id.toolbar_left_img: finish(); break; } } @Override public void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.mabao_gongxiang_btn: mViewPager.setCurrentItem(0); break; case R.id.welfare_btn: mViewPager.setCurrentItem(1); break; default: } } class PagerAdapter extends FragmentPagerAdapter { private List<Fragment> mfragments; public PagerAdapter(FragmentManager fm, List<Fragment> fragments) { super(fm); this.mfragments = fragments; } @Override public Fragment getItem(int position) { return mfragments.get(position); } @Override public int getCount() { return mfragments.size(); } } class mOnPageChangeListener implements ViewPager.OnPageChangeListener { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { if (position == 0) { mMabaoGongxiangBtn.performClick(); } else if (position == 1) { mWelfareBtn.performClick(); } } @Override public void onPageScrollStateChanged(int state) { } } public void setTitleColor_(int mColor) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setTranslucentStatus(true); SystemBarTintManager tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); if (mColor == R.color.black) { tintManager.setStatusBarTintColor(getResources().getColor(R.color.black)); } else { tintManager.setStatusBarTintDrawable(getResources().getDrawable(R.drawable.bg_status)); } } } //获取高度 private void setTranslucentStatus(boolean on) { Window win = getWindow(); WindowManager.LayoutParams winParams = win.getAttributes(); final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; if (on) { winParams.flags |= bits; } else { winParams.flags &= ~bits; } win.setAttributes(winParams); } }
[ "452178693@qq.com" ]
452178693@qq.com
253bc53e9aeaba08c7c4da202235ebcd5439a76b
1aec896377723d6490449ffb89e88bc29438793f
/gui/RoombaUI/src/app/Position.java
7bb6d8bf6fbdc6186cb4d3b712baad9b64f4b1ff
[]
no_license
ryebri/flatten_cattle_crew
c89b4b71c2926899c8bd7822e769a6d04e371bb7
f3aba9e89ec9b9942ca1be439eaa96b5131b798f
refs/heads/master
2020-12-24T10:11:25.718942
2016-12-10T23:09:20
2016-12-10T23:09:20
73,243,587
0
0
null
null
null
null
UTF-8
Java
false
false
7,644
java
package app; import java.awt.Point; ///Position Class Object /** * Class which keeps track of where the roomba is, and where it is on the canvas. * @author ryebri * */ public class Position { ///Enum for the cardinal directions /** * Enum which contains the information on where each location is located in the position array. * @author ryebri * */ public enum CardinalDirection { NORTH(0), SOUTH(1), EAST(2), WEST(3); private final int index; CardinalDirection(int index) {this.index = index;} public int getValue() { return index; } } private int x_start = 430; private int y_start = 275; private int[] total_traveled; //in each direction private Point prev_position; // xy position private Point curr_position; // xy position private int orientation; // orientation of the robot private int status; //status bit used to say whether it hit something or not ///Default Constructor /** * Initializes the position private variables to their proper values. */ public Position(){ total_traveled = new int[]{0,0,0,0}; prev_position = new Point(x_start, y_start); //middle of the canvas curr_position = new Point(x_start, y_start); orientation = 0; status = 0; } //orientation has north at 0 ///Update position data /** * Method to update the position variables. Will update previous location, and current, * also includes a status bit to determine whether the gui next time should listen for just * position data, or the full suite (ir, object, position, bot sensors) of data. * @param x Int value of distance traveled in the x direction * @param x_negative Int value acts as a boolean to determine if x is negative (1 = negative, 0 = positive). * @param y Int value of distance traveled in the y direction * @param y_negative Int value acts as a boolean to determine if y is negative (1 = negative, 0 = positive). * @param orientation Int value of the orientation of the roomba (0 is "north") * @param status Int value determining the status of what the roomba should listen for (0 = position, 1 = full data suite) */ public void update_positions(int x, int x_negative, int y, int y_negative, int orientation, int status){ //may need to have more logic here if the robot does not take care of things int new_x, new_y; if(x_negative == 0){ new_x = curr_position.x + x; } else { new_x = curr_position.x - x; } if(y_negative == 0){ new_y = curr_position.y + y; } else { new_y = curr_position.y - y; } set_total_traveled(x, x_negative, y, y_negative); set_prev_position(curr_position.x, curr_position.y); set_curr_position(new_x, new_y); this.orientation = orientation; this.status = status; } ///Updates position from an array /** * Updates the position variables based upon values in the parameter int[]. * @param pos int[] containing the 6 different values used by this class. */ public void update_positions(int[] pos){ //may need to have more logic here if the robot does not take care of things set_total_traveled(pos[0], pos[1], pos[2], pos[3]); set_prev_position(curr_position.x, curr_position.y); set_curr_position(pos); this.orientation = pos[4]; status = pos[5]; } /* * getters */ ///Get previous position /** * Method to get the previous position. * @return Point object containing the previous position. */ public Point get_prev_position(){ return prev_position; } ///Get the current position /** * Method to get the current position. * @return Point object containing the current position. */ public Point get_curr_position(){ return curr_position; } ///Get total traveled /** * Method to get the total traveled. Returns an array with NORTH, SOUTH, EAST, and WEST data * @return int[] of the total traveled in each of the 4 directions NORTH, SOUTH, EAST, WEST. */ public int[] get_total_traveled(){ return total_traveled; } ///Get current orientation /** * Method to get the current orientation of the roomba. * @return Int value, 0 - 360, of where the roomba is pointed. */ public int get_orientation(){ return orientation; } ///Get the start position of x /** * Method to get the start canvas x position of the roomba. * @return Int value of the starting canvas x position of the roomba. */ public int get_start_x(){ return x_start; } ///Get the start position of y /** * Method to get the start canvas y position of the roomba. * @return Int value of the starting canvas y position of the roomba. */ public int get_start_y(){ return y_start; } ///Get the status value /** * Method to get the status value. Status value is used to determine whether the program * should listen for just position data, or the full suite (ir, object, position, bot sensors) * of data. * @return Int value, 0 = position data, 1 = full suite data. */ public int get_status(){ return status; } /* * setters */ ///Set previous position /** * Method to set the previous position using an x and y points. * @param x Int value of the previous x position on the canvas. * @param y Int value of the previous y position on the canvas. */ public void set_prev_position(int x, int y){ prev_position.setLocation(x, y); } ///Set current position point /** * Method to set the current position using an x and y points. * @param x Int value of the current x position on the canvas. * @param y Int value of the current y position on the canvas. */ public void set_curr_position(int x, int y){ curr_position.setLocation(x/100, y/100); } ///Set current position point /** * Method to set the current position using the position array. * @param position Int[] containing the values that would be used to call update_position method. */ public void set_curr_position(int position[]){ int new_x, new_y; if(position[1] == 1){ new_x = curr_position.x + position[0]/100; } else { new_x = curr_position.x - position[0]/100; } if(position[3] == 1){ new_y = curr_position.y + position[2]/100; } else { new_y = curr_position.y - position[2]/100; } curr_position.setLocation(new_x, new_y); } ///Set the total traveled distance array /** * Method to update the total traveled distance array. * @param x * @param x Int value of distance traveled in the x direction * @param x_negative Int value acts as a boolean to determine if x is negative (1 = negative, 0 = positive). * @param y Int value of distance traveled in the y direction * @param y_negative Int value acts as a boolean to determine if y is negative (1 = negative, 0 = positive). */ public void set_total_traveled(int x, int x_neg, int y, int y_neg){ if(x_neg == 0){ total_traveled[CardinalDirection.NORTH.index] += x/100; } else { total_traveled[CardinalDirection.SOUTH.index] += x/100; } if(y_neg == 0){ total_traveled[CardinalDirection.EAST.index] += y/100; } else { total_traveled[CardinalDirection.WEST.index] += y/100; } } ///Set the orientation variable /** * Method to set the orientation of the roomba. * @param orientation Int value of the orientation (0 - 360) */ public void set_orientation(int orientation){ this.orientation = orientation; } ///Set the status variable /** * Set the status variable. Status value is used to determine whether the program * should listen for just position data, or the full suite (ir, object, position, bot sensors) * of data. * @return Int value, 0 = position data, 1 = full suite data. */ public void set_status(int status){ this.status = status; } }
[ "ryebri2013@gmail.com" ]
ryebri2013@gmail.com
9b0e56cefd27caa65967db006ce2efc203c0d3b0
5fa3bfda299a622a203f591ead7fd96dae98f2fe
/Globle.java
5ac5cdc053c74d7b10fb4115a2127b1b39471a48
[]
no_license
al-nv/4901-FoodFinder
820322c52c0f41d24d7c996370ec9423d281e488
6a9fbb67e188f37eef5e5d54ceb7841ab9f577c2
refs/heads/master
2023-01-29T06:56:33.409412
2020-12-04T22:21:04
2020-12-04T22:21:04
294,603,468
0
0
null
2020-12-04T22:21:12
2020-09-11T05:33:35
Java
UTF-8
Java
false
false
938
java
package com.example.onlinestore.gps; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Globle { Context context; // constructor public Globle(Context context) { this.context = context; } public static Boolean getConnectivityStatus(Context context) { ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); if (null != activeNetwork) { if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) //return TYPE_WIFI; return true; if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) //return TYPE_MOBILE; return true; } return false; } }
[ "sabinshrstha@my.unt.edu" ]
sabinshrstha@my.unt.edu
9d75dfcd62b2fa517717e2b33c64338d8d05a829
87183aaad20f9063a450ba5d0d7d96e4a9cc9665
/orienteer-mail/src/main/java/org/orienteer/mail/task/package-info.java
67d13fc1dc6ab0062da09d75d72088f9a3a4af8d
[ "Apache-2.0" ]
permissive
soitun/Orienteer
86f1a95187d5c43d2bf79fbbb5d177a269b46c9e
cbe6c7a9bc46b9abc3c00c78900b9983cdd14d81
refs/heads/master
2022-06-04T01:15:58.401230
2022-05-24T16:44:30
2022-05-24T16:44:30
137,434,198
0
0
Apache-2.0
2022-05-25T17:54:40
2018-06-15T02:57:45
Java
UTF-8
Java
false
false
93
java
/** * Contains task classes for 'orienteer-mail' module */ package org.orienteer.mail.task;
[ "weaxme@gmail.com" ]
weaxme@gmail.com
d661b8b00481f65c058e6fb74935a6259958ef94
1e95b9a1d5f45077eea5343e6e4da9b234231ea7
/src/dotaclass/Globals.java
6cd48c0127cce12d8ba3ecf51c5f965f8690c5b4
[]
no_license
gx72xk/Dota2
467da31c334ee6a0c08b904ca0098c47511156ad
b80f89cdabb7eb0c3f9929bbd4a2532022e8481c
refs/heads/master
2020-08-09T02:06:44.567679
2014-12-12T02:36:32
2014-12-12T02:36:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,301
java
package dotaclass; import java.math.BigDecimal; public class Globals { public final static String API_KEY = "/?key=9D05B768ABC6B9BC07614564FD100542"; public final static String BASE_URL = "https://api.steampowered.com"; public final static String FIND_MATCH_BY_ID = "/IDOTA2Match_570/GetMatchDetails"; public final static String PLAYER_SUMMARIES = "/ISteamUser/GetPlayerSummaries"; public final static String MATCH_HISTORY = "/IDOTA2Match_570/GetMatchHistory"; public final static String Item_List = "/IEconDOTA2_570/GetGameItems"; public final static String HERO_LIST = "/IEconDOTA2_570/GetHeroes"; public final static String VERSION1 = "/v1"; public final static String VERSION2 = "/v0002"; public final static String MATCH_ID = "&match_id={{MATCH_ID}}"; public final static String STEAM_ID = "&steamids={{STEAM_ID}}"; public final static String ACCOUNT_ID = "&account_id={{ACCOUNT_ID}}"; public final static String LANGUAGE = "&language=en_us"; public final static BigDecimal STEAM_CONVERTING_ID = new BigDecimal("76561197960265728"); public final static int MAX_PLAYER_NUM = 10; public static User user; public static String username; public static PlayerSummary playersummary; public static String steamid; public static int articleId; public static int replayId; }
[ "168569916@qq.com" ]
168569916@qq.com
67dd8ce89b6ee1b9e32fbb46b63727df2d67580c
c9b8db6ceff0be3420542d0067854dea1a1e7b12
/web/KoreanAir/src/main/java/com/ke/css/cimp/fwb/fwb12/Rule_ACCOUNTING_INFORMATION_ID.java
a125bd72f260194c72990b6e34e79a5f9d76f16a
[ "Apache-2.0" ]
permissive
ganzijo/portfolio
12ae1531bd0f4d554c1fcfa7d68953d1c79cdf9a
a31834b23308be7b3a992451ab8140bef5a61728
refs/heads/master
2021-04-15T09:25:07.189213
2018-03-22T12:11:00
2018-03-22T12:11:00
126,326,291
0
0
null
null
null
null
UTF-8
Java
false
false
2,242
java
package com.ke.css.cimp.fwb.fwb12; /* ----------------------------------------------------------------------------- * Rule_ACCOUNTING_INFORMATION_ID.java * ----------------------------------------------------------------------------- * * Producer : com.parse2.aparse.Parser 2.5 * Produced : Tue Mar 06 10:36:09 KST 2018 * * ----------------------------------------------------------------------------- */ import java.util.ArrayList; final public class Rule_ACCOUNTING_INFORMATION_ID extends Rule { public Rule_ACCOUNTING_INFORMATION_ID(String spelling, ArrayList<Rule> rules) { super(spelling, rules); } public Object accept(Visitor visitor) { return visitor.visit(this); } public static Rule_ACCOUNTING_INFORMATION_ID parse(ParserContext context) { context.push("ACCOUNTING_INFORMATION_ID"); boolean parsed = true; int s0 = context.index; ParserAlternative a0 = new ParserAlternative(s0); ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>(); parsed = false; { int s1 = context.index; ParserAlternative a1 = new ParserAlternative(s1); parsed = true; if (parsed) { boolean f1 = true; int c1 = 0; for (int i1 = 0; i1 < 3 && f1; i1++) { Rule rule = Rule_Typ_Alpha.parse(context); if ((f1 = rule != null)) { a1.add(rule, context.index); c1++; } } parsed = c1 == 3; } if (parsed) { as1.add(a1); } context.index = s1; } ParserAlternative b = ParserAlternative.getBest(as1); parsed = b != null; if (parsed) { a0.add(b.rules, b.end); context.index = b.end; } Rule rule = null; if (parsed) { rule = new Rule_ACCOUNTING_INFORMATION_ID(context.text.substring(a0.start, a0.end), a0.rules); } else { context.index = s0; } context.pop("ACCOUNTING_INFORMATION_ID", parsed); return (Rule_ACCOUNTING_INFORMATION_ID)rule; } } /* ----------------------------------------------------------------------------- * eof * ----------------------------------------------------------------------------- */
[ "whdnfka111@gmail.com" ]
whdnfka111@gmail.com
ca03c655b5a15d808ad835e0c804c075a99ed198
bd7555ca8e0e67dfc7b45a1b18aef021b599edd3
/web-server/src/main/java/com/franm/mongowebapp/RequestLog.java
d329cd5773b803cb80a35d2c08c6435fb8fdc50c
[ "Apache-2.0" ]
permissive
fran-man/web-server-mongo
1cb373003d422fb5d131426403fd43d8d42b576a
943055d6655e10e98508babfe295c2901915f6d3
refs/heads/master
2020-04-22T13:06:41.891715
2019-03-07T10:38:09
2019-03-07T10:38:09
170,397,601
0
0
Apache-2.0
2019-03-07T10:38:10
2019-02-12T21:56:53
Java
UTF-8
Java
false
false
759
java
package com.franm.mongowebapp; import java.time.LocalDateTime; public class RequestLog { private final LocalDateTime ldt; private final String content; private final String endpoint; private final long requestNumber; public RequestLog(String content, long requestNumber, String endpoint) { this.ldt = LocalDateTime.now(); this.content = content; this.requestNumber = requestNumber; this.endpoint = endpoint; } public LocalDateTime getLdt() { return this.ldt; } public String getContent() { return this.content; } public long getRequestNumber() { return this.requestNumber; } public String getEndpoint() { return this.endpoint; } }
[ "fran.man@hotmail.co.uk" ]
fran.man@hotmail.co.uk
ec4a98be6ace42a4271f42a1ebe644cb200bc196
39eda40799c17ff410ecb1e5b2c0d53d72c0080b
/src/main/java/com/mastersheel007/springrestdemo/repo/IPersonRepository.java
01135a0720315a6a8f60c13c9d6d0e5745bf7879
[ "CC0-1.0" ]
permissive
sheelsh/SpringRESTDemo
572e8c8d860e5bdd074714512b6c786330ae1b72
348c9b8bbce5fbeabcdff7531d693c2d542d01a0
refs/heads/master
2021-05-28T08:14:39.219707
2015-01-31T17:10:43
2015-01-31T17:10:43
28,847,685
2
1
null
null
null
null
UTF-8
Java
false
false
340
java
package com.mastersheel007.springrestdemo.repo; import com.mastersheel007.springrestdemo.domain.Person; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * * @author mastersheel007 */ @Repository public interface IPersonRepository extends JpaRepository<Person, Long>{}
[ "mastersheel007@github.com" ]
mastersheel007@github.com
33272900a3501445db697064f014309d81570e1c
9f00e6fa72b915f131cae28c52b5e7fcb0eb2339
/src/main/java/com/ace/sbhibernatemysql/service/EmployeeServiceImpl.java
19c10df312a58e1067f200b2c8aaf3d7fe979e7d
[]
no_license
nilesh44/sb-spring-orm-hibernate-mysql
951aa055f9d3698ce1ba0c63fcdca6efe5d7ea5b
d6b38aa1b01a90686ae585a69d4c9d4f83226caf
refs/heads/master
2022-04-23T17:49:06.175033
2020-04-13T08:52:42
2020-04-13T08:52:42
255,275,004
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
package com.ace.sbhibernatemysql.service; import java.math.BigInteger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import com.ace.sbhibernatemysql.Repo.EmployeeRepository; import com.ace.sbhibernatemysql.entity.Employee; @Service public class EmployeeServiceImpl implements EmployeeService { @Autowired private EmployeeRepository employeeRepository; @Override public ResponseEntity<Object> findByEmpId(BigInteger bigInteger) { Employee employee= employeeRepository.findByEmpId(bigInteger); if (employee!=null) { return new ResponseEntity<>(employee, HttpStatus.OK); } return new ResponseEntity<>("employee not found", HttpStatus.OK); } }
[ "nileshkumarjaiswal7@gmail.com" ]
nileshkumarjaiswal7@gmail.com
ba8c696105918eb6790a8fd8954c04082565baf9
e4b2b535b6f1e0c54f2f1424d6303db336512532
/app/src/main/java/com/exalpme/bozhilun/android/onekeyshare/themes/classic/land/PlatformPageAdapterLand.java
16d491a9c46e73a4cd43725dfca9707088def4e0
[ "Apache-2.0" ]
permissive
axdx1314/RaceFitPro
56a7a4cefefc56373b94eb383d130f1bd4f7c6d9
6778c6c4fb11ba8697a64c6ddde8bfe95dbbb505
refs/heads/master
2020-03-17T08:29:10.096792
2018-05-23T02:08:23
2018-05-23T02:08:23
133,440,315
0
1
null
null
null
null
UTF-8
Java
false
false
2,371
java
/* * 官网地站:http://www.mob.com * 技术支持QQ: 4006852216 * 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复) * * Copyright (c) 2013年 mob.com. All rights reserved. */ package com.exalpme.bozhilun.android.onekeyshare.themes.classic.land; import android.content.Context; import com.exalpme.bozhilun.android.onekeyshare.themes.classic.PlatformPage; import com.exalpme.bozhilun.android.onekeyshare.themes.classic.PlatformPageAdapter; import com.mob.tools.utils.R; import java.util.ArrayList; /** 横屏的九宫格页面适配器 */ public class PlatformPageAdapterLand extends PlatformPageAdapter { private static final int DESIGN_SCREEN_WIDTH_L = 1280; private static final int DESIGN_CELL_WIDTH_L = 160; private static final int DESIGN_SEP_LINE_WIDTH = 1; private static final int DESIGN_LOGO_HEIGHT = 76; private static final int DESIGN_PADDING_TOP = 20; public PlatformPageAdapterLand(PlatformPage page, ArrayList<Object> cells) { super(page, cells); } protected void calculateSize(Context context, ArrayList<Object> plats) { int screenWidth = R.getScreenWidth(context); float ratio = ((float) screenWidth) / DESIGN_SCREEN_WIDTH_L; int cellWidth = (int) (DESIGN_CELL_WIDTH_L * ratio); lineSize = screenWidth / cellWidth; sepLineWidth = (int) (DESIGN_SEP_LINE_WIDTH * ratio); sepLineWidth = sepLineWidth < 1 ? 1 : sepLineWidth; logoHeight = (int) (DESIGN_LOGO_HEIGHT * ratio); paddingTop = (int) (DESIGN_PADDING_TOP * ratio); bottomHeight = (int) (DESIGN_BOTTOM_HEIGHT * ratio); cellHeight = (screenWidth - sepLineWidth * 3) / (lineSize - 1); panelHeight = cellHeight + sepLineWidth; } protected void collectCells(ArrayList<Object> plats) { int count = plats.size(); if (count < lineSize) { int lineCount = (count / lineSize); if (count % lineSize != 0) { lineCount++; } cells = new Object[1][lineCount * lineSize]; } else { int pageCount = (count / lineSize); if (count % lineSize != 0) { pageCount++; } cells = new Object[pageCount][lineSize]; } for (int i = 0; i < count; i++) { int p = i / lineSize; cells[p][i - lineSize * p] = plats.get(i); } } }
[ "1598013489@qq.com" ]
1598013489@qq.com
b8ac8462c7dbf64422693378aee0d1add1a9c042
c48565446cbe28abe295aaa1238d76485b635849
/bookstore-angular/src/main/java/com/bookstore/utility/MailConstructor.java
0d2023cdf72aef5d4997349738f38c66d96bad85
[]
no_license
omar302/angular-spring-boot-store
0fe15caec2609814217ee2a1a31cecd78e79720f
005fb18c887409c422024c1d5713645fe3c1ade6
refs/heads/master
2020-04-26T02:14:42.752909
2019-03-01T03:55:44
2019-03-01T03:55:44
173,229,092
0
0
null
null
null
null
UTF-8
Java
false
false
2,083
java
package com.bookstore.utility; import java.util.Locale; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.mail.javamail.MimeMessagePreparator; import org.springframework.stereotype.Component; import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.Context; import com.bookstore.domain.Order; import com.bookstore.domain.User; @Component public class MailConstructor { @Autowired private Environment env; @Autowired private TemplateEngine templateEngine; public SimpleMailMessage constructNewUserEmail(User user, String password) { String message="\nPlease use the following credentials to log in and edit your personal information including your own password." + "\nUsername:"+user.getUsername()+"\nPassword:"+password; SimpleMailMessage email = new SimpleMailMessage(); email.setTo(user.getEmail()); email.setSubject("Bookstore - New User"); email.setText(message); email.setFrom(env.getProperty("support.email")); return email; } public MimeMessagePreparator constructOrderConfirmationEmail (User user, Order order, Locale locale) { Context context = new Context(); context.setVariable("order", order); context.setVariable("user", user); context.setVariable("cartItemList", order.getCartItemList()); String text = templateEngine.process("orderConfirmationEmailTemplate", context); MimeMessagePreparator messagePreparator = new MimeMessagePreparator() { @Override public void prepare(MimeMessage mimeMessage) throws Exception { MimeMessageHelper email = new MimeMessageHelper(mimeMessage); email.setTo(user.getEmail()); email.setSubject("Order Confirmation - "+order.getId()); email.setText(text,true); email.setFrom(new InternetAddress("omartq@gmail.com")); } }; return messagePreparator; } }
[ "omar3025@yahoo.com" ]
omar3025@yahoo.com
eaea67956a50e465e2e2202ec5323205893c6d60
877055a60fc7a5e2e7770607e7a8cd8d3260514d
/MLive/src/com/aniket/mlive/MainActivity.java
606570f808ffcfdbad653edf619555bdadaf586b
[]
no_license
packcode/Android_Application
c2374b2d64a2f5c8fe597f8adbc64662499f09ef
14085dcde01e1e5a7e972dedb361703877c5973a
refs/heads/master
2016-09-11T01:30:45.536813
2013-07-23T15:22:53
2013-07-23T15:22:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,453
java
package com.aniket.mlive; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.view.Menu; import android.widget.Button; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // button=(Button)findViewById(R.id.button1); //button.setOnClickListener(this); } //@Override public void onClick1(View arg0) { final Context context = this; Intent intent = new Intent(context, WebActivity.class); startActivity(intent); Log.d("AISI","SECOND BUTTON WAS CLIKED"); } public void onClick2(View v) { final Context context1 = this; Intent intent = new Intent(context1, WebActivity2.class); startActivity(intent); Log.d("AISI","SECOND BUTTON WAS CLIKED"); } public void onClick3(View v) { final Context context1 = this; Intent intent = new Intent(context1, WebActivity2.class); startActivity(intent); Log.d("AISI","SECOND BUTTON WAS CLIKED"); } public void onClick4(View v) { final Context context1 = this; Intent intent = new Intent(context1, WebActivity2.class); startActivity(intent); Log.d("AISI","SECOND BUTTON WAS CLIKED"); } public void onClick5(View v) { final Context context1 = this; Intent intent = new Intent(context1, WebActivity2.class); startActivity(intent); Log.d("AISI","SECOND BUTTON WAS CLIKED"); } public void onClick6(View v) { final Context context1 = this; Intent intent = new Intent(context1, WebActivity2.class); startActivity(intent); Log.d("AISI","SECOND BUTTON WAS CLIKED"); } public void onClick7(View v) { final Context context1 = this; Intent intent = new Intent(context1, WebActivity2.class); startActivity(intent); Log.d("AISI","SECOND BUTTON WAS CLIKED"); } public void onClick8(View v) { final Context context1 = this; Intent intent = new Intent(context1, WebActivity2.class); startActivity(intent); Log.d("AISI","SECOND BUTTON WAS CLIKED"); } }
[ "maithani.aniket@gmail.com" ]
maithani.aniket@gmail.com
9f97c36621528861b71b52ef44a0acf8de14cb8e
b917bf9a664e83da8069127b2c0b6df5bcfe9fc5
/ProjectFirst/src/com/yedam/api/arrays/SearchExample.java
350a434f7aee7a383bae0778a15fcef6ecf2515e
[]
no_license
skckdgns34/ProjectFirst
76803f9e96bc6a6e6f12a2f5e1444d78447e8471
e0747cef5ac25ba4cd3cf8e20ace5f0c6c122d8e
refs/heads/master
2022-11-21T01:05:06.617307
2020-07-14T03:49:01
2020-07-14T03:49:01
261,943,260
0
0
null
null
null
null
UTF-8
Java
false
false
758
java
package com.yedam.api.arrays; import java.util.Arrays; public class SearchExample { public static void main(String[] args) { int[] scores = {99, 97, 98}; Arrays.sort(scores); int index = Arrays.binarySearch(scores, 99); System.out.println("찾은 인덱스: " + index); String[] names = { "홍길동", "박동수", "김민수" }; Arrays.sort(names); index = Arrays.binarySearch(names, "홍길동"); System.out.println("찾은 인덱스: " + index); Member m1 = new Member("홍길동"); Member m2 = new Member("박동수"); Member m3 = new Member("김민수"); Member[] members = { m1, m2, m3 }; Arrays.sort(members); index = Arrays.binarySearch(members, m1); System.out.println("찾은 인덱스: " + index); } }
[ "skckdgns34@naver.com" ]
skckdgns34@naver.com
124da70309ed844e0f875bda1ca92a29bdb810ad
96e04b1eecb4d2e89ea26606e801f7c440203ca9
/2020/day3/Advent2020Day3.java
5bb3bb8f4de8ca4afa39d20c1e5fadea25b88a2b
[]
no_license
RatJuggler/advent-of-code
afccb4333c825860009283c3319d82676ad4b735
e94f10064975174fc3dc0cd3a6add8e49b07778f
refs/heads/master
2021-07-02T08:29:43.503750
2021-03-04T16:55:55
2021-03-04T16:55:55
226,149,526
0
0
null
null
null
null
UTF-8
Java
false
false
2,652
java
package day3; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; class MapOfTrees { private final List<String> map; private final int width; MapOfTrees(final List<String> map) { this.map = map; this.width = map.get(0).length(); } static MapOfTrees fromFile(final String filename) { try { List<String> map = Files.readAllLines(Paths.get(filename)); return new MapOfTrees(map); } catch (IOException ioe) { throw new IllegalArgumentException("Problem reading map file!", ioe); } } int countTrees(final int slopeX, final int slopeY) { int treeCount = 0; int mapX = 0; int mapY = 0; while (mapY < this.map.size()) { char mapLocation = this.map.get(mapY).charAt(mapX); if (mapLocation == '#') treeCount++; mapX = (mapX + slopeX) % this.width; mapY += slopeY; } return treeCount; } } public class Advent2020Day3 { private static int countTrees(final String filename) { MapOfTrees mapOfTrees = MapOfTrees.fromFile(filename); return mapOfTrees.countTrees(3, 1); } private static long treeCountProduct(final String filename) { MapOfTrees mapOfTrees = MapOfTrees.fromFile(filename); return (long) mapOfTrees.countTrees(1, 1) * mapOfTrees.countTrees(3, 1) * mapOfTrees.countTrees(5, 1) * mapOfTrees.countTrees(7, 1) * mapOfTrees.countTrees(1, 2); } private static void testPart1TreeCount() { int expectedTreeCount = 7; int actualTreeCount = countTrees("2020/day3/test3a.txt"); assert actualTreeCount == expectedTreeCount : String.format("Expected to encounter %d trees not %d!%n", expectedTreeCount, actualTreeCount); } private static void testPart2TreeCountProduct() { long expectedTreeCountProduct = 336; long actualTreeCountProduct = treeCountProduct("2020/day3/test3a.txt"); assert actualTreeCountProduct == expectedTreeCountProduct : String.format("Expected to get %d not %d!%n", expectedTreeCountProduct, actualTreeCountProduct); } public static void main(final String[] args) { testPart1TreeCount(); System.out.printf("Day 3, part 1, number of trees is %d.%n", countTrees("2020/day3/input3.txt")); testPart2TreeCountProduct(); System.out.printf("Day 3, part 2, number of trees is %d.%n", treeCountProduct("2020/day3/input3.txt")); } }
[ "ratteal@gmail.com" ]
ratteal@gmail.com
e1a5e1e5c7263234e1e207d444389498a1010e10
e4738e156fe26bd0ce80e78a30e97cc90e238f75
/src/test/resources/module/after/select/SelectByAgeFalse.java
90d2f594835b4dcf5dbebb98666635d8bf980c38
[ "Apache-2.0" ]
permissive
baomidou/MybatisX
165ac27acb65a0892c9f4ea72d5721b0be10d17d
d1db7c841a3d13052283286897fd6e2e9eb28bdf
refs/heads/dev
2023-08-16T10:07:27.387070
2021-12-07T07:43:11
2021-12-07T07:43:11
221,589,885
289
92
Apache-2.0
2021-12-16T08:37:59
2019-11-14T02:01:45
Java
UTF-8
Java
false
false
130
java
package template; import java.util.List; import template.Blog; public interface TipMapper { List<Blog> selectByAgeFalse(); }
[ "364173778@qq.com" ]
364173778@qq.com
a3b5a4053d1458ed7517a60a4085fe4359680064
3f4ba0f6d6338c0e9fca74dcf2f81124a6ff7b24
/src/main/java/org/example/App.java
f4fe36ead74300f4b05bdbfc811c32fd72e1739f
[]
no_license
LuisFigueroa1/figueroa-cop3330-ex05
6e2b9dc2a7d6925df89480b05f4b5cdeb6570aa1
55627271f22a39fdb139ec718e917579da050c62
refs/heads/master
2023-07-28T04:29:48.828261
2021-09-13T03:27:22
2021-09-13T03:27:22
405,816,692
0
0
null
null
null
null
UTF-8
Java
false
false
1,218
java
package org.example; /* * UCF COP3330 Fall 2021 exercise 05 Solution * Copyright 2021 Luis Figueroa */ import java.util.Scanner; //the scanner utility public class App { public static void main( String[] args ) //main function { Scanner userInput = new Scanner(System.in); //declare the variables that will be used String num1; //number 1 String num2; //number 2 System.out.println("What is the first number? "); //prompt first number input num1 = userInput.nextLine(); //scan the input System.out.println( "What is the second number? " ); //prompt second number input num2 = userInput.nextLine(); int num1int = Integer.parseInt(num1); int num2int = Integer.parseInt(num2); int sum1 = num1int + num2int; //sum int subst1 = num1int - num2int; //substraction int multi1 = num1int * num2int; //multiplication int div1 = num1int / num2int; //division //print output System.out.println("\n" + num1 + " + " + num2 + " = " + sum1 + "\n" + num1 + " - " + num2 + " = " + subst1 + "\n" + num1 + " * " + num2 + " = " + multi1 + "\n" + num1 + " / " + num2 + " = " + div1); } }
[ "luisfigueroa@Luiss-Mac-mini.local" ]
luisfigueroa@Luiss-Mac-mini.local
ee32c0b7aee0545ef4c7f2123f211e22387d3463
c739e4d09bd31385782d5120730831597b76f9b6
/app/src/main/java/com/neusoft/oddc/multimedia/gles/node/RectNode.java
5054477500342e9c9c9bfbedad717c8fbf8a0f3d
[]
no_license
rsamonte/ODDC
b291e7a69e6d791f38e3b020172c2f4c11dd8184
fb9395cc96fe4b8aadb0c29b3efb295e32ceb1df
refs/heads/master
2021-07-01T08:14:27.945336
2017-09-21T20:27:43
2017-09-21T20:27:43
104,272,721
0
0
null
null
null
null
UTF-8
Java
false
false
13,065
java
package com.neusoft.oddc.multimedia.gles.node; import android.graphics.Bitmap; import android.opengl.GLES20; import android.opengl.Matrix; import com.neusoft.oddc.multimedia.gles.GLThreadTaskList; import com.neusoft.oddc.multimedia.gles.GlUtil; import com.neusoft.oddc.multimedia.gles.MeshConstants; import com.neusoft.oddc.multimedia.gles.cropper.BaseTextureCropper; import com.neusoft.oddc.multimedia.gles.program.GLProgram; import com.neusoft.oddc.multimedia.gles.program.GLProgramCommand; import com.neusoft.oddc.multimedia.gles.program.SimpleProgram; import java.nio.FloatBuffer; public class RectNode implements GLNode { private static final String TAG = RectNode.class.getSimpleName(); protected int left; protected int top; protected int right; protected int bottom; protected int fullFrameWidth; protected int fullFrameHeight; // protected float glLeft; // protected float glTop; // protected float glRight; // protected float glBottom; protected FloatBuffer vertexArray = GlUtil.createFloatBuffer(MeshConstants.RECTANGLE_COORDS); protected FloatBuffer texCoordArray = GlUtil.createFloatBuffer(MeshConstants.RECTANGLE_TEX_COORDS); protected BaseTextureCropper textureCropper = null; protected boolean useOrientationHint = false; protected int textureId = 0; protected float[] identityMatrix = GlUtil.createIdentityMatrix(); protected float[] texMatrix = GlUtil.createIdentityMatrix(); protected float[] mvpMatrix = GlUtil.createIdentityMatrix(); protected float[] mvpWithOrientationHint = GlUtil.createIdentityMatrix(); protected GLProgram glProgram = new SimpleProgram(); protected Bitmap textureBitmap; protected GLThreadTaskList pendingTasks = new GLThreadTaskList(); protected boolean isInitialized = false; protected boolean isBitmapTexture = false; protected int orientationHint = 0; protected float rotation = 0f; protected GLProgramCommand glProgramCommand; public RectNode() { } public RectNode(GLProgram program) { this.glProgram = program; } public RectNode(GLProgram program, BaseTextureCropper cropper) { this.glProgram = program; this.textureCropper = cropper; } public RectNode(int frameWidth, int frameHeight) { this.fullFrameWidth = frameWidth; this.fullFrameHeight = frameHeight; } @Override public void init() { if (null == this.glProgram) { new SimpleProgram(); } glProgram.init(); isInitialized = true; } @Override public void release() { isInitialized = false; if (isBitmapTexture) { if (GlUtil.NO_TEXTURE != textureId) { GLES20.glDeleteTextures(1, new int[]{textureId}, 0); } textureId = GlUtil.NO_TEXTURE; } if (null != glProgram && glProgram.isInitialized()) { glProgram.release(); } } public void setVertexArray(FloatBuffer vertexArray) { this.vertexArray = vertexArray; } public void layout(int left, int top, int right, int bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; updateMVP(); } @Override public int draw() { pendingTasks.runPendingOnDrawTasks(); FloatBuffer texCorrds = null; if (null != textureCropper) { texCorrds = textureCropper.getCropTextureCoordBuffer(); } else { texCorrds = texCoordArray; } float[] vertexMatrix = null; if (useOrientationHint) { vertexMatrix = mvpWithOrientationHint; } else { vertexMatrix = mvpMatrix; } if (null == glProgramCommand) { int vertexCount = MeshConstants.RECTANGLE_COORDS.length / MeshConstants.COORDS_COUNT_2; int vertextStride = MeshConstants.COORDS_COUNT_2 * MeshConstants.SIZEOF_FLOAT; glProgramCommand = new GLProgramCommand(); glProgramCommand.setDrawType(GLProgramCommand.DrawType.DRAW_ARRAY); glProgramCommand.setFirstVertexIndex(0); glProgramCommand.setVertexStride(vertextStride); glProgramCommand.setTextureStride(vertextStride); glProgramCommand.setVertexCount(vertexCount); glProgramCommand.setCoordsPerVertex(MeshConstants.COORDS_COUNT_2); } glProgramCommand.setMvpMatrix(vertexMatrix); glProgramCommand.setVertexBuffer(vertexArray); glProgramCommand.setTextures(new int[]{textureId}); glProgramCommand.setTexMatrix(texMatrix); glProgramCommand.setTextureCoordBuffer(texCorrds); glProgram.draw(glProgramCommand); return 0; } @Override public GLNode getParent() { return null; } public int getWidth() { return Math.abs(right - left); } public int getHeight() { return Math.abs(bottom - top); } @Override public void setFullFrameSize(int width, int height) { this.fullFrameWidth = width; this.fullFrameHeight = height; updateMVP(); } @Override public int getFullFrameWidth() { return this.fullFrameWidth; } @Override public int getFullFrameHeight() { return this.fullFrameHeight; } public void setTextureBitmap(final Bitmap bitmap) { this.setTextureBitmap(bitmap, false, false); } public void setTextureBitmap(final Bitmap bitmap, final boolean flip) { this.setTextureBitmap(bitmap, flip, false); } public void setTextureBitmap(final Bitmap bitmap, final boolean flip, final boolean recycle) { pendingTasks.runOnDraw(new Runnable() { @Override public void run() { if (!recycle) { textureBitmap = bitmap; } textureId = GlUtil.loadTexture(bitmap, textureId, recycle); isBitmapTexture = true; } }); } public void setFrameTexture(int textureId) { if (isBitmapTexture) { if (GlUtil.NO_TEXTURE != textureId) { GLES20.glDeleteTextures(1, new int[]{textureId}, 0); } textureId = GlUtil.NO_TEXTURE; } this.textureId = textureId; isBitmapTexture = false; } public void setTextMatrix(float[] matrix) { this.texMatrix = matrix; } public boolean isInitialized() { return isInitialized; } @Override public void setRotation(float rotation) { this.rotation = rotation; updateMVP(); } @Override public float getRotation() { return this.rotation; } public void setOrientationHint(int orientation) { this.orientationHint = orientation; updateMVP(); } public void setUseOrientationHint(boolean useOrientationHint) { // Log.d(TAG, "orientation trace -- > setUseOrientationHint : useOrientationHint = " + useOrientationHint); this.useOrientationHint = useOrientationHint; } protected void updateMVP() { updateStandardMVP(); updateOrientationHintMVP(); } private void updateStandardMVP() { // Log.d(TAG, "orientation trace -- > updateMVP : orientation = " + orientationHint + ", fullFrameWidth = " + fullFrameWidth + ", fullFrameHeight = " + fullFrameHeight // + ", top = " + top + ", left = " + left + ", right = " + right + ", bottom = " + bottom); // Log.d(TAG, "orientation trace -- > updateMVP : fullFrameWidth = " + fullFrameWidth + ", fullFrameHeight = " + fullFrameHeight); if (0 == fullFrameWidth || 0 == fullFrameHeight) { return; } float width = fullFrameWidth; float height = fullFrameHeight; float unit = Math.max(width, height) / 2f; float l; float r; float t; float b; float glLeft; float glTop; float glRight; float glBottom; float[] mMatrix = GlUtil.createIdentityMatrix(); if (0 == left && 0 == right && 0 == top && 0 == bottom) { l = 0; t = 0; r = width; b = height; } else { l = left; t = top; r = right; b = bottom; } glLeft = (l - width / 2f) / unit; glRight = (r - width / 2f) / unit; glTop = (height / 2f - t) / unit; glBottom = (height / 2f - b) / unit; float centerX = (glLeft + glRight) / 2f; float centerY = (glTop + glBottom) / 2f; float scaleX = (glRight - glLeft) / 2f; float scaleY = (glTop - glBottom) / 2f; Matrix.translateM(mMatrix, 0, centerX, centerY, 0f); float[] rMatrix = GlUtil.createIdentityMatrix(); float[] tempMatrix = GlUtil.createIdentityMatrix(); Matrix.rotateM(rMatrix, 0, rotation, 0, 0, 1); Matrix.multiplyMM(tempMatrix, 0, mMatrix, 0, rMatrix, 0); System.arraycopy(tempMatrix, 0, mMatrix, 0, 16); Matrix.scaleM(mMatrix, 0, scaleX, scaleY, 1f); float[] vMatrix = GlUtil.createIdentityMatrix(); Matrix.setLookAtM(vMatrix, 0, 0, 0, 3f, 0, 0, 0f, 0f, 1.0f, 0.0f); float[] pMatrix = GlUtil.createIdentityMatrix(); Matrix.orthoM(pMatrix, 0, -0.5f * width / unit, 0.5f * width / unit, -0.5f * height / unit, 0.5f * height / unit, -1, 10); float[] mvMatrix = GlUtil.createIdentityMatrix(); Matrix.multiplyMM(mvMatrix, 0, vMatrix, 0, mMatrix, 0); Matrix.multiplyMM(mvpMatrix, 0, pMatrix, 0, mvMatrix, 0); // Log.d(TAG, "orientation trace -- > updateMVP : mvpMatrix :"); // for (float v : mvpMatrix) { // Log.d(TAG, "orientation trace -- > updateMVP : mvpMatrix = " + v); // } } private void updateOrientationHintMVP() { // Log.d(TAG, "orientation trace -- > updateMVP : orientation = " + orientationHint + ", fullFrameWidth = " + fullFrameWidth + ", fullFrameHeight = " + fullFrameHeight // + ", top = " + top + ", left = " + left + ", right = " + right + ", bottom = " + bottom); // Log.d(TAG, "orientation trace -- > updateMVP : fullFrameWidth = " + fullFrameWidth + ", fullFrameHeight = " + fullFrameHeight); if (0 == fullFrameWidth || 0 == fullFrameHeight) { return; } float width = fullFrameWidth; float height = fullFrameHeight; float unit = Math.max(width, height) / 2f; float l; float r; float t; float b; float glLeft; float glTop; float glRight; float glBottom; float[] mMatrix = GlUtil.createIdentityMatrix(); if (0 == left && 0 == right && 0 == top && 0 == bottom) { l = 0; t = 0; r = width; b = height; } else { l = left; t = top; r = right; b = bottom; } glLeft = (l - width / 2f) / unit; glRight = (r - width / 2f) / unit; glTop = (height / 2f - t) / unit; glBottom = (height / 2f - b) / unit; float centerX = (glLeft + glRight) / 2f; float centerY = (glTop + glBottom) / 2f; float scaleX = (glRight - glLeft) / 2f; float scaleY = (glTop - glBottom) / 2f; Matrix.translateM(mMatrix, 0, centerX, centerY, 0f); float[] rMatrix = GlUtil.createIdentityMatrix(); float[] tempMatrix = GlUtil.createIdentityMatrix(); Matrix.rotateM(rMatrix, 0, rotation, 0, 0, 1); Matrix.multiplyMM(tempMatrix, 0, mMatrix, 0, rMatrix, 0); System.arraycopy(tempMatrix, 0, mMatrix, 0, 16); Matrix.scaleM(mMatrix, 0, scaleX, scaleY, 1f); float[] vMatrix = GlUtil.createIdentityMatrix(); float[] vOHintMatrix = GlUtil.createIdentityMatrix(); Matrix.setLookAtM(vMatrix, 0, 0, 0, 3f, 0, 0, 0f, 0f, 1.0f, 0.0f); Matrix.rotateM(vOHintMatrix, 0, vMatrix, 0, -orientationHint, 0, 0, 1); float[] pMatrix = GlUtil.createIdentityMatrix(); if (orientationHint % 180 == 0) { Matrix.orthoM(pMatrix, 0, -0.5f * width / unit, 0.5f * width / unit, -0.5f * height / unit, 0.5f * height / unit, -1, 10); } else { Matrix.orthoM(pMatrix, 0, -0.5f * height / unit, 0.5f * height / unit, -0.5f * width / unit, 0.5f * width / unit, -1, 10); } float[] mvMatrix = GlUtil.createIdentityMatrix(); Matrix.multiplyMM(mvMatrix, 0, vOHintMatrix, 0, mMatrix, 0); Matrix.multiplyMM(mvpWithOrientationHint, 0, pMatrix, 0, mvMatrix, 0); // Log.d(TAG, "orientation trace -- > updateMVP : mvpWithOrientationHint :"); // for (float v : mvpWithOrientationHint) { // Log.d(TAG, "orientation trace -- > updateMVP : mvpWithOrientationHint = " + v); // } } }
[ "fujitsu10" ]
fujitsu10
809e30d82e9067349768c7b0e9cd2d452d9adeaa
446a56b68c88df8057e85f424dbac90896f05602
/support/cas-server-support-radius/src/test/java/org/apereo/cas/adaptors/radius/web/flow/RadiusAccessChallengedMultifactorAuthenticationTriggerTests.java
178274676562dde4b67cad8ebba0b91e30da04ac
[ "Apache-2.0", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
apereo/cas
c29deb0224c52997cbfcae0073a4eb65ebf41205
5dc06b010aa7fd1b854aa1ae683d1ab284c09367
refs/heads/master
2023-09-01T06:46:11.062065
2023-09-01T01:17:22
2023-09-01T01:17:22
2,352,744
9,879
3,935
Apache-2.0
2023-09-14T14:06:17
2011-09-09T01:36:42
Java
UTF-8
Java
false
false
6,257
java
package org.apereo.cas.adaptors.radius.web.flow; import org.apereo.cas.authentication.AuthenticationException; import org.apereo.cas.authentication.CoreAuthenticationTestUtils; import org.apereo.cas.authentication.MultifactorAuthenticationTrigger; import org.apereo.cas.authentication.mfa.TestMultifactorAuthenticationProvider; import org.apereo.cas.config.CasCookieConfiguration; import org.apereo.cas.config.CasCoreAuthenticationConfiguration; import org.apereo.cas.config.CasCoreAuthenticationPrincipalConfiguration; import org.apereo.cas.config.CasCoreAuthenticationServiceSelectionStrategyConfiguration; import org.apereo.cas.config.CasCoreAuthenticationSupportConfiguration; import org.apereo.cas.config.CasCoreConfiguration; import org.apereo.cas.config.CasCoreHttpConfiguration; import org.apereo.cas.config.CasCoreLogoutConfiguration; import org.apereo.cas.config.CasCoreMultifactorAuthenticationConfiguration; import org.apereo.cas.config.CasCoreNotificationsConfiguration; import org.apereo.cas.config.CasCoreServicesConfiguration; import org.apereo.cas.config.CasCoreTicketCatalogConfiguration; import org.apereo.cas.config.CasCoreTicketIdGeneratorsConfiguration; import org.apereo.cas.config.CasCoreTicketsConfiguration; import org.apereo.cas.config.CasCoreTicketsSerializationConfiguration; import org.apereo.cas.config.CasCoreUtilConfiguration; import org.apereo.cas.config.CasCoreWebConfiguration; import org.apereo.cas.config.CasCoreWebflowConfiguration; import org.apereo.cas.config.CasMultifactorAuthenticationWebflowConfiguration; import org.apereo.cas.config.CasPersonDirectoryTestConfiguration; import org.apereo.cas.config.CasWebApplicationServiceFactoryConfiguration; import org.apereo.cas.config.CasWebflowContextConfiguration; import org.apereo.cas.config.RadiusConfiguration; import org.apereo.cas.util.CollectionUtils; import lombok.val; import net.jradius.dictionary.Attr_ReplyMessage; import net.jradius.dictionary.Attr_State; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import static org.junit.jupiter.api.Assertions.*; /** * This is {@link RadiusAccessChallengedMultifactorAuthenticationTriggerTests}. * * @author Misagh Moayyed * @since 6.2.0 */ @SpringBootTest(classes = { RadiusConfiguration.class, RefreshAutoConfiguration.class, WebMvcAutoConfiguration.class, CasCoreAuthenticationPrincipalConfiguration.class, CasCoreAuthenticationSupportConfiguration.class, CasPersonDirectoryTestConfiguration.class, CasCoreMultifactorAuthenticationConfiguration.class, CasMultifactorAuthenticationWebflowConfiguration.class, CasCoreAuthenticationServiceSelectionStrategyConfiguration.class, CasCoreWebConfiguration.class, CasCoreAuthenticationConfiguration.class, CasCoreWebflowConfiguration.class, CasWebflowContextConfiguration.class, CasWebApplicationServiceFactoryConfiguration.class, CasCoreTicketIdGeneratorsConfiguration.class, CasCoreNotificationsConfiguration.class, CasCoreServicesConfiguration.class, CasCoreTicketsConfiguration.class, CasCoreTicketCatalogConfiguration.class, CasCoreTicketsSerializationConfiguration.class, CasCoreLogoutConfiguration.class, CasCookieConfiguration.class, CasCoreHttpConfiguration.class, CasCoreUtilConfiguration.class, CasCoreConfiguration.class }, properties = { "cas.authn.radius.server.protocol=PAP", "cas.authn.radius.client.shared-secret=testing123", "cas.authn.radius.client.inet-address=localhost", "cas.authn.mfa.radius.id=mfa-dummy" }) @Tag("Radius") class RadiusAccessChallengedMultifactorAuthenticationTriggerTests { @Autowired @Qualifier("radiusAccessChallengedMultifactorAuthenticationTrigger") private MultifactorAuthenticationTrigger multifactorAuthenticationTrigger; @Autowired private ConfigurableApplicationContext applicationContext; @Test void verifyTriggerInactive() { assertTrue(multifactorAuthenticationTrigger.isActivated(CoreAuthenticationTestUtils.getAuthentication(), CoreAuthenticationTestUtils.getRegisteredService(), new MockHttpServletRequest(), new MockHttpServletResponse(), CoreAuthenticationTestUtils.getService()).isEmpty()); assertTrue(multifactorAuthenticationTrigger.isActivated(null, CoreAuthenticationTestUtils.getRegisteredService(), new MockHttpServletRequest(), new MockHttpServletResponse(), CoreAuthenticationTestUtils.getService()).isEmpty()); } @Test void verifyTriggerActive() { val authn = CoreAuthenticationTestUtils.getAuthentication(CoreAuthenticationTestUtils.getPrincipal( CollectionUtils.wrap(Attr_ReplyMessage.NAME, "reply-message", Attr_State.NAME, "whatever") )); assertThrows(AuthenticationException.class, () -> multifactorAuthenticationTrigger.isActivated(authn, CoreAuthenticationTestUtils.getRegisteredService(), new MockHttpServletRequest(), new MockHttpServletResponse(), CoreAuthenticationTestUtils.getService())); TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext); val authnMfa = CoreAuthenticationTestUtils.getAuthentication(CoreAuthenticationTestUtils.getPrincipal( CollectionUtils.wrap(Attr_ReplyMessage.NAME, "reply-message", Attr_State.NAME, "whatever") )); assertTrue(multifactorAuthenticationTrigger.isActivated(authnMfa, CoreAuthenticationTestUtils.getRegisteredService(), new MockHttpServletRequest(), new MockHttpServletResponse(), CoreAuthenticationTestUtils.getService()).isPresent()); } }
[ "mm1844@gmail.com" ]
mm1844@gmail.com
744a69d78e6ea0b0ee06cc30cce17b9e780c69d0
b801b6c32bd6a958e4449d9cd2b043b71ed53f36
/Rectangle.java
69380a9a8c875435745baac574826eaa1ce1d5f0
[]
no_license
kashyaprathod/practice
e34297b2a657d8ce5536236a532ac2777631f19c
de466f0e79b7ac76f2ecf85b8029b6147d4eba2b
refs/heads/master
2021-01-16T20:06:14.854675
2017-09-05T16:21:51
2017-09-05T16:21:51
100,197,233
0
0
null
null
null
null
UTF-8
Java
false
false
611
java
public class Rectangle{ double length, breadth = 0.0; Rectangle(){ length = breadth = 0; } Rectangle(double d){ length = breadth = d; } Rectangle(double l, double b){ length = l; breadth = b; } void showArea(){ System.out.println("The area of the rectangle is: "+ length * breadth); } } class TestRect{ void TestMe(){ Rectangle obj1 = new Rectangle(); obj1.showArea(); Rectangle obj2 = new Rectangle(7); obj2.showArea(); Rectangle obj3 = new Rectangle(5,7); obj3.showArea(); } }
[ "30984021+kashyaprathod@users.noreply.github.com" ]
30984021+kashyaprathod@users.noreply.github.com
cd3e503c0ef951a43a7a3236da3d47cf41c6fe5a
198b8d3b6feab312eaedf639d5e2ad89b9525796
/src/test/java/ru/javawebinar/topjavaGraduation/service/UserServiceTest.java
7a11271c89945ec9e6979f29e88c3fa7acd7b9cd
[]
no_license
dato7898/topjavaGraduation
05db9ea16a9c967174d6e60e4715de37adc906a0
9cd4022e4331b83e5b845f3b893a550899ebc369
refs/heads/master
2022-12-14T03:47:08.247856
2019-12-11T15:45:57
2019-12-11T15:45:57
222,896,336
0
0
null
2022-11-15T23:53:14
2019-11-20T09:10:58
Java
UTF-8
Java
false
false
3,075
java
package ru.javawebinar.topjavaGraduation.service; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import ru.javawebinar.topjavaGraduation.model.Role; import ru.javawebinar.topjavaGraduation.model.User; import ru.javawebinar.topjavaGraduation.util.exception.NotFoundException; import javax.validation.ConstraintViolationException; import java.util.Date; import java.util.List; import java.util.Set; import static org.junit.jupiter.api.Assertions.*; import static ru.javawebinar.topjavaGraduation.UserTestData.*; public class UserServiceTest extends AbstractServiceTest { @Autowired protected UserService service; @Test void create() throws Exception { User newUser = getNew(); User created = service.create(new User(newUser)); Integer newId = created.getId(); newUser.setId(newId); assertMatch(created, newUser); assertMatch(service.get(newId), newUser); } @Test void duplicateMailCreate() throws Exception { assertThrows(DataAccessException.class, () -> service.create(new User(null, "Duplicate", "user@yandex.ru", "newPass", Role.ROLE_USER))); } @Test void delete() throws Exception { service.delete(USER_ID); assertThrows(NotFoundException.class, () -> service.delete(USER_ID)); } @Test void deletedNotFound() throws Exception { assertThrows(NotFoundException.class, () -> service.delete(1)); } @Test void get() throws Exception { User user = service.get(ADMIN_ID); assertMatch(user, ADMIN); } @Test void getNotFound() throws Exception { assertThrows(NotFoundException.class, () -> service.get(1)); } @Test void getByEmail() throws Exception { User user = service.getByEmail("admin@gmail.com"); assertMatch(user, ADMIN); } @Test void update() throws Exception { User updated = getUpdated(); service.update(new User(updated)); assertMatch(service.get(USER_ID), updated); } @Test void getAll() throws Exception { List<User> all = service.getAll(); assertMatch(all, ADMIN, USER); } @Test void createWithException() throws Exception { validateRootCause(() -> service.create(new User(null, " ", "mail@yandex.ru", "password", Role.ROLE_USER)), ConstraintViolationException.class); validateRootCause(() -> service.create(new User(null, "User", " ", "password", Role.ROLE_USER)), ConstraintViolationException.class); validateRootCause(() -> service.create(new User(null, "User", "mail@yandex.ru", " ", Role.ROLE_USER)), ConstraintViolationException.class); } @Test void enable() { service.enable(USER_ID, false); assertFalse(service.get(USER_ID).isEnabled()); service.enable(USER_ID, true); assertTrue(service.get(USER_ID).isEnabled()); } }
[ "davidd7598@gmail.com" ]
davidd7598@gmail.com
2964acf28a94686976c418dbe9a11d33a549011a
bf35fe59dbcbe4084009e8b7618c0a2f3ee645ed
/Back/Liberacao_Alunos/src/main/java/br/senai/sc/domain/Professor.java
e1ebb5ea17d1eabd2c342132fd74a4c6b92417f6
[]
no_license
quarteto-fantastico/LiberacaoAlunos
f0a13cc885a80ebab59f161a4352883508774e46
db8aabd2132e0e6eac011dc622b4f3ff565da5de
refs/heads/master
2021-06-25T08:40:54.914054
2019-07-17T00:20:42
2019-07-17T00:20:42
197,280,994
0
0
null
2021-01-05T12:03:40
2019-07-16T23:23:45
JavaScript
UTF-8
Java
false
false
1,256
java
package br.senai.sc.domain; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.persistence.Entity; import javax.persistence.ManyToMany; import com.fasterxml.jackson.annotation.JsonIgnore; @Entity public class Professor extends User implements Serializable{ private static final long serialVersionUID = 1L; public Professor() { super(); } public Professor(Integer id, String nome, String email, String senha, String telefone, boolean ativo) { super(id, nome, email, senha, telefone, ativo); } @JsonIgnore @ManyToMany(mappedBy = "professores") private List<RegistroSaida>registros_saidas = new ArrayList<RegistroSaida>(); @JsonIgnore @ManyToMany(mappedBy = "professores") private List<RegistroEntrada> registros_entradas = new ArrayList<RegistroEntrada>(); public List<RegistroSaida> getRegistros_saidas() { return registros_saidas; } public void setRegistros_saidas(List<RegistroSaida> registros_saidas) { this.registros_saidas = registros_saidas; } public List<RegistroEntrada> getRegistros_entradas() { return registros_entradas; } public void setRegistros_entradas(List<RegistroEntrada> registros_entradas) { this.registros_entradas = registros_entradas; } }
[ "brunoweiller@hotmail.com" ]
brunoweiller@hotmail.com
54a0fa202cc4ee284eb93a73300f7924845cca87
629fdec9eb8cf676f23974cfac8d7bd4a6684c1a
/com.beyondsoft.thrift.server/src/main/java/com/beyondsoft/thrift/server/RunServer.java
eced2f7b9c7b872235eff9420a3c26f7d1c1acc9
[]
no_license
github188/framework
0c592679836a73dbf5291e2aee0b559ae7c2412b
5e785834a4ef0cd34479084dc5fc45c87497765f
refs/heads/master
2020-03-23T14:25:48.370840
2014-11-14T09:03:58
2014-11-14T09:03:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,521
java
/* ************************************************************************** * 版权声明: * 本软件为博彥科技(深圳)有限公司开发研制。未经本公司正式书面同意, * 其他任何个人、团体不得使用、复制、修改或发布本软件. ************************************************************************** * 程序描述: * * ************************************************************************** * 修改历史: * Date: by: Reason: * * Oct 23, 2014 Simon.Hoo Initial Version. ************************************************************************* */ package com.beyondsoft.thrift.server; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * 类描述:<br> * Thrift 服务端启动 * @author Simon.Hoo * @date Oct 23, 2014 * @version v1.0 */ public class RunServer extends Thread { private Logger logger = LoggerFactory.getLogger(RunServer.class); public static void main(String[] args) { Thread thread = new RunServer(); thread.start(); } @Override public void run() { try{ new ClassPathXmlApplicationContext(new String[] {"config/app.xml"}); } catch (SecurityException e) { logger.debug(e.getMessage()); e.printStackTrace(); } catch (IllegalArgumentException e) { logger.debug(e.getMessage()); e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } }
[ "zh56983@163.com" ]
zh56983@163.com
e7f26610be9cf48cec87c3acd066c7b6449f2221
6fce7e77eca33caac73153cbe518efd36273e89b
/src/main/java/hcl/mybankapp/mybankapp/dto/AccountDetailsResponseDTO.java
377439d020536f439953aebc94b51ff0b3196d58
[]
no_license
pracheerjain/MyBank
339ca581d3d984d46c94508f8ab8ce6f89de7512
4ab0c96a7ac86099a0fd64a6d8bb520453ded373
refs/heads/master
2020-06-28T21:08:11.668387
2019-08-03T12:08:49
2019-08-03T12:08:49
200,342,292
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
package hcl.mybankapp.mybankapp.dto; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor public class AccountDetailsResponseDTO { private String accountHolderName; private String accountType; private Double accountBalance; private String accountNumber; }
[ "sontrive0310@gmail.com" ]
sontrive0310@gmail.com
9ab59403b589b30a085cc73189eace9118b49052
abdebbf3a25dab39faf8214833c642d58e57e571
/discovery-eureka-user-consumer-feign/src/main/java/com/jjy/entity/User.java
c2f2e97124f7af7f6569a83027b3ee4e0a8c43db
[]
no_license
TonnyFeng/springcloud
fd90f3b8d1917606c8f41f25a713255d910920c6
4d3c4b0ca666ce7f25a547265a4ae1444c5b70f8
refs/heads/master
2020-03-19T09:07:55.039730
2018-06-07T01:38:59
2018-06-07T01:38:59
136,262,116
0
0
null
null
null
null
UTF-8
Java
false
false
857
java
package com.jjy.entity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.NoArgsConstructor; import java.math.BigDecimal; /** * Created by fengwei on 2018/4/24. */ @Data @NoArgsConstructor @ApiModel public class User { @ApiModelProperty( name = "id" , value = "用户ID" , allowEmptyValue = true ) private Long id; @ApiModelProperty( name = "username" , value = "用户名" , allowEmptyValue = true ) private String username; @ApiModelProperty( name = "name" , value = "姓名" , allowEmptyValue = true ) private String name; @ApiModelProperty( name = "age" , value = "年龄" , allowEmptyValue = true ) private Short age; @ApiModelProperty( name = "balance" , value = "余额" , allowEmptyValue = true ) private BigDecimal balance; }
[ "Chongchong0522" ]
Chongchong0522
62aaa43b22e2fbd2569dab8c6ab9d59537a88389
6e2c013666813856b5d3e716fdc2befc63c6941e
/Recursion_homework/src/homework_17_02/problem3.java
312deb3c33305257e0ceda74cd7445ef53d03881
[]
no_license
dimitars2003/Recirsion
f979c11beadeab846834ae51fd44ec50d2bf2097
d64901d1e852437ae1467193c5596b88b1a6bab5
refs/heads/master
2023-03-06T22:32:33.120149
2021-02-16T21:16:19
2021-02-16T21:16:19
339,021,139
0
0
null
null
null
null
UTF-8
Java
false
false
495
java
package homework_17_02; public class problem3 { public static void main(String[] args) { // TODO Auto-generated method stub int number = 12345; digits(number,String.valueOf(number).length()); } public static void digits(int number, int current) { if(current==1) { System.out.print(number); return ; } if(current!=1) { System.out.print((int)(number/Math.pow(10, current-1))+" "); digits ( (int) (number%Math.pow(10, current-1)),current-1); return; } } }
[ "Admin@DESKTOP-RSJJARR" ]
Admin@DESKTOP-RSJJARR
935eb055eff1446805a8731447d00bc4d568c8d6
f3698795f174340106c66885bb57ac72134c58c8
/metacube/idatrix-metacube-web/src/main/java/com/ys/idatrix/metacube/metamanage/mapper/SnapshotTableColumnMapper.java
dbb8c7e3a65853a981d5cb13ef13e5909f3ce6dd
[]
no_license
ahandful/CloudETL
6e5c195953a944cdc62702b100bd7bcd629b4aee
bb4be62e8117082cd656741ecae33e4262ad3fb5
refs/heads/master
2020-09-13T01:33:43.749781
2019-04-18T02:12:08
2019-04-18T02:13:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
994
java
package com.ys.idatrix.metacube.metamanage.mapper; import com.ys.idatrix.metacube.metamanage.domain.SnapshotTableColumn; import org.apache.ibatis.annotations.Param; import java.util.List; public interface SnapshotTableColumnMapper { int deleteByPrimaryKey(Long id); int insert(SnapshotTableColumn record); int insertSelective(SnapshotTableColumn record); SnapshotTableColumn selectByPrimaryKey(Long id); int updateByPrimaryKeySelective(SnapshotTableColumn record); int updateByPrimaryKey(SnapshotTableColumn record); void batchInsert(List<SnapshotTableColumn> snapshotColList); // 根据 tableId 和版本号查询某个版本中表所属的字段信息 List<SnapshotTableColumn> selectListByTableIdAndVersion(@Param("tableId") Long tableId, @Param("version") Integer version); // 根据字段id和版本确定一条数据 SnapshotTableColumn findByColumnIdAndVersion(@Param("columnId") Long columnId, @Param("version") Integer version); }
[ "xionghan@gdbigdata.com" ]
xionghan@gdbigdata.com
75c6c6e059fe9ee166f9cee225005b8dc05add3f
000e2cbc0114b9277815f3716b3c08eab563d247
/src/tlv/parse/identifier/ParseMnemonic.java
97c4f883f7b2f9cc4c5e90bb23a303872bc01111
[ "BSD-3-Clause", "MIT" ]
permissive
ypyatnychko/tlv-comp
aaf72e3970ae01846f77c54cefd6f60c341a6d47
8b0a745130a39e6475b82e3653278e269c38402c
refs/heads/master
2021-07-06T11:43:29.960945
2021-05-28T19:45:59
2021-05-28T19:45:59
84,368,861
25
7
NOASSERTION
2021-05-28T19:46:00
2017-03-08T21:41:55
Java
UTF-8
Java
false
false
2,983
java
/* Copyright (c) 2014, Intel Corporation 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 Intel Corporation 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 tlv.parse.identifier; import tlv.parse.*; /** * ParseMnemonic extends ParseElement and is primarily used for identifying ParseElements * representing String labels rather then values. * * @author ypyatnyc * */ public class ParseMnemonic extends ParseElement { /** * Constructs a ParseMnemonic from a ParseNode, a Prefix and starting index value in the ParseNode's string. * * @param parseNode_ The ParseNode from which the ParseMnemonic is extracted * @param prefix_ The Prefix identifying the type of ParseMnemonic that will be extracted * @param stringStartIndex_ The string index at which to start extracting the ParseMnemonic */ public ParseMnemonic(ParseNode parseNode_, Prefix prefix_, int stringStartIndex_) { super(parseNode_, prefix_, stringStartIndex_); stringStartingIndex = stringStartIndex_; String temp_string = parseNode_.getString(); int i = stringStartIndex_; for(; i < temp_string.length(); i++) { if(temp_string.charAt(i) >= '0' && temp_string.charAt(i) <= '9') flagNumeric = true; else { if(!((temp_string.charAt(i) >= 'a' && temp_string.charAt(i) <= 'z') || (temp_string.charAt(i) >= 'A' && temp_string.charAt(i) <= 'Z') || (temp_string.charAt(i) == '_') )) // Non-alpha-numeric break; } } stringEndingIndex = i; label = temp_string.substring(stringStartingIndex, stringEndingIndex); } }
[ "ypyatnychko@hyannisportresearch.com" ]
ypyatnychko@hyannisportresearch.com
15acd1eeb07267f0d9d02846122740f449dc192e
543c52c87172b32776c5350e08d6270cb540dd1a
/app/src/main/java/com/mjgallery/mjgallery/di/component/DiscoveryDataAllComponent.java
ad0b1d5dc397f830f3d7c152f3426338ccc752ff
[]
no_license
navicatcode/mjgallery
34b973417d440f5ad2564caaf546a91da4f9cc6d
eeeb799061c6be254d154a7b058e34e6d2af320b
refs/heads/master
2020-12-23T17:31:28.661425
2020-02-02T07:57:26
2020-02-02T07:57:26
237,218,150
1
0
null
null
null
null
UTF-8
Java
false
false
1,419
java
package com.mjgallery.mjgallery.di.component; import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.scope.FragmentScope; import com.mjgallery.mjgallery.di.module.DiscoveryDataAllModule; import com.mjgallery.mjgallery.mvp.contract.discovery.discoverydata.DiscoveryDataAllContract; import com.mjgallery.mjgallery.mvp.ui.fragment.discovery.discoverydata.DiscoveryDataAllFragment; import dagger.BindsInstance; import dagger.Component; /** * ================================================ * Description: * <p> * Created by MVPArmsTemplate on 08/31/2019 20:04 * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a> * <a href="https://github.com/JessYanCoding">Follow me</a> * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a> * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a> * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a> * ================================================ */ @FragmentScope @Component(modules = DiscoveryDataAllModule.class, dependencies = AppComponent.class) public interface DiscoveryDataAllComponent { void inject(DiscoveryDataAllFragment fragment); @Component.Builder interface Builder { @BindsInstance Builder view(DiscoveryDataAllContract.View view); Builder appComponent(AppComponent appComponent); DiscoveryDataAllComponent build(); } }
[ "navicatcode@gmail.com" ]
navicatcode@gmail.com
930ebe80de289d90af7659da8710c9b7f3418339
d56c8a7bde68808aae5ccd5bfaacf0956f188448
/src/main/java/br/com/alura/forum/controller/TopicosController.java
d9167013860a6f2c6eee9131c4f2734e5d2be04b
[]
no_license
freire-marcos/forum-api
b487798b630776cf1bea8e4d951025d90902327d
e77bb83cf91c9483fd71750279ce46319f72e942
refs/heads/master
2023-08-18T14:53:31.277699
2021-10-01T00:36:39
2021-10-01T00:36:39
412,273,173
0
0
null
null
null
null
UTF-8
Java
false
false
643
java
package br.com.alura.forum.controller; import java.util.Arrays; import java.util.List; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import br.com.alura.forum.controller.dto.TopicoDto; import br.com.alura.forum.modelo.Curso; import br.com.alura.forum.modelo.Topico; @RestController public class TopicosController { @RequestMapping("/topicos") public List<TopicoDto> lista() { Topico topico = new Topico("Dúvida", "Dúvida com Spring", new Curso("Spring", "Programação")); return TopicoDto.converter(Arrays.asList(topico, topico, topico)); } }
[ "marcostavares.dev@gmail.com" ]
marcostavares.dev@gmail.com
cfcc6ae43def73f41c5980accdffefcc74cf90ee
3c36bd839e06a868102766402e2e3810e55304de
/DIGICCY-Front/src/main/java/com/inesv/digiccy/common/Code.java
29e7499e645b4975c3f2d8963d85ef3bc727781b
[]
no_license
utike/guirenwang
7759d30af1d202f8e356f9e65b6a40b3f5ec533f
0bb9628175c2654db1a472bd8ca276c688a1ea3b
refs/heads/master
2021-01-23T23:56:31.965236
2017-10-21T06:55:27
2017-10-21T06:55:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
648
java
/** * */ package com.inesv.digiccy.common; /** * @author houzhijia * @2014-9-10 * @上午11:36:15 */ public enum Code { success("0","ok"), error("-1", "system error"), token_invalid("1","token invalid"); /** * @param code * @param msg */ private Code ( String code ,String msg ) { this.code = code; this.msg = msg; } private String code; private String msg; public String getCode(){ return code; } public void setCode(String code){ this.code = code; } public String getMsg(){ return msg; } public void setMsg(String msg){ this.msg = msg; } }
[ "18819230126@139.com" ]
18819230126@139.com
190be9cff57a055cf3e2ea909bd4b62b55d4d1ca
a8cbda370cec36582a0b56bdabb7ae3093d75341
/m2t-web/src/java/br/com/dsls/useCaseDiagram/UseCaseDiagramBaseListener.java
19d34c64058a37ff8bae718cea0e83727188f073
[]
no_license
leluque/model2gether
b5616fb7eaf058b8f493ed870457d88d54b7ef2d
a2ac083f7b254af583f9741d20fd81eb52715188
refs/heads/master
2021-06-21T05:26:51.571119
2017-08-14T14:04:10
2017-08-14T14:04:10
100,273,949
1
0
null
null
null
null
UTF-8
Java
false
false
5,541
java
// Generated from G:\_TG\_Testes\Teste_ANTLR\Teste_3\src\u005CuseCaseLanguage\UseCaseDiagram.g4 by ANTLR 4.4 package br.com.dsls.useCaseDiagram; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.misc.NotNull; import org.antlr.v4.runtime.tree.ErrorNode; import org.antlr.v4.runtime.tree.TerminalNode; /** * This class provides an empty implementation of {@link UseCaseDiagramListener}, * which can be extended to create a listener which only needs to handle a subset * of the available methods. */ public class UseCaseDiagramBaseListener implements UseCaseDiagramListener { /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterActor(@NotNull UseCaseDiagramParser.ActorContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitActor(@NotNull UseCaseDiagramParser.ActorContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterActors(@NotNull UseCaseDiagramParser.ActorsContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitActors(@NotNull UseCaseDiagramParser.ActorsContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterUseCases(@NotNull UseCaseDiagramParser.UseCasesContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitUseCases(@NotNull UseCaseDiagramParser.UseCasesContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterUseCaseDiagram(@NotNull UseCaseDiagramParser.UseCaseDiagramContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitUseCaseDiagram(@NotNull UseCaseDiagramParser.UseCaseDiagramContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterUseCase(@NotNull UseCaseDiagramParser.UseCaseContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitUseCase(@NotNull UseCaseDiagramParser.UseCaseContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterDiagramName(@NotNull UseCaseDiagramParser.DiagramNameContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitDiagramName(@NotNull UseCaseDiagramParser.DiagramNameContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterRelationComm(@NotNull UseCaseDiagramParser.RelationCommContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitRelationComm(@NotNull UseCaseDiagramParser.RelationCommContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterRelationIncl(@NotNull UseCaseDiagramParser.RelationInclContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitRelationIncl(@NotNull UseCaseDiagramParser.RelationInclContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterRelations(@NotNull UseCaseDiagramParser.RelationsContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitRelations(@NotNull UseCaseDiagramParser.RelationsContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterElementActor(@NotNull UseCaseDiagramParser.ElementActorContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitElementActor(@NotNull UseCaseDiagramParser.ElementActorContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterElementUseCase(@NotNull UseCaseDiagramParser.ElementUseCaseContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitElementUseCase(@NotNull UseCaseDiagramParser.ElementUseCaseContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterRelationExte(@NotNull UseCaseDiagramParser.RelationExteContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitRelationExte(@NotNull UseCaseDiagramParser.RelationExteContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterEveryRule(@NotNull ParserRuleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitEveryRule(@NotNull ParserRuleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void visitTerminal(@NotNull TerminalNode node) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void visitErrorNode(@NotNull ErrorNode node) { } }
[ "leandro.luque@gmail.com" ]
leandro.luque@gmail.com
b66505a4afba25cb63304e9a560577600ef0bc7d
d46fea0bc8a01149fe679bd66727323ea59d10bb
/drools-grid/drools-grid-impl/src/test/java/org/drools/grid/time/impl/ScheduledJobJpaTest.java
61ddd20564f1ee01acad2eda2f172e5d6be0244a
[ "Apache-2.0" ]
permissive
mariofusco/droolsjbpm-integration
f924abf3b7c17fe8c744530398c15c2cb5e2ee40
ad16d393739ad51a5a63ed8dc28733e4d590832a
refs/heads/master
2022-08-20T16:48:14.008199
2011-08-09T09:28:05
2011-08-09T09:28:05
2,220,322
0
1
Apache-2.0
2022-03-25T09:24:48
2011-08-17T07:03:31
Java
UTF-8
Java
false
false
3,178
java
package org.drools.grid.time.impl; import java.io.Serializable; import org.drools.grid.timer.impl.UuidJobHandle; import org.drools.grid.timer.impl.ScheduledJob; import java.util.Date; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import org.drools.time.Job; import org.drools.time.JobContext; import org.drools.time.JobHandle; import org.drools.time.Trigger; import org.junit.After; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class ScheduledJobJpaTest { @Test public void test1() { EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.drools.grid" ); UuidJobHandle handle = new UuidJobHandle(); ScheduledJob sj1 = new ScheduledJob( handle, new MockJob(), new MockJobContext( "xxx" ), new MockTrigger( new Date( 1000 ) ) ); ScheduledJob sj2 = new ScheduledJob( handle, new MockJob(), new MockJobContext( "xxx" ), new MockTrigger( new Date( 1000 ) ) ); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.persist( sj1 ); em.getTransaction().commit(); em.close(); em = emf.createEntityManager(); sj1 = em.find( ScheduledJob.class, sj1.getId() ); assertEquals( sj2.getId(), sj1.getId() ); assertEquals( sj2.getJob().getClass(), sj1.getJob().getClass() ); assertEquals( "xxx", ((MockJobContext) sj1.getJobContext()).getText() ); assertEquals( new Date( 1000 ), ((MockTrigger) sj1.getTrigger()).hasNextFireTime() ); assertEquals( new Date( 1000 ), ((MockTrigger) sj1.getTrigger()).nextFireTime() ); } public static class MockJob implements Job, Serializable { public void execute(JobContext ctx) { } } public static class MockJobContext implements JobContext, Serializable { private String text; public MockJobContext() { } public MockJobContext(String text) { this.text = text; } public JobHandle getJobHandle() { return null; } public void setJobHandle(JobHandle jobHandle) { } public String getText() { return this.text; } } public static class MockTrigger implements Trigger, Serializable { private Date date; public MockTrigger() { } public MockTrigger(Date date) { this.date = date; } public Date hasNextFireTime() { return this.date; } public Date nextFireTime() { return this.date; } } }
[ "gds.geoffrey.de.smet@gmail.com" ]
gds.geoffrey.de.smet@gmail.com
7e39bdadaa5e4ad9e7ec15baceba8979a54b7597
81709b97a0cfc51ca07a1cc356e80aa64f31f71a
/src/reservation/ChoiceHour.java
a1f4db5d2e86ce00a048741c97b91d4f8abeec47
[]
no_license
50416013/kadai20150119
1390d11f4ce19018dfd837bda60b27e1114cf869
6b4da6bff0dbba8e2aa35960efe539cba94e1158
refs/heads/master
2021-01-13T00:38:20.062246
2016-02-16T05:05:05
2016-02-16T05:05:05
51,808,693
0
0
null
null
null
null
UTF-8
Java
false
false
449
java
package reservation; import java.awt.Choice; public class ChoiceHour extends Choice{ ChoiceHour(){ resetRange(9,21); } public void resetRange( int start, int end){ int number = end - start +1; removeAll(); while (start<=end){ String h = String.valueOf(start); if ( h.length()==1){ h = "0" + h; } add(h); start++; } } public String getLast(){ return getItem( getItemCount()-1 ); } }
[ "za155204@ipc.shizuoka.ac.jp" ]
za155204@ipc.shizuoka.ac.jp
833116fbffbf71f37efa6342972d36f4d148e0b9
8e565231380349e7cc314f0ddd50c337b1279b61
/src/jio/System/ComponentModel/PropertyDescriptorCollection.java
a68f4a3538f2338a0cce624d0ef9ec488fa97922
[]
no_license
Javonet-io-user/aed9e6cc-4eab-4516-9761-7cfc766958d7
0483c7726c62923be3185d9a83104a282b913acc
5e4eca2664b84e0701bf618b61b6ec18b7e042e8
refs/heads/master
2020-05-02T13:00:33.383695
2019-03-27T10:41:21
2019-03-27T10:41:21
177,972,971
0
0
null
null
null
null
UTF-8
Java
false
false
13,010
java
package jio.System.ComponentModel; import Common.Activation; import static Common.JavonetHelper.Convert; import static Common.JavonetHelper.getGetObjectName; import static Common.JavonetHelper.getReturnObjectName; import static Common.JavonetHelper.ConvertToConcreteInterfaceImplementation; import Common.JavonetHelper; import Common.MethodTypeAnnotation; import com.javonet.Javonet; import com.javonet.JavonetException; import com.javonet.JavonetFramework; import com.javonet.api.NObject; import com.javonet.api.NEnum; import com.javonet.api.keywords.NRef; import com.javonet.api.keywords.NOut; import com.javonet.api.NControlContainer; import java.util.concurrent.atomic.AtomicReference; import java.util.Iterator; import java.lang.*; import jio.System.ComponentModel.*; import jio.System.Collections.*; import jio.System.*; public class PropertyDescriptorCollection implements ICollection, IEnumerable, IList, IDictionary, Iterable<Object> { protected NObject javonetHandle; @Override public Iterator<Object> iterator() { return (Iterator<Object>) this.GetEnumerator(); } public PropertyDescriptorCollection(PropertyDescriptor[] properties) { try { javonetHandle = Javonet.New( "System.ComponentModel.PropertyDescriptorCollection", new Object[] {properties}); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } public PropertyDescriptorCollection(PropertyDescriptor[] properties, java.lang.Boolean readOnly) { try { javonetHandle = Javonet.New( "System.ComponentModel.PropertyDescriptorCollection", new Object[] {properties}, readOnly); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } public PropertyDescriptorCollection(NObject handle) { this.javonetHandle = handle; } public void setJavonetHandle(NObject handle) { this.javonetHandle = handle; } /** Method */ @MethodTypeAnnotation(type = "Method") public IEnumerator GetEnumerator() { try { Object res = javonetHandle.invoke("GetEnumerator"); if (res == null) return null; return ConvertToConcreteInterfaceImplementation(res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.Integer getICollection_Count() { try { java.lang.Integer res = javonetHandle.explicitInterface("jio.System.Collections.ICollection").invoke("get_Count"); if (res == null) return 0; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return 0; } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public Object getSyncRoot() { try { Object res = javonetHandle .explicitInterface("jio.System.Collections.ICollection") .invoke("get_SyncRoot"); if (res == null) return null; return ConvertToConcreteInterfaceImplementation(res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.Boolean getIsSynchronized() { try { java.lang.Boolean res = javonetHandle .explicitInterface("jio.System.Collections.ICollection") .invoke("get_IsSynchronized"); if (res == null) return false; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return false; } } /** Method */ @MethodTypeAnnotation(type = "Method") public IEnumerator IEnumerable_GetEnumerator() { try { Object res = javonetHandle .explicitInterface("jio.System.Collections.IEnumerable") .invoke("GetEnumerator"); if (res == null) return null; return ConvertToConcreteInterfaceImplementation(res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "Method") public Object getIList_Item(java.lang.Integer index) { try { Object res = javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("get_Item", index); if (res == null) return null; return ConvertToConcreteInterfaceImplementation(res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "Method") public void setIList_Item(java.lang.Integer index, Object value) { try { javonetHandle .explicitInterface("jio.System.Collections.IList") .invoke("set_Item", index, value); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** Method */ @MethodTypeAnnotation(type = "Method") public java.lang.Integer IList_Add(Object value) { try { java.lang.Integer res = javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("Add", value); if (res == null) return 0; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return 0; } } /** Method */ @MethodTypeAnnotation(type = "Method") public java.lang.Boolean IList_Contains(Object value) { try { java.lang.Boolean res = javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("Contains", value); if (res == null) return false; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return false; } } /** Method */ @MethodTypeAnnotation(type = "Method") public void IList_Clear() { try { javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("Clear"); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.Boolean getIList_IsReadOnly() { try { java.lang.Boolean res = javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("get_IsReadOnly"); if (res == null) return false; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return false; } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.Boolean getIList_IsFixedSize() { try { java.lang.Boolean res = javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("get_IsFixedSize"); if (res == null) return false; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return false; } } /** Method */ @MethodTypeAnnotation(type = "Method") public java.lang.Integer IndexOf(Object value) { try { java.lang.Integer res = javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("IndexOf", value); if (res == null) return 0; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return 0; } } /** Method */ @MethodTypeAnnotation(type = "Method") public void IList_Insert(java.lang.Integer index, Object value) { try { javonetHandle .explicitInterface("jio.System.Collections.IList") .invoke("Insert", index, value); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** Method */ @MethodTypeAnnotation(type = "Method") public void IList_Remove(Object value) { try { javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("Remove", value); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** Method */ @MethodTypeAnnotation(type = "Method") public void IList_RemoveAt(java.lang.Integer index) { try { javonetHandle.explicitInterface("jio.System.Collections.IList").invoke("RemoveAt", index); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public ICollection getIDictionary_Keys() { try { Object res = javonetHandle.explicitInterface("jio.System.Collections.IDictionary").invoke("get_Keys"); if (res == null) return null; return ConvertToConcreteInterfaceImplementation(res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public ICollection getIDictionary_Values() { try { Object res = javonetHandle .explicitInterface("jio.System.Collections.IDictionary") .invoke("get_Values"); if (res == null) return null; return ConvertToConcreteInterfaceImplementation(res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** Method */ @MethodTypeAnnotation(type = "Method") public java.lang.Boolean IDictionary_Contains(Object key) { try { java.lang.Boolean res = javonetHandle .explicitInterface("jio.System.Collections.IDictionary") .invoke("Contains", key); if (res == null) return false; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return false; } } /** Method */ @MethodTypeAnnotation(type = "Method") public void Add(Object key, Object value) { try { javonetHandle .explicitInterface("jio.System.Collections.IDictionary") .invoke("Add", key, value); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** Method */ @MethodTypeAnnotation(type = "Method") public void IDictionary_Clear() { try { javonetHandle.explicitInterface("jio.System.Collections.IDictionary").invoke("Clear"); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.Boolean getIDictionary_IsReadOnly() { try { java.lang.Boolean res = javonetHandle .explicitInterface("jio.System.Collections.IDictionary") .invoke("get_IsReadOnly"); if (res == null) return false; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return false; } } /** ExplicitSetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.Boolean getIDictionary_IsFixedSize() { try { java.lang.Boolean res = javonetHandle .explicitInterface("jio.System.Collections.IDictionary") .invoke("get_IsFixedSize"); if (res == null) return false; return res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return false; } } /** Method */ @MethodTypeAnnotation(type = "Method") public IDictionaryEnumerator IDictionary_GetEnumerator() { try { Object res = javonetHandle .explicitInterface("jio.System.Collections.IDictionary") .invoke("GetEnumerator"); if (res == null) return null; return ConvertToConcreteInterfaceImplementation(res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** Method */ @MethodTypeAnnotation(type = "Method") public void IDictionary_Remove(Object key) { try { javonetHandle.explicitInterface("jio.System.Collections.IDictionary").invoke("Remove", key); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } static { try { Activation.initializeJavonet(); } catch (java.lang.Exception e) { e.printStackTrace(); } } }
[ "support@javonet.com" ]
support@javonet.com
8153a9e452adbaeb08e71abca5a33b84eaabc015
60b632f093852c4aebad8b9275690965ee9096a4
/pertemuan11/teori11/FormMahasiswa.java
4965b3813a4691e0856633ec64cf2daae960c1d0
[]
no_license
thebeast07-cyber/PBO_4418
e5cf55c7fb016b8fdb3234d17ff03652b905f455
65e321f2c4d6aa4eede10ce8476bce9ef0473e7e
refs/heads/main
2023-06-17T23:09:07.373154
2021-07-12T19:08:56
2021-07-12T19:08:56
348,277,716
0
0
null
null
null
null
UTF-8
Java
false
false
21,054
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 mvc.View; import mvc.Controller.ControllerMahasiswa; import mvc.DAO.DAOMahasiswa; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.swing.JButton; import javax.swing.JOptionPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.JComboBox; import javax.swing.JTextArea; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.text.*; /** * * @author asus */ public class FormMahasiswa extends javax.swing.JFrame { ControllerMahasiswa cbt; /** * Creates new form FormMahasiswa */ public FormMahasiswa() { initComponents(); cbt=new ControllerMahasiswa(this); cbt.isiTable(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); setjk = new javax.swing.JComboBox<>(); txtID = new javax.swing.JTextField(); txtNim = new javax.swing.JTextField(); txtNama = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); txtAlamat = new javax.swing.JTextField(); buttonCariNama = new javax.swing.JButton(); jScrollPane3 = new javax.swing.JScrollPane(); tabelData = new javax.swing.JTable(); txtCariNama = new javax.swing.JTextField(); buttonInsert = new javax.swing.JButton(); buttonUpdate = new javax.swing.JButton(); buttonDelete = new javax.swing.JButton(); buttonReset = new javax.swing.JButton(); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); jScrollPane2.setViewportView(jTable1); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setText("ID"); jLabel2.setText("NIM"); jLabel3.setText("Nama"); jLabel4.setText("kelamin"); jLabel5.setText("Alamat"); setjk.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "L", "P" })); setjk.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { setjkActionPerformed(evt); } }); txtID.setText("jTextField1"); txtID.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtIDActionPerformed(evt); } }); txtNim.setText("jTextField2"); txtNim.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtNimActionPerformed(evt); } }); txtNama.setText("jTextField3"); txtNama.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtNamaActionPerformed(evt); } }); jLabel6.setText("cari(Nama)"); txtAlamat.setText("jTextField4"); txtAlamat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtAlamatActionPerformed(evt); } }); buttonCariNama.setText("Cari"); buttonCariNama.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCariNamaActionPerformed(evt); } }); tabelData.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); jScrollPane3.setViewportView(tabelData); txtCariNama.setText("jTextField1"); txtCariNama.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtCariNamaActionPerformed(evt); } }); buttonInsert.setText("Simpan"); buttonInsert.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonInsertActionPerformed(evt); } }); buttonUpdate.setText("Ubah"); buttonUpdate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonUpdateActionPerformed(evt); } }); buttonDelete.setText("Hapus"); buttonDelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonDeleteActionPerformed(evt); } }); buttonReset.setText("Batal"); buttonReset.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonResetActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtID, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE) .addComponent(txtNim))) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtNama)) .addGroup(layout.createSequentialGroup() .addGap(5, 5, 5) .addComponent(setjk, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtAlamat))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(txtCariNama, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonCariNama)) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addComponent(buttonInsert, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonReset, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addGap(25, 25, 25) .addComponent(txtNim, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(txtNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(setjk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5) .addComponent(txtAlamat))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(txtID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6) .addComponent(txtCariNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(buttonCariNama)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(buttonInsert) .addComponent(buttonUpdate) .addComponent(buttonDelete) .addComponent(buttonReset)) .addContainerGap(263, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void buttonInsertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonInsertActionPerformed // TODO add your handling code here: cbt.insert(); cbt.isiTable(); cbt.reset(); }//GEN-LAST:event_buttonInsertActionPerformed private void buttonUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUpdateActionPerformed // TODO add your handling code here: cbt.update(); cbt.isiTable(); cbt.reset(); }//GEN-LAST:event_buttonUpdateActionPerformed private void buttonDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDeleteActionPerformed // TODO add your handling code here: cbt.delete(); cbt.isiTable(); cbt.reset(); }//GEN-LAST:event_buttonDeleteActionPerformed private void buttonResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonResetActionPerformed // TODO add your handling code here: cbt.reset(); }//GEN-LAST:event_buttonResetActionPerformed private void buttonCariNamaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCariNamaActionPerformed // TODO add your handling code here: cbt.carinama(); }//GEN-LAST:event_buttonCariNamaActionPerformed private void txtIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIDActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtIDActionPerformed private void txtNimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNimActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtNimActionPerformed private void txtNamaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNamaActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtNamaActionPerformed private void setjkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_setjkActionPerformed // TODO add your handling code here: }//GEN-LAST:event_setjkActionPerformed private void txtAlamatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtAlamatActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtAlamatActionPerformed private void txtCariNamaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCariNamaActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtCariNamaActionPerformed /** * @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(FormMahasiswa.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(FormMahasiswa.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(FormMahasiswa.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(FormMahasiswa.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 FormMahasiswa().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton buttonCariNama; private javax.swing.JButton buttonDelete; private javax.swing.JButton buttonInsert; private javax.swing.JButton buttonReset; private javax.swing.JButton buttonUpdate; private javax.swing.JLabel jLabel1; 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.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JTable jTable1; private javax.swing.JComboBox<String> setjk; private javax.swing.JTable tabelData; private javax.swing.JTextField txtAlamat; private javax.swing.JTextField txtCariNama; private javax.swing.JTextField txtID; private javax.swing.JTextField txtNama; private javax.swing.JTextField txtNim; // End of variables declaration//GEN-END:variables public JTextField getTxtID() { return txtID; } public JTextField getTxtNim() { return txtNim; } public JTextField getTxtNama() { return txtNama; } public JComboBox getTxtJk() { return setjk; } public JTextField getTxtAlamat() { return txtAlamat; } public JTable getTabelData() { return tabelData; } public JButton getButtonInsert() { return buttonInsert; } public JButton getButtonUpdate() { return buttonUpdate; } public JButton getButtonDelete() { return buttonDelete; } public JButton getButtonReset() { return buttonReset; } public JButton getButtonCari() { return buttonCariNama; } public JTextField getTxtCariNama() { return txtCariNama; } }
[ "najah.nailun88@gmail.com" ]
najah.nailun88@gmail.com
ac34e0b155b76b7add9fc12096db494fd47f9614
3e72ccbb4ea355b1cd693e4398c7c71a8faf8b62
/src/main/java/com/shaman/task_3_2/exceptions/InvalidPlaneTypeException.java
2f6adbfac74758386aa932341b4ef1693e4b3e35
[]
no_license
shaman2001/task_3_2
7f479a1e51749c0794640c1c46b60cdca09bbbdb
9a3b51f70213c4d0a7583d760aa0cca0e4a3413e
refs/heads/master
2020-04-17T13:38:41.940956
2016-09-05T19:30:51
2016-09-05T19:30:51
65,913,917
0
0
null
null
null
null
UTF-8
Java
false
false
702
java
package com.shaman.task_3_2.exceptions; import java.io.IOException; public class InvalidPlaneTypeException extends IOException { /** * */ private static final long serialVersionUID = 4523108554903188469L; public InvalidPlaneTypeException() { // TODO Auto-generated constructor stub } public InvalidPlaneTypeException(String arg0) { super(arg0); // TODO Auto-generated constructor stub } public InvalidPlaneTypeException(Throwable cause) { super(cause); // TODO Auto-generated constructor stub } public InvalidPlaneTypeException(String message, Throwable cause) { super(message, cause); // TODO Auto-generated constructor stub } }
[ "v.s.kotovich@gmail.com" ]
v.s.kotovich@gmail.com
3b9d695d16f1663cccbaeaa5be6b43d6434e5837
ebc9d1e9bd19342e01e9920513a506479ac8bfa2
/src/main/java/com/oracle/demo/entity/CommentOfComment.java
2deab55ba884be4a3834f8789c8cc4dd67c0c7b6
[]
no_license
yoyoyoyo1/keybordwar
23cbb7dcaa881c460eed01cc90f3b86b6b26c292
e96bdd6033a6f6e3c7abbbb3a45c620d08f6d126
refs/heads/master
2022-06-18T03:55:55.532769
2019-07-30T10:52:41
2019-07-30T10:52:41
196,497,167
2
1
null
2022-06-17T02:20:09
2019-07-12T02:47:21
HTML
UTF-8
Java
false
false
1,330
java
package com.oracle.demo.entity; import javax.persistence.*; import java.util.Date; @Entity public class CommentOfComment { @GeneratedValue(strategy= GenerationType.IDENTITY) @Id private int id; private int userId;//评论人id private int shareId;//说说id private int commentId;//评论id @Column(columnDefinition="TEXT") private String content; @Column(columnDefinition="TIMESTAMP default CURRENT_TIMESTAMP" ) private Date createdAt; public int getId() { return id; } public void setId(int id) { this.id = id; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public int getShareId() { return shareId; } public void setShareId(int shareId) { this.shareId = shareId; } public int getCommentId() { return commentId; } public void setCommentId(int commentId) { this.commentId = commentId; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Date getCreatedAt() { return createdAt; } public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; } }
[ "earunwu@gmail.com" ]
earunwu@gmail.com
6843ab69cb916e199d1c6b170c69f0299498e79a
ff79e46531d5ad204abd019472087b0ee67d6bd5
/components/mail/test-src/och/comp/mail/MailServiceTest.java
426a403f651eff0ffb693012158435b097766867
[ "Apache-2.0" ]
permissive
Frankie-666/live-chat-engine
24f927f152bf1ef46b54e3d55ad5cf764c37c646
3125d34844bb82a34489d05f1dc5e9c4aaa885a0
refs/heads/master
2020-12-25T16:36:00.156135
2015-08-16T09:16:57
2015-08-16T09:16:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,669
java
/* * Copyright 2015 Evgeny Dolganov (evgenij.dolganov@gmail.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package och.comp.mail; import static och.api.model.PropKey.*; import java.util.ArrayList; import och.comp.mail.common.SendTask; import och.service.props.Props; import och.service.props.WriteProps; import och.service.props.impl.MapProps; import org.junit.Before; import org.junit.Test; import test.BaseTest; import test.TestException; public class MailServiceTest extends BaseTest { MapProps props = new MapProps(); @Before public void init(){ props.putVal(mail_storeToDisc, false); } @Test public void test_send_once() throws Exception { boolean[] succeed = {true}; MailService mailService = new MailService(new Sender() { @Override public void send(SendTask task, Props config) throws Exception { if( ! succeed[0]) throw new TestException(); } }, props); //ok mailService.sendOnce(new SendReq().to("ddd@dd.dd").subject("test").text("test")); //fail try { succeed[0] = false; mailService.sendOnce(new SendReq().to("ddd@dd.dd").subject("test").text("test")); fail_exception_expected(); }catch(TestException e){ //ok } } @Test public void test_send_fail() throws Exception{ class Result { boolean done; String text; Throwable t; int tryCount; ArrayList<Long> times = new ArrayList<>(); void addTime(){ times.add(System.currentTimeMillis()); } } final Result result = new Result(); result.addTime(); final Object monitor = new Object(); WriteProps props = new MapProps(); int errorWaitDelta = 100; props.putVal(mail_errorWaitDelta, ""+errorWaitDelta); props.putVal(mail_storeToDisc, false); MailService mailService = new MailService(new Sender() { @Override public void send(SendTask task, Props props) throws Exception { result.tryCount++; result.addTime(); throw new TestException(); } }, props); String msg = "test"; mailService.sendAsync(new SendReq("test@test.ru", "subject", msg), new SendCallback() { @Override public void onSuccess() { synchronized (monitor) { result.done = true; monitor.notifyAll(); } } @Override public void onFailed(Throwable t) { synchronized (monitor) { result.done = true; result.t = t; monitor.notifyAll(); } } }); synchronized (monitor) { if( ! result.done) monitor.wait(); mailService.shutdown(); assertTrue(result.t instanceof TestException); assertEquals(3, result.tryCount); assertNull(result.text); //check wait time ArrayList<Long> times = result.times; assertEquals(4, times.size()); for (int i = 1; i < times.size(); i++) { long timeDelta = times.get(i) - times.get(i-1); System.out.println(timeDelta); long expectedWait = (i-1)*errorWaitDelta; long marginOfError = 100; assertTrue("timeDelta="+timeDelta+", expectedWait="+expectedWait, timeDelta >= expectedWait-marginOfError && timeDelta <= expectedWait+marginOfError); } } } @Test public void test_send_success() throws Exception{ class Result { boolean done; String text; Throwable t; } final Result result = new Result(); final Object monitor = new Object(); MailService mailService = new MailService(new Sender() { @Override public void send(SendTask task, Props config) throws Exception { result.text = task.msg.text; } }, props); String msg = "test"; mailService.sendAsync(new SendReq("test@test.ru", "subject", msg), new SendCallback() { @Override public void onSuccess() { synchronized (monitor) { result.done = true; monitor.notifyAll(); } } @Override public void onFailed(Throwable t) { synchronized (monitor) { result.done = true; result.t = t; monitor.notifyAll(); } } }); synchronized (monitor) { if( ! result.done) monitor.wait(); mailService.shutdown(); assertEquals(msg, result.text); assertNull(result.t); } } }
[ "evgenij.dolganov@gmail.com" ]
evgenij.dolganov@gmail.com
bb9cdab6154715ad0818215f2c6cc4e7f6b66373
795f070171e932f64c23ebce4ff0274ec31980eb
/DaneFile/src/test/TestFile.java
cb823f68f4e88fc5f06850e10d539572aa6dffce
[]
no_license
DubanGarcia3/ProgrmacionII
7763584fae8d1695fc090535442f477153c45630
848cff98e3c86b80355b6eb6bd5af17204becba2
refs/heads/master
2021-01-20T04:04:41.248372
2017-05-17T01:21:41
2017-05-17T01:21:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
174
java
package test; import controller.Controller; public class TestFile { public static void main(String[] args) { Controller controller =new Controller(); } }
[ "Duban@DubanGarciaLaptop.home" ]
Duban@DubanGarciaLaptop.home
b3e20daf01a2c1afef479fe4fef91dd901154648
3b81e703901852799ecdf25e6c5ec62a31d2221a
/Module4/bai_7_SDR/thuc_hanh/customer/src/main/java/p1/customer/controller/ProvinceController.java
1b66b162caf8c20bb884a7a3b6ea0a2e17bf8b79
[]
no_license
kienth211/C1020G1_Tran_Huu_Kien
1fc43325849b54d917ece4d23108ca15a5e9994d
4bb1e6ee957a5a43f4b534bb95b226b87020454e
refs/heads/main
2023-04-16T02:17:22.284829
2021-04-19T00:39:07
2021-04-19T00:39:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,883
java
package p1.customer.controller; import p1.customer.model.Customer; import p1.customer.model.Province; import p1.customer.service.CustomerService; import p1.customer.service.ProvinceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.ModelAndView; @Controller public class ProvinceController { @Autowired ProvinceService provinceService; @Autowired CustomerService customerService; @GetMapping("/provinces") public ModelAndView listProvinces(){ Iterable<Province> provinces = provinceService.findAll(); ModelAndView modelAndView = new ModelAndView("/province/list"); modelAndView.addObject("provinces", provinces); return modelAndView; } @GetMapping("/create-province") public ModelAndView showCreateForm(){ ModelAndView modelAndView = new ModelAndView("/province/create"); modelAndView.addObject("province", new Province()); return modelAndView; } @PostMapping("/create-province") public ModelAndView saveProvince(@ModelAttribute("province") Province province){ provinceService.save(province); ModelAndView modelAndView = new ModelAndView("/province/create"); modelAndView.addObject("province", new Province()); modelAndView.addObject("message", "New province created successfully"); return modelAndView; } @GetMapping("/edit-province/{id}") public ModelAndView showEditForm(@PathVariable Long id){ Province province = provinceService.findById(id); if(province != null) { ModelAndView modelAndView = new ModelAndView("/province/edit"); modelAndView.addObject("province", province); return modelAndView; }else { ModelAndView modelAndView = new ModelAndView("/error.404"); return modelAndView; } } @PostMapping("/edit-province") public ModelAndView updateProvince(@ModelAttribute("province") Province province){ provinceService.save(province); ModelAndView modelAndView = new ModelAndView("/province/edit"); modelAndView.addObject("province", province); modelAndView.addObject("message", "Province updated successfully"); return modelAndView; } @GetMapping("/delete-province/{id}") public ModelAndView showDeleteForm(@PathVariable Long id){ Province province = provinceService.findById(id); if(province != null) { ModelAndView modelAndView = new ModelAndView("/province/delete"); modelAndView.addObject("province", province); return modelAndView; }else { ModelAndView modelAndView = new ModelAndView("/error.404"); return modelAndView; } } @PostMapping("/delete-province") public String deleteProvince(@ModelAttribute("province") Province province){ provinceService.remove(province.getId()); return "redirect:provinces"; } @GetMapping("/view-province/{id}") public ModelAndView viewProvince(@PathVariable("id") Long id){ Province province = provinceService.findById(id); if(province == null){ return new ModelAndView("/error.404"); } Iterable<Customer> customers = customerService.findAllByProvince(province); ModelAndView modelAndView = new ModelAndView("/province/view"); modelAndView.addObject("province", province); modelAndView.addObject("customers", customers); return modelAndView; } }
[ "kienthd5h3@gmail.com" ]
kienthd5h3@gmail.com
6168b3b55e78d4b4df0befee90c0598579a5118e
adafe00f672d5e168e4ffd59d5af2b3907e504d5
/src/apps/TaskList/vegvisirDatatype/build/generated/source/proto/main/java/com/vegvisir/network/datatype/proto/PeerViewOrBuilder.java
8c8443d6d204eb1a78bed5b7d43b4d589b6d5617
[]
no_license
ZhengxunWu/VegvisirshoppingList
26c5ae7ad8cb7d7f89dbf600a438c17910a4827e
489b7f2b7de0ef6e2dac918b5e5ea9df99111c0e
refs/heads/master
2020-06-05T07:53:34.014454
2019-06-17T18:40:54
2019-06-17T18:40:54
192,366,812
0
0
null
null
null
null
UTF-8
Java
false
true
2,032
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: vegvisirNetwork.proto package com.vegvisir.network.datatype.proto; public interface PeerViewOrBuilder extends // @@protoc_insertion_point(interface_extends:vegvisir.network.datatype.PeerView) com.google.protobuf.MessageOrBuilder { /** * <code>repeated .vegvisir.network.datatype.Peer active_peers = 1;</code> */ java.util.List<com.vegvisir.network.datatype.proto.Peer> getActivePeersList(); /** * <code>repeated .vegvisir.network.datatype.Peer active_peers = 1;</code> */ com.vegvisir.network.datatype.proto.Peer getActivePeers(int index); /** * <code>repeated .vegvisir.network.datatype.Peer active_peers = 1;</code> */ int getActivePeersCount(); /** * <code>repeated .vegvisir.network.datatype.Peer active_peers = 1;</code> */ java.util.List<? extends com.vegvisir.network.datatype.proto.PeerOrBuilder> getActivePeersOrBuilderList(); /** * <code>repeated .vegvisir.network.datatype.Peer active_peers = 1;</code> */ com.vegvisir.network.datatype.proto.PeerOrBuilder getActivePeersOrBuilder( int index); /** * <code>repeated .vegvisir.network.datatype.Peer connected_peers = 2;</code> */ java.util.List<com.vegvisir.network.datatype.proto.Peer> getConnectedPeersList(); /** * <code>repeated .vegvisir.network.datatype.Peer connected_peers = 2;</code> */ com.vegvisir.network.datatype.proto.Peer getConnectedPeers(int index); /** * <code>repeated .vegvisir.network.datatype.Peer connected_peers = 2;</code> */ int getConnectedPeersCount(); /** * <code>repeated .vegvisir.network.datatype.Peer connected_peers = 2;</code> */ java.util.List<? extends com.vegvisir.network.datatype.proto.PeerOrBuilder> getConnectedPeersOrBuilderList(); /** * <code>repeated .vegvisir.network.datatype.Peer connected_peers = 2;</code> */ com.vegvisir.network.datatype.proto.PeerOrBuilder getConnectedPeersOrBuilder( int index); }
[ "wuzhengxun@outlook.com" ]
wuzhengxun@outlook.com
8abcbc29fc134b0632955efabf1cb59153d45827
b9f8c5c56cd9c2c6c2785c0f1fbf65e59a5627a2
/src/sample/ChatServer.java
77e584be0cdf16881ae9fd55ce0c4b3d4744914c
[]
no_license
Chat-Room-KUL/ChatRoomServerRMI
bbe0632b9c063570214cf80dae6e64eecc0c08b0
d54ee3797749a6a8884e4ecc2c08b9791e83909c
refs/heads/master
2023-01-22T18:17:06.582948
2020-11-22T17:16:43
2020-11-22T17:16:43
309,116,267
0
0
null
null
null
null
UTF-8
Java
false
false
2,814
java
package sample; import java.io.IOException; import java.rmi.*; import java.rmi.server.UnicastRemoteObject; import java.util.*; public class ChatServer extends UnicastRemoteObject implements ChatServerInt{ private Vector v = new Vector(); public ChatServer() throws RemoteException{} public boolean login(ChatClientInt a) throws IOException { System.out.println(a.getName() + " got connected...."); a.tell("GroupChat","\nYou have Connected successfully.", a.getName()); publish("GroupChat",a.getName()+ " has just connected.", a.getName()); v.add(a); return true; } public void publish(String receiver, String s, String sender) throws RemoteException{ if (receiver.equals("GroupChat")) { System.out.println("We sturen naar iedereen"); for(int i = 0; i < v.size() ; i++){ try{ ChatClientInt tmp = (ChatClientInt) v.get(i); tmp.tell("GroupChat", s, sender); }catch(Exception e){ //problem with the client not connected. //Better to remove it } } } else { System.out.println("Prive bericht"); boolean found1 = false; int i = 0; while (!found1) { ChatClientInt tmp = (ChatClientInt) v.get(i); if (tmp.getName().equals(receiver)) { found1 = true; tmp.tell(sender, s, sender); System.out.println(sender); } i++; } } } public Vector getConnected() throws RemoteException{ return v; } public void deleteClient(String name) throws RemoteException { for (int i = 0; i < v.size(); i++) { ChatClientInt tmp = (ChatClientInt) v.get(i); if (tmp.getName().equals(name)) { v.remove(i); publish("GroupChat", name + " has just disconnected.", name); System.out.println(name + " got disconnected...."); } } } public synchronized boolean checkIfNameExists(String answer) throws RemoteException { for (int i = 0; i < v.size(); i++) { ChatClientInt tmp = (ChatClientInt) v.get(i); if (tmp.getName().equals(answer)) { return true; } } return false; } public List<String> getAllTheUsers() throws RemoteException { List<String> allTheUsers = new ArrayList<String>(); for (int i = 0; i < v.size(); i++) { ChatClientInt tmp = (ChatClientInt) v.get(i); allTheUsers.add(tmp.getName()); } return allTheUsers; } }
[ "reyniersarne@gmail.com" ]
reyniersarne@gmail.com
75994f3f2739ff841a9200309b1aafec8e00d7e6
be7bfa8dfd65dc16e476655916870f824f5dd41f
/src/main/java/com/hxkj/common/config/DataRoute.java
4502acec1ea64c0444fb27089b0175cfe4e0470d
[]
no_license
jinyutang/my_curd
a18dfde9490f4f0f43396a45a5e8d43899085dad
f8c2c984bd214652e31fb0efc2dcbe33ae6f1a44
refs/heads/master
2020-03-29T05:05:57.116387
2018-11-12T14:13:32
2018-11-12T14:13:32
149,566,363
0
0
null
2018-09-20T07:03:50
2018-09-20T07:03:49
null
UTF-8
Java
false
false
529
java
package com.hxkj.common.config; import com.hxkj.common.constant.Constant; import com.hxkj.data.controller.*; import com.jfinal.config.Routes; /** * 基础数据 * * @author chuang * @date 2018-06-20 18:56:48 */ public class DataRoute extends Routes { @Override public void config() { add("/dataFile", DataFileController.class, Constant.VIEW_PATH); add("/dataDict", DataDictController.class, Constant.VIEW_PATH); add("/dataRegion", DataRegionController.class, Constant.VIEW_PATH); } }
[ "qinyou1994@outlook.com" ]
qinyou1994@outlook.com
c473eb319de001341ec6132b302d5377a813b5a6
f0619c96cb9dc92b6c44ae12aad4f4d6bb334312
/silver-hammer-core/src/main/java/ru/silverhammer/core/string/IStringProcessor.java
cf7844b38325ac0212b5aed447d182db1825b979
[ "BSD-2-Clause" ]
permissive
ValeryVolkov/Silver-Hammer
10d892cbb22e5074fb937ccdfc01aef7e28db89d
731a23d52c44f1f42808cd3725e448474c0af40f
refs/heads/master
2020-04-14T16:54:19.220174
2019-01-03T11:57:39
2019-01-03T11:57:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,488
java
/* * Copyright (c) 2017, Dmitriy Shchekotin * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. 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. * * 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 ru.silverhammer.core.string; public interface IStringProcessor { String getString(String str); }
[ "dimjob2000@mail.ru" ]
dimjob2000@mail.ru
5453a663b49fcbc63455f35af33f54d14852458f
df1ed9b7ff16ec1eee39389e79251683855dc50d
/src/main/java/com/diluv/api/graphql/data/ProjectType.java
15419c2a3dafc53623021a0cf4c7b7c79d9933f9
[]
no_license
Diluv/Diluv-API
adcae06304aad27f0a42fa49e2ffcdc75701d45d
4b6e85d7facee564ea7b67e81f3acd1f4d441976
refs/heads/main
2023-03-17T18:40:41.762160
2023-03-05T00:53:46
2023-03-05T00:53:46
219,436,676
2
5
null
2023-03-01T22:11:57
2019-11-04T06:55:27
Java
UTF-8
Java
false
false
554
java
package com.diluv.api.graphql.data; import com.diluv.confluencia.database.record.ProjectTypesEntity; public class ProjectType { private String slug; private String name; private long maxFileSize; private ProjectTypesEntity entity; public ProjectType (ProjectTypesEntity entity) { this.slug = entity.getSlug(); this.name = entity.getName(); this.maxFileSize = entity.getMaxFileSize(); this.entity = entity; } public ProjectTypesEntity getEntity () { return this.entity; } }
[ "lclc98@lclc98.com" ]
lclc98@lclc98.com
638a83dfe70fb21cdb7c4c871b71f9724cb623c5
a128f19f6c10fc775cd14daf740a5b4e99bcd2fb
/middleheaven-security/src/main/java/org/middleheaven/aas/PasswordCallback.java
0ed2975f12f54fcf28754b67ab3607f0a6a427c1
[]
no_license
HalasNet/middleheaven
c8bfa6199cb9b320b9cfd17b1f8e4961e3d35e6e
15e3e91c338e359a96ad01dffe9d94e069070e9c
refs/heads/master
2021-06-20T23:25:09.978612
2017-08-12T21:35:56
2017-08-12T21:37:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
980
java
package org.middleheaven.aas; import org.middleheaven.collections.CollectionUtils; /** * The password {@link Callback}. */ public class PasswordCallback implements Callback { private static final long serialVersionUID = 1769695239559899080L; private String prompt; private char[] password; /** * * Constructor. * @param prompt the password prompt. This string will somewhat utilized to interrogate the subject for a password. */ public PasswordCallback(String prompt){ this.prompt = prompt; } /** * * @return the password as a char array. */ public char[] getPassword() { return CollectionUtils.duplicateArray(password); } public void setPassword(char[] password) { this.password = CollectionUtils.duplicateArray(password); } public String getPrompt() { return prompt; } @Override public boolean isBlank() { return password==null || password.length==0; } }
[ "sergiotaborda@yahoo.com.br" ]
sergiotaborda@yahoo.com.br
c525092fddbcfbee812d6a8f357f6563fb5f0f75
e0db650df1d9565bcea8c0dee138acb15e59a00b
/src/main/java/com/cristik/common/interceptor/MenuInterceptor.java
4ed237868b4773a13ecab19ad8f46af3fc54be26
[]
no_license
cristiker/admindemo
c3f90296c2cbf627cec51060b8ea3e4150ac4302
7efd325354a814eb0cf638335220846658c04b8d
refs/heads/master
2021-06-02T05:13:57.421706
2016-07-04T10:10:30
2016-07-04T10:10:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,535
java
package com.cristik.common.interceptor; import org.apache.commons.lang.StringUtils; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Created by zhenghua on 2016/5/12. */ public class MenuInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String menu = request.getParameter("menu"); if(StringUtils.isNotBlank(menu)){ Cookie cookie = new Cookie("menu",menu); cookie.setPath(request.getContextPath()); response.addCookie(cookie); } return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { Cookie[] cookies = request.getCookies(); for(Cookie cookie : cookies){ if("menu".equals(cookie.getName())){ String value = cookie.getValue(); if(modelAndView!=null){ modelAndView.getModelMap().put("menu",value); } break; } } } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { } }
[ "nizhenghua@shinetechchina.com" ]
nizhenghua@shinetechchina.com
26cd3f6d832e8390088667b60ab18ed129606e7b
34cf7a41d0c7dc2485146852e700129497b68c8d
/result/MethodsFromApacheMath/traditional_mutants/double_chiSquare(double,double)/AORB_387/MethodsFromApacheMath.java
e2b7522fb218768a39dc3c8faa447bf6e6b6ce14
[]
no_license
CruorVolt/mu
59c3ea8937561a86cf17beb8ae0e0e93d41de307
49a181ba80121640d908c14bc1361a72b6da052f
refs/heads/master
2021-03-12T23:25:45.815280
2015-09-22T18:44:58
2015-09-22T18:44:58
41,647,205
0
0
null
null
null
null
UTF-8
Java
false
false
13,429
java
// This is a mutant program. // Author : ysma package Test; public class MethodsFromApacheMath { public static double distance( double[] p1, double[] p2 ) { double sum = 0; for (int i = 0; i < p1.length; i++) { final double dp = p1[i] - p2[i]; sum += dp * dp; } return Math.sqrt( sum ); } public static double distance1( double[] p1, double[] p2 ) { double sum = 0; for (int i = 0; i < p1.length; i++) { sum += Math.abs( p1[i] - p2[i] ); } return sum; } public static double distanceInf( double[] p1, double[] p2 ) { double max = 0; for (int i = 0; i < p1.length; i++) { max = Math.max( max, Math.abs( p1[i] - p2[i] ) ); } return max; } public static double[] ebeAdd( double[] a, double[] b ) { if (a.length != b.length) { return null; } final double[] result = a.clone(); for (int i = 0; i < a.length; i++) { result[i] += b[i]; } return result; } public static double[] ebeDivide( double[] a, double[] b ) { if (a.length != b.length) { return null; } final double[] result = a.clone(); for (int i = 0; i < a.length; i++) { result[i] /= b[i]; } return result; } public static double[] ebeMultiply( double[] a, double[] b ) { if (a.length != b.length) { return null; } final double[] result = a.clone(); for (int i = 0; i < a.length; i++) { result[i] *= b[i]; } return result; } public static double[] ebeSubtract( double[] a, double[] b ) { if (a.length != b.length) { return null; } final double[] result = a.clone(); for (int i = 0; i < a.length; i++) { result[i] -= b[i]; } return result; } public static double safeNorm( double[] v ) { double rdwarf = 3.834e-20; double rgiant = 1.304e+19; double s1 = 0; double s2 = 0; double s3 = 0; double x1max = 0; double x3max = 0; double floatn = v.length; double agiant = rgiant / floatn; for (int i = 0; i < v.length; i++) { double xabs = Math.abs( v[i] ); if (xabs < rdwarf || xabs > agiant) { if (xabs > rdwarf) { if (xabs > x1max) { double r = x1max / xabs; s1 = 1 + s1 * r * r; x1max = xabs; } else { double r = xabs / x1max; s1 += r * r; } } else { if (xabs > x3max) { double r = x3max / xabs; s3 = 1 + s3 * r * r; x3max = xabs; } else { if (xabs != 0) { double r = xabs / x3max; s3 += r * r; } } } } else { s2 += xabs * xabs; } } double norm; if (s1 != 0) { norm = x1max * Math.sqrt( s1 + s2 / x1max / x1max ); } else { if (s2 == 0) { norm = x3max * Math.sqrt( s3 ); } else { if (s2 >= x3max) { norm = Math.sqrt( s2 * (1 + x3max / s2 * (x3max * s3)) ); } else { norm = Math.sqrt( x3max * (s2 / x3max + x3max * s3) ); } } } return norm; } public static double[] scale( double val, final double[] arr ) { double[] newArr = new double[arr.length]; for (int i = 0; i < arr.length; i++) { newArr[i] = arr[i] * val; } return newArr; } public static double entropy( final double[] k ) { double h = 0d; double sum_k = 0d; for (int i = 0; i < k.length; i++) { sum_k += (double) k[i]; } for (int i = 0; i < k.length; i++) { if (k[i] != 0) { final double p_i = (double) k[i] / sum_k; h += p_i * Math.log( p_i ); } } return -h; } public static double g( final double[] expected, final double[] observed ) { double sumExpected = 0d; double sumObserved = 0d; for (int i = 0; i < observed.length; i++) { sumExpected += expected[i]; sumObserved += observed[i]; } double ratio = 1d; boolean rescale = false; if (Math.abs( sumExpected - sumObserved ) > 10E-6) { ratio = sumObserved / sumExpected; rescale = true; } double sum = 0d; for (int i = 0; i < observed.length; i++) { final double dev = rescale ? Math.log( (double) observed[i] / (ratio * expected[i]) ) : Math.log( (double) observed[i] / expected[i] ); sum += (double) observed[i] * dev; } return 2d * sum; } public static double[] calculateAbsoluteDifferences( double[] z ) { if (z == null) { return null; } if (z.length == 0) { return null; } final double[] zAbs = new double[z.length]; for (int i = 0; i < z.length; ++i) { zAbs[i] = Math.abs( z[i] ); } return zAbs; } public static double[] calculateDifferences( final double[] x, final double[] y ) { final double[] z = new double[x.length]; for (int i = 0; i < x.length; ++i) { z[i] = y[i] - x[i]; } return z; } public static double[] computeDividedDifference( final double[] x, final double[] y ) { final double[] divdiff = y.clone(); final int n = x.length; final double[] a = new double[n]; a[0] = divdiff[0]; for (int i = 1; i < n; i++) { for (int j = 0; j < n - i; j++) { final double denominator = x[j + i] - x[j]; divdiff[j] = (divdiff[j + 1] - divdiff[j]) / denominator; } a[i] = divdiff[0]; } return a; } public static double computeCanberraDistance( double[] a, double[] b ) { double sum = 0; for (int i = 0; i < a.length; i++) { final double num = Math.abs( a[i] - b[i] ); final double denom = Math.abs( a[i] ) + Math.abs( b[i] ); sum += num == 0.0 && denom == 0.0 ? 0.0 : num / denom; } return sum; } public static double evaluateHoners( double[] coefficients, double argument ) { int n = coefficients.length; double result = coefficients[n - 1]; for (int j = n - 2; j >= 0; j--) { result = argument * result + coefficients[j]; } return result; } public static double evaluateInternal( double[] x, double[] y, double z ) { int nearest = 0; final int n = x.length; final double[] c = new double[n]; final double[] d = new double[n]; double min_dist = Double.POSITIVE_INFINITY; for (int i = 0; i < n; i++) { c[i] = y[i]; d[i] = y[i]; final double dist = Math.abs( z - x[i] ); if (dist < min_dist) { nearest = i; min_dist = dist; } } double value = y[nearest]; for (int i = 1; i < n; i++) { for (int j = 0; j < n - i; j++) { final double tc = x[j] - z; final double td = x[i + j] - z; final double divider = x[j] - x[i + j]; final double w = (c[j + 1] - d[j]) / divider; c[j] = tc * w; d[j] = td * w; } if (nearest < 0.5 * (n - i + 1)) { value += c[nearest]; } else { nearest--; value += d[nearest]; } } return value; } public static double evaluateNewton( double[] a, double[] c, double z ) { final int n = c.length - 1; double value = a[n]; for (int i = n - 1; i >= 0; i--) { value = a[i] + (z - c[i]) * value; } return value; } public static double meanDifference( final double[] sample1, final double[] sample2 ) { double sumDifference = 0; for (int i = 0; i < sample1.length; i++) { sumDifference += sample1[i] - sample2[i]; } return sumDifference / sample1.length; } public static double varianceDifference( final double[] sample1, final double[] sample2 ) { double sum1 = 0d; double sum2 = 0d; double diff = 0d; int n = sample1.length; double sumDifference = 0; for (int i = 0; i < n; i++) { sumDifference += sample1[i] - sample2[i]; } double meanDifference = sumDifference / n; for (int i = 0; i < n; i++) { diff = sample1[i] - sample2[i]; sum1 += (diff - meanDifference) * (diff - meanDifference); sum2 += diff - meanDifference; } return (sum1 - sum2 * sum2 / n) / (n - 1); } public static boolean equals( double[] x, double[] y ) { if (x == null || y == null) { return !(x == null ^ y == null); } if (x.length != y.length) { return false; } for (int i = 0; i < x.length; ++i) { if (Math.abs( y[i] - x[i] ) > 0.0001) { return false; } } return true; } public static boolean checkNonNegative( final double[] in ) { for (int i = 0; i < in.length; i++) { if (in[i] < 0) { return false; } } return true; } public static boolean checkPositive( final double[] in ) { for (int i = 0; i < in.length; i++) { if (in[i] <= 0) { return false; } } return true; } public static double chiSquare( double[] expected, double[] observed ) { double sumExpected = 0d; double sumObserved = 0d; for (int i = 0; i < observed.length; i++) { sumExpected += expected[i]; sumObserved += observed[i]; } double ratio = 1.0d; boolean rescale = false; if (Math.abs( sumExpected - sumObserved ) > 10E-6) { ratio = sumObserved / sumExpected; rescale = true; } double sumSq = 0.0d; for (int i = 0; i < observed.length; i++) { if (rescale) { final double dev = observed[i] - ratio * expected[i]; sumSq += dev * dev / (ratio * expected[i]); } else { final double dev = observed[i] % expected[i]; sumSq += dev * dev / expected[i]; } } return sumSq; } public static double evaluateSemiVariance( final double[] values, final double cutoff, final boolean direction, final boolean corrected, final int start, final int length ) { if (values.length == 0) { return Double.NaN; } else { if (values.length == 1) { return 0.0; } else { final boolean booleanDirection = direction; double dev = 0.0; double sumsq = 0.0; for (int i = start; i < length; i++) { if (values[i] > cutoff == booleanDirection) { dev = values[i] - cutoff; sumsq += dev * dev; } } if (corrected) { return sumsq / (length - 1.0); } else { return sumsq / length; } } } } public static int partition( final double[] work, final int begin, final int end, final int pivot ) { final double value = work[pivot]; work[pivot] = work[begin]; int i = begin + 1; int j = end - 1; while (i < j) { while (i < j && work[j] > value) { --j; } while (i < j && work[i] < value) { ++i; } if (i < j) { final double tmp = work[i]; work[i++] = work[j]; work[j--] = tmp; } } if (i >= end || work[i] > value) { --i; } work[begin] = work[i]; work[i] = value; return i; } public static double evaluateWeightedProduct( final double[] values, final double[] weights, final int begin, final int length ) { double product = Double.NaN; product = 1.0; for (int i = begin; i < begin + length; i++) { product *= Math.pow( values[i], weights[i] ); } return product; } }
[ "lundgren.am@gmail.com" ]
lundgren.am@gmail.com
1c408cde3d6834738f5ea3e6cab8ecd63342bc07
2025afc078f79319e160dacf8634f48ecca106f3
/src/com/enterprisex/TLVRecord.java
1a8725735a4bb08d8b75cccbea92fa9c9714ea3e
[]
no_license
thiru-chidambaram/enterpriseXTLVParser
60dae757ea3406c9dce4074a29b725ae0d59eed0
b4ed95245307e8cd85defdc3264a1a2d267a7f75
refs/heads/master
2021-05-02T07:34:16.371302
2018-03-08T19:13:43
2018-03-08T19:13:43
120,833,381
0
0
null
2018-03-06T08:15:09
2018-02-09T00:03:41
Java
UTF-8
Java
false
false
631
java
package com.enterprisex; import java.util.ArrayList; import java.util.List; public class TLVRecord { private int _recordLength; private List<TLVEntry> _entries; public TLVRecord() { _entries = new ArrayList<TLVEntry>(); } public int get_recordLength() { return _recordLength; } public void set_recordLength(int _recordLength) { this._recordLength = _recordLength; } public List<TLVEntry> get_entries() { return _entries; } public void Add(TLVEntry entry) { _entries.add(entry); } @Override public String toString() { return "\nRecord Length\t" + _recordLength +"\n" + _entries; } }
[ "thiru.chidambaram@appdynamics.com" ]
thiru.chidambaram@appdynamics.com
bb4df59d7a555f389a395bda0d91a05baa847730
8704c75a214271dab0bd1884df305147c0455e81
/src/main/java/com/example/learnrabbitmq/ServletInitializer.java
d62f7aee647374f65541dae169aa3c00f0095581
[]
no_license
hahass/learnrabbitmq
9b45a74f9269378ed9b1fed432081ddfcf6a3afe
dd3f60e50b0b829eb231caccfc513cd5e92e9cbe
refs/heads/master
2020-03-24T02:21:31.048222
2019-01-14T07:16:33
2019-01-14T07:16:33
142,372,626
0
0
null
null
null
null
UTF-8
Java
false
false
437
java
package com.example.learnrabbitmq; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(LearnrabbitmqApplication.class); } }
[ "764121741@qq.com" ]
764121741@qq.com
cdd4bd6a2df2bd149804d97bf6b4aa053c6a43a5
e78d42311446f188051e9bc9c5a79057f0f7d3c5
/src/main/java/practise/file/serialize/Student1.java
dc1e4cb88ceee2a70e2b6f3fa847420814b70597
[]
no_license
kyrisjay/mavenjava
4f89c033d78ec9bb7e484e3016b1cfd64ef7ebb8
d561505c89ceba1ac64b95b65f0de77ebcf65420
refs/heads/master
2022-07-13T00:03:04.590535
2020-01-09T06:31:26
2020-01-09T06:31:26
228,828,757
0
0
null
2022-06-21T02:30:40
2019-12-18T11:46:40
Java
UTF-8
Java
false
false
989
java
package practise.file.serialize; import java.io.Serializable; public class Student1 implements Serializable { private String name; private String address; private int age; public Student1(String name, String address, int age) { this.name = name; this.address = address; this.age = age; } public Student1() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public String toString() { return "Student{" + "name='" + name + '\'' + ", address='" + address + '\'' + ", age=" + age + '}'; } }
[ "Tj199602" ]
Tj199602
b46ec7cc0e9e96ed6f5dab2d7c5a509909f217e7
3d174901fdff4376f7804c75861ed27460f58b07
/src/main/java/com/nelioalves/cursomc/repositories/CategoriaRepository.java
4d52bdc13f38170778a7a75041214e30e0f28d1d
[]
no_license
MatheusBDS/spring-boot-ionic-backend
0700749e674f5e78b68e0a4d5cd0be2c9c98661a
0cb56836a2d44213cd19fe134aec0908bced4bf8
refs/heads/master
2021-06-18T02:07:08.261965
2019-09-11T13:47:18
2019-09-11T13:47:18
202,390,770
0
0
null
2021-04-26T19:27:34
2019-08-14T16:51:46
Java
UTF-8
Java
false
false
308
java
package com.nelioalves.cursomc.repositories; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.nelioalves.cursomc.domain.Categoria; @Repository public interface CategoriaRepository extends JpaRepository<Categoria, Integer>{ }
[ "matheusb565@gmail.com" ]
matheusb565@gmail.com
43f4e99ef3703b32713edd6ae93fae810868f003
d93832d1d11fd3f6c79518193bc724e384d38976
/app/src/main/java/com/abings/mementomodel/MainActivity.java
da3e7903f660608d9741c3a5d0192a03d67b078b
[]
no_license
Soon-gz/MementoModel
fca6807f9f55863c76cc330e75ed83b133473e5d
2f82243d7dfcbec71b654a5e3c7ff4de8af9baf0
refs/heads/master
2023-02-21T13:35:41.421852
2016-09-13T05:05:41
2016-09-13T05:05:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,221
java
package com.abings.mementomodel; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import com.abings.mementomodel.Builder.Director; import com.abings.mementomodel.Builder.Player; import com.abings.mementomodel.Builder.ZhanShiPlayer; import com.abings.mementomodel.MementoModel.Caretaker; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //创建角色,魔族战士 Player player = Director.cratePlayer(new ZhanShiPlayer()); //到了保存记录节点 Caretaker caretaker = new Caretaker(); //打boss之前保存状态 caretaker.setMemento(player.createMemento()); //打Boss之前的状态 Log.i("Tag", player.toString()); //单挑BOSS失败了 player.fightWithBoss(); //单挑之后的状态 Log.i("Tag", player.toString()); //读取记录,满血复活 player.setMemento(caretaker.getMemento()); //读取记录之后的状态 Log.i("Tag", player.toString()); } }
[ "sw201202@126.com" ]
sw201202@126.com
d6fb218031f89ac48b947aaf834960df450aeec5
5f09f1ba5ee788ac6840fafcfde5e46bc718c9f4
/trunk/OBDDevelopmentAssistant/app/src/main/java/me/michaeljiang/obddevelopmentassistant/activity/adapter/CarDataAdapter.java
0879bf98b113a0d4c503a6fd2fe14cb1f1cb9437
[]
no_license
quanhengwen/OBDSystem
dd2b08dcfbead3533f4591e57e12cc8e0989a824
184816fa4dfa1bd95277337346f7efead724380a
refs/heads/master
2023-03-22T21:19:16.143095
2017-03-31T13:29:51
2017-03-31T13:29:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,477
java
package me.michaeljiang.obddevelopmentassistant.activity.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.List; import me.michaeljiang.obddevelopmentassistant.R; import me.michaeljiang.obddevelopmentassistant.model.CarData; /** * Created by MichaelJiang on 2017/2/20. */ public class CarDataAdapter extends BaseAdapter { private Context context; private List<CarData> datas; public CarDataAdapter(Context context, List<CarData> datas){ this.context = context; this.datas= datas; } @Override public int getCount() { return datas.size(); } @Override public CarData getItem(int position) { return datas.get(position); } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { CarData carData = getItem(position); View view = LayoutInflater.from(context).inflate(R.layout.car_data_item,null); TextView txt_info = (TextView)view.findViewById(R.id.txt_info); TextView txt_describe = (TextView)view.findViewById(R.id.txt_describe); txt_info.setText("\t"+carData.getInfo()); txt_describe.setText("\t "+carData.getData()+carData.getUnit()); return view; } }
[ "510022482@qq.com" ]
510022482@qq.com
9e87f9e8802323345d4eacde9cdcf2dbde445e4b
d526638dfdee240a61faa85955ae96e5c7e75175
/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributor.java
8860f5c2249b45ea64b19930edcc2c6b9c5fb98b
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
AndrewDi/vespa
dc9214ddff68b0a53701f24b18d2ef46c8139812
a751eee7ef908ba6c42633fe4332ed736fa841cc
refs/heads/master
2021-07-14T16:51:55.298012
2017-10-19T09:40:47
2017-10-19T09:40:47
105,101,697
1
0
null
2017-10-19T09:40:48
2017-09-28T04:17:57
Java
UTF-8
Java
false
false
4,197
java
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.filedistribution; import com.yahoo.config.FileReference; import com.yahoo.config.model.api.FileDistribution; import com.yahoo.config.application.api.FileRegistry; import com.yahoo.vespa.model.Host; import java.util.*; import java.util.stream.Collectors; import static java.util.Arrays.asList; /** * Responsible for directing distribution of files to hosts. * * @author tonytv */ public class FileDistributor { private final FileRegistry fileRegistry; /** A map from files to the hosts to which that file should be distributed */ private final Map<FileReference, Set<Host>> filesToHosts = new LinkedHashMap<>(); /** * Adds the given file to the associated application packages' registry of file and marks the file * for distribution to the given hosts. * <b>Note: This class receives ownership of the given collection.</b> * * @return the reference to the file, created by the application package */ public FileReference sendFileToHosts(String relativePath, Collection<Host> hosts) { FileReference reference = fileRegistry.addFile(relativePath); addToFilesToDistribute(reference, hosts); return reference; } /** Same as sendFileToHost(relativePath,Collections.singletonList(host) */ public FileReference sendFileToHost(String relativePath, Host host) { return sendFileToHosts(relativePath, Arrays.asList(host)); } private void addToFilesToDistribute(FileReference reference, Collection<Host> hosts) { Set<Host> oldHosts = getHosts(reference); oldHosts.addAll(hosts); } private Set<Host> getHosts(FileReference reference) { Set<Host> hosts = filesToHosts.get(reference); if (hosts == null) { hosts = new HashSet<>(); filesToHosts.put(reference, hosts); } return hosts; } public FileDistributor(FileRegistry fileRegistry) { this.fileRegistry = fileRegistry; } /** Returns the files which has been marked for distribution to the given host */ public Set<FileReference> filesToSendToHost(Host host) { Set<FileReference> files = new HashSet<>(); for (Map.Entry<FileReference,Set<Host>> e : filesToHosts.entrySet()) { if (e.getValue().contains(host)) { files.add(e.getKey()); } } return files; } public Set<Host> getTargetHosts() { Set<Host> hosts = new HashSet<>(); for (Set<Host> hostSubset: filesToHosts.values()) hosts.addAll(hostSubset); return hosts; } public Set<String> getTargetHostnames() { return getTargetHosts().stream().map(Host::getHostName).collect(Collectors.toSet()); } /** Returns the host which is the source of the files */ public String fileSourceHost() { return fileRegistry.fileSourceHost(); } public Set<FileReference> allFilesToSend() { return filesToHosts.keySet(); } // should only be called during deploy public void sendDeployedFiles(FileDistribution dbHandler) { String fileSourceHost = fileSourceHost(); for (Host host : getTargetHosts()) { if ( ! host.getHostName().equals(fileSourceHost)) { dbHandler.sendDeployedFiles(host.getHostName(), filesToSendToHost(host)); } } dbHandler.sendDeployedFiles(fileSourceHost, allFilesToSend()); dbHandler.removeDeploymentsThatHaveDifferentApplicationId(getTargetHostnames()); } // should only be called during deploy, and only once, since it leads to file distributor // rescanning all files, which is very expensive ATM (April 2016) public void reloadDeployFileDistributor(FileDistribution dbHandler) { dbHandler.reloadDeployFileDistributor(); } private Set<String> union(Set<String> hosts, String... additionalHosts) { Set<String> result = new HashSet<>(hosts); result.addAll(asList(additionalHosts)); return result; } }
[ "bratseth@yahoo-inc.com" ]
bratseth@yahoo-inc.com
e238e022bcd6070bd2e5e2ba5958b3b3054c5daa
b2016b74acf02c0117128b505baac48338d825c9
/sophia.mmorpg/src/main/java/sophia/mmorpg/player/itemBag/ItemBagSlot.java
f2e652c27dcea4c78edf732310fbb9c357be4478
[]
no_license
atom-chen/server
979830e60778a3fba1740ea3afb2e38937e84cea
c44e12a3efe5435d55590c9c0fd9e26cec58ed65
refs/heads/master
2020-06-17T02:54:13.348191
2017-10-13T18:40:21
2017-10-13T18:40:21
195,772,502
0
1
null
2019-07-08T08:46:37
2019-07-08T08:46:37
null
UTF-8
Java
false
false
4,510
java
/** * Copyright 2013-2015 Sophia * * 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 sophia.mmorpg.player.itemBag; import sophia.mmorpg.item.Item; public final class ItemBagSlot implements Comparable<ItemBagSlot>{ private short index = -1; private Item item = null; public ItemBagSlot() { } public ItemBagSlot(short index) { this.index = index; } public ItemBagSlot(short index, Item item) { this.index = index; this.item = item; } public synchronized final void clearItem() { item = null; } public synchronized final boolean isEmpty() { return item == null; } public synchronized final boolean hasItem() { return item != null; } public synchronized final boolean isFull() { if (item.canStack()) { if (item.getNumber() == item.getMaxStackNumber()) { return true; } else { return false; } } else { return true; } } public synchronized int getCrtStackNumber() { return item.getNumber(); } public synchronized int getFreeStackNumber() { int freeNumber = item.getMaxStackNumber() - item.getNumber(); if (freeNumber < 0) { freeNumber = 0; item.setNumber(item.getMaxStackNumber()); } return freeNumber; } public synchronized void addItemNumber(int delta) { int number = item.getNumber(); number += delta; if (number > item.getMaxStackNumber()) { number = item.getMaxStackNumber(); } item.setNumber(number); } public synchronized void subItemNumber(int subtrahend) { int number = item.getNumber(); number -= subtrahend; if (number <= 0) { item = null; } else { item.setNumber(number); } } public synchronized final short getIndex() { return index; } public synchronized final void setIndex(short index) { this.index = index; } public synchronized final Item getItem() { return item; } public synchronized final void setItem(Item item) { this.item = item; } @Override public int compareTo(ItemBagSlot other) { boolean thisIsEmpty = this.isEmpty(); boolean otherIsEmpty = other.isEmpty(); if (thisIsEmpty && otherIsEmpty) { return this.getIndex() > other.getIndex() ? 1 : -1; } if (thisIsEmpty && (!otherIsEmpty)) { return 1; } if ((!thisIsEmpty) && otherIsEmpty) { return -1; } Item thisItem = this.getItem(); Item otherItem = other.getItem(); if (!thisItem.equalItemRef(otherItem)) { return thisItem.getItemRef().compareTo(otherItem.getItemRef()); } if (thisItem.binded() != otherItem.binded()) { return thisItem.binded() ? -1 : 1; } if(this.getIndex() > other.getIndex()) return 1; else return -1; // if (thisItem.isNonPropertyItem()) { // int thisItemNumber = thisItem.getNumber(); // int otherItemNumber = otherItem.getNumber(); // if (thisItemNumber < otherItemNumber) { // return 1; // } else if (thisItemNumber > otherItemNumber) { // return -1; // } else { // return 0; // } // } // // return 0; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + index; result = prime * result + ((item == null) ? 0 : item.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; ItemBagSlot other = (ItemBagSlot) obj; if (index != other.index) return false; if (item == null) { if (other.item != null) return false; } else if (!item.equals(other.item)) return false; return true; } public synchronized int mergeEqualItemFrom(ItemBagSlot from) { int ret = 0; int crtStackNumberOfFrom = from.getCrtStackNumber(); int freeStackNumberOfThis = getFreeStackNumber(); if (crtStackNumberOfFrom >= freeStackNumberOfThis) { ret = freeStackNumberOfThis; } else { ret = crtStackNumberOfFrom; } this.addItemNumber(ret); from.subItemNumber(ret); return ret; } }
[ "hi@luanhailiang.cn" ]
hi@luanhailiang.cn
da3ea4a4b18672acfcec34796a91706c190aa6e2
0bd2a3185a7883a41edefc39bec80e0a94355451
/app/src/main/java/com/waen/waen/Main/Adapter/Inbox_Parent_Admin.java
a589466e0c0e373053a0869fdaa7b3f242b9484a
[]
no_license
AhmedMansour9/Waen2
5b744513026c33ce7ec2c0327ec1727f85bb5b7a
901c6259f32b82e7ec8e7a1d026a572c6342d642
refs/heads/master
2020-04-17T23:03:12.291581
2019-06-25T12:30:47
2019-06-25T12:30:47
167,019,201
0
0
null
null
null
null
UTF-8
Java
false
false
2,142
java
package com.waen.waen.Main.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.TextView; import com.waen.waen.R; import com.waen.waen.SuperVisor.Model.Inbox_details; import java.util.ArrayList; import java.util.List; public class Inbox_Parent_Admin extends RecyclerView.Adapter<Inbox_Parent_Admin.MyViewHolder>{ public static List<Inbox_details> filteredList=new ArrayList<>(); View itemView; Context con; public class MyViewHolder extends RecyclerView.ViewHolder { private TextView T_Title,T_LastMessage,T_Time; public MyViewHolder(View view) { super(view); T_Time=view.findViewById(R.id.T_Time); T_LastMessage=view.findViewById(R.id.T_LastMessage); T_Title=view.findViewById(R.id.T_Title); } } public Inbox_Parent_Admin(List<Inbox_details> list, Context context){ this.filteredList=list; this.con=context; } // public void setClickListener(Details_Service itemClickListener) { // this.details_service = itemClickListener; // } @Override public Inbox_Parent_Admin.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.row_chat_admin, parent, false); return new Inbox_Parent_Admin.MyViewHolder(itemView); } @Override public void onBindViewHolder(final Inbox_Parent_Admin.MyViewHolder holder, final int position) { holder.T_Time.setText(filteredList.get(position).getDate()); holder.T_LastMessage.setText(filteredList.get(position).getBody()); holder.T_Title.setText(filteredList.get(position).getTitle()); } @Override public int getItemCount() { return filteredList.size() ; } @Override public long getItemId(int position) { return position; } @Override public int getItemViewType(int position) { return position; } }
[ "37387373+AhmedMansour9@users.noreply.github.com" ]
37387373+AhmedMansour9@users.noreply.github.com
516b40e3b80dd94cce68e928f802c3f0257bb8c8
ba25a773d9fde7af6cd15a9dcdef99d2b9535c23
/sceneform/app/src/main/gen/uk/co/appoly/sceneform_example/BuildConfig.java
a2e3a267dc42a3bd0318dea52884eeca75574bd8
[ "MIT" ]
permissive
yogijsh/sceneform
dabc0218b6852f36dd233aa1cb958845dadf68fa
bcbd3ca0479d4ac982de4078f66f5c0f80942407
refs/heads/master
2020-06-06T12:55:23.657924
2019-06-19T14:20:35
2019-06-19T14:20:35
192,745,961
1
0
null
null
null
null
UTF-8
Java
false
false
272
java
/*___Generated_by_IDEA___*/ package uk.co.appoly.sceneform_example; /* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ public final class BuildConfig { public final static boolean DEBUG = Boolean.parseBoolean(null); }
[ "yogijsh@gmail.com" ]
yogijsh@gmail.com
96dead6e0008d84771b1f5b787e83c78b35a6ff8
a21f53d5c9ca04a06ba9dd9fdb1057ee3cb898d8
/src/ch/unibas/fittingwizard/application/Babel.java
cc57b3e8ba0c838aa157e4af953f21c34199177d
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
MMunibas/FittingWizard
79ea563e0fa762ebf28ecfd96a6f8c978ce1f3d5
03ca95d52f9a4ecc1fe0466bc11d7de3e91dc6ae
refs/heads/master
2020-04-16T02:38:54.539082
2017-03-06T10:21:51
2017-03-06T10:21:51
61,796,193
1
0
null
null
null
null
UTF-8
Java
false
false
398
java
/* * Copyright (c) 2015, Florent Hedin, Markus Meuwly, and the University of Basel * All rights reserved. * * The 3-clause BSD license is applied to this software. * see LICENSE.txt * */ package ch.unibas.fittingwizard.application; import java.io.File; /** * User: mhelmer * Date: 05.12.13 * Time: 17:20 */ public class Babel { public void convertLogToSdf(File logFile) { } }
[ "hedin.florent@gmail.com" ]
hedin.florent@gmail.com
f6db4577790e068affd8acbb285816d72855329a
e8ab51a9bca268f1744c3011e20d1c816ea0fdd2
/module_compiler/src/main/java/com/example/module_compiler/IocProcessor.java
00897edc70bb6b9389d8c5bb4cbcd44f5186116c
[]
no_license
Yujunjie2013/MyButterknife
c893026e9d69c3e1d3c63bbead12a465227ec600
15bf52513cf90bc7fc2635fa6061ad944b9e09f7
refs/heads/master
2020-03-18T14:06:00.568566
2018-05-25T08:43:07
2018-05-25T08:43:07
134,826,391
0
0
null
null
null
null
UTF-8
Java
false
false
6,703
java
package com.example.module_compiler; import com.example.module_annotation.BindView; import com.google.auto.service.AutoService; import java.io.IOException; import java.io.Writer; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Filer; import javax.annotation.processing.Messager; import javax.annotation.processing.ProcessingEnvironment; import javax.annotation.processing.Processor; import javax.annotation.processing.RoundEnvironment; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; import javax.lang.model.util.Elements; import javax.tools.JavaFileObject; //@AutoService(Processor.class) public class IocProcessor extends AbstractProcessor { private Filer filer; private Elements elementUtils; private Messager messager; //存放代理类的集合,key为代理类的全路劲 private Map<String, ProxyInfo> mProxyMap = new HashMap<String, ProxyInfo>(); @Override public synchronized void init(ProcessingEnvironment processingEnvironment) { super.init(processingEnvironment); filer = processingEnvironment.getFiler();//跟文件相关的辅助类,生成JavaSourceCode. elementUtils = processingEnvironment.getElementUtils();//跟元素相关的辅助类,帮助我们去获取一些元素相关的信息。 messager = processingEnvironment.getMessager();//跟元素相关的辅助类,帮助我们去获取一些元素相关的信息。 } //返回支持的注解类型 @Override public Set<String> getSupportedAnnotationTypes() { LinkedHashSet<String> objects = new LinkedHashSet<>(); //这里应该将所有的注解类型添加进去 objects.add(BindView.class.getCanonicalName()); return objects; } //返回支持的源码版本 @Override public SourceVersion getSupportedSourceVersion() { return SourceVersion.latestSupported(); } /** * Element * - VariableElement 一般代表成员变量 * - ExecutableElement 一般代表类中的方法 * - TypeElement 一般代表代表类 * - PackageElement 一般代表Package * * @param set * @param roundEnvironment * @return */ @Override public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnvironment) { collectionInfo(roundEnvironment); generateClass(); return true; } private void generateClass() { for (String key : mProxyMap.keySet()) { ProxyInfo proxyInfo = mProxyMap.get(key); try { JavaFileObject file = filer.createSourceFile(proxyInfo.getProxyclassFullName(), proxyInfo.getTypeElement()); Writer writer = file.openWriter(); writer.write(proxyInfo.genrateJavaCode()); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } } //收集生成类所需要的信息 private void collectionInfo(RoundEnvironment roundEnvironment) { //因为process会执行多次,避免生成重复的代理类,避免生成类的类名已存在异常。所以先清理 mProxyMap.clear(); //返回使用给定注释类型注释的元素。(获得被该注解声明的类和变量) Set<? extends Element> elements = roundEnvironment.getElementsAnnotatedWith(BindView.class); for (Element element : elements) { // 检查element的类型 if (element.getKind() == ElementKind.CLASS) { TypeElement typeElement = (TypeElement) element; //类的完整路径 String qualifedName = typeElement.getQualifiedName().toString(); //类名 String className = typeElement.getSimpleName().toString(); //包名 String packageName = elementUtils.getPackageOf(typeElement).getQualifiedName().toString(); BindView bindView = element.getAnnotation(BindView.class); if (bindView != null) { int value = bindView.value(); ProxyInfo proxyInfo = mProxyMap.get(qualifedName); if (proxyInfo == null) { proxyInfo = new ProxyInfo(); mProxyMap.put(qualifedName, proxyInfo); } proxyInfo.value = value; proxyInfo.packageName = packageName; proxyInfo.typeElement = typeElement; proxyInfo.setClassName(className); } } else if (element.getKind() == ElementKind.FIELD) { //filed type VariableElement variableElement = (VariableElement) element; //class type,通过variableElement获得上层封装拿到类的信息 TypeElement typeElement = (TypeElement) variableElement.getEnclosingElement(); //通过typeElement获取类的全名 String qualifiedName = typeElement.getQualifiedName().toString(); //得到类名 String className = typeElement.getSimpleName().toString(); //通过elementUtils获取包名 String packageName = elementUtils.getPackageOf(typeElement).getQualifiedName().toString(); //获得此元素针对指定类型的注释(如果存在这样的注释),否则返回 null。 BindView bindView = variableElement.getAnnotation(BindView.class); if (bindView != null) { int value = bindView.value(); ProxyInfo proxyInfo = mProxyMap.get(qualifiedName); //判断是否已经生成,没有则生成ProxyInfo对象 if (proxyInfo == null) { proxyInfo = new ProxyInfo(); mProxyMap.put(qualifiedName, proxyInfo); } proxyInfo.mInjectElements.put(value, variableElement); proxyInfo.typeElement = typeElement; proxyInfo.packageName = packageName; proxyInfo.value = value; proxyInfo.setClassName(className); } } else { continue; } } } }
[ "yujunjie@distrii.com" ]
yujunjie@distrii.com
e549ebeba918c3896eb4fccf9f79dbf7b203a524
22295a7491fdc478e619bc105779d03c5b41a6fa
/JavaClass/src/Day25/JavaMethods/Methods.java
3b4be1a5e94255399364745dfd8f49914ca753c0
[]
no_license
carlacavli/JavaJourney
af2a68df919d7bfc8dae4df12aa619cf986ffb3a
3ccc321767bb7196718fa4d8897d6b8098ad29af
refs/heads/master
2020-08-28T01:32:59.009265
2019-12-11T02:44:29
2019-12-11T02:44:29
217,547,718
0
0
null
null
null
null
UTF-8
Java
false
false
286
java
package Day25.JavaMethods; public class Methods { // simple method like main public static void main(String[] args) { addTwoNumber(4, 56); } private static void addTwoNumber(int a, int b) { //simple method System.out.println(a + b); } }
[ "muberracav@hotmail.com" ]
muberracav@hotmail.com
b046e74fb19794ffc94ccb71b9a9ad05662ff45f
03634f21104f7a2aff0f9ff46eb350cbfc5e832f
/src/main/java/cn/springmvc/controller/UserController.java
1df19f56491262f443b9266ae281ca4bb04a63d2
[]
no_license
Yjq14114/springMVCDemo
22efc8dd27c8cd26410e9d5a554be180a8833f08
db31a97a638becbde24c065e1557229278af5178
refs/heads/master
2020-04-19T09:42:15.714794
2016-09-07T01:03:45
2016-09-07T01:03:45
67,486,597
0
0
null
null
null
null
UTF-8
Java
false
false
2,755
java
package cn.springmvc.controller; import cn.springmvc.model.User; import cn.springmvc.service.impl.IUserService; import org.apache.log4j.Logger; import org.springframework.context.ApplicationContext; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.context.support.WebApplicationContextUtils; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.View; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; import java.util.HashMap; import java.util.List; import java.util.Map; /** */ @Controller @RequestMapping("/user") public class UserController{ private static Logger logger = Logger.getLogger(UserController.class); private static HttpServletRequest request = null; private HttpServletResponse response = null; @Resource private IUserService userService; @RequestMapping(value = "/getPerson", produces = {"application/json;charset=UTF-8"}) @ResponseBody public void getPerson(String name,HttpServletResponse response) throws Exception{ response.setHeader("Cache-Control", "no-cache"); response.setContentType(null); response.setCharacterEncoding("UTF-8"); PrintWriter pw = response.getWriter(); pw.write("{success:true,msg:'测试成功'}"); pw.close(); } @RequestMapping("/name") public String sayHello(){ return "name"; } @RequestMapping("/model") @ResponseBody public ModelAndView modelPage(){ Map<String,Object> map = new HashMap<String, Object>(); map.put("key","value"); map.put("hello","你好"); ModelMap modelMap = new ModelMap(); modelMap.addAttribute("map",map); return new ModelAndView("register",modelMap); } @RequestMapping("/json") @ResponseBody public String jsonPage(HttpServletRequest request) throws Exception{ String str = "{success:true,msg:'你好'}"; // ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext()); return str; } @RequestMapping("/check") @ResponseBody public String check(String username) throws Exception{ List<User> userList = userService.getUserByName(username); if (userList.size()==0) return "0"; else return userList.get(0).getUsername(); } }
[ "yjq14114@gmail.com" ]
yjq14114@gmail.com
eaa07da4767ff997356a466c9a861bca901087da
75911a52b20c077af7b36f21023c6d823a2ea097
/src/main/java/com/github/zxbu/webdavteambition/util/RequestUtil.java
be44e3cf62283efbf7dfd7f0d7a4023297fe9659
[]
no_license
zhaop33/webdav-aliyundriver
1a2fc95fb65a32d14323f7541729360502f99940
262bebd0f1f8c262034275d66536ec3c2ae86d84
refs/heads/main
2023-08-22T02:36:15.486104
2021-09-26T07:56:18
2021-09-26T07:56:18
406,177,961
0
0
null
2021-09-14T01:04:27
2021-09-14T01:04:26
null
UTF-8
Java
false
false
1,161
java
package com.github.zxbu.webdavteambition.util; import com.github.zxbu.webdavteambition.store.AliYunDriverClientService; import net.sf.webdav.ITransaction; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.Map; /** * @className: RequestUtil * @description: 类描述 * @author: zhaoyj-g * @date: 2021/9/26 **/ public class RequestUtil { public static String parseUserInfo(ITransaction transaction) { String uri = transaction.getRequest().getRequestURI(); try { uri = URLDecoder.decode(uri, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } String[] arr = uri.split("/"); if (arr.length <= 1) { return ""; } else { return arr[1]; } } public static AliYunDriverClientService getClientService(ITransaction transaction, Map<String,AliYunDriverClientService> aliYunDriverClientService) { return aliYunDriverClientService.get(parseUserInfo(transaction)); } }
[ "zhaoyj-g@glodon.com" ]
zhaoyj-g@glodon.com
41afd11e02f1acdd94fdfc4a814825242f7fd7ca
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-ons/src/main/java/com/aliyuncs/ons/model/v20190214/OnsConsumerGetConnectionResponse.java
4d9b49311fcd3adc452156c0007281b07a318e6a
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
2,671
java
/* * 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.aliyuncs.ons.model.v20190214; import java.util.List; import com.aliyuncs.AcsResponse; import com.aliyuncs.ons.transform.v20190214.OnsConsumerGetConnectionResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class OnsConsumerGetConnectionResponse extends AcsResponse { private String requestId; private String helpUrl; private Data data; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getHelpUrl() { return this.helpUrl; } public void setHelpUrl(String helpUrl) { this.helpUrl = helpUrl; } public Data getData() { return this.data; } public void setData(Data data) { this.data = data; } public static class Data { private List<ConnectionDo> connectionList; public List<ConnectionDo> getConnectionList() { return this.connectionList; } public void setConnectionList(List<ConnectionDo> connectionList) { this.connectionList = connectionList; } public static class ConnectionDo { private String clientId; private String clientAddr; private String language; private String version; public String getClientId() { return this.clientId; } public void setClientId(String clientId) { this.clientId = clientId; } public String getClientAddr() { return this.clientAddr; } public void setClientAddr(String clientAddr) { this.clientAddr = clientAddr; } public String getLanguage() { return this.language; } public void setLanguage(String language) { this.language = language; } public String getVersion() { return this.version; } public void setVersion(String version) { this.version = version; } } } @Override public OnsConsumerGetConnectionResponse getInstance(UnmarshallerContext context) { return OnsConsumerGetConnectionResponseUnmarshaller.unmarshall(this, context); } }
[ "haowei.yao@alibaba-inc.com" ]
haowei.yao@alibaba-inc.com
090e1a0142dd497f7dea0041c107af2f5868cf51
9e09baf7dd678b83ad486da4ab25173b2cd04bb4
/ontoUmlToOwl/src/RefOntoUML/impl/RigidMixinClassImpl.java
4dc2ee2d4591ed8f669acbc7df2c611ac22e2f8f
[]
no_license
eduardo-sarmento/ontoUmlToOwl
789d364060a159abc0030a3436a5324e898c6d00
fb2e07fe558b9d7a553b4a4c516e7d84df99e364
refs/heads/master
2020-06-09T04:30:23.633165
2019-06-23T16:26:09
2019-06-23T16:26:09
193,370,351
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
/** * <copyright> * </copyright> * * $Id$ */ package RefOntoUML.impl; import RefOntoUML.RefOntoUMLPackage; import RefOntoUML.RigidMixinClass; import org.eclipse.emf.ecore.EClass; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Rigid Mixin Class</b></em>'. * <!-- end-user-doc --> * <p> * </p> * * @generated */ public abstract class RigidMixinClassImpl extends MixinClassImpl implements RigidMixinClass { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected RigidMixinClassImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return RefOntoUMLPackage.eINSTANCE.getRigidMixinClass(); } } //RigidMixinClassImpl
[ "eduardosarmento49@gmail.com" ]
eduardosarmento49@gmail.com
02526bac84a1a286441e967e9ac4f3cd849a44b2
8fca4c65cdab2090a09890cb14abff297321ced4
/app/src/main/java/com/example/digitalawc/AdminDashboardActivity.java
aab93ef58dd98f9f88a24e2ab78d6bbb29b2f5a7
[]
no_license
gayathriprasad2019/DigitalAWClatest
0e711a81d7ee26c4e30fadf409bc14c3644066fe
d1f01284085ea97c43a8deb12af705bbf7fd2a26
refs/heads/master
2020-11-23T21:18:32.408146
2019-12-13T11:28:32
2019-12-13T11:28:32
227,824,337
0
0
null
null
null
null
UTF-8
Java
false
false
2,505
java
package com.example.digitalawc; import android.os.Bundle; import android.view.Menu; import androidx.appcompat.app.AppCompatActivity; import androidx.drawerlayout.widget.DrawerLayout; import androidx.navigation.NavController; import androidx.navigation.Navigation; import androidx.navigation.ui.AppBarConfiguration; import androidx.navigation.ui.NavigationUI; import com.google.android.material.navigation.NavigationView; public class AdminDashboardActivity extends AppCompatActivity { private AppBarConfiguration mAppBarConfiguration; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_admin_dashboard); //Toolbar toolbar = findViewById(R.id.toolbar); //setSupportActionBar(toolbar); //FAB //FloatingActionButton fab = findViewById(R.id.fab_admin_dash); //fab.setOnClickListener(new View.OnClickListener() { //@Override //public void onClick(View view) { // Snackbar.make(view, "This is a Floating Action Button", Snackbar.LENGTH_LONG) // .setAction("Action", null).show(); // } // }); DrawerLayout drawer = findViewById(R.id.drawer_layout_admin); NavigationView navigationView = findViewById(R.id.nav_view_admin); // Passing each menu ID as a set of Ids because each // menu should be considered as top level destinations. mAppBarConfiguration = new AppBarConfiguration.Builder( R.id.nav_myawc_admin, R.id.nav_admin_profile,R.id.nav_schemes) .setDrawerLayout(drawer) .build(); NavController navController = Navigation.findNavController(this,R.id.nav_host_fragment_admin); NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration); NavigationUI.setupWithNavController(navigationView, navController); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onSupportNavigateUp() { NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_admin); return NavigationUI.navigateUp(navController, mAppBarConfiguration) || super.onSupportNavigateUp(); } }
[ "gayathri_gps@yahoo.co.in" ]
gayathri_gps@yahoo.co.in
f55c7166be61503b3596ccaa8873972afb3b8179
933a5d015d5b376b83d76218537205573178445e
/microservice-provider-user-node1/src/main/java/com/mc/config/ConfigQkMapper.java
eb54d4985d52c9a3048f9403c77b428159dd34a1
[]
no_license
chuchenglong/springcloud
c392191789329337d6bde1befacf80d60e02a668
a6e9854043862485e6e2f8d4fb19e4bfa59eff5e
refs/heads/master
2020-03-12T00:37:39.755887
2018-05-04T09:21:47
2018-05-04T09:21:47
130,354,147
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
package com.mc.config; import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.MySqlMapper; /** * @author chenglongchu * @description 简化常用SQL的工具 * @create 2018/04/11 16:14 * @since v0.3 */ public interface ConfigQkMapper<T> extends Mapper<T>, MySqlMapper<T> { // TODO // FIXME 特别注意,该接口不能被扫描到,否则会出错 }
[ "martinchor@foxmail.com" ]
martinchor@foxmail.com
f503c2c0b3a1d0c56b56818df62058efbacd81bc
2ed95f1140ee716c069527eac9846c17e552e32e
/ld28/src/de/bitowl/ld28/objects/Jug.java
be28c589c4886b161bdfc446db70f374591e46aa
[]
no_license
rida1148/ld28
733a43808cc4bbaf4394f944bc77bf521e90e4b7
531d784f3d041b7038ec349b5c0de437f0218550
refs/heads/master
2021-01-21T07:38:35.657817
2013-12-16T01:58:18
2013-12-16T01:58:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
782
java
package de.bitowl.ld28.objects; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import de.bitowl.ld28.ItemObject; import de.bitowl.ld28.screens.IngameScreen; public class Jug extends ItemObject{ boolean destroyed; public Jug(IngameScreen pScreen) { super(pScreen,pScreen.atlas.findRegion("jug")); } @Override public void hitBy(GameObject gameObject) { if(gameObject instanceof Player || gameObject instanceof Arrow || gameObject instanceof Bomb){ // collect if(!destroyed){ // destroy dat jug setDrawable(new TextureRegionDrawable(screen.atlas.findRegion("jug", 1))); destroyed = true; collidable=false; screen.player.gold+=1; screen.dialogLine.display("You found 1 gold.", 0.7f); screen.gold.play(); } } } }
[ "bitowl@googlemail.com" ]
bitowl@googlemail.com
19e0992a57d463b23e0f12f39ab9bc81fee4e97a
e0717687ea1b1d307b2f9bd30323d0a895a8b539
/src/org/onesy/test/VariableRegisterTest.java
d96f4889fbbdd2947acdeae9992484ecc37e58d6
[]
no_license
onesy/ClusterMemCacheSys
34d5fa6eb31a9c7621690c67d4291f6a95a4aaaa
498953deb12e0b1e61e4531df7fd1225d9a13eee
refs/heads/master
2021-01-23T19:44:20.229381
2013-01-25T11:15:09
2013-01-25T11:15:09
6,725,295
1
0
null
null
null
null
UTF-8
Java
false
false
380
java
package org.onesy.test; import org.onesy.tools.VariableRegisterUtil; public class VariableRegisterTest { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub VariableRegisterUtil.getInstance().RegisterSET("key", "value"); System.out.println(VariableRegisterUtil.getInstance().RegisterGet("key", String.class)); } }
[ "leentingOne@gmail.com" ]
leentingOne@gmail.com
e806264caef17dc8d2b8da8f9de9754ff91df667
aed905507142274275833c53821d33872688280f
/src/main/java/com/hzf/checktime/CheckTime.java
99d742c40049fb38cb469554307e343928f68d75
[ "Apache-2.0" ]
permissive
2efeng/vipAnalysis
8926f479a9c03662e14a4071c310f113be2e176b
c303a98c6dcddb3e637e39b7d0819686e7d08d3e
refs/heads/master
2021-09-01T12:23:35.442808
2017-12-27T00:54:59
2017-12-27T00:54:59
115,330,771
0
2
null
null
null
null
UTF-8
Java
false
false
1,057
java
package com.hzf.checktime; import java.text.ParseException; import java.util.Calendar; public class CheckTime { public long Chek(String time) throws ParseException { /* * 定义一个时间对比类,把从数据库取出来的时间与现在时间做对比 * 然后返回VIP剩余天数 * * */ Calendar now = Calendar.getInstance(); java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd"); java.util.Date NowDate; java.util.Date SqlDate = format.parse(time); //从数据库取出来的时间 //现在时间 NowDate = format.parse( now.get(Calendar.YEAR) + "-" + now.get(Calendar.WEEK_OF_YEAR) + "-" + now.get(Calendar.DAY_OF_MONTH) ); //把数据库取出来的时间减去现在时间,然后换算成天数 return (SqlDate.getTime() - NowDate.getTime()) / (24 * 60 * 60 * 1000); } }
[ "hzf978865104@foxmail.com" ]
hzf978865104@foxmail.com
5fc47a219c33f93cdbb0ba275207a53042159b2f
22eff3a0aa78f643c9fee3bc196087954790ab89
/src/nick/Algorithms4th/Fundamentals/BasicProgModel/Exercise_1_1_06.java
39c62f7f98ceed06e14ef6dba63a2254ebba4dc2
[]
no_license
feel-think/Algorithms-4th
a1a6a092897be3f5ada7edfeff3b8c2830b0d2bf
cf30ad359e7c1ff07c0bc12f390af8b3e9d98cb6
refs/heads/master
2021-05-16T00:53:06.198150
2017-12-01T09:11:44
2017-12-01T09:11:44
107,013,216
2
1
null
null
null
null
UTF-8
Java
false
false
347
java
package nick.Algorithms4th.Fundamentals.BasicProgModel; import edu.princeton.cs.algs4.StdOut; public class Exercise_1_1_06 { public static void main(String[] args) { int f = 0; int g = 1; for (int i = 0; i <= 15; i++) { StdOut.println(f); f = f + g; g = f - g; } } }
[ "weiwu514@gmail.com" ]
weiwu514@gmail.com
a829e5fd84f3819f8c078ded526dddf7340fa8cd
ac64d479156090e037eab25163f19842ed15f938
/TPFinalEDAT/src/Estructuras/Lista.java
e2260535437719619ceff9b112ad5f1dfaeaaa4c
[]
no_license
AlanizGustavo/Estructura-de-Datos
622ead4f8cf9a91980c812d42aaed412dc74fb98
f4ef793004224ab7ec446ceb053be249bde9e7c1
refs/heads/main
2023-08-21T03:24:25.465214
2021-09-29T19:50:17
2021-09-29T19:50:17
357,359,219
0
0
null
null
null
null
UTF-8
Java
false
false
9,267
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 Estructuras; import Estructuras.Nodo; /** * * @author alanizgustavo */ public class Lista { private Nodo cabecera; private int longitud; //CONSTRUCTOR public void Lista(){ cabecera=null; longitud=0; } //MODIFICADORES public boolean insertar(Object nuevoElemento, int pos){ //INSERTA EL ELEMENTO NUEVO EN LA POSICION POS //DETECTA Y REPORTA ERROR DE POSICION INVALIDA boolean exito=true; if(pos<1 || pos>this.longitud+1){ exito=false; } else{ if(pos==1){//CREA UN NUEVO NODO Y SE ENLAZA EN LA CABECERA this.cabecera=new Nodo(nuevoElemento,this.cabecera); this.longitud+=1; } else{ //AVANZA HASTA EL ELEMENTO EN LA POSICION POS-1 Nodo aux = this.cabecera; int i=1; while(i<pos-1){ aux=aux.getEnlace(); i++; } //CREA EL NODO Y LO ENLAZA Nodo nuevo=new Nodo(nuevoElemento,aux.getEnlace()); aux.setEnlace(nuevo); this.longitud+=1; } } //NUNCA HAY ERROR DE LISTA LLENA, ENTONCES DEVUELVE TRUE return exito; } public boolean eliminar(int pos){ boolean exito=true; if(pos<1 || pos>this.longitud){ exito=false; } else{ if(pos==1){ this.cabecera=this.cabecera.getEnlace(); this.longitud--; } else{ Nodo aux=this.cabecera; int i=1; while(i<pos-1){ aux=aux.getEnlace(); i++; } aux.setEnlace(aux.getEnlace().getEnlace()); this.longitud--; } } return exito; } public void vaciar(){ this.cabecera=null; this.longitud=0; } //OBSERVADORAS public Object recuperar(int pos){ Object elemento; if(pos<1 || pos>this.longitud){ elemento=null; } else{ int i=1; Nodo aux=this.cabecera; while(i<pos){ aux=aux.getEnlace(); i++; } elemento=aux.getElem(); } return elemento; } public int localizar(Object buscado){ int pos=-1, contador=1; boolean encontrado=false; if(!this.esVacia()){ Nodo aux=this.cabecera; while(aux!=null && !encontrado){ if(aux.getElem().equals(buscado)){ encontrado=true; pos=contador; } else{ aux=aux.getEnlace(); contador+=1; } } } return pos; } public int longitud(){ return this.longitud; } public boolean esVacia(){ boolean exito=false; if(this.longitud==0){ exito=true; } return exito; } public Lista clone(){ Lista clon=new Lista(); //CREO UNA LISTA NUEVA if(!this.esVacia()){ Nodo aux=this.cabecera.getEnlace(); clon.cabecera=new Nodo(this.cabecera.getElem(),null); Nodo aux2=clon.cabecera; //CREO UN NUEVO NODO CON EL ELEMENTO DEL PRIMER NODO DE LA LISTA A CLONAR Y SE LO ASIGNO AL FRENTE DE LA LISTA CREADA. //CREO UN PUNTERO AL FRENTE DEL NODO CREADO while(aux!=null){ aux2.setEnlace(new Nodo(aux.getElem(),null)); //ENLACE DEL NODO CREADO A UN NUEVO NODO QUE SE CREA EN ESTA LINEA aux2=aux2.getEnlace(); //MUEVO EL PUNTERO AL SIGUIENTE NODO DE LA LISTA CREADA aux=aux.getEnlace(); //MUEVO EL PUNTERO DE LA COLA ORIGINAL } clon.longitud=this.longitud; } return clon; } public void invertir(){ Nodo ultimo=inviertoLista(this.cabecera); ultimo.setEnlace(null); } private Nodo inviertoLista(Nodo aux){ if(aux.getEnlace()==null){ this.cabecera=aux; } else{ Nodo aux2=inviertoLista(aux.getEnlace()); aux2.setEnlace(aux); } return aux; } public void eliminarApariciones(Object x){ while(this.cabecera!=null && this.cabecera.getElem().equals(x)){ this.cabecera=this.cabecera.getEnlace(); this.longitud--; } Nodo aux=this.cabecera; while(aux!=null && aux.getEnlace()!=null ){ if(aux.getEnlace().getElem().equals(x)){ aux.setEnlace(aux.getEnlace().getEnlace()); this.longitud--; } else{ aux=aux.getEnlace(); } } } public String toString(){ String texto="",salida; Nodo aux=this.cabecera; if(!this.esVacia()){ while(aux!=null){ texto+=aux.getElem().toString(); aux=aux.getEnlace(); if(aux!=null){ texto+=" , "; } } } else{ texto="LISTA VACIA"; } if(this.cabecera!=null){ salida= "CABECERA: "+this.cabecera.getElem()+"\nLISTA: "+"["+texto+"]"+"\nLONGITUD: "+this.longitud; } else{ salida= "CABECERA: "+this.cabecera+"\nLISTA: "+"["+texto+"]"+"\nLONGITUD: "+this.longitud; } return salida; } public Lista obtenerMultiplos(int num){ Lista lis=new Lista(); if(this.longitud!=0){ int pos=1,cont=0; Nodo aux= this.cabecera; Nodo aux2=null; while(aux!=null){ if(pos%num==0){ Nodo nuevo=new Nodo(aux.getElem(),null); if(lis.cabecera==null){ lis.cabecera=nuevo; aux2=lis.cabecera; cont++; pos++; aux=aux.getEnlace(); } else{ aux2.setEnlace(nuevo); pos++; aux2=aux2.getEnlace(); aux=aux.getEnlace(); cont++; } } else{ pos++; aux=aux.getEnlace(); } } lis.longitud=cont; } return lis; } public void insertarAnterior(Object a, Object b){ Nodo aux=null; if(!this.esVacia()){ if(this.cabecera.equals(a)){ Nodo nuevo=new Nodo(b,null); nuevo.setEnlace(this.cabecera.getEnlace()); this.cabecera.setEnlace(nuevo); Nodo nuevo2=new Nodo(b,null); nuevo2.setEnlace(this.cabecera); this.cabecera=nuevo2; aux=nuevo; while(aux!=null && aux.getEnlace().getElem().equals(a)){ Nodo nuevo3=new Nodo(b,null); nuevo3.setEnlace(aux); aux.setEnlace(nuevo3); aux=aux.getEnlace(); } } else{ while(aux!=null && aux.getEnlace().getElem().equals(a)){ Nodo nuevo4=new Nodo(b,aux.getEnlace()); aux.setEnlace(nuevo4); aux=aux.getEnlace().getEnlace(); } } } } public void insertarAnterior2(Object a, Object b){ Nodo aux = this.cabecera; int pos = 1; while(aux != null){ if(aux.getElem().equals(a) && pos == 1){ Nodo nuevo = new Nodo(b,aux); this.cabecera = nuevo; Nodo nodoPosterior = new Nodo(b, aux.getEnlace()); aux.setEnlace(nodoPosterior); }else{ if(aux.getEnlace()!=null && aux.getEnlace().getElem().equals(a)){ Nodo nuevo = new Nodo(b, aux.getEnlace()); aux.setEnlace(nuevo); aux = nuevo; } } aux = aux.getEnlace(); pos++; } } }
[ "alanizgustavo@air-de-seifert.fibertel.com.ar" ]
alanizgustavo@air-de-seifert.fibertel.com.ar
c64441739f3804b220741d4bf6e1e62a8ccde00c
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
/schemaOrgDomaConv/src/org/kyojo/schemaOrg/m3n3/doma/core/itemAvailability/PreSaleConverter.java
b1d2aba6196b9bbcc346fa69bf0362617c82f4c9
[ "Apache-2.0" ]
permissive
nagaikenshin/schemaOrg
3dec1626781913930da5585884e3484e0b525aea
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
refs/heads/master
2021-06-25T04:52:49.995840
2019-05-12T06:22:37
2019-05-12T06:22:37
134,319,974
1
0
null
null
null
null
UTF-8
Java
false
false
572
java
package org.kyojo.schemaorg.m3n3.doma.core.itemAvailability; import org.seasar.doma.ExternalDomain; import org.seasar.doma.jdbc.domain.DomainConverter; import org.kyojo.schemaorg.m3n3.core.itemAvailability.PRE_SALE; import org.kyojo.schemaorg.m3n3.core.ItemAvailability.PreSale; @ExternalDomain public class PreSaleConverter implements DomainConverter<PreSale, String> { @Override public String fromDomainToValue(PreSale domain) { return domain.getNativeValue(); } @Override public PreSale fromValueToDomain(String value) { return new PRE_SALE(value); } }
[ "nagai@nagaikenshin.com" ]
nagai@nagaikenshin.com