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
3f77f9003828b422490f0debdf49476d0cc7ccfb
c823afba560493971fbe5b5df3fbd5e7169036d5
/src/com/th/source/com/sun/corba/se/PortableActivationIDL/_ActivatorStub.java
1ee98fdc0bb1950ae5cf27099018d93c47756943
[]
no_license
HWenTing/JavaSourceLearn
034e7e7e6e2b2d6ece11a7b3403e89489473a599
9297397d38ffe593b10fe927a1a95396c5d61e21
refs/heads/main
2023-01-23T23:24:48.690473
2020-12-04T08:11:34
2020-12-04T08:11:34
318,447,213
0
0
null
null
null
null
UTF-8
Java
false
false
18,933
java
package com.sun.corba.se.PortableActivationIDL; /** * com/sun/corba/se/PortableActivationIDL/_ActivatorStub.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u101/7261/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl * Wednesday, June 22, 2016 1:22:39 AM PDT */ public class _ActivatorStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.PortableActivationIDL.Activator { /** A new ORB started server registers itself with the Activator */ public void registerServer (String serverId, com.sun.corba.se.PortableActivationIDL.ServerProxy serverObj) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("registerServer", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); com.sun.corba.se.PortableActivationIDL.ServerProxyHelper.write ($out, serverObj); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { registerServer (serverId, serverObj ); } finally { _releaseReply ($in); } } // registerServer /** A server is shutting down that was started by this activator. * Complete termination of the server is detected by the death of the * process implementing the server. */ public void serverGoingDown (String serverId) { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("serverGoingDown", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { serverGoingDown (serverId ); } finally { _releaseReply ($in); } } // serverGoingDown /** Called whenever an ORB instance is created. This registers * the transport endpoints and the ORB proxy callback object. * Note that we cannot detect when an ORB shuts down, although * all of the POA shutdowns should still be reported. */ public void registerORB (String serverId, String orbId, com.sun.corba.se.PortableActivationIDL.ORBProxy orb, com.sun.corba.se.PortableActivationIDL.EndPointInfo[] endPointInfo) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint, com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegistered { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("registerORB", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId); com.sun.corba.se.PortableActivationIDL.ORBProxyHelper.write ($out, orb); com.sun.corba.se.PortableActivationIDL.EndpointInfoListHelper.write ($out, endPointInfo); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/NoSuchEndPoint:1.0")) throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/ORBAlreadyRegistered:1.0")) throw com.sun.corba.se.PortableActivationIDL.ORBAlreadyRegisteredHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { registerORB (serverId, orbId, orb, endPointInfo ); } finally { _releaseReply ($in); } } // registerORB /** Construct or find an ORBD object template corresponding to the * server's object template and return it. Called whenever a * persistent POA is created. */ public org.omg.PortableInterceptor.ObjectReferenceTemplate registerPOA (String serverId, String orbId, org.omg.PortableInterceptor.ObjectReferenceTemplate poaTemplate) { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("registerPOA", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write ($out, poaTemplate); $in = _invoke ($out); org.omg.PortableInterceptor.ObjectReferenceTemplate $result = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read ($in); return $result; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { return registerPOA (serverId, orbId, poaTemplate ); } finally { _releaseReply ($in); } } // registerPOA /** Called whenever a POA is destroyed. */ public void poaDestroyed (String serverId, String orbId, org.omg.PortableInterceptor.ObjectReferenceTemplate poaTemplate) { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("poaDestroyed", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write ($out, poaTemplate); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { poaDestroyed (serverId, orbId, poaTemplate ); } finally { _releaseReply ($in); } } // poaDestroyed /** If the server is not running, start it up. This is allowed * whether or not the server has been installed. */ public void activate (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerAlreadyActive, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("activate", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyActive:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyActiveHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { activate (serverId ); } finally { _releaseReply ($in); } } // activate /** If the server is running, shut it down */ public void shutdown (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotActive, com.sun.corba.se.PortableActivationIDL.ServerNotRegistered { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("shutdown", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:PortableActivationIDL/ServerNotActive:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerNotActiveHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { shutdown (serverId ); } finally { _releaseReply ($in); } } // shutdown /** Invoke the server install hook. If the server is not * currently running, this method will activate it. */ public void install (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown, com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalled { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("install", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyInstalled:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyInstalledHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { install (serverId ); } finally { _releaseReply ($in); } } // install /** Invoke the server uninstall hook. If the server is not * currently running, this method will activate it. * After this hook completes, the server may still be running. */ public void uninstall (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered, com.sun.corba.se.PortableActivationIDL.ServerHeldDown, com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalled { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("uninstall", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/ServerHeldDown:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read ($in); else if (_id.equals ("IDL:PortableActivationIDL/ServerAlreadyUninstalled:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerAlreadyUninstalledHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { uninstall (serverId ); } finally { _releaseReply ($in); } } // uninstall /** list active servers */ public String[] getActiveServers () { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("getActiveServers", true); $in = _invoke ($out); String $result[] = com.sun.corba.se.PortableActivationIDL.ServerIdsHelper.read ($in); return $result; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { return getActiveServers ( ); } finally { _releaseReply ($in); } } // getActiveServers /** list all registered ORBs for a server */ public String[] getORBNames (String serverId) throws com.sun.corba.se.PortableActivationIDL.ServerNotRegistered { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("getORBNames", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); $in = _invoke ($out); String $result[] = com.sun.corba.se.PortableActivationIDL.ORBidListHelper.read ($in); return $result; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:PortableActivationIDL/ServerNotRegistered:1.0")) throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { return getORBNames (serverId ); } finally { _releaseReply ($in); } } // getORBNames /** Find the server template that corresponds to the ORBD's * adapter id. */ public org.omg.PortableInterceptor.ObjectReferenceTemplate lookupPOATemplate (String serverId, String orbId, String[] orbAdapterName) { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("lookupPOATemplate", true); org.omg.PortableInterceptor.ServerIdHelper.write ($out, serverId); org.omg.PortableInterceptor.ORBIdHelper.write ($out, orbId); org.omg.PortableInterceptor.AdapterNameHelper.write ($out, orbAdapterName); $in = _invoke ($out); org.omg.PortableInterceptor.ObjectReferenceTemplate $result = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read ($in); return $result; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { return lookupPOATemplate (serverId, orbId, orbAdapterName ); } finally { _releaseReply ($in); } } // lookupPOATemplate // Type-specific CORBA::Object operations private static String[] __ids = { "IDL:PortableActivationIDL/Activator:1.0"}; public String[] _ids () { return (String[])__ids.clone (); } private void readObject (java.io.ObjectInputStream s) throws java.io.IOException { String str = s.readUTF (); String[] args = null; java.util.Properties props = null; org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props); try { org.omg.CORBA.Object obj = orb.string_to_object (str); org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); _set_delegate (delegate); } finally { orb.destroy() ; } } private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException { String[] args = null; java.util.Properties props = null; org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props); try { String str = orb.object_to_string (this); s.writeUTF (str); } finally { orb.destroy() ; } } } // class _ActivatorStub
[ "982740445@qq.com" ]
982740445@qq.com
7a94d67b9d8392e2c07fd017e77697bf8ae31b04
d259139b9d8e596aaac8b06700123db5c6ec6be1
/src/chapter6/problems/binarytree/NumberOfEle.java
c33a50fa2ac7cbac7a57315ab7941af644842099
[]
no_license
Krishna9331/DataStructure-algorithm
6e887469807b7c91b4fbb3b1af591ef4beded038
5f8c2bb1219fc54231e8ffbee91c1e27fe9a6b98
refs/heads/master
2021-04-15T14:20:55.143851
2018-10-25T17:17:20
2018-10-25T17:17:20
55,626,831
2
2
null
null
null
null
UTF-8
Java
false
false
1,216
java
package chapter6.problems.binarytree; import chapter5.LinkedListQueue; /** * Created by mishrk3 on 5/24/2016. */ public class NumberOfEle { public int numberOfElement(SampleBinaryTree.Node<Integer> root) { SampleBinaryTree.Node<Integer> p = root; SampleBinaryTree.Node<Integer> temp; LinkedListQueue<SampleBinaryTree.Node<Integer>> queue = new LinkedListQueue<>(); int count = 0; if (p != null) { count++; queue.enQueue(p); } while (!queue.isEmpty()) { temp = queue.deQueue(); if (temp.left != null) { queue.enQueue(temp.left); count++; } if (temp.right != null) { queue.enQueue(temp.right); count++; } } return count; } public int sizeOfTree(SampleBinaryTree.Node<Integer> root) { if (null == root) { return 0; } return sizeOfTree(root.left) + 1 + sizeOfTree(root.right); } public static void main(String[] args) { NumberOfEle noe = new NumberOfEle(); SampleBinaryTree<Integer> tree = SampleBinaryTree.getDefaultTree(); System.out.println("The number of elements in tree is: " + noe.numberOfElement(tree.getRoot())); System.out.println("The number of elements in tree using recursion is: " + noe.sizeOfTree(tree.getRoot())); } }
[ "kkant551@gmail.com" ]
kkant551@gmail.com
2ec5edd759c8e31f2bc8e5be9458d02a0e20c372
c5b313aea1865c0a76ae63e766a02b48ffacaeee
/java/spring/tutorial-spring/src/test/java/spring/tutorial/test/bean/assem/advanced/ServiceRequestTest.java
8346abf2bd554269a2eb07f3dca4bc160640ea61
[]
no_license
GNUSource/tutorial
2f608e10417e38d43cfb4aff936d999879050fe1
629de48af3f50f9da67d3448fd5457f2c201494d
refs/heads/master
2021-01-12T05:48:49.482484
2017-07-24T09:12:24
2017-07-24T09:12:24
77,206,539
2
0
null
null
null
null
UTF-8
Java
false
false
742
java
package spring.tutorial.test.bean.assem.advanced; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import spring.tutorial.bean.assem.JavaConfig; import spring.tutorial.bean.assem.advanced.manager.impl.ServiceRequest; public class ServiceRequestTest { @Test public void test() { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(JavaConfig.class); ServiceRequest serviceRequest = context.getBean(ServiceRequest.class); Boolean hasPermission = serviceRequest.accessUri("user"); if (hasPermission) { System.out.println("you have permisssion"); } else { System.out.println("you don't have permission"); } } }
[ "kaifei@bianjie.ai" ]
kaifei@bianjie.ai
f169d3b124df066e2541033b723174f180c4ed04
bd6f8cea8d993d4671db94c3e550468cc4d6fde2
/app/src/test/java/com/alanmbennett/petcare/ExampleUnitTest.java
00d8de29a0a76056eab141d0cf05adba4ce6a1fe
[]
no_license
alanmbennett/PetCare
a3d9aa0539fb43895460289e6f02f704deb2608a
09824c9bb602653b8dfe8e428ea5cb38af1011d7
refs/heads/master
2020-04-23T23:14:41.931809
2019-03-27T15:05:51
2019-03-27T15:05:51
171,529,400
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
package com.alanmbennett.petcare; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "alanmitchellbennett@gmail.com" ]
alanmitchellbennett@gmail.com
5cb82a424360348b00671302cc91c017128fc901
c7eb3cb32018368a686f06c37cd07d905f8fc3d1
/DacAug19/src/com/app/controller/AppointmentController.java
706e5327e00ee14be9e9db31f705fe83f40b07e1
[]
no_license
tejashanmukh/CDACPROJECT-BACKEND
55568a0aea6b1ec2d01918341a116d2c0a03016d
67a1301650c677dfb50d4c42d2b2032c38d0bc19
refs/heads/master
2020-12-21T12:05:34.970789
2020-01-27T05:58:40
2020-01-27T05:58:40
236,424,933
0
0
null
null
null
null
UTF-8
Java
false
false
4,399
java
package com.app.controller; import java.text.SimpleDateFormat; import java.util.List; import static org.springframework.http.HttpStatus.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import com.app.dao.IAppointmentDao; import com.app.pojos.Appointment; import com.app.pojos.PatientDetails; import com.app.pojos.User; import static org.springframework.http.HttpStatus.*; @CrossOrigin(allowedHeaders = "*") @RestController @RequestMapping("/appointment") public class AppointmentController { @Autowired private IAppointmentDao appDao; @PostMapping("/app") public ResponseEntity<?> bookApp(@RequestBody Appointment app,@RequestParam int id) { System.out.println(id); System.out.println("hey"+app.getDrId()); System.out.println(app.getAppDate()); int hrs=app.getAppDate().getHours(); int min =app.getAppDate().getMinutes(); System.out.println(hrs+":"+min); // if(hrs==0) // { // System.out.println("hello"); // } // int mins=app.getAppDate().getMinutes(); // String time= hrs+":"+mins; // System.out.println("hey"+app.getAppDate().getTime()); // System.out.println(app); System.out.println(app.getAppTime()); // SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); // String time1 =0 to 5:29 // sdf.format(app.getAppTime()); if(hrs >=0 & hrs<5) { System.out.println("bhai"); String time= hrs+18+":"+(min+30); System.out.println(time); } else { if(hrs < 12) { if(min<30) { System.out.println("dingdong"); String time= hrs-6+":"+(min+30); app.setAppTime(time); } else { // String time= hrs-6+":"+(min+30); // app.setAppTime(time); System.out.println("hey bro"); String time= hrs-5+":"+(min-30); app.setAppTime(time); } } else { System.out.println("hello"); if(min<30) { String time= hrs-6+":"+(min+30); app.setAppTime(time); } else { // String time= hrs-6+":"+(min+30); // app.setAppTime(time); System.out.println("hey bro"); String time= hrs-5+":"+(min-30); app.setAppTime(time); } } } // app.getDrId().setDoctorId(id); try { return new ResponseEntity<Integer>(appDao.bookAppointment(app,id),OK); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return new ResponseEntity<Exception>(e,NOT_FOUND); } } @GetMapping("/getApptlist") public ResponseEntity<?> apptList(@RequestParam Integer did) { System.out.println("controller"+did); try { return new ResponseEntity<List<Appointment>> (appDao.getAppDetails(did),OK); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return new ResponseEntity<Exception>(e,NOT_FOUND); } } @GetMapping("/confirmAppt") public ResponseEntity<?> confirmAppt(@RequestParam Integer id) { System.out.println("confirm"+id); try { return new ResponseEntity<String>(appDao.ConfirmAppt(id),OK); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return new ResponseEntity<Exception>(e,NOT_FOUND); } } @GetMapping("/declineAppt") public ResponseEntity<?> declineAppt(@RequestParam Integer id) { System.out.println("confirm"+id); try { return new ResponseEntity<String>(appDao.DeclineAppt(id),OK); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return new ResponseEntity<Exception>(e,NOT_FOUND); } } @GetMapping("/getPtdetails") public ResponseEntity<?> getPtDetails(@RequestParam Integer id) { System.out.println("hey Buddy"+id); try { return new ResponseEntity<User>(appDao.getPtDetails(id),OK); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return new ResponseEntity<Exception>(e,NOT_FOUND); } } @GetMapping("/getApptdetailsofPatient") public List<Appointment> getApptDetailsOfPatient(@RequestParam Integer id) { return appDao.getAppdetail(id); } }
[ "kusumanchi.raviteja2014@gmail.com" ]
kusumanchi.raviteja2014@gmail.com
5845f873bcd0771e6ea20d128d692989f09dbf8c
9add51ea1c8032d6c9ba445ddb3eb600c4e0678f
/app/src/main/java/com/amoharib/soleeklabapp/ui/login/LoginActivity.java
07785e48fb2a01d03e2d91969e49e9ae560810c6
[]
no_license
AMoharib/SoleekLabApp
201177c9261316c5cf4f44358dd796b53f2f5a60
35fc9b53aade80429e0ff134ef29a26980a00d4e
refs/heads/master
2020-04-01T12:33:02.591859
2018-10-16T02:48:55
2018-10-16T02:48:55
153,212,681
0
0
null
null
null
null
UTF-8
Java
false
false
2,521
java
package com.amoharib.soleeklabapp.ui.login; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.TextInputEditText; import android.widget.Button; import android.widget.ProgressBar; import android.widget.Toast; import com.amoharib.soleeklabapp.R; import com.amoharib.soleeklabapp.ui.home.HomeActivity; import com.amoharib.soleeklabapp.ui.register.RegistrationActivity; import javax.inject.Inject; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import dagger.android.support.DaggerAppCompatActivity; public class LoginActivity extends DaggerAppCompatActivity implements LoginContract.View { @Inject LoginContract.Presenter presenter; @BindView(R.id.username) TextInputEditText username; @BindView(R.id.password) TextInputEditText password; @BindView(R.id.login_btn) Button loginBtn; ProgressDialog progressDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); ButterKnife.bind(this); setUpProgressBar(); presenter.subscribe(this); } private void setUpProgressBar() { progressDialog = new ProgressDialog(this); progressDialog.setMessage(getString(R.string.logging_in_message)); progressDialog.setCancelable(false); } @Override public void showMessage(String message) { Toast.makeText(this, message, Toast.LENGTH_LONG).show(); } @Override public void notifyEmptyOrBadEmail() { username.setError("Invalid username format"); } @Override public void notifyBadPassword() { password.setError("Password must not be less than 8 characters"); } @Override public void goToHomePage() { Intent intent = new Intent(this, HomeActivity.class); startActivity(intent); finish(); } @Override public void showProgress() { progressDialog.show(); } @Override public void hideProgress() { progressDialog.dismiss(); } @OnClick(R.id.login_btn) public void onLoginBtnClicked() { presenter.loginUser(username.getText().toString(), password.getText().toString()); } @OnClick(R.id.signup_tv) public void onRegistrationClicked() { Intent intent = new Intent(this, RegistrationActivity.class); startActivity(intent); } }
[ "a.mo7arib@gmail.com" ]
a.mo7arib@gmail.com
af3ab39b5fc8853080e8032c3202db0da4132fc5
9562a756ee1602ed13e43b2f471002ea0a6d6955
/pdf-kit/src/test/java/pdf/kit/QAOption.java
f93f9d42d116cd93d02261bc50cdccf7c142cbda
[]
no_license
iezhuhx/unit
fefc800dafa287b93a4d49b179237ae272f0e1d2
f3ae4bc3db6e754aa0777297c06e2aea4ac44666
refs/heads/master
2022-07-05T04:19:07.844193
2019-11-29T02:19:31
2019-11-29T02:19:31
161,440,080
0
0
null
2022-06-30T20:21:14
2018-12-12T06:00:31
HTML
UTF-8
Java
false
false
519
java
package pdf.kit; import pdf.kit.util.RandomUtils; public class QAOption { String idx;// A B C D String desc;// 选项描述 public String getIdx() { return idx; } public void setIdx(String idx) { this.idx = idx; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public QAOption getOption() throws Exception{ QAOption opt = new QAOption(); opt.setDesc(RandomUtils.createWord()); //opt.setIdx(RandomUtils.getNum(1, 4)); return opt; } }
[ "zzuchenyb@sina.com" ]
zzuchenyb@sina.com
9d4276a7eee270eee0c1c54451879dbe613f78c7
629d245806ac0213f15ac4669fbe96dcfc646e1d
/platforms/android/src/com/worksap/ilock/screen/WelcomeActivity.java
927c4ca5c07276729f31655fede2670a925cacfa
[]
no_license
lzwandnju/cordovaProject
c80df95c29a286c813d0d5d92a17bbce1d7837d9
2f37e9d66ed1cd228087ec87a0ccf669d5a08e8c
refs/heads/master
2021-01-13T05:23:48.017319
2017-02-09T01:10:47
2017-02-09T01:10:47
81,393,415
0
0
null
null
null
null
UTF-8
Java
false
false
2,422
java
package com.worksap.ilock.screen; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.LinearLayout; import com.qq.e.ads.AdListener; import com.qq.e.ads.AdRequest; import com.qq.e.ads.AdSize; import com.qq.e.ads.AdView; import com.worksap.ilock.screen.ad.Constants; import com.worksap.ilock.screen.front.MainActivity; public class WelcomeActivity extends BaseActivity { private AdView bannerAD; private LinearLayout bannerContainer; private Button button_android; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.welcome); bannerContainer = (LinearLayout)findViewById(R.id.bannerad2); button_android=(Button)findViewById(R.id.button_android); button_android.setOnClickListener(new AndroidOnClickListener()); } //设置事件监听器 private class AndroidOnClickListener implements OnClickListener { public void onClick(View v){ Intent intent = new Intent(); // intent.setClass(WelcomeActivity.this,AndroidToJSActivity.class); intent.setClass(WelcomeActivity.this,MainActivity.class); startActivity(intent); WelcomeActivity.this.finish(); } } @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); showBannerAD(); } private void showBannerAD() { this.bannerAD = new AdView(this, AdSize.BANNER, Constants.APPId, Constants.BannerPosId); this.bannerAD.setAdListener(new AdListener() { @Override public void onNoAd() { Log.i("admsg:", "Banner AD LoadFail"); } @Override public void onBannerClosed() { // 仅在开启广点通广告关闭按钮时生效 Log.i("admsg:", "Banner AD Closed"); } @Override public void onAdReceiv() { Log.i("admsg:", "Banner AD Ready to show"); } @Override public void onAdExposure() { Log.i("admsg:", "Banner AD Exposured"); } @Override public void onAdClicked() { Log.i("admsg:", "Banner AD Clicked"); } @Override public void onNoAd(int arg0) { Log.i("admsg:", "Banner AD onNoAd:::" + arg0); } }); this.bannerContainer.removeAllViews(); this.bannerContainer.addView(bannerAD); bannerAD.fetchAd(new AdRequest()); } }
[ "li_zhe@worksap.co.jp" ]
li_zhe@worksap.co.jp
4b93f0dbfe49925a3f2ed5dc5d07429d5002ba1f
682d3a4a7b6b7b667a76a3994c4ee2abbb7315ce
/Demo3.java
cb6283d775c542a6802a146ee05a10b85d47ca9b
[]
no_license
sathish-chandran/devops
d54cb1a20c0e6b6a9c841b3ae09cffa696a6b793
fa367e44c50cb34e54343c9702e8f2deac4c333e
refs/heads/main
2023-05-06T05:26:52.878201
2021-05-28T11:53:48
2021-05-28T11:53:48
370,305,260
0
0
null
null
null
null
UTF-8
Java
false
false
92
java
class Demo3 { public static void main(String args[]) { System.out.println("Demo3"); } }
[ "sathishchandran@Sathishs-MacBook-Pro.local" ]
sathishchandran@Sathishs-MacBook-Pro.local
33fa022a0414ef16adfa41162b88e2f6ac98196c
7e4b691b16213a248192cc3315a73193d4af5cf0
/app/src/main/java/screenonoff/ScreenReceiver.java
8e3672860a3c2953e062a89e42c0549ebf65825b
[]
no_license
atiartalukdar/PingUtility
faad150416348797c9021029d4531e3be3c81914
d97e47a53be906e62949a0b51c198d76dc541b51
refs/heads/master
2020-03-29T11:23:12.111503
2018-09-22T05:52:12
2018-09-22T05:52:12
149,849,578
1
0
null
null
null
null
UTF-8
Java
false
false
4,458
java
package screenonoff; import android.app.AlarmManager; import android.app.KeyguardManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.media.MediaPlayer; import android.os.Build; import android.os.CountDownTimer; import android.os.Vibrator; import android.provider.Settings; import android.support.annotation.RequiresApi; import android.util.Log; import com.evernote.android.job.JobManager; import com.firebase.jobdispatcher.Constraint; import com.firebase.jobdispatcher.FirebaseJobDispatcher; import com.firebase.jobdispatcher.GooglePlayDriver; import com.firebase.jobdispatcher.Job; import com.firebase.jobdispatcher.Lifetime; import com.firebase.jobdispatcher.RetryStrategy; import com.firebase.jobdispatcher.Trigger; import alarmmanager.ToastBroadcastReceiver; import firebaseDispatcher.ScheduledJobService; import mobitsolutions.com.pingutility.NoteSyncJob; /** * Created by Atiar on 2/8/18. */ public class ScreenReceiver extends BroadcastReceiver { MediaPlayer mp; public static boolean wasScreenOn = true; Context mContext = null; Vibrator vibe; Long Timer = System.currentTimeMillis(); Long Threshold = 1000L; String Screen = "null"; int screenTimeOut; //for new onReceive Context cntx = null; Long a, seconds_screenoff = 0L, OLD_TIME = 0L, seconds_screenon = 0L, actual_diff = 0L; Boolean OFF_SCREEN = true, ON_SCREEN = true, sent_msg = true; @RequiresApi(api = Build.VERSION_CODES.M) @Override public void onReceive(final Context context, final Intent intent) { KeyguardManager myKM = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); JobManager.create(context); if (Build.VERSION.SDK_INT >=6){ //firebase job scheduler / dispatcher scheduleJob(context); NoteSyncJob.scheduleJob(); }else{ //evernote job scheduler NoteSyncJob.scheduleJob(); //===========Alarm Manager =========== Intent toastIntent= new Intent(context, ToastBroadcastReceiver.class); PendingIntent toastAlarmIntent = PendingIntent.getBroadcast(context, 0, toastIntent,PendingIntent.FLAG_UPDATE_CURRENT); long startTime=System.currentTimeMillis(); //alarm starts immediately AlarmManager backupAlarmMgr=(AlarmManager)context.getSystemService(context.ALARM_SERVICE); backupAlarmMgr.setInexactRepeating(AlarmManager.RTC_WAKEUP,startTime,AlarmManager.INTERVAL_FIFTEEN_MINUTES,toastAlarmIntent); // alarm will repeat after every 15 minutes try { backupAlarmMgr.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, 15000,toastAlarmIntent); // alarm will repeat after every 15 minutes }catch (Exception e){ e.printStackTrace(); } } } public static void scheduleJob(Context context) { //creating new firebase job dispatcher FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context)); //creating new job and adding it with dispatcher Job job = createJob(dispatcher); dispatcher.mustSchedule(job); } public static Job createJob(FirebaseJobDispatcher dispatcher){ Job job = dispatcher.newJobBuilder() //persist the task across boots .setLifetime(Lifetime.FOREVER) //.setLifetime(Lifetime.UNTIL_NEXT_BOOT) //call this service when the criteria are met. .setService(ScheduledJobService.class) //unique id of the task .setTag("genie") //don't overwrite an existing job with the same tag .setReplaceCurrent(false) // We are mentioning that the job is periodic. .setRecurring(true) // Run between 10 - 15 mins from now. .setTrigger(Trigger.executionWindow(600, 900)) // retry with exponential backoff .setRetryStrategy(RetryStrategy.DEFAULT_LINEAR) //.setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL) //Run this job only when the network is available. .setConstraints(Constraint.ON_ANY_NETWORK) .build(); return job; } }
[ "swajan.talukdar@gmail.com" ]
swajan.talukdar@gmail.com
d384dd3ef6b534a56cc775faeef9c32091bff6ee
ce2b7ff4be41b3f61de3abffdc7359ae1a6f2921
/src/cl/buildersoft/framework/report/BSAbstractReport.java
3a7a0c2cb162aceacedca8a07871744e3ee938db
[]
no_license
claudiomoscoso/timectrl-web
6092769a4c59d39a240b491e093d96d4ab2ef988
eb99b7cd535067fb21065364790cd75cc96b6c6a
refs/heads/master
2020-04-06T05:15:08.973316
2016-08-22T15:21:35
2016-08-22T15:21:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,690
java
package cl.buildersoft.framework.report; import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import cl.buildersoft.framework.database.BSmySQL; import cl.buildersoft.framework.exception.BSDataBaseException; import cl.buildersoft.framework.util.BSConnectionFactory; import cl.buildersoft.framework.util.BSDateTimeUtil; import cl.buildersoft.framework.web.servlet.BSHttpServlet_; import cl.buildersoft.timectrl.business.beans.BSParamReport; import cl.buildersoft.timectrl.type.BSParamReportType; // @WebServlet("/servlet/Report") public abstract class BSAbstractReport extends BSHttpServlet_ { private static final long serialVersionUID = 5237687092259523326L; protected abstract BSReport getReportSpec(HttpServletRequest request); protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String action = getAction(request); String url = "/WEB-INF/jsp/framework/report/main-report.jsp"; if ("".equals(action)) { BSReport report = getReportSpec(request); String uri = request.getRequestURI().substring(request.getContextPath().length()); report.setUri(uri); HttpSession session = request.getSession(false); synchronized (session) { session.setAttribute("BSReport", report); } } else { HttpSession session = request.getSession(false); BSReport report = null; synchronized (session) { report = (BSReport) session.getAttribute("BSReport"); } String spName = report.getSpName(); BSmySQL mysql = new BSmySQL(); BSConnectionFactory cf = new BSConnectionFactory(); Connection conn = cf.getConnection(request); List<Object> params = getParameters(request, report); ResultSet rs = mysql.callSingleSP(conn, spName, params); String[] heads = getHeads(rs); List<String[]> data = resultSetToList(rs); request.setAttribute("Heads", heads); request.setAttribute("Data", data); if ("download".equals(action)) { url = "/servlet/framework/report/DownloadReport"; } cf.closeConnection(conn); } String dateFormat = BSDateTimeUtil.getFormatDate(request); request.setAttribute("DateFormat", dateFormat); forward(request, response, url); } private String getAction(HttpServletRequest request) { String out = ""; Boolean isRun = request.getParameter("run") != null; Boolean isDownload = request.getParameter("download") != null; if (isRun) { out = "run"; } else { if (isDownload) { out = "download"; } } return out; } public List<String[]> resultSetToList(ResultSet rs) { List<String[]> out = new ArrayList<String[]>(); ResultSetMetaData md; try { md = rs.getMetaData(); Integer columns = md.getColumnCount(); String[] row = null; while (rs.next()) { row = new String[columns]; for (int i = 0; i < columns; i++) { row[i] = rs.getString(i + 1); } out.add(row); } } catch (SQLException e) { throw new BSDataBaseException(e); } return out; } private String[] getHeads(ResultSet rs) { String[] out = null; try { ResultSetMetaData md = rs.getMetaData(); List<String> fields = new ArrayList<String>(); Integer index = null; for (index = 1; index <= md.getColumnCount(); index++) { fields.add(md.getColumnLabel(index)); } out = new String[fields.size()]; index = 0; for (String field : fields) { out[index++] = field; } } catch (SQLException e) { throw new BSDataBaseException(e); } return out; } private List<Object> getParameters(HttpServletRequest request, BSReport report) { List<BSParamReport> params = null;// report.listParamReport(); List<Object> out = new ArrayList<Object>(); String name = null; String value = null; for (BSParamReport param : params) { name = param.getName(); value = request.getParameter(name); out.add(convertParam(request, param, value)); param.setValue(value); } return out; } private Object convertParam(HttpServletRequest request, BSParamReport param, String value) { BSParamReportType type = param.getParamType(); Object out = null; if (type.equals(BSParamReportType.DATE)) { out = value.trim().length() == 0 ? null : BSDateTimeUtil.string2Calendar(request, value); } else if (type.equals(BSParamReportType.TEXT) || type.equals(BSParamReportType.SELECT)) { out = (String) value; } return out; } }
[ "claudio.moscoso@gmail.com" ]
claudio.moscoso@gmail.com
c4fc86e7143e069d9b54344c3ff7a3b1f04859a2
d21950f60f988f1d812fc727fce50c22cca84242
/src/main/java/Preprocessing/ParameterManager.java
c6fe51c61a557b93313f2f7984799f2560ce3f84
[]
no_license
AimeeD90/pClean
958fb551d02a75e9fca907b727737794180fb707
eba7ab68c96a3f6fcdd07ae77c11050938f3380e
refs/heads/master
2023-04-28T20:02:22.440115
2018-08-06T10:06:42
2018-08-06T10:06:42
143,710,319
2
2
null
null
null
null
UTF-8
Java
false
false
5,714
java
package Preprocessing; import org.apache.commons.cli.*; import java.io.File; /** * Created by dengyamei on 06/08/2018. */ public class ParameterManager { private String tool; private String version; private String releasedate; private Options options; public ParameterManager() { } /* * main constructor * */ public ParameterManager(String tool, String version, String releasedate) { this.tool = tool; this.version = version; this.releasedate = releasedate; ParameterOptions(); } public void printToolInfo() { System.out.println(this.tool + " " + this.version + " (" + this.releasedate + ")"); } public void printUsageInfo() { printToolInfo(); System.out.println(); HelpFormatter help = new HelpFormatter(); System.out.println("java -Xmx2G pClean.jar"); help.printHelp("Options", this.options); System.out.println(); } public void ParameterOptions() { Options options = new Options(); options.addOption("h", false, "Help info"); options.addOption("i", true, "MS/MS data in MGF format"); options.addOption("idres", true, "Identification result"); options.addOption("o", true, "Output directory"); options.addOption("itol", true, "Fragment tolerance"); options.addOption("a2", false, "Consider gap masses of two amino acids"); options.addOption("mionFilter", false, "immonium ions filter"); options.addOption("labelMethod", true, "Peptide labeling method, iTRAQ4plex, iTRAQ8plex or TMT6, TMT12"); options.addOption("repFilter", false, "remove reporter ions"); options.addOption("labelFilter", false, "remove label-associated ions"); options.addOption("low", false, "removal of low b-/y-free window"); options.addOption("high", false, "removal of low b-/y-free window"); options.addOption("isoReduction", false, "reduction of heavy isotopic peaks"); options.addOption("chargeDeconv", false, "high charge deconvolution"); options.addOption("ionsMerge", false, "merge two adjacent peaks within a mass tolerance of 20ppm"); options.addOption("largerThanPrecursor", false, "remove peaks larger than precursor"); options.addOption("network", false, "Graph-based network filtration"); this.options = options; } public Options getOptions() { return options; } /* * initialize parameters * */ private boolean a2 = true; private String idres = null; private String input = null; private String outdir = null; private double itol; private boolean mionFilter; private String labelMethod = null; private boolean repFilter; private boolean labelFilter; private boolean low; private boolean high; private boolean isoReduction; private boolean chargeDeconv; private boolean ionsMerge; private boolean largerThanPrecursor; private boolean network; public void InitializeParameters(CommandLine cmd) { if (cmd.hasOption("a2")) { DeltaMassDB.consider2aa = true; } else { DeltaMassDB.consider2aa = false; } this.a2 = DeltaMassDB.consider2aa; if (cmd.hasOption("idres")) { this.idres = cmd.getOptionValue("idres"); } if (cmd.hasOption("i")) { this.input = cmd.getOptionValue("i"); } if (cmd.hasOption("o")) { this.outdir = cmd.getOptionValue("o"); File OD = new File(outdir); if (OD.isDirectory() && OD.exists()) { } else { OD.mkdirs(); } } if (cmd.hasOption("itol")) { Config.ms2tol = Double.valueOf(cmd.getOptionValue("itol")); } else { Config.ms2tol = 0.05; } this.itol = Config.ms2tol; this.mionFilter = cmd.hasOption("mionFilter"); if (cmd.hasOption("labelMethod")) { this.labelMethod = cmd.getOptionValue("labelMethod"); } this.repFilter = cmd.hasOption("repFilter"); this.labelFilter = cmd.hasOption("labelFilter"); this.low = cmd.hasOption("low"); this.high = cmd.hasOption("high"); this.isoReduction = cmd.hasOption("isoReduction"); this.chargeDeconv = cmd.hasOption("chargeDeconv"); this.ionsMerge = cmd.hasOption("ionsMerge"); this.largerThanPrecursor = cmd.hasOption("largerThanPrecursor"); this.network = cmd.hasOption("network"); } public boolean considerA2() { return a2; } public String getIdres() { return idres; } public String getInput() { return input; } public String getOutdir() { return outdir; } public double getItol() { return itol; } public boolean doImionFilter() { return mionFilter; } public String getLabelMethod() { return labelMethod; } public boolean doRepFilter() { return repFilter; } public boolean doLabelFilter() { return labelFilter; } public boolean doLowWindowFilter() { return low; } public boolean doHighWindowFilter() { return high; } public boolean doIsoReduction() { return isoReduction; } public boolean doChargeDeconv() { return chargeDeconv; } public boolean doIonsMerge() { return ionsMerge; } public boolean doLargerThanPrecursor() { return largerThanPrecursor; } public boolean doNetworkFilter() { return network; } }
[ "aimee.d.ym@gmail.com" ]
aimee.d.ym@gmail.com
66bdf8e76b0fb61b64a0db9f78d0439cc2408f98
028cbe18b4e5c347f664c592cbc7f56729b74060
/external/modules/derby/10.10.2.0/java/testing/org/apache/derbyTesting/junit/DerbyDistribution.java
18fde7503fc84476297718e2cca743d7ec6f4e6e
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-generic-export-compliance" ]
permissive
dmatej/Glassfish-SVN-Patched
8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e
269e29ba90db6d9c38271f7acd2affcacf2416f1
refs/heads/master
2021-05-28T12:55:06.267463
2014-11-11T04:21:44
2014-11-11T04:21:44
23,610,469
1
0
null
null
null
null
UTF-8
Java
false
false
13,222
java
/* Derby - Class org.apache.derbyTesting.junit.DerbyDistribution Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.apache.derbyTesting.junit; import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests; /** * Holds information required to run a Derby distribution and make choices * based on the version of the Derby distribution. * <p> * <em>Implementation note</em>: For simplicity distributions off the classes * directory have been forbidden. The main reason for this is that it is * sometimes a hard requirement that you must include only a single JAR from a * distribution on the classpath. One such example is the compatibility test, * where you need the testing code from one distribution and the client driver * from another. While it is possible to support such a configuration running * off the {@code classes}-directory in many scenarios, it complicates * the creation and handling of classpath string. Generating the JARs when * testing on trunk seems like an acceptable price to pay. */ public class DerbyDistribution implements Comparable { private static File[] EMPTY_FILE_ARRAY = new File[] {}; public static final String JAR_RUN = "derbyrun.jar"; public static final String JAR_CLIENT = "derbyclient.jar"; public static final String JAR_ENGINE = "derby.jar"; public static final String JAR_NET = "derbynet.jar"; public static final String JAR_TESTING = "derbyTesting.jar"; private static final String[] REQUIRED_JARS = { JAR_ENGINE, JAR_NET, JAR_CLIENT }; /** The version of the Derby distribution, i.e. 10.8.1.2. */ private final DerbyVersion version; /** Path to derbyrun.jar (may be {@code null}). */ private final String derbyRunJarPath; /** Path to derbyclient.jar. */ private final String derbyClientJarPath; /** Path to derby.jar. */ private final String derbyEngineJarPath; /** Path to derbynet.jar. */ private final String derbyNetJarPath; /** * Production classpath, i.e. all JAR files found except for * derbyTesting.jar. */ private final String productionClasspath; /** Testing classpath, i.e. path to derbyTesting.jar. */ private final String testingClasspath; /** * Derives the information for a Derby distribution. * * @throws NullPointerException if version is {@code null} * @see #newInstance(DerbyVersion, File) */ private DerbyDistribution(DerbyVersion version, File[] productionJars, File[] testingJars) { if (version == null) { throw new NullPointerException("version is null"); } this.version = version; this.productionClasspath = constructJarClasspath(productionJars); this.testingClasspath = constructJarClasspath(testingJars); File root = productionJars[0].getParentFile(); this.derbyRunJarPath = getPath(root, JAR_RUN); this.derbyClientJarPath = getPath(root, JAR_CLIENT); this.derbyEngineJarPath = getPath(root, JAR_ENGINE); this.derbyNetJarPath = getPath(root, JAR_NET); } /** Returns the absolute path to the JAR if it exists, otherwise null. */ private String getPath(File root, String jar) { File f = new File(root, jar); if (PrivilegedFileOpsForTests.exists(f)) { return f.getAbsolutePath(); } else { return null; } } /** Tells if this distribution has a {@code derbyrun.jar}. */ public boolean hasDerbyRunJar() { return derbyRunJarPath != null; } /** * Returns the path to {@code derbyrun.jar}. * * @return A path, or {@code null} if this distribution doesn't come with * {@code derbyrun.jar}. * @see #hasDerbyRunJar() */ public String getDerbyRunJarPath() { return derbyRunJarPath; } /** Returns the path to {@code derbyclient.jar}. */ public String getDerbyClientJarPath() { return derbyClientJarPath; } /** Returns the path to {@code derby.jar}. */ public String getDerbyEngineJarPath() { return derbyEngineJarPath; } /** Returns the path to {@code derbynet.jar}. */ public String getDerbyNetJarPath() { return derbyEngineJarPath; } /** Returns a classpath with the network server production JARs. */ public String getServerClasspath() { return this.derbyNetJarPath + File.pathSeparator + this.derbyEngineJarPath; } /** Returns a classpath with all production JARs. */ public String getProductionClasspath() { return productionClasspath; } /** Returns a classpath with all testing JARs. */ public String getTestingClasspath() { return testingClasspath; } /** Returns a classpath with all production and testing JARs. */ public String getFullClassPath() { return productionClasspath + File.pathSeparatorChar + testingClasspath; } /** Returns the version of this distribution. */ public DerbyVersion getVersion() { return version; } /** * Orders this distribution and the other distribution based on the version. * <p> * <em>Implementation note</em>: Remove this method when we can use * Java SE 5.0 features. * * @param o the other distribution * @return {@code 1} if this version is newer, {@code 0} if both * distributions have the same version, and {@code -1} if the other * version is newer. * @see #compareTo(org.apache.derbyTesting.junit.DerbyDistribution) */ public int compareTo(Object o) { return compareTo((DerbyDistribution)o); } /** * Orders this distribution and the other distribution based on the version. * * @param o the other distribution * @return {@code 1} if this version is newer, {@code 0} if both * distributions have the same version, and {@code -1} if the other * version is newer. */ public int compareTo(DerbyDistribution o) { return version.compareTo(o.version); } private static boolean hasRequiredJars(List jars) { for (int i=0; i < REQUIRED_JARS.length; i++) { boolean hasJar = false; for (Iterator jarIter = jars.iterator(); jarIter.hasNext(); ) { File jar = (File)jarIter.next(); if (jar.getName().equalsIgnoreCase(REQUIRED_JARS[i])) { hasJar = true; break; } } if (!hasJar) { BaseTestCase.println("missing jar: " + REQUIRED_JARS[i]); return false; } } return true; } /** * Helper method extracting Derby production JARs from a directory. * * @param libDir directory * @return A list of JARs (possibly empty). */ private static File[] getProductionJars(File libDir) { File[] pJars = libDir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.toUpperCase().endsWith(".JAR") && !isTestingJar(name); } }); if (pJars == null) { return EMPTY_FILE_ARRAY; } else { return pJars; } } /** * Helper method extracting Derby testing JARs from a directory. * * @param libDir directory * @return A list of JARs (possibly empty). */ private static File[] getTestingJars(File libDir) { File[] tJars = libDir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return isTestingJar(name); } }); if (tJars == null) { return EMPTY_FILE_ARRAY; } else { return tJars; } } public static File[] getJars(File libDir) { File[] jars = libDir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.toUpperCase().endsWith(".JAR"); } }); return jars; } /** * Tells if the given file is a Derby testing JAR. * * @param name name of the file * @return {@code true} if a testing JAR, {@code false} otherwise */ private static boolean isTestingJar(String name) { return name.toUpperCase().endsWith(JAR_TESTING.toUpperCase()); } /** * Merges a list of JAR files into a classpath string. * * @param jars JAR files to merge * @return A classpath string. */ private static String constructJarClasspath(File[] jars) { StringBuffer sb = new StringBuffer(512); for (int i=0; i < jars.length; i++) { try { sb.append(jars[i].getCanonicalPath()); } catch (IOException ioe) { // Do the next best thing; use absolute path. String absPath = jars[i].getAbsolutePath(); sb.append(absPath); BaseTestCase.println("obtaining canonical path for " + absPath + " failed: " + ioe.getMessage()); } sb.append(File.pathSeparatorChar); } if (jars.length > 0) { sb.deleteCharAt(sb.length() -1); } return sb.toString(); } /** * <p> * Returns a distribution with the specified version, based on the given * library directory. * </p> * * <p> * It is the responsibility of the caller to ensure that the specified * version matches the JARs in the given directory. * </p> * * @param version the version of the distribution * @param baseDir the base dir for the distribution, holding the Derby JARs * @return A representation of the distribution, or {@code null} if * the specified directory doesn't contain a valid distribution. * @throws IllegalArgumentException if {@code version} is {@code null} */ public static DerbyDistribution newInstance(DerbyVersion version, File baseDir) { return newInstance(version, baseDir, baseDir); } /** * <p> * Returns a distribution with the specified version, based on the given * library and testing directories. * </p> * * <p> * It is the responsibility of the caller to ensure that the specified * version matches the JARs in the given directories. * </p> * * @param version the version of the distribution * @param baseDir the directory holding the production JARs * @param testDir the directory holding the testing JAR * @return A representation of the distribution, or {@code null} if * the specified directories don't make up a valid distribution. * @throws IllegalArgumentException if {@code version} is {@code null} */ public static DerbyDistribution newInstance(DerbyVersion version, File baseDir, File testDir) { File[] productionJars = getProductionJars(baseDir); File[] testingJars = getTestingJars(testDir); List tmpJars = new ArrayList(); tmpJars.addAll(Arrays.asList(productionJars)); tmpJars.addAll(Arrays.asList(testingJars)); if (hasRequiredJars(tmpJars)) { return new DerbyDistribution(version, productionJars, testingJars); } // Invalid distribution, ignore it. BaseTestCase.println("Distribution deemed invalid (note that running " + "off classes isn't supported): " + baseDir.getAbsolutePath() + (baseDir.equals(testDir) ? "" : ", " + testDir.getAbsolutePath())); return null; } }
[ "snjezana@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5" ]
snjezana@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
b739ee403e493f19106dae58ecfd33f69ea0c58d
92b55af52301e87a8cb729dcafb62f78f34b7788
/Open Source/Ruby VMs/JRuby/jruby-parser/src/org/jrubyparser/ast/NotNode.java
f322a795c7b9bf304b50fca4f8633fa7f9a2aea9
[]
no_license
briancabbott/rb-programming-sandbox
382ec03f6efed06cf656981aed56a451bb4a53a3
a25c8290293d96e947f769f493dbabe5f78aebf4
refs/heads/master
2020-12-25T18:19:38.959954
2015-03-29T04:11:24
2015-03-29T04:11:24
7,495,370
0
1
null
null
null
null
UTF-8
Java
false
false
3,042
java
/* ***** BEGIN LICENSE BLOCK ***** * Version: CPL 1.0/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Common Public * License Version 1.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.eclipse.org/legal/cpl-v10.html * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * Copyright (C) 2009 Thomas E. Enebo <tom.enebo@gmail.com> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the CPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the CPL, the GPL or the LGPL. ***** END LICENSE BLOCK *****/ package org.jrubyparser.ast; import org.jrubyparser.NodeVisitor; import org.jrubyparser.SourcePosition; /** * The 'not' operator, as it was in 1.8. In 1.9 and 2.0 'not' is syntactic * sugar for '!' with a different precedence but semantically identical, * and there we represent applications of 'not' with a call to '!' with a * name of '!' and a lexical name of 'not'. So you will not see this node * except in a 1.8 AST. */ public class NotNode extends Node { private Node conditionNode; public NotNode(SourcePosition position, Node conditionNode) { super(position); assert conditionNode != null : "conditionNode is not null"; this.conditionNode = adopt(conditionNode); } /** * Checks node for 'sameness' for diffing. * * @param node to be compared to * @return Returns a boolean */ @Override public boolean isSame(Node node) { return super.isSame(node) && getCondition().isSame(((NotNode) node).getCondition()); } public NodeType getNodeType() { return NodeType.NOTNODE; } /** * Accept for the visitor pattern. * @param iVisitor the visitor **/ public Object accept(NodeVisitor iVisitor) { return iVisitor.visitNotNode(this); } /** * Gets the conditionNode. * @return Returns a Node */ public Node getCondition() { return conditionNode; } @Deprecated public Node getConditionNode() { return getCondition(); } }
[ "briancabbott@gmail.com" ]
briancabbott@gmail.com
fd2be2a6a4b76443b54a3b0a958f8ce29f480393
bbb907af865d609847a92615b3f715366fdc82e4
/src/main/java/Classes/Review.java
92c39688d2a86b9ebd1982113c4dd4f3e94c56cb
[]
no_license
mihan1708/Movies
faacf4316c881e00fe57a9a58bfd40f8667fdd87
8dcb6a7913e886d4b571a253005a7d84810cae9e
refs/heads/master
2020-05-17T18:57:55.626074
2019-04-28T10:13:28
2019-04-28T10:13:28
183,891,949
0
0
null
null
null
null
UTF-8
Java
false
false
1,133
java
package Classes; import javax.persistence.*; @Entity @Table(name = "REVIEW") public class Review { @Id @Column(name = "REVIEW_ID") long review_ID; @Column(name = "MOVIE_id") int movie_ID; @Column(name = "create_Date") String createDate; @Column(name = "name_author") String author; @Column(name = "TEXT") String text; @Column(name = "rating") float rating; public Review(int Movie_ID, int reviewID, String text, String author, float rating, String createDate) { this.text = text; this.author = author; this.rating = rating; this.createDate = createDate; this.movie_ID = Movie_ID; this.review_ID = reviewID; } public Review() { } public float getRating() { return rating; } public String getAuthor() { return author; } public String getCreateDate() { return createDate; } public String getText() { return text; } public int getMovie_ID() { return movie_ID; } public long getReview_ID() { return review_ID; } }
[ "misha.rodionov.2011@mail.ru" ]
misha.rodionov.2011@mail.ru
f354e657e5278f2cca3da3d80b451093e2b67f2f
f4af23657703514246d6495247dd4b5ffa69e9ff
/src/main/java/com/jene/cognitive/utils/FoldTransactionsToResult.java
aa925f26bc8dcce8f48fb432223b647bdf18ca65
[]
no_license
jorgeakanieves/pulsar-flink-k8s
0d2df441af9c4ac3cb6aadb84f2bddde0a56e8ed
6a1a44aff37a90ea2fe0d6a90c7e835c4ed0c542
refs/heads/master
2020-04-26T14:56:49.101712
2019-03-27T13:45:59
2019-03-27T13:45:59
173,631,542
7
2
null
null
null
null
UTF-8
Java
false
false
2,641
java
package com.jene.cognitive.utils; import com.jene.cognitive.model.AccountResult; import com.jene.cognitive.model.Transaction; import org.apache.flink.api.common.functions.FoldFunction; import java.time.Instant; /** * @uthor Jorge Nieves */ public class FoldTransactionsToResult implements FoldFunction<Transaction, AccountResult> { @Override public AccountResult fold(AccountResult accumulator, Transaction value) throws Exception { accumulator.setCount(accumulator.getCount() + 1); accumulator.setAccountId(value.getAccountId()); if(!accumulator.getCities().contains(value.getPeerCity())) { accumulator.getCities().add(value.getPeerCity()); } if(!accumulator.getCountries().contains(value.getPeerCountry())) { accumulator.getCountries().add(value.getPeerCountry()); } if(accumulator.getMinTimestamp() == 0) { accumulator.setMinTimestamp(Long.parseLong(value.getTimeMilis().toString())); accumulator.setMaxTimestamp(Long.parseLong(value.getTimeMilis().toString())); } else { Instant d1 = Instant.ofEpochMilli(accumulator.getMinTimestamp()); Instant d2 = Instant.ofEpochMilli(Long.parseLong(value.getTimeMilis().toString())); if(d1.isBefore(d2)) { accumulator.setMinTimestamp(d1.toEpochMilli()); accumulator.setMaxTimestamp(d2.toEpochMilli()); } else { accumulator.setMinTimestamp(d2.toEpochMilli()); accumulator.setMaxTimestamp(d1.toEpochMilli()); } } if (accumulator.getCityCounts().containsKey(value.getPeerCity())){ accumulator.getCityCounts().put(value.getPeerCity(), accumulator.getCityCounts().get(value.getPeerCity())+1); } else { accumulator.getCityCounts().put(value.getPeerCity(), 1); } if (accumulator.getCityAmounts().containsKey(value.getPeerCity())){ accumulator.getCityAmounts().put(value.getPeerCity(), accumulator.getCityAmounts().get(value.getPeerCity())+value.getAmount()); } else { accumulator.getCityAmounts().put(value.getPeerCity(), value.getAmount()); } if (accumulator.getCountryCounts().containsKey(value.getPeerCountry())){ accumulator.getCountryCounts().put(value.getPeerCountry(), accumulator.getCountryCounts().get(value.getPeerCountry())+1); } else { accumulator.getCountryCounts().put(value.getPeerCountry(), 1); } accumulator.setResult(accumulator.getResult()); return accumulator; } }
[ "jorge.nieves@gft.com" ]
jorge.nieves@gft.com
810175b8e34662e5965721b46cc26d70450c6c4a
359387afb2396ffb8f9e7dd68fdcc06320069f11
/EFacturaWebTest/src/xg/generadorCFEs/GeneradorCFEsTest.java
3ec5df80ecd8220de8d553508399a039b674f12d
[]
no_license
domingomendivil/testefac
2ff65674a2cbed79e3cf762eb8ca60532d137a66
8f2b1bb700b772d9b428082d7597c79055e69b5f
refs/heads/master
2021-01-19T15:39:00.737455
2013-05-23T17:22:04
2013-05-23T17:26:56
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
4,622
java
package xg.generadorCFEs; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.security.KeyStore; import java.security.PrivateKey; import java.security.KeyStore.ProtectionParameter; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List; import org.junit.Test; import uy.gub.dgi.cfe.CAEdefType; import uy.gub.dgi.cfe.CFEDefType; import uy.gub.dgi.cfe.CFEDefTypeX; import uy.gub.dgi.cfe.CFEDefTypeX.EFactX; import uy.gub.dgi.cfe.CFEDefTypeX.EFactX.Detalle; import uy.gub.dgi.cfe.ItemDetFact; import xg.beans.CAEBean; import xg.beans.CFEBean; import xg.config.Factory; import xg.config.FactoryException; import xg.generadorcfes.GeneradorCFEs; import xg.generadorcfes.GeneradorCFEsImpl; import xg.xml.XMLMarshallerException; import xg.xml.XMLMarshallerImpl; import xg.xml.XMLSignerImpl; public class GeneradorCFEsTest { private CAEdefType getCAE() throws IOException, XMLMarshallerException { String xml=new FileXMLReader().getXMLFile("xmls/cae1.xml"); CAEBean cae = new CAEBean(xml); return cae.getCae(); } private CFEDefTypeX getFactura() { CFEDefTypeX cfe_x = new CFEDefTypeX(); EFactX efact = new EFactX(); Detalle detalle = new Detalle(); ItemDetFact item = new ItemDetFact(); detalle.getItem().add(item); efact.setDetalle(detalle); cfe_x.setEFactX(efact); return cfe_x; } @Test //GENERAR CFE //testear generar un CFE sin problemas en nada //chequear fecha de timestamp //chequear que verifique contra el xml generado public void testGenerarCFE() throws Exception { XMLSignerImpl xmlSigner = getXMLSigner(); GeneradorCFEsImpl generador = new GeneradorCFEsImpl(xmlSigner); CFEDefTypeX cfe_x = getFactura(); int nro = 2; CAEdefType cae = getCAE(); CFEBean cfe = generador.generarCFE(cfe_x, cae, nro); String xml =new XMLMarshallerImpl().unmarshall(cfe.getCfe()); System.out.println(xml); } //TEST GENERAR SOBRE CFE NULO //TEST GENERAR SOBRE UN CFE //TEST GENERAR SOBRE 2 CFEs //TEST GENERAR SOBRE private XMLSignerImpl getXMLSigner() throws Exception { PrivateKey privateKey = getPrivateKey(); Certificate certificate = getX509Certificate(); XMLSignerImpl xmlSigner = new XMLSignerImpl(privateKey, certificate); return xmlSigner; } //GENERAR SOBRE: testeo no hay CFEs en el día de ayer para generar sobre public void testGenerarSobreNoHayCFEsAyer(){ } //GENERAR SOBRE: testeo hay un CFE ayer public void testGenerarSobreHayunCFEAyer(){ } //GENERAR SOBRE: testeo hay CFEs solo antes de ayer public void testGenerarSobreHayCFEsAnteAyer(){ } //GENERAR SOBRE: testeo hay CFEs ayer y anteayer: deben generarse dos sobres public void testGenerarSobreHayCFEsAyeryAnteayer(){ } //GENERAR SOBRE: testo generar un sobre con certificado vencido public void testGenerarSobreCertificadoVencido(){ XMLSignerImpl xmlSigner; try { xmlSigner = new Factory().getXMLSigner(); GeneradorCFEs generador = new GeneradorCFEsImpl(xmlSigner); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } // generador.generarCFE(cfe_x, cae, nro); } private X509Certificate getX509Certificate() throws Exception { System.out.println("getPublicKey"); KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); String keyStoreAlias = "servicios.dgi.red.uy"; java.io.FileInputStream fis = null; try { String keyStoreDir = "keystores/agesic_prod.jks"; String keyStorePwd = "pep1to"; ; fis = new FileInputStream(new File(keyStoreDir)); ks.load(fis, keyStorePwd.toCharArray()); return (X509Certificate) ks.getCertificate(keyStoreAlias); } finally { if (fis != null) { fis.close(); } } } private PrivateKey getPrivateKey() throws Exception { KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); java.io.FileInputStream fis = null; try { fis = new java.io.FileInputStream("keystores//agesic_prod.jks"); ks.load(fis, "pep1to".toCharArray()); } finally { if (fis != null) { fis.close(); } } // get my private key ProtectionParameter p = new KeyStore.PasswordProtection( "pep1to".toCharArray()); KeyStore.PrivateKeyEntry pkEntry = (KeyStore.PrivateKeyEntry) ks .getEntry("servicios.dgi.red.uy", p); PrivateKey myPrivateKey = pkEntry.getPrivateKey(); return myPrivateKey; } private List<CFEDefTypeX> getFacturas() { CFEDefTypeX cfe = getFactura(); ArrayList<CFEDefTypeX> lista = new ArrayList(); lista.add(cfe); return lista; } }
[ "domingo.mendivil@gmail.com" ]
domingo.mendivil@gmail.com
cc0416395f88844eb3a431fa32a27df70ae1203d
e3c25790c9fa9a5a96d8628e312b470497384dfa
/app/src/androidTest/java/com/example/usuario/aplicacion3marzo/ExampleInstrumentedTest.java
a1fb333ea9afe14fa90098a73eca5dd420797c3f
[]
no_license
EduardoFistGitHub/Clase03Marzo
69df98b54f6cb4bcda82462da8fe2a03b1655cc0
70918d2cd7248e6650b275e2d502e313206d35e6
refs/heads/master
2021-01-25T14:45:38.906632
2018-03-03T19:49:05
2018-03-03T19:49:05
123,725,641
0
0
null
null
null
null
UTF-8
Java
false
false
773
java
package com.example.usuario.aplicacion3marzo; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.usuario.aplicacion3marzo", appContext.getPackageName()); } }
[ "edyironfist@gmail.com" ]
edyironfist@gmail.com
32038efcf7f1674b2a5ecdb80aefdb059d3d034a
28da0cd3d68657f3b90dd27a75e1ace707c9e938
/src/jdz/bukkitUtils/misc/loot/LootTable.java
06607831c91ca9e8e47f724ec4ecdba01001fa36
[]
no_license
theblobinc/JonosBukkitUtils
c3fb9f5ff6639c03931f0ed6ce3f8550de6c9d2e
3904c6b47e7058889fb2ed9708b118741f981d2a
refs/heads/master
2020-04-26T01:46:23.571905
2019-03-01T01:46:14
2019-03-01T01:46:14
172,140,081
0
0
null
2019-02-22T21:56:51
2019-02-22T21:56:51
null
UTF-8
Java
false
false
1,192
java
package jdz.bukkitUtils.misc.loot; import java.util.HashMap; import java.util.Map; import java.util.Set; import lombok.Getter; public abstract class LootTable { private final Map<Loot, Double> weighting = new HashMap<>(); @Getter private static double totalWeight = 0; public void addLoot(Loot loot) { addLoot(loot, 1); } public void addLoot(Loot loot, double weight) { if (weighting.keySet().contains(loot)) weighting.put(loot, weighting.get(loot)); else weighting.put(loot, weight); totalWeight += weight; } public boolean removeLoot(Loot loot) { if (weighting.containsKey(loot)) { totalWeight -= weighting.remove(loot); return true; } return false; } public Loot getRandom() { double rand = Math.random() * totalWeight; for (Loot item : weighting.keySet()) { rand -= weighting.get(item); if (rand <= 0) return item; } return weighting.keySet().iterator().next(); } public Set<Loot> getAllLoot() { return weighting.keySet(); } public double getProbability(Loot loot) { if (!weighting.containsKey(loot)) return -1; return weighting.get(loot) / totalWeight; } }
[ "jaidencolebaker@gmail.com" ]
jaidencolebaker@gmail.com
c45bcf48e40ffd2503b2dd78aa545f8575de434e
24874cdd07c9f4e50eba8f0d9234d05f10e0c748
/springcloud/cloud/product/src/main/java/cloud/dao/CloudInfoRepository.java
338edd685a47549d720695d991e972501abb5832
[]
no_license
lwsh1995/java-frame
28eee0496404669831a3add8c9e2b83b66aabf38
62d1de245bcba1e61079a0db610cbab6bcb1566c
refs/heads/master
2020-06-16T18:17:38.351224
2019-07-17T12:30:53
2019-07-17T12:30:53
195,662,125
1
0
null
null
null
null
UTF-8
Java
false
false
257
java
package cloud.dao; import cloud.entity.CloudInfo; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; public interface CloudInfoRepository extends JpaRepository<CloudInfo,String> { List<CloudInfo> findById(int id); }
[ "649542997@qq.com" ]
649542997@qq.com
1cd848556b1b2b76c58143892e217f1f4d3b98e5
afa6578248db2b02b675ba7238118bead58d2f7f
/app/src/main/java/com/semo/app/main/base/BaseFragmentView.java
90a370887eea0803625ca6775d5ba2ffe9f1ed93
[ "Apache-2.0" ]
permissive
Jessica-Dasul-Jung/Semo
5df208869aba33fcf0e9484d4d0416877a95fa11
26fc8c65fd509db67fccbf8b6d76f65409a276db
refs/heads/master
2020-05-31T07:39:26.324472
2019-06-04T09:27:37
2019-06-04T09:27:37
190,170,263
0
0
null
null
null
null
UTF-8
Java
false
false
1,280
java
/* * Copyright 2018 Rozdoum * * 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.semo.app.main.base; import android.support.annotation.StringRes; import android.view.View; /** * Created by Alexey on 08.05.18. */ public interface BaseFragmentView extends BaseView { void showProgress(); void showProgress(int message); void hideProgress(); void showSnackBar(String message); void showSnackBar(int message); void showSnackBar(View view, int messageId); void showToast(@StringRes int messageId); void showToast(String message); void showWarningDialog(int messageId); void showWarningDialog(String message); boolean hasInternetConnection(); void startLoginActivity(); }
[ "sicajung0214@gmail.com" ]
sicajung0214@gmail.com
e9023c4281159da09870f04a08fa8538ab745e28
af628c7265c15c438a30d8afce5f3e9bf3a2ceb0
/springCloud-example/cloud-alibaba-consumer-nacos-order84/src/main/java/com/huazai/springcloud/alibaba/consumer/nacos/order/config/ApplicationContextConfig.java
edda1646e12d2b7fe0c384963ee3f3204662d7e1
[]
no_license
SexCastException/springCloud
41c907f4df1536baddc7b14cfa261d9ead854b84
bd60d9ef7412164373f76ab5a61d86e469c6f6b5
refs/heads/master
2022-12-22T08:29:52.336617
2020-09-29T13:59:29
2020-09-29T13:59:29
285,600,409
0
0
null
null
null
null
UTF-8
Java
false
false
521
java
package com.huazai.springcloud.alibaba.consumer.nacos.order.config; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; /** * @author pyh * @date 2020/9/14 23:21 */ @Configuration public class ApplicationContextConfig { @Bean @LoadBalanced public RestTemplate getRestTemplate() { return new RestTemplate(); } }
[ "739967221@qq,cin" ]
739967221@qq,cin
0cb0c5c5476ea01fee26d7bdf1e414f5c36fd990
84380dc2ebe2e72058b071ffa72cb9ee78ae9330
/src/main/java/org/unclazz/dom/queries/ElementListQuery.java
0b8bf5216b56e94197b8c36a11555de1c71bb524
[ "MIT" ]
permissive
unclazz/unclazz-dom-queries
98652cb431204ecc7b30c91869d41fa3afcaf248
dc4e50e19494841e2824e2102347bf0751fe4e56
refs/heads/master
2021-01-10T02:02:36.208701
2016-03-06T05:37:53
2016-03-06T05:37:53
53,238,581
0
0
null
2016-03-06T05:01:23
2016-03-06T05:01:21
null
UTF-8
Java
false
false
3,644
java
package org.unclazz.dom.queries; import org.w3c.dom.Node; /** * {@link ElementNode}の問合わせを行うクエリ. * <p>このオブジェクト自体がクエリとして機能すると同時に、 * このオブジェクトのメンバーが返すオブジェクトもまたより特殊化された問合せを行うクエリとして機能する。 * インスタンスは{@link RelativeNodesQuery#element()}メソッドなどを通じて得られる。 * </p> */ public class ElementListQuery extends FunctionalListQuery<Node, ElementNode> { private static final Function<TreeStructure, ElementNode> treeStructuredNode2ElementNode = new Function<TreeStructure, ElementNode>() { @Override public ElementNode apply(TreeStructure target) { return target instanceof ElementNode ? (ElementNode) target : null; } }; private final FunctionalListQuery<Node, ElementNode> inner; ElementListQuery(final FunctionalListQuery<Node, TreeStructure> relativeNodesQuery) { this(relativeNodesQuery, null); } ElementListQuery(final FunctionalListQuery<Node, TreeStructure> relativeNodesQuery, final String name) { if (name == null) { // 関数を合成して新しいクエリを生成する this.inner = relativeNodesQuery.and(treeStructuredNode2ElementNode); } else { // タグ名によるフィルタリングを行うための関数オブジェクトを生成 final Function<ElementNode, ElementNode> tagName = new Function<ElementNode, ElementNode>() { @Override public ElementNode apply(ElementNode target) { return target.getTagName().equalsIgnoreCase(name) ? target : null; } }; // 関数を合成して新しいクエリを生成する this.inner = relativeNodesQuery.and(treeStructuredNode2ElementNode).and(tagName); } } @Override protected Iterable<Node> source(NodeKind n) { return inner.source(n); } @Override protected Function<Node, ElementNode> function() { return inner.function(); } /** * 子要素を持つ{@link ElementNode}のみを返すクエリを返す. * @return クエリ */ public FunctionalListQuery<Node, ElementNode> hasChildren() { return this.and(new Function<ElementNode, ElementNode>() { @Override public ElementNode apply(ElementNode target) { return target.hasChildNodes() ? target : null; } }); } /** * 指定された名前の属性を持つ{@link ElementNode}のみを返すクエリを返す. * 属性名の照合のとき大文字小文字は区別される。 * @param name 属性名 * @return クエリ */ public AttributedElementListQuery hasAttribute(final String name) { return new AttributedElementListQuery(this, name); } /** * 指定されたclass属性値を持つ{@link ElementNode}を返すクエリを返す. * @param className class属性名 * @return クエリ */ public ListQuery<ElementNode> className(final String className) { return this.and(new Function<ElementNode, ElementNode>() { @Override public ElementNode apply(ElementNode target) { return target.query(Queries.classes).contains(className) ? target : null; } }); } /** * 対象XMLノードの子孫要素に対してIDによる問合せを行うクエリを返す. * @param id ID * @return クエリ */ public final Query<ElementNode> id(final String id) { final ListQuery<ElementNode> base = this; return new Query<ElementNode>() { @Override public ElementNode queryFrom(final NodeKind n) { for (final ElementNode e : base.queryFrom(n)) { if (id.equals(e.getAttribute("id"))) { return e; } } return null; } }; } }
[ "mizuki.fujitani@gmail.com" ]
mizuki.fujitani@gmail.com
54e6755ebf8364160e273b1ab93a0eca01af3dea
3e9aa8ab17e246ae0bbb11eb3bc35c4da673ab9a
/src/myIngrediBox/gui/ActionBar.java
4da26341f52a0566332bf5a6561a828d78ebeeb3
[ "MIT" ]
permissive
HTW-Berlin-UI/MyIngrediBox
e23000ce2751c797e1952808190c6166b68c5a5d
6439763779da9eaa2b36b3332f6a2a582efdad20
refs/heads/master
2021-05-13T12:30:33.344363
2018-02-13T14:39:51
2018-02-13T14:39:51
116,673,854
0
0
null
null
null
null
UTF-8
Java
false
false
1,686
java
package myIngrediBox.gui; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JRadioButton; import myIngrediBox.ontologies.BuyingPreference; public class ActionBar extends JPanel implements ActionListener { private JButton submitButton; private SubmitListener submitListener; private JRadioButton buyLowLeftoversRadio; private JRadioButton buyChepeastRadio; private ButtonGroup buyingPreferenceGroup; public ActionBar() { setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); submitButton = new JButton("Start Shopping"); submitButton.addActionListener(this); buyLowLeftoversRadio = new JRadioButton("Reduce Leftovers"); buyChepeastRadio = new JRadioButton("Get cheapest"); buyLowLeftoversRadio.setActionCommand(BuyingPreference.LOW_LEFTOVERS.toString()); buyChepeastRadio.setActionCommand(BuyingPreference.CHEAPEST.toString()); buyChepeastRadio.setSelected(true); buyingPreferenceGroup = new ButtonGroup(); buyingPreferenceGroup.add(buyLowLeftoversRadio); buyingPreferenceGroup.add(buyChepeastRadio); setLayout(new FlowLayout(FlowLayout.RIGHT)); add(buyChepeastRadio); add(buyLowLeftoversRadio); add(submitButton); } public void setSubmitListener(SubmitListener listener) { this.submitListener = listener; } @Override public void actionPerformed(ActionEvent e) { if (this.submitListener != null) this.submitListener .submit(BuyingPreference.valueOf(this.buyingPreferenceGroup.getSelection().getActionCommand())); } }
[ "k.koal@student.htw-berlin.de" ]
k.koal@student.htw-berlin.de
3946717eb2e2eaf361ccc1c09b3cc6b2b84368c3
3f1135c7d8c6527686af82720e32569879700397
/src/java/growthcraft/bees/common/block/BlockBeeBoxJurassicraft.java
61c87037219dd8100137df9c20b410383ccd3b8e
[ "MIT" ]
permissive
Um-Mitternacht/George-Washington-Carver-1.7
74b1f01f2c31b20368ec941f4691bd1fbd3fc535
3ec0329c82770361245b455a95bbb4730ff1d8fb
refs/heads/1.10.2
2020-05-30T11:27:33.605639
2017-02-26T00:33:55
2017-02-26T00:33:55
63,481,645
1
3
null
2017-02-17T17:57:03
2016-07-16T12:19:32
Java
UTF-8
Java
false
false
2,508
java
/* * The MIT License (MIT) * * Copyright (c) 2016 IceDragon200 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package growthcraft.bees.common.block; import growthcraft.core.integration.jc.EnumJCWoodType; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; public class BlockBeeBoxJurassicraft extends BlockBeeBox { public BlockBeeBoxJurassicraft() { super(); setHardness(2f); setUnlocalizedName("grc.BeeBox.Jurassicraft"); } @Override public String getMetaname(int meta) { if (meta >= 0 && meta < EnumJCWoodType.VALUES.length) { return EnumJCWoodType.VALUES[meta].name; } return super.getMetaname(meta); } @Override @SideOnly(Side.CLIENT) @SuppressWarnings({"rawtypes", "unchecked"}) public void getSubBlocks(Item block, CreativeTabs tab, List list) { for (int i = 0; i < EnumJCWoodType.VALUES.length; ++i) { list.add(new ItemStack(block, 1, i)); } } //@Override //@SideOnly(Side.CLIENT) // //{ // this.icons = new IIcon[4 * EnumBopWoodType.VALUES.length]; // for (EnumBopWoodType type : EnumBopWoodType.VALUES) // { // registerBeeBoxIcons(reg, String.format("/biomesoplenty/%s/", type.name), type.meta); // } //} }
[ "eyespot7b@aol.com" ]
eyespot7b@aol.com
d3057ca95e833a305fd4d3261e49ad84a45885cc
b830dbbc8d649cf95d72c6dc0b49affc22bc41c4
/Java/TechDegreeProjects/Spark-Blog/src/main/java/com/teamtreehouse/blog/model/Comments.java
41343acb36c7cbde7683271a334e0a82d99e40e8
[]
no_license
ronaldnwilliams/Treehouse
65311f03ec923f757d94ce0d8a8c63960dbc8aab
16185930166bb574477aef553532402b61d6d743
refs/heads/master
2021-05-11T08:31:29.235118
2018-08-04T17:19:50
2018-08-04T17:19:50
118,049,604
0
0
null
2018-01-18T23:48:00
2018-01-18T23:13:02
Python
UTF-8
Java
false
false
1,252
java
package com.teamtreehouse.blog.model; import java.util.Date; public class Comments { private String name; private String comment; private Date date; public Comments(String name, String comment) { this.name = name; this.comment = comment; this.date = new Date(); } public String getName() { return name; } public String getComment() { return comment; } public Date getDate() { return date; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Comments comments = (Comments) o; if (name != null ? !name.equals(comments.name) : comments.name != null) return false; if (comment != null ? !comment.equals(comments.comment) : comments.comment != null) return false; return date != null ? date.equals(comments.date) : comments.date == null; } @Override public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (comment != null ? comment.hashCode() : 0); result = 31 * result + (date != null ? date.hashCode() : 0); return result; } }
[ "ronaldnwilliams@gmail.com" ]
ronaldnwilliams@gmail.com
bc34313c8ea1de045dc3ce336085b40266100738
8a3371bdc4f4eadcc35f38e5fe84b6e7e4b5c02a
/src/main/java/com/reforgedsrc/app/vue2demo/boot/data/entity/User.java
0bc75bc5aa9b3ae9b6ce92c074e392c3dc234012
[]
no_license
skymarlio82/vue2-app-boot
34c0504ad2c54da4c0acc8dea2cf98b9000d5884
c6b96c1aac07d55e5fc5f3ef0a5a04bc78b61cdf
refs/heads/master
2020-09-06T15:28:42.437927
2020-08-28T09:45:39
2020-08-28T09:45:39
204,591,719
1
0
null
2019-10-29T18:47:32
2019-08-27T01:17:36
Java
UTF-8
Java
false
false
449
java
package com.reforgedsrc.app.vue2demo.boot.data.entity; import java.util.Date; import java.util.List; import lombok.Data; @Data public class User { private Long id = 0L; private String username = null; private String password = null; private Boolean enabled = false; private Date lastPasswordResetDate = null; private List<Authority> authorities = null; private String menu = null; public User() { } }
[ "jitao.liu82@gmail.com" ]
jitao.liu82@gmail.com
967b0c0c211f02f1ec4d73a3f97484d0871c8323
abef02c55d09b14fcd258a18607b21e7b8e27d51
/Sampling.java
498181ef9d1f117316450e78ecfa3aee3a439fa3
[]
no_license
evanli05/BayesNet-and-Inference-Algorithm
b5ef8f745a3e812508af72ff0afa1a2e7bcf17cf
d66aaac468140b8dead7de054958a4f3fdc9d80f
refs/heads/master
2021-06-02T08:10:27.087156
2016-09-07T05:28:32
2016-09-07T05:28:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
17,978
java
/* Authors : * Pratish Merchant * Neelam Tikone */ package pa2.ai; import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; import java.util.Map.Entry; import java.util.Random; import java.util.Scanner; import java.util.Set; import java.util.Stack; import java.util.concurrent.ThreadLocalRandom; public class Sampling { public static int nop = 2; public static Hashtable<String, Double> E = new Hashtable<String, Double>(); public static Hashtable<String, Double> B = new Hashtable<String, Double>(); public static Hashtable<String, Double> A = new Hashtable<String, Double>(); public static Hashtable<String, Double> M = new Hashtable<String, Double>(); public static Hashtable<String, Double> J = new Hashtable<String, Double>(); HashMap<String, ArrayList<String>> parents = new HashMap<String, ArrayList<String>>(); public static HashMap<String, String> evi = new HashMap<String, String>(); public static String evidence[][] ; public static String query[] ; public static int values[] = new int[5]; public static int n,m; public static String[] vars = { "E", "B", "A", "M", "J" }; public static Stack<String> variable; public static void createTables() { // Create table B B.put("t", 0.001); B.put("f", 0.999); // Create Table E E.put("t", 0.002); E.put("f", 0.998); // Create Table A A.put("tt", 0.95); A.put("tf", 0.94); A.put("ft", 0.29); A.put("ff", 0.001); // Create Table J J.put("t", 0.9); J.put("f", 0.05); // Create Table M M.put("t", 0.70); M.put("f", 0.01); variable = new Stack<String>(); //Stack of variables variable.push("M"); variable.push("J"); variable.push("A"); variable.push("B"); variable.push("E"); } /* * This function is to create a function to maintain the information about * the parents in the Hashmap. */ public static HashMap<String, ArrayList<String>> createParents() { HashMap<String, ArrayList<String>> parents = new HashMap<String, ArrayList<String>>(); ArrayList<String> a = new ArrayList<String>(); a.add("B"); a.add("E"); parents.put("A", a); ArrayList<String> j = new ArrayList<String>(); j.add("A"); parents.put("J", j); ArrayList<String> m = new ArrayList<String>(); m.add("A"); parents.put("M", m); ArrayList<String> b = new ArrayList<String>(); parents.put("B", b); ArrayList<String> e = new ArrayList<String>(); parents.put("E", e); return parents; } /* * The method Prob returns the probability value of each of the element by * considering the dependencies as well. Below is the Program which * implements the enumeration algorithm as specified in Russel and Norvig * Book. * * element: it is the Element whose probability value is suppose to be found * out value: the value of the element(True or False) evi: HashMap which * contains the given evidences and their values parents: HashMap which * contains the elements and the ArrayList of its Parents * */ public static Double Prob(String element, String value, HashMap<String, String> evi, HashMap<String, ArrayList<String>> parents) { Double finalProb = (double) 0; ArrayList<String> p = new ArrayList<String>(); p = parents.get(element); String parentVals = ""; if (p.size() == 0) { // Size of parent is 0 which means it is E or B as // they have no parents if (element.equalsIgnoreCase("E")) { finalProb = E.get("t"); } else if (element.equalsIgnoreCase("B")) finalProb = B.get("t"); } else { int n = p.size(); // size of parents for (int i = 0; i < n; i++) { // Getting the value of Parent parentVals = parentVals + evi.get(p.get(i)); } if (element.equalsIgnoreCase("A")) { // If parent is A then get the // Probability of A finalProb = A.get(parentVals); } else if (element.equalsIgnoreCase("J")) { // If parent is J then // get the Probability // of J finalProb = J.get(parentVals); } else if (element.equalsIgnoreCase("M")) { // If parent is M then // get the Probability // of M finalProb = M.get(parentVals); } } if (value.equalsIgnoreCase("t")) { return finalProb; } else { return (1 - finalProb); // if the value for element is f then return // the Probability for False } } // This function is to calculating the probability. It normalizes for the // true and false value public static HashMap<String, Double> normalize(HashMap<String, Double> QX) { Double total = 0.0; for (String s : QX.keySet()) { total = QX.get(s) + total; } for (String s : QX.keySet()) { QX.put(s, QX.get(s) / total); } return QX; } /* * The enumerationAsk function takes the input of following: query: it is * the Query variable var: Stack of all the elements evidence[][]: it is the * list of evidence variables and their values as provided by the user * parents: its the HashMap of variables and their parents. varss: It is the * array which contains list of all variables. */ public static HashMap<String, Double> enumerationAsk(String query, Stack<String> var, String evidence[][], HashMap<String, ArrayList<String>> parents, String[] varss) { HashMap<String, Double> QX = new HashMap<String, Double>(); String output[] = { "f", "t" }; // used to enumerate through the true as // well as false values of the query // variable String e[] = new String[2]; HashMap<String, String> evi = new HashMap<String, String>(); for (int k = 0; k < evidence.length; k++) { evi.put(evidence[k][0], evidence[k][1]); } for (int i = 0; i < output.length; i++) { evi.put(query, output[i]); QX.put(output[i], enumerateAll(var, evi, parents)); // puts the // calculated // probability // for True and // False and // stores it in // HashMap evi.remove(query); } return normalize(QX); } /* * This function is used to enumerate through all the elements of the * list.The following arguments are used in the program: * * */ public static Double enumerateAll(Stack<String> var, HashMap<String, String> evi, HashMap<String, ArrayList<String>> parents) { if (var.isEmpty()) return (double) 1.0; String s = var.pop(); if (evi.containsKey(s)) { //No need to normalise if the element is present in evidence as its value is determined. Double valu = Prob(s, evi.get(s), evi, parents) * enumerateAll(var, evi, parents); var.push(s); return valu; } else { Double total = 0.0; evi.put(s, "t"); //Normalising for the True value of variable total = total + Prob(s, "t", evi, parents) * enumerateAll(var, evi, parents); evi.put(s, "f"); //Normalising for the False value of variable total = total + Prob(s, "f", evi, parents) * enumerateAll(var, evi, parents); evi.remove(s); var.push(s); return total; } } public static double generateRandom() { double rand = ThreadLocalRandom.current().nextDouble(0.00, 1.00); return rand; } public static void printArray(int[] input) { for (int i = 0 ; i < input.length ; i ++){ System.out.print (input[i] + "\t"); } System.out.println(); } // Used to compare sample with input recieved public static boolean compareValues(int []samples , int []input){ boolean flag= false; for (int j = 0 ; j < samples.length ; j ++){ if (input[j] != -1 ){ if (samples[j] != input[j]) flag = true; } } return flag; } public static double likelihoodSampling(int [][]samples, int input[],double[] prob, int query){ double cntnum = 0.00; double cntden = 0.00; double result = 0.00; int inwquery [] = new int [input.length]; for (int i = 0 ; i < input.length ; i ++){ if (i == query){ inwquery[i] = 1; } else { inwquery[i] = input[i]; } } for (int i = 0 ; i < samples.length ; i++){ boolean denflag = false; boolean numflag = false; denflag = compareValues(samples[i], input); if (!denflag){ cntden += prob[i]; } numflag = compareValues(samples[i], inwquery); if (!numflag){ cntnum += prob[i]; } } if (cntden !=0){ result = (cntnum/cntden); }else result = 0; return result; } public static double priorSampling(int [][]samples, int input[], int query){ double cntnum = 0.00; double cntden = 0.00; double result = 0.00; int inwquery [] = new int [input.length]; for (int i = 0 ; i < input.length ; i ++){ if (i == query){ inwquery[i] = 1; } else { inwquery[i] = input[i]; } } for (int i = 0 ; i < samples.length ; i++){ boolean denflag = false; boolean numflag = false; denflag = compareValues(samples[i], input); if (!denflag){ cntden ++; } numflag = compareValues(samples[i], inwquery); if (!numflag){ cntnum ++; } } if (cntden != 0.0){ result = cntnum/cntden; }else result = 0.0; return result; } public static int[][] generateRejectionSamples(int noofsamples, int input[]){ int [][] rejectionSamples = new int[noofsamples][5]; int counter = 0 ; while (counter < noofsamples){ int [][] checkInput = generateSamples(1); if (compareValues(checkInput[0], input)){ continue; } rejectionSamples[counter] = checkInput[0]; counter ++; } return rejectionSamples; } public static int[][] generateLikelihoodSamples(int noofsamples, double prob[], int input[] ){ int[][] samples = new int[noofsamples][5]; int counter = 0; double bur; double ear; double alm; double jhn; double mry; while (counter < noofsamples){ double weight = 1.000; if (input[0] != -1){ if (input[0] == 1){ weight *= B.get("t"); samples[counter][0] = 1; } else { weight *= B.get("f"); samples[counter][0] = 0; } } else { bur = generateRandom(); if (bur <= B.get("t")) { samples[counter][0] = 1; } else { samples[counter][0] = 0; } } if (input[1] != -1){ if (input[1] == 1){ weight *= E.get("t"); samples[counter][1] = 1; }else { weight *= E.get("f"); samples[counter][1] = 0; } }else { ear = generateRandom(); if (ear <= E.get("t")) { samples[counter][1] = 1; } else { samples[counter][1] = 0; } } String almcond = "" ; if (samples[counter][0] == 1){ almcond += "t"; } else almcond += "f"; if (samples[counter][1] == 1){ almcond += "t"; } else { almcond += "f"; } if (input[2] != -1){ if (input[2] == 1){ weight *= A.get(almcond); samples[counter][2] = 1; } else { weight *= (1 - A.get(almcond)); samples[counter][2] = 0; } }else { alm = generateRandom(); if (alm <= A.get(almcond)){ samples[counter][2] = 1; } else { samples[counter][2] = 0; } } String jhncond = "" ; if (samples[counter][2] == 1){ jhncond += "t"; } else jhncond += "f"; if (input[3] != -1){ if ( input[3] == 1){ weight *= J.get(jhncond); samples[counter][3] = 1; }else { weight *= (1 - J.get(jhncond)); samples[counter][3] = 0; } } else { jhn = generateRandom(); if (jhn <= J.get(jhncond)){ samples[counter][3] = 1; } else { samples[counter][3] = 0; } } if (input[4] != -1){ if (input[4] == 1){ weight *= M.get(jhncond); samples[counter][4] = 1; }else { weight *= (1 - M.get(jhncond)); samples[counter][4] = 0; } }else { mry = generateRandom(); if (mry <= M.get(jhncond)){ samples[counter][4] = 1; } else { samples[counter][4] = 0; } } prob[counter] = weight; counter++; } return samples; } public static int[][] generateSamples(int noofsamples) { int[][] samples = new int[noofsamples][5]; int counter = 0; double bur; double ear; double alm; double jhn; double mry; while (counter < noofsamples){ bur = Math.random(); if (bur <= B.get("t")) { samples[counter][0] = 1; } else { samples[counter][0] = 0; } ear = Math.random(); if (ear <= E.get("t")) { samples[counter][1] = 1; } else { samples[counter][1] = 0; } alm = Math.random(); String almcond = "" ; if (samples[counter][0] == 1){ almcond += "t"; } else almcond += "f"; if (samples[counter][1] == 1){ almcond += "t"; } else { almcond += "f"; } if (alm <= A.get(almcond)){ samples[counter][2] = 1; } else { samples[counter][2] = 0; } jhn = Math.random(); String jhncond = "" ; if (samples[counter][2] == 1){ jhncond += "t"; } else jhncond += "f"; if (jhn <= J.get(jhncond)){ samples[counter][3] = 1; } else { samples[counter][3] = 0; } mry = Math.random(); if (mry <= M.get(jhncond)){ samples[counter][4] = 1; } else { samples[counter][4] = 0; } counter++; } return samples; } public static int getIndex(String query){ switch (query.toLowerCase()) { case "b": return 0; case "e": return 1; case "a": return 2; case "j": return 3; case "m": return 4; default: break; } return 0; } public static void readInput(){ Scanner in = new Scanner(System.in); String startinput[] = in.nextLine().split(" "); if (startinput.length != 2 ){ System.out.println("Incorrect values for m & n. Exiting "); System.exit(1); } n = Integer.parseInt(startinput[0]); m = Integer.parseInt(startinput[1]); values = new int[5]; evidence = new String[n][nop]; query = new String[m]; for (int i = 0; i < n; i++) { evidence[i] = in.nextLine().split(" "); } for (int i = 0; i < m; i++) { query[i] = in.nextLine(); } for (int i = 0; i < values.length; i++) { values[i] = -1; } for (int i = 0; i < n; i++) { switch (evidence[i][0].toLowerCase()) { case "b": if (evidence[i][1].toLowerCase().equals("t")){ values[0] = 1; } else { values[0] = 0; } break; case "e": if (evidence[i][1].toLowerCase().equals("t")){ values[1] = 1; } else { values[1] = 0; } break; case "a": if (evidence[i][1].toLowerCase().equals("t")){ values[2] = 1; } else { values[2] = 0; } break; case "j": if (evidence[i][1].toLowerCase().equals("t")){ values[3] = 1; } else { values[3] = 0; } break; case "m": if (evidence[i][1].toLowerCase().equals("t")){ values[4] = 1; } else { values[4] = 0; } break; default: break; } } } public static void main(String[] args) { // TODO Auto-generated method stub createTables(); if (args[0].equalsIgnoreCase("p")){ int samplesize = Integer.parseInt(args[1]); if (samplesize >= 10 && samplesize <= 50000){ readInput(); int samples[][] = generateSamples(samplesize); for (int i =0; i < m ; i++){ System.out.println(query[i] + " " + priorSampling(samples, values,getIndex(query[i]))); } }else { System.out.println("Please enter a valid selection of sample size"); } } else if(args[0].equalsIgnoreCase("r")){ int samplesize = Integer.parseInt(args[1]); if (samplesize >= 10 && samplesize <= 50000){ readInput(); int samples[][] = generateRejectionSamples(Integer.parseInt(args[1]),values); for (int i =0; i < m ; i++){ System.out.println(query[i] + " " + priorSampling(samples, values,getIndex(query[i]))); } }else { System.out.println("Please enter a valid selection of sample size"); } }else if (args[0].equalsIgnoreCase("l")){ int samplesize = Integer.parseInt(args[1]); if (samplesize >= 10 && samplesize <= 50000){ readInput(); double[] prob = new double[Integer.parseInt(args[1])]; int samples[][] = generateLikelihoodSamples(Integer.parseInt(args[1]), prob ,values); for (int i =0; i < m ; i++){ System.out.println(query[i] + " " + likelihoodSampling( samples, values,prob,getIndex(query[i]))); } }else { System.out.println("Please enter a valid selection of sample size"); } }else if (args[0].equalsIgnoreCase("e")){ if (Integer.parseInt(args[1]) == 0){ readInput(); String varss[] = { "E", "B", "A", "M", "J" }; for (int k = 0; k < evidence.length; k++) { evi.put(evidence[k][0], evidence[k][1]); } HashMap<String, ArrayList<String>> parents = createParents(); for (int i = 0; i < query.length; i++) { String que = query[i]; HashMap<String, Double> finalEnum = enumerationAsk(que, variable, evidence, parents, varss); System.out.println(query[i] + " " + finalEnum.get("t")); } }else { System.out.println("The sample size for enumeration should be 0"); } } // System.out.println("Program ends"); } }
[ "Neelam@Neelams-MacBook-Pro.local" ]
Neelam@Neelams-MacBook-Pro.local
3c9bc7a8e949bf43ce82e59b1ccf001915a38b65
3249a962fa923ff08bf93b37fe972f218d8fe4d5
/src/main/java/com/burning8393/template/biz/controller/UserController.java
6ef8a8160e161eb7596c64f81ccb3e68f7aaa123
[ "Apache-2.0" ]
permissive
BurnJinji/SpringBootTemplate
a0de2c874addc420ce4ee1e77cbe4bfe83cd13a6
6e2badf98d1fa7a84a7d9041f136647f1dcacef6
refs/heads/master
2020-04-24T03:53:49.483708
2019-03-02T02:43:53
2019-03-02T02:43:53
171,685,048
0
0
null
null
null
null
UTF-8
Java
false
false
1,405
java
package com.burning8393.template.biz.controller; import com.burning8393.template.biz.entity.User; import com.burning8393.template.biz.service.UserService; import com.burning8393.template.common.utils.ResultHelper; import com.burning8393.template.model.ResultWrapper; import com.burning8393.template.model.query.UserQuery; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * @author Pang Xiaowei * @title: UserController * @projectName template * @description: TODO * @date 2019-02-2223:02 */ @RequestMapping("user") @RestController public class UserController { @Autowired UserService userService; @GetMapping("/page/{current}/{size}") public ResultWrapper fetchAllUsers(@PathVariable("current") int current, @PathVariable("size") int size) { return ResultHelper.success(userService.fetchPageUsers(current, size)); } @GetMapping("/get/{id}") public ResultWrapper<User> fetchOne(@PathVariable("id") Long id) { return ResultHelper.success(userService.fetchOne(id)); } @PostMapping("/one") public ResultWrapper<Integer> insert(UserQuery query) { return ResultHelper.success(userService.insert(query)); } @PutMapping("/one") public ResultWrapper<Integer> update(UserQuery query) { return ResultHelper.success(userService.update(query)); } }
[ "pang798763716@outlook.com" ]
pang798763716@outlook.com
348d81c93ce6bc246223fa597b2e781e45c40d5a
9957e2035cd98df33fe0534894e97117b65373ca
/src/main/java/com/sofka/universidad/domain/monitoria/values/Nombre.java
ea371c543de09a72a73d85225e2572d40bbe4d60
[]
no_license
beycker111/Implementacion-ddd-cuarta-pauta
c9aab38f686ff34791a28fefd9bad66d83c61ed0
2bff2ee7eefa209832aeddffa85e0e65d0404527
refs/heads/master
2023-08-06T08:19:00.314587
2021-09-29T01:21:29
2021-09-29T01:21:29
411,108,110
1
1
null
null
null
null
UTF-8
Java
false
false
389
java
package com.sofka.universidad.domain.monitoria.values; import co.com.sofka.domain.generic.ValueObject; import java.util.Objects; public class Nombre implements ValueObject<String> { private final String nombre; public Nombre(String nombre) { this.nombre = Objects.requireNonNull(nombre); } @Override public String value() { return nombre; } }
[ "beycker_111@hotmail.com" ]
beycker_111@hotmail.com
24215d76522a58efac2ca21b576843cd3fa1d5b3
4bdc2db9778a62009326a7ed1bed2729c8ff56a9
/kernel/impl/fabric3-fabric/src/main/java/org/fabric3/fabric/deployment/command/UnProvisionExtensionsCommand.java
5d2538287543fe4fe6fb4c541918d60963f88892
[]
no_license
aaronanderson/fabric3-core
2a66038338ac3bb8ba1ae6291f39949cb93412b2
44773a3e636fcfdcd6dcd43b7fb5b442310abae5
refs/heads/master
2021-01-16T21:56:29.067390
2014-01-09T15:44:09
2014-01-14T06:26:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,171
java
/* * Fabric3 * Copyright (c) 2009-2013 Metaform Systems * * Fabric3 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version, with the * following exception: * * Linking this software statically or dynamically with other * modules is making a combined work based on this software. * Thus, the terms and conditions of the GNU General Public * License cover the whole combination. * * As a special exception, the copyright holders of this software * give you permission to link this software with independent * modules to produce an executable, regardless of the license * terms of these independent modules, and to copy and distribute * the resulting executable under terms of your choice, provided * that you also meet, for each linked independent module, the * terms and conditions of the license of that module. An * independent module is a module which is not derived from or * based on this software. If you modify this software, you may * extend this exception to your version of the software, but * you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * * Fabric3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the * GNU General Public License along with Fabric3. * If not, see <http://www.gnu.org/licenses/>. */ package org.fabric3.fabric.deployment.command; /** * Command to unprovision a set of extensions. */ public class UnProvisionExtensionsCommand extends AbstractExtensionsCommand { private static final long serialVersionUID = -1996037945082492244L; public ProvisionExtensionsCommand getCompensatingCommand() { ProvisionExtensionsCommand compensating = new ProvisionExtensionsCommand(); compensating.extensionUris = this.extensionUris; return compensating; } }
[ "jim.marino@gmail.com" ]
jim.marino@gmail.com
e109afe4aff8817133fd18379a67bea1e919839b
b331293683fa4aa01b3ef0a1dbedde6543385207
/src/utilities/logging/QuiteLogger.java
e15c55974bf5c018273733bdeb5373f962fd7259
[]
no_license
Ormly/AntCraft
30da5af18d68f635f3f7b80b5f6282119c6bebf1
28df02a8acf6dc3435d228ef3f4e1409f38a36a3
refs/heads/master
2020-05-09T17:04:25.911941
2019-06-27T15:44:34
2019-06-27T15:44:34
181,294,369
0
1
null
null
null
null
UTF-8
Java
false
false
167
java
package utilities.logging; public class QuiteLogger extends Logger { @Override protected void log(String msg) { // do nothing.. quietly.. } }
[ "chen902@gmail.com" ]
chen902@gmail.com
9f4f5c8193da7ce91253471925e43e6fda533e26
0bd26479c47e6b7522b829e6c27c005039fe6609
/core/src/me/vitoremanoel/vikingsinvader/entity/entitys/Entity.java
dcf773d5512f9ced991fb77110bcf74914a730f9
[]
no_license
VitorEmanoel/VikingsInvader
66b52c28963e6b05029ea35e6b995a02cc85adff
0d773f33abd690aeee4594dbc9fae78640112926
refs/heads/master
2020-04-09T11:20:42.272999
2018-12-20T11:59:53
2018-12-20T11:59:53
160,306,586
2
2
null
null
null
null
UTF-8
Java
false
false
2,967
java
package me.vitoremanoel.vikingsinvader.entity.entitys; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import me.vitoremanoel.vikingsinvader.animation.animations.AbstractAnimation; import me.vitoremanoel.vikingsinvader.location.Direction; import me.vitoremanoel.vikingsinvader.location.Location; import me.vitoremanoel.vikingsinvader.location.Size; public abstract class Entity { protected Location location; protected AbstractAnimation animation; private boolean hide; protected Size size; private boolean paused; protected float stateTime; public Entity(Size size){ this.location = new Location(0, 0); this.stateTime = 0f; this.size = size; } public void stopAnimation(){ this.stateTime = 0f; this.animation = null; } public void playAnimation(AbstractAnimation animation){ this.stateTime = 0f; this.animation = animation; } public void playAnimation(AbstractAnimation animation, Animation.PlayMode playMode){ animation.getAnimation().setPlayMode(playMode); this.playAnimation(animation); } public Size getSize() { return size; } public boolean inAnimation(){ return (this.animation != null); } public boolean inAnimation(AbstractAnimation animation){ return (this.animation == animation && !this.animation.getAnimation().isAnimationFinished(this.stateTime)); } public void pauseAnimation(){ this.paused = true; } public boolean isPaused(){ return this.paused; } public void resumeAnimation(){ this.paused = false; } public float getStateTime(){ return this.stateTime; } public AbstractAnimation getAnimation(){ return this.animation; } public Location getLocation(){ return this.location; } public void hide(){ this.hide = true; } public void show(){ this.hide = false; } public boolean isHide(){ return this.hide; } public void render(SpriteBatch batch){ if(this.hide) return; if(!this.inAnimation()) return; if(!paused) this.stateTime += Gdx.graphics.getDeltaTime(); Sprite spriteFrame = new Sprite(this.animation.getAnimation().getKeyFrame(this.stateTime)); if(this.location.getDirection() == Direction.LEFT){ spriteFrame.flip(true, false); this.getLocation().setX(this.getLocation().getX() - this.size.getHeight()/2); } spriteFrame.setRotation(this.getLocation().getRotation()); spriteFrame.setPosition(this.location.getX() - (this.size.getWidth() + this.size.getWidth()/2), this.location.getY() - (this.size.getHeight() + this.size.getHeight()/2)); spriteFrame.draw(batch); } }
[ "vitore88@gmail.com" ]
vitore88@gmail.com
0e0367d274bce6b9fccfcf5a7f68c1171bea4da2
73e21b027017c68cf88a3092d090787600834583
/sample-videochat-webrtc/src/main/java/com/VideoCalling/sample/groupchatwebrtc/activities/SignIn.java
b595bbb8c2735f2b9b79d321cfec335da53701bb
[ "BSD-2-Clause" ]
permissive
sadeghhidden/BTT_Lawyer2017
8a6fa70134150f43a7737d0f24cfdc6b0ee3a034
1304814069b8e007f276d5c4aaa1da17ab50165f
refs/heads/master
2020-05-01T19:36:31.404117
2017-02-24T09:32:23
2017-02-24T09:32:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,111
java
package com.VideoCalling.sample.groupchatwebrtc.activities; import android.content.Intent; import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.Button; import com.VideoCalling.sample.groupchatwebrtc.R; public class SignIn extends AppCompatActivity { Toolbar toolbar; Button login; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sign_in); initViews(); } public void initViews() { toolbar= (Toolbar) findViewById(R.id.toolbar); toolbar.setTitle("Login"); toolbar.setTitleTextColor(Color.parseColor("#ffffff")); /* login= (Button) findViewById(R.id.signin); login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(SignIn.this,OpponentsActivity.class)); } });*/ } }
[ "Iprotechs2017@gmail.com" ]
Iprotechs2017@gmail.com
07d673181d6b69eb7ab36ff6fe683e2abb00ea9c
47210e31e6d399fe4153631014d220d6ef5db6af
/plat-sponge/src/main/java/com/treyzania/mc/zaniportals/ZaniPortalsSpongeConfig.java
842e21a95f4b2196df1197a0881af47a470f4083
[ "MIT" ]
permissive
treyzania/ZaniPortals
5b1f8e566dd20a5f3aaa72c00fb702003f4bb5a0
526e861e1ee8d0158bd6ce5f9a3d1c6c725a1b4e
refs/heads/master
2021-01-17T11:47:44.003397
2018-01-02T04:51:51
2018-01-02T04:51:51
60,110,265
0
0
null
null
null
null
UTF-8
Java
false
false
1,933
java
package com.treyzania.mc.zaniportals; import java.util.HashMap; import java.util.Map; import org.spongepowered.api.GameRegistry; import org.spongepowered.api.block.BlockType; import org.spongepowered.api.item.ItemType; import com.treyzania.mc.zaniportals.adapters.PortalConfig; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ZaniPortalsSpongeConfig implements PortalConfig { @Setting(value = "portal.frameIds") private int[] frameIds = { 49, 112 }; @Setting(value = "portal.signBlockIds", comment = "The IDs allowed for the block that the sign goes on.") private int[] signBlockIds = { 49 }; @Setting(value = "portal.maxSize") private int maxSize = 50; @Setting(value = "idmap.blocks") private Map<Integer, String> blockIds; @Setting(value = "idmap.items") private Map<Integer, String> itemIds; private transient GameRegistry gameReg; protected void setGR(GameRegistry gr) { this.gameReg = gr; } @Override public int[] getFrameBlockIds() { return this.frameIds; } @Override public int getPortalBlockId() { return IDMap.STILL_WATER_ID; } @Override public int getMaxPortalSize() { return this.maxSize; } @Override public boolean isBlockImportant(int id) { // TODO Auto-generated method stub return false; } public Map<Integer, BlockType> getBlockMap() { Map<Integer, BlockType> m = new HashMap<>(); for (Map.Entry<Integer, String> e : this.blockIds.entrySet()) { m.put(e.getKey(), this.gameReg.getType(BlockType.class, e.getValue()).get()); } return m; } public Map<Integer, ItemType> getItemMap() { Map<Integer, ItemType> m = new HashMap<>(); for (Map.Entry<Integer, String> e : this.blockIds.entrySet()) { m.put(e.getKey(), this.gameReg.getType(ItemType.class, e.getValue()).get()); } return m; } }
[ "treyzania@gmail.com" ]
treyzania@gmail.com
b3c0e2e71fe08e377abf3030962ebecb19f321d5
f14bbbcc885e847a5a41d4fbee71e797d71bbef3
/src/main/java/gov/nih/ncgc/openhts/tool1/actions/PointsetRemoveAction.java
998722c6c1879bbea10c05368fd41c9c7319116a
[]
no_license
jtalics/PCSpace
b549d03cfc0ab90998ca01bc9c39a5abcf2d662f
c58599592c66115d244553b5971e62e6b373a8e4
refs/heads/master
2023-06-26T18:11:00.404525
2023-06-18T16:03:33
2023-06-18T16:03:33
28,522,385
0
0
null
null
null
null
UTF-8
Java
false
false
1,544
java
package gov.nih.ncgc.openhts.tool1.actions; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import javax.swing.Action; import gov.nih.ncgc.openhts.tool1.Session; import gov.nih.ncgc.openhts.tool1.pointsetManager.Pointset; import gov.nih.ncgc.openhts.tool1.pointsetManager.PointsetManager; import gov.nih.ncgc.openhts.tool1.pointsetManager.PointsetSelectorDialog; public class PointsetRemoveAction extends Tool1Action { private final Session session; public PointsetRemoveAction(final Session session) { this.session = session; putValue(Action.NAME, "Remove"); putValue(Action.MNEMONIC_KEY, KeyEvent.VK_D); putValue(Action.ACTION_COMMAND_KEY, "Remove"); putValue(SHORT_DESCRIPTION, "remove a data source from memory"); setEnabled(true); } @Override public void actionPerformed(final ActionEvent e) { session.statusPanel.log2((String) getValue(Action.NAME)); try { final Pointset pointset = session.pointsetManager.getSelectedPointset(); if (pointset == null) { final PointsetSelectorDialog pointsetSelectorDialog = session.dialogManager .getPointsetChooseDialog(PointsetManager.DELETE); pointsetSelectorDialog.showDialog(); return; } session.pointsetManager.unregisterPointset(pointset); } catch (final Throwable ex) { session.errorSupport("Cannot remove because:\n", ex, "delete_data_menu_error"); } finally { // nop } } private static final long serialVersionUID = 1L; }
[ "jtalics@gmail.com" ]
jtalics@gmail.com
e9252ca261e6ba35f0aef5541bf882b8a80dbedb
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a016/A016820Test.java
8501f9aecb6af2e4a0c40f79ef934cfd20cf9f79
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a016; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A016820Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
efe67fba4efa1e4c27640ceb6e6305264a089f7c
a05e1a01a49a59129cdd71c1fe843c910a35ed8c
/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/transform/ListIdentitiesResultJsonUnmarshaller.java
806711da28039646d37d9d66056ef4ca1544d3bc
[ "Apache-2.0", "JSON" ]
permissive
lenadkn/java-sdk-test-2
cd36997e44cd3926831218b2da7c71deda8c2b26
28375541f8a4ae27417419772190a8de2b68fc32
refs/heads/master
2021-01-20T20:36:53.719764
2014-12-19T00:38:57
2014-12-19T00:38:57
65,262,893
1
0
null
null
null
null
UTF-8
Java
false
false
3,241
java
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.cognitoidentity.model.transform; import java.util.Map; import java.util.Map.Entry; import com.amazonaws.services.cognitoidentity.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * List Identities Result JSON Unmarshaller */ public class ListIdentitiesResultJsonUnmarshaller implements Unmarshaller<ListIdentitiesResult, JsonUnmarshallerContext> { public ListIdentitiesResult unmarshall(JsonUnmarshallerContext context) throws Exception { ListIdentitiesResult listIdentitiesResult = new ListIdentitiesResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) return null; while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("IdentityPoolId", targetDepth)) { context.nextToken(); listIdentitiesResult.setIdentityPoolId(StringJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("Identities", targetDepth)) { context.nextToken(); listIdentitiesResult.setIdentities(new ListUnmarshaller<IdentityDescription>(IdentityDescriptionJsonUnmarshaller.getInstance()).unmarshall(context)); } if (context.testExpression("NextToken", targetDepth)) { context.nextToken(); listIdentitiesResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return listIdentitiesResult; } private static ListIdentitiesResultJsonUnmarshaller instance; public static ListIdentitiesResultJsonUnmarshaller getInstance() { if (instance == null) instance = new ListIdentitiesResultJsonUnmarshaller(); return instance; } }
[ "aws@amazon.com" ]
aws@amazon.com
1aa63e91c33eadec2c6e323126fb19b8ecb99301
137fedbbc8bbfbb25d0f51f07e8593adcd1d6be2
/baihewan/src/com/morln/app/lbstask/bbs/cache/CollectBoardSource.java
d3f034b6d3354ebdb63366a0ae8c825fb487cbbb
[]
no_license
zhaozw/baihewan_android
6e3837ec1111e06529029842d8e8399ae2e217ba
7a4f5f4e6501f0295547fc5407bbb39adebc0561
refs/heads/master
2020-12-25T08:37:22.700838
2013-06-25T13:11:11
2013-06-25T13:11:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
953
java
package com.morln.app.lbstask.bbs.cache; import com.morln.app.lbstask.bbs.db.CollectedBoardTable; import com.morln.app.lbstask.bbs.model.CollectedBoard; import com.morln.app.lbstask.cache.SourceName; import com.xengine.android.data.cache.XBaseAdapterIdUsernameDBDataSource; import com.xengine.android.data.db.XDBTable; /** * 订阅版面的数据源。 * Created by jasontujun. * Date: 12-3-4 * Time: 上午1:18 */ public class CollectBoardSource extends XBaseAdapterIdUsernameDBDataSource<CollectedBoard> { @Override public String getId(CollectedBoard item) { return item.getBoardId(); } @Override public String getSourceName() { return SourceName.BBS_COLLECTION_BOARD; } @Override public XDBTable<CollectedBoard> getDatabaseTable() { return new CollectedBoardTable(); } @Override public String getUsername(CollectedBoard item) { return item.getUserName(); } }
[ "jasontujun@163.com" ]
jasontujun@163.com
ac89176d2bb3983a6fa831455fb1ff8837ac86cb
5874dfa55041e6079c4a60686d444260dc4ced4c
/app/src/main/java/co/herovitamin/doctorsapp/splash/SplashPresenter.java
387225c4ec0a4ee8c350dd67b6cac6f2a586daea
[]
no_license
kerpie/DoctorsApp
4e68e8914514306cd6a7d597960f37ef1df244c8
b19c15099263c31791b8bc0b2aa2494528a9171e
refs/heads/master
2021-01-21T23:24:00.259888
2017-06-26T01:32:22
2017-06-26T01:32:22
95,242,676
0
0
null
null
null
null
UTF-8
Java
false
false
1,051
java
package co.herovitamin.doctorsapp.splash; import android.content.Intent; import android.os.Handler; import android.os.SystemClock; import android.support.v7.app.AppCompatActivity; import co.herovitamin.doctorsapp.MainActivity; /** * Created by kerry on 22/06/17. */ class SplashPresenter implements SplashContract.Presenter { private SplashContract.View mView; SplashPresenter(SplashContract.View mView) { this.mView = mView; } @Override public void start() { mView.showLoader(); // simulate loading of data new Handler().postDelayed(new Runnable() { @Override public void run() { showMainScreen(); } }, 3000); } @Override public void showMainScreen() { mView.hideLoader(); Intent intent = new Intent((AppCompatActivity)mView, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); mView.changeToMainScreen(intent); } }
[ "k4torce@gmail.com" ]
k4torce@gmail.com
f3bf209f1ccb6184d675f00f117478557faba21c
b439339c951bcb35f314c05295cf7850ad2a753b
/dlfc-contract-datacenter/src/main/java/com/dlfc/contract/mapper/ConHouseUserLogMapper.java
8d339e571affdc7a477f2f7a333f3a9ec95ac276
[]
no_license
iversonwuwei/zfgj-wechat-datacenter
1096f0aee5e55c34cb231fbe5e9c8bd6c5a545bf
a2e325043bf6f80ffd5fe11d5172b7759831aad5
refs/heads/master
2021-01-25T09:31:47.912861
2017-06-09T05:28:22
2017-06-09T05:28:22
93,844,847
0
0
null
null
null
null
UTF-8
Java
false
false
243
java
package com.dlfc.contract.mapper; import com.dlfc.contract.entity.ConHouseUserLog; import com.dlfc.contract.entity.ConHouseUserLogExample; public interface ConHouseUserLogMapper extends DataMapper<ConHouseUserLog, ConHouseUserLogExample> { }
[ "123456789" ]
123456789
20ee6fb4cb5d1bc28f010fb94e8d8e45b014352c
62807cd093646d9705e9c2f956069a8974ffdb03
/frame/src/main/java/com/example/frame/LoadTypeConfig.java
9e7f0470a44bf6b85be5c9cf5139e250445a2509
[]
no_license
zhilong-zl/ShiXun
1583524d6cf9c91ccdcd1bc97cabf61b4bec9c57
f83d33e02dcd6a7f6879717531f7d44854ecd1fc
refs/heads/master
2022-08-28T14:13:36.622532
2020-05-28T23:17:52
2020-05-28T23:17:52
267,717,361
0
0
null
null
null
null
UTF-8
Java
false
false
185
java
package com.example.frame; public class LoadTypeConfig { public static final int NORMAL = 100; public static final int REFRESH = 100; public static final int MORE = 100; }
[ "2477961186@qq.com" ]
2477961186@qq.com
0a1daa8c42e4a7a2321e1cbffdbfdd30c21010ee
0e7f1099cd245eef3d697398626ee44580a400c9
/bwTracker/src/ac/aiit/bwcam/bwtracker/data/impl/BWRawStatsBase.java
33d7dd7ae45d83304b3f6f99082a8f1d6c1cba0d
[]
no_license
aksgaiit/bwtrackr
f8e41455970029fb8556d9c4784b6f9a339cfb04
96e2abcbeea922576f0dd44750ea8f81f187bef0
refs/heads/master
2016-09-05T13:53:53.446388
2014-03-12T17:48:46
2014-03-12T17:48:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
446
java
package ac.aiit.bwcam.bwtracker.data.impl; import ac.aiit.bwcam.bwtracker.data.IBWRawStats; public class BWRawStatsBase extends ByMillisecStatsBase implements IBWRawStats { protected Long _value = null; protected BWRawStatsBase() { super(); } public BWRawStatsBase(IBWRawStats other){ super(other); this._value = Long.valueOf(other.getValue()); } @Override public long getValue() { return this._value; } }
[ "b1218ak@aiit.ac.jp" ]
b1218ak@aiit.ac.jp
d9429ff0cd9e6db5ed33b5b46d817b9eee0c58f8
877b41beb76cc3f2281e48cfebb90493f6c99bc4
/UserCode/Factory/ComponentFactory.java
b11df00a0c17792f78f3a73e51986a1b6997b917
[]
no_license
chrismwilliams/aquarium-sim
9c056f6341fdfaaed3b26634477278c322d330dc
207d9e98430b8cd86c23be17aa88372e03e8195d
refs/heads/master
2022-06-10T06:11:23.855693
2018-10-04T14:13:05
2018-10-04T14:13:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,935
java
package UserCode.Factory; import UserCode.Components.*; import UserCode.Behaviours.IObserver; import UserCode.Behaviours.IObservable; import UserCode.Misc.Screen; import java.util.List; import java.util.ArrayList; /** * ComponentFactory defines the behaviour of the concrete implementation of the IComponentFactory interface. This factory * creates and returns IComponents based on the String value passed to the method getComponent. * * @author Chris Williams * @version 3.0 */ public class ComponentFactory implements IComponentFactory { // DECLARE an instance of the IObserver class that so that it can watch new RequestBubble IComponents, call it '_bubbleObserver private IObserver _bubbleObserver; // DECLARE a double to store the aquarium's minimum x value, call it '_screenMinX': private double _screenMinX; // DECLARE a double to store the aquarium's maximum x value, call it '_screenMaxX': private double _screenMaxX; // DECLARE a double to store the aquarium's minimum y value, call it '_screenMinY': private double _screenMinY; // DECLARE a double to store the aquarium's maximum y value, call it '_screenMaxY': private double _screenMaxY; /** * @Deprecated * Constructor for objects of class ComponentFactory, used only for testing * */ @Deprecated public ComponentFactory() { // USED for testing only: // INITIALISE the _screenMinX field with the value returned from calling Screen.MIN_X.getValue(): _screenMinX = Screen.MIN_X.getValue(); // INITIALISE the _screenMaxX field with the value returned from calling Screen.MAX_X.getValue() _screenMaxX = Screen.MAX_X.getValue(); // INITIALISE the _screenMinY field by calling Screen.MIN_Y.getValue(): _screenMinY = Screen.MIN_Y.getValue(); // INITIALISE the _screenMaxY field by calling Screen.MAX_X.getValue(): _screenMaxY = Screen.MAX_Y.getValue(); } /** * Constructor for objects of class ComponentFactory * * @param bubbleRequestObserver the IObserver class which all IObservable RequestBubble classes will notify when a bubble * has been requested * */ public ComponentFactory(IObserver bubbleRequestObserver) { // INITIALISE the _bubbleObserver field with the param passed: _bubbleObserver = bubbleRequestObserver; // INITIALISE the _screenMinX field with the value returned from calling Screen.MIN_X.getValue(): _screenMinX = Screen.MIN_X.getValue(); // INITIALISE the _screenMaxX field with the value returned from calling Screen.MAX_X.getValue() _screenMaxX = Screen.MAX_X.getValue(); // INITIALISE the _screenMinY field by calling Screen.MIN_Y.getValue(): _screenMinY = Screen.MIN_Y.getValue(); // INITIALISE the _screenMaxY field by calling Screen.MAX_X.getValue(): _screenMaxY = Screen.MAX_Y.getValue(); } /** * * METHOD: used to create the IComponents based on the String value passed. All instances of RequestBubble IComponents will * be attached to the IObserver _bubbleObserver field * * @param _name the name of the component required * * @return an instance of IComponent based on the param field * */ private IComponent getComponent(String _name) { // CHANGE the _name param to lower case to be used by a switch: _name = _name.toLowerCase(); // DECLARE and initialise an IComponent field to be return to the caller, call it _component: IComponent _component = null; // START a switch statement using the _name param switch(_name) { // CHECK if the _name is for the RotateObj class: case "rotateobj" : _component = new RotateObj(); break; // CHECK if the _name param is for the RequestBubble class: case "requestbubble" : _component = new RequestBubble(); _bubbleObserver.observeObj((IObservable) _component); break; // CHECK if the _name param is for the Preditor class: case "preditor" : _component = new Preditor(); break; // CHECK if the _name param is for the Prey class: case "prey" : _component = new Prey(); break; // CHECK if the _name param is for the MoveHorizontal class: case "movehorizontal" : _component = new MoveHorizontal(_screenMinX, _screenMaxX); break; // CHECK if the _name param is for the MoveVertically class: case "movevertically" : _component = new MoveVertically(); break; // CHECK if the _name param is for the MoveDiag class: case "movediag" : _component = new MoveDiag(_screenMinX, _screenMaxX, _screenMinY, _screenMaxY); break; // CHECK if the _name param is for the Feed class: case "feed" : _component = new Feed(); break; // CHECK if the _name param is for the FoodFall class: case "foodfall" : _component = new FoodFall(_screenMinY); break; // IF no cases are found, set _component to null: default: _component = null; } // RETURN the _component field to caller: return _component; } /** * * METHOD: used to return a List of all the components required, based on the array of Strings provided * * @param _c an array of Strings corresponding to the IComponents required * * @return List an array of all the IComponents requested * */ public List getComponent(String[] _c) { // CHECK if the array is empty first: if(_c.length == 0) { // RETURN null: return null; } // DECLARE and initialise a new list to return to the caller, call it 'components': List<IComponent> _components = new ArrayList<IComponent>(); // LOOP through the String array _c and add all components to the List _components: for (String c : _c) { // ASSIGN an IComponent field and call the getComponent method with the Strings provided: IComponent component = getComponent(c); // ADD the returned IComponent to the _component List: _components.add(component); } // RETURN the _components array to the caller: return _components; } }
[ "christophw+github@protonmail.com" ]
christophw+github@protonmail.com
893406d2b8c487fd8d02e2e6cac3944069da19bf
c62462f6f957d2316b09b845880810c52e01bf82
/Week_05/springhomework5/src/main/java/com/zhanghongyu/autowire/KlassC.java
a3ea7ca679e34ef8c2da3d9fdc3726e6f23aba4b
[]
no_license
henrysworld/JAVA-xxxx
bdaccd11f1f3527a8b7f66f41327820a3a2ff1a9
fa1920d50caac4b2d776cf5f318b2ce46169b039
refs/heads/main
2023-01-30T05:25:11.115225
2020-12-16T15:44:31
2020-12-16T15:44:31
394,947,456
1
0
null
null
null
null
UTF-8
Java
false
false
739
java
package com.zhanghongyu.autowire; import org.springframework.beans.factory.annotation.Autowired; public class KlassC { // 直接用Autowired也可以实现AttributeA自动装载 // @Autowired public AttributeA attributeA; public AttributeA getAttributeA() { return attributeA; } public void setAttributeA(AttributeA attributeA) { this.attributeA = attributeA; } //根据constructor自总装载测试用 public AttributeB attributeB1; public String hello() { return "hello zhanghongyu this is autowire class"; } public KlassC(){ super(); } public KlassC(AttributeB attributeB){ super(); this.attributeB1 = attributeB; } }
[ "rainsemail@126.com" ]
rainsemail@126.com
9dc485d27f6db831e168e4d12dee095fc47d6e43
fdbe5c3d25d63afeb01be07db8bf850b83415eeb
/app/src/androidTest/java/com/example/bookmanager/Week3Test.java
32315a85fc03c6f71bc7f02b592fbe27376aba67
[]
no_license
sengeiou/LibraryManager
d88ad852ecaac703d3d8d85ee7762cb7f9e3e681
bee5553fd0e4bfe7aab57ae1937faf1fe41ba8b9
refs/heads/master
2021-10-26T14:54:53.020950
2019-04-13T06:26:38
2019-04-13T06:26:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,596
java
package com.example.bookmanager; import android.support.test.rule.ActivityTestRule; import com.example.bookmanager.ui.MainActivity; import org.hamcrest.Matchers; import org.junit.Rule; import org.junit.Test; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.action.ViewActions.click; import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; import static android.support.test.espresso.action.ViewActions.typeText; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import static android.support.test.espresso.matcher.ViewMatchers.withId; import static android.support.test.espresso.matcher.ViewMatchers.withText; import static com.example.bookmanager.EspressoUtil.sleep; /** * Test for Week3 */ public class Week3Test { @Rule public ActivityTestRule<MainActivity> mMainActivityActivityTestRule = new ActivityTestRule<>(MainActivity.class); /** * Login admin */ @Test public void adminLogin() { sleep(500L); onView(Matchers.allOf(withId(R.id.admin), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.nick), isDisplayed())).perform(typeText("admin1"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.pwd), isDisplayed())).perform(typeText("admin1"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.login), isDisplayed())).perform(click()); sleep(6000L); } /** * Login user */ @Test public void userLogin() { sleep(500L); onView(Matchers.allOf(withId(R.id.normal), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.nick), isDisplayed())).perform(typeText("666666"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.pwd), isDisplayed())).perform(typeText("999999"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.login), isDisplayed())).perform(click()); sleep(6000L); } /** * Test change password */ @Test public void userChangePassword(){ userLogin(); onView(Matchers.allOf(withId(R.id.cpgl), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.sname), isDisplayed())).perform(typeText("test_sname"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.old_pass), isDisplayed())).perform(typeText("test_old_pass"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.new_pass), isDisplayed())).perform(typeText("test_new_pass"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.confirm), isDisplayed())).perform(typeText("test_confirm"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.save), isDisplayed())).perform(click()); sleep(6000L); } /** * Test activity manager */ @Test public void adminActivityManager(){ adminLogin(); onView(Matchers.allOf(withId(R.id.mmm1), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.et1), isDisplayed())).perform(typeText("test_query"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.btn_search), isDisplayed())).perform(click()); sleep(2500L); onView(Matchers.allOf(withId(R.id.btn_clear), isDisplayed())).perform(click()); sleep(6000L); } /** * Test push comment */ @Test public void userPushComment(){ userLogin(); onView(Matchers.allOf(withId(R.id.mmm2), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.add), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.content), isDisplayed())).perform(typeText("test_push_comment"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.anonymous), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.save), isDisplayed())).perform(click()); sleep(6000L); } /** * Test user goto books */ @Test public void userGotoBooks() { userLogin(); onView(Matchers.allOf(withId(R.id.fcgl), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.et1), isDisplayed())).perform(typeText("test_query"), closeSoftKeyboard()); sleep(500L); onView(Matchers.allOf(withId(R.id.btn_search), isDisplayed())).perform(click()); sleep(2500L); onView(Matchers.allOf(withId(R.id.btn_clear), isDisplayed())).perform(click()); sleep(6000L); } /** * Test user goto books and filter */ @Test public void userGotoBooksAndFilter() { userLogin(); onView(Matchers.allOf(withId(R.id.fcgl), isDisplayed())).perform(click()); sleep(500L); onView(Matchers.allOf(withId(R.id.rb_1), isDisplayed())).perform(click()); sleep(1500L); onView(Matchers.allOf(withId(R.id.rb_2), isDisplayed())).perform(click()); sleep(1500L); onView(Matchers.allOf(withId(R.id.rb_3), isDisplayed())).perform(click()); sleep(6000L); } /** * Test user move back */ @Test public void userMoveBack() { userLogin(); sleep(1500L); onView(Matchers.allOf(withContentDescription("Navigate up"), isDisplayed())).perform(click()); sleep(6000L); } /** * Test admin move back */ @Test public void adminMoveBack() { adminLogin(); sleep(1500L); onView(Matchers.allOf(withContentDescription("Navigate up"), isDisplayed())).perform(click()); sleep(6000L); } }
[ "jianing2@illinois.edu" ]
jianing2@illinois.edu
a00830b2eb6f588917ca6fdf207ce49f665ef844
da0c4ab68ea6af2115acc80232ac50b3854dff26
/editor/src/main/com/mbrlabs/mundus/assets/AssetManager.java
ff696141944b110fd8b81449db874fda0c58765a
[ "Apache-2.0" ]
permissive
codenigma/Mundus
3910f88da4690fea320a56ecfec90a3046bda329
75f9caabda96ad771d1defe4f4c281070ae67aeb
refs/heads/master
2020-05-29T08:50:13.005722
2016-10-02T13:32:06
2016-10-02T13:36:12
69,009,248
0
0
null
null
null
null
UTF-8
Java
false
false
3,863
java
/* * Copyright (c) 2016. See AUTHORS file. * * 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.mbrlabs.mundus.assets; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.loader.G3dModelLoader; import com.badlogic.gdx.utils.UBJsonReader; import com.mbrlabs.mundus.commons.model.MModel; import com.mbrlabs.mundus.commons.model.MTexture; import com.mbrlabs.mundus.commons.utils.TextureUtils; import com.mbrlabs.mundus.core.project.ProjectManager; import org.apache.commons.io.FilenameUtils; /** * @author Marcus Brummer * @version 24-01-2016 */ public class AssetManager { private ProjectManager projectManager; public AssetManager(ProjectManager projectManager) { this.projectManager = projectManager; } /** * * @param importedModel * @return */ public MModel importG3dbModel(ModelImporter.ImportedModel importedModel) { long id = projectManager.current().obtainID(); String relativeImportFolder = ProjectManager.PROJECT_MODEL_DIR + id + "/"; String absoluteImportFolder = projectManager.current().path + "/" + relativeImportFolder; String g3dbFilename = importedModel.name + ".g3db"; String textureFilename = importedModel.textureFile.name(); FileHandle absoluteG3dbImportPath = Gdx.files.absolute(absoluteImportFolder + g3dbFilename); FileHandle absoluteTextureImportPath = Gdx.files.absolute(absoluteImportFolder + textureFilename); importedModel.g3dbFile.copyTo(absoluteG3dbImportPath); importedModel.textureFile.copyTo(absoluteTextureImportPath); // load model G3dModelLoader loader = new G3dModelLoader(new UBJsonReader()); Model model = loader.loadModel(absoluteG3dbImportPath); // create model MModel mModel = new MModel(); mModel.setModel(model); mModel.name = importedModel.name; mModel.id = id; mModel.g3dbPath = relativeImportFolder + g3dbFilename; mModel.texturePath = relativeImportFolder + textureFilename; projectManager.current().models.add(mModel); // save whole project projectManager.saveCurrentProject(); return mModel; } /** * * @param textureFile * @param mipMap * @return */ public MTexture importTexture(FileHandle textureFile, boolean mipMap) { long id = projectManager.current().obtainID(); String relativeImportPath = ProjectManager.PROJECT_TEXTURE_DIR + textureFile.name(); String absoluteImportPath = FilenameUtils.concat(projectManager.current().path, relativeImportPath); FileHandle absoluteImportFile = Gdx.files.absolute(absoluteImportPath); textureFile.copyTo(absoluteImportFile); MTexture tex = new MTexture(); tex.setId(id); tex.setPath(relativeImportPath); if(mipMap) { tex.texture = TextureUtils.loadMipmapTexture(absoluteImportFile, true); } else { tex.texture = new Texture(absoluteImportFile); } projectManager.current().textures.add(tex); // save whole project projectManager.saveCurrentProject(); return tex; } }
[ "mbrlabs7@gmail.com" ]
mbrlabs7@gmail.com
9517a41456a2db2439665b8b9c115990e3069223
bdacd6b950247df9910bc0dbfb547e7d3a45a313
/bank-logic/src/main/java/co/edu/usbcali/bank/repository/CuentaRepositoryImpl.java
b9a401d57edb539200f9a8a53c83c833d74f917e
[]
no_license
elkin5/spring-course-usbcali
1d51c62010f34a526503fc4b5bf957d4bf175293
30ddf1d365676ab5d2000fe77afdceea780c8379
refs/heads/master
2022-12-24T06:08:21.817040
2019-10-18T01:50:16
2019-10-18T01:50:16
212,220,869
0
0
null
2022-12-15T23:31:50
2019-10-01T23:50:34
Java
UTF-8
Java
false
false
1,051
java
package co.edu.usbcali.bank.repository; import java.util.List; import java.util.Optional; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Repository; import co.edu.usbcali.bank.domain.Cuenta; @Repository @Scope("singleton") public class CuentaRepositoryImpl implements CuentaRepository { @PersistenceContext EntityManager entityManager; @Override public Cuenta save(Cuenta entity) { entityManager.persist(entity); return entity; } @Override public Optional<Cuenta> findById(String id) { Cuenta cuenta = entityManager.find(Cuenta.class, id); return Optional.ofNullable(cuenta); } @Override public List<Cuenta> findAll() { return entityManager.createQuery("FROM cuenta", Cuenta.class).getResultList(); } @Override public void delete(Cuenta entity) { entityManager.remove(entity); } @Override public void deleteById(String id) { findById(id).ifPresent(entity -> delete(entity)); } }
[ "salas@usbcali.edu.co" ]
salas@usbcali.edu.co
fd7f6f718fffd552a2e9c8183954f1c8452ebff8
5da62636aece63240e70f9ba1d1529c79463b035
/server-security-oauth2/src/main/java/com/it/cast/aouthConfig/request/AuthFacebookRequest.java
4f8b841a95c1043ab8bf268dbd78a4ffc947fccb
[]
no_license
wzlitcast/git_springCloud
0e29dbc113465fc56c3503b54733944b9fa6943d
c127385b1818b2a23ba610832e598050a5661e90
refs/heads/master
2022-12-24T07:16:33.544823
2019-09-23T02:41:48
2019-09-23T02:41:48
210,234,666
2
3
null
2022-12-15T23:24:26
2019-09-23T00:43:09
Java
UTF-8
Java
false
false
3,133
java
package com.it.cast.aouthConfig.request; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSONObject; import com.it.cast.aouthConfig.config.AuthConfig; import com.it.cast.aouthConfig.config.AuthSource; import com.it.cast.aouthConfig.exception.AuthException; import com.it.cast.aouthConfig.model.AuthToken; import com.it.cast.aouthConfig.model.AuthUser; import com.it.cast.aouthConfig.model.AuthUserGender; import com.it.cast.aouthConfig.utils.UrlBuilder; /** * Facebook登录 * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @since 1.8 */ public class AuthFacebookRequest extends BaseAuthRequest { public AuthFacebookRequest(AuthConfig config) { super(config, AuthSource.FACEBOOK); } @Override protected AuthToken getAccessToken(String code) { String accessTokenUrl = UrlBuilder.getFacebookAccessTokenUrl(config.getClientId(), config.getClientSecret(), code, config .getRedirectUri()); HttpResponse response = HttpRequest.post(accessTokenUrl).execute(); JSONObject object = JSONObject.parseObject(response.body()); if (object.containsKey("error")) { throw new AuthException(object.getJSONObject("error").getString("message")); } return AuthToken.builder() .accessToken(object.getString("access_token")) .expireIn(object.getIntValue("expires_in")) .tokenType(object.getString("token_type")) .build(); } @Override protected AuthUser getUserInfo(AuthToken authToken) { String accessToken = authToken.getAccessToken(); HttpResponse response = HttpRequest.get(UrlBuilder.getFacebookUserInfoUrl(accessToken)).execute(); String userInfo = response.body(); JSONObject object = JSONObject.parseObject(userInfo); if (object.containsKey("error")) { throw new AuthException(object.getJSONObject("error").getString("message")); } String picture = null; if (object.containsKey("picture")) { JSONObject pictureObj = object.getJSONObject("picture"); pictureObj = pictureObj.getJSONObject("data"); if (null != pictureObj) { picture = pictureObj.getString("url"); } } return AuthUser.builder() .uuid(object.getString("id")) .username(object.getString("name")) .nickname(object.getString("name")) .avatar(picture) .location(object.getString("locale")) .email(object.getString("email")) .gender(AuthUserGender.getRealGender(object.getString("gender"))) .token(authToken) .source(AuthSource.FACEBOOK) .build(); } /** * 返回认证url,可自行跳转页面 * * @return 返回授权地址 */ @Override public String authorize() { return UrlBuilder.getFacebookAuthorizeUrl(config.getClientId(), config.getRedirectUri()); } }
[ "wzlitcast@163.com" ]
wzlitcast@163.com
39275c967cc85013c8707ef1a2b3d0b6d155b84d
8644599129302ae7dc3e56fae2e1c9f655266957
/MiniStatement.java
0d2e9546c2ff70547bba26d22864d3763ce1001e
[]
no_license
Prapti98/ATMSimulatorSystem
28e18d166cf0760bad4450c9cfdc0bbc62c5b240
ca36399e6fc496cfedcc6ed7ef901db43ede4ece
refs/heads/main
2023-07-15T16:31:33.860061
2021-08-25T04:22:17
2021-08-25T04:22:17
399,685,441
0
0
null
null
null
null
UTF-8
Java
false
false
2,916
java
import javax.swing.*; import javax.swing.border.LineBorder; import com.mysql.jdbc.Connection; import com.mysql.jdbc.PreparedStatement; import com.mysql.jdbc.Statement; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.DriverManager; import java.sql.ResultSet; import java.text.SimpleDateFormat; import java.util.Calendar; public class MiniStatement { JFrame ministatement=new JFrame("MINI STATEMENT"); String date; String time; int cardno; String SPIN; public MiniStatement(){ ministatement.setVisible(true); ministatement.setLocation(300,150); ministatement.setSize(450,450); ministatement.setLayout(new FlowLayout()); ministatement.setDefaultCloseOperation(3); JPanel panel =new JPanel(new FlowLayout()); panel.setPreferredSize(new Dimension(450,450)); panel.setBackground(Color.darkGray); LineBorder border=new LineBorder(Color.cyan,8); panel.setBorder(border); ministatement.add(panel); JButton exit=new JButton("EXIT"); exit.setPreferredSize(new Dimension(100,40)); panel.add(exit); try{ this.date=new SimpleDateFormat("yyyy:MM:dd").format(Calendar.getInstance().getTime()); System.out.println(date); this.time=new SimpleDateFormat("HH:mm").format(Calendar.getInstance().getTime()); System.out.println(time); Class.forName("com.mysql.jdbc.Driver"); Connection con=(Connection) DriverManager.getConnection("jdbc:mysql://localhost/ATMProject","root","prapti2323"); String sql="Select * from Login"; Statement smt=(Statement) con.createStatement(); ResultSet rs=smt.executeQuery(sql); while(rs.next()){ this.cardno=rs.getInt("Card_No"); this.SPIN=rs.getString("Password"); } Deposit d=new Deposit(); Withdrawal w=new Withdrawal(); PreparedStatement psmt=(PreparedStatement) con.prepareStatement("insert into MiniState(CardNo,Withdraw,Deposite,Time,Date) values(?,?,?,?,?)"); System.out.println("Deposit"+d.amount); System.out.println("withdraw"+d.amount); System.out.println("CardNo"+cardno); System.out.println("Time"+time); System.out.println("Date"+date); psmt.setInt(1,cardno); psmt.setInt(2,w.amount); psmt.setInt(3,d.amount); psmt.setString(4,time); psmt.setString(5,date); int i=psmt.executeUpdate(); }catch(Exception e){ } exit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { ministatement.dispose(); } }); } public static void main(String[] args) { new MiniStatement(); } }
[ "prapti.punt@gmail.com" ]
prapti.punt@gmail.com
899ed69b222aff61911cb600d7f598c1b527024b
fa32414cd8cb03a7dc3ef7d85242ee7914a2f45f
/app/src/main/java/com/google/android/gms/tagmanager/zzk.java
2bd7528eb68d905a5d7bf685f063aa951658214d
[]
no_license
SeniorZhai/Mob
75c594488c4ce815a1f432eb4deacb8e6f697afe
cac498f0b95d7ec6b8da1275b49728578b64ef01
refs/heads/master
2016-08-12T12:49:57.527237
2016-03-10T06:57:09
2016-03-10T06:57:09
53,562,752
4
2
null
null
null
null
UTF-8
Java
false
false
1,291
java
package com.google.android.gms.tagmanager; import com.helpshift.res.values.HSConsts; import io.fabric.sdk.android.services.settings.SettingsJsonConstants; class zzk { public static byte[] zzee(String str) { int length = str.length(); if (length % 2 != 0) { throw new IllegalArgumentException("purported base16 string has odd number of characters"); } byte[] bArr = new byte[(length / 2)]; for (int i = 0; i < length; i += 2) { int digit = Character.digit(str.charAt(i), 16); int digit2 = Character.digit(str.charAt(i + 1), 16); if (digit == -1 || digit2 == -1) { throw new IllegalArgumentException("purported base16 string has illegal char"); } bArr[i / 2] = (byte) ((digit << 4) + digit2); } return bArr; } public static String zzi(byte[] bArr) { StringBuilder stringBuilder = new StringBuilder(); for (byte b : bArr) { if ((b & 240) == 0) { stringBuilder.append(HSConsts.STATUS_NEW); } stringBuilder.append(Integer.toHexString(b & SettingsJsonConstants.SETTINGS_IDENTIFIER_MASK_DEFAULT)); } return stringBuilder.toString().toUpperCase(); } }
[ "370985116@qq.com" ]
370985116@qq.com
bfeb49fce79328be97c25b34f9958728dd93ebe7
7f7a6333fd7e6a8e9208ea5d83275bce5aa512a2
/src/test/java/com/example/springbootelasticsearch/SpringbootElasticsearchApplicationTests.java
672f5b9d110352df37f0185a74a4da08805bdd4f
[]
no_license
1165701441/SpringbootElasticsearch
718eb0a5b9fc54cf0990476b3b1ea88ad9604a9d
f1dd21fe346ea3966b634432ae6d78f59f23954d
refs/heads/master
2023-04-09T05:31:49.208970
2021-04-06T09:49:01
2021-04-06T09:49:01
355,134,373
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package com.example.springbootelasticsearch; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SpringbootElasticsearchApplicationTests { @Test void contextLoads() { } }
[ "bukas@gmail.com" ]
bukas@gmail.com
e9273fd7628e6d3358d38c08a002b2b77d692a3a
7dc9bbf4ce56b265319a23eb7d10fc3191ca879d
/JavaSource/com/amandris/clients/web/action/admin/SetAdminDeleteBuyerAction.java
9af4cf723efa7088047386a993b2351e54ffb4d3
[]
no_license
blueoceandevops/amandris
8fe2b405d720d961b2c9217c82087beedf3fbfb2
8347b062f908d794e3ea35f571d4b59a8bf6fd10
refs/heads/master
2021-10-09T03:55:40.145040
2018-12-20T19:23:50
2018-12-20T19:23:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,640
java
package com.amandris.clients.web.action.admin; import java.util.Locale; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.amandris.clients.service.dao.BuyerDAO; import com.amandris.clients.service.dao.BuyerHistoricCreditDAO; import com.amandris.clients.service.dao.BuyerHistoricLoginDAO; import com.amandris.clients.service.dao.ContactDAO; import com.amandris.clients.service.dao.ContactMessageDAO; import com.amandris.clients.service.dao.InvitationDAO; import com.amandris.clients.service.dao.MessageDAO; import com.amandris.clients.service.dao.RecommendationDAO; import com.amandris.clients.service.dao.SavedSearchDAO; import com.amandris.clients.service.dao.VoteDAO; import com.amandris.clients.service.vo.Buyer; import com.amandris.clients.util.Constant; import com.amandris.clients.util.DBUtils; import com.amandris.clients.web.action.common.AbstractAction; import com.amandris.clients.web.util.AdminSession; public class SetAdminDeleteBuyerAction extends AbstractAction { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)throws Exception { HttpSession session = request.getSession(); BuyerDAO buyerDAO = new BuyerDAO(); Locale locale = null; Buyer buyer = null; BuyerHistoricCreditDAO buyerHistoricCreditDAO = new BuyerHistoricCreditDAO(); BuyerHistoricLoginDAO buyerHistoricLoginDAO = new BuyerHistoricLoginDAO(); MessageDAO messageDAO = new MessageDAO(); RecommendationDAO recommendationDAO = new RecommendationDAO(); SavedSearchDAO savedSearchDAO = new SavedSearchDAO(); ContactDAO contactDAO = new ContactDAO(); ContactMessageDAO contactMessageDAO = new ContactMessageDAO(); VoteDAO voteDAO = new VoteDAO(); InvitationDAO invitationDAO = new InvitationDAO(); AdminSession adminSession = ( AdminSession)session.getAttribute( Constant.ADMIN_SESSION_OBJECT_NAME); locale = getLocale( request); if( adminSession == null) return ( mapping.findForward( Constant.ADMIN_SESSION_FAIL)); buyer = buyerDAO.getBuyerById( DBUtils.parseInteger( request.getParameter( "id"), 0), null); if( buyer != null){ if( (contactDAO.getBuyerContactCount( buyer.getId()) == 0 ) && ( voteDAO.getVoteToBuyerByBuyerId( buyer.getId(), "id", true, null, 0, Integer.MAX_VALUE).size() == 0)){ buyerHistoricCreditDAO.deleteBuyerHistoricCreditByBuyerId ( buyer.getId()); buyerHistoricLoginDAO.deleteBuyerHistoricLoginByBuyerId ( buyer.getId()); messageDAO.deleteBuyerMessageByBuyerId ( buyer.getId()); recommendationDAO.deleteBuyerRecomendationByBuyerId ( buyer.getId()); savedSearchDAO.deleteBuyerSavedSearchByBuyerId ( buyer.getId()); invitationDAO.deleteInvitationByBuyerId ( buyer.getId()); buyerDAO.deleteBuyer ( buyer); } else { buyer.setLogin ( buyer.getLogin() + "(borrado)"); buyer.setActive ( new Integer(0)); buyer.setIsPublic ( new Integer( 0)); buyer.setIntro ( "Usuario borrado"); buyer.setText ( "Usuario borrado"); buyer.setPreferredText ( ""); buyer.setEmail ( "no-reply@amandris.com"); buyerDAO.setBuyer( buyer); } } saveToken(request); return ( mapping.findForward( Constant.SUCCESS)); } }
[ "" ]
12ece94d7b3ae94738c7dde4567c9ecb159e61f0
6bfd0dfebfb9c506ce079c4b661ab88cbb19b6ea
/0220/src/com/hb/bm/Ex08.java
bc26e3bb4db41e0fb627de0f76e73d9ec311a788
[]
no_license
tototo121212/javastudy
ad1c28fd15da1b1486c6ad321bc4e34b8e402124
a4bc0dc4acdedb3cc9eb63efd149069fde23c06d
refs/heads/master
2021-01-02T08:48:33.726836
2017-08-02T02:58:23
2017-08-02T02:58:23
99,065,475
0
0
null
null
null
null
UHC
Java
false
false
2,004
java
package com.hb.bm; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JToggleButton; import javax.swing.ScrollPaneConstants; public class Ex08 extends JFrame implements ActionListener, ItemListener{ JPanel jp1 ; String[] items = {"선택하세요","축구","야구","농구","배구"}; JComboBox jcom ; JButton jb ; JTextArea jta; JScrollPane jsp ; public Ex08() { setTitle("콤보박스"); jp1 = new JPanel(); jcom = new JComboBox(items); jb = new JButton("exit"); jta = new JTextArea(10,25); jsp = new JScrollPane(jta, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jta.setLineWrap(true); jta.setEditable(false); jp1.add(jcom); jp1.add(jb); add(jp1,BorderLayout.NORTH); add(jsp,BorderLayout.CENTER); Toolkit tk = Toolkit.getDefaultToolkit(); Dimension ds = tk.getScreenSize(); setBounds(ds.width / 2 - 150, ds.height / 2 - 150, 300, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); setVisible(true); jb.addActionListener(this); jcom.addItemListener(this); } public static void main(String[] args) { new Ex08(); } @Override public void itemStateChanged(ItemEvent e) { String msg =(String)e.getItem(); if(e.getStateChange()==e.SELECTED){ jta.append(msg+"선택 \n"); } } @Override public void actionPerformed(ActionEvent e) { System.exit(0); } }
[ "HB04-14@HB04-06" ]
HB04-14@HB04-06
e18113763a91ffc463127318997da5fd8171d1d6
d5b5ba2f3f20bb85b2ddb69af206f89013bc90b8
/src/main/java/eu/claymc/lobbysystem/Lobbysystem.java
cea5e16d2d5fa114799ab175bccfe3feec04a218
[]
no_license
ClayMCDevelopment/Lobbysystem
397fc53e3fb3b0b44fbbfda80aad83744c8a1a67
b72f10e51cc202183d4296598fd154050d7ab21d
refs/heads/master
2023-05-11T17:11:57.049297
2021-06-06T07:53:43
2021-06-06T07:53:43
369,258,558
1
0
null
null
null
null
UTF-8
Java
false
false
4,533
java
package eu.claymc.lobbysystem; import eu.claymc.api.ClayAPI; import eu.claymc.lobbysystem.enums.LocationEnum; import eu.claymc.lobbysystem.items.*; import eu.claymc.lobbysystem.items.click.AcpClickListener; import eu.claymc.lobbysystem.items.click.LobbiesClickListener; import eu.claymc.lobbysystem.items.click.NavigatorClickListener; import eu.claymc.lobbysystem.items.click.ProfileClickListener; import eu.claymc.lobbysystem.items.report.ReportItem; import eu.claymc.lobbysystem.items.report.sql.ReportSQL; import eu.claymc.lobbysystem.items.shop.ShopClickListener; import eu.claymc.lobbysystem.items.shop.ShopInteractListener; import eu.claymc.lobbysystem.items.shop.sql.ShopSQL; import eu.claymc.lobbysystem.listener.ChatListener; import eu.claymc.lobbysystem.listener.ConnectionListener; import eu.claymc.lobbysystem.listener.ProtectionListener; import eu.claymc.lobbysystem.manager.ParticleManager; import eu.claymc.lobbysystem.manager.ScoreboardManager; import eu.claymc.lobbysystem.utils.Data; import eu.claymc.lobbysystem.utils.RunTask; import eu.claymc.lobbysystem.utils.SkullBuilder; import org.bukkit.Bukkit; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; public class Lobbysystem extends JavaPlugin { public static Lobbysystem instance; private ParticleManager particleManager; private Data data; private SkullBuilder skullBuilder; private ScoreboardManager scoreboardManager; private ShopSQL shopSQL; private ReportSQL reportSQL; @Override public void onEnable() { instance = this; init(); schedule(); createMySQLTable(); this.particleManager = new ParticleManager(); this.data = new Data(); this.scoreboardManager = new ScoreboardManager(); this.scoreboardManager.startScoreboardAnimation(); this.scoreboardManager.update(); new RunTask(); this.shopSQL = new ShopSQL(); this.reportSQL = new ReportSQL(); Bukkit.getScheduler().scheduleSyncDelayedTask(Lobbysystem.getInstance(), new Runnable() { @Override public void run() { Lobbysystem.getInstance().getData().spawnArmorstands(); } }, 80); } @Override public void onDisable() { } public void init() { final PluginManager pluginManager = Bukkit.getPluginManager(); pluginManager.registerEvents(new ConnectionListener(), this); pluginManager.registerEvents(new ProtectionListener(), this); pluginManager.registerEvents(new NavigatorItem(), this); pluginManager.registerEvents(new GrapplingHookItem(), this); pluginManager.registerEvents(new AcpItem(), this); pluginManager.registerEvents(new PlayerHiderItem(), this); pluginManager.registerEvents(new LobbiesItem(), this); pluginManager.registerEvents(new ProfileItem(), this); pluginManager.registerEvents(new NavigatorClickListener(), this); pluginManager.registerEvents(new AcpClickListener(), this); pluginManager.registerEvents(new SilentHubItem(), this); pluginManager.registerEvents(new LobbiesClickListener(), this); pluginManager.registerEvents(new ShopInteractListener(), this); pluginManager.registerEvents(new ShopClickListener(), this); pluginManager.registerEvents(new ProfileClickListener(), this); //pluginManager.registerEvents(new ReportItem(), this); pluginManager.registerEvents(new ChatListener(), this); } public void schedule() { new BukkitRunnable() { @Override public void run() { Lobbysystem.getInstance().getParticleManager().spawnParticle(LocationEnum.SPAWN.getLocation()); } }.runTaskTimer(Lobbysystem.getInstance(), 0, 35); } public void createMySQLTable() { ClayAPI.getInstance().getSqlAdapter().update("CREATE TABLE IF NOT EXISTS claypass (UUID VARCHAR(64), BUYED INT);"); } public static Lobbysystem getInstance() { return instance; } public ParticleManager getParticleManager() { return particleManager; } public Data getData() { return data; } public ScoreboardManager getScoreboardManager() { return scoreboardManager; } public ShopSQL getShopSQL() { return shopSQL; } public ReportSQL getReportSQL() { return reportSQL; } }
[ "ghostmaxi296@gmail.com" ]
ghostmaxi296@gmail.com
d1347087bb6c7e19cb2832ae1ba17ff38ae5ad53
aeb171a9c7ce8c2447a143bc0b506d835d776338
/src/th/ac/nu/studens/u54347583/compro/ch02/DynamicInit.java
a37ac3ddf572b529cf470cee62e4fe4da84b7c0d
[]
no_license
aammiemisty/compro7583
5e87d55fdad000914610afdb439eac1cdf05d888
d11041cf7a0f8b71c68de1689b9e2ca54d7dbcce
refs/heads/master
2016-09-09T19:38:44.390027
2012-07-13T07:43:38
2012-07-13T07:43:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
596
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package th.ac.nu.studens.u54347583.compro.ch02; /** * * @author User */ public class DynamicInit { /** * @param args the command line arguments */ public static void main(String[] args) { if (args.length == 2) { int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); double c = Math.sqrt(a * a + b * b); System.out.println(c); } // TODO code application logic here } }
[ "aam_ppshidae@msn.com" ]
aam_ppshidae@msn.com
26956676c696bb6538c37dcbdecfe9dcf18e9356
0eb37ae3ccd63221b5abaf167d5bceb4e0705fbc
/api-s/src/main/java/com/enjoygolf24/api/service/impl/MemberReservationManageServiceImpl.java
3267fe82c192bfca30f73b0add80839831e49515
[]
no_license
r-e-d-dragon/myWork
2405303054d4bb181cc129a007b4fe5db3bb29e1
62a147ccd6f7749aaddc42d1f9fec4f9afb85551
refs/heads/master
2022-12-25T12:55:56.015817
2020-10-09T16:01:39
2020-10-09T16:01:39
291,210,244
0
0
null
null
null
null
UTF-8
Java
false
false
20,909
java
package com.enjoygolf24.api.service.impl; import java.lang.reflect.InvocationTargetException; import java.sql.Timestamp; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.Date; import java.util.List; import java.util.Optional; import java.util.UUID; import java.util.stream.Collectors; import javax.servlet.http.HttpSession; import javax.transaction.Transactional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.enjoygolf24.api.common.code.MailSectionCd; import com.enjoygolf24.api.common.code.PointCategoryCd; import com.enjoygolf24.api.common.code.ReservationStatusCd; import com.enjoygolf24.api.common.database.bean.MstPenaltyPoint; import com.enjoygolf24.api.common.database.bean.MstReservationLimit; import com.enjoygolf24.api.common.database.bean.TblAsp; import com.enjoygolf24.api.common.database.bean.TblPointHistory; import com.enjoygolf24.api.common.database.bean.TblPointManage; import com.enjoygolf24.api.common.database.bean.TblPointManagePK; import com.enjoygolf24.api.common.database.bean.TblReservation; import com.enjoygolf24.api.common.database.bean.TblUser; import com.enjoygolf24.api.common.database.jpa.repository.AspRepository; import com.enjoygolf24.api.common.database.jpa.repository.MemberRepository; import com.enjoygolf24.api.common.database.jpa.repository.MstPenaltyPointRepository; import com.enjoygolf24.api.common.database.jpa.repository.MstReservationLimitRepository; import com.enjoygolf24.api.common.database.jpa.repository.PointHistoryRepository; import com.enjoygolf24.api.common.database.jpa.repository.PointManageRepository; import com.enjoygolf24.api.common.database.jpa.repository.ReservationRepository; import com.enjoygolf24.api.common.database.mybatis.bean.MemberReservationManage; import com.enjoygolf24.api.common.database.mybatis.bean.PointManage; import com.enjoygolf24.api.common.database.mybatis.bean.ReservationPointTimeTableInfo; import com.enjoygolf24.api.common.database.mybatis.repository.ReservationMapper; import com.enjoygolf24.api.common.utility.DateUtility; import com.enjoygolf24.api.service.EmailSendService; import com.enjoygolf24.api.service.MemberReservationManageService; import com.enjoygolf24.api.service.bean.EmailSendServiceBean; import com.enjoygolf24.api.service.bean.MemberReservationServiceBean; import com.github.pagehelper.PageHelper; @Service public class MemberReservationManageServiceImpl implements MemberReservationManageService { private static final Logger logger = LoggerFactory.getLogger(MemberRegisterServiceImpl.class); @Autowired HttpSession session; @Autowired ReservationMapper reservationMapper; @Autowired ReservationRepository reservationRepository; @Autowired PointHistoryRepository pointHistoryRepository; @Autowired MemberRepository memberRepository; @Autowired PointManageRepository pointManageRepository; @Autowired MstReservationLimitRepository mstReservationLimitRepository; @Autowired MstPenaltyPointRepository mstPenaltyPointRepository; @Autowired private EmailSendService emailSendService; @Autowired private AspRepository aspRepository; @Override public List<ReservationPointTimeTableInfo> getViewReservationPonitTimeTableInfo(Date dateTime, Date validateStartTerm) { return reservationMapper.getViewReservationPoitTimeTableInfo(dateTime, validateStartTerm); } @Override public List<MemberReservationManage> getMemberReservationList(String reservationNumber, String memberCode, String aspCode, String reservationDate, String status, boolean valid, int pageNo, int pageSize) { PageHelper.startPage(pageNo, pageSize); return reservationMapper.getMemberReservationList(reservationNumber, memberCode, aspCode, null, reservationDate, null, status, null, null, null, null, valid); } @Override public List<MemberReservationManage> getMemberReservationList(String reservationNumber, String memberCode, String aspCode, String reservationDate, String status, String name, String kananame, String phone, String email, boolean valid, int pageNo, int pageSize) { PageHelper.startPage(pageNo, pageSize); return reservationMapper.getMemberReservationList(reservationNumber, memberCode, aspCode, null, reservationDate, null, status, name, kananame, phone, email, valid); } @Override public List<MemberReservationManage> getReservationList(String aspCode, String reservationDate, String dateKind) { return reservationMapper.getReservationList(aspCode, reservationDate, dateKind); } @Override @Transactional public String MemberReservationUpdate(MemberReservationServiceBean serviceBean) { // 予約情報更新 TblReservation reservation = updateReservation(serviceBean); // 予約日 String reservationDate = serviceBean.getReservationDate(); // 月ポイント情報取得 if (PointCategoryCd.MONTHLY_POINT.equals(serviceBean.getPointCategoryCode())) { List<PointManage> pointList = getMemberPointManageList(serviceBean.getMemberCode(), PointCategoryCd.MONTHLY_POINT, serviceBean.getReservationDate()); // TODO 当月分は当月のみ使用、ポイントがあっても開始日か過ぎてないと使えない。 // TODO 来月は、来月の使用ポイントから計算 Optional<PointManage> mPoint = pointList.stream() .filter(p -> p.getStartDate().startsWith(reservationDate.substring(0, 7))).findFirst(); if (mPoint.isPresent()) { if (serviceBean.getConsumedPoint() <= mPoint.get().getPointAmount()) { // ポイント履歴登録 insertPointHistory(serviceBean, mPoint.get(), reservation.getReservationId(), serviceBean.getConsumedPoint()); // ポイント管理 updateMemberPointManage(serviceBean, mPoint.get(), serviceBean.getConsumedPoint()); } } else { // TODO 予約月のポイント情報がない } } // イベントポイント情報取得 if (PointCategoryCd.EVENT_POINT.equals(serviceBean.getPointCategoryCode())) { List<PointManage> pointList = getMemberPointManageList(serviceBean.getMemberCode(), PointCategoryCd.EVENT_POINT, serviceBean.getReservationDate()); int consumedPoint = serviceBean.getConsumedPoint(); for (PointManage point : pointList) { if (point.getPointAmount() - consumedPoint >= 0) { // ポイント履歴登録 insertPointHistory(serviceBean, point, reservation.getReservationId(), consumedPoint); // ポイント管理 updateMemberPointManage(serviceBean, point, consumedPoint); break; } else { consumedPoint = consumedPoint - point.getPointAmount(); // ポイント履歴登録 insertPointHistory(serviceBean, point, reservation.getReservationId(), point.getPointAmount()); // ポイント管理 updateMemberPointManage(serviceBean, point, point.getPointAmount()); } } } // TODO // 予約完了メール送信 sendReservationMail(MailSectionCd.RESERVATION_FIXED, reservation); return reservation.getReservationId(); } @Override @Transactional public String MemberReservationRegister(MemberReservationServiceBean serviceBean) { // 仮予約情報登録 TblReservation reservation = insertReservation(serviceBean); return reservation.getReservationId(); } @Override @Transactional public String MemberReservationCancle(MemberReservationServiceBean serviceBean) { // 予約情報更新ー取消 TblReservation reservation = updateReservationCancle(serviceBean); if (!PointCategoryCd.ADMIN_POINT.equals(reservation.getPointCategoryCode())) { // 取消、ポイント戻し処理 updateMemberCanclePointManage(serviceBean); // TODO // 予約取消メール送信 sendReservationMail(MailSectionCd.RESERVATION_CANCLE, reservation); } return serviceBean.getReservationId(); } /** * 予約履歴登録 * * @param serviceBean * @return */ @Transactional private TblPointHistory insertPointHistory(MemberReservationServiceBean serviceBean, PointManage pointManage, String reservationId, int consomedPoint) { TblPointHistory pointHistory = new TblPointHistory(); pointHistory.setMemberCode(serviceBean.getMemberCode()); pointHistory.setReservationId(reservationId); // ポイントコード pointHistory.setPointCode(pointManage.getPointType()); // 消費ポイント pointHistory.setConsumedPoint(consomedPoint); pointHistory.setStartDate(DateUtility.getDate(pointManage.getStartDate())); pointHistory.setExpireDate(DateUtility.getDate(pointManage.getEndDate())); pointHistory.setRegisterUser(serviceBean.getLoginUserCd()); pointHistory.setRegisterDate(new Timestamp(System.currentTimeMillis())); pointHistory.setUpdateUser(serviceBean.getLoginUserCd()); pointHistory.setUpdateDate(new Timestamp(System.currentTimeMillis())); pointHistoryRepository.save(pointHistory); return pointHistory; } /** * 予約登録 ポイント管理 * * @param serviceBean * @return * @throws IllegalAccessException * @throws InvocationTargetException */ @Transactional private TblPointManage updateMemberPointManage(MemberReservationServiceBean serviceBean, PointManage pointManage, int consomedPoint) { TblPointManagePK pk = new TblPointManagePK(); pk.setId(pointManage.getPointManageId()); pk.setMemberCode(serviceBean.getMemberCode()); TblPointManage tblPointManage = pointManageRepository.findById(pk); tblPointManage.setConsumedPoint(tblPointManage.getConsumedPoint() + consomedPoint); tblPointManage.setPointAmount(tblPointManage.getPointAmount() - consomedPoint); tblPointManage.setUpdateUser(serviceBean.getLoginUserCd()); tblPointManage.setUpdateDate(new Timestamp(System.currentTimeMillis())); pointManageRepository.save(tblPointManage); return tblPointManage; } /** * 予約取消 ポイント管理 * * @param serviceBean * @return * @throws IllegalAccessException * @throws InvocationTargetException */ @Transactional private String updateMemberCanclePointManage(MemberReservationServiceBean serviceBean) { // 予約履歴更新 List<TblPointHistory> list = pointHistoryRepository.findByReservationId(serviceBean.getReservationId()); int penaltyPoint = serviceBean.getPenaltyPoint(); for (TblPointHistory history : list) { if (penaltyPoint > 0) { history.setConsumedPoint(-history.getConsumedPoint() + penaltyPoint); penaltyPoint = -history.getConsumedPoint() + penaltyPoint; } else { history.setConsumedPoint(-history.getConsumedPoint()); } history.setUpdateUser(serviceBean.getLoginUserCd()); history.setUpdateDate(new Timestamp(System.currentTimeMillis())); pointHistoryRepository.save(history); // ポイント管理更新 TblPointManage tblPointManage = pointManageRepository.findByIdMemberCodeAndPointTypeAndStartDateAndEndDate( serviceBean.getMemberCode(), history.getPointCode(), DateUtility.toTimestampDayOfFirst(history.getStartDate()), DateUtility.toTimestampDayOfLast(history.getExpireDate())); if (tblPointManage != null) { tblPointManage.setConsumedPoint(tblPointManage.getConsumedPoint() + history.getConsumedPoint()); tblPointManage.setPointAmount(tblPointManage.getPointAmount() - history.getConsumedPoint()); tblPointManage.setUpdateUser(serviceBean.getLoginUserCd()); tblPointManage.setUpdateDate(new Timestamp(System.currentTimeMillis())); pointManageRepository.save(tblPointManage); } } return serviceBean.getReservationId(); } /** * 予約情報登録 * * @param serviceBean * @param reservationHistory * @return TblReservation * @throws InvocationTargetException * @throws IllegalAccessException */ @Transactional private TblReservation insertReservation(MemberReservationServiceBean serviceBean) { TblReservation reservation = new TblReservation(); reservation.setReservationId(UUID.randomUUID().toString()); reservation.setReservationNumber(serviceBean.getReservationNumber()); reservation.setStatus(serviceBean.getStatus()); reservation.setMemberCode(serviceBean.getMemberCode()); reservation.setAspCode(serviceBean.getAspCode()); reservation.setBatNumber(serviceBean.getBatNumber()); // 予約日 reservation.setReservationDate(DateUtility.getDate(serviceBean.getReservationDate())); reservation.setReservationTime(serviceBean.getReservationTime()); reservation.setConsumedPoint(serviceBean.getConsumedPoint()); reservation.setPointCategoryCode(serviceBean.getPointCategoryCode()); reservation.setGradeTypeCd(serviceBean.getGradeTypeCd()); reservation.setPenaltyPoint(serviceBean.getPenaltyPoint()); reservation.setRegisterUser(serviceBean.getLoginUserCd()); reservation.setRegisterDate(new Timestamp(System.currentTimeMillis())); reservation.setUpdateUser(serviceBean.getLoginUserCd()); reservation.setUpdateDate(new Timestamp(System.currentTimeMillis())); reservationRepository.save(reservation); return reservation; } /** * 予約情報更新 * * @param serviceBean * @param reservationId * @return */ @Transactional private TblReservation updateReservation(MemberReservationServiceBean serviceBean) { TblReservation reservation = getReservation(serviceBean.getReservationId()); reservation.setStatus(serviceBean.getStatus()); reservation.setPointCategoryCode(serviceBean.getPointCategoryCode()); reservation.setReservationNumber(serviceBean.getReservationNumber()); reservation.setMemberCode(serviceBean.getMemberCode()); reservation.setUpdateUser(serviceBean.getLoginUserCd()); reservation.setUpdateDate(new Timestamp(System.currentTimeMillis())); reservationRepository.save(reservation); return reservation; } /** * 予約情報取消 * * @param serviceBean * @param reservationId * @return */ @Transactional private TblReservation updateReservationCancle(MemberReservationServiceBean serviceBean) { TblReservation reservation = getReservation(serviceBean.getReservationId()); reservation.setStatus(serviceBean.getStatus()); reservation.setUpdateUser(serviceBean.getLoginUserCd()); reservation.setUpdateDate(new Timestamp(System.currentTimeMillis())); // 管理者一括予約 if (PointCategoryCd.ADMIN_POINT.equals(reservation.getPointCategoryCode())) { reservationRepository.save(reservation); return reservation; } // ペナルティー情報取得 MstPenaltyPoint penalty = mstPenaltyPointRepository.findByGradeCodeAndValidateStartTermLessThanEqual( reservation.getGradeTypeCd(), DateUtility.getCurrentTimestamp()); if (penalty != null) { int reservationTime = Integer.valueOf(reservation.getReservationTime().substring(0, 2)); LocalDateTime reservationDateTime = reservation.getReservationDate().toInstant() .atZone(ZoneId.systemDefault()).toLocalDateTime().plusHours(reservationTime) .minusHours(penalty.getLimitTime()); LocalDateTime limitDateTime = DateUtility.getCurrentTimestamp().toInstant().atZone(ZoneId.systemDefault()) .toLocalDateTime(); // ペナルティー発生 if (reservationDateTime.compareTo(limitDateTime) < 0) { reservation .setConsumedPoint(reservation.getConsumedPoint() - penalty.getPenaltyPointAmount().intValue()); reservation.setPenaltyPoint(penalty.getPenaltyPointAmount().intValue()); // ペナルティー設定 serviceBean.setPenaltyPoint(penalty.getPenaltyPointAmount().intValue()); } } reservationRepository.save(reservation); return reservation; } @Override public TblReservation getReservation(String reservationId) { return reservationRepository.getOne(reservationId); } @Override public List<PointManage> getMemberPointManageList(String memberCode, String categoryCode, String reservationDate) { return reservationMapper.getMemberPointManageList(memberCode, categoryCode, reservationDate); } @Override public MstReservationLimit getMemberReservationLimit(String memberTypeCode, Date reservationDate) { return mstReservationLimitRepository.findByMemberTypeCdAndValidateStartTermLessThanEqual(memberTypeCode, reservationDate); } @Override public List<MemberReservationManage> getMemberReservationAllList(String reservationNumber, String memberCode, String aspCode, String batNumber, String reservationDate, String reservationTime, String status, boolean valid) { return reservationMapper.getMemberReservationList(reservationNumber, memberCode, aspCode, batNumber, reservationDate, reservationTime, status, null, null, null, null, valid); } /** * 会員予約情報、予約制限情報取得 * */ @Override public MemberReservationManage getMemberReservationInfo(String memberCode, String reservationDate) { DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM"); LocalDate now = LocalDate.now(); LocalDate currentMonth = now.with(TemporalAdjusters.firstDayOfMonth()); LocalDate nextMonth = now.with(TemporalAdjusters.firstDayOfNextMonth()); MemberReservationManage reservation = new MemberReservationManage(); // 会員情報取得 TblUser member = memberRepository.findByMemberCode(memberCode); reservation.setTblUser(member); // 月ポイント情報取得 List<PointManage> validMonPointList = getMemberPointManageList(memberCode, PointCategoryCd.MONTHLY_POINT, reservationDate); List<PointManage> currMonPointList = getMemberPointManageList(memberCode, PointCategoryCd.MONTHLY_POINT, currentMonth.format(dateTimeFormatter)); List<PointManage> nextMonPointList = getMemberPointManageList(memberCode, PointCategoryCd.MONTHLY_POINT, nextMonth.format(dateTimeFormatter)); // イベントポイント情報取得 List<PointManage> validEvtPointList = getMemberPointManageList(memberCode, PointCategoryCd.EVENT_POINT, reservationDate); reservation.setValidMonthlyPoint(validMonPointList.stream().mapToInt(x -> x.getPointAmount()).sum()); reservation.setCurrentMonthlyPoint(currMonPointList.stream().mapToInt(x -> x.getPointAmount()).sum()); reservation.setNextMonthlyPoint(nextMonPointList.stream().mapToInt(x -> x.getPointAmount()).sum()); reservation.setValidEventPoint(validEvtPointList.stream().mapToInt(x -> x.getPointAmount()).sum()); List<MemberReservationManage> reservationList = getMemberReservationAllList(null, memberCode, null, null, null, null, ReservationStatusCd.STATUS_FIXED, true); reservation.setReservationList(reservationList); reservation.setMonthlyReservationCount( reservationList.stream().filter(p -> p.getPointCategoryCode().equals(PointCategoryCd.MONTHLY_POINT)) .collect(Collectors.toList()).size()); reservation.setEventReservationCount( reservationList.stream().filter(p -> p.getPointCategoryCode().equals(PointCategoryCd.EVENT_POINT)) .collect(Collectors.toList()).size()); reservation.setCurrentMonth(currentMonth.format(dateTimeFormatter)); reservation.setNextMonth(nextMonth.format(dateTimeFormatter)); if (member != null) { // 予約制限情報取得 MstReservationLimit master = getMemberReservationLimit(member.getMemberTypeCd(), DateUtility.getDate(reservationDate)); if (master != null) { reservation.setLimitReservationCount(master.getReservationLimit()); reservation.setLimitEventReservationCount(master.getEventLimit()); reservation.setLimitMonthlyReservationCount(master.getMonthlyLimit()); reservation.setLimitReservationPoint(master.getMaxReservationPoint()); } } else { reservation.setLimitReservationCount(0); reservation.setLimitEventReservationCount(0); reservation.setLimitMonthlyReservationCount(0); reservation.setLimitReservationPoint(0); } return reservation; } /** * メール送信 * * @param mailSectionCd * @param reservation */ public void sendReservationMail(String mailSectionCd, TblReservation reservation) { EmailSendServiceBean emailSendServiceBean = createReservationEmailSendServiceBean(mailSectionCd, reservation); // email send emailSendService.send(emailSendServiceBean); String txt = emailSendServiceBean.getSenderName() + "\n" + emailSendServiceBean.getSenderEmailAddress() + "\n" + emailSendServiceBean.getTargetEmailAddress() + "\n" + emailSendServiceBean.getSubject() + "\n" + emailSendServiceBean.getBody(); logger.info(txt); } private EmailSendServiceBean createReservationEmailSendServiceBean(String mailSectionCd, TblReservation reservation) { TblUser member = memberRepository.findByMemberCode(reservation.getMemberCode()); TblAsp asp = aspRepository.findByAspCode(reservation.getAspCode()); EmailSendServiceBean mailSendServiceBean = new EmailSendServiceBean(mailSectionCd, reservation, member, asp); return mailSendServiceBean; } }
[ "H1705635@H1705635" ]
H1705635@H1705635
05efb2844fb054ca1868647d23a36dd4a0602573
bfce795e0247940f7aba55b3f4a2676444c87da3
/guido-agent-oss/src/main/java/oss/guido/ch/qos/logback/core/property/FileExistsPropertyDefiner.java
357857342dcd239d575c4b92770cad8316b30683
[]
no_license
ManuelPivotal/guido
3de7c08046075a99a7f115df2f5cd4ff63fc1392
094af774f2881bc798653143c5d19941493b53c9
refs/heads/master
2021-01-12T17:51:33.572529
2016-11-25T16:37:39
2016-11-25T16:37:39
71,653,381
0
0
null
null
null
null
UTF-8
Java
false
false
1,730
java
/** * Logback: the reliable, generic, fast and flexible logging framework. * Copyright (C) 1999-2015, QOS.ch. All rights reserved. * * This program and the accompanying materials are dual-licensed under * either the terms of the Eclipse Public License v1.0 as published by * the Eclipse Foundation * * or (per the licensee's choosing) * * under the terms of the GNU Lesser General Public License version 2.1 * as published by the Free Software Foundation. */ package oss.guido.ch.qos.logback.core.property; import java.io.File; import oss.guido.ch.qos.logback.core.PropertyDefinerBase; import oss.guido.ch.qos.logback.core.util.OptionHelper; /** * In conjunction with {@link oss.guido.ch.qos.logback.core.joran.action.PropertyAction} sets * the named variable to "true" if the file specified by {@link #setPath(String) path} * property exists, to "false" otherwise. * * @see #getPropertyValue() * * @author Ceki G&uuml;c&uuml; */ public class FileExistsPropertyDefiner extends PropertyDefinerBase { String path; public String getPath() { return path; } /** * The path for the file to search for. * * @param path */ public void setPath(String path) { this.path = path; } /** * Returns "true" if the file specified by {@link #setPath(String) path} property exists. * Returns "false" otherwise. * * @return "true"|"false" depending on the existence of file */ public String getPropertyValue() { if (OptionHelper.isEmpty(path)) { addError("The \"path\" property must be set."); return null; } File file = new File(path); return booleanAsStr(file.exists()); } }
[ "mmeyer@pivotal.io" ]
mmeyer@pivotal.io
ebbe8b4b70d221e28e03e420472c2a102de0b882
eaea3fa01f88ab8781681e8b123be97f3e1631f6
/src/main/java/taskman/TaskManApp.java
3258f6a763ed043cd0c21b99ec62095648268546
[]
no_license
shekhargulati/taskman
378513322a3c13d4de3237fd005c600154bc92d2
3af2f71b4996618e8a5b4c322b251baea95061c5
refs/heads/master
2021-01-13T08:50:40.523489
2016-10-06T16:12:31
2016-10-06T16:12:31
70,170,559
1
0
null
null
null
null
UTF-8
Java
false
false
297
java
package taskman; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class TaskManApp { public static void main(String[] args) { SpringApplication.run(TaskManApp.class, args); } }
[ "shekhargulati84@gmail.com" ]
shekhargulati84@gmail.com
187c07dbe06325957ae9af05201473e7823257e7
ce235dd16d7e74d0a855b38f80dec8b086292da0
/src/main/java/com/devglan/controller/AuthenticationController.java
dffec2469d2044317af316701781157466b9a2e4
[]
no_license
leirradev/springbootangular
03ef049ab60a99e186e1c6762d31951f6dc8ac17
9a9bc21053c807bc64bbd644ee67b7e27ad33925
refs/heads/master
2023-01-07T15:31:57.210333
2019-09-19T18:49:23
2019-09-19T18:49:23
209,626,637
0
0
null
2023-01-07T09:53:19
2019-09-19T18:49:57
Java
UTF-8
Java
false
false
1,346
java
package com.devglan.controller; import com.devglan.config.JwtTokenUtil; import com.devglan.model.*; import com.devglan.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.AuthenticationException; import org.springframework.web.bind.annotation.*; @CrossOrigin(origins = "*", maxAge = 3600) @RestController @RequestMapping("/token") public class AuthenticationController { @Autowired private AuthenticationManager authenticationManager; @Autowired private JwtTokenUtil jwtTokenUtil; @Autowired private UserService userService; @RequestMapping(value = "/generate-token", method = RequestMethod.POST) public ApiResponse<AuthToken> register(@RequestBody LoginUser loginUser) throws AuthenticationException { authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(loginUser.getUsername(), loginUser.getPassword())); final User user = userService.findOne(loginUser.getUsername()); final String token = jwtTokenUtil.generateToken(user); return new ApiResponse<>(200, "success",new AuthToken(token, user.getUsername())); } }
[ "lestermiro.lm@gmail.com" ]
lestermiro.lm@gmail.com
875829cfbe8f40d141e9d48f5ed2df76210e0a28
34533b913cd0384d2697ec4e7f642203306ccf9c
/src/main/java/entity/Pizza.java
e3a680a06216d14d43709da3586a3359b2bfe13b
[]
no_license
Kanykei02/lesson
db149d93da18c73d2a3dacdc9d5dced7760d78cb
b1c68d7b5c809193eafa330c907c0b9e04fec2f9
refs/heads/master
2023-03-29T18:13:58.246548
2021-04-09T14:38:18
2021-04-09T14:38:18
355,877,746
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
package entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "pizza") @Data @NoArgsConstructor @AllArgsConstructor @ToString public class Pizza { @Id @Column(name = "id") private Integer id; @Column(name = "name", length = 55) private String name; @Column(name = "price") private Integer price; @Column(name = "weight") private Integer weight; }
[ "almazbekovakany@gmail.com" ]
almazbekovakany@gmail.com
fc679d7555db7ebd0d6cd4c375c43988abe49dd3
ab3c3ac2de4333c97fb9fc57da7e58a23121e237
/SlideVerify/src/main/java/com/example/verifydemo/VerifyFullScreenActivity.java
9b4a2fe2b62274ce3d23245466814ab1654c20cb
[]
no_license
yangzhaojason/Android-development
1eebf9318e2879efa8e784d85ed9cef1e54a802c
fbb5901c60f38aebd6dee745358f62a1a7375dbc
refs/heads/master
2020-04-04T22:52:57.520852
2018-11-07T07:00:08
2018-11-07T07:00:08
156,339,233
2
0
null
null
null
null
UTF-8
Java
false
false
3,436
java
package com.example.verifydemo; import android.app.Activity; import android.content.Intent; import android.content.res.Configuration; //getApplicationContext() import android.content.res.Resources; import android.os.Bundle; import android.view.ViewGroup; import android.view.Window; import android.webkit.WebView; import android.widget.ProgressBar; import com.token.verifysdk.VerifyCoder; import com.token.verifysdk.VerifyCoder.VerifyListener; public class VerifyFullScreenActivity extends Activity { private WebView mWebView; private ProgressBar pg1; //开启监听,调用外部验证的.jar libs private VerifyListener listener = new VerifyListener() { @Override //编译器可以给你验证@Override下面的方法名是否是你父类中所有的 public void onVerifySucc(String ticket, String randstr) { // TODO Auto-generated method stub 5 Intent it = new Intent(); it.putExtra("ticket", ticket); it.putExtra("randstr", randstr); setResult(Activity.RESULT_OK, it); finish(); // } @Override public void onVerifyFail() { //认证失败 // TODO Auto-generated method stub setResult(Activity.RESULT_CANCELED); finish(); } @Override public void onIframeLoaded(int state, String info) { } @Override public void onIFrameResize(float width, float height) { //全屏验证码可不用处理该方法 } }; public Resources getResources() { Resources res = super.getResources(); Configuration config = new Configuration(); config.setToDefaults(); res.updateConfiguration(config, res.getDisplayMetrics()); return res; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); //设置当前的窗体,无标题 String content2 = getIntent().getStringExtra("jsurl"); //Intent传递数据 (得到返回数据) if (content2 == null) { finish(); return; } //获取到jsurl后调用接口VerifyCoder.getVerifyCoder() VerifyCoder verify = VerifyCoder.getVerifyCoder(); //这是libs里面的认证的接口 获取单例 verify.setShowtitle(true); //显示出验证码webview getApplicationContext()获取当前应用的上下文 mWebView = verify.getWebView(getApplicationContext(), content2, listener); //获取验证码WebView,context调用验证码时当前界面的上下文, //requestcode对应onActivityResult的requestCode通过这里传递的 mWebView.requestFocus(); // mWebView.forceLayout(); // } @Override protected void onDestroy() { super.onDestroy(); if (mWebView != null) { mWebView.clearHistory(); mWebView.clearCache(true); mWebView.freeMemory(); ViewGroup parent = (ViewGroup) mWebView.getParent(); if (parent != null) { parent.removeView(mWebView); } mWebView.removeAllViews(); mWebView.destroy(); mWebView = null; } VerifyCoder.getVerifyCoder().release(); } }
[ "1551237257@qq.com" ]
1551237257@qq.com
7c1aac6e8802fb2c4561c069e459ccf15a86e5c4
7a094fae7c078c87570af32d62a4a1988e228ce5
/app/build/generated/source/r/debug/com/google/android/gms/R.java
ba6e11e25a29c0d1120a200702bfff85e3a8a148
[]
no_license
assetllc/shooter3
5973e12ae7fad233a5c166262fcd3249883d5557
c26bda906b368210b9493276e793196c1e690fd3
refs/heads/master
2016-09-05T10:03:52.612394
2014-09-16T21:23:26
2014-09-16T21:23:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,929
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.google.android.gms; public final class R { public static final class attr { public static final int adSize = 0x7f010000; public static final int adSizes = 0x7f010001; public static final int adUnitId = 0x7f010002; public static final int buyButtonAppearance = 0x7f010019; public static final int buyButtonHeight = 0x7f010016; public static final int buyButtonText = 0x7f010018; public static final int buyButtonWidth = 0x7f010017; public static final int cameraBearing = 0x7f010004; public static final int cameraTargetLat = 0x7f010005; public static final int cameraTargetLng = 0x7f010006; public static final int cameraTilt = 0x7f010007; public static final int cameraZoom = 0x7f010008; public static final int environment = 0x7f010013; public static final int fragmentMode = 0x7f010015; public static final int fragmentStyle = 0x7f010014; public static final int mapType = 0x7f010003; public static final int maskedWalletDetailsBackground = 0x7f01001c; public static final int maskedWalletDetailsButtonBackground = 0x7f01001e; public static final int maskedWalletDetailsButtonTextAppearance = 0x7f01001d; public static final int maskedWalletDetailsHeaderTextAppearance = 0x7f01001b; public static final int maskedWalletDetailsLogoImageType = 0x7f010020; public static final int maskedWalletDetailsLogoTextColor = 0x7f01001f; public static final int maskedWalletDetailsTextAppearance = 0x7f01001a; public static final int theme = 0x7f010012; public static final int uiCompass = 0x7f010009; public static final int uiRotateGestures = 0x7f01000a; public static final int uiScrollGestures = 0x7f01000b; public static final int uiTiltGestures = 0x7f01000c; public static final int uiZoomControls = 0x7f01000d; public static final int uiZoomGestures = 0x7f01000e; public static final int useViewLifecycle = 0x7f01000f; public static final int zOrderOnTop = 0x7f010010; } public static final class color { public static final int common_action_bar_splitter = 0x7f040000; public static final int common_signin_btn_dark_text_default = 0x7f040001; public static final int common_signin_btn_dark_text_disabled = 0x7f040002; public static final int common_signin_btn_dark_text_focused = 0x7f040003; public static final int common_signin_btn_dark_text_pressed = 0x7f040004; public static final int common_signin_btn_default_background = 0x7f040005; public static final int common_signin_btn_light_text_default = 0x7f040006; public static final int common_signin_btn_light_text_disabled = 0x7f040007; public static final int common_signin_btn_light_text_focused = 0x7f040008; public static final int common_signin_btn_light_text_pressed = 0x7f040009; public static final int common_signin_btn_text_dark = 0x7f040017; public static final int common_signin_btn_text_light = 0x7f040018; public static final int wallet_bright_foreground_disabled_holo_light = 0x7f04000a; public static final int wallet_bright_foreground_holo_dark = 0x7f04000b; public static final int wallet_bright_foreground_holo_light = 0x7f04000c; public static final int wallet_dim_foreground_disabled_holo_dark = 0x7f04000d; public static final int wallet_dim_foreground_holo_dark = 0x7f04000e; public static final int wallet_dim_foreground_inverse_disabled_holo_dark = 0x7f04000f; public static final int wallet_dim_foreground_inverse_holo_dark = 0x7f040010; public static final int wallet_highlighted_text_holo_dark = 0x7f040011; public static final int wallet_highlighted_text_holo_light = 0x7f040012; public static final int wallet_hint_foreground_holo_dark = 0x7f040013; public static final int wallet_hint_foreground_holo_light = 0x7f040014; public static final int wallet_holo_blue_light = 0x7f040015; public static final int wallet_link_text_light = 0x7f040016; public static final int wallet_primary_text_holo_light = 0x7f040019; public static final int wallet_secondary_text_holo_dark = 0x7f04001a; } public static final class drawable { public static final int common_signin_btn_icon_dark = 0x7f020000; public static final int common_signin_btn_icon_disabled_dark = 0x7f020001; public static final int common_signin_btn_icon_disabled_focus_dark = 0x7f020002; public static final int common_signin_btn_icon_disabled_focus_light = 0x7f020003; public static final int common_signin_btn_icon_disabled_light = 0x7f020004; public static final int common_signin_btn_icon_focus_dark = 0x7f020005; public static final int common_signin_btn_icon_focus_light = 0x7f020006; public static final int common_signin_btn_icon_light = 0x7f020007; public static final int common_signin_btn_icon_normal_dark = 0x7f020008; public static final int common_signin_btn_icon_normal_light = 0x7f020009; public static final int common_signin_btn_icon_pressed_dark = 0x7f02000a; public static final int common_signin_btn_icon_pressed_light = 0x7f02000b; public static final int common_signin_btn_text_dark = 0x7f02000c; public static final int common_signin_btn_text_disabled_dark = 0x7f02000d; public static final int common_signin_btn_text_disabled_focus_dark = 0x7f02000e; public static final int common_signin_btn_text_disabled_focus_light = 0x7f02000f; public static final int common_signin_btn_text_disabled_light = 0x7f020010; public static final int common_signin_btn_text_focus_dark = 0x7f020011; public static final int common_signin_btn_text_focus_light = 0x7f020012; public static final int common_signin_btn_text_light = 0x7f020013; public static final int common_signin_btn_text_normal_dark = 0x7f020014; public static final int common_signin_btn_text_normal_light = 0x7f020015; public static final int common_signin_btn_text_pressed_dark = 0x7f020016; public static final int common_signin_btn_text_pressed_light = 0x7f020017; public static final int ic_plusone_medium_off_client = 0x7f020019; public static final int ic_plusone_small_off_client = 0x7f02001a; public static final int ic_plusone_standard_off_client = 0x7f02001b; public static final int ic_plusone_tall_off_client = 0x7f02001c; public static final int powered_by_google_dark = 0x7f02001d; public static final int powered_by_google_light = 0x7f02001e; } public static final class id { public static final int book_now = 0x7f050010; public static final int buyButton = 0x7f05000a; public static final int buy_now = 0x7f05000f; public static final int buy_with_google = 0x7f05000e; public static final int classic = 0x7f050011; public static final int grayscale = 0x7f050012; public static final int holo_dark = 0x7f050005; public static final int holo_light = 0x7f050006; public static final int hybrid = 0x7f050004; public static final int match_parent = 0x7f05000c; public static final int monochrome = 0x7f050013; public static final int none = 0x7f050000; public static final int normal = 0x7f050001; public static final int production = 0x7f050007; public static final int sandbox = 0x7f050008; public static final int satellite = 0x7f050002; public static final int selectionDetails = 0x7f05000b; public static final int strict_sandbox = 0x7f050009; public static final int terrain = 0x7f050003; public static final int wrap_content = 0x7f05000d; } public static final class integer { public static final int google_play_services_version = 0x7f060000; } public static final class string { public static final int common_google_play_services_enable_button = 0x7f070001; public static final int common_google_play_services_enable_text = 0x7f070002; public static final int common_google_play_services_enable_title = 0x7f070003; public static final int common_google_play_services_error_notification_requested_by_msg = 0x7f070004; public static final int common_google_play_services_install_button = 0x7f070005; public static final int common_google_play_services_install_text_phone = 0x7f070006; public static final int common_google_play_services_install_text_tablet = 0x7f070007; public static final int common_google_play_services_install_title = 0x7f070008; public static final int common_google_play_services_invalid_account_text = 0x7f070009; public static final int common_google_play_services_invalid_account_title = 0x7f07000a; public static final int common_google_play_services_needs_enabling_title = 0x7f07000b; public static final int common_google_play_services_network_error_text = 0x7f07000c; public static final int common_google_play_services_network_error_title = 0x7f07000d; public static final int common_google_play_services_notification_needs_installation_title = 0x7f07000e; public static final int common_google_play_services_notification_needs_update_title = 0x7f07000f; public static final int common_google_play_services_notification_ticker = 0x7f070010; public static final int common_google_play_services_unknown_issue = 0x7f070011; public static final int common_google_play_services_unsupported_date_text = 0x7f070012; public static final int common_google_play_services_unsupported_text = 0x7f070013; public static final int common_google_play_services_unsupported_title = 0x7f070014; public static final int common_google_play_services_update_button = 0x7f070015; public static final int common_google_play_services_update_text = 0x7f070016; public static final int common_google_play_services_update_title = 0x7f070017; public static final int common_signin_button_text = 0x7f070018; public static final int common_signin_button_text_long = 0x7f070019; public static final int wallet_buy_button_place_holder = 0x7f07001f; } public static final class style { public static final int Theme_IAPTheme = 0x7f080000; public static final int WalletFragmentDefaultButtonTextAppearance = 0x7f080001; public static final int WalletFragmentDefaultDetailsHeaderTextAppearance = 0x7f080002; public static final int WalletFragmentDefaultDetailsTextAppearance = 0x7f080003; public static final int WalletFragmentDefaultStyle = 0x7f080004; } public static final class styleable { public static final int[] AdsAttrs = { 0x7f010000, 0x7f010001, 0x7f010002 }; public static final int AdsAttrs_adSize = 0; public static final int AdsAttrs_adSizes = 1; public static final int AdsAttrs_adUnitId = 2; public static final int[] MapAttrs = { 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010 }; public static final int MapAttrs_cameraBearing = 1; public static final int MapAttrs_cameraTargetLat = 2; public static final int MapAttrs_cameraTargetLng = 3; public static final int MapAttrs_cameraTilt = 4; public static final int MapAttrs_cameraZoom = 5; public static final int MapAttrs_mapType = 0; public static final int MapAttrs_uiCompass = 6; public static final int MapAttrs_uiRotateGestures = 7; public static final int MapAttrs_uiScrollGestures = 8; public static final int MapAttrs_uiTiltGestures = 9; public static final int MapAttrs_uiZoomControls = 10; public static final int MapAttrs_uiZoomGestures = 11; public static final int MapAttrs_useViewLifecycle = 12; public static final int MapAttrs_zOrderOnTop = 13; public static final int[] WalletFragmentOptions = { 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015 }; public static final int WalletFragmentOptions_environment = 1; public static final int WalletFragmentOptions_fragmentMode = 3; public static final int WalletFragmentOptions_fragmentStyle = 2; public static final int WalletFragmentOptions_theme = 0; public static final int[] WalletFragmentStyle = { 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020 }; public static final int WalletFragmentStyle_buyButtonAppearance = 3; public static final int WalletFragmentStyle_buyButtonHeight = 0; public static final int WalletFragmentStyle_buyButtonText = 2; public static final int WalletFragmentStyle_buyButtonWidth = 1; public static final int WalletFragmentStyle_maskedWalletDetailsBackground = 6; public static final int WalletFragmentStyle_maskedWalletDetailsButtonBackground = 8; public static final int WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance = 7; public static final int WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance = 5; public static final int WalletFragmentStyle_maskedWalletDetailsLogoImageType = 10; public static final int WalletFragmentStyle_maskedWalletDetailsLogoTextColor = 9; public static final int WalletFragmentStyle_maskedWalletDetailsTextAppearance = 4; } }
[ "trebuchet90@yahoo.com" ]
trebuchet90@yahoo.com
d17c471dbb73dc46f037a8fac18dc4b660ee6a96
77389498c8802fa31ea06ddad4e2b7336a2c5b23
/java/src/mbp/common/db/Database.java
a6e33a04a3d9d6524e1cde8d12214f00cab53fab
[]
no_license
semvdwal/example-code
67b26d1532d099a11e56a042bd4281a18e5bbb8e
848de961cdd6c480a350dc79a2bc12b43d2a4123
refs/heads/master
2021-01-01T18:00:00.924433
2017-07-24T17:52:50
2017-07-24T17:52:50
98,218,887
0
0
null
null
null
null
UTF-8
Java
false
false
23,793
java
package mbp.common.db; import com.mongodb.MongoClient; import com.mongodb.client.AggregateIterable; import com.mongodb.client.FindIterable; import com.mongodb.client.MongoDatabase; import com.mongodb.client.model.Filters; import com.mongodb.client.result.UpdateResult; import com.wwk.meubelplan.common.db.SelectionFilter; import org.bson.Document; import org.bson.types.ObjectId; import java.util.Date; import java.util.logging.Logger; import static java.util.Arrays.asList; /** * Created by sem on 05-04-14. */ public class Database { private static final Logger logger = Logger.getLogger("Database"); private static int maxRetries = 5; private MongoClient mongoClient; private MongoDatabase db; private boolean batchMode = false; private String dbaseLocation = "remote:localhost/meubelplan-develop-2"; private String username = "admin"; private String password = "admin"; private static ThreadLocal<Database> instance; /** * Saves current instance in */ public Database(String username, String password){ if(username != null && password != null) { this.username = username; this.password = password; } } /** * Gets a database instance * @return A database instance */ public static Database getInstance(String username, String password){ if(instance == null){ instance = new ThreadLocal<>(); } if(instance.get() == null){ instance.set(new Database(username, password)); } return instance.get(); } public static Database getInstance(){ return getInstance(null, null); } /** * Opens a new connection to the database */ public void openDatabase(){ openDatabase(false); } /** * Opens a new connection to the database */ public void openDatabase(Boolean force){ if(mongoClient == null){ mongoClient = new MongoClient(); } if(db == null || force) db = mongoClient.getDatabase("mbp"); } /** * Start batch mode, database will not be closed until batch mode ends */ public void startBatch(){ openDatabase(); batchMode = true; } /** * Ends batch mode, closing the database */ public void endBatch(){ batchMode = false; closeDatabase(); } /** * Creates a new instance from an entity which can be used in the database * @param c The class of the entity to find an instance from (use entities within com.wwk.webshopconnect.entities) * @return An instance of the given class, enriched for use with the database */ public <T extends Model> T newEntityInstance(Class<T> c){ T result = null; try{ openDatabase(); result = c.newInstance(); }catch (Exception e){ logger.warning("Could not create new database entity instance: "+e.getMessage()); e.printStackTrace(); }finally { closeDatabase(); } return result; } /** * Retrieves an object from the database based on * @param dbId The database id of the object which is requested * @return The request object */ public <T extends Model> T get(String dbId, Class<T> c){ try { return get(new ObjectId(dbId), c); } catch (IllegalArgumentException e) { return null; } } /** * Retrieves an object from the database based on * @param objectId The database recordId of the object which is requested * @return The request object */ public <T extends Model> T get(ObjectId objectId, Class<T> c){ if(objectId == null) return null; T result = null; try{ openDatabase(); FindIterable<Document> iterable = db.getCollection(c.getSimpleName()).find(new Document("_id", objectId)).limit(1); Document document = iterable.first(); if(document != null){ result = c.newInstance(); result.setDocument(document); } else { logger.info("Could not find document of type "+c.getSimpleName()+" with objectId "+objectId.toHexString()); } }catch (Exception e){ logger.warning("Could not load object from database ("+e.getClass().getSimpleName()+"): " + e.getMessage()); }finally{ closeDatabase(); } return result; } /** * Retrieves an document from the database * @param objectId The database recordId of the object which is requested * @return The requested document */ public Document get(ObjectId objectId){ logger.warning("Cannot get document without class / collection name"); return null; } /** * Retrieves all objects for a specific class from the database * @param tClass The class to find al objects for * @return DatabaseIterator An iterator which can be used to iterate over the resulting objects */ public <T extends Model> DatabaseResult<T> getALL(Class<T> tClass){ try { openDatabase(); return new DatabaseResult<>(tClass, db.getCollection(tClass.getSimpleName()).find()); }catch (Exception e){ logger.warning("Could not browse class in database: "+e.getMessage()); e.printStackTrace(); }finally{ closeDatabase(); } return null; } /** * Retrieves all objects matching a particular query. * @param tClass The class for which to execute the query * @param filter The filter to use for this query * @return A list of objects matching the query, of the given class type */ public <T extends Model> DatabaseResult<T> query(Class<T> tClass, Document filter){ return query(tClass, filter, 0); } /** * Retrieves all objects matching a particular query. * @param tClass The class for which to execute the query * @param filter The filter to use for this query * @param retries The number of times the function has already been called * @return A list of objects matching the query, of the given class type */ public <T extends Model> DatabaseResult<T> query(Class<T> tClass, Document filter, int retries){ try { openDatabase(); return new DatabaseResult<>(tClass, db.getCollection(tClass.getSimpleName()).find(filter)); }catch (Exception e){ logger.warning("Could not query database: "+e.getMessage()); e.printStackTrace(); }finally{ closeDatabase(); } return null; } /** * Aggregate query results * @param tClass The class for which to execute the aggregation * @param group The group selection for this aggregation * @param <T> The class type * @return Found documents */ public <T extends Model> AggregateIterable<Document> aggregate(Class<T> tClass, Document group){ return aggregate(tClass, group, null); } /** * Aggregate query results * @param tClass The class for which to execute the aggregation * @param group The group selection for this aggregation * @param filter The filter for this aggregation * @param <T> The class type * @return Found documents */ public <T extends Model> AggregateIterable<Document> aggregate(Class<T> tClass, Document group, Document filter){ try { openDatabase(); if(filter != null) { return db.getCollection(tClass.getSimpleName()).aggregate(asList(new Document("$match", filter), new Document("$group", group))); } else { return db.getCollection(tClass.getSimpleName()).aggregate(asList(new Document("$group", group))); } } catch (Exception e) { logger.warning("Could not query database: "+e.getMessage()); e.printStackTrace(); } finally { closeDatabase(); } return null; } /** * Retrieves all objects matching a particular query. * @param filter The filter to use for this query * @return A list of objects matching the query, of the given class type */ public FindIterable<Document> queryDocuments(Document filter, Class dClass){ return queryDocuments(filter, dClass, 0); } /** * Retrieves all objects matching a particular query. * @param filter The filter to use for this query * @param retries The number of times the function has already been called * @return A list of objects matching the query, of the given class type */ public FindIterable<Document> queryDocuments(Document filter, Class dClass, int retries){ try { openDatabase(); return db.getCollection(dClass.getSimpleName()).find(filter); }catch (Exception e){ logger.warning("Could not query (documents) database: "+e.getMessage()); e.printStackTrace(); }finally{ closeDatabase(); } return null; } /** * Retrieves all objects matching a query, using a specific selection (mostly used for aggregation functions) * @param filter The filter to use * @param customSelect The custom select string * @return A list of documents resulting from the query */ public FindIterable<Document> queryCustomSelect(SelectionFilter filter, String customSelect){ return queryCustomSelect(filter, customSelect, 0); } /** * Retrieves all objects matching a query, using a specific selection (mostly used for aggregation functions) * @param filter The filter to use * @param customSelect The custom select string * @param retries The number of times the function has already been called * @return A list of documents resulting from the query */ public FindIterable<Document> queryCustomSelect(SelectionFilter filter, String customSelect, int retries){ logger.warning("queryCustomSelect no longer supported"); return null; } /** * Create a new index with default type for the given class and property * @param className The name of the class to add the index for * @param property The property to add the index for */ public void createIndex(String className, String property){ createIndex(className, property, "notunique"); } /** * Create a new index with specified type for the given class and property * @param className The name of the class to add the index for * @param property The property to add the index for * @param type The type of index to create */ public void createIndex(String className, String property, String type){ try { openDatabase(); // TODO Create index }catch (Exception e){ logger.warning("Could not create index: "+e.getMessage()); e.printStackTrace(); }finally { closeDatabase(); } } /** * Saves an object to the database. The object must be an instance, retrieved from the database, or created through * the method newEntityInstance. * @param dbObject The object to save to the database * @return The bound object if successful or null if not successful */ public <T extends Model> T save(T dbObject){ if(dbObject == null || dbObject.getDocument() == null){ logger.warning("Trying to store null!"); return null; } dbObject.setUpdateDate(new Date()); return save(dbObject, 0); } /** * Saves an object to the database. The object must be an instance, retrieved from the database, or created through * the method newEntityInstance. * @param dbObject The object to save to the database * @param retries The number of times the function has already been called * @return The bound object if successful or null if not successful */ private <T extends Model> T save(T dbObject, int retries){ Document result = null; if(dbObject == null || dbObject.getDocument() == null){ logger.warning("Trying to store null!"); return null; } if(!dbObject.validate(false)){ // TODO: Handle validation error } if(dbObject.getObjectId() != null){ T oldObject = null; try { oldObject = get(dbObject.getObjectId(), (Class<T>) dbObject.getClass()); } catch (Exception e){ logger.info("Could not get oldObject for comparison"); } if(oldObject != null){ dbObject.updateBeforeSave(oldObject); } else { dbObject.updateBeforeSave(null); } } else { dbObject.updateBeforeSave(null); } try { openDatabase(); if(dbObject.getObjectId() != null){ db.getCollection(dbObject.getClassName()).replaceOne(Filters.eq("_id", dbObject.getObjectId()), dbObject.getDocument()); } else { db.getCollection(dbObject.getClassName()).insertOne(dbObject.getDocument()); } }catch (Exception e){ logger.warning("General exception while saving object ("+dbObject.getClass().getSimpleName()+") to database: "+e.getMessage()); try { logger.warning("JSON: " + dbObject.getDocument().toJson()); } catch (Exception e1){ if(dbObject.getObjectId() != null) { logger.info("ObjectId: " + dbObject.getObjectId().toHexString()); } } e.printStackTrace(); if(e.getCause() != null) { logger.warning("Caused by:"); logger.warning(e.getCause().getMessage()); e.getCause().printStackTrace(); } }finally{ closeDatabase(); } return dbObject; } /** * Update a single document * @param tClass The class to update (collection name) * @param filter The filter to use to select documents to update * @param update The fields with new values to update * @param <T> tClass needs to extend Model * @return The update count (1 if successful) */ public <T extends Model> long updateOne(Class<T> tClass, Document filter, Document update){ try { openDatabase(); UpdateResult result = db.getCollection(tClass.getSimpleName()).updateOne(filter, update); return result.getModifiedCount(); } catch (Exception e) { logger.info("Error on updateOne: "+e.getMessage()); } finally { closeDatabase(); } return 0L; } /** * Update many documents * @param tClass The class to update (collection name) * @param filter The filter to use to select documents to update * @param update The fields with new values to update * @param <T> tClass needs to extend Model * @return The update count (higher than 0 if successful) */ public <T extends Model> long updateMany(Class<T> tClass, Document filter, Document update){ try { openDatabase(); UpdateResult result = db.getCollection(tClass.getSimpleName()).updateMany(filter, update); return result.getModifiedCount(); } catch (Exception e) { logger.info("Error on updateMany: "+e.getMessage()); } finally { closeDatabase(); } return 0L; } /** * Counts the number of records of the given class * @param tClass The class to count * @return int The number of records found */ public long count(Class tClass){ return count(tClass, 0); } /** * Counts the number of records of the given class * @param tClass The class to count * @param retries The number of times the function has already been called * @return int The number of records found */ public long count(Class tClass, int retries){ long result = 0; try{ openDatabase(); result = db.getCollection(tClass.getSimpleName()).count(); }catch (Exception e){ logger.warning("Could not count objects of class " + tClass.getSimpleName() + ", reason: " + e.getMessage()); }finally{ closeDatabase(); } return result; } /** * Counts the number of records of the given class * @param tClass The class to count * @param filter The filter to use on this query count * @return int The number of records found */ public long count(Class tClass, Document filter){ return count(tClass, filter, 0); } /** * Counts the number of records of the given class * @param tClass The class to count * @param filter The filter to use on this query count * @param retries The number of times the function has already been called * @return int The number of records found */ public long count(Class tClass, Document filter, int retries){ long result = 0; try{ openDatabase(); result = db.getCollection(tClass.getSimpleName()).count(filter); }catch (Exception e){ logger.warning("Could not count objects of class " + tClass.getSimpleName() + ", reason: " + e.getMessage()); logger.info("Cause: "); e.printStackTrace(); if(e.getCause() != null) e.getCause().printStackTrace(); }finally{ closeDatabase(); } return result; } /** * Deletes an object from the database. * * @param dbObject The object to remove from the database */ public <T extends Model> void delete(T dbObject){ delete(dbObject, 0); } /** * Deletes an object from the database. * * @param dbObject The object to remove from the database * @param retries The number of times the function has already been called */ public <T extends Model> void delete(T dbObject, int retries){ if(dbObject == null || dbObject.getDocument() == null){ logger.warning("Trying to delete null document!"); return; } try{ openDatabase(); db.getCollection(dbObject.getClassName()).deleteOne(dbObject.getDocument()); }catch (Exception e){ logger.warning("Could not delete object from database: "+e.getMessage()); e.printStackTrace(); }finally{ closeDatabase(); } } /** * Deletes documents from database that match given class and filter document * @param tClass The class to delete documents for * @param filter The filter to use to select documents which will be deleted * @param <T> The class type has to be a Model */ public <T extends Model> void delete(Class<T> tClass, Document filter) { delete(tClass, filter, 0); } /** * Deletes documents from database that match given class and filter document * @param tClass The class to delete documents for * @param filter The filter to use to select documents which will be deleted * @param retries The number of retries * @param <T> The class type has to be a Model */ public <T extends Model> void delete(Class<T> tClass, Document filter, int retries) { if(filter == null) return; try{ openDatabase(); db.getCollection(tClass.getSimpleName()).deleteMany(filter); }catch (Exception e){ logger.warning("Could not delete object from database (filter "+filter.toJson()+"): "+e.getMessage()); e.printStackTrace(); }finally{ closeDatabase(); } } /** * Closes the database instance */ public void closeDatabase(){ closeDatabase(false); } /** * Closes the database instance */ public void closeDatabase(boolean force){ if(force) { try { if(db != null){ logger.info("Closing current db"); db = null; }else{ db = null; } } catch (Exception e){ logger.warning("Error closing database ["+e.getClass().getCanonicalName()+"]: "+e.getMessage()); } db = null; transaction = null; } } /** * Starts a new transaction * @return */ public boolean startTransaction(){ logger.warning("Transactions not supported"); return true; } /** * Commits the current transaction * @return */ public boolean endTransaction(){ logger.warning("Transactions not supported"); return true; } /** * Commits the current transaction * @return */ public boolean rollbackTransaction(){ logger.warning("Transactions not supported"); return true; } /** * Returns the record for a given user object * @param dbObject * @return */ @Deprecated public ObjectId getObjectId(Model dbObject){ if(dbObject.getDocument() != null){ return dbObject.getDocument().getObjectId("_id"); } return null; } /** * Serializes a sinlge object to json * @param dbObject Object * @return String */ @Deprecated public <T extends Model> String toJson(T dbObject){ if(dbObject == null || dbObject.getDocument() == null) return null; String json = dbObject.getDocument().toJson(); return json; } /** * Serializes a list of objects to json * @param dbObjects List<Object> * @return String */ @Deprecated public <T extends Model> String toJson(Iterable<T> dbObjects){ StringBuilder builder = new StringBuilder(); builder.append("["); for(Model dbObject : dbObjects){ String jsonString = toJson(dbObject); if(jsonString != null && !jsonString.equals("")) { if (builder.length() > 1) builder.append(","); builder.append(jsonString); }else{ if(dbObject == null){ logger.warning("Got empty object in list"); }else{ logger.warning("JSON String was empty for object "+dbObject.getDbId()); } } } builder.append("]"); return builder.toString(); } /** * * @param json String * @return Object */ @Deprecated public <T extends Model> T fromJson(String json, Class<T> c){ T object = null; try { object = c.newInstance(); object.setDocument(Document.parse(json)); } catch (Exception e){ logger.warning("Could not deserialize object from json: "+e.getMessage()); e.printStackTrace(); } finally { closeDatabase(); } return object; } }
[ "sem@sem-it.nl" ]
sem@sem-it.nl
4a3992807338c4e2390f73cbf18d830087d9e325
35a711e92c42d491489d7b56746a5d66353bd583
/Introduction/src/WindowPopoup.java
7bbf3c8aa916e251a43dcd64cee61be4405834ce
[]
no_license
vishalchopra790/Java
929149d79cf64bb437b6163f77d0e8fdfdf9760b
50218f5f123070012aef570b895d8cf686a63b72
refs/heads/master
2023-01-23T19:24:55.252335
2020-12-06T06:49:05
2020-12-06T06:49:05
318,970,466
0
0
null
null
null
null
UTF-8
Java
false
false
474
java
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class WindowPopoup { public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "C:\\XL_Apps\\eclipse\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://admin:admin@the-internet.herokuapp.com"); driver.findElement(By.linkText("Basic Auth")).click(); } }
[ "vishalchopra790@gmail.com" ]
vishalchopra790@gmail.com
7cad50febaeee5560e06c797312fde7492b193c2
4c9ca5d3da6e6da18d26ac1a3b588f4df610b990
/src/GUI/PopupMenuLayers.java
bb1ff553aad7d5e0bc7f5597b5f208ae6d1cb306
[]
no_license
Sanquira/ReactorPlanner
dae2cf15cafb066a15d602055c09c6d1027c438d
e74187a1dccbb4869f09f7953113d205a5f79428
refs/heads/master
2021-01-10T15:34:19.115885
2016-02-19T21:05:57
2016-02-19T21:05:57
52,116,158
0
0
null
null
null
null
UTF-8
Java
false
false
3,074
java
package GUI; import java.awt.event.ActionEvent; import java.io.FileNotFoundException; import java.io.IOException; import javax.swing.AbstractAction; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import math.field3d; import files.SaveLoadFile; import files.SaveTemplate; public class PopupMenuLayers extends JPopupMenu { public PopupMenuLayers(mainWindow mainWindow, field3d ff, int sx, int sy, int sz) { super(); add(new JMenuItem(new AbstractAction("Remove layer") { @Override public void actionPerformed(ActionEvent e) { ff.rstXY(sz); mainWindow.redraw(ff); } })); add(new JMenuItem(new AbstractAction("Remove all") { @Override public void actionPerformed(ActionEvent e) { ff.rstAll(); mainWindow.redraw(ff); } })); addSeparator(); add(new JMenuItem(new AbstractAction("New") { @Override public void actionPerformed(ActionEvent e) { String[] namesplit; try { namesplit = JOptionPane.showInputDialog("Insert new generator size (format: \"x y z\" eg. 11 11 15)").split(" "); } catch (NullPointerException e1) { return; } mainWindow.ff = new field3d(Integer.valueOf(namesplit[0]), Integer.valueOf(namesplit[1]), Integer.valueOf(namesplit[2])); mainWindow.repaint(); } })); add(new JMenuItem(new AbstractAction("Save as") { @Override public void actionPerformed(ActionEvent e) { try { String name = JOptionPane.showInputDialog("Save as (without .txt)"); if (name == null) return; SaveLoadFile.saveField(ff, name); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } })); add(new JMenuItem(new AbstractAction("Load from") { @Override public void actionPerformed(ActionEvent e) { String name = JOptionPane.showInputDialog("Load from (without .txt)"); if (name == null) return; try { SaveLoadFile.loadField(mainWindow, name); } catch (FileNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } })); addSeparator(); add(new JMenuItem(new AbstractAction("Save template") { @Override public void actionPerformed(ActionEvent e) { String name = JOptionPane.showInputDialog("Save as (without .smtpl)"); if (name == null) return; try { SaveTemplate.SaveTemp(ff, name); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } })); // add(new JMenuItem(new AbstractAction("Save templates with bounded size ") { // // @Override // public void actionPerformed(ActionEvent e) { // JOptionPane.showConfirmDialog(null, "Not implemented yet"); //// String name = JOptionPane.showInputDialog("Save as (without .smtpl)"); //// if (name == null) //// return; //// String size = JOptionPane.showInputDialog("Max bound size:"); //// if (size == null) //// return; //// SaveTemplate.SaveTempBounded(Integer.valueOf(size), ff, name); // } // })); } }
[ "sanquira.van.delbar@gmail.com" ]
sanquira.van.delbar@gmail.com
74677c7eb91cdc3a4449f631244b79d761857493
036be310b0916220dfb6296a4b7b920dd750620b
/cland/src/main/java/edu/vinaenter/util/Md5Util.java
1eb60e9b521f13da7913c8e6a843e44ea55686f7
[]
no_license
Tronghien98/cland
4673c4383c3d7eaa78de6797ec144f09cebd75a3
32f44a21dd77b1197ff5ce0777f405562984f164
refs/heads/master
2023-05-02T21:28:49.654838
2021-05-30T03:45:48
2021-05-30T03:45:48
372,110,428
0
0
null
null
null
null
UTF-8
Java
false
false
528
java
package edu.vinaenter.util; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Md5Util { public static String md5(String str){ String result = ""; MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); digest.update(str.getBytes()); BigInteger bigInteger = new BigInteger(1,digest.digest()); result = bigInteger.toString(16); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return result; } }
[ "andrew.hien98@gmail.com" ]
andrew.hien98@gmail.com
dddc51c3f4c9fd6381c867a9320e0330f139c08f
49e5d267c2306f9dc88836800cd87f6bfd7461a6
/univocity-trader-core/src/main/java/com/univocity/trader/utils/IncomingCandles.java
60d017f1ec389f08d1e6fb3f6bd7bf7506d72a7b
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
drkarl/univocity-trader
a6e6d9ec9fa56dad70fa2628e2b0bc48ad5198c4
26ccc0bd0b7024222ffa0ead2ea17c97a9c2c550
refs/heads/master
2023-03-13T12:24:30.944578
2021-03-10T00:03:16
2021-03-10T00:03:16
340,787,115
0
0
Apache-2.0
2021-03-09T23:42:56
2021-02-21T00:52:25
Java
UTF-8
Java
false
false
3,741
java
package com.univocity.trader.utils; import org.slf4j.*; import java.util.*; import java.util.concurrent.*; /** * A simple enumeration that receives candles from the exchange, which might come as a stream, and adds them to an * internal queue. The consumer of the enumeration will block if the queue becomes empty and the exchange is still * producing candles. The last call to {@link #nextElement()} might produce a {@code null} if the consumer * was blocked waiting for more candles, and the exchange finished adding candles to this internal queue. * * The {@link #iterator()} of this class ensures no {@code null} is produced so this can be used in for loops. * * If the consumer of candles returned by the exchange needs to stop processing them for some reason, * call {@link #stopConsuming()}. * * By default, after 30 seconds with an empty queue and without receiving anything since, * {@link #stopConsuming()} will be invoked automatically and abort the process. The {@link com.univocity.trader.Exchange} * implementation can check if {@link #consumerStopped()} produces {@code true} to close any open resources instead * of running indefinitely. * * @author uniVocity Software Pty Ltd - <a href="mailto:dev@univocity.com">dev@univocity.com</a> */ public class IncomingCandles<T> implements Enumeration<T>, Iterable<T> { private static final Logger log = LoggerFactory.getLogger(IncomingCandles.class); private final Queue<T> input = new ConcurrentLinkedQueue<>(); private final Object lock = new Object(); private boolean noMoreCandles = false; private boolean consuming = true; private final long timeout; public IncomingCandles() { this(30_000); } public IncomingCandles(long timeout) { this.timeout = timeout; } public void stopProducing() { noMoreCandles = true; notifyNotEmpty(); } public final void stopConsuming() { consuming = false; notifyNotEmpty(); } public final boolean consumerStopped() { return !consuming; } public void add(T candle) { if (consuming) { input.offer(candle); notifyNotEmpty(); } else { log.warn("Consumer stopped. Rejected incoming candle {}", candle); } } @Override public final boolean hasMoreElements() { return consuming && (!noMoreCandles || !input.isEmpty()); } @Override public final T nextElement() { T out = input.poll(); while (out == null && consuming && !noMoreCandles) { waitWhileEmpty(); out = input.poll(); } return out; } private void notifyNotEmpty() { synchronized (lock) { lock.notifyAll(); } } private void waitWhileEmpty() { long waitStart = System.currentTimeMillis(); while (consuming && input.isEmpty() && !noMoreCandles) { synchronized (lock) { try { lock.wait(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (input.isEmpty() && System.currentTimeMillis() - waitStart >= timeout) { log.warn("Timeout waiting for candles to be returned from the exchange"); stopConsuming(); } } } @Override public final Iterator<T> iterator() { return new Iterator<>() { T next; @Override public final boolean hasNext() { if (next == null) { next = nextElement(); } return next != null; } @Override public final T next() { if (next == null) { throw new IllegalStateException("Can't invoke next() without checking if there are more elements with hasNext()"); } T out = next; next = null; return out; } }; } public static <C> IncomingCandles<C> fromCollection(Collection<C> candles) { IncomingCandles out = new IncomingCandles(); out.input.addAll(candles); out.stopProducing(); return (IncomingCandles<C>) out; } }
[ "jbax@univocity.com" ]
jbax@univocity.com
60d5f3ed0b4e87d1a20c5f27d219b3e896b7ed2e
42e0369e4adcff460d456b91e1cbbd71cd2330b2
/src/for문연습/forTest1.java
6f48aedf134d81b35ce7fc9b4aad70426733a00b
[]
no_license
changhwan09290/Javaclass
df77ec8c0268dd9b3bb80d86f363fcfe969c955f
15174585a21a7aa9ba4f57cbe1ba8bc2e2885996
refs/heads/master
2023-06-15T07:59:36.307192
2021-07-04T10:04:00
2021-07-04T10:04:00
382,818,033
0
0
null
null
null
null
UTF-8
Java
false
false
391
java
package for문연습; public class forTest1 { public static void main(String[] args) { // TODO Auto-generated method stub int num; for(num=1; num<=5; num++) { System.out.println(num); } System.out.println("for문 종료후"); System.out.println(num); //2,4,6,8,10...20 int i; for(i=2; i<=20; i+=2) {System.out.println("%3d");}; System.out.println(); } }
[ "hwan09290@naver.com" ]
hwan09290@naver.com
91a79511fbae35dd18eedb0e27c82b3ee3bcc5f1
0737d5af88cca5c11791c5e4627626f52b60b33e
/rabbitmq-producer/src/main/java/com/example/boot/rabbitmq/MainConfig.java
5a9fae936c86cc6a66b9ec86a2c30492c786dd5f
[]
no_license
myzou/boot-use
d2dd7891af32c33dbccef358c931917429f713fa
b54ec1e138883aaa04a2899461db2daf9a7fba50
refs/heads/master
2022-06-27T02:15:24.529684
2019-08-30T01:53:47
2019-08-30T01:53:47
205,284,232
1
0
null
2022-06-17T02:27:11
2019-08-30T01:52:54
Java
UTF-8
Java
false
false
249
java
package com.example.boot.rabbitmq; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @ComponentScan("com.example.boot.rabbitmq.*") public class MainConfig { }
[ "944711140@qq.com" ]
944711140@qq.com
0bfe22f29977f75680fe0c62082d33a474ed9f97
3d48ddc132b5de638675626c9c0eac1e6d71d436
/src/main/java/com/infosys/project/user/entity/Wishlist.java
6cd8e033ceb0af766e0823cfb5f27478e3af6f22
[]
no_license
AyanPal1998/user
78c7c86e46c29a1f0411cb6f35331fa00f83600a
fb454fd1424af1c1fb0697e366f20aa140e0714d
refs/heads/master
2023-03-30T11:05:23.492413
2021-03-18T04:13:48
2021-03-18T04:13:48
348,934,899
0
0
null
null
null
null
UTF-8
Java
false
false
717
java
package com.infosys.project.user.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; @Entity @Table(name = "wishlist") @IdClass(WishlistId.class) public class Wishlist { @Id @Column(name = "buyerid", unique = true, nullable = false, length = 11) Long buyerId; @Id @Column(name = "prodid", unique = true, nullable = false, length = 11) Long prodId; public Long getBuyerId() { return buyerId; } public void setBuyerId(Long buyerId) { this.buyerId = buyerId; } public Long getProdId() { return prodId; } public void setProdId(Long prodId) { this.prodId = prodId; } }
[ "gst.ayanpal@gmail.com" ]
gst.ayanpal@gmail.com
27445bdd4a55ee3787541332c19238c5fae7333d
35c45f90f49632d3181a4c85c183fbe5593cbf59
/src/main/java/com/refugio/web/DAO/IUsuarioDAO.java
ccf88eb260ceb5b1f1ca36aa4e59110cab220ff0
[]
no_license
nico-caro/refugio
e598416a224bec2291c95da8452d85fb1516a419
d39408be1ab351cf0b8d253743bc2d3115bca723
refs/heads/master
2021-09-25T05:55:55.803320
2018-10-18T22:33:17
2018-10-18T22:33:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
206
java
package com.refugio.web.DAO; import org.springframework.data.repository.CrudRepository; import com.refugio.web.entity.Usuario; public interface IUsuarioDAO extends CrudRepository<Usuario, Integer>{ }
[ "ni.caroc@duoc.cl" ]
ni.caroc@duoc.cl
ba646afb1864d8afb71b0bc276685214fcc54f4c
da181f89e0b26ffb3fc5f9670a3a5f8f1ccf0884
/CoreGestionTextilLevel/src/ar/com/textillevel/entidades/documentos/factura/itemfactura/ItemFacturaRecargo.java
9102d5a67eba2415da16f024f6a7f0f178ea6f65
[]
no_license
nacho270/GTL
a1b14b5c95f14ee758e6b458de28eae3890c60e1
7909ed10fb14e24b1536e433546399afb9891467
refs/heads/master
2021-01-23T15:04:13.971161
2020-09-18T00:58:24
2020-09-18T00:58:24
34,962,369
2
1
null
2016-08-22T22:12:57
2015-05-02T20:31:49
Java
UTF-8
Java
false
false
532
java
package ar.com.textillevel.entidades.documentos.factura.itemfactura; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.Transient; import ar.com.textillevel.entidades.enums.ETipoItemFactura; @Entity @DiscriminatorValue(value="ITR") public class ItemFacturaRecargo extends ItemFactura{ private static final long serialVersionUID = -9213799408568357101L; @Override @Transient public ETipoItemFactura getTipo() { return ETipoItemFactura.RECARGO; } }
[ "ignaciocicero@gmail.com@9de48aec-ec99-11dd-b2d9-215335d0b316" ]
ignaciocicero@gmail.com@9de48aec-ec99-11dd-b2d9-215335d0b316
cde8767c0706e187aee6cdb0532b63c932d86031
78f29ebe1b1b43b7dc001d7008fd0ec4082963b5
/Implementare/src/smarthouse/ontology/beanynizer/ElectricalCooker.java
fca31c50de85d11ca1171aa3b4b3ab732d192362
[]
no_license
yhkim93/context-aware-smarthome
4aa889394860bde096e74864820f6ceb65274781
536b208af92c548de7aa8ad62b64e8595cbb2ba3
refs/heads/master
2021-01-10T21:11:46.774799
2009-07-11T08:12:32
2009-07-11T08:12:32
42,921,230
0
0
null
null
null
null
UTF-8
Java
false
false
3,515
java
/* * $class.javaName.java * * Generated by Protege plugin Beanynizer. * This class implements the functionality of ElectricalCooker. * Feel free to change. * */ package smarthouse.ontology.beanynizer; /** * Editable Java class for concept <code>ElectricalCooker</code> of SmartHouseOntology ontology. */ public class ElectricalCooker extends ElectricalCookerData implements nuggets.INugget { //-------- constructors -------- /** * Default Constructor. <br> * Create a new <code>ElectricalCooker</code>. */ public ElectricalCooker() { // Empty constructor required for JavaBeans (do not remove). } /** * Init Constructor. <br> * Create a new <code>ElectricalCooker</code>. * @param devicestatus * @param haslocation * @param instancename * @param timestamp */ public ElectricalCooker(String devicestatus, Location haslocation, String instancename, String timestamp) { // Constructor using required slots (change if desired). setDeviceStatus(devicestatus); setHasLocation(haslocation); setInstanceName(instancename); setTimestamp(timestamp); } /** * Clone Constructor. <br> * Create a new <code>ElectricalCooker</code>.<br> * Copy all attributes from <code>proto</code> to this instance. * * @param proto The prototype instance. */ public ElectricalCooker(ElectricalCooker proto) { setDeviceStatus(proto.getDeviceStatus()); setHasLocation(proto.getHasLocation()); setInstanceName(proto.getInstanceName()); setTimestamp(proto.getTimestamp()); } //-------- custom code -------- //-------- Object methods ----- /** * Get a string representation of this <code>ElectricalCooker</code>. * @return The string representation. */ public String toString() { return "ElectricalCooker(" + "devicestatus="+getDeviceStatus() + ", haslocation="+getHasLocation() + ", instancename="+getInstanceName() + ", timestamp="+getTimestamp() + ")"; } /** * Get a clone of this <code>ElectricalCooker</code>. * @return a shalow copy of this instance. */ public Object clone() { return new ElectricalCooker(this); } /** * Test the equality of this <code>ElectricalCooker</code> * and an object <code>obj</code>. * * @param obj the object this test will be performed with * @return false if <code>obj</code> is not of <code>ElectricalCooker</code> class, * true if all attributes are equal. */ public boolean equals(Object obj) { if (obj instanceof ElectricalCooker) { ElectricalCooker cmp=(ElectricalCooker)obj; if (getDeviceStatus()!=cmp.getDeviceStatus() && (getDeviceStatus()==null || !getDeviceStatus().equals(cmp.getDeviceStatus())) ) return false; if (getHasLocation()!=cmp.getHasLocation() && (getHasLocation()==null || !getHasLocation().equals(cmp.getHasLocation())) ) return false; if (getInstanceName()!=cmp.getInstanceName() && (getInstanceName()==null || !getInstanceName().equals(cmp.getInstanceName())) ) return false; if (getTimestamp()!=cmp.getTimestamp() && (getTimestamp()==null || !getTimestamp().equals(cmp.getTimestamp())) ) return false; return true; } return false; } }
[ "belikebigboy@gmail.com" ]
belikebigboy@gmail.com
12d02d401e54252cd3318dd245cccac0cb66656c
f36718c698bbb22f0a10e3c771a1da5c7d19050b
/src/main/java/controller/Controller.java
bfac95d78cc2a3dad66006d6e6e9b8dcd5efcf9d
[]
no_license
KenzoCoenaerts-r0683311/testing_webshop
8131ec13ca9e0d2a8b43c55f0bba899c894e0374
800c3b3b6e9b1bfbe1a18cfb9d657a7c11abfe08
refs/heads/master
2020-04-07T22:03:33.636422
2018-12-14T12:08:02
2018-12-14T12:08:02
158,457,137
0
0
null
null
null
null
UTF-8
Java
false
false
2,491
java
package controller; import java.io.IOException; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.Properties; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; 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 javax.ws.rs.NotAuthorizedException; import controller.handler.RequestHandler; import domain.*; /** * Servlet implementation class UserController */ @WebServlet("/Controller") public class Controller extends HttpServlet { private static final long serialVersionUID = 1L; private ShopService shopService; private ControllerFactory controllerFactory = new ControllerFactory(); public Controller() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } @Override public void init() throws ServletException { super.init(); ServletContext context = getServletContext(); Properties properties = new Properties(); Enumeration<String> paramNames = context.getInitParameterNames(); while (paramNames.hasMoreElements()) { String propertyName = paramNames.nextElement(); properties.setProperty(propertyName, context.getInitParameter(propertyName)); } shopService = new ShopService(properties); } protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String action = request.getParameter("action"); String destination = "index.jsp"; RequestHandler handler = null; if (action != null) { try { handler = controllerFactory.getController(action, shopService); destination = handler.handleRequest(request, response); } catch (NotAuthorizedException exc) { List<String> errors = new ArrayList<String>(); errors.add(exc.getMessage()); request.setAttribute("errors", errors); destination = "index.jsp"; } } RequestDispatcher view = request.getRequestDispatcher(destination); view.forward(request, response); } }
[ "kenzo.coenaerts@student.ucll.be" ]
kenzo.coenaerts@student.ucll.be
ae86280d5bf6a395a36a3a987943be7a87e3c5e6
c7c97005df468f907260efed9a7cf56c8edfb5ab
/src/main/java/com/github/generator/expersions/functions/Date.java
7c351ad7fc088b23eff48b4f6ad81bb1e4629fe5
[]
no_license
EtaCassiopeia/EasyGen
88b82e173dd4295ed85f35c3e93c3900575ed439
11a8b4708b253572e95f1352c7e931707f78ea10
refs/heads/master
2021-01-17T08:25:05.845188
2017-03-04T13:32:30
2017-03-04T13:32:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
556
java
package com.github.generator.expersions.functions; import com.github.generator.expersions.Expersion; import java.text.SimpleDateFormat; /** * Created by Mostafa on 02/17/2017. */ public class Date extends Expersion { private SimpleDateFormat dateFormat; public Date() { dateFormat = new SimpleDateFormat(); } public Date(String pattern) { dateFormat = new SimpleDateFormat(pattern); } @Override public String generate() throws Exception { return dateFormat.format(new java.util.Date()); } }
[ "mostafa.asg@gmail.com" ]
mostafa.asg@gmail.com
2c074928bfd9dd5d993fb5542a3c9af74bb1cf39
46167791cbfeebc8d3ddc97112764d7947fffa22
/spring-boot/src/main/java/com/justexample/entity/Entity1663.java
06e9f455e2a83fcd37768a66617ce4b97c6679d0
[]
no_license
kahlai/unrealistictest
4f668b4822a25b4c1f06c6b543a26506bb1f8870
fe30034b05f5aacd0ef69523479ae721e234995c
refs/heads/master
2023-08-25T09:32:16.059555
2021-11-09T08:17:22
2021-11-09T08:17:22
425,726,016
0
0
null
null
null
null
UTF-8
Java
false
false
1,134
java
package com.justexample.entity; import java.sql.Timestamp; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Entity1663 { @Id private Long id; private String code; private String name; private String status; private int seq; private Timestamp createdDate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } 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 int getSeq() { return seq; } public void setSeq(int seq) { this.seq = seq; } public Timestamp getCreatedDate() { return createdDate; } public void setCreatedDate(Timestamp createdDate) { this.createdDate = createdDate; } }
[ "laikahhoe@gmail.com" ]
laikahhoe@gmail.com
f5e84bbcb9fe65282661445fde1d9eed3a3c0d00
a1d1fe67052559643ad77cf237cc562c74b54836
/SuperHeroes/Heroes/src/main/java/com/sg/heroes/model/Hero.java
a4b964dbf6d56e382f011404dfcb35322dd35d7d
[]
no_license
kellermartin13/superHero
e59d35795a7f09c0a7b6b852bb95c02d3aa5d927
9bfdc8cf04f324b3c922d0deca415582d899b1ee
refs/heads/master
2020-03-22T20:07:20.419466
2018-07-13T13:03:55
2018-07-13T13:03:55
140,574,025
0
0
null
null
null
null
UTF-8
Java
false
false
666
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.sg.heroes.model; import java.util.List; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; /** * * @author Keller Martin */ @Getter @Setter @NoArgsConstructor @AllArgsConstructor @ToString @EqualsAndHashCode public class Hero { private Integer heroId; private String name; private String description; private List<Power> powers; }
[ "kellermartin13@gmail.com" ]
kellermartin13@gmail.com
d0ad896c20400c9c5bbb4ea236b2bb1650bd6592
8824eca5f1219697c13af33be464e58db236dac7
/workspace/2021_02_14/src/ラムダ式黒本9_23/Main.java
c7739280c18eb8166a16b5b3bb9b5650891e4dc8
[]
no_license
KudoYumi/test
774d019e6c38c28627823be7f3d5e404199f6315
3cb03a25ad5f591b5f832618468259922a5e4d5e
refs/heads/main
2023-04-02T04:41:42.467743
2021-03-29T15:08:21
2021-03-29T15:08:21
319,495,604
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package ラムダ式黒本9_23; public class Main { static String val = "A"; String name; public static void main(String[] args) { Function f2 = val -> System.out.println(val); System.out.println(val); Function f = (String val) -> System.out.println(val); f.test(val); System.out.println(val); // new Main().call(); } public void call() { Function f2 = val -> System.out.println(val); f2.test(name); } /* つまりローカル変数の名kで * */ }
[ "lady30romance1986@gmail.com" ]
lady30romance1986@gmail.com
efb091329d732a611796979688cc00135deed284
b90d8fb31d3b8b2cda56f0c2ed8c6e66d2850ee3
/src/main/java/com/springframework/controllers/GetterInjectedController.java
7ec745a94bda0b50c796598a0d18e7af637b1d55
[]
no_license
tahayvz/spring5-di-demo
3e511c1dcd7c99f3f1e8bca10f52e31fd849fca1
b26a4c241f619cdd332947b49aea334bde26a3c0
refs/heads/master
2022-11-11T02:58:34.432077
2020-06-24T20:19:18
2020-06-24T20:19:18
273,689,218
0
0
null
null
null
null
UTF-8
Java
false
false
629
java
package com.springframework.controllers; import com.springframework.services.GreetingService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; @Controller public class GetterInjectedController { private GreetingService greetingService; public String sayHello(){ return greetingService.sayGreeting(); } @Autowired public void setGreetingService(@Qualifier("getterGreetingService") GreetingService greetingService) { this.greetingService = greetingService; } }
[ "45938952+tahayvz@users.noreply.github.com" ]
45938952+tahayvz@users.noreply.github.com
1b857c65c4075a69b380bae2d74b9c2d37781e9f
30472cec0dbe044d52b029530051ab404701687f
/src/main/java/com/nawforce/platform/ConnectApi/ActionLinkGroupDefinition.java
86df38198faebdcf61b7d7c2c1cd7ea4e1be74cc
[ "BSD-3-Clause" ]
permissive
madmax983/ApexLink
f8e9dcf8f697ed4e34ddcac353c13bec707f3670
30c989ce2c0098097bfaf586b87b733853913155
refs/heads/master
2020-05-07T16:03:15.046972
2019-04-08T21:08:06
2019-04-08T21:08:06
180,655,963
1
0
null
2019-04-10T20:08:30
2019-04-10T20:08:30
null
UTF-8
Java
false
false
2,517
java
/* [The "BSD licence"] Copyright (c) 2019 Kevin Jones 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. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.nawforce.platform.ConnectApi; import com.nawforce.platform.System.Boolean; import com.nawforce.platform.System.Double; import com.nawforce.platform.System.Integer; import com.nawforce.platform.System.String; import com.nawforce.platform.System.*; @SuppressWarnings("unused") public class ActionLinkGroupDefinition { public List<ActionLinkDefinition> actionLinks; public PlatformActionGroupCategory category; public Datetime createdDate; public ActionLinkExecutionsAllowed executionsAllowed; public Datetime expirationDate; public String id; public Datetime modifiedDate; public String templateId; public String url; public ActionLinkGroupDefinition() {throw new java.lang.UnsupportedOperationException();} public Boolean equals$(Object obj) {throw new java.lang.UnsupportedOperationException();} public Double getBuildVersion() {throw new java.lang.UnsupportedOperationException();} public Integer hashCode$() {throw new java.lang.UnsupportedOperationException();} public String toString$() {throw new java.lang.UnsupportedOperationException();} }
[ "nawforce@gmail.com" ]
nawforce@gmail.com
03aef098f3d61eacf4da9314f6b7ac02f9fa5546
4a20db2ee46f00135b2cd807d180a61497046900
/app/utils/RSSBodyParser.java
27cf635bdd2975f9734d4b7aa1470f71a63cb85f
[]
no_license
pepite/ch07
edc68b2bf9f525f0fe8157ab2ceb0d8ff0198849
7ad0e4b7b405558e26ab9525f00ce6f0d7307ff7
refs/heads/master
2021-01-24T06:25:50.790557
2012-11-26T13:27:06
2012-11-26T13:27:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
91
java
package utils; import play.mvc.BodyParser.*; public class RSSBodyParser extends Xml { }
[ "leroux.nicolas@gmail.com" ]
leroux.nicolas@gmail.com
16b4abfbdef89aa219dc39ecf5326e96321bc551
491326a95237547f13de0120fc2c761f883f775d
/src/main/java/id/co/bfi/dmsuploadscheduler/config/yaml/JasyptConfig.java
07b913bc006466c4c4ed8982ad3c1f6838860a7c
[]
no_license
ferdinalcandra/DEVSCHEDULERPIS
77a15872156e09a846fe0e18b14504bea6d3f0ba
e4f4e99054f75857f02687276951d114665a66c0
refs/heads/master
2023-04-07T07:56:31.317241
2021-03-30T08:04:55
2021-03-30T08:04:55
350,263,755
0
0
null
null
null
null
UTF-8
Java
false
false
1,087
java
package id.co.bfi.dmsuploadscheduler.config.yaml; import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; @Configuration @ConfigurationProperties(prefix = "jasypt.encryptor") @PropertySource(value = "file:conf/jasypt.yml", factory = YamlPropertySourceFactory.class) public class JasyptConfig { private String algorithm; private String password; public String getAlgorithm() { return algorithm; } public void setAlgorithm(String algorithm) { this.algorithm = algorithm; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String decryptPassword(String encryptedPass) { StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); encryptor.setPassword(getPassword()); encryptor.setAlgorithm(getAlgorithm()); return encryptor.decrypt(encryptedPass); } }
[ "ferdinal.candra@gmail.com" ]
ferdinal.candra@gmail.com
cfbe5537df2837b7e87d863105ebefbd7fdbe978
78db5365cdddcf81f197ebc075b35e765a1d531d
/src/java/Testing/Now/User.java
ecb3f6394fd689be6f6093e0ef58da5a1c5b3604
[]
no_license
rfarage/MySQL--JSF
90c34f847a6ba088e21e86c92a74675745054612
af8a64286f67f92c814cb609137b71d246cbd0c8
refs/heads/master
2020-04-03T23:56:00.976755
2018-10-31T23:16:16
2018-10-31T23:16:16
155,635,063
0
0
null
null
null
null
UTF-8
Java
false
false
1,533
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 Testing.Now; import java.io.*; import java.util.Scanner; import javax.swing.JPasswordField; /** * * @author Rania */ public class User { private String username; private String email; private String password; private String confirmPassword; private String firstName; private String lastName; public User() { } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getConfirmPassword() { return confirmPassword; } public void setConfirmPassword(String confirmPassword) { this.confirmPassword = confirmPassword; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } }
[ "rfarage@gmu.edu" ]
rfarage@gmu.edu
5a46d3f31886b0d3b28defdc74b5321933fb6bfb
ca536ba024ac31d425e752e0d424e3469e990f6f
/src/main/java/br/com/tsi4/model/DAO/UsuarioDAO.java
6e064e9b4639e583cc5b071231bebe6c907b7287
[]
no_license
marcelodossantosaraujo/SistemaAtendimentos
9e953566ddc6e9ba368c037534a5a5b6d7c9f2e0
f6f8f0bc69ce4921547dbda094392077b551a2c5
refs/heads/master
2021-01-15T11:18:56.835026
2014-11-01T14:51:04
2014-11-01T14:51:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,038
java
package br.com.tsi4.model.DAO; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import br.com.tsi4.model.Usuario; import br.com.tsi4.model.JDBC.Conectar; public class UsuarioDAO implements ICRUD<Usuario> { private Connection connection; private PreparedStatement preparar; public UsuarioDAO() { connection = Conectar.getConnection(); } @Override public long create(Usuario obj) throws SQLException { String sql = "insert into usuarios(pk_usuario,pk_hospital,nomeusuario,senha,nivelusuario)" + "values (?,? , ? , ? , ?)"; preparar = connection.prepareStatement(sql); preparar.setLong(1, obj.getPkUsuario()); preparar.setLong(2, obj.getPkHospital()); preparar.setString(3, obj.getNomeusuario()); preparar.setString(4, obj.getSenha()); preparar.setString(5, obj.getNivelusuario()); preparar.execute(); ResultSet rs = preparar.getGeneratedKeys(); if (rs.next()) { return rs.getInt(1); } return -1; } @Override public long update(Usuario obj) throws SQLException { String sql = "update usuarios set" + "(pk_hospital=?,nomeusuario=?,senha=?,nivelusuario=?)"; preparar = connection.prepareStatement(sql); preparar.setLong(1, obj.getPkHospital()); preparar.setString(2, obj.getNomeusuario()); preparar.setString(3, obj.getSenha()); preparar.setString(4, obj.getNivelusuario()); preparar.execute(); ResultSet rs = preparar.getGeneratedKeys(); if (rs.next()) { return rs.getInt(1); } return -1; } @Override public boolean delete(Usuario obj) throws SQLException { String sql = "DELETE FROM USUARIOS WHERE id=?"; preparar = connection.prepareStatement(sql); preparar.setLong(1, obj.getPkUsuario()); preparar.execute(); preparar.close(); if (retriveOneByPkKey(obj.getPkUsuario()) == null) { return true; } return false; } @Override public List<Usuario> restriveAll() throws SQLException { List<Usuario> lisUsuarios = new ArrayList<>(); Usuario usuario; String sql = "select * from usuarios order by nomeusuario"; preparar = connection.prepareStatement(sql); ResultSet rs = preparar.executeQuery(); while (rs.next()) { usuario = new Usuario(); usuario.setPkUsuario(rs.getLong("pk_usuario")); usuario.setPkHospital(rs.getLong("pk_hospital")); usuario.setNomeusuario(rs.getNString("nomeusuario")); usuario.setSenha(rs.getNString("senha")); usuario.setNivelusuario(rs.getNString("nivelusuario")); lisUsuarios.add(usuario); } preparar.close(); return lisUsuarios; } @Override public Usuario retriveOneByPkKey(long pkKLey) throws SQLException { Usuario usuario = null; String sql = "select * from usuarios where pk_usuario = ?"; preparar = connection.prepareStatement(sql); preparar.setLong(1, pkKLey); ResultSet rs = preparar.executeQuery(); while (rs.next()) { usuario = new Usuario(); usuario.setPkHospital(rs.getLong("pk_hospital")); usuario.setPkUsuario(rs.getLong("pk_usuario")); usuario.setNomeusuario(rs.getString("nomeUsuario")); usuario.setSenha(rs.getString("senha")); usuario.setNivelusuario(rs.getString("nivelusuario")); } preparar.close(); return usuario; } @Override public List<Usuario> retriveByName(String nome) throws SQLException { List<Usuario> lisUsuarios = new ArrayList<>(); Usuario usuario; String sql = "select * from usuarios where nomeusuario like ?"; preparar = connection.prepareStatement(sql); preparar.setString(1, "%" + nome + "%"); ResultSet rs = preparar.executeQuery(); while (rs.next()) { usuario = new Usuario(); usuario.setPkUsuario(rs.getLong("pk_usuario")); usuario.setPkHospital(rs.getLong("pk_hospital")); usuario.setNomeusuario(rs.getNString("nomeusuario")); usuario.setSenha(rs.getNString("senha")); usuario.setNivelusuario(rs.getNString("nivelusuario")); lisUsuarios.add(usuario); } preparar.close(); return lisUsuarios; } }
[ "itacir@hotmail.com" ]
itacir@hotmail.com
bb8180a0b462368ecc07210389a78de9b88df8f0
e3a333ceb9837ba22f96dedd4a6f97ed2f17613e
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Mecanum_Drive_Math.java
f1628d3e0336fa3dd320ea87d4e46b88b002a8c6
[ "BSD-3-Clause" ]
permissive
EmmanuelJeffers/FTC_2017-18
1243e90691afb07c9afbbe078d6b0ef8cc386cf3
debcea465e3e443bfcaa4af2ed74ba4c9cbd90f8
refs/heads/master
2021-07-14T03:47:28.626215
2017-10-17T18:44:37
2017-10-17T18:44:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,907
java
package org.firstinspires.ftc.teamcode; import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.eventloop.opmode.OpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; /** * Created by Emmanuel on 8/30/2017. */ @TeleOp (name = "Mecanum Drive", group = "Tele Test ") //@Disabled public class Mecanum_Drive_Math extends OpMode { Hardware_333 robot = new Hardware_333(); private final double DRIVE_SPEED = 1.0; /* code to run once the driver hits INIT */ @Override public void init(){ //Initialize the hardware variables robot.init(hardwareMap); //send message to drivers station telemetry.addData("Driver Station:", "I'm waiting..."); telemetry.update(); } /* Code to run repeatedly after the driver hits INIT, but before they hit PLAY */ @Override public void init_loop(){} /* Code to run once when the driver hits PLAY */ @Override public void start(){} /* Code to run repeatedly after the driver hits PLAY, but before they hit STOP */ @Override public void loop(){ double r = Math.hypot(gamepad1.left_stick_x, gamepad1.left_stick_y); double robotAngle = Math.atan2(gamepad1.left_stick_y, gamepad1.left_stick_x) - Math.PI / 4; double rightX = gamepad1.right_stick_x; final double v1 = r * Math.cos(robotAngle) + rightX; final double v2 = r * Math.sin(robotAngle) - rightX; final double v3 = r * Math.sin(robotAngle) + rightX; final double v4 = r * Math.cos(robotAngle) - rightX; robot.Lefty1.setPower(v1); robot.Righty1.setPower(v2); robot.Lefty2.setPower(v3); robot.Righty2.setPower(v4); } /* Code to run once when the driver hits STOP */ @Override public void stop(){} }
[ "ejeffers22@gmail.com" ]
ejeffers22@gmail.com
ea23aa3402ffbf42d73323cdd529b99b09823ded
51705fa1c004b281f576eecf7b64d182f5fb3f0e
/src/main/java/net/ptnetwork/web/controller/system/SysConfigController.java
3c45f5e8878a0674b66750caf192712a4ce955dd
[]
no_license
zns0123/ruoyi-plus
627855c9d3922b4ea4456edef5dc73e58341a41d
fb89c359e4275c8726bf44fe427870046146ec4b
refs/heads/master
2023-09-05T02:47:02.713854
2021-11-19T02:33:24
2021-11-19T02:33:24
431,398,722
0
1
null
null
null
null
UTF-8
Java
false
false
4,737
java
package net.ptnetwork.web.controller.system; import java.util.List; import net.ptnetwork.common.annotation.Log; import net.ptnetwork.common.annotation.RepeatSubmit; import net.ptnetwork.common.constant.UserConstants; import net.ptnetwork.common.core.controller.BaseController; import net.ptnetwork.common.core.domain.AjaxResult; import net.ptnetwork.common.core.page.TableDataInfo; import net.ptnetwork.common.enums.BusinessType; import net.ptnetwork.common.utils.SecurityUtils; import net.ptnetwork.common.utils.poi.ExcelUtil; import net.ptnetwork.system.domain.SysConfig; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import net.ptnetwork.system.service.ISysConfigService; /** * 参数配置 信息操作处理 * * @author ruoyi */ @RestController @RequestMapping("/system/config") public class SysConfigController extends BaseController { @Autowired private ISysConfigService configService; /** * 获取参数配置列表 */ @PreAuthorize("@ss.hasPermi('system:config:list')") @GetMapping("/list") public TableDataInfo list(SysConfig config) { startPage(); List<SysConfig> list = configService.selectConfigList(config); return getDataTable(list); } @Log(title = "参数管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:config:export')") @GetMapping("/export") public AjaxResult export(SysConfig config) { List<SysConfig> list = configService.selectConfigList(config); ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); return util.exportExcel(list, "参数数据"); } /** * 根据参数编号获取详细信息 */ @PreAuthorize("@ss.hasPermi('system:config:query')") @GetMapping(value = "/{configId}") public AjaxResult getInfo(@PathVariable Long configId) { return AjaxResult.success(configService.selectConfigById(configId)); } /** * 根据参数键名查询参数值 */ @GetMapping(value = "/configKey/{configKey}") public AjaxResult getConfigKey(@PathVariable String configKey) { return AjaxResult.success(configService.selectConfigByKey(configKey)); } /** * 新增参数配置 */ @PreAuthorize("@ss.hasPermi('system:config:add')") @Log(title = "参数管理", businessType = BusinessType.INSERT) @PostMapping @RepeatSubmit public AjaxResult add(@Validated @RequestBody SysConfig config) { if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); } config.setCreateBy(SecurityUtils.getUsername()); return toAjax(configService.insertConfig(config)); } /** * 修改参数配置 */ @PreAuthorize("@ss.hasPermi('system:config:edit')") @Log(title = "参数管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysConfig config) { if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); } config.setUpdateBy(SecurityUtils.getUsername()); return toAjax(configService.updateConfig(config)); } /** * 删除参数配置 */ @PreAuthorize("@ss.hasPermi('system:config:remove')") @Log(title = "参数管理", businessType = BusinessType.DELETE) @DeleteMapping("/{configIds}") public AjaxResult remove(@PathVariable Long[] configIds) { return toAjax(configService.deleteConfigByIds(configIds)); } /** * 清空缓存 */ @PreAuthorize("@ss.hasPermi('system:config:remove')") @Log(title = "参数管理", businessType = BusinessType.CLEAN) @DeleteMapping("/clearCache") public AjaxResult clearCache() { configService.clearCache(); return AjaxResult.success(); } }
[ "2511400872@qq.com" ]
2511400872@qq.com
d6e77d538a71e02e0c1727869683e8ff2d8ab8a3
a89d262f3c7465b74b9094430436550a7c6e2104
/app/src/main/java/br/com/senaijandira/mybooks/model/LivroELidos.java
6a482dc430010fde9eae809449c41eda30e19208
[]
no_license
ROiPinheiro/MyBooks
16407299ee9f6c66b925ee162eba6fb7dbb7aa7c
dad01735f95ea0d707de3c1bc07972d596e7fcda
refs/heads/master
2020-03-28T12:30:41.969076
2018-10-15T22:36:41
2018-10-15T22:36:41
148,305,327
0
0
null
null
null
null
UTF-8
Java
false
false
1,093
java
package br.com.senaijandira.mybooks.model; public class LivroELidos { private int idPk; private int idLivros; private int id; private byte[] capa; private String descricao; private String titulo; public LivroELidos(){ } public int getIdPk() { return idPk; } public void setIdPk(int idLivrosLidos) { this.idPk = idLivrosLidos; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getIdLivros() { return idLivros; } public void setIdLivros(int idLivros) { this.idLivros = idLivros; } public byte[] getCapa() { return capa; } public void setCapa(byte[] capa) { this.capa = capa; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } public String getTitulo() { return titulo; } public void setTitulo(String titulo) { this.titulo = titulo; } }
[ "17259227@CFP127ALUNO.LOCAL" ]
17259227@CFP127ALUNO.LOCAL
631fae41c815d470863934a6139c70d17e766b65
05159cf825a28d0e18bc004d6201237a36aa7c00
/app/src/androidTest/java/com/example/project1/hackpolyproject1/ExampleInstrumentedTest.java
333f66500bb6b59ab45132f705c4f95df6f3bf64
[]
no_license
HackpolyProject1/HackpolyProject1
0e1ec111115d2a373bc03eeef92be66a85d661ba
bcd12077a766c4dd15344d6844653164c76592dc
refs/heads/master
2021-01-13T11:52:35.654630
2017-02-17T07:50:08
2017-02-17T07:50:08
81,691,721
0
2
null
2017-02-12T16:19:06
2017-02-12T00:09:53
Java
UTF-8
Java
false
false
778
java
package com.example.project1.hackpolyproject1; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.project1.hackpolyproject1", appContext.getPackageName()); } }
[ "Stanley Rohrbacher" ]
Stanley Rohrbacher
0fa48f379c2d41aea0c5f2614c45823314fe400c
df598809590aef1f659a43ed976939ac8f2d2941
/frame-template/src/main/java/frame/template/service/QueryManualInputFieldConfigService.java
081303cd28b4258e19c62c37859380f44fcc3d1e
[]
no_license
kayla-wzp/SpringBootBaseFrame
face71961d589a837aec4950a7cde11ef09ee336
b0040dc9c5334e5aee28643e5901a5a6e518ea5e
refs/heads/master
2023-02-08T02:47:05.714900
2021-01-04T09:06:18
2021-01-04T09:06:18
287,432,077
0
0
null
null
null
null
UTF-8
Java
false
false
983
java
package frame.template.service; import frame.template.dao.QueryManualInputFieldConfigDao; import frame.template.vo.reqres.QueryManualInputFieldConfigListReq; import frame.template.vo.reqres.QueryManualInputFieldConfigListRes; import frame.template.vo.reqres.QueryManualInputFieldEnumListReq; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @Service public class QueryManualInputFieldConfigService { @Resource private QueryManualInputFieldConfigDao queryManualInputFieldConfigDao; public List<QueryManualInputFieldConfigListRes> queryManualInputFieldConfigList( QueryManualInputFieldConfigListReq req) { return queryManualInputFieldConfigDao.queryManualInputFieldConfigList(req); } public QueryManualInputFieldConfigListRes querySingleManualInputFieldConfig(QueryManualInputFieldEnumListReq req) { return queryManualInputFieldConfigDao.querySingleManualInputFieldConfig(req.getManualInputFieldConfigId()); } }
[ "411930867@qq.com" ]
411930867@qq.com
63b15e19faee0751f4eb01c4a319c065500e2a66
42f30f4e39451e64be309669cc412cfb77814b1c
/src/init/Init.java
fd2244ff6fcfbf2110a6f4b97e3ba49a3ffbdd05
[]
no_license
OathK1per/interview
59dc507e4ef9a05e61cec4848b93bd2a9b344c65
741b6de6509f1ec13bce6d159820a6ce5d73c32c
refs/heads/master
2023-02-01T23:57:08.699838
2020-12-18T09:39:49
2020-12-18T09:39:49
286,711,426
0
0
null
null
null
null
UTF-8
Java
false
false
240
java
package init; /** * @author Yuanping Zhang * @date */ public class Init { public static void main(String[] args) { Father s1 = new Son(); System.out.println("---------------"); Father s2 = new Son(); } }
[ "zhangypg@gmail.com" ]
zhangypg@gmail.com
c45768ddea5730456e9f81134c4dc2d2a999af10
2cab2cfd9927cc33635103e165ca4c6306ae4a13
/src/main/java/com/kodilla/good/patterns/challenges/SmsService.java
1e76b4d5901c7d3659160883c8417e302c0d9697
[]
no_license
paulina-bukowska/kodilla-good-patterns_mod_9
a22db918d627e3c994c02bdd87214ef70ef83e5a
e5bdbe4895c69836e31fca825a875e0553a5d9dc
refs/heads/master
2021-09-06T03:18:21.067690
2018-02-02T00:16:17
2018-02-02T00:16:17
114,160,683
0
1
null
null
null
null
UTF-8
Java
false
false
310
java
package com.kodilla.good.patterns.challenges; public class SmsService implements InformationService { @Override public void inform(User user) { String phoneNumber = user.getPhoneNum(); System.out.println("Sending message to " + phoneNumber + " - \"Your order is preparing\""); } }
[ "pbukowska16@gmail.com" ]
pbukowska16@gmail.com
45ac1adec1c285054fd4134a8dabe1e508e60a13
93ce442558a22180fd9ecc5ab7748bbe86a48e7e
/LongestSubStrKUniqueChar/src/com/company/Main.java
52b76c3c81c8e49993199a000f744849a2410269
[]
no_license
arunvyas168/RandomProblems
3aa7c1526f5c1cb61cef1537ae9fd6cdf774c46a
1574ecb6780d45233e9c6ebae673b30ca016bd94
refs/heads/master
2020-05-21T20:08:55.874860
2016-10-16T03:20:12
2016-10-16T03:20:12
65,159,683
0
0
null
null
null
null
UTF-8
Java
false
false
1,126
java
package com.company; import java.util.HashSet; import java.util.Set; public class Main { public static void main(String[] args) { String input = "abcbbbbcccbdddadacb"; int k = 2; int longestSubString = longestSubStringwithKUnique(input,k); System.out.println("Length of longest SubString with K unique char is: "+longestSubString); } public static int longestSubStringwithKUnique(String input, int k){ Set<Character> set = new HashSet<Character>(); char[] array = input.toCharArray(); int index = 1; int maxLen = 0; int len = 0; for (char c : array){ if (set.contains(c)){ len++; }else { if (index<k){ set.add(c); index++; len++; }else { maxLen = Math.max(len,maxLen); len = 1; index = 1; set.clear(); set.add(c); } } } return Math.max(len,maxLen); } }
[ "arunvyas27@gmail.com" ]
arunvyas27@gmail.com
ab56238a79d9547753058f726a51a4356720c83b
ca482335e19f6a5cb6558201443e625e026992bb
/Timer-master/app/src/main/java/com/example/root/timer/MainActivity.java
9e050ad3f37c0ae8f7c299f856d40433d6bc19e7
[]
no_license
pankaj443/Android_Cluster
5249a793216e33cd41d5b383855511c45444c9af
40a8c4004de8fc34ada74fc3e6757c2e77924a08
refs/heads/master
2020-03-29T12:22:32.614564
2019-02-04T17:16:55
2019-02-04T17:16:55
149,896,314
0
3
null
2019-05-18T19:36:47
2018-09-22T16:44:18
Java
UTF-8
Java
false
false
2,851
java
package com.example.root.timer; import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.os.CountDownTimer; import android.view.View; import android.widget.Button; import android.widget.SeekBar; import android.widget.TextView; public class MainActivity extends Activity { SeekBar seekBar; TextView timertext; Boolean counteractive = false; Button startbutton; CountDownTimer countDownTimer; public void resetTimer() { timertext.setText("00:30"); seekBar.setProgress(30); countDownTimer.cancel(); startbutton.setText("Go!"); seekBar.setEnabled(true); counteractive = false; } public void update(int secondsdown){ int minutes = (int) secondsdown / 60; int sec = (int) secondsdown-minutes*60; String secondstring = Integer.toString(sec); String minstring = Integer.toString(minutes); if (sec <= 9){ secondstring = "0"+ secondstring; } if (minutes <= 9){ minstring = "0"+ minstring; } timertext.setText(minstring + ":"+secondstring); } public void Starttimer(View view){ if(counteractive ==false) { counteractive = true; seekBar.setEnabled(false); startbutton.setText("STOP"); countDownTimer = new CountDownTimer(seekBar.getProgress() * 1000 + 100, 1000) { @Override public void onTick(long millisUntilFinished) { update((int) millisUntilFinished / 1000); } @Override public void onFinish() { resetTimer(); MediaPlayer mediaPlayer = MediaPlayer.create(getApplicationContext(), R.raw.horn); mediaPlayer.start(); } }.start(); } else { resetTimer(); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); seekBar = (SeekBar)findViewById(R.id.seekBar); timertext = (TextView)findViewById(R.id.timertext); startbutton = (Button)findViewById(R.id.startbutton); seekBar.setMax(600); seekBar.setProgress(30); seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { update(progress); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); } }
[ "pankajofficial443@gmail.com" ]
pankajofficial443@gmail.com
9b9ffef1dd8c590f17a3bdc3d3e6435a0270f9a1
9289ddce1ad59b7d2e4dafa30509f92af93a92db
/mcas/build/generated/ap_generated_sources/debug/out/com/haife/android/mcas/di/module/GlobalConfigModule_ProvideCacheFileFactory.java
3bd26f2532194104209c814955bea73da51d2b78
[]
no_license
dy175785/MyWanAndroid
69ac1b45d8aee7f9282411ac196ed18a57889c56
0f59245670a27f72fa0fb0302012bb244b46df20
refs/heads/master
2023-01-08T21:31:37.053203
2020-11-06T12:02:47
2020-11-06T12:02:47
307,313,398
1
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
package com.haife.android.mcas.di.module; import android.app.Application; import dagger.internal.Factory; import dagger.internal.Preconditions; import java.io.File; import javax.annotation.Generated; import javax.inject.Provider; @Generated( value = "dagger.internal.codegen.ComponentProcessor", comments = "https://google.github.io/dagger" ) public final class GlobalConfigModule_ProvideCacheFileFactory implements Factory<File> { private final GlobalConfigModule module; private final Provider<Application> applicationProvider; public GlobalConfigModule_ProvideCacheFileFactory( GlobalConfigModule module, Provider<Application> applicationProvider) { this.module = module; this.applicationProvider = applicationProvider; } @Override public File get() { return provideInstance(module, applicationProvider); } public static File provideInstance( GlobalConfigModule module, Provider<Application> applicationProvider) { return proxyProvideCacheFile(module, applicationProvider.get()); } public static GlobalConfigModule_ProvideCacheFileFactory create( GlobalConfigModule module, Provider<Application> applicationProvider) { return new GlobalConfigModule_ProvideCacheFileFactory(module, applicationProvider); } public static File proxyProvideCacheFile(GlobalConfigModule instance, Application application) { return Preconditions.checkNotNull( instance.provideCacheFile(application), "Cannot return null from a non-@Nullable @Provides method"); } }
[ "1757857744@qq.com" ]
1757857744@qq.com
c7bab9d784def530676a692ae941aab9d193abff
a2ede0ee4ca6de0871215c6c5a26153867afafdb
/customline/.svn/pristine/7b/7b6aee1a5cc10e448016c8435a1b36b37e2b6db0.svn-base
ce7f939d8132e508d6d2772f222fb3357eb5bfdb
[]
no_license
wangwenbin13/amwell
89f8c45b2b4658883fcd5300c83a072c4aea9960
6aa1ec496f8cb084dc48ed42d1950e5afecbe513
refs/heads/master
2021-01-10T01:37:45.749250
2015-11-23T03:28:53
2015-11-23T03:28:53
46,552,662
0
0
null
null
null
null
UTF-8
Java
false
false
778
package com.amwell.vo; import java.io.Serializable; import java.math.BigDecimal; /** * * @author wangwenbin * * 2015-1-15 */ /** * 退票的订单 以及该订单退票的张数 */ public class StatOutLeaCou implements Serializable{ private String leaseOrderNo; private Integer countTimes; private BigDecimal outMoney; public String getLeaseOrderNo() { return leaseOrderNo; } public void setLeaseOrderNo(String leaseOrderNo) { this.leaseOrderNo = leaseOrderNo; } public Integer getCountTimes() { return countTimes; } public void setCountTimes(Integer countTimes) { this.countTimes = countTimes; } public BigDecimal getOutMoney() { return outMoney; } public void setOutMoney(BigDecimal outMoney) { this.outMoney = outMoney; } }
[ "wangwenbin_13@163.com" ]
wangwenbin_13@163.com
d759f023fc7a935a2edb92eacf8abbd26aa2099b
fe38d59c699cbe4665995df707adb03add7fcfbb
/src/main/java/com/lalajie/java/week3/CircleApp.java
4c8ef665ba35e5986fe00f326ebb32638b6fe1fe
[]
no_license
lalajie2036/java-learning
c7b002947acb2154c9021bb0b4944e56cb3c8d1a
39ce92cf15301619d8122731c08ac0e8c970ed0a
refs/heads/main
2023-02-05T06:49:39.748689
2020-12-28T09:31:56
2020-12-28T09:31:56
301,373,562
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
package com.lalajie.java.week3; /** * @ClassName CircleApp * @Description TODO * @Author Mister-Lu * @Date 2020/10/19 **/ public class CircleApp { public static void main(String[] args) { // Point point = new Point(); // Circle circle = new Circle(); Point point = new Point(10,20); Circle circle = new Circle(10,20,5); point.print(); circle.print(); // Cylinder.print(); //1 创建两个Point的对象,求出两点之间的距离 //2 创建一个Point对象,判断该点是否在上面的circle圆对象内 } }
[ "15862811804@163.com" ]
15862811804@163.com
049d98abf5aaac1c55d145c38e4c508b72718cf6
21817427bd42bee333e4b43adb406b648cb96e70
/S13-kotlin/CL02-ConvertirJavaKotlin/app/src/androidTest/java/com/androidavanzado/myapplication/ExampleInstrumentedTest.java
7c26f6ace951901d94d85f041f2d78487fe42305
[]
no_license
juansebastian2426/androidapp
59f8698e4906ad41478fee2613d7e9ad0798d019
79bb5b8797fef61631972cf3b822ae5e1e5f43e1
refs/heads/master
2021-05-18T13:37:15.369731
2020-03-23T12:29:53
2020-03-23T12:29:53
251,265,643
1
0
null
2020-03-30T09:57:56
2020-03-30T09:57:55
null
UTF-8
Java
false
false
750
java
package com.androidavanzado.myapplication; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.androidavanzado.myapplication", appContext.getPackageName()); } }
[ "camposmiguel@gmail.com" ]
camposmiguel@gmail.com
a90782cf2bb3d24e7683cc8cebf0b6bf4593ea7b
6dca9f861c9943853a180440735e9872f97bac74
/src/main/java/br/com/alura/livraria/util/Phase.java
b471a7653557a2a045f786dab36c6125802cafff
[]
no_license
eduardofloriano/alura-cdi
2b52d4f49c8cc06681adde37daad34c740c59865
55acc17fa3f4fbff209c2091616cbb72d82f8462
refs/heads/master
2021-01-11T19:49:19.655874
2017-07-02T05:24:50
2017-07-02T05:24:50
79,402,995
0
0
null
null
null
null
UTF-8
Java
false
false
900
java
package br.com.alura.livraria.util; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import javax.faces.event.PhaseId; import javax.inject.Qualifier; @Qualifier @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface Phase { Phases value(); enum Phases{ RESTORE_VIEW(PhaseId.RESTORE_VIEW), APPLY_REQUEST_VALUES(PhaseId.APPLY_REQUEST_VALUES), PROCESS_VALIDATIONS(PhaseId.PROCESS_VALIDATIONS), UPDATE_MODEL_VALUES(PhaseId.UPDATE_MODEL_VALUES), INVOKE_APPLICATION(PhaseId.INVOKE_APPLICATION), RENDER_RESPONSE(PhaseId.RENDER_RESPONSE); private PhaseId phaseId; Phases(PhaseId phaseId){ this.phaseId = phaseId; } public PhaseId getPhaseId() { return phaseId; } } }
[ "devluiseduardo@gmail.com" ]
devluiseduardo@gmail.com
8b14d36c89781b1d8504964362e34a90e99217bb
e81b1d1742a811d48f1b2bb0a3fa6c6bbdbde820
/dynatrace/src/main/java/de/tsystems/mms/apm/performancesignature/dynatrace/PerfSigStartRecording.java
55bfd266879516bcd14f07f66cdce9600639b7e6
[ "Apache-2.0" ]
permissive
kleopatra999/performance-signature-dynatrace-plugin
08a35282c8e4bf26b8e2bbf04fbfc73ce244269d
94cf5b442f41e0ede3b756d06a9f05133645e459
refs/heads/master
2021-01-14T12:40:44.366322
2016-09-02T07:56:48
2016-09-02T07:56:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,943
java
/* * Copyright (c) 2014 T-Systems Multimedia Solutions GmbH * * 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 de.tsystems.mms.apm.performancesignature.dynatrace; import de.tsystems.mms.apm.performancesignature.dynatrace.configuration.CredProfilePair; import de.tsystems.mms.apm.performancesignature.dynatrace.configuration.DynatraceServerConfiguration; import de.tsystems.mms.apm.performancesignature.dynatrace.configuration.GenericTestCase; import de.tsystems.mms.apm.performancesignature.dynatrace.rest.CommandExecutionException; import de.tsystems.mms.apm.performancesignature.dynatrace.rest.DTServerConnection; import de.tsystems.mms.apm.performancesignature.dynatrace.rest.RESTErrorException; import de.tsystems.mms.apm.performancesignature.dynatrace.rest.model.BaseConfiguration; import de.tsystems.mms.apm.performancesignature.dynatrace.rest.model.SystemProfile; import de.tsystems.mms.apm.performancesignature.util.PerfSigUtils; import hudson.AbortException; import hudson.Extension; import hudson.FilePath; import hudson.Launcher; import hudson.model.AbstractProject; import hudson.model.Failure; import hudson.model.Run; import hudson.model.TaskListener; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.Builder; import hudson.util.FormValidation; import hudson.util.ListBoxModel; import jenkins.model.Jenkins; import jenkins.tasks.SimpleBuildStep; import org.apache.commons.lang.StringUtils; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; import javax.annotation.Nonnull; import java.io.IOException; import java.io.PrintStream; import java.util.Date; public class PerfSigStartRecording extends Builder implements SimpleBuildStep { private final String dynatraceProfile, testCase; private String recordingOption; private boolean lockSession; @DataBoundConstructor public PerfSigStartRecording(final String dynatraceProfile, final String testCase) { this.dynatraceProfile = dynatraceProfile; this.testCase = StringUtils.deleteWhitespace(testCase); } @Override public void perform(@Nonnull final Run<?, ?> run, @Nonnull final FilePath workspace, @Nonnull final Launcher launcher, @Nonnull final TaskListener listener) throws InterruptedException, IOException { final PrintStream logger = listener.getLogger(); DynatraceServerConfiguration serverConfiguration = PerfSigUtils.getServerConfiguration(dynatraceProfile); if (serverConfiguration == null) throw new AbortException("failed to lookup Dynatrace server configuration"); CredProfilePair pair = serverConfiguration.getCredProfilePair(dynatraceProfile); if (pair == null) throw new AbortException("failed to lookup Dynatrace server profile"); logger.println("starting session recording ..."); final DTServerConnection connection = new DTServerConnection(serverConfiguration, pair); if (!connection.validateConnection()) { throw new RESTErrorException(Messages.PerfSigRecorder_DTConnectionError()); } final String testCase = run.getEnvironment(listener).expand(this.testCase); String sessionName = pair.getProfile() + "_" + run.getParent().getName() + "_Build-" + run.getNumber() + "_" + testCase; sessionName = sessionName.replace("/", "_"); for (BaseConfiguration profile : connection.getSystemProfiles()) { SystemProfile systemProfile = (SystemProfile) profile; if (pair.getProfile().equals(systemProfile.getId()) && systemProfile.isRecording()) { logger.println("another session is still recording, trying to stop recording"); PerfSigStopRecording stopRecording = new PerfSigStopRecording(dynatraceProfile); stopRecording.perform(run, workspace, launcher, listener); break; } } String result = null; Date timeframeStart = null; try { result = connection.startRecording(sessionName, "This session is triggered by Jenkins", getRecordingOption(), lockSession, false); } catch (CommandExecutionException e) { if (e.getMessage().contains("continuous")) { timeframeStart = new Date(); } else throw e; } if ((result != null && result.contains(sessionName)) || timeframeStart != null) { logger.println(String.format(Messages.PerfSigStartRecording_StartedSessionRecording(), pair.getProfile(), sessionName)); } else { throw new RESTErrorException(String.format(Messages.PerfSigStartRecording_SessionRecordingError(), pair.getProfile())); } logger.println("registering new TestRun"); String testRunId = connection.registerTestRun(run.getNumber()); if (testRunId != null) { logger.println(String.format(Messages.PerfSigStartRecording_StartedTestRun(), pair.getProfile(), testRunId)); logger.println("Dynatrace: registered test run " + testRunId + "" + " (available as environment variables " + PerfSigEnvContributor.TESTRUN_ID_KEY + " and " + PerfSigEnvContributor.SESSIONCOUNT + ")"); } else { logger.println("warning: could not register TestRun"); } run.addAction(new PerfSigEnvInvisAction(result, timeframeStart, testCase, testRunId)); } public String getTestCase() { return testCase; } public String getRecordingOption() { return recordingOption == null ? DescriptorImpl.defaultRecordingOption : recordingOption; } @DataBoundSetter public void setRecordingOption(final String recordingOption) { this.recordingOption = recordingOption; } public boolean isLockSession() { return lockSession; } @DataBoundSetter public void setLockSession(final boolean lockSession) { this.lockSession = lockSession; } public String getDynatraceProfile() { return dynatraceProfile; } @Symbol("startSession") @Extension public static final class DescriptorImpl extends BuildStepDescriptor<Builder> { public static final boolean defaultLockSession = false; public static final String defaultRecordingOption = "all"; public ListBoxModel doFillRecordingOptionItems() { return new ListBoxModel(new ListBoxModel.Option("all"), new ListBoxModel.Option("violations"), new ListBoxModel.Option("timeseries")); } public FormValidation doCheckTestCase(@QueryParameter final String testCase) { try { Jenkins.checkGoodName(testCase); GenericTestCase.DescriptorImpl.addTestCases(testCase); return FormValidation.ok(); } catch (Failure e) { return FormValidation.error(e.getMessage()); } } public ListBoxModel doFillDynatraceProfileItems() { return PerfSigUtils.listToListBoxModel(PerfSigUtils.getDTConfigurations()); } public boolean isApplicable(final Class<? extends AbstractProject> aClass) { return true; } public String getDisplayName() { return Messages.PerfSigStartRecording_DisplayName(); } } }
[ "Raphael.Pionke@t-systems.com" ]
Raphael.Pionke@t-systems.com