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
6d4b0bc98b5e4a82e84d075bffc2c14065007877
b0326909d51962e62436c8f39ca1cb1c36f62108
/app/com/fixit/model/notification/impl/GroupNotificationFactory.java
336a3349a58edebc51317c6ed430dc2344ba21d4
[ "Apache-2.0" ]
permissive
alefebvre-fixit/fixit
6560a799c3a1f29c24a2a10d5a5ecd7aec94816f
73b6683b87213635336395170695b523f1e941c8
refs/heads/master
2020-05-29T23:10:35.689066
2017-07-21T15:42:10
2017-07-21T15:42:10
26,295,307
0
0
null
null
null
null
UTF-8
Java
false
false
954
java
package com.fixit.model.notification.impl; import java.util.Date; import play.Logger; import com.fixit.model.group.Group; import com.fixit.model.notification.Notification; import com.fixit.model.notification.NotificationFactory; public class GroupNotificationFactory extends NotificationFactory { @Override public Notification createNotification(Object object) { if (object instanceof Group) { Group group = (Group) object; Notification notification = new Notification(); notification.setType(Notification.TYPE_GROUP); notification.setActor(group.getUsername()); notification.setGroupId(group.getId()); notification.setGroupName(group.getName()); notification.setNotificationDate(new Date()); notification.setStatus(group.getStatus()); return notification; } else { Logger.debug("Object " + object.getClass().getName() + " is not an instance of " + Group.class.getSimpleName()); return null; } } }
[ "antoinelefebvre@gmail.com" ]
antoinelefebvre@gmail.com
0977c7788f69c83fa809ccefb35c3373b68d0d5e
1dd23142d826a4f68dcae2641d26f0dffc75f4cd
/app/src/main/java/com/superlifesecretcode/app/ui/dailyactivities/interestedevent/InterestedEventView.java
62f138bcebbd285dc351eb5ad4ad926b0fa10a4e
[]
no_license
gajanandchouhan/P1
89fbd667bedcb31337db5fd63d712976ac025b16
7281cc9ff8704f83c77a325a56ded54195e1f423
refs/heads/master
2020-04-13T19:44:29.057744
2018-12-28T13:06:20
2018-12-28T13:06:20
163,411,483
0
0
null
null
null
null
UTF-8
Java
false
false
630
java
package com.superlifesecretcode.app.ui.dailyactivities.interestedevent; import com.superlifesecretcode.app.data.model.interesetdevent.InterestedEventdata; import com.superlifesecretcode.app.data.model.news.SingleNewsResponseModel; import com.superlifesecretcode.app.ui.base.BaseView; import java.util.List; /** * Created by Divya on 14-03-2018. */ interface InterestedEventView extends BaseView{ void setEventData(List<InterestedEventdata> interestedEventResponseDataList); void setDetails(SingleNewsResponseModel newsResponseModel); void onUpdateInteresed(); void onTimeUpdated(); void noData(); }
[ "gajanand.chouhan@tekzee.com" ]
gajanand.chouhan@tekzee.com
02f49a0f476b656a3ab07e4e4e5fe738ecefeec9
7615541dc79bf20457b0cadc5dc6cb1eef6f8400
/RegistroAcademico/src/main/java/registro/registroacademico/resources/EstudianteResource.java
c827e5bcffc075b2d9455b1512065d2700273cba
[]
no_license
andresj90/Proyecto_academico
b4d7a3afe7eb9d77018ae7ec9a74067585116502
41bc75c85d1a8aacbeb35a1037f36d2aad34ed98
refs/heads/master
2020-04-08T01:06:08.410283
2018-11-24T00:02:11
2018-11-24T00:02:11
158,881,307
0
0
null
null
null
null
UTF-8
Java
false
false
3,106
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 registro.registroacademico.resources; import java.util.List; import javax.ejb.EJB; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import registro.registroacademico.dto.EstudianteDTO; import registro.registroacademico.entities.EstudianteEntity; import registro.registroacademico.logic.EstudianteLogic; /** * Servicio REST Estudiante * @author AndresJ90 */ @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/estudiantes") public class EstudianteResource { @EJB private EstudianteLogic estudianteLogic; /** * Método REST para obtener todos los coordinadores * @return */ @GET public List<EstudianteDTO> getListaEstudiante(){ List<EstudianteEntity> estudiantes = estudianteLogic.getEstudiantes(); return EstudianteDTO.tolistEstudiante(estudiantes); } /** * Método REST para obtener un coordinador a través del id * @param id * @return */ @GET @Path("{id_estudiante: \\d+}") public EstudianteDTO getEstudiante(@PathParam("id_estudiante") int id){ EstudianteEntity estudiante = estudianteLogic.getEstudiante(id); if (estudiante == null) { throw new RuntimeException("El estudiante no existe"); } return new EstudianteDTO(estudiante); } /** * Método REST para crear un docente * @param estudianteCrear * @return */ @POST public EstudianteDTO createEstudiante(EstudianteDTO estudianteCrear){ return new EstudianteDTO(estudianteLogic.createEstudiante(estudianteCrear.toEntity())); } /** * Método REST para actualizar un docente * @param id * @param estudianteActualizar * @return */ @PUT @Path("{id_estudiante: \\d+}") public EstudianteDTO updateEstudiante (@PathParam("id_estudiante") int id,EstudianteDTO estudianteActualizar ){ EstudianteEntity entity = estudianteLogic.getEstudiante(id); if (entity == null) { throw new RuntimeException("El estudiante no existe"); } return new EstudianteDTO(estudianteLogic.updateEstudiante(id, estudianteActualizar.toEntity())); } /** * Método REST para eliminar un estudiante * @param id */ @DELETE @Path("{id_estudiante: \\d+}") public void deleteEstudiante(@PathParam("id_estudiante") int id){ EstudianteEntity estudiante = estudianteLogic.getEstudiante(id); if (estudiante == null) { throw new RuntimeException("El estudiante no existe"); } estudianteLogic.deleteEstudiante(id); } }
[ "42348909+andresj90@users.noreply.github.com" ]
42348909+andresj90@users.noreply.github.com
85f6f3e8c6fde4be4a4124ab58c97253c8c079ea
fe024cc7265e5bc8a1bc7b5c93a24c7b0cb7fa01
/discovery/src/main/java/com/spring/discovery/DiscoveryApplication.java
e520269f8bd702e9c0bd50b7a2c9b8e35f39082b
[]
no_license
Lalu774/discovery
58814d5f0ab6f562924c533583d6f4ac3697d925
7bdaa6c46c4e61a5869e8b28cf1089fd4aa30ccc
refs/heads/master
2020-04-15T09:19:58.010001
2019-01-08T03:01:51
2019-01-08T03:01:51
164,545,599
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.spring.discovery; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @SpringBootApplication @EnableEurekaServer public class DiscoveryApplication { public static void main(String[] args) { SpringApplication.run(DiscoveryApplication.class, args); } }
[ "Lalu@Lalu" ]
Lalu@Lalu
1a3ff83bba77825d781a4e9655675b4bac677620
720ce17f452893ea0ae00b3f3e6d7055ff2f5746
/parent/BundlerCleanupEJB/src/main/java/mil/nga/bundler/ejb/jdbc/JDBCJobService.java
abde7bf940e4980c14f4b99837fa037c52f0b2b1
[]
no_license
carpenlc/bundler-cleanup
aa124fead1bc279c4af48b4c6a9d6ef51c7f3b0e
90f943ff8f93464826f38d552335a7fc4b436f46
refs/heads/master
2022-11-30T17:05:26.049867
2020-08-10T17:19:48
2020-08-10T17:19:48
95,913,304
0
0
null
2022-11-15T23:46:06
2017-06-30T18:18:26
Java
UTF-8
Java
false
false
23,664
java
package mil.nga.bundler.ejb.jdbc; 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 javax.annotation.Resource; import javax.ejb.EJB; import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.sql.DataSource; import mil.nga.bundler.ejb.EJBClientUtilities; import mil.nga.bundler.ejb.exceptions.EJBLookupException; import mil.nga.bundler.model.Job; import mil.nga.bundler.types.ArchiveType; import mil.nga.bundler.types.JobStateType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Session Bean implementation class JDBCJobService * * This class re-implements the methods in the JobService EJB class as * simple JDBC calls. This class was created in order to solve some * performance problems when using Hibernate in conjunction with the * metrics data. */ @Stateless @LocalBean public class JDBCJobService { /** * Table used to extract the target archive information. */ private static final String TABLE_NAME = "JOBS"; /** * Set up the logging system for use throughout the class */ private static final Logger LOGGER = LoggerFactory.getLogger( JDBCJobService.class); /** * Container-injected datasource object. */ @Resource(mappedName="java:jboss/datasources/JobTracker") DataSource datasource; /** * Container-injected reference to the JDBCArchiveService EJB. */ @EJB JDBCArchiveService jdbcArchiveService; /** * Eclipse-generated default constructor. */ public JDBCJobService() { } /** * Private method used to obtain a reference to the target EJB. * @return Reference to the JobService EJB. */ private JDBCArchiveService getJDBCArchiveService() throws EJBLookupException { if (jdbcArchiveService == null) { LOGGER.warn("Application container failed to inject the " + "reference to the JDBCArchiveService EJB. Attempting " + "to look it up via JNDI."); jdbcArchiveService = EJBClientUtilities .getInstance() .getJDBCArchiveService(); // If it's still null, throw an exception to prevent NPE later. if (jdbcArchiveService == null) { throw new EJBLookupException( "Unable to obtain a reference to [ " + JDBCArchiveService.class.getName() + " ].", JDBCArchiveService.class.getName()); } } return jdbcArchiveService; } /** * Delete all information associated with the input jobID from the back-end * data store. * * @param jobID The target job ID to delete. */ public void delete(String jobID) { Connection conn = null; List<String> jobIDs = new ArrayList<String>(); PreparedStatement stmt = null; ResultSet rs = null; long start = System.currentTimeMillis(); String sql = "delete from " + TABLE_NAME + " where JOB_ID = ?"; if (datasource != null) { if ((jobID != null) && (!jobID.isEmpty())) { try { // First, delete the associated archive and file objects getJDBCArchiveService().deepDeleteArchive(jobID); conn = datasource.getConnection(); // Note: If the container Datasource has jta=true this will throw // an exception. conn.setAutoCommit(false); stmt = conn.prepareStatement(sql); stmt.setString(1, jobID); stmt.executeUpdate(); // Note: If the container Datasource has jta=true this will throw // an exception. conn.commit(); } catch (EJBLookupException ele) { LOGGER.error("Unable to obtain a reference to [ " + ele.getEJBName() + " ]. Delete of job [ " + jobID + " ] will not be performed."); } catch (SQLException se) { LOGGER.error("An unexpected SQLException was raised while " + "attempting to insert delete a [ " + TABLE_NAME + " ] object " + "from the data store. Error message [ " + se.getMessage() + " ]."); } finally { try { if (stmt != null) { stmt.close(); } } catch (Exception e) {} try { if (conn != null) { conn.close(); } } catch (Exception e) {} } } else { LOGGER.warn("Input JOB_ID field is null or empty. " + "Delete operation will not be performed."); } } else { LOGGER.warn("DataSource object not injected by the container. " + "An empty List will be returned to the caller."); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Delete of [ " + TABLE_NAME + " ] record for job ID [ " + jobID + " ] completed in [ " + (System.currentTimeMillis() - start) + " ] ms."); } } /** * Delete all information associated with the input Job from the back-end * data store. * * @param job The target job object to delete. */ public void delete(Job job) { if (job != null) { delete(job.getJobID()); } else { LOGGER.error("The input Job object is null. Delete operation " + "not be performed."); } } /** * Retrieve a complete list of job IDs from the data store. * @return A list of job IDs. */ public List<String> getJobIDs() { Connection conn = null; List<String> jobIDs = new ArrayList<String>(); PreparedStatement stmt = null; ResultSet rs = null; long start = System.currentTimeMillis(); String sql = "select JOB_ID from " + TABLE_NAME; if (datasource != null) { try { conn = datasource.getConnection(); stmt = conn.prepareStatement(sql); rs = stmt.executeQuery(); while (rs.next()) { jobIDs.add(rs.getString("JOB_ID")); } } catch (SQLException se) { LOGGER.error("An unexpected SQLException was raised while " + "attempting to retrieve a list of job IDs from the " + "target data source. Error message [ " + se.getMessage() + " ]."); } finally { try { if (rs != null) { rs.close(); } } catch (Exception e) {} try { if (stmt != null) { stmt.close(); } } catch (Exception e) {} try { if (conn != null) { conn.close(); } } catch (Exception e) {} } } else { LOGGER.warn("DataSource object not injected by the container. " + "An empty List will be returned to the caller."); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("[ " + jobIDs.size() + " ] job IDs selected in [ " + (System.currentTimeMillis() - start) + " ] ms."); } return jobIDs; } /** * Retrieve a list of job IDs that were started prior to the input time. * This method was added to facilitate cleanup of data from the back-end * data store. * * @return A list of job IDs. */ public List<String> getJobIDs(long time) { Connection conn = null; List<String> jobIDs = new ArrayList<String>(); PreparedStatement stmt = null; ResultSet rs = null; long start = System.currentTimeMillis(); String sql = "select JOB_ID from " + TABLE_NAME + " where START_TIME < ?"; if (datasource != null) { try { conn = datasource.getConnection(); stmt = conn.prepareStatement(sql); stmt.setLong(1, time); rs = stmt.executeQuery(); while (rs.next()) { jobIDs.add(rs.getString("JOB_ID")); } } catch (SQLException se) { LOGGER.error("An unexpected SQLException was raised while " + "attempting to retrieve a list of job IDs from the " + "target data source. Error message [ " + se.getMessage() + " ]."); } finally { try { if (rs != null) { rs.close(); } } catch (Exception e) {} try { if (stmt != null) { stmt.close(); } } catch (Exception e) {} try { if (conn != null) { conn.close(); } } catch (Exception e) {} } } else { LOGGER.warn("DataSource object not injected by the container. " + "An empty List will be returned to the caller."); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("[ " + jobIDs.size() + " ] job IDs selected in [ " + (System.currentTimeMillis() - start) + " ] ms."); } return jobIDs; } /** * This method will return a list of all * <code>mil.nga.bundler.model.Job</code> objects currently persisted in * the back-end data store. The Job objects returned will not be fully * loaded. They will not contain the individual archives nor the file * lists. * * @return A list of Job objects. */ public List<Job> getJobs() { Connection conn = null; List<Job> jobs = new ArrayList<Job>(); PreparedStatement stmt = null; ResultSet rs = null; long start = System.currentTimeMillis(); String sql = "select JOB_ID, ARCHIVE_SIZE, " + "ARCHIVE_TYPE, END_TIME, NUM_ARCHIVES, " + "NUM_ARCHIVES_COMPLETE, NUM_FILES, NUM_FILES_COMPLETE, " + "START_TIME, JOB_STATE, TOTAL_SIZE, TOTAL_SIZE_COMPLETE, " + "USER_NAME from " + TABLE_NAME + " order by START_TIME desc"; if (datasource != null) { try { conn = datasource.getConnection(); stmt = conn.prepareStatement(sql); rs = stmt.executeQuery(); while (rs.next()) { Job job = new Job(); job.setJobID(rs.getString("JOB_ID")); job.setArchiveSize(rs.getLong("ARCHIVE_SIZE")); job.setArchiveType(ArchiveType.valueOf( rs.getString("ARCHIVE_TYPE"))); job.setEndTime(rs.getLong("END_TIME")); job.setNumArchives(rs.getInt("NUM_ARCHIVES")); job.setNumArchivesComplete( rs.getInt("NUM_ARCHIVES_COMPLETE")); job.setNumFiles(rs.getLong("NUM_FILES")); job.setNumFilesComplete(rs.getLong("NUM_FILES_COMPLETE")); job.setStartTime(rs.getLong("START_TIME")); job.setState(JobStateType.valueOf( rs.getString("JOB_STATE"))); job.setTotalSize(rs.getLong("TOTAL_SIZE")); job.setTotalSizeComplete(rs.getLong("TOTAL_SIZE_COMPLETE")); job.setUserName(rs.getString("USER_NAME")); jobs.add(job); } } catch (SQLException se) { LOGGER.error("An unexpected SQLException was raised while " + "attempting to retrieve a list of job IDs from the " + "target data source. Error message [ " + se.getMessage() + " ]."); } finally { try { rs.close(); } catch (Exception e) {} try { stmt.close(); } catch (Exception e) {} try { conn.close(); } catch (Exception e) {} } } else { LOGGER.warn("DataSource object not injected by the container. " + "An empty List will be returned to the caller."); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("[ " + jobs.size() + " ] jobs selected in [ " + (System.currentTimeMillis() - start) + " ] ms."); } return jobs; } /** * Load the fully materialized Job from the data store. The returned * Job object will contain fully populated child Archive and * child FileEntry lists. * * @param jobID The ID of the job to retrieve. * @return The fully materialized job. */ public Job getMaterializedJob(String jobID) { Connection conn = null; Job job = new Job(); PreparedStatement stmt = null; ResultSet rs = null; long start = System.currentTimeMillis(); String sql = "select JOB_ID, ARCHIVE_SIZE, " + "ARCHIVE_TYPE, END_TIME, NUM_ARCHIVES, " + "NUM_ARCHIVES_COMPLETE, NUM_FILES, NUM_FILES_COMPLETE, " + "START_TIME, JOB_STATE, TOTAL_SIZE, TOTAL_SIZE_COMPLETE, " + "USER_NAME from " + TABLE_NAME + " where JOB_ID = ?"; if (datasource != null) { if ((jobID != null) && (!jobID.isEmpty())) { try { conn = datasource.getConnection(); stmt = conn.prepareStatement(sql); stmt.setString(1, jobID); rs = stmt.executeQuery(); if (rs.next()) { job.setJobID(rs.getString("JOB_ID")); job.setArchiveSize(rs.getLong("ARCHIVE_SIZE")); job.setArchiveType(ArchiveType.valueOf( rs.getString("ARCHIVE_TYPE"))); job.setEndTime(rs.getLong("END_TIME")); job.setNumArchives(rs.getInt("NUM_ARCHIVES")); job.setNumArchivesComplete( rs.getInt("NUM_ARCHIVES_COMPLETE")); job.setNumFiles(rs.getLong("NUM_FILES")); job.setNumFilesComplete(rs.getLong("NUM_FILES_COMPLETE")); job.setStartTime(rs.getLong("START_TIME")); job.setState(JobStateType.valueOf( rs.getString("JOB_STATE"))); job.setTotalSize(rs.getLong("TOTAL_SIZE")); job.setTotalSizeComplete(rs.getLong("TOTAL_SIZE_COMPLETE")); job.setUserName(rs.getString("USER_NAME")); // Get the child archive data job.setArchives( getJDBCArchiveService(). getMaterializedArchives( job.getJobID())); } } catch (EJBLookupException ele) { LOGGER.error("Unable to obtain a reference to [ " + ele.getEJBName() + " ]. Delete of job [ " + jobID + " ] will not be performed."); } catch (SQLException se) { LOGGER.error("An unexpected SQLException was raised while " + "attempting to retrieve a list of job IDs from the " + "target data source. Error message [ " + se.getMessage() + " ]."); } finally { try { if (rs != null) { rs.close(); } } catch (Exception e) {} try { if (stmt != null) { stmt.close(); } } catch (Exception e) {} try { if (conn != null) { conn.close(); } } catch (Exception e) {} } } else { // jobid is null } } else { LOGGER.warn("DataSource object not injected by the container. " + "An empty Job will be returned to the caller."); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Materialized job with job ID [ " + jobID + " ] selected in [ " + (System.currentTimeMillis() - start) + " ] ms."); } return job; } /** * This method will return a list of all * <code>mil.nga.bundler.model.Job</code> objects currently persisted in * the back-end data store That fall between the input start and end time. * The Job objects returned will not be fully materialized. * They will not contain the individual archives nor the file * lists. * * @param startTime The "from" parameter * @param endTime The "to" parameter * @return All of the jobs with a start time that fall in between the two * input parameters. */ public List<Job> getJobsByDate(long startTime, long endTime) { Connection conn = null; List<Job> jobs = new ArrayList<Job>(); PreparedStatement stmt = null; ResultSet rs = null; long start = System.currentTimeMillis(); String sql = "select JOB_ID, ARCHIVE_SIZE, " + "ARCHIVE_TYPE, END_TIME, NUM_ARCHIVES, " + "NUM_ARCHIVES_COMPLETE, NUM_FILES, NUM_FILES_COMPLETE, " + "START_TIME, JOB_STATE, TOTAL_SIZE, TOTAL_SIZE_COMPLETE, " + "USER_NAME from " + TABLE_NAME + " where START_TIME > ? " + "and START_TIME < ? order by START_TIME desc"; // Ensure the startTime is earlier than the endTime before submitting // the query to the database. if (startTime > endTime) { LOGGER.warn("The caller supplied a start time that falls " + "after the end time. Swapping start and end " + "times."); long temp = startTime; startTime = endTime; endTime = temp; } else if (startTime == endTime) { LOGGER.warn("The caller supplied the same time for both start " + "and end time. This method will likely yield a null " + "job list."); } if (datasource != null) { try { conn = datasource.getConnection(); stmt = conn.prepareStatement(sql); stmt.setLong(1, startTime); stmt.setLong(2, endTime); rs = stmt.executeQuery(); while (rs.next()) { Job job = new Job(); job.setJobID(rs.getString("JOB_ID")); job.setArchiveSize(rs.getLong("ARCHIVE_SIZE")); job.setArchiveType(ArchiveType.valueOf( rs.getString("ARCHIVE_TYPE"))); job.setEndTime(rs.getLong("END_TIME")); job.setNumArchives(rs.getInt("NUM_ARCHIVES")); job.setNumArchivesComplete( rs.getInt("NUM_ARCHIVES_COMPLETE")); job.setNumFiles(rs.getLong("NUM_FILES")); job.setNumFilesComplete(rs.getLong("NUM_FILES_COMPLETE")); job.setStartTime(rs.getLong("START_TIME")); job.setState(JobStateType.valueOf( rs.getString("JOB_STATE"))); job.setTotalSize(rs.getLong("TOTAL_SIZE")); job.setTotalSizeComplete(rs.getLong("TOTAL_SIZE_COMPLETE")); job.setUserName(rs.getString("USER_NAME")); jobs.add(job); } } catch (SQLException se) { LOGGER.error("An unexpected SQLException was raised while " + "attempting to retrieve a list of job IDs from the " + "target data source. Error message [ " + se.getMessage() + " ]."); } finally { try { if (rs != null) { rs.close(); } } catch (Exception e) {} try { if (stmt != null) { stmt.close(); } } catch (Exception e) {} try { if (conn != null) { conn.close(); } } catch (Exception e) {} } } else { LOGGER.warn("DataSource object not injected by the container. " + "An empty List will be returned to the caller."); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("[ " + jobs.size() + " ] job IDs selected in [ " + (System.currentTimeMillis() - start) + " ] ms."); } return jobs; } }
[ "carpenlc@ndwdstdelvglf01.arn.gov" ]
carpenlc@ndwdstdelvglf01.arn.gov
44574e7645a21c79890c88839e11353f7aa4637b
b2e8198366b7c8e2edf5e2dee7c7f0f1c7ecf9d1
/src/main/java/shiro/ui/DialogBox.java
41b54c030de95de100ccb5d8c536a0e5d1ee40a5
[]
no_license
gloon99/ip
36ad38d39885b19377eb74e6a78f00d07352b83e
a8f2a8320e7bf575ba35b3030e7788dc7290e56a
refs/heads/master
2022-12-19T07:28:37.715381
2020-09-12T17:16:09
2020-09-12T17:16:09
288,401,173
1
0
null
2020-09-06T12:34:41
2020-08-18T08:38:27
Java
UTF-8
Java
false
false
2,091
java
package shiro.ui; import java.io.IOException; import java.util.Collections; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; /** * An example of a custom control using FXML. * This control represents a dialog box consisting of an ImageView to represent the speaker's face and a label * containing text from the speaker. */ public class DialogBox extends HBox { @FXML private Label dialog; @FXML private ImageView displayPicture; private DialogBox(String text, Image img) { try { FXMLLoader fxmlLoader = new FXMLLoader(MainWindow.class.getResource("/view/DialogBox.fxml")); fxmlLoader.setController(this); fxmlLoader.setRoot(this); fxmlLoader.load(); } catch (IOException e) { e.printStackTrace(); } dialog.setText(text); displayPicture.setImage(img); } /** * Flips the dialog box such that the ImageView is on the left and text on the right. */ private void flip() { ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren()); Collections.reverse(tmp); getChildren().setAll(tmp); setAlignment(Pos.TOP_LEFT); dialog.setStyle("-fx-background-color: rgb(255, 230, 242); " + "-fx-background-radius: 15;" + "-fx-padding: 7.5;" + "-fx-text-fill: rgb(153, 0, 51);" + "-fx-border-color: rgb(255, 204, 229);" + "-fx-border-radius: 15;"); } protected static DialogBox getUserDialog(String text, Image img) { return new DialogBox(text, img); } protected static DialogBox getShiroDialog(String text, Image img) { var db = new DialogBox(text, img); db.flip(); return db; } }
[ "goh.yeeloon@gmail.com" ]
goh.yeeloon@gmail.com
7a205eae58b39410022debdae54dda7caaf5f95e
aa480f05e6170c9dc57c3177b2b493c1110c658b
/src/main/java/com/pluralsight/model/Goal.java
27f9f0b034ce8992d0c8539455d19523c857d77f
[]
no_license
miguel-ossa/FitnessTracker
128b4e28289ade240484acc0d48618a979cc4e0c
bd64952a32dfcdb95511c51adb67fdd46ff2171e
refs/heads/master
2022-12-24T07:42:05.608316
2019-06-24T11:15:01
2019-06-24T11:15:01
189,010,042
0
0
null
2022-06-21T01:11:09
2019-05-28T10:52:01
Java
UTF-8
Java
false
false
1,560
java
package com.pluralsight.model; import java.util.ArrayList; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.validator.constraints.Range; @Entity @Table(name = "goals") //@NamedQueries({ // @NamedQuery(name = Goal.FIND_GOAL_REPORTS, // query = "Select new com.pluralsight.model.GoalReport(g.minutes, e.minutes, e.activity) " + // "from Goal g, Exercise e where g.id = e.goal.id"), // @NamedQuery(name = Goal.FIND_ALL_GOALS, // query = "Select g from Goal g") //}) public class Goal { public static final String FIND_GOAL_REPORTS = "fingGoalReports"; public static final String FIND_ALL_GOALS = "fingAllGoals"; @Id @GeneratedValue @Column(name = "GOAL_ID") private Long id; @Range(min = 0, max = 120) @Column(name = "MINUTES") private int minutes; @OneToMany(mappedBy="goal", cascade=CascadeType.ALL, fetch=FetchType.LAZY) private List<Exercise> exercises = new ArrayList<Exercise>(); public List<Exercise> getExercises() { return exercises; } public Long getId() { return id; } public int getMinutes() { return minutes; } public void setExercises(List<Exercise> exercises) { this.exercises = exercises; } public void setId(Long id) { this.id = id; } public void setMinutes(int minutes) { this.minutes = minutes; } }
[ "miguel.ossa.abellan@gmail.com" ]
miguel.ossa.abellan@gmail.com
c6be3928ca34cd94ba92805f79be53d5f02e4b5e
49997d07552f2620fa2c2f8fa157e344b4892d08
/app/src/test/java/com/example/wang/injectview/ExampleUnitTest.java
12c60b78983e45ca236bc279229a614f03a297bd
[]
no_license
wxlx1349/InjectView
07d89cfba9f84f346bce43f272b37a0491dbce6b
3c44b0da52a09dbb8fd0d21528420dff153b50eb
refs/heads/master
2021-01-19T09:37:11.890781
2017-02-16T02:43:32
2017-02-16T02:43:32
82,131,124
1
1
null
null
null
null
UTF-8
Java
false
false
405
java
package com.example.wang.injectview; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "694533580@qq.com" ]
694533580@qq.com
c691ff2fa51a728e6095a129c193fb1e00f4f888
227654c14c5124fdf28b334442b57b95289ae6bb
/Arrays - Exercise/Ex08MagicSum.java
b89e1f16b11f8672645881c032475d1a5995b446
[]
no_license
MargaritaGeorgievaYancheva/SoftUni-Java-Fundamentals-September-2020
fe3b55b14f316289d447850807adb8a622012d20
0ae785d27eea021d5a803acc8402b2ebbd73c807
refs/heads/main
2023-04-07T10:31:20.608852
2021-04-15T18:06:24
2021-04-15T18:06:24
348,088,800
0
0
null
null
null
null
UTF-8
Java
false
false
685
java
package com.company; import java.util.Arrays; import java.util.Scanner; public class Ex08MagicSum { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] numbers = Arrays.stream(sc.nextLine().split("\\s+")) .mapToInt(e -> Integer.parseInt(e)) .toArray(); int givenSum = Integer.parseInt(sc.nextLine()); for (int i = 0; i < numbers.length; i++) { for (int j = i + 1; j < numbers.length; j++) { if (numbers[i] + numbers[j] == givenSum) { System.out.println(numbers[i] + " " + numbers[j]); } } } } }
[ "margaritaqncheva@gmail.com" ]
margaritaqncheva@gmail.com
51a2e5012008a2d751602f10ca80c83357c7e30c
e03753fe9b24872f7bb0cc5af7fcc52f3af96817
/src/VOIP/SocketReceiver.java
b387f37827b546e318d181c60fdd05a722be7ba6
[]
no_license
mjs0031/Course-Comp-6320-VOIP-Sandbox
d43c9fe1fd9528063cca89499a8910f77fe51ee3
6952747983737f32da7ec5d6c3600d807e057d2e
refs/heads/master
2021-01-25T10:29:12.745154
2013-03-01T01:29:47
2013-03-01T01:29:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,553
java
//Package Declaration // package VOIP; //Java Package Support // import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; //Internal Package Support // // { Not Applicable } /** * * VOIP/SocketReceiver.java * * @author(s) : Ian Middleton, Zach Ogle, Matthew J Swann * @version : 1.0 * Last Update : 2013-02-20 * Update By : Matthew J Swann * * * VOIP PACKAGE :: Source code for Comp 6360: Wireless & Mobile Networks * Assignment 1 :: VOIP * * This is source code for the SocketReceiver class. This class accepts a * set of packets, unpacks the BYTES and plays back the sound. * */ public class SocketReceiver extends Thread{ // Audio Variables AudioFormat format; // Transmit Variables InetAddress address; DatagramPacket dp; DatagramSocket s; SourceDataLine sLine; // Control Variables boolean is_true = true; byte[] buf; /** * Base constructor. * * @throws IOException : General IOException for package functions. * @throws LineUnavailable : General LineUnavailable for package * functions. */ public SocketReceiver() throws IOException, LineUnavailableException{ this.buf = new byte[2048]; this.s = new DatagramSocket(10150); this.dp = new DatagramPacket(buf, buf.length); this.format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100, 16, 2, 4, 44100, false); DataLine.Info sLineInfo = new DataLine.Info(SourceDataLine.class, this.format); this.sLine = (SourceDataLine)AudioSystem.getLine(sLineInfo); } // end SocketReceiver() /** * Run command called automatically by Thread.start(). * * @throws IOException : General IOException for package functions. * @throws LineUnavailable : General LineUnavailable for package * functions. */ @Override public void run(){ try{ this.sLine.open(this.format); } catch (LineUnavailableException e){ // empty sub-block } this.sLine.start(); // Continues until program is closed. while(this.is_true){ try{ this.s.receive(this.dp); } catch (IOException e){ // empty sub-block } this.sLine.write(this.dp.getData(), 0, this.dp.getLength()); } // end while } // end SocketReceiver.run() } // end SocketReceiver class
[ "mjs0031@auburn.edu" ]
mjs0031@auburn.edu
f7b29fddd7ceeea33ce40636f8030248fcc654fd
0677e44d856818584226d6978968dd8cccc90c6c
/src/main/java/mchorse/aperture/events/CameraEditorPlaybackStateEvent.java
61cafa0ca2d158184044d59345bf0efe0672ce35
[ "MIT" ]
permissive
HaiNguyen007/aperture
d94328a5a83656fc2a80c97e97aefaf34c7df993
0bd567e9a4377427b54916d762b245c8951c3018
refs/heads/master
2020-04-04T06:47:13.922800
2018-10-13T14:30:50
2018-10-13T14:30:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
package mchorse.aperture.events; import net.minecraftforge.fml.common.eventhandler.Event; /** * Camera editor playback state event * * This event is fired when the camera editor is either played or paused. */ public class CameraEditorPlaybackStateEvent extends Event { /** * Play is true and pause is false */ public boolean play; /** * Position at which camera editor started playing/was paused */ public int position; public CameraEditorPlaybackStateEvent(boolean play, int position) { this.play = play; this.position = position; } }
[ "mchorselessrider@gmail.com" ]
mchorselessrider@gmail.com
3f223215bd11cc0122e5c0ee5453909f32e9fb3a
f67965871bbc208a1ecf1a2abb5b0ca77817f2d9
/Car Registry System/src/com/CRS/Controller/CrudCars.java
ba22e37ee3333000b82b8d13653c388f04801907
[]
no_license
MrX456/Cars_Registry_System
05543004ac415179006af2e5986e9f0395f9aa14
2a6c99b93cd3724ae33b1cf3ef1b9acbb37135b4
refs/heads/main
2023-01-28T02:50:48.424608
2020-12-12T22:03:53
2020-12-12T22:03:53
320,921,731
1
0
null
null
null
null
UTF-8
Java
false
false
1,031
java
/* * In this interface CRUD database operations for cars table * will be declared. */ package com.CRS.Controller; import java.sql.ResultSet; /* * Car Registry System / Controller / Cars Business Logic Interface * @author MRX * Version : 1.0.0 */ public interface CrudCars { public abstract void registerCar(String maker, String model, String country, String year, String body, String color, String speed, String price, String imgPath, String byUser, String idEngineModel); public abstract ResultSet searchCars(String modelLike); public abstract void searchPhoto(String carID); public abstract void updateCar(String maker, String model, String country, String year, String body, String color, String speed, String price, String byUser, String id); public abstract void deleteCar(String id, String car, String color, String user, String motive); }
[ "jjunior590@gmail.com" ]
jjunior590@gmail.com
f3fa0ad403092dafce08146e684f542152b119de
a1dabc4f32031be20312384931d7b701fcd29a83
/src/main/java/io/renren/modules/generator/dto/SupervisorTaskReqDTO.java
a33982561f6bc74ae0075376ede7e9905e3151f0
[ "Apache-2.0" ]
permissive
404forD/teaching-supervise
9239e9521c554146af00aebab5ecab20e6fbfe6f
696a5e34a67778e29cc3514d75241594a9df53a2
refs/heads/master
2023-05-11T17:16:55.892526
2021-05-28T13:47:10
2021-05-28T13:47:10
371,713,013
0
0
null
null
null
null
UTF-8
Java
false
false
771
java
package io.renren.modules.generator.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; import java.util.Date; @Getter @Setter //督导员个人督导任务 public class SupervisorTaskReqDTO { @ApiModelProperty(value = "课程名称") private String courseName; @ApiModelProperty(value = "老师名字") private String teacherName; @ApiModelProperty(value = "教室地址") private String classroomNum; @ApiModelProperty(value = "日期") private Date date; @ApiModelProperty(value = "年级") private String classGrade; @ApiModelProperty(value = "专业") private String classSpeciality; @ApiModelProperty(value = "班级名称") private String className; }
[ "594033925@qq.com" ]
594033925@qq.com
938a5b8ba95f8a2e1c15ed06dedc4c5c73581339
bc14c24ab4a0d819a07aeaf05955d26bce7ebbab
/src/main/java/com/hust/party/controller/UserCenterController.java
1e57a9ffaa90cc3723e9d906d166997c9427a628
[]
no_license
Fan086/party
01556f2b3087d8a9020f139d71a2388c31035a42
e9768b7dab40c9885166f389cdfd905744f8c9ee
refs/heads/master
2020-03-16T17:49:32.400599
2018-05-10T04:28:25
2018-05-10T04:28:25
132,848,410
0
0
null
null
null
null
UTF-8
Java
false
false
1,521
java
package com.hust.party.controller; import com.hust.party.common.BaseController; import com.hust.party.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.hust.party.pojo.User; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.List; /** * Created by Wei on 2017/7/14. */ @Controller @RequestMapping("/user") public class UserCenterController extends BaseController{ @Autowired UserService userService; @RequestMapping("/center") public ModelAndView userCenter(HttpServletRequest req) { ModelAndView mav = new ModelAndView(); User user = (User) req.getSession().getAttribute("user"); HashMap<String, Object> map = userService.getuserdetail(user.getId()); mav.addObject("map", map); mav.setViewName("userCenter"); return mav; } @RequestMapping("/updatePassword") public String update(HttpServletRequest req, String password) { User user = (User) req.getSession().getAttribute("user"); userService.changepassword(user.getId(), password); return "redirect:/login.jsp"; } @RequestMapping("/resetPassword") public String reset(HttpServletRequest req) { User user = (User) req.getSession().getAttribute("user"); userService.resetpassword(user.getId()); return "redirect:/login.jsp"; } }
[ "code_fan@163.com" ]
code_fan@163.com
67f72c073089491a0b7a1c56580e194e8ca40915
bde8dfc2cab9852f11167ea1fba072718efd7eeb
/acris-widgets-beantable/src/main/java/com/google/gwt/gen2/table/event/client/PageLoadHandler.java
e92da7ce82b5b9702067d3dceed97444be68f44b
[]
no_license
seges/acris
1051395f8900dce44cbaabf373538de6d4a5c565
db8bd8f1533a767a4e43b4b8cc1039b0c8882e70
refs/heads/master
2020-12-13T02:18:28.968038
2015-08-29T13:28:07
2015-08-29T13:28:07
41,421,718
4
1
null
2018-08-21T18:08:35
2015-08-26T11:22:52
Java
UTF-8
Java
false
false
968
java
/* * Copyright 2008 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.gwt.gen2.table.event.client; import com.google.gwt.event.shared.EventHandler; /** * Handler interface for {@link PageLoadEvent} events. */ public interface PageLoadHandler extends EventHandler { /** * Called when a {@link PageLoadEvent} is fired. * * @param event the event that was fired */ void onPageLoad(PageLoadEvent event); }
[ "sloboda@seges.sk@e28c4d36-3818-11de-97fb-aff7d2a6cc54" ]
sloboda@seges.sk@e28c4d36-3818-11de-97fb-aff7d2a6cc54
9f8b8dfdd82db915d43fed2ff87cdc6d9f430c1d
c498cefc16ba5d75b54d65297b88357d669c8f48
/gameserver/src/ru/catssoftware/gameserver/model/actor/stat/StaticObjStat.java
8e5b08982437d268b6e83eed697fad8b4a2a18f8
[]
no_license
ManWithShotgun/l2i-JesusXD-3
e17f7307d9c5762b60a2039655d51ab36ec76fad
8e13b4dda28905792621088714ebb6a31f223c90
refs/heads/master
2021-01-17T16:10:42.561720
2016-07-22T18:41:22
2016-07-22T18:41:22
63,967,514
1
2
null
null
null
null
UTF-8
Java
false
false
1,113
java
/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package ru.catssoftware.gameserver.model.actor.stat; import ru.catssoftware.gameserver.model.actor.instance.L2StaticObjectInstance; public class StaticObjStat extends CharStat { public StaticObjStat(L2StaticObjectInstance activeChar) { super(activeChar); setLevel((byte) 1); } @Override public L2StaticObjectInstance getActiveChar() { return (L2StaticObjectInstance) _activeChar; } @Override public final byte getLevel() { return 1; } }
[ "u3n3ter7@mail.ru" ]
u3n3ter7@mail.ru
5dab635c32731fec937634f60f955d58fb76ba6d
3bcefa7861eb21b39533c88b204f4d94db433468
/messaging-rabbitmq/src/test/java/org/elasticsoftware/elasticactors/rabbitmq/BufferingMessageAckerTest.java
463590e7da2c305eb568283bf9c98f6d0fcadf03
[ "Apache-2.0" ]
permissive
adrianprecub/elasticactors
2177b5fdd9d22264e3439adda6258b1b8bfbc7ec
0d4e5fb924ee07c4378b2c8a227f3e0324714a9f
refs/heads/master
2020-05-22T14:03:55.164588
2019-05-10T15:51:58
2019-05-10T15:51:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,367
java
/* * Copyright 2013 - 2017 The Original Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.elasticsoftware.elasticactors.rabbitmq; import com.rabbitmq.client.Channel; import org.elasticsoftware.elasticactors.rabbitmq.ack.BufferingMessageAcker; import org.testng.annotations.Test; import static org.mockito.Mockito.*; /** * @author Joost van de Wijgerd */ public class BufferingMessageAckerTest { @Test public void testAcking() throws Exception { Channel channel = mock(Channel.class); BufferingMessageAcker messageAcker = new BufferingMessageAcker(channel); messageAcker.start(); // deliver out of order for(long i = 100; i < 1000; i++) { messageAcker.deliver(i); } for(long i = 1; i < 100; i++) { messageAcker.deliver(i); } Thread.sleep(1000); verifyZeroInteractions(channel); // ack the first 99 but not the first (nothing should be acked) for(long i = 2; i < 100; i++) { messageAcker.ack(i); } Thread.sleep(1000); verifyZeroInteractions(channel); // now ack the first (this should cause an ack on the channel messageAcker.ack(1); verify(channel,timeout(1000)).basicAck(99, true); messageAcker.ack(102); messageAcker.ack(100); verify(channel,timeout(1000)).basicAck(100, true); messageAcker.ack(101); verify(channel,timeout(1000)).basicAck(102, true); for(long i = 103; i < 1000; i++) { messageAcker.ack(i); } verify(channel,timeout(1000)).basicAck(999, true); // deliver one more message messageAcker.deliver(1000); Thread.sleep(1000); verifyZeroInteractions(channel); messageAcker.stop(); } }
[ "jwijgerd@gmail.com" ]
jwijgerd@gmail.com
f23eb8f3ec38788e1747ce61e2d8a324e0878c94
04907491e4fb0b1f2f5c336101cbe386a372b29f
/itrip-utils/src/main/java/cn/itrip/common/WeekUtils.java
cd9cfe5f49156acbcce36aaf6fadad200ffe278b
[]
no_license
linxiaoqi/Itrip
7593d495540da85d87ef7b6418864c8e1a23b959
1942ecf0316c8c7d566de874eebbb3fca18a3b20
refs/heads/master
2020-04-15T20:14:22.560366
2019-01-18T07:49:23
2019-01-18T07:49:23
164,984,126
0
0
null
null
null
null
UTF-8
Java
false
false
751
java
package cn.itrip.common; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class WeekUtils { /*** *获取当前日期是星期几 */ public static Integer getWeekOfDate(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date); int w = cal.get(Calendar.DAY_OF_WEEK); if (w < 0) w = 0; return w; } public static void main(String[] args) throws ParseException { WeekUtils weekUtils = new WeekUtils(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); int count = weekUtils.getWeekOfDate(sdf.parse("2017-07-15")); System.out.println(count); } }
[ "zys@163.com" ]
zys@163.com
6f96df23d0e6bff09677a35bc8179b65104c0568
d15ecce0b5debe8068504b987417c790bbf6d288
/src/Servlets/AdminOrderedCakeSearch.java
b2b113d947b9becbbacdad34bba7f70d6bb0f62b
[]
no_license
salamzakeer/ITP_Cakes.lk
2a26fbc6663d1a52528840118894be6e8d7ef664
4127f1bdcf03804f573582923a0d621096a3d43f
refs/heads/master
2022-12-30T04:38:34.056443
2020-10-22T04:45:04
2020-10-22T04:45:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,277
java
package Servlets; import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import javax.servlet.RequestDispatcher; 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 Connection.DbConnection; /** * Servlet implementation class AdminOrderedCakeSearch */ @WebServlet("/AdminOrderedCakeSearch") public class AdminOrderedCakeSearch extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public AdminOrderedCakeSearch() { super(); // TODO Auto-generated constructor stub } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String Name=request.getParameter("id"); Connection conn= DbConnection.getDBConnection(); Statement st; try { ArrayList<String> orderlist = null; ArrayList<ArrayList<String>> oid_list = new ArrayList<ArrayList<String>>(); String query = "select * from cake_order where custname='"+Name+"'OR cake_oid='"+Name+"'"; st = conn.createStatement(); ResultSet rs = st.executeQuery(query); while (rs.next()) { orderlist = new ArrayList<String>(); orderlist.add(rs.getString(1)); orderlist.add(rs.getString(2)); orderlist.add(rs.getString(3)); orderlist.add(rs.getString(4)); orderlist.add(rs.getString(5)); orderlist.add(rs.getString(6)); orderlist.add(rs.getString(7)); orderlist.add(rs.getString(8)); oid_list.add(orderlist); } request.setAttribute("OrderList", oid_list); RequestDispatcher view = request.getRequestDispatcher("/AdminOrderedCakeSearcResults.jsp"); view.forward(request, response); conn.close(); } catch (Exception e) { e.printStackTrace(); } } }
[ "uabarna9@gmail.com" ]
uabarna9@gmail.com
2148947928c73db015037e3af592caeb4504cd5d
d195d98c5fbb0676d02bd09533f53ceb1d3fdefe
/packages/SystemUI/src/com/android/systemui/statusbar/policy/PieController.java
a8c8d2381a4db6a884a1ebb47be3d40476f2ee50
[ "Apache-2.0", "LicenseRef-scancode-unicode" ]
permissive
TeamEOS/frameworks_base
25402f10786baf12c2cfb60fe92e0297b794d24f
fa7e4c88a31c963cf2ad91ef5c56ec43796e962f
refs/heads/lp5.1
2020-04-06T04:40:30.885968
2015-10-02T11:36:54
2015-10-03T20:00:32
8,963,772
4
11
null
2015-06-19T11:18:28
2013-03-23T00:46:36
Java
UTF-8
Java
false
false
36,255
java
/* * Copyright (C) 2014-2015 SlimRoms Project * This code is loosely based on portions of the CyanogenMod Project (Jens Doll) Copyright (C) 2013 * and the ParanoidAndroid Project source, Copyright (C) 2012. * * 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.android.systemui.statusbar.policy; import android.app.Activity; import android.app.ActivityManager; import android.app.StatusBarManager; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.res.Resources; import android.database.ContentObserver; import android.graphics.PixelFormat; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.Point; import android.graphics.PorterDuff.Mode; import android.hardware.input.InputManager; import android.net.Uri; import android.os.BatteryManager; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.ServiceManager; import android.os.UserHandle; import android.os.Vibrator; import android.provider.Settings; import android.service.gesture.EdgeGestureManager; import android.telephony.PhoneStateListener; import android.telephony.ServiceState; import android.telephony.TelephonyManager; import android.util.Log; import android.util.Slog; import android.view.HapticFeedbackConstants; import android.view.IWindowManager; import android.view.SoundEffectConstants; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; import android.view.accessibility.AccessibilityEvent; import android.widget.ImageView; import com.android.internal.navigation.Hintable; import com.android.internal.navigation.NavigationBarOverlay; import com.android.internal.utils.eos.ActionConstants; import com.android.internal.utils.eos.ActionHandler; import com.android.internal.utils.eos.ActionUtils; import com.android.internal.utils.eos.Config; import com.android.internal.utils.eos.Config.ActionConfig; import com.android.internal.utils.eos.Config.ButtonConfig; import com.android.internal.utils.eos.ImageHelper; import com.android.internal.util.gesture.EdgeGesturePosition; import com.android.internal.util.gesture.EdgeServiceConstants; import com.android.systemui.R; import com.android.systemui.statusbar.pie.PieItem; import com.android.systemui.statusbar.pie.PieView; import com.android.systemui.statusbar.pie.PieView.PieDrawable; import com.android.systemui.statusbar.pie.PieView.PieSlice; import com.android.systemui.statusbar.pie.PieSliceContainer; import com.android.systemui.statusbar.pie.PieSysInfo; import java.util.ArrayList; /** * Controller class for the default pie control. * <p> * This class is responsible for setting up the pie control, activating it, and defining and * executing the actions that can be triggered by the pie control. */ public class PieController implements Hintable, PieView.OnExitListener, PieView.OnSnapListener, PieItem.PieOnClickListener, PieItem.PieOnLongClickListener { private static final String TAG = "PieController"; private static final boolean DEBUG = false; private boolean mSecondLayerActive; private Handler mObservHandler = new Handler(); public static final float EMPTY_ANGLE = 10; public static final float START_ANGLE = 180 + EMPTY_ANGLE; private static final int MSG_PIE_GAIN_FOCUS = 1068; private final static int MENU_VISIBILITY_ALWAYS = 0; private final static int MENU_VISIBILITY_NEVER = 1; private final static int MENU_VISIBILITY_SYSTEM = 2; private Context mContext; private PieView mPieContainer; private EdgeGestureManager mPieManager; private boolean mAttached = false; private boolean mIsDetaching = false; private NavigationBarOverlay mNavigationBarOverlay; private Vibrator mVibrator; private WindowManager mWindowManager; private int mBatteryLevel; private int mBatteryStatus; private TelephonyManager mTelephonyManager; private ServiceState mServiceState; // All pie slices that are managed by the controller private PieSliceContainer mNavigationSlice; private PieSliceContainer mNavigationSliceSecondLayer; private PieItem mMenuButton; private PieSysInfo mSysInfo; private int mNavigationIconHints = 0; private int mDisabledFlags = 0; private boolean mShowMenu = false; private int mShowMenuVisibility; private Drawable mBackIcon; private Drawable mBackAltIcon; private boolean mIconResize = false; private float mIconResizeFactor ; private int mPieTriggerSlots; private int mPieTriggerMask = EdgeGesturePosition.LEFT.FLAG | EdgeGesturePosition.BOTTOM.FLAG | EdgeGesturePosition.RIGHT.FLAG; private boolean mPieTriggerMaskLocked; private int mRestorePieTriggerMask; private EdgeGesturePosition mPosition; private EdgeGestureManager.EdgeGestureActivationListener mPieActivationListener = new EdgeGestureManager.EdgeGestureActivationListener(Looper.getMainLooper()) { @Override public void onEdgeGestureActivation( int touchX, int touchY, EdgeGesturePosition position, int flags) { if (mPieContainer != null && activateFromListener(touchX, touchY, position)) { // give the main thread some time to do the bookkeeping mHandler.obtainMessage(MSG_PIE_GAIN_FOCUS).sendToTarget(); } else { mPieActivationListener.restoreListenerState(); } } }; private Handler mHandler = new Handler(Looper.getMainLooper()) { public void handleMessage(Message m) { switch (m.what) { case MSG_PIE_GAIN_FOCUS: if (mPieContainer != null) { if (!mPieActivationListener.gainTouchFocus( mPieContainer.getWindowToken())) { mPieContainer.exit(); } } else { mPieActivationListener.restoreListenerState(); } break; } } }; private final class SettingsObserver extends ContentObserver { SettingsObserver(Handler handler) { super(handler); } void observe() { ContentResolver resolver = mContext.getContentResolver(); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_GRAVITY), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_BUTTONS_CONFIG), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_SIZE), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_BUTTON_COLOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_BUTTON_PRESSED_COLOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_BUTTON_LONG_PRESSED_COLOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_BUTTON_OUTLINE_COLOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_ICON_COLOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_ICON_COLOR_MODE), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_BUTTON_ALPHA), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_BUTTON_PRESSED_ALPHA), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_BUTTONS_CONFIG_SECOND_LAYER), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_MENU), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.System.getUriFor( Settings.System.PIE_IME_CONTROL), false, this, UserHandle.USER_ALL); } @Override public void onChange(boolean selfChange, Uri uri) { super.onChange(selfChange, uri); if (uri.equals(Settings.System.getUriFor( Settings.System.PIE_BUTTONS_CONFIG_SECOND_LAYER))) { ArrayList<ButtonConfig> buttonsConfig = Config.getConfig(mContext, ActionConstants.getDefaults(ActionConstants.PIE_SECONDARY)); if (mSecondLayerActive != buttonsConfig.size() > 0) { constructSlices(); } } refreshContainer(); } } private SettingsObserver mSettingsObserver = new SettingsObserver(mObservHandler); private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); mBatteryStatus = intent.getIntExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_UNKNOWN); } else if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action) || Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) { setupNavigationItems(); } else if (Intent.ACTION_SCREEN_OFF.equals(action)) { // Give up on screen off. what's the point in pie controls if you don't see them? if (isShowing()) { mPieContainer.exit(); } } } }; private PhoneStateListener mPhoneStateListener = new PhoneStateListener() { @Override public void onServiceStateChanged(ServiceState serviceState) { mServiceState = serviceState; } }; public PieController(Context context, EdgeGestureManager pieManager, NavigationBarOverlay nbo) { mContext = context; mNavigationBarOverlay = nbo; mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE); mWindowManager = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE); if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { mTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); } mPieManager = pieManager; mPieManager.setEdgeGestureActivationListener(mPieActivationListener); } public void refreshContainer() { if (mAttached) { setupNavigationItems(); setupListener(); } } public void attachContainer() { if (!mAttached) { mAttached = true; setupContainer(); refreshContainer(); mSettingsObserver.observe(); } } public void detachContainer(boolean onExit) { if (mPieContainer == null || !mAttached) { return; } if (isShowing() && !onExit) { mIsDetaching = true; return; } mIsDetaching = false; mAttached = false; mPieManager.updateEdgeGestureActivationListener(mPieActivationListener, 0); if (mTelephonyManager != null) { mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE); } mContext.getContentResolver().unregisterContentObserver(mSettingsObserver); mContext.unregisterReceiver(mBroadcastReceiver); mPieContainer.clearSlices(); mPieContainer = null; } private void setupContainer() { if (mPieContainer == null) { mPieContainer = new PieView(mContext, mNavigationBarOverlay); mPieContainer.setOnSnapListener(this); mPieContainer.setOnExitListener(this); if (mTelephonyManager != null) { mTelephonyManager.listen( mPhoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE); } /** * Add intent actions to listen on it. * Battery change for the battery, * screen off to get rid of the pie, * apps available to check if apps on external sdcard * are available and reconstruct the button icons */ IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_BATTERY_CHANGED); filter.addAction(Intent.ACTION_SCREEN_OFF); filter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE); filter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE); mContext.registerReceiver(mBroadcastReceiver, filter); // Construct the slices constructSlices(); } } public void constructSlices() { final Resources res = mContext.getResources(); // Clear the slices mPieContainer.clearSlices(); // Construct navbar slice int inner = res.getDimensionPixelSize(R.dimen.pie_navbar_radius); int outer = inner + res.getDimensionPixelSize(R.dimen.pie_navbar_height); mNavigationSlice = new PieSliceContainer(mPieContainer, PieSlice.IMPORTANT | PieDrawable.DISPLAY_ALL); mNavigationSlice.setGeometry(START_ANGLE, 180 - 2 * EMPTY_ANGLE, inner, outer); // Construct maybe navbar slice second layer ArrayList<ButtonConfig> buttonsConfig = Config.getConfig(mContext, ActionConstants.getDefaults(ActionConstants.PIE_SECONDARY)); mSecondLayerActive = buttonsConfig.size() > 0; if (mSecondLayerActive) { inner = res.getDimensionPixelSize(R.dimen.pie_navbar_second_layer_radius); outer = inner + res.getDimensionPixelSize(R.dimen.pie_navbar_height); mNavigationSliceSecondLayer = new PieSliceContainer(mPieContainer, PieSlice.IMPORTANT | PieDrawable.DISPLAY_ALL); mNavigationSliceSecondLayer.setGeometry( START_ANGLE, 180 - 2 * EMPTY_ANGLE, inner, outer); } // Setup buttons and add the slices finally mPieContainer.addSlice(mNavigationSlice); if (mSecondLayerActive) { mPieContainer.addSlice(mNavigationSliceSecondLayer); // Adjust dimensions for sysinfo when second layer is active inner = res.getDimensionPixelSize(R.dimen.pie_sysinfo_second_layer_radius); } else { inner = res.getDimensionPixelSize(R.dimen.pie_sysinfo_radius); } // Construct sysinfo slice outer = inner + res.getDimensionPixelSize(R.dimen.pie_sysinfo_height); mSysInfo = new PieSysInfo(mContext, mPieContainer, this, PieDrawable.DISPLAY_NOT_AT_TOP); mSysInfo.setGeometry(START_ANGLE, 180 - 2 * EMPTY_ANGLE, inner, outer); mPieContainer.addSlice(mSysInfo); } private void setupListener() { ContentResolver resolver = mContext.getContentResolver(); mPieTriggerSlots = Settings.System.getIntForUser(resolver, Settings.System.PIE_GRAVITY, EdgeGesturePosition.LEFT.FLAG, UserHandle.USER_CURRENT); int sensitivity = mContext.getResources().getInteger(R.integer.pie_gesture_sensivity); if (sensitivity < EdgeServiceConstants.SENSITIVITY_LOWEST || sensitivity > EdgeServiceConstants.SENSITIVITY_HIGHEST) { sensitivity = EdgeServiceConstants.SENSITIVITY_DEFAULT; } int flags = mPieTriggerSlots & mPieTriggerMask; if (Settings.System.getIntForUser(resolver, Settings.System.PIE_IME_CONTROL, 1, UserHandle.USER_CURRENT) == 1) { flags |= EdgeServiceConstants.IME_CONTROL; } mPieManager.updateEdgeGestureActivationListener(mPieActivationListener, sensitivity<<EdgeServiceConstants.SENSITIVITY_SHIFT | flags); } private void setupNavigationItems() { ContentResolver resolver = mContext.getContentResolver(); // Get minimum allowed image size for layout int minimumImageSize = (int) mContext.getResources().getDimension(R.dimen.pie_item_size); mNavigationSlice.clear(); // Reset mIconResizeFactor mIconResizeFactor = 1.0f; // Check the size set from the user and set resize values if needed float diff = PieView.PIE_ICON_START_SIZE_FACTOR - Settings.System.getFloatForUser(resolver, Settings.System.PIE_SIZE, PieView.PIE_CONTROL_SIZE_DEFAULT, UserHandle.USER_CURRENT); if (diff > 0.0f) { mIconResize = true; mIconResizeFactor = 1.0f - diff; } else { mIconResize = false; } // Prepare IME back icon mBackAltIcon = mContext.getResources().getDrawable(R.drawable.ic_sysbar_back_ime); mBackAltIcon = prepareBackIcon(mBackAltIcon, false); ArrayList<ButtonConfig> buttonsConfig; // First we construct first buttons layer buttonsConfig = Config.getConfig(mContext, ActionConstants.getDefaults(ActionConstants.PIE_PRIMARY)); getCustomActionsAndConstruct(resolver, buttonsConfig, false, minimumImageSize); if (mSecondLayerActive) { // If second layer is active we construct second layer now mNavigationSliceSecondLayer.clear(); buttonsConfig = Config.getConfig(mContext, ActionConstants.getDefaults(ActionConstants.PIE_SECONDARY)); getCustomActionsAndConstruct(resolver, buttonsConfig, true, minimumImageSize); } mShowMenuVisibility = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.PIE_MENU, MENU_VISIBILITY_SYSTEM, UserHandle.USER_CURRENT); setNavigationIconHints(mNavigationIconHints, true); setMenuVisibility(mShowMenu); } private void getCustomActionsAndConstruct(ContentResolver resolver, ArrayList<ButtonConfig> buttonsConfig, boolean secondLayer, int minimumImageSize) { int buttonWidth = 10 / buttonsConfig.size(); ButtonConfig buttonConfig; for (int j = 0; j < buttonsConfig.size(); j++) { buttonConfig = buttonsConfig.get(j); if (secondLayer) { addItemToLayer(mNavigationSliceSecondLayer, buttonConfig, buttonWidth, minimumImageSize); } else { addItemToLayer(mNavigationSlice, buttonConfig, buttonWidth, minimumImageSize); } } if (!secondLayer) { mMenuButton = constructItem(1, ActionHandler.SYSTEMUI_TASK_MENU, ActionHandler.SYSTEMUI_TASK_NO_ACTION, ActionConstants.EMPTY, minimumImageSize); mNavigationSlice.addItem(mMenuButton); } } private void addItemToLayer(PieSliceContainer layer, ButtonConfig buttonConfig, int buttonWidth, int minimumImageSize) { layer.addItem(constructItem(buttonWidth, buttonConfig.getActionConfig(ActionConfig.PRIMARY).getAction(), buttonConfig.getActionConfig(ActionConfig.SECOND).getAction(), buttonConfig.getActionConfig(ActionConfig.PRIMARY).getIconUri(), minimumImageSize)); if (buttonConfig.getActionConfig(ActionConfig.PRIMARY).getAction() .equals(ActionHandler.SYSTEMUI_TASK_HOME)) { layer.addItem(constructItem(buttonWidth, ActionHandler.SYSTEMUI_TASK_ASSIST, buttonConfig.getActionConfig(ActionConfig.SECOND).getAction(), ActionConstants.EMPTY, minimumImageSize)); } } private PieItem constructItem(int width, String clickAction, String longPressAction, String iconUri, int minimumImageSize) { ImageView view = new ImageView(mContext); int iconType = setPieItemIcon(view, iconUri, clickAction); view.setMinimumWidth(minimumImageSize); view.setMinimumHeight(minimumImageSize); LayoutParams lp = new LayoutParams(minimumImageSize, minimumImageSize); view.setLayoutParams(lp); PieItem item = new PieItem(mContext, mPieContainer, 0, width, clickAction, longPressAction, view, iconType); item.setOnClickListener(this); if (!longPressAction.equals(ActionHandler.SYSTEMUI_TASK_NO_ACTION)) { item.setOnLongClickListener(this); } return item; } private int setPieItemIcon(ImageView view, String iconUri, String clickAction) { Drawable d = ActionUtils.getDrawableForAction(mContext, clickAction); if (d != null) { view.setImageDrawable(d); } if (iconUri != null && !iconUri.equals(ActionConstants.EMPTY) && !iconUri.startsWith(ActionHandler.SYSTEM_PREFIX)) { if (clickAction.equals(ActionHandler.SYSTEMUI_TASK_BACK)) { // Back icon image needs to be handled seperatly. // All other is handled in PieItem. mBackIcon = prepareBackIcon(d, true); } else { // Custom images need to be forced to resize to fit better resizeIcon(view, null, true); } return 2; } else { if (clickAction.startsWith(ActionHandler.SYSTEM_PREFIX)) { if (clickAction.equals(ActionHandler.SYSTEMUI_TASK_BACK)) { mBackIcon = prepareBackIcon(d, false); } if (mIconResize) { resizeIcon(view, null, false); } return 0; } resizeIcon(view, null, true); return 1; } } private Drawable resizeIcon(ImageView view, Drawable d, boolean useSystemDimens) { int size = 0; Drawable dOriginal = d; if (d == null) { dOriginal = view.getDrawable(); } if (useSystemDimens) { size = mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.app_icon_size); } else { size = Math.max(dOriginal.getIntrinsicHeight(), dOriginal.getIntrinsicWidth()); } Drawable dResized = ImageHelper.resize( mContext, dOriginal, ActionUtils.pxToDp(mContext, (int) (size * mIconResizeFactor))); if (d == null) { view.setImageDrawable(dResized); return null; } else { return (dResized); } } private Drawable prepareBackIcon(Drawable d, boolean customIcon) { int customImageColorize = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.PIE_ICON_COLOR_MODE, 0, UserHandle.USER_CURRENT); int drawableColor = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.PIE_ICON_COLOR, -2, UserHandle.USER_CURRENT); if (drawableColor == -2) { drawableColor = mContext.getResources().getColor(R.color.pie_foreground_color); } if (mIconResize && !customIcon) { d = resizeIcon(null, d, false); } else if (customIcon) { d = resizeIcon(null, d, true); } if ((customImageColorize != 1 || !customIcon) && customImageColorize != 3) { d = new BitmapDrawable(mContext.getResources(), ImageHelper.getColoredBitmap(d, drawableColor)); } return d; } public boolean activateFromListener(int touchX, int touchY, EdgeGesturePosition position) { if (isShowing()) { return false; } doHapticTriggerFeedback(); mPosition = position; Point center = new Point(touchX, touchY); mPieContainer.setSnapPoints(mPieTriggerMask & ~mPieTriggerSlots); mPieContainer.activate(center, position); mWindowManager.addView(mPieContainer, generateLayoutParam()); return true; } private WindowManager.LayoutParams generateLayoutParam() { WindowManager.LayoutParams lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, PixelFormat.TRANSLUCENT); // Turn on hardware acceleration for high end gfx devices. if (ActivityManager.isHighEndGfx()) { lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED; } // This title is for debugging only. See: dumpsys window lp.setTitle("PieControlPanel"); lp.windowAnimations = android.R.style.Animation; lp.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_BEHIND; return lp; } @Override public void onExit() { mWindowManager.removeView(mPieContainer); mPieActivationListener.restoreListenerState(); if (mIsDetaching) { detachContainer(true); } } public void updatePieTriggerMask(int newMask, boolean lock) { if (mPieTriggerMaskLocked) { // Outside call. // Update mask is currently locked. Save new requested mask // till lock is released and can be restored. mRestorePieTriggerMask = newMask; return; } int oldState = mPieTriggerSlots & mPieTriggerMask; if (lock) { // Lock update is requested. Save old state // to restore it later on release if no other mask // updates are requested inbetween. mPieTriggerMaskLocked = true; mRestorePieTriggerMask = oldState; } mPieTriggerMask = newMask; // Check if we are active and if it would make a change at all if (mPieContainer != null && ((mPieTriggerSlots & mPieTriggerMask) != oldState)) { setupListener(); } } public void restorePieTriggerMask() { if (!mPieTriggerMaskLocked) { return; } // Restore last trigger mask mPieTriggerMaskLocked = false; updatePieTriggerMask(mRestorePieTriggerMask, false); } @Override public void setNavigationIconHints(int hints) { // This call may come from outside. // Check if we already have a navigation slice to manipulate if (mNavigationSlice != null) { setNavigationIconHints(hints, false); } else { mNavigationIconHints = hints; } } protected void setNavigationIconHints(int hints, boolean force) { if (!force && hints == mNavigationIconHints) return; if (DEBUG) Slog.v(TAG, "Pie navigation hints: " + hints); mNavigationIconHints = hints; PieItem item; for (int j = 0; j < 2; j++) { item = findItem(ActionHandler.SYSTEMUI_TASK_BACK, j); if (item != null) { boolean isAlt = (hints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) != 0; item.setImageDrawable(isAlt ? mBackAltIcon : mBackIcon); } } setDisabledFlags(mDisabledFlags, true); } private PieItem findItem(String type, int secondLayer) { if (secondLayer == 1) { if (mSecondLayerActive && mNavigationSliceSecondLayer != null) { for (PieItem item : mNavigationSliceSecondLayer.getItems()) { String itemType = (String) item.tag; if (type.equals(itemType)) { return item; } } } } else { for (PieItem item : mNavigationSlice.getItems()) { String itemType = (String) item.tag; if (type.equals(itemType)) { return item; } } } return null; } @Override public void setDisabledFlags(int disabledFlags) { // This call may come from outside. // Check if we already have a navigation slice to manipulate if (mNavigationSlice != null) { setDisabledFlags(disabledFlags, false); } else { mDisabledFlags = disabledFlags; } } protected void setDisabledFlags(int disabledFlags, boolean force) { if (!force && mDisabledFlags == disabledFlags) return; mDisabledFlags = disabledFlags; final boolean disableHome = ((disabledFlags & View.STATUS_BAR_DISABLE_HOME) != 0); final boolean disableRecent = ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0); final boolean disableBack = ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0) && ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0); PieItem item; for (int j = 0; j < 2; j++) { item = findItem(ActionHandler.SYSTEMUI_TASK_BACK, j); if (item != null) { item.show(!disableBack); } item = findItem(ActionHandler.SYSTEMUI_TASK_HOME, j); if (item != null) { item.show(!disableHome); // If the homebutton exists we can assume that the keyguard // search button exists as well. item = findItem(ActionHandler.SYSTEMUI_TASK_ASSIST, j); item.show(disableHome); } item = findItem(ActionHandler.SYSTEMUI_TASK_RECENTS, j); if (item != null) { item.show(!disableRecent); } } setMenuVisibility(mShowMenu, true); } @Override public void setMenuVisibility(boolean showMenu) { setMenuVisibility(showMenu, false); } private void setMenuVisibility(boolean showMenu, boolean force) { if (!force && mShowMenu == showMenu) { return; } if (mMenuButton != null) { final boolean disableRecent = ((mDisabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0); mMenuButton.show((showMenu || mShowMenuVisibility == MENU_VISIBILITY_ALWAYS) && mShowMenuVisibility != MENU_VISIBILITY_NEVER && !disableRecent); } mShowMenu = showMenu; } @Override public void onSnap(EdgeGesturePosition position) { if (position == mPosition) { return; } doHapticTriggerFeedback(); if (DEBUG) { Slog.d(TAG, "onSnap from " + position.name()); } int triggerSlots = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.PIE_GRAVITY, EdgeGesturePosition.LEFT.FLAG, UserHandle.USER_CURRENT); triggerSlots = triggerSlots & ~mPosition.FLAG | position.FLAG; Settings.System.putIntForUser(mContext.getContentResolver(), Settings.System.PIE_GRAVITY, triggerSlots, UserHandle.USER_CURRENT); } @Override public void onLongClick(PieItem item) { String type = (String) item.longTag; if (!ActionHandler.isActionKeyEvent(type)) { mPieContainer.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); } mPieContainer.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); //ActionHandler.performTask(mContext, type, true); ActionHandler.performTask(mContext, type); } @Override public void onClick(PieItem item) { String type = (String) item.tag; if (!ActionHandler.isActionKeyEvent(type)) { mPieContainer.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); } if (!type.equals(ActionHandler.SYSTEMUI_TASK_MENU)) { mPieContainer.playSoundEffect(SoundEffectConstants.CLICK); } mPieContainer.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); //ActionHandler.performTask(mContext, type, false); ActionHandler.performTask(mContext, type); } private void doHapticTriggerFeedback() { if (mVibrator == null || !mVibrator.hasVibrator()) { return; } int hapticSetting = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, 1, UserHandle.USER_CURRENT); if (hapticSetting != 0) { mVibrator.vibrate(5); } } public boolean isShowing() { return mPieContainer != null && mPieContainer.isShowing(); } public String getOperatorState() { if (mTelephonyManager == null) { return null; } if (mServiceState == null || mServiceState.getState() == ServiceState.STATE_OUT_OF_SERVICE) { return mContext.getString(R.string.pie_phone_status_no_service); } if (mServiceState.getState() == ServiceState.STATE_POWER_OFF) { return mContext.getString(R.string.pie_phone_status_airplane_mode); } if (mServiceState.isEmergencyOnly()) { return mContext.getString(R.string.pie_phone_status_emergency_only); } return mServiceState.getOperatorAlphaLong(); } public String getBatteryLevel() { if (mBatteryStatus == BatteryManager.BATTERY_STATUS_FULL) { return mContext.getString(R.string.pie_battery_status_full); } if (mBatteryStatus == BatteryManager.BATTERY_STATUS_CHARGING) { return mContext.getString(R.string.pie_battery_status_charging, mBatteryLevel); } return mContext.getString(R.string.pie_battery_status_discharging, mBatteryLevel); } }
[ "randall.rushing@gmail.com" ]
randall.rushing@gmail.com
f51cc736de93bfc65df223bfcf55e536794c4e9d
86306dd7aa6efdfcd5dabff8b272201a6fd9e3d7
/src/main/java/com/chapter3/nio/SimpleFileCopy.java
44424a7c85da67b3ab980d209f4b1fbf1151c567
[]
no_license
xiaowoniu93/better_faster
e63d738a4cdd62edd119b8297b0d2402a19630c0
8decc4137c6fa588c7f151fa6c9a1887822b02e2
refs/heads/master
2022-12-24T04:34:56.709561
2020-07-09T15:15:32
2020-07-09T15:15:32
155,739,316
0
0
null
2022-12-16T04:35:26
2018-11-01T15:53:00
Java
UTF-8
Java
false
false
1,051
java
package com.chapter3.nio; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; public class SimpleFileCopy { public static void main(String[] args) throws IOException{ String sourceFile = "gradle项目启动_断点配置.rtf"; String destFile = "gradle项目启动_断点配置V2.rtf"; copyFile(sourceFile, destFile); } public static void copyFile(String sourceFile, String destFile) throws IOException{ FileInputStream fis = new FileInputStream(new File(sourceFile)); FileOutputStream fos = new FileOutputStream(new File(destFile)); FileChannel readChannel = fis.getChannel(); FileChannel writeChannel = fos.getChannel(); ByteBuffer byteBuffer = ByteBuffer.allocate(1024); while (true) { byteBuffer.clear(); int r = readChannel.read(byteBuffer); if(r == -1){ break; } byteBuffer.flip(); writeChannel.write(byteBuffer); } readChannel.close(); writeChannel.close(); } }
[ "3166653897@qq.com" ]
3166653897@qq.com
9ea6213261b0765f243b97918bad62e5f2e3ebe9
5719832da2610590b19d7721513cdd098819ab53
/jobassistant2/pub/org/job/pub/Publish1.java
ba0affac9574003569cc698d9991a8ea2b07fa1b
[]
no_license
lovecode2011/duolekit
35c2580303dec180571e54dcd1b915fa9e00f6aa
570191adfda0c2e7df6d68357fd5b25a2635d2bd
refs/heads/master
2021-01-21T08:50:52.945277
2015-03-04T02:14:48
2015-03-04T02:14:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,179
java
package org.job.pub; import java.sql.Timestamp; import java.util.List; import jodd.datetime.JDateTime; import org.hibernate.Session; import org.hibernate.Transaction; import org.job.dao.HibernateSessionFactory; import org.job.dao.entity.Doccatalog; import org.job.dao.entity.DoccatalogDAO; import org.job.dao.entity.Sysprop; import org.job.dao.entity.SyspropDAO; public class Publish1 { public static void main(String[] args) { try{ String SYSVERSION = "0.8"; String SUBVERSION = "1"; String PUBDATE = new JDateTime().toString(); Session session = HibernateSessionFactory.getSession(); Transaction t= session.beginTransaction(); DoccatalogDAO dao =new DoccatalogDAO(); // List<Doccatalog> list = dao.findAll(); // for (int i = 0; i < list.size(); i++) { // Doccatalog cata = (Doccatalog) list.get(i); // dao.delete(cata); // } t.commit(); // t= session.beginTransaction(); SyspropDAO sdao = new SyspropDAO(); // Sysprop prop = sdao.findById("MAILDO"); // prop.setV("FALSE"); // sdao.merge(prop); // t.commit(); t= session.beginTransaction(); sdao = new SyspropDAO(); Sysprop prop1 = sdao.findById("SYSVERSION"); if (prop1 == null){ prop1 = new Sysprop("SYSVERSION",SYSVERSION); sdao.merge(prop1); }else{ prop1.setV(SYSVERSION); sdao.save(prop1); } t.commit(); t= session.beginTransaction(); sdao = new SyspropDAO(); Sysprop prop2 = sdao.findById("SUBVERSION"); if (prop2 == null){ prop2 = new Sysprop("SUBVERSION",SUBVERSION); sdao.merge(prop2); }else{ prop2.setV(SUBVERSION); sdao.save(prop2); } t.commit(); t= session.beginTransaction(); sdao = new SyspropDAO(); Sysprop prop3 = sdao.findById("PUBDATE"); if (prop3 == null){ prop3 = new Sysprop("PUBDATE",PUBDATE); sdao.merge(prop3); }else{ prop3.setV(PUBDATE); sdao.save(prop3); } t.commit(); // Transaction t2=session.beginTransaction(); // dao =new DoccatalogDAO(); // for (int i=0;i<5;i++){ // Doccatalog item = new Doccatalog(); // item.setType("TG"); // System.out.println(""+(20140101+i)); // item.setDocsenddate(20140101+i); // item.setDocsender("XXX"); // item.setDoccaption("标题"+i); // item.setDoccode(""); // item.setContact(""); // item.setPhone(""); // item.setBaseurl(""); // item.setUrl(""); // item.setIndate(20140106); // item.setIntimestamp(new Timestamp(System.currentTimeMillis())); // item.setIshidden(false); // item.setIslooked(false); // item.setIstodo(false); // item.setIstodotime(new Timestamp(System.currentTimeMillis()));//待办时间 // item.setTodomemo(""); // item.setIsdoned(false); // item.setIsdonedtime(new Timestamp(System.currentTimeMillis()));//办完时间 // item.setDonememo(""); // dao.save(item); // } // t2.commit(); JDateTime jdt = new JDateTime(); System.out.println(Integer.parseInt(jdt.toString("YYYYMMDD"))); session.close(); }catch(Exception ex){ ex.printStackTrace(); } } }
[ "ebiskit@gmail.com" ]
ebiskit@gmail.com
dd37e6b302b1cbac08ef4203ae185476cd7e594b
eabec85a69c20648e8c3f29fc4272a214872e82f
/src/main/java/com/globaltech/qna/model/User.java
91079585b15590f538be176ce682955e2b5f11d7
[]
no_license
shivang420/Global-Tech
54fa10b19421f9b2bcf6f9f1f1b5af9123b751d4
7915d18a1f447b9e4c751359bc5769129aebc480
refs/heads/master
2023-01-04T07:48:25.753778
2020-10-27T06:31:52
2020-10-27T06:31:52
306,662,655
0
0
null
null
null
null
UTF-8
Java
false
false
851
java
package com.globaltech.qna.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @Entity @Table(name = "user", schema = "global_tech") @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private String id; @Column(name = "username") private String userName; //getters and setters public String getId() { return id; } public void setId(String id) { this.id = id; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } }
[ "48752081+shivang420@users.noreply.github.com" ]
48752081+shivang420@users.noreply.github.com
01983b3b5f3a9344c6fb49707f67fefae68931a2
a41badc5180e260f43df6c62f93dd6d354f73ff2
/src/org/usfirst/frc4014/powerup/autonomous/AscendClawToTop.java
e7810443712bdf4c6ba76e14209f622d19445780
[]
no_license
FRC4014/2018-robot-code
5d9b23904fc4c19669e08fde84c44a870a7d890d
a8dc735f43489d6a4f2187f8c0bf3d4afb04e7d0
refs/heads/master
2021-05-10T22:50:23.512001
2018-04-22T18:38:08
2018-04-22T18:38:08
118,267,590
0
1
null
null
null
null
UTF-8
Java
false
false
2,307
java
package org.usfirst.frc4014.powerup.autonomous; import org.usfirst.frc4014.powerup.clawlift.ClawLift; import edu.wpi.first.wpilibj.Preferences; import edu.wpi.first.wpilibj.command.Command; public class AscendClawToTop extends Command{ private final ClawLift clawLift; private final double distance; private double speed; private long initTimestamp; public AscendClawToTop(ClawLift clawLift, double distanceInches) { this.clawLift = clawLift; this.distance = distanceInches; requires(clawLift); } @Override protected void initialize() { initTimestamp = System.currentTimeMillis(); clawLift.resetEncoder(); speed = Preferences.getInstance().getDouble("AutoAscendClawSpeed", 0.9); } @Override protected void execute() { // clawLift.ascend((distance > 0) ? speed : -speed); if (System.currentTimeMillis() - initTimestamp > 1800) { speed = Preferences.getInstance().getDouble("HoldSteady", .25); } clawLift.ascend(speed); } @Override protected boolean isFinished() { return probableCollision() || achievedDistance(); } private boolean probableCollision() { /*boolean collision = (System.currentTimeMillis() - initTimestamp > 150) && (Math.abs(RobotMap.clawAscentEncoder.getRate()) < 1.0); if (collision) { System.out.println("AscendClawByDistance: collision"); }*/ return false; } private boolean achievedDistance() { /*double encoderDistance = RobotMap.clawAscentEncoder.getDistance(); boolean finished = encoderDistance >= distance - 0.5; System.out.println("AscendClawByDistance: target distance = " + distance + " | ENCODER distance = " + encoderDistance + " | speed = " + speed + " | is finished = " + finished); if (finished) { System.out.println("AscendClawByDistance: ascended " + distance); }*/ if (System.currentTimeMillis() - initTimestamp > 1800) { speed = .25; } System.out.println("time is: " + ((System.currentTimeMillis() - initTimestamp))); return (System.currentTimeMillis() - initTimestamp > 1800); } }
[ "njennings2019@hightechhigh.org" ]
njennings2019@hightechhigh.org
bcc1eebc405fe492d4d51678bc0d053426e1edbd
9dd221c7a8729a2fd4e8f3be27fbc99468cc3714
/simulator-aas/src/main/java/com/iot/learnings/simulator/config/SimulatorProperties.java
ce4a5d75e9084c8fd2cf35fc207ce6cd13089d24
[]
no_license
asharma2/iot-learnings
adb8f02a1fcd7f0ec53e90d0d748070d5ae0f99e
173a57f7486e0c9f59c833dd800c142d918a94d6
refs/heads/main
2023-02-26T19:12:23.128918
2021-01-25T07:29:01
2021-01-25T07:29:01
324,778,026
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
package com.iot.learnings.simulator.config; import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; import lombok.Data; @Data @ConfigurationProperties(prefix = "simulator.properties") public class SimulatorProperties { String hostname; List<Integer> ports; Integer delayBetweenPackets; Integer maxConnections; String imeiGeneration; String repeatPath; String repeatType; }
[ "atul.sharma@rategain.com" ]
atul.sharma@rategain.com
4b39f84d6a44edf0c11c199aa006f302e0cec1dc
34b41ffa2b0c3cc3ba6ac977187c732d1c4dd977
/_dataStructure/Heap.java
af8c6b53c0804fea8e9631c4275730f757d4288b
[]
no_license
dejavuyj/algo
a122da894b1351ea942534b8bfd49b2bdeeb1a73
a40c0f84d8d8ad592a2aa438d3010549a7a2be91
refs/heads/master
2023-09-01T05:14:57.691117
2023-08-27T02:00:26
2023-08-27T02:00:26
249,194,416
2
0
null
null
null
null
UTF-8
Java
false
false
1,845
java
package _dataStructure; public class Heap { private int[] a; // 从1开始存储数据 private int n; // 堆可以存储的最大数据个数 private int count; // 堆已经存储的数据个数 private static int swapCount = 0; public Heap(int capacity) { a = new int[capacity + 1]; n = capacity; count = 0; } private static void swap(int[] a, int i, int j) { int tmp = a[i]; a[i] = a[j]; a[j] = tmp; swapCount++; System.out.println("swap " + i + ", " + j); } // 从下向上堆化 public void insert(int data) { if (count >= n) { return; } count++; int cur = count; a[cur] = data; int parent = cur / 2; while (parent >= 1 && a[parent] < a[cur]) { swap(a, cur, parent); cur = parent; parent = cur / 2; } } public void removeMax() { if (count == 0) { return; } a[1] = a[count]; count--; heapify(a, count, 1); } // 从上往下堆化 private static void heapify(int[] a, int n, int i) { while (true) { int maxPos = i; if (i * 2 <= n && a[i] < a[i * 2]) maxPos = i * 2; if (i * 2 + 1 <= n && a[maxPos] < a[i * 2 + 1]) maxPos = i * 2 + 1; if (maxPos == i) break; swap(a, i, maxPos); i = maxPos; } } public static void buildHeap(int[] a, int n) { for (int i = n / 2; i >= 1; i--) { heapify(a, n, i); } } // n表示数据的个数, 数组a中的数据从下标1到n的位置 public static void sort(int[] a, int n) { buildHeap(a, n); int k = n; while (k > 1) { swap(a, 1, k); k--; heapify(a, k, 1); } } public static void main(String[] args) { int[] a = { 0, 3, 2, 7, 6, 9, 5, 1, 8, 4 }; // int[] a = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; sort(a, a.length - 1); for (int i = 1; i < a.length; i++) { System.out.print(a[i] + " "); } System.out.println("total swapCount is " + swapCount); } }
[ "xiaoyaoj_0346@qq.com" ]
xiaoyaoj_0346@qq.com
dcd7d357bfc58f290e0e7d5e38157aeeeeb0c9c1
b772d2d5b1024f9331a2abce744b6451c93774b3
/atcrowdfunding07-member-parent/atcrowdfunding12-member-authentication-consumer/src/main/java/com/atguigu/crowd/handler/MemberHandler.java
d32c62ee937fa3e6d76bc315695b4301a91be904
[]
no_license
jacklmjie/java-atcrowdfunding
aef948e7eb3eb59d4e91998d055543e660424728
a95686697b4e3006b8fa3c46c350c71b4123d696
refs/heads/master
2023-03-17T21:44:35.207028
2021-03-05T09:13:49
2021-03-05T09:13:49
291,608,770
0
0
null
null
null
null
UTF-8
Java
false
false
6,606
java
package com.atguigu.crowd.handler; import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.servlet.http.HttpSession; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.atguigu.crowd.api.MySQLRemoteService; import com.atguigu.crowd.api.RedisRemoteService; import com.atguigu.crowd.config.ShortMessageProperties; import com.atguigu.crowd.constant.CrowdConstant; import com.atguigu.crowd.entity.po.MemberPO; import com.atguigu.crowd.entity.vo.MemberLoginVO; import com.atguigu.crowd.entity.vo.MemberVO; import com.atguigu.crowd.util.ResultEntity; @Controller public class MemberHandler { @Autowired private ShortMessageProperties shortMessageProperties; @Autowired private RedisRemoteService redisRemoteService; @Autowired private MySQLRemoteService mySQLRemoteService; @RequestMapping("/auth/member/logout") public String logout(HttpSession session) { session.invalidate(); return "redirect:http://www.crowd.com/"; } @RequestMapping("/auth/member/do/login") public String login( @RequestParam("loginacct") String loginacct, @RequestParam("userpswd") String userpswd, ModelMap modelMap, HttpSession session) { // 1.调用远程接口根据登录账号查询MemberPO对象 ResultEntity<MemberPO> resultEntity = mySQLRemoteService.getMemberPOByLoginAcctRemote(loginacct); if(ResultEntity.FAILED.equals(resultEntity.getResult())) { modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, resultEntity.getMessage()); return "member-login"; } MemberPO memberPO = resultEntity.getData(); if(memberPO == null) { modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_LOGIN_FAILED); return "member-login"; } // 2.比较密码 String userpswdDataBase = memberPO.getUserpswd(); BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); boolean matcheResult = passwordEncoder.matches(userpswd, userpswdDataBase); if(!matcheResult) { modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_LOGIN_FAILED); return "member-login"; } // 3.创建MemberLoginVO对象存入Session域 MemberLoginVO memberLoginVO = new MemberLoginVO(memberPO.getId(), memberPO.getUsername(), memberPO.getEmail()); session.setAttribute(CrowdConstant.ATTR_NAME_LOGIN_MEMBER, memberLoginVO); return "redirect:http://www.crowd.com/auth/member/to/center/page"; //return "redirect:/auth/member/to/center/page"; } @RequestMapping("/auth/do/member/register") public String register(MemberVO memberVO, ModelMap modelMap) { // 1.获取用户输入的手机号 String phoneNum = memberVO.getPhoneNum(); // 2.拼Redis中存储验证码的Key String key = CrowdConstant.REDIS_CODE_PREFIX + phoneNum; // 3.从Redis读取Key对应的value ResultEntity<String> resultEntity = redisRemoteService.getRedisStringValueByKeyRemote(key); // 4.检查查询操作是否有效 String result = resultEntity.getResult(); if(ResultEntity.FAILED.equals(result)) { modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, resultEntity.getMessage()); return "member-reg"; } String redisCode = resultEntity.getData(); if(redisCode == null) { modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_CODE_NOT_EXISTS); return "member-reg"; } // 5.如果从Redis能够查询到value则比较表单验证码和Redis验证码 String formCode = memberVO.getCode(); if(!Objects.equals(formCode, redisCode)) { modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_CODE_INVALID); return "member-reg"; } // 6.如果验证码一致,则从Redis删除 redisRemoteService.removeRedisKeyRemote(key); // 7.执行密码加密 BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); String userpswdBeforeEncode = memberVO.getUserpswd(); String userpswdAfterEncode = passwordEncoder.encode(userpswdBeforeEncode); memberVO.setUserpswd(userpswdAfterEncode); // 8.执行保存 // ①创建空的MemberPO对象 MemberPO memberPO = new MemberPO(); // ②复制属性 BeanUtils.copyProperties(memberVO, memberPO); // ③调用远程方法 ResultEntity<String> saveMemberResultEntity = mySQLRemoteService.saveMember(memberPO); if(ResultEntity.FAILED.equals(saveMemberResultEntity.getResult())) { modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, saveMemberResultEntity.getMessage()); return "member-reg"; } // 使用重定向避免刷新浏览器导致重新执行注册流程 return "redirect:http://www.crowd.com/auth/member/to/login/page"; } @ResponseBody @RequestMapping("/auth/member/send/short/message.json") public ResultEntity<String> sendMessage(@RequestParam("phoneNum") String phoneNum) { // 1.发送验证码到phoneNum手机 /* * ResultEntity<String> sendMessageResultEntity = * CrowdUtil.sendCodeByShortMessage( shortMessageProperties.getHost(), * shortMessageProperties.getPath(), shortMessageProperties.getMethod(), * phoneNum, shortMessageProperties.getAppCode(), * shortMessageProperties.getSign(), shortMessageProperties.getSkin()); */ ResultEntity<String> sendMessageResultEntity = ResultEntity.successWithData("6666"); // 2.判断短信发送结果 if(ResultEntity.SUCCESS.equals(sendMessageResultEntity.getResult())) { // 3.如果发送成功,则将验证码存入Redis // ①从上一步操作的结果中获取随机生成的验证码 String code = sendMessageResultEntity.getData(); // ②拼接一个用于在Redis中存储数据的key String key = CrowdConstant.REDIS_CODE_PREFIX + phoneNum; // ③调用远程接口存入Redis ResultEntity<String> saveCodeResultEntity = redisRemoteService.setRedisKeyValueRemoteWithTimeout(key, code, 15, TimeUnit.MINUTES); // ④判断结果 if(ResultEntity.SUCCESS.equals(saveCodeResultEntity.getResult())) { return ResultEntity.successWithoutData(); }else { return saveCodeResultEntity; } } else { return sendMessageResultEntity; } } }
[ "li.mengjie@yalla.live" ]
li.mengjie@yalla.live
d2b9c0b99455ff020cf896af47e6457883336f42
21044fbb7d77472c068232027c9f14b061031b80
/src/com/javarush/test/level06/lesson08/task02/Cat.java
924a8f4545aaa83ec94210d6c507dba30d4b5d39
[]
no_license
uraplayer/JavaRushHomeWork
6a216dc8673d88dce403874c4fa65595fc60d8b7
4ab5d7deb24aa89c3187ee2d48a3588d4097e4c5
refs/heads/master
2021-01-23T12:52:57.109172
2017-09-06T20:28:30
2017-09-06T20:28:30
102,655,258
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package com.javarush.test.level06.lesson08.task02; /* Статические методы: int getCatCount() и setCatCount(int) Добавить к классу Cat два статических метода: int getCatCount() и setCatCount(int), с помощью которых можно получить/изменить количество котов (переменную catCount) */ public class Cat { private static int catCount = 0; public Cat() { catCount++; } public static int getCatCount() { return catCount; //напишите тут ваш код } public static void setCatCount(int catCount) { Cat.catCount = catCount; //напишите тут ваш код } }
[ "uraplayer@mail.ru" ]
uraplayer@mail.ru
48b599aef88e33e894ce212f6a162561f77d9b69
c737790fe9d0c089f451f7f0f84fb372dc5e60ff
/app/src/main/java/com/example/app/main/MainActivity.java
18d194f256d11ed2165e8c46e1a1a45e15d515f4
[]
no_license
mohsenjahani/MVP_RxJava2
d404afbc87315a1d2f473d265176fae3715b2222
e415f1005b106eb88dffbf22e46efefd9f9b0d36
refs/heads/master
2020-03-29T13:39:07.747173
2018-09-23T10:38:28
2018-09-23T10:38:28
149,974,552
1
0
null
null
null
null
UTF-8
Java
false
false
987
java
package com.example.app.main; import android.annotation.SuppressLint; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import com.example.app.R; import com.example.app.core.BaseActivity; public class MainActivity extends BaseActivity<MainPresenter> implements IMain.Callback { TextView textView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = (TextView) findViewById(R.id.tv1); mPresenter = new MainPresenter(this); mPresenter.loadData(); } @SuppressLint("SetTextI18n") @Override public void showLoading() { textView.setText("Loading..."); } @Override public void hideLoading() { Toast.makeText(this, "hideLoading!", Toast.LENGTH_SHORT).show(); } @Override public void setData(String data) { textView.setText(data); } }
[ "scriptestan@gmail.com" ]
scriptestan@gmail.com
47faced24caba6dfdf2cce9376187ad6f2f2d9b4
20be33ddaf86eed58e1717f244fce5addd1085e8
/app/src/main/java/in/anees/petapp/model/WorkingTime.java
477ce5654163019e7aed20608d473f0da9f33f49
[ "Apache-2.0" ]
permissive
sakzk007/PetApp-Android
649574c64c5773c8fbfb38072d3a4d709fa2f1d0
6e9630c49efaa801a47b26e62ff5017d8dfefe9b
refs/heads/master
2020-07-05T16:29:29.704819
2019-08-15T18:58:18
2019-08-15T18:58:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
package in.anees.petapp.model; import java.util.Date; /** * Created by Anees Thyrantakath on 2/16/19. */ public class WorkingTime { private Date mOpeningTime; private Date mClosingTime; public Date getOpeningTime() { return mOpeningTime; } public WorkingTime setOpeningTime(Date mOpeningTime) { this.mOpeningTime = mOpeningTime; return this; } public Date getClosingTime() { return mClosingTime; } public WorkingTime setClosingTime(Date mClosingTime) { this.mClosingTime = mClosingTime; return this; } }
[ "developer.anees@gmail.com" ]
developer.anees@gmail.com
713b8971fe0ad42988710d5ddd6b3ca27f953d81
155a82cd25c6e3f6b26021869b9f501cc8b450a2
/src/main/java/ac/za/cput/domain/academicResults/Assignments.java
dff53f0cf5ed24d96460bf6ee350ed377b192b7d
[]
no_license
215062264/Assignment9
6afe3f3ee70d7891d07fc7f10f983166e916d617
5cf55bfbd63cb3722386b50dd5e5d20016c24321
refs/heads/master
2020-05-25T20:47:23.034525
2019-05-22T07:11:37
2019-05-22T07:11:37
187,983,368
0
0
null
null
null
null
UTF-8
Java
false
false
2,066
java
package ac.za.cput.domain.academicResults; import org.springframework.boot.autoconfigure.domain.EntityScan; import java.util.Objects; @EntityScan public class Assignments { private String dueDate, studentNum; private double mark; private Assignments(){} private Assignments(Assignments.Builder builder) { this.dueDate = builder.dueDate; this.studentNum = builder.studentNum; this.mark = builder.mark; } public String getDueDate() { return dueDate; } public String getStudentNum() { return studentNum; } public double getAssignmentMark() { return mark; } public static class Builder { private String dueDate, studentNum; private double mark; public Assignments.Builder dueDate(String dueDate) { this.dueDate = dueDate; return this; } public Assignments.Builder studentNum(String studentNum) { this.studentNum = studentNum; return this; } public Assignments.Builder mark(double mark) { this.mark = mark; return this; } public Builder copy(Assignments assignments){ this.studentNum = assignments.studentNum; this.dueDate = assignments.dueDate; return this; } public Assignments build() { return new Assignments(this); } } @Override public String toString() { return "Assignments{" + "dueDate='" + dueDate + '\'' + ", studentNum='" + studentNum + '\'' + ", Mark='" + mark + '\'' + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Assignments assignments = (Assignments) o; return studentNum.equals(assignments.studentNum); } @Override public int hashCode() { return Objects.hash(studentNum); } }
[ "Kylejosias6@gmail.com" ]
Kylejosias6@gmail.com
b9542727ef8fbe9e4956307ce073db76b92c6b1c
66820526e58eeaba16dcd9749d03ce5505603abe
/src/main/java/com/vertx/filemerger/verticles/other/Client.java
c3b2b6684fac8cad74b1ad6bc7a1104ac52dd816
[]
no_license
shankar-sutar77/filemerger
a64f2c38faee035a05158a0db71e974cd1bb582a
f563e63b96afc672d332a4aaccaf75e11178310e
refs/heads/master
2022-12-25T04:12:42.053044
2020-09-28T08:53:49
2020-09-28T08:53:49
299,083,591
0
0
null
null
null
null
UTF-8
Java
false
false
916
java
package com.vertx.filemerger.verticles.other; import io.vertx.core.*; import io.vertx.core.http.*; import io.vertx.core.json.*; public class Client extends AbstractVerticle { @Override public void start() { System.out.println("SERVER STARTED...!"); HttpServer server = vertx.createHttpServer(); server.websocketHandler(websocket -> { System.out.println("Connected!"); websocket.textMessageHandler( text -> { System.out.println("FROM CLIENT===>" + text); JsonObject fragmentInfo = new JsonObject(text); System.out.println("FILENAME+=>"+fragmentInfo.getString("fileName")); }); websocket.writeTextMessage("FROM SERVER"); }); server.listen(1234, "192.168.0.135", res -> { if (res.succeeded()) { System.out.println("Server is now listening!"); } else { System.out.println("Failed to bind!"); } }); } }
[ "shankarsutar@mahaswami.com" ]
shankarsutar@mahaswami.com
0cfe5ca437b60dbaf167fb9d3da5e5aca69d80bc
8245d44343cbc3af9de15a2e88b046af2d9c3724
/backend/src/main/java/com/akveo/bundlejava/rest/PlanActPcdController.java
c28ba7db2a326d30513057e7fb32504298e80d0f
[]
no_license
mednourconsulting/tronico
69b23d0954fca2e957ca2c5911e4f2735c201878
bde6d64d51e6917f0e607559317f847f38999ff9
refs/heads/main
2022-12-31T15:02:24.068135
2020-10-15T16:59:48
2020-10-15T16:59:48
301,691,698
0
0
null
null
null
null
UTF-8
Java
false
false
2,730
java
package com.akveo.bundlejava.rest; import com.akveo.bundlejava.model.PlanActPcd; import com.akveo.bundlejava.repository.PlanActPcdRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/planActPcd") @CrossOrigin("*") public class PlanActPcdController { @Autowired private PlanActPcdRepository planActPcdRepository; //@PreAuthorize("hasAuthority('ADMIN')") @GetMapping("/getAll/{atelier}/{year}") public ResponseEntity<List<PlanActPcd>> getAll(@PathVariable("atelier") String atelier , @PathVariable("year") Long year) { return ResponseEntity.ok(planActPcdRepository.findByAtelierAndYearOrderByWeek(atelier , year)); } @GetMapping("/get/{atelier}") public ResponseEntity<List<PlanActPcd>> get(@PathVariable("atelier") String atelier) { return ResponseEntity.ok(planActPcdRepository.findByAtelierOrderByWeek(atelier)); } //@PreAuthorize("hasAuthority('ADMIN')") @GetMapping("/getAll/{atelier}/{year}/{week}") public ResponseEntity<List<PlanActPcd>> getAllByWeek(@PathVariable("atelier") String atelier , @PathVariable("year") Long year , @PathVariable("week") Long week) { return ResponseEntity.ok(planActPcdRepository.findByAtelierAndYearAndWeek(atelier , year , week)); } //@PreAuthorize("hasAuthority('ADMIN')") @PostMapping("/create") public ResponseEntity<PlanActPcd> createSpleetEcartOF(@RequestBody PlanActPcd planActPcd ) { return ResponseEntity.ok(planActPcdRepository.save(planActPcd)); } //@PreAuthorize("hasAuthority('ADMIN')") @PostMapping("/createAll") public ResponseEntity<List<PlanActPcd>> createAll(@RequestBody List<PlanActPcd> planActPcds) { return ResponseEntity.ok(planActPcdRepository.saveAll(planActPcds)); } //@PreAuthorize("hasAuthority('ADMIN')") @PutMapping("/update") public ResponseEntity<PlanActPcd> updateSpleetEcartOF(@RequestBody PlanActPcd planActPcd) { return ResponseEntity.ok(planActPcdRepository.save(planActPcd)); } //@PreAuthorize("hasAuthority('ADMIN')") @DeleteMapping("/delete/{id}") public ResponseEntity<PlanActPcd> deleteSpleetEcartOF(@PathVariable("id") Long id) { PlanActPcd planActPcdLoaded = planActPcdRepository.findById(id).get(); if (planActPcdLoaded==null){ System.out.println("NOT FOUND"); ResponseEntity.notFound(); } planActPcdRepository.deleteById(id); return ResponseEntity.ok(planActPcdLoaded); } }
[ "mednourconsulting@gmail.com" ]
mednourconsulting@gmail.com
45d130f5ef0b7058e5d2500a085dbfbeb1bde781
6e8288e91d8d4dd7bcdf82fe83c673e9d0db83fc
/app/src/test/java/com/example/lpugatch/dropboxenc/ExampleUnitTest.java
340a3da41b0ee21842e6df61f1e53545dd6ed404
[]
no_license
lior-pugatch/dropBoXenc
026d7d17f0f3124639f602a2c204c0c99d525e82
d97feee54279d4006bd14598516a19765f62b97f
refs/heads/master
2020-03-15T21:53:27.083574
2018-05-06T18:15:42
2018-05-06T18:15:42
132,363,599
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com.example.lpugatch.dropboxenc; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "lpugatch@qti.qualcomm.com" ]
lpugatch@qti.qualcomm.com
5df8b78667f6829d3b029c5b3194010519ea01fd
e6fa8d777eb3a2342d5f7a4fc0bc82301f48c5ee
/NYSEProject/src/pages/MainPage.java
2ba7e5c1c7e720fd97f4cf0c8d4233c6ba29a3a3
[]
no_license
brojalin/Assignment_Perfecto_NYSE
4f5013e7c742555714939ee73d105e499b2cfc97
1404b2bfc67b508a076b1b626d34bbd56ec9006c
refs/heads/master
2021-01-01T04:00:24.289300
2016-05-18T10:17:42
2016-05-18T10:18:59
59,105,053
0
0
null
null
null
null
UTF-8
Java
false
false
1,262
java
package pages; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.Assert; import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.ios.IOSDriver; public class MainPage extends BasePages { //By searchTextView = By.xpath("//android.widget.EditText[@resource-id='com.google.android.apps.maps:id/search_omnibox_text_box']/android.widget.TextView"); By searchTextbox = By.name("q"); By searchButton = By.xpath("//input[@value='Get quotes']"); public MainPage(RemoteWebDriver driver) { super(driver); // validate that we are on the Main page by looking for the "Search query" textbox. try { driver.findElement(searchTextbox); } catch (NoSuchElementException e) { Assert.fail("Main page not loaded\n"+e.toString()); } } public MainPage enterStockCode(String code) { driver.findElement(searchTextbox).clear(); driver.findElement(searchTextbox).sendKeys(code); return new MainPage(driver); } public StockDetailPage clickSearchButton() { driver.findElement(searchButton).click(); return new StockDetailPage(driver); } }
[ "rojalinb@Newt-1607-11.newtglobal.chn.local" ]
rojalinb@Newt-1607-11.newtglobal.chn.local
ca6174d17d705e4effd364d28c330a0141bda9fb
6d4bc71073e916ed75038a03766ff7706b475f21
/src/test/java/shop/AdminTest.java
9b6c9b57fcfcd84b823684f323e2752456cdb3a9
[]
no_license
keaganluttrell/javaShop
4d0cdeb78253669f526ad0814792e8e24cdc3aeb
c9c07a47866edfde078ca041b45aa09d6ae8b8c4
refs/heads/master
2023-04-24T12:32:32.129546
2021-04-27T04:43:50
2021-04-27T04:43:50
361,956,149
0
0
null
null
null
null
UTF-8
Java
false
false
1,194
java
package shop; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; public class AdminTest { @Test public void createANewAdmin() { Admin admin1 = new Admin("001", "pwd", "active", "boss", "boss@email.com"); assertNotNull(admin1); } /** * test getters and setters for admin class */ @Test public void testGetters() { Admin admin1 = new Admin("001", "pwd", "active", "boss", "boss@email.com"); String admin = admin1.getAdminName(); String email = admin1.getEmail(); assertEquals("boss", admin, "should have admin name"); assertEquals("boss@email.com", email, "should have email"); } @Test public void testSetters() { Admin admin1 = new Admin("001", "pwd", "active", "boss", "boss@email.com"); String newAdminName = "newAdmin"; String newEmail = "new@email.com"; admin1.setAdminName(newAdminName); admin1.setEmail(newEmail); assertEquals(admin1.getAdminName(), newAdminName); assertNotNull(admin1.getEmail(), newEmail); } }
[ "keaganluttrell7@gmail.com" ]
keaganluttrell7@gmail.com
13aaf6b089fc8c410ec7638dd81ffd7f0ebd6096
fdc5a1829f862291ded7bf1312860085d0f20d27
/src/main/java/com/xjtu/qiuzhao/daili/jingtaitaili/Car.java
b930e44604af7fc895646ff456d90804e499f39a
[]
no_license
JiaoHS/Leetcode
2bbf189689285b911119c169c9c0a099bca091cf
9de291a22a392233ba6891f74353aef88d243266
refs/heads/master
2021-06-05T20:41:13.951638
2021-06-03T13:08:28
2021-06-03T13:08:28
161,494,096
0
0
null
null
null
null
UTF-8
Java
false
false
210
java
package com.xjtu.qiuzhao.daili.jingtaitaili; /** * @auther coraljiao * @date 2019/9/6 14:56 * @description */ public class Car { public void move(){ System.out.println("我是汽车"); } }
[ "mrjiaohs@163.com" ]
mrjiaohs@163.com
66cf6122ca4c59a57fc9b7ffbe25858dc0381157
30f89639151a620c1f8b2a6c7b967ccbca0f8034
/src/main/java/com/stacksimplify/restservices/dtos/UserDtoV1.java
8867b642bc62f8d558943305ba96d42f731d6b75
[]
no_license
toritsejuFO/springboot-buildingblocks
48692aeb8e2c511e71a3ecf9ebe1c4ce1e26c9d9
ae0546bd60297271293b80b72e71730e7c99b571
refs/heads/main
2023-03-23T04:55:34.525639
2021-03-20T21:46:16
2021-03-20T21:46:16
336,826,327
0
0
null
null
null
null
UTF-8
Java
false
false
504
java
package com.stacksimplify.restservices.dtos; import com.stacksimplify.restservices.entities.Order; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor public class UserDtoV1 { private Long userId; private String username; private String email; private String firstname; private String lastname; private String role; private String ssn; private List<Order> orders; }
[ "toriboi.fo@gmail.com" ]
toriboi.fo@gmail.com
04b5628f71b38c14dcef56503bb81ea9e7ce9f5d
788b8e4dd7541369f1b40ef74bf8884435e81008
/src/main/java/com/soultechnamei/alchemicreactionsmod/api/RenderHelpers.java
60d3f8eab3a470b7ab60e23378a20b8f4f2ff6e7
[]
no_license
SoulTechName/AlchemicReactions
7827ef9bfc5f9f720b74ea8deedb44fa077b9203
ba1406f6e6bb2151d4e21e32a11319a8b88bbec4
refs/heads/master
2021-01-22T01:28:01.119967
2014-09-20T03:43:25
2014-09-20T03:43:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,050
java
package evilcraft.api; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; /** * A helper for rendering. * @author rubensworks * */ public class RenderHelpers { private static Map<ForgeDirection, String> METHODS_RENDERFACE = new HashMap<ForgeDirection, String>(); static { METHODS_RENDERFACE.put(ForgeDirection.DOWN, "renderFaceYNeg"); METHODS_RENDERFACE.put(ForgeDirection.UP, "renderFaceYPos"); METHODS_RENDERFACE.put(ForgeDirection.NORTH, "renderFaceZPos"); METHODS_RENDERFACE.put(ForgeDirection.EAST, "renderFaceXPos"); METHODS_RENDERFACE.put(ForgeDirection.SOUTH, "renderFaceZNeg"); METHODS_RENDERFACE.put(ForgeDirection.WEST, "renderFaceXNeg"); } private static Map<ForgeDirection, String> FIELDS_UVROTATE = new HashMap<ForgeDirection, String>(); static { // Note: the fields from the RenderBlock are INCORRECT! Very good read: http://greyminecraftcoder.blogspot.be/2013/07/rendering-non-standard-blocks.html FIELDS_UVROTATE.put(ForgeDirection.DOWN, "uvRotateBottom"); FIELDS_UVROTATE.put(ForgeDirection.UP, "uvRotateTop"); FIELDS_UVROTATE.put(ForgeDirection.NORTH, "uvRotateEast"); FIELDS_UVROTATE.put(ForgeDirection.EAST, "uvRotateSouth"); FIELDS_UVROTATE.put(ForgeDirection.SOUTH, "uvRotateWest"); FIELDS_UVROTATE.put(ForgeDirection.WEST, "uvRotateNorth"); } private static Map<ForgeDirection, String> METHODS_RENDERFACE_OBFUSICATED = new HashMap<ForgeDirection, String>(); static { METHODS_RENDERFACE_OBFUSICATED.put(ForgeDirection.DOWN, "func_147768_a"); METHODS_RENDERFACE_OBFUSICATED.put(ForgeDirection.UP, "func_147806_b"); METHODS_RENDERFACE_OBFUSICATED.put(ForgeDirection.NORTH, "func_147734_d"); METHODS_RENDERFACE_OBFUSICATED.put(ForgeDirection.EAST, "func_147764_f"); METHODS_RENDERFACE_OBFUSICATED.put(ForgeDirection.SOUTH, "func_147761_c"); METHODS_RENDERFACE_OBFUSICATED.put(ForgeDirection.WEST, "func_147798_e"); } private static Map<ForgeDirection, String> FIELDS_UVROTATE_OBFUSICATED = new HashMap<ForgeDirection, String>(); static { // Note: the fields from the RenderBlock are INCORRECT! Very good read: http://greyminecraftcoder.blogspot.be/2013/07/rendering-non-standard-blocks.html FIELDS_UVROTATE_OBFUSICATED.put(ForgeDirection.DOWN, "field_147865_v"); FIELDS_UVROTATE_OBFUSICATED.put(ForgeDirection.UP, "field_147867_u"); FIELDS_UVROTATE_OBFUSICATED.put(ForgeDirection.NORTH, "field_147875_q"); FIELDS_UVROTATE_OBFUSICATED.put(ForgeDirection.EAST, "field_147871_s"); FIELDS_UVROTATE_OBFUSICATED.put(ForgeDirection.SOUTH, "field_147873_r"); FIELDS_UVROTATE_OBFUSICATED.put(ForgeDirection.WEST, "field_147869_t"); } private static int[] ROTATE_UV_ROTATE = {0, 1, 3, 2}; // N, E, S, W -> N, E, W, S /** * An icon that contains to texture, useful for when you want to render nothing. */ public static IIcon EMPTYICON; /** * Call the correct face renderer on the renderer depending on the given renderDirection. * @param renderDirection direction to call the renderer method for. * @param renderer Renderer to call the face renderer on. * @param block To be passed to renderer. * @param x To be passed to renderer. * @param y To be passed to renderer. * @param z To be passed to renderer. * @param blockIconFromSideAndMetadata To be passed to renderer. */ public static void renderFaceDirection(ForgeDirection renderDirection, RenderBlocks renderer, Block block, double x, double y, double z, IIcon blockIconFromSideAndMetadata) { try { String methodName = Helpers.isObfusicated()?METHODS_RENDERFACE_OBFUSICATED.get(renderDirection):METHODS_RENDERFACE.get(renderDirection); Method method = renderer.getClass().getMethod(methodName, Block.class, double.class, double.class, double.class, IIcon.class); method.invoke(renderer, block, x, y, z, blockIconFromSideAndMetadata); } catch (NoSuchMethodException e1) { // Impossible to go wrong, unless this code changes or those of Minecraft... e1.printStackTrace(); } catch (SecurityException e2) { e2.printStackTrace(); } catch (IllegalAccessException e3) { e3.printStackTrace(); } catch (IllegalArgumentException e4) { e4.printStackTrace(); } catch (InvocationTargetException e5) { e5.printStackTrace(); } } /** * Set the correct rotation of the given renderer given a {@link ForgeDirection}. * It will use reflection to set the correct field in the {@link RenderBlocks}. * @param renderer The renderer to set the rotation at. * @param side The {@link ForgeDirection} to set a rotation for. * @param rotation The rotation to set. * @see RenderBlocks */ public static void setRenderBlocksUVRotation(RenderBlocks renderer, ForgeDirection side, int rotation) { try { String fieldName = Helpers.isObfusicated()?FIELDS_UVROTATE_OBFUSICATED.get(side):FIELDS_UVROTATE.get(side); Field field = renderer.getClass().getField(fieldName); field.set(renderer, ROTATE_UV_ROTATE[rotation]); } catch (NoSuchFieldException e1) { // Impossible to go wrong, unless this code changes or those of Minecraft... e1.printStackTrace(); } catch (SecurityException e2) { e2.printStackTrace(); } catch (IllegalAccessException e3) { e3.printStackTrace(); } catch (IllegalArgumentException e4) { e4.printStackTrace(); } } }
[ "soultechnamei@outlook.com" ]
soultechnamei@outlook.com
0af4516cbe104ddac60781ed4985e569f0e1e2a8
1397872963aa74f11ab64687bdb696c8dd01fd49
/src/string/autosuggestions/Trie.java
e46383f12ae7977065a89f6032323ea4a2f448ab
[]
no_license
Sud-garg05/ds-algorithms
984e976bf809a55d97f658a654c20b7276b32ec8
3cc27bf9bc5cae5200867711e94d81418d56c86e
refs/heads/master
2023-02-27T00:45:11.165241
2021-02-03T15:02:45
2021-02-03T15:02:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,076
java
package string.autosuggestions; import java.util.HashSet; import java.util.Set; public class Trie { private final TrieNode root; public Trie() { this.root = new TrieNode(); } public void add(String word, int rank){ var currentNode = root; var wordObj = new TrieNode.Word(word, rank); for (char ch : word.toCharArray()){ currentNode.addWord(wordObj); var node = currentNode.getCharacterNode(ch); if (node == null){ node = new TrieNode(); currentNode.putCharacterNode(ch, node); } currentNode = node; } } public Set<TrieNode.Word> getSuggestions(String prefix) { var current = root; var prev = new TrieNode(); for (char ch : prefix.toCharArray()) { var node = current.getCharacterNode(ch); if (node == null){ return new HashSet<>(); } prev = current; current = node; } return prev.getWords(); } }
[ "sanjay.mact4115@gmail.com" ]
sanjay.mact4115@gmail.com
6b2068777b20edb0f911833b67587d2c9769e3ca
9e5cf9d0497fdd5ce6447a862fefb39bff85e80a
/StudyJava/src/cn/edu/njupt/java/oop/orientedObject/LeetCode10.java
08e2371fb896d16506dbdf85e3df74f3036d34db
[]
no_license
zhangming2019/java-leetcode
94addaa28b32f890e9b1d3f4dd2def2fc864eb10
356630881dd31167ec5a85a9cf203bde9e15cc52
refs/heads/master
2021-04-12T04:41:14.031915
2018-03-19T08:59:01
2018-03-19T08:59:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
940
java
package cn.edu.njupt.java.oop.orientedObject; public class LeetCode10 { public boolean isMatch(String text, String pattern){ if(pattern.isEmpty()){ return text.isEmpty(); } if(pattern.length() == 1){ if(text.isEmpty()){ return false; } return (text.charAt(0) == pattern.charAt(0) || pattern.charAt(0) == '.') && text.length() ==1; } if(pattern.charAt(1) != '*'){ if(text.isEmpty()){ return false; } return (text.charAt(0) == pattern.charAt(0) || pattern.charAt(0) == '.') && isMatch(text.substring(1),pattern.substring(1)); } while(!text.isEmpty() && (text.charAt(0) == pattern.charAt(0) || pattern.charAt(0) == '.')){ if(isMatch(text,pattern.substring(2))){ return true; } text = text.substring(1); } return isMatch(text,pattern.substring(2)); } public static void main(String[] args) { LeetCode10 lt10 = new LeetCode10(); System.out.println(lt10.isMatch("", "*")); } }
[ "193024985@qq.com" ]
193024985@qq.com
b01d666202fb9ca5a3e485bad605495366d98907
caf3204287e90f2583e86b995cc39646d7ca2171
/app/src/main/java/com/example/acer/myapplicationiu/CustomAdapter2.java
1624922ee36a630c7add171b3dc6e5473abbebf5
[]
no_license
blendbe/MyApplication
5d5cc4b20099819f8e170b63c7c1afdd58f3f033
ba533312d3b0aaf8a622961c44c520ca6f48bafe
refs/heads/master
2020-03-28T09:02:33.985402
2018-09-09T08:54:34
2018-09-09T08:54:37
148,008,949
0
0
null
null
null
null
UTF-8
Java
false
false
1,998
java
package com.example.acer.myapplicationiu; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; public class CustomAdapter2 extends BaseAdapter { Context context; ArrayList<Model> itemModelList; Button button; public CustomAdapter2(Context context, ArrayList<Model> itemModelList) { this.context = context; this.itemModelList = itemModelList; } @Override public int getCount() { return itemModelList.size(); } @Override public Object getItem(int position) { return itemModelList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { convertView = null; if (convertView == null) { LayoutInflater mInflater = (LayoutInflater) context .getSystemService(Activity.LAYOUT_INFLATER_SERVICE); convertView = mInflater.inflate(R.layout.interactionmeds, null); TextView tvName = (TextView) convertView.findViewById(R.id.interMeds); ImageView imgRemove = (ImageView) convertView.findViewById(R.id.deleteDrug); Model m = itemModelList.get(position); button = (Button)convertView.findViewById(R.id.ShfaqInteraksion); tvName.setText(m.getName()); imgRemove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { itemModelList.remove(position); notifyDataSetChanged(); } }); } return convertView; } }
[ "berishablend@hotmail.com" ]
berishablend@hotmail.com
f17091cd20b78185b96ca828b586f4160be37975
b6424955a462d9037156daf41fc34980d7980f2d
/src/test/java/com/joy/util/Test.java
b02086fd2f5814a3513380d60ed2101bb9c3a55d
[ "Apache-2.0", "BSD-2-Clause", "MIT", "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
joyspapa/joy-zookeeper
c1e986e93b81a98ab39d3e2b4fd150ef874a3bd1
1cae7eb1458331deb91f99f0563b22b90a3bfb54
refs/heads/master
2020-07-17T09:08:35.390879
2019-09-23T08:10:41
2019-09-23T08:10:41
205,991,474
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package com.joy.util; public class Test { public static void main(String[] args) { extractZnodeName("DE1567052466-ENT3243-1"); extractZnodeName("DE1567052466-ENT3243"); extractZnodeName("/logplanet/memorygrid/timeoutevent/DE1567052466ENT3243"); extractZnodeName("/logplanet/memorygrid/timeoutevent/DE1567052466-ENT3243"); extractZnodeName("/logplanet/memorygrid/timeoutevent/DE1567052466-ENT3243-1"); extractZnodeName("DE1567052466ENT3243"); } public static String extractZnodeName(String src) { String znodeName = src; if (znodeName.contains("/")) { String[] znodePaths = znodeName.split("/"); znodeName = znodePaths[znodePaths.length - 1]; } if (znodeName.contains("-")) { String[] znodeNames = znodeName.split("-"); znodeName = (znodeNames.length > 1) ? znodeNames[0] + znodeNames[1] : znodeNames[0]; } System.out.println("[extractZnodeName] znodeName : " + znodeName); return znodeName; } }
[ "hanmin" ]
hanmin
e74464d18fcbe531d47f2afdc558eda46ba5b7f5
6dd4d6425fe484c60eb31c994ed155cd647fa371
/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/protocol/VersionBody.java
315bed1b0494fb8868af4030c7a92e6c4a32e42e
[ "BSD-3-Clause" ]
permissive
anagovitsyn/oss.FCL.sftools.dev.eclipseenv.wrttools
6206efe3c305b45b400e3a7359f16a166e8fea0e
2b909321ef1e9c431d17ad0233746b717dcb5fc6
refs/heads/master
2021-12-11T08:59:54.238183
2010-11-04T22:22:02
2010-11-04T22:22:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
547
java
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.sdk.internal.protocol; import org.chromium.sdk.internal.protocolparser.JsonField; import org.chromium.sdk.internal.protocolparser.JsonSubtype; import org.chromium.sdk.internal.protocolparser.JsonType; @JsonType public interface VersionBody extends JsonSubtype<CommandResponseBody> { @JsonField(jsonLiteralName="V8Version") String getV8Version(); }
[ "TasneemS@US-TASNEEMS" ]
TasneemS@US-TASNEEMS
47dfbcf4979ad4aea30ea51a79f0ca2a4cbb29fb
b8cc4e0c1d7bdfbcc2c045f35ac4097f8985fba7
/src/com/chick/history.java
f9673dd7816252d06e3b4d021c49b660c62c1267
[]
no_license
touchSurfers/ClickCounter
d571c439c04faf19288fd2c3288f1c5e582dbbd3
085c059b51e55169f553774847031157c8a03721
refs/heads/master
2020-06-08T22:43:40.304176
2011-11-18T23:36:17
2011-11-18T23:36:17
2,631,402
0
0
null
null
null
null
UTF-8
Java
false
false
8,369
java
package com.chick; import java.util.LinkedList; import java.util.ListIterator; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; import com.helpers.LazyAdapter; import com.helpers.list_item; import com.helpers.user_item; public class history extends Activity { ListView list; LazyAdapter adapter; share_class sharing_class; LinkedList<user_item> clicks; int chicks_showed = 0; int list_limit = 500; //Buy dialog advert Button start_map; ImageButton buy_button; ImageView buy_dialog; View footerView; int db_size = 0; int paid = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.hisotry); try{ sharing_class = ((share_class)getApplicationContext()); start_map = (Button)findViewById(R.id.button_map); buy_button = (ImageButton)findViewById(R.id.buy_button); buy_dialog = (ImageView)findViewById(R.id.BuyView1); CreateList(); //Payment logic, show advert if(sharing_class.isPaid()){ buy_button.setVisibility(View.GONE); buy_dialog.setVisibility(View.GONE); start_map.setVisibility(View.VISIBLE); } else{ buy_button.setVisibility(View.VISIBLE); buy_dialog.setVisibility(View.VISIBLE); start_map.setVisibility(View.GONE); } //Set list view adapter list=(ListView)findViewById(R.id.list); //add the footer before adding the adapter, else the footer will not load! footerView = ((LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.listfooter, null, false); list.addFooterView(footerView); adapter=new LazyAdapter(this,getApplicationContext()); list.setAdapter(adapter); list.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, int position, long id) { try{ sharing_class.chicks_helper = sharing_class.chicks_history.get(position); Intent i = new Intent().setClass(history.this, notes.class); startActivity(i); }catch(Exception e){ e.getLocalizedMessage(); } } }); list.setOnScrollListener(new OnScrollListener(){ @Override public void onScrollStateChanged(AbsListView view, int scrollState) {} @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { //what is the bottom iten that is visible int lastInScreen = firstVisibleItem + visibleItemCount; //is the bottom item visible & not loading more already ? Load more ! boolean end_of_list = false; if(chicks_showed >= db_size){ end_of_list = true; list.removeFooterView(footerView); } else{ end_of_list = false; } if((lastInScreen == totalItemCount) && !end_of_list){ //load more list_limit += 500; CreateList(); adapter.RefreshRow(); } } }); buy_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //Start BUY activity Intent i = new Intent().setClass(history.this, com.billing.BillingActivity.class); startActivity(i); } }); start_map.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //Start map activity Intent i = new Intent().setClass(history.this, chicks_map_activity2.class); startActivity(i); } }); //Init clicks //Create list of lists }catch(Exception e){ e.getLocalizedMessage(); } } @Override public void onDestroy() { try{ adapter.imageLoader.stopThread(); list.setAdapter(null); super.onDestroy(); }catch(Exception e){ e.getLocalizedMessage(); } } @Override public void onResume() { try{ CreateList(); adapter.RefreshRow(); if(sharing_class.isPaid()){ buy_button.setVisibility(View.GONE); buy_dialog.setVisibility(View.GONE); start_map.setVisibility(View.VISIBLE); } else{ buy_button.setVisibility(View.VISIBLE); buy_dialog.setVisibility(View.VISIBLE); start_map.setVisibility(View.GONE); } }catch(Exception e){ e.getLocalizedMessage(); } super.onResume(); } //History list aggregation function void CreateList(){ try{ //Get all data from DB LinkedList<String> IDs = new LinkedList<String>(); //chicks_history Double store_lat = 0.0; Double store_long = 0.0; user_item this_chick = null; user_item last_chick = null; boolean change = false; String photo_list = ""; IDs.clear(); int added = 0; db_size = sharing_class.dbMgr.getDBsize(); sharing_class.chicks_list.clear(); sharing_class.chicks_history.clear(); clicks = sharing_class.GetDB(list_limit); ListIterator<user_item> it = clicks.listIterator(); chicks_showed = 0; while (it.hasNext()) { this_chick = it.next(); //Init store location if(store_lat == 0.0){ store_lat = Double.valueOf(this_chick.getLat()); store_long = Double.valueOf(this_chick.getLong()); last_chick = this_chick; photo_list = ""; } change = !sharing_class.isSameLocation(Double.valueOf(this_chick.getLat()),Double.valueOf(this_chick.getLong()),store_lat,store_long); if(change){ //Store current IDs list sharing_class.chicks_history.addLast(IDs); //go through IDs and find first photo //Get photos from IDs sharing_class.chicks_list.add(new list_item(last_chick.getAddress(), last_chick.getDate(), String.valueOf(sharing_class.chicks_history.getLast().size()), photo_list)); photo_list = ""; added = 0; last_chick = this_chick; //start new IDs list IDs = new LinkedList<String>(); IDs.addFirst(this_chick.getId()); chicks_showed++; if(this_chick.getPhoto().length()>0 && photo_list == "" ){ photo_list = this_chick.getPhoto(); } store_lat = Double.valueOf(this_chick.getLat()); store_long = Double.valueOf(this_chick.getLong()); } else{ store_lat = Double.valueOf(this_chick.getLat()); store_long = Double.valueOf(this_chick.getLong()); IDs.addFirst(this_chick.getId()); chicks_showed++; if(this_chick.getPhoto().length()>0 && photo_list == ""){ photo_list = this_chick.getPhoto(); } } } //while //Ulozim posledniho sharing_class.chicks_history.addLast(IDs); sharing_class.chicks_list.add(new list_item(last_chick.getAddress(), last_chick.getDate(), String.valueOf(IDs.size()), photo_list)); }catch(Exception e){ String ee = e.toString(); } } }//End class
[ "dev@touchsurfers.com" ]
dev@touchsurfers.com
d8268eee2a80837e602af963bcf92edd8d1f625d
d4ad30e07d68601f8c9d149953c896511a28a57c
/EduMaking-Backend/src/main/java/co/unab/edu/models/entity/Instructor.java
07da6c5d060eec742835a5b8211b63397aafdbac
[]
no_license
gelverargel/Sprint4
654cbdd61d09aa57156db9bac96e17f4b9db0c07
9c6149c45b4f17d1b08560db486287c919ee26fa
refs/heads/main
2023-08-24T14:46:19.778543
2021-10-22T10:31:07
2021-10-22T10:31:07
414,426,190
0
0
null
null
null
null
UTF-8
Java
false
false
2,277
java
package co.unab.edu.models.entity; import java.time.LocalDate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name = "instructores") public class Instructor { @Id @Column(name = "id_instructor") private Integer id; @Column(name = "nom_instructor") private String nombre; @Column(name = "tel_instructor") private Integer telef; @Column(name = "email_instructor") private String email; @ManyToOne @JoinColumn(name = "id_profesion") private Profesion profesion; @Column(name = "fecha_ini_experiencia") private LocalDate fInicioExp; @ManyToOne @JoinColumn(name = "id_pais") private Pais pais; @ManyToOne @JoinColumn(name = "id_ciudad") private Ciudad ciudad; @Column(name = "estado_instructor") private String estado; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public Integer getTelef() { return telef; } public void setTelef(Integer telef) { this.telef = telef; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Profesion getProfesion() { return profesion; } public void setProfesion(Profesion profesion) { this.profesion = profesion; } public LocalDate getfInicioExp() { return fInicioExp; } public void setfInicioExp(LocalDate fInicioExp) { this.fInicioExp = fInicioExp; } public Pais getPais() { return pais; } public void setPais(Pais pais) { this.pais = pais; } public Ciudad getCiudad() { return ciudad; } public void setCiudad(Ciudad ciudad) { this.ciudad = ciudad; } public String getEstado() { return estado; } public void setEstado(String estado) { this.estado = estado; } @Override public String toString() { return "Instructor [id=" + id + ", nombre=" + nombre + ", telef=" + telef + ", email=" + email + ", profesion=" + profesion + ", fInicioExp=" + fInicioExp + ", pais=" + pais + ", ciudad=" + ciudad + ", estado=" + estado + "]"; } }
[ "90213786+gelverargel@users.noreply.github.com" ]
90213786+gelverargel@users.noreply.github.com
20cb8ff952254199e41e48b6ef0fe922edfcc676
b54816d082b2384ba21b8251ee0230250f201310
/sem_06/it_praktikum_05/soap/src/it_05/Party.java
7b75989cb570409a081733a6dfb942548a3a54ae
[]
no_license
D4ryus/studium
12174aa0cbf940b55e06cf5fdddc46d230186911
232501b41a4bd9e1d509d998957b1cb1fc6fd16a
refs/heads/master
2021-01-13T01:53:59.561492
2015-11-30T10:14:00
2015-11-30T10:14:00
18,681,751
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package it_05; import java.util.LinkedList; import javax.jws.*; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; @WebService @SOAPBinding(style = Style.RPC) public class Party implements PartyInt { LinkedList<String> guestlist = new LinkedList<>(); int max; String datum; String dj; public Party(String datum, int max, String dj){ this.datum = datum; this.max = max; this.dj = dj; } @Override public String getDatum() { return datum; } @Override public String getDj() { return dj; } @Override public int amountOfGuest() { return guestlist.size(); } @Override public LinkedList<String> getGuestList() { return guestlist; } @Override public boolean invite(String guest) { if (guestlist.size() < max) { guestlist.add(guest); System.out.printf("Guest %s added\n", guest); return true; } else { System.out.println("Guestlist full\n"); return false; } } }
[ "w.wackerbauer@yahoo.de" ]
w.wackerbauer@yahoo.de
2dfd20db2d733d630eca3211ced50f1693ff1f25
cfd98930175ade5148ab761be0d8b0c51d95d190
/app/src/androidTest/java/com/example/tablettest/ExampleInstrumentedTest.java
446861ed596fad9c7c6d84642a4baffb3a51ca50
[]
no_license
lawer/TabletTest
bd651aadb861b4fad5c9f60fbe64e8eda3c81015
953e82b01dde19aca2a4ffcda901a5bec9680c3f
refs/heads/master
2023-02-20T18:28:39.925390
2021-01-27T20:10:34
2021-01-27T20:10:34
329,669,203
0
0
null
null
null
null
UTF-8
Java
false
false
758
java
package com.example.tablettest; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.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.getInstrumentation().getTargetContext(); assertEquals("com.example.tablettest", appContext.getPackageName()); } }
[ "carlesgm@gmail.com" ]
carlesgm@gmail.com
97110e84c1241949d52e73f995999e590cc9a910
1802f85a2702f58587ce177df4aa2b11f802c87b
/src/entidade/Sorvete.java
3d4af8660e552f18b5c1e048cde96bd3e272ece1
[]
no_license
XxGiillxX/Sorveteria_Xega_Mais
e123ae1abe9f2122c16029a273e8212c8da17efe
ad9faa8923754794000498b86026b167150a007a
refs/heads/master
2023-04-09T10:01:20.952109
2021-04-13T01:10:15
2021-04-13T01:10:15
357,352,214
1
0
null
null
null
null
UTF-8
Java
false
false
614
java
package entidade; import java.util.Random; public class Sorvete { private String sabor; private double valor; private String marca; private Object tipo; public Object getTipo() { return tipo; } public void setTipo(Object tipo) { this.tipo = tipo; } public String getSabor() { return sabor; } public void setSabor(String sabor) { this.sabor = sabor; } public double getValor() { return valor; } public void setValor(double valor) { this.valor = valor; } public String getMarca() { return marca; } public void setMarca(String marca) { this.marca = marca; } }
[ "78664060+XxGiillxX@users.noreply.github.com" ]
78664060+XxGiillxX@users.noreply.github.com
e94aaf9791fa7407be5e517f8c47086c3f3a5f2c
0e06e096a9f95ab094b8078ea2cd310759af008b
/classes10-dex2jar/com/google/android/gms/internal/ads/zzbbz.java
3537fb32ad98ab3d688f18914021d8ce0d166c93
[]
no_license
Manifold0/adcom_decompile
4bc2907a057c73703cf141dc0749ed4c014ebe55
fce3d59b59480abe91f90ba05b0df4eaadd849f7
refs/heads/master
2020-05-21T02:01:59.787840
2019-05-10T00:36:27
2019-05-10T00:36:27
185,856,424
1
2
null
2019-05-10T00:36:28
2019-05-09T19:04:28
Java
UTF-8
Java
false
false
961
java
// // Decompiled by Procyon v0.5.34 // package com.google.android.gms.internal.ads; import java.util.Map; final class zzbbz<K> implements Entry<K, Object> { private Entry<K, zzbbx> zzdvi; private zzbbz(final Entry<K, zzbbx> zzdvi) { this.zzdvi = zzdvi; } @Override public final K getKey() { return this.zzdvi.getKey(); } @Override public final Object getValue() { if (this.zzdvi.getValue() == null) { return null; } return zzbbx.zzadu(); } @Override public final Object setValue(final Object o) { if (!(o instanceof zzbcu)) { throw new IllegalArgumentException("LazyField now only used for MessageSet, and the value of MessageSet must be an instance of MessageLite"); } return this.zzdvi.getValue().zzl((zzbcu)o); } public final zzbbx zzadv() { return this.zzdvi.getValue(); } }
[ "querky1231@gmail.com" ]
querky1231@gmail.com
54972224681d49d37c36c5f35bb3c7864470d302
f47b3715dfe531600fa3ab3082dbcb8f08940359
/target/tomcat/work/Tomcat/localhost/_/org/apache/jsp/WEB_002dINF/views/add_002dbooking_jsp.java
0a2552e2155713147199cd2615624b68263dad5a
[]
no_license
AigarsG/book-a-car
af98d54a196475bae8305df22859d11eb307b66f
3fc0d2c4f9cb20493bfa4eba81e2107563ccade0
refs/heads/master
2021-05-10T00:27:04.928513
2018-03-17T10:29:56
2018-03-17T10:29:56
118,834,262
0
0
null
null
null
null
UTF-8
Java
false
false
13,536
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/7.0.47 * Generated at: 2018-03-17 10:13:14 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp.WEB_002dINF.views; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class add_002dbooking_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; static { _jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(3); _jspx_dependants.put("/WEB-INF/views/../common/navigation.jspf", Long.valueOf(1516830473000L)); _jspx_dependants.put("/WEB-INF/views/../common/header.jspf", Long.valueOf(1516930818000L)); _jspx_dependants.put("/WEB-INF/views/../common/footer.jspf", Long.valueOf(1516930818000L)); } private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems; private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public void _jspInit() { _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } public void _jspDestroy() { _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.release(); } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\n"); out.write("<!DOCTYPE html>\n"); out.write("<head>\n"); out.write("<title>Book-A-Car</title>\n"); out.write("<link href=\"webjars/bootstrap/3.3.6/css/bootstrap.min.css\"\n"); out.write("\trel=\"stylesheet\">\n"); out.write("<link\n"); out.write("\thref=\"webjars/jquery-ui/1.9.2/css/smoothness/jquery-ui-1.9.2.custom.css\"\n"); out.write("\trel=\"stylesheet\">\n"); out.write("\n"); out.write("<style>\n"); out.write(".footer {\n"); out.write("\tposition: absolute;\n"); out.write("\tbottom: 0;\n"); out.write("\twidth: 100%;\n"); out.write("\theight: 60px;\n"); out.write("\tbackground-color: #f5f5f5;\n"); out.write("}\n"); out.write("</style>\n"); out.write("<script src=\"webjars/jquery/2.1.4/jquery.min.js\"></script>\n"); out.write("<script src=\"webjars/bootstrap/3.3.6/js/bootstrap.min.js\"></script>\n"); out.write("<script src=\"webjars/jquery-ui/1.9.2/js/jquery-ui-1.9.2.custom.min.js\"></script>\n"); out.write("</head>\n"); out.write("\n"); out.write("<body>"); out.write('\n'); out.write("<nav class=\"navbar navbar-default\">\n"); out.write("\n"); out.write("\t<ul class=\"nav navbar-nav\">\n"); out.write("\t\t<li><a href=\"/list-bookings.do\">Bookings</a></li>\n"); out.write("\t</ul>\n"); out.write("\n"); out.write("\t<ul class=\"nav navbar-nav navbar-right\">\n"); out.write("\t\t<li><a href=\"/logout.do\">Logout</a></li>\n"); out.write("\t</ul>\n"); out.write("\n"); out.write("</nav>"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<script type=\"text/javascript\">\n"); out.write("\tvar disabledDateRanges = {};\n"); out.write("\n"); out.write("\tfunction DisableSpecificDates(date) {\n"); out.write("\t\tvar currentTime = new Date();\n"); out.write("\t\tvar string = jQuery.datepicker.formatDate('yy-mm-dd', date);\n"); out.write("\t\tcurrentTime.setHours(0, 0, 0, 0);\n"); out.write("\t\tvar show = true;\n"); out.write("\t\tfor ( var key in disabledDateRanges) {\n"); out.write("\t\t\tif (disabledDateRanges.hasOwnProperty(key)) {\n"); out.write("\t\t\t\tvar value = disabledDateRanges[key];\n"); out.write("\t\t\t\tvar fromDate = new Date(key);\n"); out.write("\t\t\t\tvar toDate = new Date(value);\n"); out.write("\t\t\t\tvar selDate = new Date(string);\n"); out.write("\t\t\t\tif (selDate.getTime() >= fromDate.getTime()\n"); out.write("\t\t\t\t\t\t&& selDate.getTime() <= toDate.getTime()) {\n"); out.write("\t\t\t\t\tshow = false;\n"); out.write("\t\t\t\t\tbreak;\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t}\n"); out.write("\t\t}\n"); out.write("\t\treturn [ show ];\n"); out.write("\t}\n"); out.write("\n"); out.write("\t$(document).ready(function() {\n"); out.write("\t\t\n"); out.write("\t\t$(\"#selectedCar\").click(function(event) {\n"); out.write("\t\t\tdisabledDateRanges = {};\n"); out.write("\t\t});\n"); out.write("\t\t\n"); out.write("\t\t$(\"#selectedCar\").blur(function(event) {\n"); out.write("\t\t\t$.ajax({\n"); out.write("\t\t\t\ttype: 'GET',\n"); out.write("\t\t\t\tdata: {\n"); out.write("\t\t\t\t\tselectedCar: $(\"#selectedCar\").val()\n"); out.write("\t\t\t\t},\n"); out.write("\t\t\t\theaders: {\n"); out.write("\t\t\t\t\tAccept: \"application/json charset=utf-8\",\n"); out.write("\t\t\t\t\t\"Content-Type\": \"application/json charset=utf-8\"\n"); out.write("\t\t\t\t},\n"); out.write("\t\t\t\tsuccess: function(exclusionRanges) {\n"); out.write("\t\t\t\t\tdisabledDateRanges = JSON.parse(JSON.stringify(exclusionRanges));\n"); out.write("\t\t\t\t}\n"); out.write("\t\t\t});\n"); out.write("\t\t});\n"); out.write("\t\t\n"); out.write("\t\t$(\"#fromDate\").datepicker({\n"); out.write("\t\t\tbeforeShowDay : DisableSpecificDates,\n"); out.write("\t\t\tminDate : 0,\n"); out.write("\t\t\tonSelect : function(selected) {\n"); out.write("\t\t\t\tvar dateSelected = new Date(selected);\n"); out.write("\t\t\t\tdateSelected.setHours(0, 0, 0, 0);\n"); out.write("\t\t\t\t$(\"#toDate\").datepicker(\"option\", \"minDate\", dateSelected);\n"); out.write("\t\t\t}\n"); out.write("\t\t});\n"); out.write("\n"); out.write("\t\t$(\"#toDate\").datepicker({\n"); out.write("\t\t\tbeforeShowDay : DisableSpecificDates,\n"); out.write("\t\t\tminDate : 0,\n"); out.write("\t\t\tonSelect : function(selected) {\n"); out.write("\t\t\t\tvar dateSelected = new Date(selected);\n"); out.write("\t\t\t\tdateSelected.setHours(0, 0, 0, 0);\n"); out.write("\t\t\t\t$(\"#fromDate\").datepicker(\"option\", \"maxDate\", dateSelected);\n"); out.write("\t\t\t}\n"); out.write("\t\t});\n"); out.write("\t});\n"); out.write("</script>\n"); out.write("\n"); out.write("<div class=\"container\">\n"); out.write("\t<form action=\"/add-booking.do\" method=\"POST\">\n"); out.write("\t\t<fieldset class=\"form-group\">\n"); out.write("\t\t\t<label>Car</label> <select size=\"5\" id=\"selectedCar\" name=\"selectedCar\"\n"); out.write("\t\t\t\tclass=\"step form-control\">\n"); out.write("\t\t\t\t"); if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context)) return; out.write("\n"); out.write("\t\t\t</select>\n"); out.write("\t\t</fieldset>\n"); out.write("\t\t<fieldset class=\"form-group\">\n"); out.write("\t\t\t<label>From</label> <input id=\"fromDate\" type=\"text\" name=\"fromDate\"\n"); out.write("\t\t\t\tclass=\"step form-control\" />\n"); out.write("\t\t</fieldset>\n"); out.write("\t\t<fieldset class=\"form-group\">\n"); out.write("\t\t\t<label>To</label> <input id=\"toDate\" type=\"text\" name=\"toDate\"\n"); out.write("\t\t\t\tclass=\"step form-control\" />\n"); out.write("\t\t</fieldset>\n"); out.write("\t\t<input type=\"submit\" value=\"Book\" class=\"step btn btn-success\" />\n"); out.write("\t</form>\n"); out.write("</div>\n"); out.write("\n"); out.write("\n"); out.write("<footer class=\"footer\">\n"); out.write("\n"); out.write("</footer>\n"); out.write("\n"); out.write("\n"); out.write("</body>\n"); out.write("</html>"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { out.clearBuffer(); } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } private boolean _jspx_meth_c_005fforEach_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:forEach org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class); _jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fforEach_005f0.setParent(null); // /WEB-INF/views/add-booking.jsp(78,4) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f0.setItems(new org.apache.jasper.el.JspValueExpression("/WEB-INF/views/add-booking.jsp(78,4) '${cars}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${cars}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext())); // /WEB-INF/views/add-booking.jsp(78,4) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fforEach_005f0.setVar("car"); int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 }; try { int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag(); if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write("\t\t\t\t\t<option value=\""); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${car.id}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)); out.write('"'); out.write('>'); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${car.year}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)); out.write(' '); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${car.model}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)); out.write("</option>\n"); out.write("\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { return true; } } catch (java.lang.Throwable _jspx_exception) { while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0) out = _jspx_page_context.popBody(); _jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception); } finally { _jspx_th_c_005fforEach_005f0.doFinally(); _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0); } return false; } }
[ "aigars.gridjusko@gmail.com" ]
aigars.gridjusko@gmail.com
27028ffc1d56d181fc98e0bf5baad50a049ebd4d
82ab74111b0e11a47b797767b7e538bce461ab9c
/app/src/main/java/com/area52/techno/dataloaders/LastAddedLoader.java
dc038c1c8f4491d4ba1815f42d5362cecaae7c49
[]
no_license
ChrisSQL/music_app_1
24b6196538a5a3074758b7d20fbc8307c236aad2
2b1ed0296789fbe26913fb0b46f08489f365aade
refs/heads/master
2020-06-13T04:18:25.679224
2019-07-04T12:51:20
2019-07-04T12:51:20
194,530,502
0
0
null
null
null
null
UTF-8
Java
false
false
3,055
java
/* * Copyright (C) 2012 Andrew Neal * Copyright (C) 2014 The CyanogenMod Project * Copyright (C) 2015 Naman Dwivedi * 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.area52.techno.dataloaders; import android.content.Context; import android.database.Cursor; import android.provider.MediaStore; import android.provider.MediaStore.Audio.AudioColumns; import com.area52.techno.models.Song; import com.area52.techno.utils.PreferencesUtility; import java.util.ArrayList; import java.util.List; public class LastAddedLoader { private static Cursor mCursor; public static List<Song> getLastAddedSongs(Context context) { ArrayList<Song> mSongList = new ArrayList<>(); mCursor = makeLastAddedCursor(context); if (mCursor != null && mCursor.moveToFirst()) { do { long id = mCursor.getLong(0); String title = mCursor.getString(1); String artist = mCursor.getString(2); String album = mCursor.getString(3); int duration = mCursor.getInt(4); int trackNumber = mCursor.getInt(5); long artistId = mCursor.getInt(6); long albumId = mCursor.getLong(7); final Song song = new Song(id, albumId, artistId, title, artist, album, duration, trackNumber); mSongList.add(song); } while (mCursor.moveToNext()); } if (mCursor != null) { mCursor.close(); mCursor = null; } return mSongList; } public static final Cursor makeLastAddedCursor(final Context context) { //four weeks ago long fourWeeksAgo = (System.currentTimeMillis() / 1000) - (4 * 3600 * 24 * 7); long cutoff = PreferencesUtility.getInstance(context).getLastAddedCutoff(); // use the most recent of the two timestamps if (cutoff < fourWeeksAgo) { cutoff = fourWeeksAgo; } final StringBuilder selection = new StringBuilder(); selection.append(AudioColumns.IS_MUSIC + "=1"); selection.append(" AND " + AudioColumns.TITLE + " != ''"); selection.append(" AND " + MediaStore.Audio.Media.DATE_ADDED + ">"); selection.append(cutoff); return context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[]{"_id", "title", "artist", "album", "duration", "track", "artist_id", "album_id"}, selection.toString(), null, MediaStore.Audio.Media.DATE_ADDED + " DESC"); } }
[ "chrismaher.wit@gmail.com" ]
chrismaher.wit@gmail.com
326723e7e215fa41a38a7badb087112ac3333c60
eef49822e7859f27081f458ce67b5ffad91560e2
/day04_eesy_shiye/src/main/java/com/itheima/dao/impl/AccountDaoImpl.java
fc88475705f2b9b4763d3172c45ca651955cd4de
[]
no_license
MapleStoryBoy/JavaStudy
c13afc020299729259147f00cbe17196b19162aa
b59de896a0ff987c7cbd535d3d18d74a1fbfcfaa
refs/heads/master
2022-12-27T19:52:42.224168
2020-05-23T01:07:36
2020-05-23T01:07:36
187,469,253
2
0
null
2022-12-15T23:50:55
2019-05-19T11:43:00
JavaScript
UTF-8
Java
false
false
1,408
java
package com.itheima.dao.impl; import com.itheima.dao.IAccountDao; import com.itheima.domain.Account; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; import java.util.List; /** * 账户的持久层实现类 */ @Repository("accountDao") public class AccountDaoImpl implements IAccountDao { @Autowired private JdbcTemplate jdbcTemplate; public Account findAccountById(Integer accountId) { List<Account> accounts = jdbcTemplate.query("select * from account where id = ?",new BeanPropertyRowMapper<Account>(Account.class),accountId); return accounts.isEmpty()?null:accounts.get(0); } public Account findAccountByName(String accountName) { List<Account> accounts = jdbcTemplate.query("select * from account where name = ?",new BeanPropertyRowMapper<Account>(Account.class),accountName); if(accounts.isEmpty()){ return null; } if(accounts.size()>1){ throw new RuntimeException("结果集不唯一"); } return accounts.get(0); } public void updateAccount(Account account) { jdbcTemplate.update("update account set name=?,money=? where id=?",account.getName(),account.getMoney(),account.getId()); } }
[ "MapleStoryBoy@163.com" ]
MapleStoryBoy@163.com
f1f7f2954e369bc5ebf2961085cd1db22a8ca3e2
bbe05926dfd74f3401da59dd8f74d917afda46ba
/app/src/main/java/org/songs/intunestopsongsdemo/model/pojo/ITunesSongsResponse.java
8fe4b0b0a4f0edfcea15aee08693e1de7df2ee32
[]
no_license
asif786ka/ITUNES_Retrofit_SQLite_Solution
04ed5ed08eafe8310fe5baebce1e0de4ee2d7af5
09bda8728545f446d38a586cad86928e4a98ae48
refs/heads/master
2021-01-01T20:20:01.179008
2017-07-30T19:25:38
2017-07-30T19:25:38
98,819,695
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package org.songs.intunestopsongsdemo.model.pojo; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class ITunesSongsResponse { @SerializedName("feed") @Expose private Feed feed; public Feed getFeed() { return feed; } public void setFeed(Feed feed) { this.feed = feed; } }
[ "asif786ka@gmail.com" ]
asif786ka@gmail.com
b1004360d0b3b74950c65d167029cf397c886629
bb831b2c9678e27c5af384895e41152794bb4c76
/src/main/java/com/crave/edu/config/WebMvcConfiga.java
b749088fefb911bb070b28bd9ade516725cd8782
[]
no_license
crave1106/education
03d5d97107f92ef8f46644549e2c69c87fc58ca3
d7e6a4bddf13e518fbf8b8ef3365484dc4bd8d1f
refs/heads/master
2022-07-10T11:45:41.856155
2019-11-20T16:18:24
2019-11-20T16:18:24
220,268,548
0
0
null
2022-06-29T17:45:51
2019-11-07T15:28:26
JavaScript
UTF-8
Java
false
false
726
java
package com.crave.edu.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration class WebMvcConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("*") .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS") .allowCredentials(true) .maxAge(3600) .allowedHeaders("*"); } }
[ "i110611@163.com" ]
i110611@163.com
37034e6ffef416344ef0170e0a6e29613440c029
2b87e3a938e58a0a285c4f321aed6ea5d0331848
/Ejercicio8/InterfazRMI/src/interfazrmi/MetodosRemotos.java
a0cdddda139094e5af9ffb2f3836dc7c45a927c2
[]
no_license
esedecks/DesarrolloSistemasDistribuidos
03bbae4d8432d9d2af0e6875404cb792c930b4c3
c9e0aa546d5003350099434c3c556950e80cc16c
refs/heads/master
2016-08-11T07:09:00.777775
2016-05-04T02:17:53
2016-05-04T02:17:53
51,804,731
0
0
null
null
null
null
UTF-8
Java
false
false
1,352
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 interfazrmi; import java.rmi.Remote; import java.rmi.RemoteException; /** * * @author esedecks */ public interface MetodosRemotos extends Remote { //implementar todos los métodos remotos public boolean autenticarUsuario(String usuario,String password) throws RemoteException; public boolean insertarProducto(String descripcion,String existencias,String precio) throws RemoteException; public String leerArticulos() throws RemoteException; public boolean eliminarArticulo(String nombre ) throws RemoteException; public String leerInfoArticulo(String nombre ) throws RemoteException; public boolean actualizarArticulo(String descripcion,String existencias, String precio,String nombreAnterior) throws RemoteException; public boolean realizarMovimiento(String nombreArticulo,String tipoMovimiento, String cantidad) throws RemoteException; public String leerInfoForChart() throws RemoteException; public String getCorreoUsuario(String usuario) throws RemoteException; public String leerNoExistencias (String descripcion)throws RemoteException; public String getReporte () throws RemoteException; }
[ "jdecks.visible@outlook.com" ]
jdecks.visible@outlook.com
ae9d1dd2b9e7d51fc788c08adc16ea3b3e9ff6d4
245519d659ba5f4f40d3ef823c3820d941ce6a54
/disco-sales/src/main/java/disco/sales/endpoint/SaleEndpoint.java
653fc4b667a19f37941968dd04b6d44f1415ae95
[]
no_license
tarcio/disco
0093120e63a7cce8b08495873587e8a8f1d0c109
bd208dd02d28ba5a6c6dad7275dc6bd774ca19eb
refs/heads/master
2022-05-31T09:56:29.601488
2019-08-02T19:12:05
2019-08-02T19:12:05
200,180,319
0
0
null
2022-05-20T21:04:42
2019-08-02T06:41:53
Java
UTF-8
Java
false
false
4,089
java
package disco.sales.endpoint; import java.time.LocalDateTime; import java.util.Optional; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; 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.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.server.ResponseStatusException; import disco.sales.entity.Sale; import disco.sales.model.SaleDTO; import disco.sales.service.SaleService; @RestController @RequestMapping("sale") public class SaleEndpoint { private static final Logger LOGGER = LogManager.getLogger(SaleEndpoint.class); private SaleService saleService; @Autowired public SaleEndpoint(SaleService saleService) { this.saleService = saleService; } @PostMapping("/save") public ResponseEntity<Sale> save(@RequestBody SaleDTO sale) { try { LOGGER.debug("Calling saleEndpoint.save | args: {}", sale); Sale result = saleService.save(sale); LOGGER.debug("saleEndpoint.save | return: {}", result); return ResponseEntity.created(null).body(result); } catch (IllegalArgumentException exception) { throw new ResponseStatusException(HttpStatus.BAD_REQUEST, exception.getMessage(), exception); } catch (Exception exception) { throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, exception.getMessage(), exception); } } @GetMapping("/find/{id}") public ResponseEntity<Sale> findById(@PathVariable String id) { try { LOGGER.debug("Calling saleEndpoint.findById | args: {}", id); Optional<Sale> sale = saleService.findById(id); LOGGER.debug("saleEndpoint.findById | return: {}", sale.orElse(null)); return ResponseEntity.of(sale); } catch (IllegalArgumentException exception) { throw new ResponseStatusException(HttpStatus.BAD_REQUEST, exception.getMessage(), exception); } catch (Exception exception) { throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, exception.getMessage(), exception); } } @GetMapping("/find") public Page<Sale> find( @RequestParam(value = "page", defaultValue = "0", required = false) int page, @RequestParam(value = "size", defaultValue = "20", required = false) int size, @RequestParam(value = "startDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate, @RequestParam(value = "endDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate ) { try { LOGGER.debug("Calling saleEndpoint.find | args: {}, {}, {}, {}", page, size, startDate, endDate); Page<Sale> salePage = saleService.findAll(startDate, endDate, PageRequest.of(page, size, Sort.Direction.DESC, "date")); LOGGER.debug("saleEndpoint.find | return: {}", salePage); return salePage; } catch (IllegalArgumentException exception) { throw new ResponseStatusException(HttpStatus.BAD_REQUEST, exception.getMessage(), exception); } catch (Exception exception) { throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, exception.getMessage(), exception); } } @GetMapping("/deleteAll") public ResponseEntity<String> deleteAll() { try { LOGGER.debug("Calling saleEndpoint.deleteAll"); saleService.deleteAll(); return ResponseEntity.ok().body("All documents deleted!"); } catch (Exception exception) { throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, exception.getMessage(), exception); } } }
[ "tarc.lima@gmail.com" ]
tarc.lima@gmail.com
2afa844931764978f94151d569639904c7117728
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/18/18_daa60e233b01ed6cce35b5d9f3d99d30f14e6448/JSR88DeploymentListener/18_daa60e233b01ed6cce35b5d9f3d99d30f14e6448_JSR88DeploymentListener_s.java
68e5703e54494dbf64c9d7d1141bdb1fbc88ff7d
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,192
java
/* * JBoss, Home of Professional Open Source * Copyright 2010, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.arquillian.container.jsr88; import java.util.logging.Logger; import javax.enterprise.deploy.shared.CommandType; import javax.enterprise.deploy.spi.TargetModuleID; import javax.enterprise.deploy.spi.status.DeploymentStatus; import javax.enterprise.deploy.spi.status.ProgressEvent; import javax.enterprise.deploy.spi.status.ProgressListener; import javax.enterprise.deploy.spi.status.ProgressObject; /** * Listens for JSR 88 deployment events to update the deployed state * of the module. * * <p>During distribution (deployment), this listener observes the completed * operation and subsequently starts the module, marking the module as * started when the start operation is complete.</p> * * <p>During undeployment, this listener observes the completed operation * and marks the module as not started.</p> * * @author Dan Allen * @author Iskandar Salim */ class JSR88DeploymentListener implements ProgressListener { private static final Logger log = Logger.getLogger(JSR88RemoteContainer.class.getName()); private JSR88RemoteContainer container; private TargetModuleID[] ids; private CommandType type; JSR88DeploymentListener(JSR88RemoteContainer container, TargetModuleID[] moduleIds, CommandType type) { this.container = container; this.ids = moduleIds; this.type = type; } @Override public void handleProgressEvent(ProgressEvent event) { DeploymentStatus status = event.getDeploymentStatus(); log.info(status.getMessage()); if (status.isCompleted()) { if (type.equals(CommandType.DISTRIBUTE)) { ProgressObject startProgress = container.getDeploymentManager().start(ids); startProgress.addProgressListener(new ProgressListener() { @Override public void handleProgressEvent(ProgressEvent startEvent) { log.info(startEvent.getDeploymentStatus().getMessage()); if (startEvent.getDeploymentStatus().isCompleted()) { container.moduleStarted(true); } } }); } else if (type.equals(CommandType.UNDEPLOY)) { container.moduleStarted(false); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ec598d78f496c353f664d57fcfbbadea123a6595
22c0d999e81ef6446b386d97619209ea4f08bb48
/app/src/main/java/com/usamakzafar/trackerzandroidapplication/models/User.java
4dcbe7fb773782837551b101f6e4bed3884ea178
[]
no_license
usamakzafar/trackerz
84d7c264bc955a2388d30c49f9bde5f566a2e03e
f535fc64e87d6f22e07f030b0dd74818ac399af6
refs/heads/master
2020-12-02T22:13:03.684260
2017-10-20T08:36:19
2017-10-20T08:36:19
94,179,798
0
0
null
null
null
null
UTF-8
Java
false
false
1,062
java
package com.usamakzafar.trackerzandroidapplication.models; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * Created by usamazafar on 29/08/2017. */ public class User { private String email; private String name; private String dob; private String truck; private List<String> following = new ArrayList<>(); public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDob() { return dob; } public void setDob(String dob) { this.dob = dob; } public String getTruck() { return truck; } public void setTruck(String truck) { this.truck = truck; } public List<String> getFollowing() { return following; } public void setFollowing(List<String> following) { this.following = following; } }
[ "usamakzafar@gmail.com" ]
usamakzafar@gmail.com
5a6ed52a53136d3033e51ba80bbfbb12d5779e45
e3965c3364db6351c6dbba92b5bbf2923e28b059
/src/main/java/HelloWorld.java
108fd6c034e89a1a31aab0d0d614b189ad221f74
[]
no_license
zzwenyu/test2
2c0ff0ae49fd8b70e99ce5e0832dec9fcc964cc8
d30be4893891f4f67fc5d42ef2e5b7cf051345e6
refs/heads/master
2021-06-26T03:23:47.928066
2019-07-15T14:02:59
2019-07-15T14:02:59
137,292,794
0
0
null
2020-10-12T20:16:11
2018-06-14T01:55:45
Java
UTF-8
Java
false
false
145
java
package org.gpf.maventest01.model; public class HelloWorld { public String sayHelloWorld(){ return "Hello World!"; } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
0d622de640e2d32ec7a44c4e16d690eb59ae46a4
14516e33a9a3093e8fe272dbd2ec2faa5321f2bf
/Topic/src/collections/demos/ReadOnlyCollection.java
785fa30802e176a13a7b8a57eb9544f837799f02
[]
no_license
KrutikMaheta/CoreJAVA
ada1a77f952c01e314b20d4c7cec4b2355aa1d1c
5bb356cd2e37928f27d3b1116c4184e7aefddd29
refs/heads/master
2022-10-06T22:28:35.201811
2019-12-21T17:56:22
2019-12-21T17:56:22
168,912,974
0
1
null
2022-09-22T18:54:43
2019-02-03T05:28:38
Java
UTF-8
Java
false
false
725
java
package collections.demos; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; public class ReadOnlyCollection { public static void main(String[] args) { List<String> list = Arrays.asList(new String[] { "Krutik", "krunal", "Kaushik", "ketan", "kelvin", "anil" }); List<String> arrList = new ArrayList<>(); arrList.addAll(list); arrList = Collections.unmodifiableList(arrList); Set<String> set = new HashSet<String>(list); set = Collections.unmodifiableSet(set); try { arrList.add("rjjt"); } catch (UnsupportedOperationException e) { e.printStackTrace(); } System.out.println(arrList); } }
[ "krutik.maheta@gmail.com" ]
krutik.maheta@gmail.com
97d769b4f2a4a51d0f3bbcb4618b8ac71f007655
2c32baacbd7a0228201d3a5a43d7186b31989b2a
/src/main/java/com/erayt/web01/repository/CustomerRepository.java
90ac91d8a8a1182235cb1afeda806adcd82371a4
[]
no_license
zhang951228/springboo2_guides_web01
4c5091f972e3dc4eaae1d12532bbe44590083bc4
63ce8a4bd0653f01985f1644463623e69e0dfe04
refs/heads/main
2023-07-23T14:38:33.285743
2021-08-27T11:17:32
2021-08-27T11:17:32
395,550,755
0
0
null
null
null
null
UTF-8
Java
false
false
404
java
package com.erayt.web01.repository; import com.erayt.web01.domain.Customer; import org.springframework.data.mongodb.repository.MongoRepository; import java.util.List; /** * @Auther: Z151 * @Date: 2021/8/23 17:57 */ public interface CustomerRepository extends MongoRepository<Customer,String> { Customer findByFirstName(String firstName); List<Customer> findByLastName(String lastName); }
[ "292700563@qq.com" ]
292700563@qq.com
a477c13c93205b3f1e4f30e4c332942559a355b9
2852a41507868fc428f780eaddf493a55c6de68f
/springBoot/jogos/jogos/src/main/java/com/minhalojadegames/jogos/model/Categoria.java
9090dc5185bd731aba3191a4259ecf4974746584
[]
no_license
felipe-8847/generation
9f72a3377164936213ef337f960bc967e5457890
7eaf6db2e731cf9452d65732a384d40299f2ef3d
refs/heads/master
2023-06-07T09:49:12.052951
2021-07-13T22:43:16
2021-07-13T22:43:16
371,104,138
0
0
null
null
null
null
UTF-8
Java
false
false
1,260
java
package com.minhalojadegames.jogos.model; import java.util.List; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.validation.constraints.NotNull; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @Entity public class Categoria { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id_categoria; @NotNull private String nome; @NotNull private String descricao; @OneToMany(mappedBy = "adicionar") @JsonIgnoreProperties({"adicionar"}) private List<Produto> adicionarProduto; public Long getId_categoria() { return id_categoria; } public void setId_categoria(Long id_categoria) { this.id_categoria = id_categoria; } public List<Produto> getAdicionarProduto() { return adicionarProduto; } public void setAdicionarProduto(List<Produto> adicionarProduto) { this.adicionarProduto = adicionarProduto; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } }
[ "felipealves131351@gmail.com" ]
felipealves131351@gmail.com
3a323f0181e7716b38a06e6cb86bd8ea7c6991b0
94b37035ee690557a46a1714199a4949a5ba4672
/src/HW/HW5/ConvertNumeric.java
4e67fe70659881f0409de45ad7103c3147a546a8
[]
no_license
BVushakov/HomeWorks
e835dcf53c674be525037186d7679a374669340e
0d09ee9c7e2f3901bfb0358bd10d4555283660f8
refs/heads/master
2020-06-02T11:20:34.356574
2019-08-21T19:36:52
2019-08-21T19:36:52
191,138,374
0
0
null
null
null
null
UTF-8
Java
false
false
969
java
package HW.HW5; import java.util.Scanner; public class ConvertNumeric { public static void main(String[] args) { /** dec to bin */ int decimal = 243; int yourNum = decimal; System.out.println("Dec: " + yourNum + " -> Bin: " + ConverterNumericClasses.converterDecimaiToBinary(decimal)); /** bin to dec */ String binary = "11110011"; System.out.println("Bin: " + binary + " -> Dec: " + ConverterNumericClasses.convertBinaryToDecimal(binary)); /** hex to dec */ String heximal= "1B"; System.out.println("Hex: " + heximal + " -> Dec: " + ConverterNumericClasses.convertHeximalToDecimal(heximal)); /** dec to hex */ Scanner input = new Scanner( System.in ); System.out.print("Dec: "); int decimalNum =input.nextInt(); System.out.println("Dec: " + decimalNum + " -> Hex: " + ConverterNumericClasses.convertDecimalToHeximal(decimalNum)); } }
[ "bogdan.ushakov@privatbank.ua" ]
bogdan.ushakov@privatbank.ua
8852fe9b74ffd062eba1b399b953327c4a8cb262
8680eda3b30fd6f7308f5878305fdd12b1e4fd3f
/bkup version configuration/version configuration/renuar/Master/src/com/renuar/pagefragments/UserAccountViewController.java
14061279fcf83553dfd89b6b7850287f85e49bf6
[]
no_license
shayamximo/AndroidUtils
53e848bfbdf05c92a36a6c6c96fb59f8d04c9291
ef8e7a4a561f20259f77d72431043f613b9afb60
refs/heads/master
2020-05-16T21:57:37.129803
2014-09-07T08:34:11
2014-09-07T08:34:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,870
java
package com.renuar.pagefragments; import java.util.List; import android.content.Context; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import com.renuar.R; import com.renuar.json.Page; import com.renuar.json.Params; import com.renuar.json.stores.InitInfoStore; public class UserAccountViewController extends FragmentPageBase { protected int getLayoutID() { return R.layout.user_account; } @Override protected void initializeActionBar() { actionBarContorller.textViewMainTitle.setText(getResources().getString( R.string.more)); } private boolean isClass(String name) { List<Params> paramsList = InitInfoStore.getInstance() .getPageParamsByName(name); for (Params params : paramsList) { if (params.getName().equals("class_name")) return true; } return false; } @Override public void onActivityCreated(Bundle savedInstanceState) { ListView listView = (ListView) viewOfFragment .findViewById(R.id.listview_user); List<String> keysOfActions = getValueListOfParamFromName("row"); AccountAdapter accountAdapter = new AccountAdapter(getActivity(), R.layout.row_in_account, keysOfActions); listView.setAdapter(accountAdapter); super.onActivityCreated(savedInstanceState); } public class AccountAdapter extends ArrayAdapter<String> { private int resource; private List<String> keysOfActions; public AccountAdapter(Context context, int resource, List<String> keysOfActions) { super(context, resource, keysOfActions); this.resource = resource; this.keysOfActions = keysOfActions; } @Override public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; final Holder holder; if (row == null) { row = inflator.inflate(resource, parent, false); holder = new Holder(); holder.imageView = (ImageView) row .findViewById(R.id.imageview_row_in_account); holder.textView = (TextView) row .findViewById(R.id.textview_row_in_account); row.setTag(holder); } else { holder = (Holder) row.getTag(); } final String keyOfCurrentFragment = keysOfActions.get(position); Page page = InitInfoStore.getInstance().getPageByName( keyOfCurrentFragment); holder.imageView .setBackgroundResource(getIconByString(keyOfCurrentFragment)); Params params = page.getParamsByName("title"); if (params == null) holder.textView.setText(""); else holder.textView.setText(params.getValue()); row.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { if (isClass(keyOfCurrentFragment)) { fragmentRoot.openFragment(keyOfCurrentFragment, null); } else { handleNonFragmentActions(keyOfCurrentFragment); } } }); return row; } public class Holder { public ImageView imageView; public TextView textView; } } public int getIconByString(String iconString) { if (iconString.endsWith("wishlist")) return R.drawable.heart; if (iconString.endsWith("terms")) return R.drawable.document; if (iconString.endsWith("stores")) return R.drawable.location; if (iconString.endsWith("about")) return R.drawable.about; if (iconString.endsWith("contact")) return R.drawable.mail; if (iconString.endsWith("call")) return R.drawable.phone; if (iconString.endsWith("register")) return R.drawable.about; return -1; } public class NonFragmentActions { public NonFragmentActions(String action, String data) { } } }
[ "shayasms128@gmail.com" ]
shayasms128@gmail.com
53e821ee0dd8b791fc9ae7d59fd2a20d47550d92
4e92c6bb911e9f47eb6b5d4d91d4aef988c3e6e4
/src/main/java/com/example/zooshop/exception/ProductAlreadyOnOrderException.java
44808bfeaacb4d564b3fd40dba632cf12fc4ab7d
[]
no_license
wsmieja/zoo-shop
d6b7832d8721b8c1f076b90a980cefa666e940a9
2427534f50272607782ba4d9a279d345902eef5d
refs/heads/master
2023-04-25T05:12:59.536927
2021-05-17T14:44:12
2021-05-17T14:44:12
368,208,738
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
package com.example.zooshop.exception; public class ProductAlreadyOnOrderException extends Exception { }
[ "wsmieja@student.agh.edu.pl" ]
wsmieja@student.agh.edu.pl
9e7f2e8ed594d9c1a19343b8e7a7948b74cdf7ca
f5b9abde7ebb6508e8d43e0a1e30c5d31cb07bad
/blib/src/main/java/com/beevle/blib/view/HeadListView.java
242828d43113074b9f1e39f21c541f6ef55c8d89
[]
no_license
kangsafe/beevle
2629862adb49989fa6406d7fde69f99bc3d7b368
5b54152c50abe4df069374dc12a08ecb79c13976
refs/heads/master
2021-01-10T09:36:33.578638
2016-02-25T14:50:01
2016-02-25T14:50:01
52,431,607
0
0
null
null
null
null
UTF-8
Java
false
false
16,507
java
package com.beevle.blib.view; import android.content.Context; import android.graphics.Canvas; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; import android.widget.AbsListView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; import com.beevle.blib.R; import java.util.Date; /** * 重写的ListView,让每条新闻的时间显示 */ public class HeadListView extends ListView implements AbsListView.OnScrollListener { private final static int RELEASE_To_REFRESH = 0;// 下拉过程的状态值 private final static int PULL_To_REFRESH = 1; // 从下拉返回到不刷新的状态值 private final static int REFRESHING = 2;// 正在刷新的状态值 private final static int DONE = 3; private final static int LOADING = 4; // 实际的padding的距离与界面上偏移距离的比例 private final static int RATIO = 3; private static final int MAX_ALPHA = 255; private LayoutInflater inflater; // ListView头部下拉刷新的布局 private LinearLayout headerView; private TextView lvHeaderTipsTv; private TextView lvHeaderLastUpdatedTv; private ImageView lvHeaderArrowIv; private ProgressBar lvHeaderProgressBar; // 定义头部下拉刷新的布局的高度 private int headerContentHeight; private RotateAnimation animation; private RotateAnimation reverseAnimation; private int startY; private int state; private boolean isBack; // 用于保证startY的值在一个完整的touch事件中只被记录一次 private boolean isRecored; private OnRefreshListener refreshListener; private boolean isRefreshable; private HeaderAdapter mAdapter; private View mHeaderView; private boolean mHeaderViewVisible; private int mHeaderViewWidth; private int mHeaderViewHeight; public HeadListView(Context context) { super(context); //init(context); } public HeadListView(Context context, AttributeSet attrs) { super(context, attrs); //init(context); } public HeadListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); //init(context); } private void init(Context context) { setCacheColorHint(context.getResources().getColor(R.color.transparent)); inflater = LayoutInflater.from(context); headerView = (LinearLayout) inflater.inflate(R.layout.list_header, null); lvHeaderTipsTv = (TextView) headerView .findViewById(R.id.lvHeaderTipsTv); lvHeaderLastUpdatedTv = (TextView) headerView .findViewById(R.id.lvHeaderLastUpdatedTv); lvHeaderArrowIv = (ImageView) headerView .findViewById(R.id.lvHeaderArrowIv); // 设置下拉刷新图标的最小高度和宽度 lvHeaderArrowIv.setMinimumWidth(70); lvHeaderArrowIv.setMinimumHeight(50); lvHeaderProgressBar = (ProgressBar) headerView .findViewById(R.id.lvHeaderProgressBar); measureView(headerView); headerContentHeight = headerView.getMeasuredHeight(); // 设置内边距,正好距离顶部为一个负的整个布局的高度,正好把头部隐藏 headerView.setPadding(0, -1 * headerContentHeight, 0, 0); // 重绘一下 headerView.invalidate(); // 将下拉刷新的布局加入ListView的顶部 addHeaderView(headerView, null, false); // 设置滚动监听事件 setOnScrollListener(this); // 设置旋转动画事件 animation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); animation.setInterpolator(new LinearInterpolator()); animation.setDuration(250); animation.setFillAfter(true); reverseAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); reverseAnimation.setInterpolator(new LinearInterpolator()); reverseAnimation.setDuration(200); reverseAnimation.setFillAfter(true); // 一开始的状态就是下拉刷新完的状态,所以为DONE state = DONE; // 是否正在刷新 isRefreshable = false; } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { isRefreshable = firstVisibleItem == 0; } @Override public boolean onTouchEvent(MotionEvent ev) { if (isRefreshable) { switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: if (!isRecored) { isRecored = true; startY = (int) ev.getY();// 手指按下时记录当前位置 } break; case MotionEvent.ACTION_UP: if (state != REFRESHING && state != LOADING) { if (state == PULL_To_REFRESH) { state = DONE; changeHeaderViewByState(); } if (state == RELEASE_To_REFRESH) { state = REFRESHING; changeHeaderViewByState(); onLvRefresh(); } } isRecored = false; isBack = false; break; case MotionEvent.ACTION_MOVE: int tempY = (int) ev.getY(); if (!isRecored) { isRecored = true; startY = tempY; } if (state != REFRESHING && isRecored && state != LOADING) { // 保证在设置padding的过程中,当前的位置一直是在head,否则如果当列表超出屏幕的话,当在上推的时候,列表会同时进行滚动 // 可以松手去刷新了 if (state == RELEASE_To_REFRESH) { setSelection(0); // 往上推了,推到了屏幕足够掩盖head的程度,但是还没有推到全部掩盖的地步 if (((tempY - startY) / RATIO < headerContentHeight)// 由松开刷新状态转变到下拉刷新状态 && (tempY - startY) > 0) { state = PULL_To_REFRESH; changeHeaderViewByState(); } // 一下子推到顶了 else if (tempY - startY <= 0) {// 由松开刷新状态转变到done状态 state = DONE; changeHeaderViewByState(); } } // 还没有到达显示松开刷新的时候,DONE或者是PULL_To_REFRESH状态 if (state == PULL_To_REFRESH) { setSelection(0); // 下拉到可以进入RELEASE_TO_REFRESH的状态 if ((tempY - startY) / RATIO >= headerContentHeight) {// 由done或者下拉刷新状态转变到松开刷新 state = RELEASE_To_REFRESH; isBack = true; changeHeaderViewByState(); } // 上推到顶了 else if (tempY - startY <= 0) {// 由DOne或者下拉刷新状态转变到done状态 state = DONE; changeHeaderViewByState(); } } // done状态下 if (state == DONE) { if (tempY - startY > 0) { state = PULL_To_REFRESH; changeHeaderViewByState(); } } // 更新headView的size if (state == PULL_To_REFRESH) { headerView.setPadding(0, -1 * headerContentHeight + (tempY - startY) / RATIO, 0, 0); } // 更新headView的paddingTop if (state == RELEASE_To_REFRESH) { headerView.setPadding(0, (tempY - startY) / RATIO - headerContentHeight, 0, 0); } } break; default: break; } } return super.onTouchEvent(ev); } // 当状态改变时候,调用该方法,以更新界面 private void changeHeaderViewByState() { switch (state) { case RELEASE_To_REFRESH: lvHeaderArrowIv.setVisibility(View.VISIBLE); lvHeaderProgressBar.setVisibility(View.GONE); lvHeaderTipsTv.setVisibility(View.VISIBLE); lvHeaderLastUpdatedTv.setVisibility(View.VISIBLE); lvHeaderArrowIv.clearAnimation();// 清除动画 lvHeaderArrowIv.startAnimation(animation);// 开始动画效果 lvHeaderTipsTv.setText("松开刷新"); break; case PULL_To_REFRESH: lvHeaderProgressBar.setVisibility(View.GONE); lvHeaderTipsTv.setVisibility(View.VISIBLE); lvHeaderLastUpdatedTv.setVisibility(View.VISIBLE); lvHeaderArrowIv.clearAnimation(); lvHeaderArrowIv.setVisibility(View.VISIBLE); // 是由RELEASE_To_REFRESH状态转变来的 if (isBack) { isBack = false; lvHeaderArrowIv.clearAnimation(); lvHeaderArrowIv.startAnimation(reverseAnimation); lvHeaderTipsTv.setText("下拉刷新"); } else { lvHeaderTipsTv.setText("下拉刷新"); } break; case REFRESHING: headerView.setPadding(0, 0, 0, 0); lvHeaderProgressBar.setVisibility(View.VISIBLE); lvHeaderArrowIv.clearAnimation(); lvHeaderArrowIv.setVisibility(View.GONE); lvHeaderTipsTv.setText("正在刷新..."); lvHeaderLastUpdatedTv.setVisibility(View.VISIBLE); break; case DONE: headerView.setPadding(0, -1 * headerContentHeight, 0, 0); lvHeaderProgressBar.setVisibility(View.GONE); lvHeaderArrowIv.clearAnimation(); lvHeaderArrowIv.setImageResource(R.mipmap.refresh_arrow); lvHeaderTipsTv.setText("下拉刷新"); lvHeaderLastUpdatedTv.setVisibility(View.VISIBLE); break; } } // 此方法直接照搬自网络上的一个下拉刷新的demo,此处是“估计”headView的width以及height private void measureView(View child) { ViewGroup.LayoutParams params = child.getLayoutParams(); if (params == null) { params = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); } int childWidthSpec = ViewGroup.getChildMeasureSpec(0, 0 + 0, params.width); int lpHeight = params.height; int childHeightSpec; if (lpHeight > 0) { childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight, MeasureSpec.EXACTLY); } else { childHeightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); } child.measure(childWidthSpec, childHeightSpec); } public void setonRefreshListener(OnRefreshListener refreshListener) { this.refreshListener = refreshListener; isRefreshable = true; } public void onRefreshComplete() { state = DONE; lvHeaderLastUpdatedTv.setText("最近更新:" + new Date().toLocaleString()); changeHeaderViewByState(); } private void onLvRefresh() { if (refreshListener != null) { refreshListener.onRefresh(); } } protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); if (mHeaderView != null) { mHeaderView.layout(0, 0, mHeaderViewWidth, mHeaderViewHeight); configureHeaderView(getFirstVisiblePosition()); } } protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if (mHeaderView != null) { measureChild(mHeaderView, widthMeasureSpec, heightMeasureSpec); mHeaderViewWidth = mHeaderView.getMeasuredWidth(); mHeaderViewHeight = mHeaderView.getMeasuredHeight(); } } public void setPinnedHeaderView(View view) { mHeaderView = view; if (mHeaderView != null) { //listview的上边和下边有黑色的阴影。xml中: android:fadingEdge="none" setFadingEdgeLength(0); } requestLayout(); } public void setAdapter(ListAdapter adapter) { //lvHeaderLastUpdatedTv.setText("最近更新:" + new Date().toLocaleString()); super.setAdapter(adapter); mAdapter = (HeaderAdapter) adapter; } public void configureHeaderView(int position) { if (mHeaderView == null) { return; } int state = mAdapter.getHeaderState(position); switch (state) { case HeaderAdapter.HEADER_GONE: { mHeaderViewVisible = false; break; } case HeaderAdapter.HEADER_VISIBLE: { mAdapter.configureHeader(mHeaderView, position, MAX_ALPHA); if (mHeaderView.getTop() != 0) { mHeaderView.layout(0, 0, mHeaderViewWidth, mHeaderViewHeight); } mHeaderViewVisible = true; break; } case HeaderAdapter.HEADER_PUSHED_UP: { View firstView = getChildAt(0); int bottom = firstView.getBottom(); int headerHeight = mHeaderView.getHeight(); int y; int alpha; if (bottom < headerHeight) { y = (bottom - headerHeight); alpha = MAX_ALPHA * (headerHeight + y) / headerHeight; } else { y = 0; alpha = MAX_ALPHA; } mAdapter.configureHeader(mHeaderView, position, alpha); if (mHeaderView.getTop() != y) { mHeaderView.layout(0, y, mHeaderViewWidth, mHeaderViewHeight + y); } mHeaderViewVisible = true; break; } } } protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); if (mHeaderViewVisible) { drawChild(canvas, mHeaderView, getDrawingTime()); } } public interface OnRefreshListener { void onRefresh(); } public interface HeaderAdapter { int HEADER_GONE = 0; int HEADER_VISIBLE = 1; int HEADER_PUSHED_UP = 2; int getHeaderState(int position); void configureHeader(View header, int position, int alpha); } }
[ "kangsafe@hotmail.com" ]
kangsafe@hotmail.com
51d7a26aabfab43dc49e24040d9a183fceba7501
f37e31c11544c29219d16d1223a7ac2839ac6de9
/app/src/main/java/com/youzi/fastnews/view/BasePopwindow.java
a63c887e642aad6daf8ad563c48db7c7c0e6bdc6
[]
no_license
pekphet/fastnews
8602c2306f0bd70765cef61053ec88169423a7f1
56c66248f82f7f6efe736cfad95c24491cc6c934
refs/heads/master
2021-01-13T03:50:19.585146
2017-01-11T05:30:23
2017-01-11T05:30:34
78,605,901
0
0
null
null
null
null
UTF-8
Java
false
false
3,094
java
package com.youzi.fastnews.view; import android.app.Activity; import android.content.Context; import android.graphics.drawable.ColorDrawable; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.PopupWindow; import android.widget.TextView; import com.youzi.fastnews.R; import java.util.List; /** * Created by ywb on 2016/4/25. */ public class BasePopwindow extends PopupWindow { private Context mContext; private OnPopupwindowClickListener mPopupwindowClickListener; private int mInflateId; private List<String> mDataList; public BasePopwindow(Context context, int inflateId) { mContext = context; mInflateId = inflateId; } public BasePopwindow(Context context, int inflateId, List<String> dataList) { mContext = context; mInflateId = inflateId; mDataList = dataList; } public interface OnPopupwindowClickListener { public void click(); } public void setOnPopupwindowClickListener(OnPopupwindowClickListener popupwindowClickListener) { mPopupwindowClickListener = popupwindowClickListener; } public void showPopWindow(View v) { View view = LayoutInflater.from(mContext).inflate(mInflateId, null, false); final PopupWindow popupWindow = new PopupWindow(view, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); TextView femaleSelected = (TextView) view.findViewById(R.id.complete_iamge); TextView cancelSelected = (TextView) view.findViewById(R.id.image_cancel); femaleSelected.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mPopupwindowClickListener.click(); if (popupWindow.isShowing()) { popupWindow.dismiss(); } } }); cancelSelected.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (popupWindow.isShowing()) { popupWindow.dismiss(); } } }); popupWindow.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss() { // TODO Auto-generated method stub WindowManager.LayoutParams params = ((Activity) mContext).getWindow().getAttributes(); params.alpha = 1f; ((Activity) mContext).getWindow().setAttributes(params); } }); popupWindow.setOutsideTouchable(true); popupWindow.setBackgroundDrawable(new ColorDrawable(0)); popupWindow.setFocusable(true); popupWindow.showAtLocation(v, Gravity.BOTTOM, 0, 0); WindowManager.LayoutParams params = ((Activity) mContext).getWindow().getAttributes(); params.alpha = 0.5f; ((Activity) mContext).getWindow().setAttributes(params); } }
[ "yangwenbin@1.com" ]
yangwenbin@1.com
ae9a17fc22ce4d986fb17f27bcc1de48121c84fb
f729549a273e202c15140d7246c80f31e197c2a4
/app/src/main/java/ru/liveproduction/victoria/view/LogoTextView.java
17d6273c6c84c41f440a6b36b1b520e5d76faa0c
[]
no_license
EdmonDantes/VictoriaAndroid
b5a8338545010de7df1d10ddaf74c8cf529718e1
4d68623a1c41d46ace519a1d448898ae8449ee1e
refs/heads/master
2021-07-24T20:47:53.985707
2020-05-28T22:21:19
2020-05-28T22:21:19
179,774,037
0
0
null
null
null
null
UTF-8
Java
false
false
978
java
package ru.liveproduction.victoria.view; import android.content.Context; import android.graphics.Color; import android.graphics.LinearGradient; import android.graphics.Shader; import android.util.AttributeSet; import android.widget.TextView; public class LogoTextView extends android.support.v7.widget.AppCompatTextView { public LogoTextView(Context context) { super(context); } public LogoTextView(Context context, AttributeSet attrs) { super(context, attrs); } public LogoTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); if (changed) getPaint().setShader(new LinearGradient(0, 0, getWidth(), 0, Color.argb(255, 0,172,219), Color.argb(255, 0, 184, 78), Shader.TileMode.CLAMP)); } }
[ "dantes2104@gmail.com" ]
dantes2104@gmail.com
50ac18c8258eb5a08b4297ffa2d9e36936c582fc
919481c5bae7a6dc9490a3bf2cc9218b296a8e9b
/src/main/java/org/neo4j/sample/domain/User.java
12a7062b3931fae821d4f15151c092b54e0aaaf7
[]
no_license
sarmbruster/unmanaged-extension-archetype
09e79f063e37e2afb228000d5a0fefeabd313fc5
d1b73ae26502b57e5c61ba3d062f5e0b28e3cb28
refs/heads/master
2020-06-08T07:58:46.876409
2015-04-22T05:56:57
2015-04-22T05:56:57
34,371,778
1
0
null
null
null
null
UTF-8
Java
false
false
401
java
package org.neo4j.sample.domain; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class User { String username; public User() { } public User(String username) { this.username = username; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } }
[ "stefan@armbruster-it.de" ]
stefan@armbruster-it.de
67c9b28c7b55d9f88f171d8c0548b0fc932449dd
0b0929f8d3ae40f108c1109fa3fb0055b822ad70
/src/test/java/HorizontalSlider/HorizontalSliderTest.java
e0c43bbc9663ce204d676fe32f567dc5f0696cc0
[]
no_license
EmanHamza21/SeleniumJava
d33912ca433deb6e0b8f2cd94c300572f99cccda
be820b5b0c0d0bb36c7c876f30723b16985fbe26
refs/heads/main
2023-04-15T22:25:40.616947
2021-05-03T00:01:35
2021-05-03T00:01:35
363,661,164
0
0
null
null
null
null
UTF-8
Java
false
false
516
java
package HorizontalSlider; import base.BaseTests; import org.openqa.selenium.Keys; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; public class HorizontalSliderTest extends BaseTests { @Test public void testHorizontalSlider(){ String value = "4"; var HorizontalSliderPage = homePage.clickHorizontalSlider(); HorizontalSliderPage.setSliderValue(value); assertEquals(HorizontalSliderPage.getSliderValue(),value,"incorrect value"); } }
[ "73943197+EmanHamza21@users.noreply.github.com" ]
73943197+EmanHamza21@users.noreply.github.com
41b5fe84bf3e4af682b82624e4274479a4a0f4d3
aaeb3576655cdd8ae05f4119fa458e155f2b6ab1
/src/main/java/com/yimin/easystore/wechat/pojo/WeChatTextMessage.java
c4fc8ec9458d5f4abdc2c1b9b56f993ce6d4278f
[]
no_license
BoyJeffrey/easystore
b99341b897ba675157e254ae634b815a05af689d
6ca4db9f2e86d5c3955a023781ad4de8a8c75644
refs/heads/master
2020-12-30T16:02:40.804607
2017-09-19T08:28:28
2017-09-19T08:28:28
90,955,647
0
0
null
null
null
null
UTF-8
Java
false
false
368
java
package com.yimin.easystore.wechat.pojo; /** * 消息文字 * @author MichaelZhou. */ public class WeChatTextMessage extends WeChatBaseMessage{ // 回复的消息内容 private String Content; public String getContent() { return Content; } public void setContent(String content) { Content = content; } }
[ "yangj517@163.com" ]
yangj517@163.com
d843d2dfec47c8b004ecde3f0e1f783b13bfac99
de3b73d6d4208e9184d0da7f449ad10269dbd5a6
/src/application/MediaBar.java
baf09ef7d9f11bb407c744964e54045fec390c4c
[]
no_license
sokampdx/media_player
799c54742479d3b41be0b0fc5514d8a34a790545
68f0b53bfdd0156da46a4d25b609a1e80594b901
refs/heads/master
2021-04-15T15:29:12.497909
2018-03-29T04:30:42
2018-03-29T04:30:42
126,907,715
0
0
null
null
null
null
UTF-8
Java
false
false
3,423
java
package application; import javafx.application.Platform; import javafx.beans.InvalidationListener; import javafx.beans.Observable; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.Slider; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.media.MediaPlayer; import static javafx.scene.media.MediaPlayer.*; public class MediaBar extends HBox { Slider time = new Slider(); Slider vol = new Slider(); Button playButton = new Button("||"); Label volume = new Label("Volume: "); MediaPlayer player; public MediaBar(MediaPlayer play) { player = play; setup_volume_slider(); setup_player_frame(); build_media_components(); handle_play_button(); handle_playing_time_slider(); handle_seeking_time_slider(); handle_volume_slider(); } private void handle_volume_slider() { vol.valueProperty().addListener(new InvalidationListener() { public void invalidated(Observable observable) { if(vol.isPressed()) { player.setVolume(vol.getValue() / 100); } } }); } private void handle_seeking_time_slider() { time.valueProperty().addListener(new InvalidationListener() { public void invalidated(Observable observable) { if(time.isPressed()) { player.seek(player.getMedia().getDuration().multiply(time.getValue() / 100)); } } }); } private void handle_playing_time_slider() { player.currentTimeProperty().addListener(new InvalidationListener() { public void invalidated(Observable observable) { updateValues(); } }); } protected void updateValues() { Platform.runLater(new Runnable() { public void run() { time.setValue(player.getCurrentTime().toMillis() / player.getTotalDuration().toMillis() * 100); } }); } private void handle_play_button() { playButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { Status status = player.getStatus(); if(status == Status.PLAYING) { handle_playing_status(); } if(is_paused(status)) { start_playing(); } } private boolean is_paused(Status status) { return status == Status.PAUSED || status == Status.HALTED || status == Status.STOPPED; } private void start_playing() { player.play(); playButton.setText("||"); } private void handle_playing_status() { if (player.getCurrentTime().greaterThanOrEqualTo(player.getTotalDuration())) { player.seek(player.getStartTime()); player.play(); } else { player.pause(); playButton.setText(">"); } } }); } private void build_media_components() { getChildren().add(playButton); getChildren().add(time); getChildren().add(volume); getChildren().add(vol); } private void setup_player_frame() { setAlignment(Pos.CENTER); setPadding(new Insets(5, 10, 5, 10)); HBox.setHgrow(time, Priority.ALWAYS); playButton.setPrefWidth(30); } private void setup_volume_slider() { vol.setPrefWidth(70); vol.setMinWidth(30); vol.setValue(100); } }
[ "anthonykpso@gmail.com" ]
anthonykpso@gmail.com
e08d2875427ee43108317e94625dcaa1f58d1b53
56ed712c8a6f6e829074150b0355c42bd187f1a3
/app/src/main/java/constantbeta/com/flashbulbmob/TorchRepeaterActivity.java
2ad047fef69e568fa3830f796289e2639eaa695f
[]
no_license
bigjosh/flashbulbmob-android
050f0fc84649976738b15e33c15d4a83e6d02cc7
8b6429ddc84b6a0d7e0faaf4c6381c9c04303114
refs/heads/master
2021-01-19T07:02:26.895594
2016-04-06T20:06:13
2016-04-06T20:06:13
55,784,991
0
0
null
2016-04-08T14:26:59
2016-04-08T14:26:59
null
UTF-8
Java
false
false
5,883
java
package constantbeta.com.flashbulbmob; import android.content.Context; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class TorchRepeaterActivity extends AppCompatActivity { private static final int MinMillis = 100; private static final int MaxMillis = 5000; private FlashToggler flashToggler; private TorchRepeater torchRepeater; private EditText onMillisEditText; private EditText offMillisEditText; private Button canStartButton; private Button cannotStartButton; private Button stopButton; @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_torch_repeater); setupToolbar(); setupTextInputs(); setupBoundariesLabel(); setupButtons(); } @Override protected void onPause() { super.onPause(); if (torchRepeater != null) { stopPressed(null); } } @Override protected void onStart() { super.onStart(); setupFlashToggler(); } @Override protected void onStop() { super.onStop(); releaseFlashToggler(); } private void setupToolbar() { final Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar); setSupportActionBar(toolbar); } private void setupTextInputs() { onMillisEditText = (EditText) findViewById(R.id.on_millis); onMillisEditText.addTextChangedListener(millisWatcher); offMillisEditText = (EditText) findViewById(R.id.off_millis); offMillisEditText.addTextChangedListener(millisWatcher); } private void setupBoundariesLabel() { TextView boundariesLabel = (TextView) findViewById(R.id.boundaries_label); final String templateText = boundariesLabel.getText().toString(); final String text = templateText.replace("MIN", "" + MinMillis) .replace("MAX", "" + MaxMillis); boundariesLabel.setText(text); } private void setupButtons() { canStartButton = (Button)findViewById(R.id.can_start_button); cannotStartButton = (Button)findViewById(R.id.cannot_start_button); cannotStartButton.setVisibility(View.GONE); stopButton = (Button)findViewById(R.id.stop_button); disableAndHide(stopButton); } private void setupFlashToggler() { try { flashToggler = new FlashTogglerDeprecated(getApplicationContext()); } catch (final Exception e) { // no-op } } private void releaseFlashToggler() { if (flashToggler != null) { flashToggler.destroy(); } } private Integer editTextInt(final EditText editText) { try { return Integer.parseInt(editText.getText().toString().trim()); } catch (Exception e) { return null; } } private Integer onMillis() { return editTextInt(onMillisEditText); } private Integer offMillis() { return editTextInt(offMillisEditText); } private boolean canStart() { return validTime(onMillis()) && validTime(offMillis()); } private boolean validTime(final Integer millis) { return millis != null && millis >= MinMillis && millis <= MaxMillis; } private void disableAndHide(final Button button) { button.setVisibility(View.GONE); button.setEnabled(false); } private void enableAndShow(final Button button) { button.setVisibility(View.VISIBLE); button.setEnabled(true); } private void disableInputs() { onMillisEditText.setEnabled(false); offMillisEditText.setEnabled(false); } private void enableInputs() { onMillisEditText.setEnabled(true); offMillisEditText.setEnabled(true); } public void startPressed(View view) { dismissKeyboard(); disableAndHide(canStartButton); enableAndShow(stopButton); disableInputs(); torchRepeater = new TorchRepeater(flashToggler, onMillis(), offMillis()); torchRepeater.start(); } public void stopPressed(View view) { torchRepeater.stop(); torchRepeater = null; enableInputs(); disableAndHide(stopButton); enableAndShow(canStartButton); } private void dismissKeyboard() { if (getCurrentFocus() != null) { final InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); } } private final TextWatcher millisWatcher = new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { if (canStart()) { cannotStartButton.setVisibility(View.GONE); enableAndShow(canStartButton); } else { disableAndHide(canStartButton); cannotStartButton.setVisibility(View.VISIBLE); } } }; }
[ "steve.goldman@gmail.com" ]
steve.goldman@gmail.com
117cb8feadaa4c9f7f605ddfb8ef4c2e1bcf5ac1
e0c84eb64eabd5955a8219900689b3f8684e54eb
/aula6/AppEscola.java
54aa92cc31fc3458cc3d3b7af78933670c9217bb
[]
no_license
valiche/devturma6B
3c997875096f2b0e72e05da605c5f2d3352b5060
19029593b57bb28597bfb4a403ee71a8617e6711
refs/heads/master
2022-11-28T05:35:33.648185
2020-08-14T20:54:28
2020-08-14T20:54:28
285,620,765
0
1
null
null
null
null
UTF-8
Java
false
false
754
java
public class AppEscola { public static void main(String[] args) { Estudante estudante = new Estudante("Isabele", "Mi Casa", "5555-5555", 987266071, "Java", 2020); //Estudante estudante2 = new Estudante(987267, "DEV", 2022); // System.out.println("Estudante: " + estudante.getNome() + " | RA: " + // estudante.getRa()); Professor professor = new Professor("Emerson", "Su Casa", "5555-0000", "Prof", "Gama", 100000); // System.out.println("Professor: " + professor.getNome() + " | Salário: " + // professor.getSalario()); System.out.println(estudante.exibirDados()); System.out.println(professor.exibirDados()); System.out.println(professor); //usando o toString } }
[ "987266071@itaud.des.ihf" ]
987266071@itaud.des.ihf
d26267c8f495be3a89e25e3b312943e52cf5cb10
6d9036bffaa80874c488b33dc83c96087dfe2dee
/JJB/Processes/DateComparator.java
09a642423470a72e2df563a48532661fbc818c27
[]
no_license
stylesuxx/JJB
8d3c89a72d69c257d63e1566081e34c8b35962a5
bc7a78102e41d19d2628cd671e0032b8c802ce95
refs/heads/master
2020-06-05T04:40:54.551810
2011-12-05T02:50:20
2011-12-05T02:50:20
2,811,679
1
0
null
null
null
null
UTF-8
Java
false
false
715
java
package JJB.Processes; import java.util.Date; import java.util.Map; import java.util.Comparator; /** Date Comparator * * @author stylesuxx * @version 0.1 */ public class DateComparator implements Comparator<String> { private Map<String,Date> base; /** Default Constructor * * @param base (Unordered) Map to look up the values */ public DateComparator( Map<String,Date> base ) { this.base = base; } /** Compare 2 Dates * * @param a String to Date 1 * @param b String to Date 2 * * @return int */ @Override public int compare( String a, String b ){ Date aa = base.get(a); Date bb = base.get(b); return ( aa.compareTo(bb) ); } }
[ "stylesuxx@gmail.com" ]
stylesuxx@gmail.com
bf8202d67db8204bdce6506f2eeda8f8cfc4aa12
3179cdb06637ca100d27272bb76371bff092d4f0
/app/src/main/java/com/example/framgiamaidaidien/mvpexample/ListUserFragment.java
486e82ebb11dfd778b031f31a49ed420475cc473
[]
no_license
luckyluke1994/MVPExample
d078f91139d18ebc2a96e77eba6b1309511ab728
c5bb5fcc097f946add687f6dac6e69a2a923b48c
refs/heads/master
2021-01-13T03:04:57.481376
2016-12-21T04:23:14
2016-12-21T04:23:14
77,017,154
0
0
null
null
null
null
UTF-8
Java
false
false
5,419
java
package com.example.framgiamaidaidien.mvpexample; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ProgressBar; import android.widget.TextView; import com.example.framgiamaidaidien.mvpexample.adapter.ListUserAdapter; import com.example.framgiamaidaidien.mvpexample.model.ListUserHelper; import com.example.framgiamaidaidien.mvpexample.model.User; import com.example.framgiamaidaidien.mvpexample.presenter.ListUserPresenter; import com.example.framgiamaidaidien.mvpexample.view.ListUserView; import java.util.ArrayList; import java.util.List; /** * Created by FRAMGIA\mai.dai.dien on 20/12/2016. */ public class ListUserFragment extends Fragment implements ListUserView, View.OnClickListener{ private static final String EXTRA_USER_LIST = "extra_user_list"; private static final String URL = "https://api.myjson.com/bins/3w62s"; private ArrayList<User> mUserList; private TextView mTVMessage; private ProgressBar mPBLoading; private RecyclerView mRecyclerView; private Button mBTReload; private ListUserAdapter mAdapter; // MVP private ListUserPresenter presenter; private ListUserHelper listUserHelper; public ListUserFragment() { // Required empty public constructor } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); if (savedInstanceState != null) { mUserList = savedInstanceState.getParcelableArrayList(EXTRA_USER_LIST); } if (presenter == null) { Log.d("PJ3", "Presenter Null"); if (listUserHelper == null) listUserHelper = new ListUserHelper(URL); listUserHelper.setList(mUserList); presenter = new ListUserPresenter(this, listUserHelper); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.list_user_fragment, container, false); } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mTVMessage = (TextView) view.findViewById(R.id.message); mPBLoading = (ProgressBar) view.findViewById(R.id.loading); mBTReload = (Button) view.findViewById(R.id.reload); mBTReload.setOnClickListener(this); mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view); mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (presenter != null) presenter.getData(true); // Use cache } @Override public void reload() { mPBLoading.setVisibility(View.VISIBLE); mTVMessage.setVisibility(View.GONE); mBTReload.setVisibility(View.GONE); } @Override public void showNoData() { mPBLoading.setVisibility(View.GONE); mTVMessage.setVisibility(View.VISIBLE); mBTReload.setVisibility(View.VISIBLE); mTVMessage.setText("No Data"); mRecyclerView.setVisibility(View.GONE); } @Override public void showError() { mPBLoading.setVisibility(View.GONE); mTVMessage.setVisibility(View.VISIBLE); mTVMessage.setText("Load Data Error"); mRecyclerView.setVisibility(View.GONE); } @Override public void displayListUser(List<User> listUser) { this.mUserList = (ArrayList<User>) listUser; mPBLoading.setVisibility(View.GONE); mTVMessage.setVisibility(View.GONE); mAdapter = new ListUserAdapter(listUser); mRecyclerView.setAdapter(mAdapter); mRecyclerView.setVisibility(View.VISIBLE); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.reload: presenter.reload(); break; } } @Override public void onPause() { Log.d("PJ3", "On Pause"); super.onPause(); } @Override public void onDestroy() { Log.d("PJ3", "On Destroy"); super.onDestroy(); presenter = null; listUserHelper = null; mAdapter = null; } @Override public void onSaveInstanceState(Bundle outState) { Log.d("PJ3", "On save Instance State"); super.onSaveInstanceState(outState); outState.putParcelableArrayList(EXTRA_USER_LIST, mUserList); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.menu, menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_reload: presenter.getData(false); // Not use cache break; } return super.onOptionsItemSelected(item); } }
[ "mddien1994@gmail.com" ]
mddien1994@gmail.com
3bce0342597ab29624c4e86e578aff7d725a08d9
ff1c74802380bb473fcf8e1b6eab25ae0e178a95
/CashMaсhine_Spring/src/main/java/com/gmail/dmitriy/exceptions/UserExistException.java
4166e84d1b5a64dde0404dde6c110e27ed8914e1
[]
no_license
GorovDimon11/training
bebd806614e9fe7a8f6226d93ad24589f2a4efc5
13f3de67d6113f3bfea5eac6eb86661bb030a57f
refs/heads/master
2022-12-23T23:24:18.576611
2020-02-10T15:13:21
2020-02-10T15:13:21
223,967,426
1
0
null
2022-12-16T05:10:53
2019-11-25T14:26:04
Java
UTF-8
Java
false
false
191
java
package com.gmail.dmitriy.exceptions; public class UserExistException extends Exception { @Override public String getMessage() { return "User is already registered"; } }
[ "dmitriygorovenko11@gmail.com" ]
dmitriygorovenko11@gmail.com
4bfda47f529e0b1e7e7df0f756c075585e9a38b8
d7f724e6b7c792f86ab0d327240ee2de09827c20
/src/part1/lesson26/task01/src/main/java/ru/inno/stc14/entity/Person.java
5f50342a12498b1d2c28de3b60465a1eaff85b98
[]
no_license
salakhov/lessons
d767945aac0f5b405c01a8d412d5f493081e01a8
21d4dcf142c960206ce3726b87ce4ed05ea40571
refs/heads/master
2022-02-20T11:37:25.972116
2019-09-18T16:30:02
2019-09-18T16:30:02
182,580,236
0
0
null
2022-01-21T23:27:51
2019-04-21T20:40:06
JavaScript
UTF-8
Java
false
false
2,162
java
package ru.inno.stc14.entity; import java.util.Objects; /** * Класс человек. Предназначен для хранения объекта с контактными данными */ public class Person implements HomeMember { private int id; private String name; private String birthDate; private String email; private String phone; public Person() { } public Person(String name, String birthDate, String email, String phone) { this.name = name; this.birthDate = birthDate; this.email = email; this.phone = phone; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getBirthDate() { return birthDate; } public void setBirthDate(String birthDate) { this.birthDate = birthDate; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Person person = (Person) o; return id == person.id; } @Override public int hashCode() { return Objects.hash(id); } @Override public String toString() { return "Person{" + "id=" + id + ", name='" + name + '\'' + ", birthDate=" + birthDate + ", email=" + email + ", phone=" + phone + '}'; } /** *Функция возвращает класс животного (разумный для человека с именем, фамилией или не разумный, кличка и имя владельца) */ @Override public String getHomeMemberType() { return "Human"; } }
[ "salahov@primetver.ru" ]
salahov@primetver.ru
b102e46ae87880ae0d74ea8ee523b7ef78ba518b
fdacc8a5f50d8c6e66577b268a629447de31b9ba
/app/src/main/java/com/example/acer/lbsgereja/GpsService.java
80a20d2823402482bbc0cd427077f020365dac46
[]
no_license
Veshine/lbs
58a7ad75fb7bf0088e0bf9dbf53e81ae110f32cd
074fd72acfc669d850dcdf37b763932a14f04cf0
refs/heads/master
2020-04-23T19:55:31.447756
2019-02-19T07:14:20
2019-02-19T07:14:20
171,406,312
0
0
null
null
null
null
UTF-8
Java
false
false
4,244
java
package com.example.acer.lbsgereja; import android.app.AlertDialog; import android.app.Service; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.os.IBinder; import android.provider.Settings; /** * Created Veronika Apriani */ public class GpsService extends Service implements LocationListener { private final Context _context; boolean GPSEnable = false; boolean GetLocation = false; Location location; double lat; double lng; private static final long MIN_JARAK_GPS_UPDATE = 5; private static final long MIN_WAKTU_GPS_UPDATE = 1000 * 60 * 1; protected LocationManager LocationBasedService; public GpsService(Context context) { _context = context; getLocation(); } private Location getLocation() { try { LocationBasedService = (LocationManager) _context.getSystemService(LOCATION_SERVICE); GPSEnable = LocationBasedService.isProviderEnabled(LocationManager.GPS_PROVIDER); if (!GPSEnable) { // tidak ada koneksi ke GPS dan Jaringan } else { GetLocation = true; if (GPSEnable) { if (location == null){ LocationBasedService.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_WAKTU_GPS_UPDATE,MIN_JARAK_GPS_UPDATE, this); if (LocationBasedService != null) { location = LocationBasedService.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (location != null) { lat = location.getLatitude(); lng = location.getLongitude(); }}}} } } catch (Exception e) { e.printStackTrace(); } return location; } @Override public void onLocationChanged(Location location) { // TODO Auto-generated method stub } @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } @Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } @Override public IBinder onBind(Intent intent) { // TODO Auto-generated method stub return null; } public double getLatitude() { if (location != null) lat = location.getLatitude(); return lat; } public void setLatitude(double lat) { this.lat = lat; } public double getLongitude() { if (location != null) lng = location.getLongitude(); return lng; } public void setLongitude(double lng) { this.lng = lng; } public boolean GetLocation() { return this.GetLocation; } public void showSettingAlert() { AlertDialog.Builder alertDialog = new AlertDialog.Builder(_context); alertDialog.setTitle("GPS Setting"); alertDialog.setMessage("GPS tidak aktif. Mau masuk ke setting Menu?"); alertDialog.setPositiveButton("Setting", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); _context.startActivity(intent); } }); alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); alertDialog.show(); } public void stopUsingGPS() { if (LocationBasedService != null) LocationBasedService.removeUpdates(GpsService.this); } }
[ "veronikaapriani.shine@gmail,com" ]
veronikaapriani.shine@gmail,com
b957e5a7786ef66d052f7f48a470b41ee1c0cb99
58417a458f922317d0b35b57597a82a198bc4351
/api/src/main/java/net/luckperms/api/cacheddata/CachedDataManager.java
91682fd423f42e3d94665e2f78d9a60153be2bb6
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
LuckPerms/LuckPerms
72358e677669fd767b2ac24ca7483f828e93e000
f12d3cd8ba47fb0d25f7c13e1f3a89d770bd34a6
refs/heads/master
2023-08-15T01:31:25.175005
2023-08-05T09:49:57
2023-08-05T09:49:57
59,388,335
601
247
MIT
2023-09-05T08:59:16
2016-05-22T00:49:12
Java
UTF-8
Java
false
false
9,729
java
/* * This file is part of LuckPerms, licensed under the MIT License. * * Copyright (c) lucko (Luck) <luck@lucko.me> * Copyright (c) contributors * * 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 net.luckperms.api.cacheddata; import net.luckperms.api.context.ContextManager; import net.luckperms.api.model.PermissionHolder; import net.luckperms.api.model.group.Group; import net.luckperms.api.model.user.User; import net.luckperms.api.query.QueryOptions; import org.checkerframework.checker.nullness.qual.NonNull; import java.util.concurrent.CompletableFuture; /** * Holds cached permission and meta lookup data for a {@link PermissionHolder}. * * <p>All calls will account for inheritance, as well as any default data * provided by the platform. These calls are heavily cached and are therefore * fast.</p> */ public interface CachedDataManager { /** * Gets the manager for {@link CachedPermissionData}. * * @return the permission data manager */ @NonNull Container<CachedPermissionData> permissionData(); /** * Gets the manager for {@link CachedMetaData}. * * @return the meta data manager */ @NonNull Container<CachedMetaData> metaData(); /** * Gets PermissionData from the cache, using the given query options. * * @param queryOptions the query options * @return a permission data instance */ @NonNull CachedPermissionData getPermissionData(@NonNull QueryOptions queryOptions); /** * Gets MetaData from the cache, using the given query options. * * @param queryOptions the query options * @return a meta data instance */ @NonNull CachedMetaData getMetaData(@NonNull QueryOptions queryOptions); /** * Gets PermissionData from the cache, using the most appropriate query options * available at the time. * * <p>For {@link User}s, the most appropriate query options will be their * {@link ContextManager#getQueryOptions(User) current active query options} if the * corresponding player is online, and otherwise, will fallback to * {@link ContextManager#getStaticQueryOptions() the current static query options}.</p> * * <p>For {@link Group}s, the most appropriate query options will always be * {@link ContextManager#getStaticQueryOptions() the current static query options}.</p> * * @return a permission data instance * @since 5.1 */ @NonNull CachedPermissionData getPermissionData(); /** * Gets MetaData from the cache, using the most appropriate query options * available at the time. * * <p>For {@link User}s, the most appropriate query options will be their * {@link ContextManager#getQueryOptions(User) current active query options} if the * corresponding player is online, and otherwise, will fallback to * {@link ContextManager#getStaticQueryOptions() the current static query options}.</p> * * <p>For {@link Group}s, the most appropriate query options will always be * {@link ContextManager#getStaticQueryOptions() the current static query options}.</p> * * @return a meta data instance * @since 5.1 * @see PermissionHolder#getQueryOptions() */ @NonNull CachedMetaData getMetaData(); /** * Invalidates all cached {@link CachedPermissionData} and {@link CachedMetaData} * instances. */ void invalidate(); /** * Invalidates all underlying permission calculators. * * <p>Can be called to allow for an update in defaults.</p> */ void invalidatePermissionCalculators(); /** * Manages a specific type of {@link CachedData cached data} within * a {@link CachedDataManager} instance. * * @param <T> the data type */ interface Container<T extends CachedData> { /** * Gets {@link T data} from the cache. * * @param queryOptions the query options * @return a data instance * @throws NullPointerException if contexts is null */ @NonNull T get(@NonNull QueryOptions queryOptions); /** * Calculates {@link T data}, bypassing the cache. * * <p>The result of this operation is calculated each time the method is called. * The result is not added to the internal cache.</p> * * <p>It is therefore highly recommended to use {@link #get(QueryOptions)} instead.</p> * * <p>The use cases of this method are more around constructing one-time * instances of {@link T data}, without adding the result to the cache.</p> * * @param queryOptions the query options * @return a data instance * @throws NullPointerException if contexts is null */ @NonNull T calculate(@NonNull QueryOptions queryOptions); /** * (Re)calculates data for a given context. * * <p>This method returns immediately in all cases. The (re)calculation is * performed asynchronously and applied to the cache in the background.</p> * * <p>If there was a previous data instance associated with * the given {@link QueryOptions}, then that instance will continue to be returned by * {@link #get(QueryOptions)} until the recalculation is completed.</p> * * <p>If there was no value calculated and cached prior to the call of this * method, then one will be calculated.</p> * * @param queryOptions the query options * @throws NullPointerException if contexts is null */ void recalculate(@NonNull QueryOptions queryOptions); /** * (Re)loads permission data for a given context. * * <p>Unlike {@link #recalculate(QueryOptions)}, this method immediately * invalidates any previous data values contained within the cache, * and then schedules a task to reload a new data instance to * replace the one which was invalidated.</p> * * <p>The invalidation happens immediately during the execution of this method. * The result of the re-computation encapsulated by the future.</p> * * <p>Subsequent calls to {@link #get(QueryOptions)} will block until * the result of this operation is complete.</p> * * <p>If there was no value calculated and cached prior to the call of this * method, then one will be calculated.</p> * * <p>This method returns a Future so users can optionally choose to wait * until the recalculation has been performed.</p> * * @param queryOptions the query options. * @return a future * @throws NullPointerException if contexts is null */ @NonNull CompletableFuture<? extends T> reload(@NonNull QueryOptions queryOptions); /** * Recalculates data for all known contexts. * * <p>This method returns immediately. The recalculation is performed * asynchronously and applied to the cache in the background.</p> * * <p>The previous data instances will continue to be returned * by {@link #get(QueryOptions)} until the recalculation is completed.</p> */ void recalculate(); /** * Reloads permission data for all known contexts. * * <p>Unlike {@link #recalculate()}, this method immediately * invalidates all previous data values contained within the cache, * and then schedules a task to reload new data instances to * replace the ones which were invalidated.</p> * * <p>The invalidation happens immediately during the execution of this method. * The result of the re-computation encapsulated by the future.</p> * * <p>Subsequent calls to {@link #get(QueryOptions)} will block until * the result of this operation is complete.</p> * * <p>This method returns a Future so users can optionally choose to wait * until the recalculation has been performed.</p> * * @return a future */ @NonNull CompletableFuture<Void> reload(); /** * Invalidates any cached data instances mapped to the given context. * * @param queryOptions the queryOptions to invalidate for */ void invalidate(@NonNull QueryOptions queryOptions); /** * Invalidates all cached data instances. */ void invalidate(); } }
[ "git@lucko.me" ]
git@lucko.me
eec7ce779df810fcbda897465141a53640cce751
3b5e232a9a31e5bac7264b18fb8f413ed6b9700b
/src/com/realityinteractive/imageio/tga/TGAImageMetadata.java
10c4e157c390d342334ba90e55f5b4252c2c4d5e
[]
no_license
Andreas-W/ParticleEditor
96fa9fa5b5f60a91ef1eb65624ee206cb57dcb56
3902437d3928430615032a8378bdebdb43b6e8e7
refs/heads/master
2021-01-23T04:40:54.424874
2017-09-21T13:51:07
2017-09-21T13:51:07
80,370,644
2
0
null
null
null
null
UTF-8
Java
false
false
4,747
java
package com.realityinteractive.imageio.tga; /* * TGAImageMetadata.java * Copyright (c) 2003 Reality Interactive, Inc. * See bottom of file for license and warranty information. * Created on Sep 27, 2003 */ import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.metadata.IIOMetadata; import javax.imageio.metadata.IIOMetadataFormat; import javax.imageio.metadata.IIOMetadataNode; import org.w3c.dom.Node; /** * <p>The image metadata for a TGA image type. At this time there are no * elements in the format (i.e. {@link javax.imageio.metadata.IIOMetadataFormat#canNodeAppear(java.lang.String, javax.imageio.ImageTypeSpecifier)} * always returns <code>false</code>).</p> * * @author Rob Grzywinski <a href="mailto:rgrzywinski@realityinteractive.com">rgrzywinski@realityinteractive.com</a> * @version $Id: TGAImageMetadata.java,v 1.1 2005/04/12 11:23:53 ornedan Exp $ * @since 1.0 */ // NOTE: this is currently unused public class TGAImageMetadata extends IIOMetadata { // ========================================================================= /** * @see javax.imageio.metadata.IIOMetadata#IIOMetadata() */ public TGAImageMetadata() { super(TGAImageReaderSpi.SUPPORTS_STANDARD_IMAGE_METADATA_FORMAT, TGAImageReaderSpi.NATIVE_IMAGE_METADATA_FORMAT_NAME, TGAImageReaderSpi.NATIVE_IMAGE_METADATA_FORMAT_CLASSNAME, TGAImageReaderSpi.EXTRA_IMAGE_METADATA_FORMAT_NAMES, TGAImageReaderSpi.EXTRA_IMAGE_METADATA_FORMAT_CLASSNAMES); } /** * <p>Ensure that the specified format name is supported by this metadata. * If the format is not supported {@link java.lang.IllegalArgumentException} * is thrown.</p> * * @param formatName the name of the metadata format that is to be validated */ private void checkFormatName(final String formatName) { // if the format name is not known, throw an exception if(!TGAImageReaderSpi.NATIVE_IMAGE_METADATA_FORMAT_NAME.equals(formatName)) { throw new IllegalArgumentException("Unknown image metadata format name \"" + formatName + "\"."); // FIXME: localize } /* else -- the format name is valid */ } /** * @see javax.imageio.metadata.IIOMetadata#getAsTree(java.lang.String) */ public Node getAsTree(final String formatName) { // validate the format name (this will throw if invalid) checkFormatName(formatName); // create and return a root node // NOTE: there are no children at this time final IIOMetadataNode root = new IIOMetadataNode(TGAImageReaderSpi.NATIVE_IMAGE_METADATA_FORMAT_NAME); return root; } /** * @see javax.imageio.metadata.IIOMetadata#getMetadataFormat(java.lang.String) */ public IIOMetadataFormat getMetadataFormat(final String formatName) { // validate the format name (this will throw if invalid) checkFormatName(formatName); // return the metadata format return TGAImageMetadataFormat.getInstance(); } /** * <p>This is read-only metadata.</p> * * @see javax.imageio.metadata.IIOMetadata#isReadOnly() */ public boolean isReadOnly() { // see javadoc return true; } /** * @see javax.imageio.metadata.IIOMetadata#mergeTree(java.lang.String, org.w3c.dom.Node) */ public void mergeTree(final String formatName, final Node root) throws IIOInvalidTreeException { // validate the format name (this will throw if invalid) checkFormatName(formatName); // since there are no elements in the tree, there is nothing to merge } /** * @see javax.imageio.metadata.IIOMetadata#reset() */ public void reset() { // NOTE: nothing to do since there are no elements } } // ============================================================================= /* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
[ "andreas-winkler@hotmail.com" ]
andreas-winkler@hotmail.com
144a359afc34a29e7bd424252f0b814b4a75114a
af8bb2ad079069eb0f2fd6c853310ca975e4d0fa
/CrowdfundingProject/crowdfunding07-member-parent/crowdfunding09-member-entity/src/main/java/com/jager/crowd/entity/po/ProjectItemPicPOExample.java
5d4f272a54d43cd350f03865d4fa9d81861b3a84
[]
no_license
jager123/Project
3fd88b8d20f56720cdd6ddce397f7389b4eecfbb
bb7f07bd8caadef8bed5fe7a836bba3fe263445a
refs/heads/master
2023-04-18T21:54:57.234181
2021-05-09T07:46:33
2021-05-09T07:46:33
365,691,920
0
0
null
null
null
null
UTF-8
Java
false
false
11,612
java
package com.jager.crowd.entity.po; import java.util.ArrayList; import java.util.List; public class ProjectItemPicPOExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public ProjectItemPicPOExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Integer value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Integer value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andProjectidIsNull() { addCriterion("projectid is null"); return (Criteria) this; } public Criteria andProjectidIsNotNull() { addCriterion("projectid is not null"); return (Criteria) this; } public Criteria andProjectidEqualTo(Integer value) { addCriterion("projectid =", value, "projectid"); return (Criteria) this; } public Criteria andProjectidNotEqualTo(Integer value) { addCriterion("projectid <>", value, "projectid"); return (Criteria) this; } public Criteria andProjectidGreaterThan(Integer value) { addCriterion("projectid >", value, "projectid"); return (Criteria) this; } public Criteria andProjectidGreaterThanOrEqualTo(Integer value) { addCriterion("projectid >=", value, "projectid"); return (Criteria) this; } public Criteria andProjectidLessThan(Integer value) { addCriterion("projectid <", value, "projectid"); return (Criteria) this; } public Criteria andProjectidLessThanOrEqualTo(Integer value) { addCriterion("projectid <=", value, "projectid"); return (Criteria) this; } public Criteria andProjectidIn(List<Integer> values) { addCriterion("projectid in", values, "projectid"); return (Criteria) this; } public Criteria andProjectidNotIn(List<Integer> values) { addCriterion("projectid not in", values, "projectid"); return (Criteria) this; } public Criteria andProjectidBetween(Integer value1, Integer value2) { addCriterion("projectid between", value1, value2, "projectid"); return (Criteria) this; } public Criteria andProjectidNotBetween(Integer value1, Integer value2) { addCriterion("projectid not between", value1, value2, "projectid"); return (Criteria) this; } public Criteria andItemPicPathIsNull() { addCriterion("item_pic_path is null"); return (Criteria) this; } public Criteria andItemPicPathIsNotNull() { addCriterion("item_pic_path is not null"); return (Criteria) this; } public Criteria andItemPicPathEqualTo(String value) { addCriterion("item_pic_path =", value, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathNotEqualTo(String value) { addCriterion("item_pic_path <>", value, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathGreaterThan(String value) { addCriterion("item_pic_path >", value, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathGreaterThanOrEqualTo(String value) { addCriterion("item_pic_path >=", value, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathLessThan(String value) { addCriterion("item_pic_path <", value, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathLessThanOrEqualTo(String value) { addCriterion("item_pic_path <=", value, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathLike(String value) { addCriterion("item_pic_path like", value, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathNotLike(String value) { addCriterion("item_pic_path not like", value, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathIn(List<String> values) { addCriterion("item_pic_path in", values, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathNotIn(List<String> values) { addCriterion("item_pic_path not in", values, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathBetween(String value1, String value2) { addCriterion("item_pic_path between", value1, value2, "itemPicPath"); return (Criteria) this; } public Criteria andItemPicPathNotBetween(String value1, String value2) { addCriterion("item_pic_path not between", value1, value2, "itemPicPath"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "1776152540@qq.com" ]
1776152540@qq.com
66cb45da4567296aa0eb8d3e20a33daeadc8d8b8
202a26eb0d15fbaec9aec32bad77d2c19304432f
/src/Operation/$_LoginAccount.java
dfcba73d498fd78a79c293f9932c0c09b21820f1
[]
no_license
YAMMEN10/HelloTalkServer
6220457732f19af582173ddf4318fece2394446d
703dfbf43799930feb6597c03ef75e9337df2253
refs/heads/master
2020-05-24T12:37:08.276190
2019-05-17T19:37:35
2019-05-17T19:37:35
187,271,801
0
0
null
null
null
null
UTF-8
Java
false
false
913
java
package Operation; import Information.$_AccountInformationById; import JSONData.*; import Room.$_Client; import Tools.$_Client_File; import java.util.List; public class $_LoginAccount extends $_AccountOperation { @Override public List<$_JSON> excuteOperation() { $_JSON_login signIn_json=($_JSON_login)my_json; String id = signIn_json.getIdFrom() ; $_Client_File cl_file = new $_Client_File() ; if(cl_file.isExist(id)) { $_JSON_Login_Successful signIn_successful = new $_JSON_Login_Successful("Login_User_Successful",id,true) ; list_my_json.add(signIn_successful) ; return list_my_json ; }else{ $_JSON_Login_Successful signIn_successful = new $_JSON_Login_Successful("Login_User_Successful",id,false) ; list_my_json.add(signIn_successful) ; return list_my_json ; } } }
[ "YAMMEN.githup98@gmail.com" ]
YAMMEN.githup98@gmail.com
cbe27fc47fa33692af4177d88d04d4a805f6d185
8ca8f9ddfa24ca13a1a610a63e1abbd63f2ce068
/src/api/java/baubles/api/package-info.java
0052d2ab56030f15e9c74e798d29706d6c9901e0
[ "MIT" ]
permissive
Yopu/OpenGrave
3652faa84e7ed0c6739d225c3c218f8a93f6d6e0
121f75a0c36e1d81c63dc0854bb2cbcc07bb8248
refs/heads/master
2023-08-09T18:47:02.409779
2018-08-07T13:00:33
2018-08-07T13:00:33
29,886,003
7
4
MIT
2023-08-01T03:59:58
2015-01-26T22:52:14
Kotlin
UTF-8
Java
false
false
139
java
@API(owner = "Baubles", apiVersion = "1.4.0.2", provides = "Baubles|API") package baubles.api; import net.minecraftforge.fml.common.API;
[ "yopu42@gmail.com" ]
yopu42@gmail.com
17bc351ed149bf87cb5111fb29f437f61194dbd8
c644f61b184d7564b8a6803e41d3ae282bb0d6d0
/store-product/store-product-facade/src/main/java/store/product/common/enums/ProductRecommendTypeEnum.java
e9e3fbb1a8383f7a060f0f4e3561a5276e7214a0
[]
no_license
KurisMakise/v-store
63bb92e12f911f64ebfe16eb3dd7643d6265ab01
badb83610c5da9fb8fc87e90540c627ba8a504b3
refs/heads/master
2021-10-28T03:42:34.729284
2019-04-21T15:44:35
2019-04-21T15:44:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
715
java
package store.product.common.enums; /** * @author violet * @since 2019/3/15 */ public enum ProductRecommendTypeEnum { STAR(1L, "明星产品", "star"), POPULAR(2L, "为你推荐", "popular"), COMMENT(3L, "热评产品", "comment"), NEW(4L, "新品推荐", "new"); private long type; private String typeInfo; private String code; ProductRecommendTypeEnum(long type, String typeInfo, String code) { this.type = type; this.typeInfo = typeInfo; this.code = code; } public long getType() { return type; } public String getTypeInfo() { return typeInfo; } public String getCode() { return code; } }
[ "569252295@qq.com" ]
569252295@qq.com
ae127dcaf5864fb13492973ca45735b3aac406ae
03fd0ce0bae64069dd3c7972d0a56b19170b837a
/Marvin/src/main/java/kutch/biff/marvin/widget/LineChartWidget.java
c7ab9c9e45ccd9e0728b0433c49880c3fec42710
[ "Apache-2.0" ]
permissive
CRY-D/Board-Instrumentation-Framework
1681090855c4980711127ed1e867cc95b7ac7662
5689bde340f0d28cceef6474f795267df724b5fe
refs/heads/master
2022-01-09T10:22:25.949718
2019-05-28T18:46:18
2019-05-28T18:46:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,793
java
/* * ############################################################################## * # Copyright (c) 2016 Intel Corporation * # * # 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. * ############################################################################## * # File Abstract: * # * # * ############################################################################## */ package kutch.biff.marvin.widget; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.scene.chart.XYChart; import javafx.scene.layout.GridPane; import kutch.biff.marvin.datamanager.DataManager; import kutch.biff.marvin.utility.FrameworkNode; import kutch.biff.marvin.utility.SeriesDataSet; /** * * @author Patrick Kutch */ public class LineChartWidget extends LineChartWidget_MS { @Override @SuppressWarnings("unchecked") public boolean Create(GridPane pane, DataManager dataMgr) { SetParent(pane); if (getSeries().isEmpty()) { if (getyAxisMaxCount() > 0) { for (int iLoop = 0; iLoop < getyAxisMaxCount(); iLoop++) { SeriesDataSet objDS = new SeriesDataSet(Integer.toString(iLoop), "", ""); getSeries().add(objDS); } } else { LOGGER.severe("Chart created with no series defined and no count defined for yAxis"); return false; } } _CreateChart(); ConfigureDimentions(); ConfigureAlignment(); SetupPeekaboo(dataMgr); pane.add(getChart(), getColumn(), getRow(), getColumnSpan(), getRowSpan()); //hmm, only get called if different, that could be a problem for a chart dataMgr.AddListener(getMinionID(), getNamespace(), new ChangeListener() { @Override @SuppressWarnings("unchecked") public void changed(ObservableValue o, Object oldVal, Object newVal) { if (IsPaused()) { return; } String[] strList = newVal.toString().split(","); int iIndex = 0; for (String strValue : strList) { double newValue; try { newValue = Double.parseDouble(strValue); HandleSteppedRange(newValue); } catch (NumberFormatException ex) { LOGGER.severe("Invalid data for Line Chart received: " + strValue); return; } if (iIndex < getSeries().size()) { SeriesDataSet ds = getSeries().get(iIndex++); ShiftSeries(ds.getSeries(), getxAxisMaxCount()); ds.getSeries().getData().add(new XYChart.Data<>(ds.getSeries().getData().size(), newValue)); } else { LOGGER.severe("Received More datapoints for Line Chart than was defined in application definition file. Received " + Integer.toString(strList.length) + " expecting " + Integer.toString(getSeries().size())); return; } } } }); SetupTaskAction(); return ApplyCSS(); } /** * * @param node * @return */ @Override public boolean HandleWidgetSpecificSettings(FrameworkNode node) { if (true == HandleChartSpecificAppSettings(node)) { return true; } if (node.getNodeName().equalsIgnoreCase("Series")) { String Label; if (node.hasAttribute("Label")) { Label = node.getAttribute("Label"); } else { Label = ""; } SeriesDataSet objDS = new SeriesDataSet(Label, "", ""); getSeries().add(objDS); return true; } return false; } }
[ "Patrick.Kutch@gmail.com" ]
Patrick.Kutch@gmail.com
57e515691b300f79068dd58dfdb050ecead4ae7b
09620c6a06bd3dfb1237f8ff1d2fc190092a9f69
/WikiSims-1.2/src/similarity/TermFrequency.java
604d8541ca99baa8abb54eca27ed46c2b00a4c38
[]
no_license
ThomasDavine/WikiSims
2dfbb066dec36920c7ffdc65af6a6470fe9f3686
1c278006078ce96d8b88909b7346f4d6af0caea6
refs/heads/master
2016-09-06T17:42:58.018782
2014-01-20T09:42:12
2014-01-20T09:42:12
16,065,811
0
1
null
null
null
null
UTF-8
Java
false
false
1,092
java
package similarity; import java.util.ArrayList; import java.util.HashMap; import org.apache.commons.collections.Bag; import org.apache.commons.collections.bag.HashBag; /** Class to build the Term -Frequency vector * here implemented as a HashMap<type,frequency> * * @author tommaso * */ public class TermFrequency { private ArrayList<String> tokens = new ArrayList<String>(); private HashMap<String,Integer> frequencyVector = new HashMap<String,Integer>(); public TermFrequency(ArrayList<String> tokens) { this.tokens=tokens; setFrequencyVector(); } private void setFrequencyVector(){ //store tokens in a Bag in order to use the bag method getCount() Bag bag = getWordFrequencies(tokens); for(Object str : bag.uniqueSet().toArray()){ frequencyVector.put((String) str, bag.getCount(str)); } } public HashMap<String,Integer> getFrequencyVector(){ return frequencyVector; } private Bag getWordFrequencies(ArrayList<String> tokens) { Bag wordBag = new HashBag(); for(String token : tokens){ wordBag.add(token); } return wordBag; } }
[ "tommaso.moretti@gmail.com" ]
tommaso.moretti@gmail.com
fa6a6c6c3136dbb3eb50b2305396642d44faf777
31ba94f20aab2a144b67a2239b71d0a5e71b77d2
/src/main/java/com/epam/se2/lesson16/RecursiveGenericsExample.java
6ce224d2da822576669f4de342bf698969a8685f
[]
no_license
elefus/epam-devops-09-2017
f61e92fce85746f8dc3cbdb72095cdd3cefe1bb9
706b68cf4d3eb9732d2ca24f5e9345a7b7707c51
refs/heads/master
2021-08-29T23:49:36.078982
2017-12-15T09:59:45
2017-12-15T09:59:45
105,904,169
3
0
null
null
null
null
UTF-8
Java
false
false
257
java
package com.epam.se2.lesson16; public class RecursiveGenericsExample { public static void main(String[] args) { // list.add(1).add(2).add(5); GenericArrayList<Integer> arrayList = null; arrayList.add(1).add(2).add(5); } }
[ "elefus@yandex.ru" ]
elefus@yandex.ru
e0df0463b9fd9517dee455b6d338e96dd9acf84a
bce0c2c6d876e3161f39cd803404578182f7bdac
/src/main/java/kr/or/dgit/bigdata/diet/dto/Post.java
ba083e694636a11eb11406df92d245814854fcfe
[]
no_license
DaeguIT-MinSuKim/bigdata_1st
6ddc09a5e2643a6a9322c5e8bab334d6c6f9d511
fddcbe285278ba35ea8d5bb25084cb95ccaa14ae
refs/heads/master
2021-01-12T04:19:37.246803
2017-07-07T18:24:20
2017-07-07T18:24:20
77,586,922
0
0
null
null
null
null
UTF-8
Java
false
false
1,671
java
package kr.or.dgit.bigdata.diet.dto; public class Post { private String zipcode; private String sido; private String sigungu; private String doro; private int building1; private int building2; public Post() {} public Post(String sido) { this.sido = sido; } public Post(String sido, String doro) { this.sido = sido; this.doro = doro; } public Post(String zipcode, String sido, String sigungu, String doro, int building1, int building2) { this.zipcode = zipcode; this.sido = sido; this.sigungu = sigungu; this.doro = doro; this.building1 = building1; this.building2 = building2; } public String getZipcode() { return zipcode; } public void setZipcode(String zipcode) { this.zipcode = zipcode; } public String getSido() { return sido; } public void setSido(String sido) { this.sido = sido; } public String getSigungu() { return sigungu; } public void setSigungu(String sigungu) { this.sigungu = sigungu; } public String getDoro() { return doro; } public void setDoro(String doro) { this.doro = doro; } public int getBuilding1() { return building1; } public void setBuilding1(int building1) { this.building1 = building1; } public int getBuilding2() { return building2; } public void setBuilding2(int building2) { this.building2 = building2; } @Override public String toString() { return String.format("%s", sido); } public String[] toArray(){ String addr = String.format("%s %s %s %s%s", sido, sigungu, doro, building1, building2==0?"":"-"+building2); return new String[]{zipcode, addr}; } }
[ "bomiisworldstar@gmail.com" ]
bomiisworldstar@gmail.com
c1db8debaffe88045450087118c99b76ba982903
60b07a35482878f244ad01e3945cc079675c5b1c
/gmall-api/src/main/java/com/atguigu/gmall/oms/entity/OrderItem.java
3988be8392354470348b366efada6d03c3725fa5
[]
no_license
cloudxm888/gmall
827b571037fd44fa230ca8cacb9371a9f7be3b64
2b8567aec413e566520319bfe0d9a2c1ce7d23cc
refs/heads/master
2022-07-04T17:15:09.899966
2019-12-28T04:31:36
2019-12-28T04:31:36
230,556,831
0
0
null
2022-06-21T02:31:50
2019-12-28T04:14:06
Java
UTF-8
Java
false
false
3,236
java
package com.atguigu.gmall.oms.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.io.Serializable; import java.math.BigDecimal; /** * <p> * 订单中所包含的商品 * </p> * * @author Lfy * @since 2019-05-08 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("oms_order_item") @ApiModel(value="OrderItem对象", description="订单中所包含的商品") public class OrderItem implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty(value = "订单id") @TableField("order_id") private Long orderId; @ApiModelProperty(value = "订单编号") @TableField("order_sn") private String orderSn; @TableField("product_id") private Long productId; @TableField("product_pic") private String productPic; @TableField("product_name") private String productName; @TableField("product_brand") private String productBrand; @TableField("product_sn") private String productSn; @ApiModelProperty(value = "销售价格") @TableField("product_price") private BigDecimal productPrice; @ApiModelProperty(value = "购买数量") @TableField("product_quantity") private Integer productQuantity; @ApiModelProperty(value = "商品sku编号") @TableField("product_sku_id") private Long productSkuId; @ApiModelProperty(value = "商品sku条码") @TableField("product_sku_code") private String productSkuCode; @ApiModelProperty(value = "商品分类id") @TableField("product_category_id") private Long productCategoryId; @ApiModelProperty(value = "商品的销售属性") @TableField("sp1") private String sp1; @TableField("sp2") private String sp2; @TableField("sp3") private String sp3; @ApiModelProperty(value = "商品促销名称") @TableField("promotion_name") private String promotionName; @ApiModelProperty(value = "商品促销分解金额") @TableField("promotion_amount") private BigDecimal promotionAmount; @ApiModelProperty(value = "优惠券优惠分解金额") @TableField("coupon_amount") private BigDecimal couponAmount; @ApiModelProperty(value = "积分优惠分解金额") @TableField("integration_amount") private BigDecimal integrationAmount; @ApiModelProperty(value = "该商品经过优惠后的分解金额") @TableField("real_amount") private BigDecimal realAmount; @TableField("gift_integration") private Integer giftIntegration; @TableField("gift_growth") private Integer giftGrowth; // @ApiModelProperty(value = "商品销售属性:[{"key":"颜色","value":"颜色"},{"key":"容量","value":"4G"}]") @TableField("product_attr") private String productAttr; }
[ "cloudxm888@163.com" ]
cloudxm888@163.com
763c633af155ae7606e109a80e38ead0610d5777
c5fba7a58a05e86e6d85ace3809852c9953e77c8
/app/src/main/java/com/example/david/proyectowms/Prueba.java
8552d8500cedbd4d59f2891fb40b9c4ab04da7c2
[]
no_license
drivera9/triziocomandroid
671f7c9e3710b976f3769e26876ae33afcf175a9
37c58524eaa463dac710fd36833cb2e3be74fa5b
refs/heads/master
2021-01-13T03:00:36.691688
2016-12-21T15:20:00
2016-12-21T15:20:00
58,573,451
0
0
null
null
null
null
UTF-8
Java
false
false
2,232
java
package com.example.david.proyectowms; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.GridView; import android.widget.SimpleAdapter; public class Prueba extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_prueba); GridView gridview = (GridView) findViewById(R.id.gridView5);// crear el // gridview a partir del elemento del xml gridview String[] mercado = new String[15]; for (int i =0;i<mercado.length-1;i++){ mercado[i] = i + "-------------------- " + i; System.out.println(mercado[i]); } ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(),R.layout.activity_prueba,mercado); // Getting a reference to gridview of MainActivity GridView gridView = (GridView) findViewById(R.id.gridView11); // Setting an adapter containing images to the gridview gridView.setAdapter(adapter); gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_prueba, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "davidrivera0218@gmail.com" ]
davidrivera0218@gmail.com
d40b478d540eb92bbc8b2d1458eb380ccd102331
f55740d354098ef66436b0b42e3301823152f90d
/test/org/telegram/ui/Adapters/BaseLocationAdapter.java
37eb671a939b92f959a3f146e706f1ac16d94c3a
[]
no_license
life-of-kar/Techgif
3de6719bd824aba41104104ffb1823ffb7ead652
64267640c5b48c5c515056822ab9b4469756bb1d
refs/heads/master
2020-08-03T18:09:28.700147
2016-11-11T13:34:47
2016-11-11T13:34:47
73,539,775
2
0
null
2016-11-12T07:58:57
2016-11-12T07:58:56
null
UTF-8
Java
false
false
9,515
java
package org.telegram.ui.Adapters; import android.location.Location; import java.net.URLEncoder; import java.util.ArrayList; import java.util.Locale; import java.util.Timer; import java.util.TimerTask; import org.json.JSONArray; import org.json.JSONObject; import org.telegram.messenger.AndroidUtilities; import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.BuildVars; import org.telegram.messenger.FileLog; import org.telegram.messenger.exoplayer.C0747C; import org.telegram.messenger.volley.RequestQueue; import org.telegram.messenger.volley.Response.ErrorListener; import org.telegram.messenger.volley.Response.Listener; import org.telegram.messenger.volley.VolleyError; import org.telegram.messenger.volley.toolbox.JsonObjectRequest; import org.telegram.messenger.volley.toolbox.Volley; import org.telegram.tgnet.TLRPC.TL_geoPoint; import org.telegram.tgnet.TLRPC.TL_messageMediaVenue; public class BaseLocationAdapter extends BaseFragmentAdapter { private BaseLocationAdapterDelegate delegate; protected ArrayList<String> iconUrls; private Location lastSearchLocation; protected ArrayList<TL_messageMediaVenue> places; private RequestQueue requestQueue; private Timer searchTimer; protected boolean searching; /* renamed from: org.telegram.ui.Adapters.BaseLocationAdapter.1 */ class C09171 extends TimerTask { final /* synthetic */ Location val$coordinate; final /* synthetic */ String val$query; /* renamed from: org.telegram.ui.Adapters.BaseLocationAdapter.1.1 */ class C09161 implements Runnable { C09161() { } public void run() { BaseLocationAdapter.this.lastSearchLocation = null; BaseLocationAdapter.this.searchGooglePlacesWithQuery(C09171.this.val$query, C09171.this.val$coordinate); } } C09171(String str, Location location) { this.val$query = str; this.val$coordinate = location; } public void run() { try { BaseLocationAdapter.this.searchTimer.cancel(); BaseLocationAdapter.this.searchTimer = null; } catch (Throwable e) { FileLog.m13e("tmessages", e); } AndroidUtilities.runOnUIThread(new C09161()); } } public interface BaseLocationAdapterDelegate { void didLoadedSearchResult(ArrayList<TL_messageMediaVenue> arrayList); } /* renamed from: org.telegram.ui.Adapters.BaseLocationAdapter.2 */ class C17492 implements Listener<JSONObject> { C17492() { } public void onResponse(JSONObject response) { try { BaseLocationAdapter.this.places.clear(); BaseLocationAdapter.this.iconUrls.clear(); JSONArray result = response.getJSONObject("response").getJSONArray("venues"); for (int a = 0; a < result.length(); a++) { try { Object[] objArr; JSONObject object = result.getJSONObject(a); String iconUrl = null; if (object.has("categories")) { JSONArray categories = object.getJSONArray("categories"); if (categories.length() > 0) { JSONObject category = categories.getJSONObject(0); if (category.has("icon")) { JSONObject icon = category.getJSONObject("icon"); objArr = new Object[2]; objArr[0] = icon.getString("prefix"); objArr[1] = icon.getString("suffix"); iconUrl = String.format(Locale.US, "%s64%s", objArr); } } } BaseLocationAdapter.this.iconUrls.add(iconUrl); JSONObject location = object.getJSONObject("location"); TL_messageMediaVenue venue = new TL_messageMediaVenue(); venue.geo = new TL_geoPoint(); venue.geo.lat = location.getDouble("lat"); venue.geo._long = location.getDouble("lng"); if (location.has("address")) { venue.address = location.getString("address"); } else if (location.has("city")) { venue.address = location.getString("city"); } else if (location.has("state")) { venue.address = location.getString("state"); } else if (location.has("country")) { venue.address = location.getString("country"); } else { objArr = new Object[2]; objArr[0] = Double.valueOf(venue.geo.lat); objArr[1] = Double.valueOf(venue.geo._long); venue.address = String.format(Locale.US, "%f,%f", objArr); } if (object.has("name")) { venue.title = object.getString("name"); } venue.venue_id = object.getString(TtmlNode.ATTR_ID); venue.provider = "foursquare"; BaseLocationAdapter.this.places.add(venue); } catch (Throwable e) { FileLog.m13e("tmessages", e); } } } catch (Throwable e2) { FileLog.m13e("tmessages", e2); } BaseLocationAdapter.this.searching = false; BaseLocationAdapter.this.notifyDataSetChanged(); if (BaseLocationAdapter.this.delegate != null) { BaseLocationAdapter.this.delegate.didLoadedSearchResult(BaseLocationAdapter.this.places); } } } /* renamed from: org.telegram.ui.Adapters.BaseLocationAdapter.3 */ class C17503 implements ErrorListener { C17503() { } public void onErrorResponse(VolleyError error) { FileLog.m11e("tmessages", "Error: " + error.getMessage()); BaseLocationAdapter.this.searching = false; BaseLocationAdapter.this.notifyDataSetChanged(); if (BaseLocationAdapter.this.delegate != null) { BaseLocationAdapter.this.delegate.didLoadedSearchResult(BaseLocationAdapter.this.places); } } } public BaseLocationAdapter() { this.places = new ArrayList(); this.iconUrls = new ArrayList(); this.requestQueue = Volley.newRequestQueue(ApplicationLoader.applicationContext); } public void destroy() { if (this.requestQueue != null) { this.requestQueue.cancelAll((Object) "search"); this.requestQueue.stop(); } } public void setDelegate(BaseLocationAdapterDelegate delegate) { this.delegate = delegate; } public void searchDelayed(String query, Location coordinate) { if (query == null || query.length() == 0) { this.places.clear(); notifyDataSetChanged(); return; } try { if (this.searchTimer != null) { this.searchTimer.cancel(); } } catch (Throwable e) { FileLog.m13e("tmessages", e); } this.searchTimer = new Timer(); this.searchTimer.schedule(new C09171(query, coordinate), 200, 500); } public void searchGooglePlacesWithQuery(String query, Location coordinate) { if (this.lastSearchLocation != null) { if (coordinate.distanceTo(this.lastSearchLocation) < 200.0f) { return; } } this.lastSearchLocation = coordinate; if (this.searching) { this.searching = false; this.requestQueue.cancelAll((Object) "search"); } try { this.searching = true; Object[] objArr = new Object[4]; objArr[0] = BuildVars.FOURSQUARE_API_VERSION; objArr[1] = BuildVars.FOURSQUARE_API_ID; objArr[2] = BuildVars.FOURSQUARE_API_KEY; objArr[3] = String.format(Locale.US, "%f,%f", new Object[]{Double.valueOf(coordinate.getLatitude()), Double.valueOf(coordinate.getLongitude())}); String url = String.format(Locale.US, "https://api.foursquare.com/v2/venues/search/?v=%s&locale=en&limit=25&client_id=%s&client_secret=%s&ll=%s", objArr); if (query != null && query.length() > 0) { url = url + "&query=" + URLEncoder.encode(query, C0747C.UTF8_NAME); } JsonObjectRequest jsonObjReq = new JsonObjectRequest(0, url, null, new C17492(), new C17503()); jsonObjReq.setShouldCache(false); jsonObjReq.setTag("search"); this.requestQueue.add(jsonObjReq); } catch (Throwable e) { FileLog.m13e("tmessages", e); this.searching = false; if (this.delegate != null) { this.delegate.didLoadedSearchResult(this.places); } } notifyDataSetChanged(); } }
[ "sureshrajpurohit@live.in" ]
sureshrajpurohit@live.in
15dbc08a2c39d1e405f4705a0ccfbdad660bfd9d
a72b22a06b68c1e0f48d10301025b2f5ba1b2660
/Cuckoo raven/Back end/server2/Logo.java
8835fb63839ef14a07b3ea33aa7f88805d2a6a27
[]
no_license
Gokul-nAth/My-projects
8b3d04d28bd19d05a6ca5b9eef2769ab60f14a54
84e95af6c1a547374cac3786c54b887277b46a91
refs/heads/main
2023-03-30T21:59:49.673083
2021-03-23T12:01:34
2021-03-23T12:01:34
329,320,237
0
0
null
null
null
null
UTF-8
Java
false
false
1,395
java
package server2; import java.io.IOException; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; 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.servlet.http.HttpSession; import Reuseable.Reuse; @WebServlet("/checkauthstatus") public class Logo extends HttpServlet{ @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Reuse.getInstance().addHeaders(response); try { PreparedStatement ps=Reuse.getInstance().getConnection().prepareStatement("select `Logo`,`Name`,`AccountType` from `users` where `Id`=?"); ps.setString(1,Reuse.getInstance().tokenHeader(request)); ResultSet rs=ps.executeQuery(); rs.next(); Map<String,Object> map=new HashMap<String,Object>(); if(!rs.getString(1).equals("") || rs.getString(1)!=null){ map.put("logo",rs.getString(1)); } else { map.put("logo",null); } map.put("userName", rs.getString(2)); map.put("userType", rs.getString(3)); response.getWriter().print(Reuse.getInstance().mapToJsonParse(map)); } catch(Exception e) { e.printStackTrace(); } } }
[ "77395399+Gokul-nAth@users.noreply.github.com" ]
77395399+Gokul-nAth@users.noreply.github.com
ec2da44e83795252910d82aa9b68bc4e97761c9e
2c5bd8860db9a7f07f07c7fdc69f550b7daeb7fa
/YTO20120103/src/cn/net/yto/ui/ReceiveMenuActivity.java
f266d3b8dac494d40be1e35d28d4c1b158571a48
[]
no_license
kit-team/xuebao
0f2a88ee34c397012a495d1c553615cc7b99e9cd
a77d9724a6c15d7352d1a484c146cad746b51d70
refs/heads/master
2021-01-20T02:15:29.527890
2013-01-09T12:02:11
2013-01-09T12:02:11
7,308,701
0
1
null
null
null
null
UTF-8
Java
false
false
4,572
java
package cn.net.yto.ui; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Handler; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.AdapterView.OnItemClickListener; import android.widget.GridView; import cn.net.yto.R; import cn.net.yto.biz.UserManager; import cn.net.yto.ui.menu.ListMenuItemAdapter; import cn.net.yto.ui.menu.MenuAction; import cn.net.yto.ui.menu.MenuItem; import cn.net.yto.ui.menu.GridMenuItemAdapter; public class ReceiveMenuActivity extends BaseActivity { private static final String TAG = "ReceiveMenuActivity"; private ListView mListView; private ArrayList<MenuItem> mMenuItemList = new ArrayList<MenuItem>(); private UserManager mUserService; private TextView mTitleView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initContext(); initMenuItem(); initViews(); } @Override protected void onStart() { super.onStart(); setTitleInfo(R.string.receive); } @Override protected void onDestroy() { super.onDestroy(); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { boolean result = true; switch (keyCode) { case KeyEvent.KEYCODE_BACK: case KeyEvent.KEYCODE_STAR: returnBack(); break; // case 29:// F1 // CommonUtils.startWifiSettingActivity(mContext); // break; case KeyEvent.KEYCODE_1: case KeyEvent.KEYCODE_2: case KeyEvent.KEYCODE_3: case KeyEvent.KEYCODE_4: case KeyEvent.KEYCODE_5: case KeyEvent.KEYCODE_6: case KeyEvent.KEYCODE_7: case KeyEvent.KEYCODE_8: case KeyEvent.KEYCODE_9: int index = keyCode - KeyEvent.KEYCODE_1; if (index >= 0 && index < mMenuItemList.size()) { mMenuItemList.get(index).doAction(); } break; default: result = false; break; } if (result) { return true; } return super.onKeyDown(keyCode, event); } private void initViews() { requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.activity_list_menu); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title); setTitleInfo(R.string.main_menu); mListView = (ListView) findViewById(R.id.list); mListView.setAdapter(new ListMenuItemAdapter(this, mMenuItemList)); mListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id) { mMenuItemList.get(position).doAction(); } }); } private void initMenuItem() { addMenuItem(R.drawable.receive_order, R.string.receive_order, OrderTabActivity.class); // addMenuItem(R.drawable.receive_no_order, R.string.receive_no_order, ReceiveNoOrderTabActivity.class); addMenuItem(R.drawable.receive_no_order, R.string.receive_no_order, ReceiveExpressPageActivity.class); addMenuItem(R.drawable.receive_batch, R.string.receive_batch, ReceiveBatchActivity.class); addMenuItem(R.drawable.receive_no_order_unusaul, R.string.receive_no_order_unusaul, ReceiveNoOrderUnusualActivity.class); addMenuItem(R.drawable.receive_cancel_replace, R.string.receive_cancel_replace, ReceiveWayBillTabActivity.class); addMenuItem(R.drawable.receive_view, R.string.receive_view, ReceiveViewTabActivity.class); addReturnMenuItem(R.drawable.return_back, R.string.back); } private void addMenuItem(int imgResId, int textResId, final Class<? extends Activity> cls) { MenuAction action = new MenuAction() { @Override public void action() { if(cls != null){ Intent intent = new Intent(mContext, cls); startActivity(intent); } } }; MenuItem item = new MenuItem(imgResId, textResId, action); mMenuItemList.add(item); } private void addReturnMenuItem(int imgResId, int textResId) { MenuAction action = new MenuAction() { @Override public void action() { returnBack(); } }; MenuItem item = new MenuItem(imgResId, textResId, action); mMenuItemList.add(item); } private void initContext() { mUserService = mAppContext.getUserService(); } protected void returnBack() { finish(); } }
[ "timlian@yeah.net" ]
timlian@yeah.net
571697e1c5452929026147b08848a4d6f4d7683c
e34190c4ae4348a5604a67db0595de7fd878ba16
/FirstProject/src/main/java/edu/htu/excption_handleing/ImplmentCaculateSalary.java
61d2bef8d6a39681a76d4a6f091a25c6746b4b1b
[]
no_license
Ezzideen/UpSkilling-Java
d2d3d7a37dc2475efeaab1b01e09fa1631a2eb6a
57443b88cbf07470df32c5567cdfd8b4ba6dccbf
refs/heads/master
2023-03-01T10:34:23.472304
2021-02-09T22:43:45
2021-02-09T22:43:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
209
java
package edu.htu.excption_handleing; public class ImplmentCaculateSalary implements CaculateSalary { @Override public void calculateemployeeSalary() { System.out.println("calculateemployeeSalary"); } }
[ "mbaj2888@gmail.com" ]
mbaj2888@gmail.com
b1c8aa2fd1ee4968d06588263de7fcbe0bbf026a
8e80074a2cbcfe06a3024a3e9532190aaec906f9
/src/main/java/com/hfmes/sunshine/cache/CountNumsCache.java
acaa2aa02dcb8df6bf608e4fda4e97c6217e4fa8
[]
no_license
Rikhard-Dong/sunshine
adda2550b6f63afbb7dac3392ee2abce3a7df481
5a5ac48dcb88f55c8cf34c52539d3f24fbd6d70a
refs/heads/master
2020-03-25T18:19:57.710290
2018-08-21T01:01:05
2018-08-21T01:01:05
144,024,941
1
0
null
null
null
null
UTF-8
Java
false
false
1,251
java
package com.hfmes.sunshine.cache; import com.hfmes.sunshine.dao.DevcDao; import com.hfmes.sunshine.domain.Devc; import lombok.extern.slf4j.Slf4j; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * @author supreDong@gmail.com * @date 2018/8/16 17:23 * <p> * 记录设备对应生产数量 * key device id value count 统计生产数量 */ @Slf4j public class CountNumsCache { private static Map<Integer, Integer> cache; private CountNumsCache() { } public static void init(DevcDao devcDao) { log.info("初始化统计数量缓存..."); cache = new ConcurrentHashMap<>(); List<Devc> devcList = devcDao.findAll(); if (devcList.size() > 0) { for (Devc devc : devcList) { cache.put(devc.getDeviceId(), 0); } } else { log.warn("警告 --> 初始化countNumsCache, 当前没有设备数据"); } } public static void put(Integer devcId, Integer counts) { cache.put(devcId, counts); } public static Integer get(Integer devcId) { return cache.get(devcId); } public static void remove(Integer devcId) { cache.remove(devcId); } }
[ "supreDong@gmail.com" ]
supreDong@gmail.com
f924f61865a865baf08c6713ed3651c17c3f84bb
5d95a895d641fef5076d56f4364c30e64fcf44fb
/Estructura de Datos/DiccionarioArbol/Base.java
bc7470bcb097b43fd26db82cced6c7460305e7b7
[]
no_license
Pankecho/Java
f169d9b3ea6bf9eee60f85ff02fa02d81aec67ff
495a461e4590863bd16214b1a9d694e34d00b14b
refs/heads/master
2021-01-18T21:43:26.259337
2017-12-21T04:30:27
2017-12-21T04:30:27
46,466,999
0
0
null
null
null
null
UTF-8
Java
false
false
1,938
java
import java.util.*; import java.io.*; /** * Write a description of class Base here. * * @author (your name) * @version (a version number or a date) */ public class Base { private ArrayList <String> palabrasEspañol; private ArrayList <String> palabrasZapoteco; private ArrayList <String> palabrasMixteco; public Base(){ palabrasEspañol = new ArrayList <String>(); palabrasZapoteco = new ArrayList <String>(); palabrasMixteco = new ArrayList <String>(); } public void llenarEspañol(){ try{ FileReader reader = new FileReader("Palabras Español.txt"); BufferedReader br = new BufferedReader(reader); String linea; while((linea = br.readLine()) != null){ palabrasEspañol.add(linea); } reader.close(); }catch(Exception e){ } } public void llenarMixteco(){ try{ FileReader reader = new FileReader("Palabras Mixteco.txt"); BufferedReader br = new BufferedReader(reader); String linea; while((linea = br.readLine()) != null){ palabrasMixteco.add(linea); } reader.close(); }catch(Exception e){ } } public void llenarZapoteco(){ try{ FileReader reader = new FileReader("Palabras Zapoteco.txt"); BufferedReader br = new BufferedReader(reader); String linea; while((linea = br.readLine()) != null){ palabrasZapoteco.add(linea); } reader.close(); }catch(Exception e){ } } public ArrayList getEspañol(){ return palabrasEspañol; } public ArrayList getMixteco(){ return palabrasMixteco; } public ArrayList getZapoteco(){ return palabrasZapoteco; } }
[ "esponja.014@gmail.com" ]
esponja.014@gmail.com
5371a8a055ce96047c74037a38fdfbb644c7dc6f
27f65daf5b374e49661aa9b9d5ddf884ada72c1e
/src/main/java/com/graviton/lambda/calendar/db/DBMgr.java
2df480b4b21ecaf8b5b249b821dcd91848ce73d3
[]
no_license
SixingYan/Calendar-Management-System-G
fe3faa7d20b7bc3ae23e718aa9c8432a0f1e11fe
54580eeacc90b0dda8292354d991ede4b2f79b40
refs/heads/master
2020-04-03T18:22:46.455203
2018-12-11T23:00:05
2018-12-11T23:00:05
155,481,486
0
0
null
null
null
null
UTF-8
Java
false
false
5,888
java
package com.graviton.lambda.calendar.db; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import com.graviton.lambda.calendar.model.*; /** * Use as, * <code> * import com.graviton.lambda.calendar.db.DBMgr; * DBMgr db = new DBMgr(); * ArrayList<Calendar> calendars = db.doSAC(); // show all calendars * </code> * DBMgr only has one change to call any of functions, * after calling, it will turn down the connection. * This URL is a <B>free</B> test cluster provided by MongoDB using MongoDB Atlas. * @author Jack Sixing Yan */ public class DBMgr { private DAO dao; public DBMgr () { this.dao = new DAO(); } public DBMgr (String url, String database) { this.dao = new DAO(url, database); } /** * Show All Calendars * @return */ public ArrayList<Calendar> doSAC () { ArrayList<Calendar> m = dao.findCalendars(); this.dao.close(); return m; } /** * Create Personal Calendar * @return */ public boolean doCPC (Calendar cld) { dao.addCalendar(cld.name, cld.startDate, cld.endDate, cld.earlyTime, cld.lateTime, cld.duration); this.dao.close(); return true; } /** * Load Personal Calendar * @return */ public ArrayList<Calendar> doLPC (String name) { ArrayList<Calendar> m = dao.findCalendar(name); this.dao.close(); return m; } /** * Show Daily Schedule * @return */ public ArrayList<Meeting> doSDS (PresentCalendarDaily obj) { ArrayList<Meeting> ms = dao.findMeetings(obj.name, obj.date); this.dao.close(); return ms; } /** * Show Monthly Schedule * @return */ public ArrayList<Meeting> doSMS (PresentCalendarMonthly obj) { ArrayList<Meeting> ms = dao.findMeetings(obj.name, obj.year, obj.month); this.dao.close(); return ms; } /** * Schedule Meeting * @return */ public boolean doSM (Meeting mt) { Calendar c; // check calendar if (dao.findCalendar(mt.name).isEmpty()) return false; else c = dao.findCalendar(mt.name).get(0); // check basic time range if (c.removeDay.contains(mt.date)) return false; if (!inDate(c.startDate, c.endDate, mt.date) & !c.addDay.contains(mt.date)) return false; if (!inTime(c.earlyTime, c.lateTime, mt.time)) return false; // check closed timeslot ArrayList<TimeSlot> closedTS = dao.findClosedTimeSlot(mt.name); for (TimeSlot cts : closedTS) if (!isAllowed (cts, mt)) return false; // add it this.dao.addMeeting(mt.name, mt.date, mt.time, mt.people, mt.location); this.dao.close(); return true; } private boolean isAllowed (TimeSlot cts, Meeting mt) { if (!isNull(cts.date)) { if (!isNull(cts.fromTime) & !isNull(cts.toTime)) if (!isNull(cts.dow)) return !(inDate(cts.date, mt.date) & inTime(cts.fromTime,cts.toTime, mt.time) & inDow(cts.dow, mt.date)); else return !(inDate(cts.date, mt.date) & inTime(cts.fromTime,cts.toTime, mt.time)); else return !inDate(cts.date, mt.date); } else { if (!isNull(cts.fromTime) & !isNull(cts.toTime)) if (!isNull(cts.dow)) return !(inTime(cts.fromTime,cts.toTime, mt.time) & inDow(cts.dow, mt.date)); else return !inTime(cts.fromTime,cts.toTime, mt.time); else return !inDow(cts.dow, mt.date); } } private boolean inDate (int cdate, int date) { if (cdate == date) return true; return false; } private boolean inDate (int fromDate, int toDate, int date) { if (fromDate <= date & toDate >= date) return true; return false; } private boolean isNull (int val) { return val == -1; } private boolean inTime(int fromTime, int toTime, int time) { if (fromTime <= time & toTime >= time) return true; return false; } private boolean inDow(int cdow, int date) { return cdow == getDow (date); } private int getDow (int date) { java.util.Calendar cld = java.util.Calendar.getInstance(); try { Date datet = new SimpleDateFormat("yyyyMMdd").parse(String.valueOf(date)); cld.setTime(datet); } catch (ParseException e) { ; } int dow = cld.get(java.util.Calendar.DAY_OF_WEEK) - 1; // 指示一个星期中的某天。 if (dow < 0) dow = 7; return dow; } /** * Close Existing Meeting * @return */ public boolean doCEM (SelectMeeting obj) { this.dao.deleteMeeting(obj.name, obj.date, obj.time); this.dao.close(); return true; } /** * Delete Personal Calendar * @return */ public boolean doDPC (String name) { this.dao.deleteCalendar(name); this.dao.close(); return true; } /** * Add Day * @return */ public boolean doADC (String name, int date) { Calendar c = dao.findCalendar(name).get(0); if (c.removeDay.contains(date)) c.removeDay.remove(date); if (!c.addDay.contains(date)) c.addDay.add(date); this.dao.updateCalendar(name, c.addDay, null); this.dao.updateCalendar(name, null, c.removeDay); this.dao.close(); return true; } /** * Remove Day * @return */ public boolean doRDC (String name, int date) { Calendar c = dao.findCalendar(name).get(0); if (!c.removeDay.contains(date)) c.removeDay.add(date); if (c.addDay.contains(date)) c.addDay.remove(date); this.dao.updateCalendar(name, c.addDay, null); this.dao.updateCalendar(name, null, c.removeDay); this.dao.close(); return true; } /** * Close TimeSlot. * @return */ public boolean doCT (String name, int date, int dow, int fromTime, int toTime) { // check whether it exist if (this.dao.findCalendar(name).isEmpty()) return false; // this.dao.addClosedTimeSlot(name, date, dow, fromTime, toTime); this.dao.close(); return true; } /** * Close Exist Meeting * @return */ public boolean doCEM (String name, int date, int time) { this.dao.deleteMeeting(name, date, time); this.dao.close(); return true; } }
[ "plutoyem@outlook.com" ]
plutoyem@outlook.com
7bfa2645c0499ce6f30bf945cd98e49241d445a4
0aa35a61fe889833ef03f7bfa9f13a5e4bf98d64
/src/main/java/com/qjy/open/service/sys/LogService.java
b95a43386b097fba8ece9e098f54e81f94c7888f
[]
no_license
qianjyjava/openSourceUtil
e63765ec5dd3b519c0653c67b6497fa0ec64f8da
dcaee1943cf364fe50da0533096ef7a791a8924e
refs/heads/master
2020-04-06T04:43:54.958630
2017-02-23T06:47:20
2017-02-23T06:47:20
82,894,277
0
0
null
null
null
null
UTF-8
Java
false
false
129
java
package com.qjy.open.service.sys; import com.qjy.open.entity.sys.Log; public interface LogService { int insert(Log record); }
[ "qianjyjava@163.com" ]
qianjyjava@163.com