blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
6a78912c6081ce560eecb607efaa77a022aa8f69
5ffb589448461cecb35dedd83ccf3ea969ead039
/src/main/java/com/upgrad/bookmyconsultation/repository/AppointmentRepository.java
43c998b9485d7b266c42e8b5f1ed8a16b993a0b1
[]
no_license
jain-rishabh966/bookmyconsultation
96634461c0ec262367c0a2b23355fab7e249e684
d06137b1290497f1a6bd93a432ab9f039a736def
refs/heads/master
2023-08-10T18:46:37.006771
2021-09-28T18:37:58
2021-09-28T18:37:58
401,070,440
0
1
null
null
null
null
UTF-8
Java
false
false
525
java
package com.upgrad.bookmyconsultation.repository; import com.upgrad.bookmyconsultation.entity.Appointment; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface AppointmentRepository extends CrudRepository<Appointment, String> { public List<Appointment> findByUserId(String userId); public Appointment findByDoctorIdAndTimeSlotAndAppointmentDate(String doctorId, String timeSlot, String appointmentDate); }
[ "jain.rishabh966@gmail.com" ]
jain.rishabh966@gmail.com
f668b6038df41443b90f3c5e28193eb553d11129
75caf72af15d8c315aae27636f59f44c61d15e0b
/src/main/java/com/ymkj/analysis/service/IntelligentAnalysisService.java
9903d53bc814d2604ac5f1f165152a01f2afb937
[]
no_license
taohuanting/analysis
0a34e9d23d0946a41489fe79d19b80d3c39a547d
e5cb3c9d122e21a4f6d2380ba43aba570abcc73f
refs/heads/master
2023-02-17T22:31:44.879446
2021-01-14T03:30:25
2021-01-14T03:30:25
327,474,585
0
0
null
null
null
null
UTF-8
Java
false
false
783
java
package com.ymkj.analysis.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ymkj.analysis.entity.domain.BaseNetPrice; import com.ymkj.analysis.entity.dto.*; import com.ymkj.analysis.entity.query.AnalysisQuery; import com.ymkj.analysis.entity.query.BaseQuery; import java.util.List; import java.util.Map; /** * 网价管理业务接口 * * @author tao */ public interface IntelligentAnalysisService { Page<NetPriceMaterial> getMaterialList(BaseQuery query); List<String> getManufacturerList(String cityName); BaseNetPrice getNetPriceByMaterialAndDate(AnalysisQuery query); List<BaseNetPrice> getOtherNetPriceByMaterial(AnalysisQuery query); Map<String, SameManufacturerNetPriceDTO> compare(AnalysisQuery query); }
[ "19983541949@163.com" ]
19983541949@163.com
82acbb197f69dab24c307d221961e7f0e4db48fe
6f0e29c0685ed9a8cdad10230d83e84cfad5bf5d
/springbootshirodemo/src/main/java/com/fang/service/impl/UserInfoServiceImpl.java
2ee7531cd9ac135d8b7995fcfb81a0221bfff369
[]
no_license
10wjfang/spring-boot-demo
2a8acddd007b7666e56260185cd121f11574585e
a1c40d720df4b3f310f486485ec075b8cbf7d988
refs/heads/master
2020-04-07T01:43:36.177546
2019-02-15T14:31:21
2019-02-15T14:31:21
157,949,669
1
2
null
null
null
null
UTF-8
Java
false
false
865
java
package com.fang.service.impl; import com.fang.dao.UserInfoDao; import com.fang.entity.UserInfo; import com.fang.service.UserInfoService; import org.springframework.stereotype.Service; import javax.annotation.Resource; /** * @Author: fwj * @Description: * @Date: Created in 2018/4/26 11:42 * @Modified by: */ @Service public class UserInfoServiceImpl implements UserInfoService { @Resource private UserInfoDao userInfoDao; @Override public UserInfo findByUsername(String username) { System.out.println("UserInfoServiceImpl.findByUsername"); return userInfoDao.findByUsername(username); } @Override public boolean save(UserInfo userInfo) { UserInfo result = userInfoDao.save(userInfo); System.out.println(result); if (result != null) return true; return false; } }
[ "10wjfang@stu.edu.cn" ]
10wjfang@stu.edu.cn
d7a27721a87b5258ed6d16501f7f504ace745ac4
eb16c6da12ca0f4551aa6113879f02f8d49508fa
/src/main/java/com/fja/po/User.java
3daa180286030f7809241babc51e68ae4f14d577
[]
no_license
fujingoa/A2GitHub
e75a1e526336750b074a47169fdeb64795cb1676
ab6f974ca3d5a48ed821499dbf65f55ce875cf79
refs/heads/master
2022-12-22T16:00:43.480145
2020-10-01T04:05:40
2020-10-01T04:05:40
300,137,136
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package com.fja.po; /** * @author ${fujingao} * @create 2020-10-01-8:49 */ public class User { private int idd; private String name; public User() { } public User(String name) { this.name = name; } public User(int id, String name) { this.idd = id; this.name = name; } @Override public String toString() { return "User{" + "id=" + idd + ", name='" + name + '\'' + '}'; } public int getId() { return idd; } public void setId(int id) { this.idd = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "2965311728@qq.com" ]
2965311728@qq.com
1f936049432a2927d619ff57f44b9cd2c436297b
90121b449cc47e33b297b6f9dda9444ec641406c
/workspace/jmdata-biservice/.svn/pristine/c2/c226a288adc4bc556637c262dad5b41eeffe1ea7.svn-base
452a3d81d30675137544998e90dccbc8f24a7513
[]
no_license
luosong33/git
0e6a0d899907c898a2676af87c4f51379978f6e7
7adf9d5cb9363fa4b85cdf6d92f2c02b022a5e91
refs/heads/master
2021-01-20T02:42:24.350595
2017-07-11T16:31:11
2017-07-11T16:31:11
89,442,631
0
0
null
null
null
null
UTF-8
Java
false
false
967
package org.jumao.bi.dao; import java.util.List; import org.apache.hadoop.hbase.util.Bytes; import org.jumao.commons.frameworks.jmframework.commutil.MRConstants; import org.jumao.commons.frameworks.jmframework.hbaseutil.dao.IHBaseDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; @Repository public class CommonDaoImpl { @Autowired public IHBaseDao hbasedao; @Autowired public JdbcTemplate jdbcTemplate; public static final String User_Loginout_Tab = "jmbi:userTraces"; public static final byte[] Column_Family_Name = Bytes.toBytes(MRConstants.TAB_CF); public <T> List<T> getSqlResult(String sql, Class<T> clazz) { List<T> result = jdbcTemplate.query(sql, new BeanPropertyRowMapper<T>(clazz)); return result; } }
[ "luosong3345@gmail.com" ]
luosong3345@gmail.com
a45f658b2511fa76c8990d2322dd587bdd58ad00
70eb3dc982bb052cf77c58c1ccfe8cf6e1ccd224
/src/Chapter_6_Methods/Ex_6_23.java
211c729a027e6367279026798c193196221837b7
[ "MIT" ]
permissive
RAstardzhiev/Java-Book-Exercises
c30b20b07ae014352a7cf3a495f1ff28e3af7753
054f72b2c3870828045eada86227b5c81f68db1d
refs/heads/master
2021-01-11T18:51:52.411264
2017-01-21T17:16:03
2017-01-21T17:16:03
79,642,113
1
0
null
null
null
null
UTF-8
Java
false
false
438
java
package Chapter_6; import java.util.Scanner; public class Ex_6_23 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a text: "); String s = input.nextLine(); System.out.print("Enter a Symbol: "); char c = input.next().charAt(0); System.out.println("Symbol " + c + " is found in your text " + Chapter6Methods.count(s, c)); } }
[ "freeccqeb@gmail.com" ]
freeccqeb@gmail.com
3b25c305b7ba1ea2312eed12a2804239fdb86e80
b9ac9c37f4dd454e4671f4423ff6188e225fcaf1
/cas-overlay-template/src/main/java/com/yale/sso/handler/CustomQueryDatabaseAuthenticationHandler.java
7742c8d7fcd0e21e694fa765e69c5c7b84d9a457
[]
no_license
qiuxuky/sso
1720d3a7f02c59cf6a1157fa25f5a46e806e3c9b
535b5592ed6589f2fc744b3726c7725114caccd9
refs/heads/master
2020-03-21T19:37:30.964196
2018-06-28T03:23:46
2018-06-28T03:23:46
138,960,478
2
0
null
null
null
null
UTF-8
Java
false
false
3,007
java
package com.yale.sso.handler; import java.security.GeneralSecurityException; import javax.security.auth.login.AccountNotFoundException; import javax.security.auth.login.FailedLoginException; import javax.sql.DataSource; import javax.validation.constraints.NotNull; import org.jasig.cas.adaptors.jdbc.AbstractJdbcUsernamePasswordAuthenticationHandler; import org.jasig.cas.authentication.HandlerResult; import org.jasig.cas.authentication.PreventedException; import org.jasig.cas.authentication.UsernamePasswordCredential; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.dao.DataAccessException; import org.springframework.dao.IncorrectResultSizeDataAccessException; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.stereotype.Component; import com.yale.sso.crypto.CustomPasswordEncoder; import com.yale.sso.model.SysUser; @Component("customQueryDatabaseAuthenticationHandler") public class CustomQueryDatabaseAuthenticationHandler extends AbstractJdbcUsernamePasswordAuthenticationHandler { @NotNull private String sql; @Autowired private CustomPasswordEncoder customPasswordEncoder; @Override protected HandlerResult authenticateUsernamePasswordInternal(UsernamePasswordCredential credential) throws GeneralSecurityException, PreventedException { final String id = getPrincipalNameTransformer().transform(credential.getUsername()); final String password = credential.getPassword(); try { SysUser user = getJdbcTemplate().queryForObject(this.sql, new Object[]{id,id,id}, new BeanPropertyRowMapper<SysUser>(SysUser.class)); if (user == null) { throw new AccountNotFoundException(id + " not found with SQL query"); } String pwd = user.getPassword(); //用户名作为盐 String salt=user.getUserName(); final String encryptedPassword = customPasswordEncoder.encode(password,salt); if (!pwd.equals(encryptedPassword)) { throw new FailedLoginException("Password does not match value on record."); } } catch (final IncorrectResultSizeDataAccessException e) { if (e.getActualSize() == 0) { throw new AccountNotFoundException(id + " not found with SQL query"); } else { throw new FailedLoginException("Multiple records found for " + id); } } catch (final DataAccessException e) { throw new PreventedException("SQL exception while executing query for " + id, e); } return createHandlerResult(credential, this.principalFactory.createPrincipal(id), null); } /** * @param sql: The sql to set. */ @Autowired public void setSql(@Value("${cas.jdbc.authn.query.sql:}") final String sql){ this.sql = sql; } @Override @Autowired(required = false) public void setDataSource(@Qualifier("queryDatabaseDataSource") final DataSource dataSource){ super.setDataSource(dataSource); } }
[ "775469137@qq.com" ]
775469137@qq.com
64bc0585b76bf4e97c852b839c56faffe2889f21
d7cbba61b2d7609697c37787476cd0230b59d5ba
/src/java/com/br/dao/Locacao_acessorioPO.java
0be059beb5776bd9c333b06d62e4e10591a3c8cc
[]
no_license
WellingtonCaetano/marvwel
fb00b4caee7259067017e7cdb513446270de6316
1094e8139373e59afa2c7829858daf93e3bcf135
refs/heads/master
2021-08-19T15:00:22.874836
2017-11-26T19:58:26
2017-11-26T19:58:26
112,091,580
0
0
null
null
null
null
UTF-8
Java
false
false
3,553
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.br.dao; import com.br.TO.EntidadeApoioTO.Locacao_acessorioTO; import com.br.TO.EntidadeApoioTO.Veiculo_caracteristicaTO; import com.br.controll.conexao.Conexao; import com.br.util.InterfacePersistencia; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; /** * * @author EDSON */ public class Locacao_acessorioPO implements InterfacePersistencia<Locacao_acessorioTO>{ @Override public void salvar(Locacao_acessorioTO obj) { StringBuilder sql = new StringBuilder(); sql.append("INSERT INTO public.locacao_acessorio(codigo_locacao, codigo_acessorio) VALUES ( ?, ?)"); try { Connection con = Conexao.getInstancia().getConnection(); PreparedStatement statement = con.prepareStatement(sql.toString()); setStatement(statement, obj); } catch (Exception e) { e.printStackTrace(); } } @Override public void atualizar(Locacao_acessorioTO obj) { StringBuilder sql = new StringBuilder(); sql.append("UPDATE public.locacao_acessorio SET codigo_locacao=?, codigo_acessorio=? WHERE codigo=?"); try { Connection con = Conexao.getInstancia().getConnection(); PreparedStatement statement = con.prepareStatement(sql.toString()); setStatement(statement, obj); } catch (Exception e) { e.printStackTrace(); } } @Override public void remove(long id) { StringBuilder sql = new StringBuilder(); sql.append("DELETE FROM public.locacao_acessorio WHERE codigo=?;"); try { Connection con = Conexao.getInstancia().getConnection(); PreparedStatement statement = con.prepareStatement(sql.toString()); statement.setLong(1, id); } catch (Exception e) { e.printStackTrace(); } } @Override public List<Locacao_acessorioTO> list(Locacao_acessorioTO obj) { List<Locacao_acessorioTO> list = new ArrayList<>(); StringBuilder sql = new StringBuilder() .append("SELECT * FROM public.locacao_acessorio where 1=1 "); if (obj.getCodigo() != 0) { sql.append(" and codigo=" + obj.getCodigo()); } try { Connection con = Conexao.getInstancia().getConnection(); PreparedStatement statement = con.prepareStatement(sql.toString()); ResultSet set = statement.executeQuery(); while (set.next()) { list.add(setRest(set)); } } catch (Exception e) { e.printStackTrace(); } return list; } @Override public void setStatement(PreparedStatement statement, Locacao_acessorioTO obj) { try { statement.setLong(1, obj.getCodigo_locacao()); statement.setLong(2, obj.getCodigo_acessorio()); if (obj.getCodigo() != 0) { statement.setLong(3, obj.getCodigo()); } statement.execute(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public Locacao_acessorioTO setRest(ResultSet set) { Locacao_acessorioTO l_acess = new Locacao_acessorioTO(); try { l_acess.setCodigo(set.getLong("codigo")); l_acess.setCodigo_locacao(set.getLong(("codigo_locacao"))); l_acess.setCodigo_acessorio(set.getLong("codigo_acessorio")); } catch (Exception e) { // TODO: handle exception } return l_acess; } }
[ "wellington@192.168.1.7" ]
wellington@192.168.1.7
38fe3ef310d97cb477eeb8e9544d5b995362a1bd
0d420298e732861b6a4859d9c236b746b0985b39
/zoo-netty/zoo-netty-server/src/main/java/com/panda/zoo/netty/server/base/AbstractServer.java
f891266d65ae7e059963f05868063f197d503969
[]
no_license
smileclj/panda-zoo
88bf21f4bda0f4b8bd0d2d649db3e490b702795c
aa30ebeb507d27e854d5cd4d0cf54ab3e004caf8
refs/heads/master
2022-12-25T04:10:06.601086
2019-09-29T06:49:09
2019-09-29T06:49:09
82,775,082
0
0
null
null
null
null
UTF-8
Java
false
false
2,770
java
package com.panda.zoo.netty.server.base; import com.google.common.collect.Iterables; import com.panda.zoo.netty.common.constants.ZooNettyConstants; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; /** * Created by huixiangdou on 2017/5/2. */ public abstract class AbstractServer implements Server { private static final Logger logger = LoggerFactory.getLogger(AbstractServer.class); private int serverPort = ZooNettyConstants.DEFAULT_PORT; // 默认端口 private String serverName = "HttpServer"; private EventLoopGroup bossGroup; private EventLoopGroup workGroup; private ServerBootstrap serverBootstrap; private List<ChannelHandler> channelHandlers; public AbstractServer(int serverPort, String serverName) { this.serverName = serverName; this.serverPort = serverPort; bossGroup = new NioEventLoopGroup(); workGroup = new NioEventLoopGroup(); serverBootstrap = new ServerBootstrap(); serverBootstrap.group(bossGroup, workGroup); } protected abstract void init(ServerBootstrap serverBootstrap); @Override public void start() { init(serverBootstrap); ChannelFuture channelFuture; try { logger.info("server start --> name:{},port:{}", serverName, serverPort); channelFuture = serverBootstrap.bind(serverPort).sync(); channelFuture.channel().closeFuture().sync(); } catch (InterruptedException e) { logger.error("[" + serverName + "] server start error", e); bossGroup.shutdownGracefully(); workGroup.shutdownGracefully(); } } @Override public void close() { bossGroup.shutdownGracefully(); workGroup.shutdownGracefully(); } public int getServerPort() { return serverPort; } public void setServerPort(int serverPort) { this.serverPort = serverPort; } public String getServerName() { return serverName; } public void setServerName(String serverName) { this.serverName = serverName; } public List<ChannelHandler> getChannelHandlers() { return channelHandlers; } public void setChannelHandlers(List<ChannelHandler> channelHandlers) { this.channelHandlers = channelHandlers; } }
[ "huixiangdou@2dfire.com" ]
huixiangdou@2dfire.com
3c491c78f7e44b381e7df4678dfafca3ced05d54
efbebdb33e5f18f43a61439d040510b966e82f52
/src/main/java/com/example/check/service/attendance/AttendanceServiceImpl.java
e1811c8421493ba84eddf45efe29ec88a432cede
[]
no_license
SeungDaniel/KNOW-ChangYoung-Backend
cf2e9d7903f5f16fd77d23d915db680ac5a485a1
d585fad4517835c50091c3f695c5e83245928524
refs/heads/master
2023-02-27T06:08:01.921746
2021-02-03T07:39:14
2021-02-03T07:39:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,273
java
package com.example.check.service.attendance; import com.example.check.entity.attendance.Attendance; import com.example.check.entity.attendance.AttendanceRepository; import com.example.check.entity.student.Student; import com.example.check.entity.student.StudentRepository; import com.example.check.exception.AlreadyAttendanceException; import com.example.check.exception.AttendanceTimeException; import com.example.check.exception.StudentNotFoundException; import com.example.check.exception.UnAuthorizationException; import com.example.check.payload.response.AttendanceCountResponse; import com.example.check.payload.response.AttendanceResponse; import com.example.check.payload.response.StudentGraphResponse; import com.example.check.payload.response.StudentResponse; import com.example.check.security.auth.AuthenticationFacade; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.ArrayList; import java.util.List; @Service @RequiredArgsConstructor public class AttendanceServiceImpl implements AttendanceService{ private final AuthenticationFacade authenticationFacade; private final AttendanceRepository attendanceRepository; private final StudentRepository studentRepository; @Override public void createAttendance() { if(!authenticationFacade.isLogined()) { throw new UnAuthorizationException(); } Student student = studentRepository.findById(authenticationFacade.getStudentId()) .orElseThrow(StudentNotFoundException::new); LocalDateTime now = LocalDateTime.now(); LocalDateTime startTime = LocalDateTime.of(now.getYear(),now.getMonth(),now.getDayOfMonth(), 5,30); LocalDateTime endTime = LocalDateTime.of(now.getYear(),now.getMonth(),now.getDayOfMonth(), 8,2); if(now.isBefore(startTime) || now.isAfter(endTime) || (now.getDayOfWeek().getValue() == 6 || now.getDayOfWeek().getValue() == 7)) { throw new AttendanceTimeException(); } System.out.println(now); if(!attendanceRepository.findAllByStudentAndDateTimeBetween(student, LocalDateTime.of(now.getYear(),now.getMonth(),now.getDayOfMonth(),0,0) , LocalDateTime.of(now.getYear(),now.getMonth(),now.getDayOfMonth(),23,59)).isEmpty()) { throw new AlreadyAttendanceException(); } HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest(); String ip = req.getHeader("X-FORWARDED-FOR"); if (ip == null) { ip = req.getRemoteAddr(); } attendanceRepository.save( Attendance.builder() .ipAddress(ip) .dateTime(LocalDateTime.now()) .student(student) .build() ); } @Override public List<AttendanceResponse> getTodayAttendanceList(LocalDate date) { List<Attendance> attendanceList = attendanceRepository.findAllByDateTimeBetweenOrderByDateTimeDesc( LocalDateTime.of(date, LocalTime.of(0,0)), LocalDateTime.of(date, LocalTime.of(23,59))); List<AttendanceResponse> attendanceResponses = new ArrayList<>(); for(Attendance attendance : attendanceList) { attendanceResponses.add( AttendanceResponse.builder() .dateTime(attendance.getDateTime()) .id(attendance.getId()) .userId(attendance.getStudent().getId()) .name(attendance.getStudent().getName()) .build() ); } return attendanceResponses; } @Override public List<AttendanceCountResponse> getAttendanceList() { List<Student> students = studentRepository.findAllByOrderByNameAsc(); List<AttendanceCountResponse> attendanceCountResponses = new ArrayList<>(); LocalDate startDate = LocalDate.of(2021,01,18); LocalDate todayDate = LocalDate.now(); Integer dateSum = todayDate.getDayOfYear() - startDate.getDayOfYear() + 1; while(!startDate.isAfter(todayDate)) { if(startDate.getDayOfWeek().getValue() >= 6) { dateSum --; } startDate = startDate.plusDays(1); } for(Student student : students) { Integer count = attendanceRepository.countAllByStudent(student); attendanceCountResponses.add( AttendanceCountResponse.builder() .notAttendanceCount(dateSum - count) .attendanceCount(count) .dateSum(dateSum) .name(student.getName()) .build() ); } return attendanceCountResponses; } @Override public List<AttendanceResponse> getStudentAttendanceList(String studentId) { Student student = studentRepository.findById(studentId) .orElseThrow(StudentNotFoundException::new); List<Attendance> attendanceList = attendanceRepository.findAllByStudentOrderByDateTimeDesc(student); List<AttendanceResponse> attendanceResponses = new ArrayList<>(); for(Attendance attendance : attendanceList) { attendanceResponses.add( AttendanceResponse.builder() .dateTime(attendance.getDateTime()) .id(attendance.getId()) .userId(attendance.getStudent().getId()) .name(attendance.getStudent().getName()) .build() ); } return attendanceResponses; } @Override public StudentGraphResponse getNotAttendanceStudent() { boolean isAttendance = false; LocalDate startDate = LocalDate.of(2021,01,18); LocalDate tmp = LocalDate.of(2021,01,18); LocalDate todayDate = LocalDate.now(); Integer dateSum = todayDate.getDayOfYear() - tmp.getDayOfYear() + 1; LocalDateTime now = LocalDateTime.now(); while(!tmp.isAfter(todayDate)) { if(tmp.getDayOfWeek().getValue() >= 6) { dateSum --; } tmp = tmp.plusDays(1); } LocalDate date = LocalDate.now(); List<Student> students = studentRepository.findAllByOrderByNameAsc(); List<Attendance> attendanceList = attendanceRepository.findAllByDateTimeBetweenOrderByDateTimeDesc( LocalDateTime.of(date,LocalTime.of(0,0)), LocalDateTime.of(date,LocalTime.of(23,59))); List<StudentResponse> studentResponses = new ArrayList<>(); Integer todayAmount = attendanceRepository.countAllBy(); Integer lastAmount = attendanceRepository.countAllByDateTimeBetween( LocalDateTime.of(startDate,LocalTime.of(0,0)), now.minusDays(1)); for(Student student : students) { for(Attendance attendance : attendanceList) { if (attendance.getStudent().equals(student)) { isAttendance = true; } } if(!isAttendance) { studentResponses.add( StudentResponse.builder() .userId(student.getId()) .name(student.getName()) .nickname(student.getNickname()) .build() ); } isAttendance = false; } return StudentGraphResponse.builder() .studentResponses(studentResponses) .lastDayGraph(lastAmount/(21.0*(dateSum-1))) .todayGraph(todayAmount/(21.0*dateSum)) .build(); } }
[ "jhhong0509@naver.com" ]
jhhong0509@naver.com
a372e16f62b7f486caf33f98f977ef42592356b4
3b1671d44363d1d5855d6a275df6ae4d16047686
/app/src/main/java/org/domain/name/app/control/RemoteControl.java
948adb31fbdc0d2c2d772ac6560d81936f35d4f1
[]
no_license
chongbo2013/Framework
292ac40acdca909cb42abde34871faef570ff9d1
ed20cb05a28ff9a374a7aeebda787c4d454e642e
refs/heads/master
2020-03-10T05:22:40.572325
2018-04-11T09:04:11
2018-04-11T09:04:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
185
java
package org.domain.name.app.control; import com.liux.framework.app.AppControl; /** * 2017/11/6 * By Liux * lx0758@qq.com */ public class RemoteControl implements AppControl { }
[ "lx0758@qq.com" ]
lx0758@qq.com
d35b2dd5bffd8b1ca1ed125a05236a1365c0c974
26edc760f6d11314f9bfd3c0f4b509c36ab88e2d
/src/main/java/com/joker/dq/dao/hibernate/RoleDaoHibernate.java
4dfeb506f3bcd13008377b785b83f49a56992aa9
[]
no_license
JokerQZhang/dq
130773be7087066fa2e8a731af7623229e53a636
d14d0699becce015651fc88d50daa410a2d1b6ee
refs/heads/master
2020-04-15T15:21:40.213444
2016-06-04T01:55:05
2016-06-04T01:55:05
54,450,563
0
0
null
null
null
null
UTF-8
Java
false
false
1,284
java
package com.joker.dq.dao.hibernate; import com.joker.dq.dao.RoleDao; import com.joker.dq.model.Role; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Repository; import java.util.List; /** * This class interacts with hibernate session to save/delete and * retrieve Role objects. * * @author <a href="mailto:bwnoll@gmail.com">Bryan Noll</a> * @author jgarcia (updated to hibernate 4) */ @Repository public class RoleDaoHibernate extends GenericDaoHibernate<Role, Long> implements RoleDao { /** * Constructor to create a Generics-based version using Role as the entity */ public RoleDaoHibernate() { super(Role.class); } /** * {@inheritDoc} */ public Role getRoleByName(String rolename) { List roles = getSession().createCriteria(Role.class).add(Restrictions.eq("name", rolename)).list(); if (roles.isEmpty()) { return null; } else { return (Role) roles.get(0); } } /** * {@inheritDoc} */ public void removeRole(String rolename) { Object role = getRoleByName(rolename); Session session = getSessionFactory().getCurrentSession(); session.delete(role); } }
[ "383913397@qq.com" ]
383913397@qq.com
4117c402b2f92d72a9de09f803137c56de6c6a5f
07a8b9a2f36173f8d7d266918d45b7cf9b3ee1d5
/Graph/LongestPath.java
c09221550b888b4c6a7828685ae9942c439e0c19
[]
no_license
ArijitXfx/500-Codes-Quarantine-Challenge
caebcf9e3f759c022e5dd11c0108ff2c238caaff
5c39962176754b727586b4d13c64261d6c79dc6d
refs/heads/master
2023-02-03T19:18:01.465448
2020-12-21T05:32:21
2020-12-21T05:32:21
290,114,857
1
0
null
null
null
null
UTF-8
Java
false
false
682
java
public class LongestPath{ public static int LongestPathDFS(int[][] graph, int N){ boolean[] vis = new boolean[N]; int[] dp = new int[N]; for(int i=0;i<N;i++){ if(!vis[i]){ util(i, graph, N, dp, vis); } } int max = 0; for(int i:dp) max = max<i?i:max; return max; } public static void util(int v, int[][] graph, int N, int[] dp, boolean[] vis){ vis[v] = true; for(int i:graph[v]){ if(!vis[i]){ util(i,graph,N,dp,vis); } dp[v] = Math.max(dp[v], 1+dp[i]); } } public static void main(String[] args){ int[][] graph = { {}, {}, {3}, {1}, {0,1}, {0,2} }; System.out.println(LongestPathDFS(graph, 6)); } }
[ "thearijitxfx@gmail.com" ]
thearijitxfx@gmail.com
cf62ca720c2af7e97e42a8ee7a7ce65d057f982e
848744723840f041cbbf7b4fef6c3c054d1fbd33
/getui/build/generated/source/r/debug/android/support/coreutils/R.java
8783f48e7b3bdc74416fc4d7a7e9d8a351f4a830
[]
no_license
yxs7673/gaopeic
269ddf541e5f16ab6ea9a6ef2ae1976cb70a3f95
95056e1b01eb6184e5563fba1f0fdce675d8fa80
refs/heads/master
2020-03-31T06:58:31.728709
2018-10-08T01:33:24
2018-10-08T01:33:24
152,002,150
1
0
null
null
null
null
UTF-8
Java
false
false
7,031
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.coreutils; public final class R { public static final class attr { public static int font = 0x7f040070; public static int fontProviderAuthority = 0x7f040072; public static int fontProviderCerts = 0x7f040073; public static int fontProviderFetchStrategy = 0x7f040074; public static int fontProviderFetchTimeout = 0x7f040075; public static int fontProviderPackage = 0x7f040076; public static int fontProviderQuery = 0x7f040077; public static int fontStyle = 0x7f040078; public static int fontWeight = 0x7f040079; } public static final class bool { public static int abc_action_bar_embed_tabs = 0x7f050001; } public static final class color { public static int notification_action_color_filter = 0x7f06003c; public static int notification_icon_bg_color = 0x7f06003d; public static int ripple_material_light = 0x7f060048; public static int secondary_text_default_material_light = 0x7f06004a; } public static final class dimen { public static int compat_button_inset_horizontal_material = 0x7f08004b; public static int compat_button_inset_vertical_material = 0x7f08004c; public static int compat_button_padding_horizontal_material = 0x7f08004d; public static int compat_button_padding_vertical_material = 0x7f08004e; public static int compat_control_corner_material = 0x7f08004f; public static int notification_action_icon_size = 0x7f080059; public static int notification_action_text_size = 0x7f08005a; public static int notification_big_circle_margin = 0x7f08005b; public static int notification_content_margin_start = 0x7f08005c; public static int notification_large_icon_height = 0x7f08005d; public static int notification_large_icon_width = 0x7f08005e; public static int notification_main_column_padding_top = 0x7f08005f; public static int notification_media_narrow_margin = 0x7f080060; public static int notification_right_icon_size = 0x7f080061; public static int notification_right_side_padding_top = 0x7f080062; public static int notification_small_icon_background_padding = 0x7f080063; public static int notification_small_icon_size_as_large = 0x7f080064; public static int notification_subtext_size = 0x7f080065; public static int notification_top_pad = 0x7f080066; public static int notification_top_pad_large_text = 0x7f080067; } public static final class drawable { public static int notification_action_background = 0x7f090054; public static int notification_bg = 0x7f090055; public static int notification_bg_low = 0x7f090056; public static int notification_bg_low_normal = 0x7f090057; public static int notification_bg_low_pressed = 0x7f090058; public static int notification_bg_normal = 0x7f090059; public static int notification_bg_normal_pressed = 0x7f09005a; public static int notification_icon_background = 0x7f09005b; public static int notification_template_icon_bg = 0x7f09005c; public static int notification_template_icon_low_bg = 0x7f09005d; public static int notification_tile_bg = 0x7f09005e; public static int notify_panel_notification_icon_bg = 0x7f09005f; } public static final class id { public static int action_container = 0x7f0c0009; public static int action_divider = 0x7f0c000b; public static int action_image = 0x7f0c000c; public static int action_text = 0x7f0c0012; public static int actions = 0x7f0c0013; public static int async = 0x7f0c0017; public static int blocking = 0x7f0c0018; public static int chronometer = 0x7f0c001c; public static int forever = 0x7f0c0026; public static int icon = 0x7f0c005c; public static int icon_group = 0x7f0c005d; public static int info = 0x7f0c005f; public static int italic = 0x7f0c0060; public static int line1 = 0x7f0c0061; public static int line3 = 0x7f0c0062; public static int normal = 0x7f0c0069; public static int notification_background = 0x7f0c006a; public static int notification_main_column = 0x7f0c006b; public static int notification_main_column_container = 0x7f0c006c; public static int right_icon = 0x7f0c0071; public static int right_side = 0x7f0c0072; public static int text = 0x7f0c008c; public static int text2 = 0x7f0c008d; public static int time = 0x7f0c0090; public static int title = 0x7f0c0091; } public static final class integer { public static int status_bar_notification_info_maxnum = 0x7f0d0005; } public static final class layout { public static int notification_action = 0x7f0f001d; public static int notification_action_tombstone = 0x7f0f001e; public static int notification_template_custom_big = 0x7f0f0025; public static int notification_template_icon_group = 0x7f0f0026; public static int notification_template_part_chronometer = 0x7f0f002a; public static int notification_template_part_time = 0x7f0f002b; } public static final class string { public static int status_bar_notification_info_overflow = 0x7f150022; } public static final class style { public static int TextAppearance_Compat_Notification = 0x7f1600fa; public static int TextAppearance_Compat_Notification_Info = 0x7f1600fb; public static int TextAppearance_Compat_Notification_Line2 = 0x7f1600fd; public static int TextAppearance_Compat_Notification_Time = 0x7f160100; public static int TextAppearance_Compat_Notification_Title = 0x7f160102; public static int Widget_Compat_NotificationActionContainer = 0x7f16016b; public static int Widget_Compat_NotificationActionText = 0x7f16016c; } public static final class styleable { public static int[] FontFamily = { 0x7f040072, 0x7f040073, 0x7f040074, 0x7f040075, 0x7f040076, 0x7f040077 }; public static int FontFamily_fontProviderAuthority = 0; public static int FontFamily_fontProviderCerts = 1; public static int FontFamily_fontProviderFetchStrategy = 2; public static int FontFamily_fontProviderFetchTimeout = 3; public static int FontFamily_fontProviderPackage = 4; public static int FontFamily_fontProviderQuery = 5; public static int[] FontFamilyFont = { 0x7f040070, 0x7f040078, 0x7f040079 }; public static int FontFamilyFont_font = 0; public static int FontFamilyFont_fontStyle = 1; public static int FontFamilyFont_fontWeight = 2; } }
[ "yxs7673" ]
yxs7673
e7335656c63368d012b9a32557d7ba2b955b45c6
138774c34c46e9f6aef5b3c83829819b227b2385
/app/src/main/java/asp/com/asp/weibo/WBAuthActivity.java
3e1a2a37db3bf334e9e94112374b28e5bd444581
[]
no_license
ZengTianShengZ/ASP
d874fcfa91141fd7660899d372cb184d458810b7
8933702a6228a8a5b7fc6f6f0868ac0fba7a9642
refs/heads/master
2021-01-21T14:44:20.433449
2016-06-13T14:17:11
2016-06-13T14:17:11
58,735,204
0
0
null
null
null
null
UTF-8
Java
false
false
10,975
java
package asp.com.asp.weibo; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.sina.weibo.sdk.auth.AuthInfo; import com.sina.weibo.sdk.auth.Oauth2AccessToken; import com.sina.weibo.sdk.auth.WeiboAuthListener; import com.sina.weibo.sdk.auth.sso.SsoHandler; import com.sina.weibo.sdk.exception.WeiboException; import com.sina.weibo.sdk.net.RequestListener; import org.androidannotations.annotations.AfterViews; import org.androidannotations.annotations.Click; import org.androidannotations.annotations.EActivity; import org.androidannotations.annotations.ViewById; import org.json.JSONException; import org.json.JSONObject; import java.text.SimpleDateFormat; import asp.com.asp.R; import asp.com.asp.domain.User; import asp.com.asp.utils.BmobUserUtil; import asp.com.asp.utils.ConfigConstantUtil; import asp.com.asp.utils.ImageLoaderUtil; import asp.com.asp.utils.SharedPreferencesUtil; import asp.com.asp.view.SnackbarUtil; import cn.bmob.v3.BmobUser; import cn.bmob.v3.listener.SaveListener; /** * Created by Administrator on 2016/5/18. */ @EActivity(R.layout.activity_wb_auth) public class WBAuthActivity extends AppCompatActivity { @ViewById(R.id.wb_toolbar) Toolbar wb_toolbar; @ViewById(R.id.wb_auth_btn) Button wb_auth_btn; /** 注意:SsoHandler 仅当 SDK 支持 SSO 时有效 */ private SsoHandler mSsoHandler; private AuthInfo mAuthInfo; /** 封装了 "access_token","expires_in","refresh_token",并提供了他们的管理功能 */ private Oauth2AccessToken mAccessToken; private ImageLoaderUtil mImageLoaderUtil; private SharedPreferencesUtil mSharedPreferencesUtil; private String ImgUrl ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @AfterViews void updateQiangDate() { setSupportActionBar(wb_toolbar); wb_toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { onBackPressed(); } }); wb_toolbar.setNavigationIcon(R.mipmap.back_btn); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mImageLoaderUtil = ImageLoaderUtil.getInstance(); mImageLoaderUtil.initData(getApplicationContext()); mSharedPreferencesUtil =SharedPreferencesUtil.getInstance(getApplicationContext(),getPackageName()); // 创建微博实例 //mWeiboAuth = new WeiboAuth(this, Constants.APP_KEY, Constants.REDIRECT_URL, Constants.SCOPE); // 快速授权时,请不要传入 SCOPE,否则可能会授权不成功 mAuthInfo = new AuthInfo(this, Constants.APP_KEY, Constants.REDIRECT_URL, Constants.SCOPE); mSsoHandler = new SsoHandler(WBAuthActivity.this, mAuthInfo); // 从 SharedPreferences 中读取上次已保存好 AccessToken 等信息, // 第一次启动本应用,AccessToken 不可用 mAccessToken = AccessTokenKeeper.readAccessToken(this); //Toast.makeText(WBAuthActivity.this,mAccessToken.getUid(), Toast.LENGTH_LONG).show(); if (mAccessToken.isSessionValid()) { updateTokenView(true); } } @Click(R.id.wb_auth_btn) void wb_auth_btnClick(){ mSsoHandler.authorizeClientSso(new AuthListener()); } /** * 微博认证授权回调类。 * 1. SSO 授权时,需要在 {@link #onActivityResult} 中调用 {@link SsoHandler#authorizeCallBack} 后, * 该回调才会被执行。 * 2. 非 SSO 授权时,当授权结束后,该回调就会被执行。 * 当授权成功后,请保存该 access_token、expires_in、uid 等信息到 SharedPreferences 中。 */ class AuthListener implements WeiboAuthListener { @Override public void onComplete(Bundle values) { // 从 Bundle 中解析 Token mAccessToken = Oauth2AccessToken.parseAccessToken(values); //从这里获取用户输入的 电话号码信息 String phoneNum = mAccessToken.getPhoneNum(); if (mAccessToken.isSessionValid()) { // 显示 Token updateTokenView(false); // 保存 Token 到 SharedPreferences AccessTokenKeeper.writeAccessToken(WBAuthActivity.this, mAccessToken); /* Toast.makeText(WBAuthActivity.this, //授权成功 R.string.weibosdk_demo_toast_auth_success, Toast.LENGTH_SHORT).show();*/ // bmob 调用第三方登录接口 BmobUserUtil.bmobWbLoggin(getApplicationContext(), mAccessToken.getToken(),mAccessToken.getExpiresTime()+"", mAccessToken.getUid()); } else { // 以下几种情况,您会收到 Code: // 1. 当您未在平台上注册的应用程序的包名与签名时; // 2. 当您注册的应用程序包名与签名不正确时; // 3. 当您在平台上注册的包名和签名与您当前测试的应用的包名和签名不匹配时。 String code = values.getString("code"); //授权失败 String message = getString(R.string.weibosdk_demo_toast_auth_failed); if (!TextUtils.isEmpty(code)) { message = message + "\nObtained the code: " + code; } // Toast.makeText(WBAuthActivity.this, message, Toast.LENGTH_LONG).show(); } UsersAPI usersAPI = new UsersAPI(getApplicationContext(), Constants.APP_KEY, mAccessToken); usersAPI.show(Long.valueOf(mAccessToken.getUid()), new SinaRequestListener()); } @Override public void onCancel() { Toast.makeText(WBAuthActivity.this, //取消授权 R.string.weibosdk_demo_toast_auth_canceled, Toast.LENGTH_LONG).show(); } @Override public void onWeiboException(WeiboException e) { Toast.makeText(WBAuthActivity.this, "Auth exception : " + e.getMessage(), Toast.LENGTH_LONG).show(); } } /** * 当 SSO 授权 Activity 退出时,该函数被调用。 * * @see {@link Activity#onActivityResult} */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // SSO 授权回调 // 重要:发起 SSO 登陆的 Activity 必须重写 onActivityResults if (mSsoHandler != null) { mSsoHandler.authorizeCallBack(requestCode, resultCode, data); } } /** * 显示当前 Token 信息。 * * @param hasExisted 配置文件中是否已存在 token 信息并且合法 */ private void updateTokenView(boolean hasExisted) { String date = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format( new java.util.Date(mAccessToken.getExpiresTime())); //Token:%1$s \n有效期:%2$s String format = getString(R.string.weibosdk_demo_token_to_string_format_1); // mTokenText.setText(String.format(format, mAccessToken.getToken(), date)); String message = String.format(format, mAccessToken.getToken(), date); if (hasExisted) { //Token 仍在有效期内,无需再次登录。 message = getString(R.string.weibosdk_demo_token_has_existed) + "\n" + message; } //mTokenText.setText(message); } private boolean upSuccess = false; class SinaRequestListener implements RequestListener { //新浪微博请求接口 @Override public void onComplete(String response) { // TODO Auto-generated method stub try { JSONObject jsonObject = new JSONObject(response); Log.i("jsonObject",".....jsonObject......"+jsonObject.toString()); final String idStr = jsonObject.getString("idstr");// 唯一标识符(uid) final String name = jsonObject.getString("name");// 姓名 final String avatarHd = jsonObject.getString("avatar_hd");// 头像 final String description = jsonObject.getString("description"); Log.i("loginSuccess",name+".......///////........."+idStr+"/////"+avatarHd); if(name != null) { new Thread() { public void run() { if(BmobUserUtil.Bmob_Wb_ID != null && !BmobUserUtil.Bmob_Wb_ID.equals("")){ Log.i("Bmob_Wb_ID", ".......Bmob_Wb_ID........"+BmobUserUtil.Bmob_Wb_ID); Bitmap bitmap = mImageLoaderUtil.getNetWorkBitmap(avatarHd); ImgUrl = mImageLoaderUtil.saveToSdCard(bitmap); upSuccess = BmobUserUtil.uploadblockLogo(getApplicationContext(),name,idStr,ImgUrl,wb_auth_btn); Log.i("uploadblockLogo",ImgUrl+ "././././/./upSuccess././././"+upSuccess); } }; }.start(); } } catch (JSONException e) { e.printStackTrace(); } } /** * 05-24 17:34:51.231 5046-5046/asp.com.asp W/ViewRootImpl: mView has no focus, use com.android.internal.policy.impl.PhoneWindow$DecorView{42d84168 V.E..... R.....ID 0,0-1080,1800} instead 05-24 17:34:51.586 5046-5046/asp.com.asp I/loginSuccess: 曾田生..........................2876232957/////http://tva4.sinaimg.cn/crop.85.16.180.180.1024/ab6fd4fdjw1e9e5obce5cj208c05h74f.jpg 05-24 17:34:51.741 5046-5131/asp.com.asp I/System.out: discardStream skip 0 bytes 05-24 17:34:51.751 5046-5046/asp.com.asp I/onFailure: 109..........................login data required. 05-24 17:34:51.846 5046-5133/asp.com.asp I/System.out: discardStream skip 0 bytes 05-24 17:34:51.851 5046-5046/asp.com.asp I/onFailure: 304..........................username or password is null. * @param e */ @Override public void onWeiboException(WeiboException e) { } } }
[ "zengtianshengz@163.com" ]
zengtianshengz@163.com
e349807ac938bbacdff0e1d86eb85307616c3b33
5d2be8d0aab6439d1e06f79a6b8580be8f8ac943
/src/main/java/com/mariana/gallery/persistence/user/UserDAO.java
14d3a12e565be1b3b3c0960dcd44e80095b2e593
[]
no_license
MariannaTvu/Gallery
0c5730a66f6112cf683d23ca3b3ae85eb4ddc7ad
4a5d4a5254d41a084fc9a6b029e39274954eab2d
refs/heads/master
2020-04-12T10:09:45.959450
2017-05-20T15:50:48
2017-05-20T15:50:48
61,962,601
5
0
null
null
null
null
UTF-8
Java
false
false
459
java
package com.mariana.gallery.persistence.user; import com.mariana.gallery.persistence.user_gallery.UserGallery; public interface UserDAO { User findUserById(long id); User findUserByUsername(String username); User saveUser(User user); void setGallery(User user, UserGallery gallery); void setBio(User user, String bio); @Deprecated User findUserByGallery(UserGallery gallery); void setBalance(User user, int balance); }
[ "nico.tvu@gmail.com" ]
nico.tvu@gmail.com
a30b839ab772ce9d00eb899922c1bfc26c4c70fa
66c766517e47b855af27641ed1334e1e3576922b
/car-server/web/CarEye/src/com/careye/constant/ConfigProperties.java
ff4aa200a92039457513d29edc5f7420e76c80ff
[]
no_license
vincenlee/Car-eye-server
21a6c2eda0fd3f096c842fdae6eea4c5af84d22e
47f45a0596fddf65cda6fb7cf657aa716244e5b5
refs/heads/master
2022-05-04T22:09:50.411646
2018-09-28T08:03:03
2018-09-28T08:03:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,408
java
package com.careye.constant; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.apache.log4j.Logger; public class ConfigProperties { protected static final Logger logger = Logger.getLogger(ConfigProperties.class); private static InputStream inputStream; private static Properties p; /**发送邮件用户名*/ public static String sendUserName = null; /**发送邮件邮箱地址*/ public static String sendUserPassword = null; /**设置邮件服务器*/ public static String smtphost = null; /**发送邮件邮箱地址*/ public static String sendUserAdr = null; /**接收异常邮箱*/ public static String receiveExceptionEmail = null; /**通讯端口*/ public static int PORT = 8888; public static String IP = null; public static String MEMCACHED_IP = null; public static String MEMCACHED_PORT = null; /**深海捷电话对接接口*/ public static String SOFT_PHONE_URL = null; /**百度地图API*/ public static String MAPBAIDU_MAP_URL = null; public static String MAPBAIDU_TRAFFIC_CSS_URL = null; public static String MAPBAIDU_TRAFFIC_JS_URL = null; public static String MAPBAIDU_DISTANCETOOL_URL = null; /**百度地图获取当前城市信息*/ public static String MAPBAIDU_CITYINFO_URL = null; public static String MAPBAIDU_AK = null; /**高德地图API**/ public static String MAPGAODE_MAP_URL = null; /**地图类型**/ public static String MAP_TYPE = null; /**MQ配置*/ public static String MQ_SERVER = null; /**WEB下行MQ名称*/ public static String DS_WEB_DOWN_QUEUE_NAME = null; public static String MONGO_DB = null; public static String MONGO_POSITION_COLLECTION = null; // 位置 public static String MONGO_ALARM_COLLECTION = null; // 报警 public static String MONGO_IP = null; public static String MONGO_PORT = null; /**MYSQL数据库操作的开启关闭状态 1开启 2关闭**/ public static String CMSS_STATUS = null; /**GTALK数据库操作的开启关闭状态 1开启 2关闭**/ public static String GTALK_STATUS = null; public static final String proPath = "properties/mainconfig.properties"; static{ try { p = new Properties(); inputStream = ConfigProperties.class.getClassLoader().getResourceAsStream(proPath); try { p.load(inputStream); logger.info("读取程序公用配置文件成功!"); } catch (IOException e) { logger.error("读取程序公用配置文件异常!", e); } if(sendUserName == null){ sendUserName = getValue("sendUserName"); } if(sendUserPassword == null){ sendUserPassword = getValue("sendUserPassword"); } if(smtphost == null){ smtphost = getValue("smtphost"); } if(sendUserAdr == null){ sendUserAdr = getValue("sendUserAdr"); } if(receiveExceptionEmail == null){ receiveExceptionEmail = getValue("receiveExceptionEmail"); } if(PORT == 8888){ PORT = Integer.parseInt(new String(getValue("PORT").trim())); } if(MEMCACHED_IP == null){ MEMCACHED_IP = getValue("MEMCACHED_IP").trim(); } if(MEMCACHED_PORT == null){ MEMCACHED_PORT = getValue("MEMCACHED_PORT").trim(); } if(IP == null){ IP = getValue("IP").trim(); } if(MQ_SERVER == null){ MQ_SERVER = getValue("MQ_SERVER").trim(); } if(DS_WEB_DOWN_QUEUE_NAME == null){ DS_WEB_DOWN_QUEUE_NAME = getValue("DS_WEB_DOWN_QUEUE_NAME").trim(); } if(MONGO_IP == null){ MONGO_IP = getValue("MONGO_IP").trim(); } if(MONGO_PORT == null){ MONGO_PORT = getValue("MONGO_PORT").trim(); } if(MONGO_DB == null){ MONGO_DB = getValue("MONGO_DB").trim(); } if(MONGO_POSITION_COLLECTION == null){ MONGO_POSITION_COLLECTION = getValue("MONGO_POSITION_COLLECTION").trim(); } if(MONGO_ALARM_COLLECTION == null){ MONGO_ALARM_COLLECTION = getValue("MONGO_ALARM_COLLECTION").trim(); } if(MAPBAIDU_MAP_URL == null){ MAPBAIDU_MAP_URL = getValue("MAPBAIDU_MAP_URL").trim(); } if(MAPBAIDU_TRAFFIC_CSS_URL == null){ MAPBAIDU_TRAFFIC_CSS_URL = getValue("MAPBAIDU_TRAFFIC_CSS_URL").trim(); } if(MAPBAIDU_TRAFFIC_JS_URL == null){ MAPBAIDU_TRAFFIC_JS_URL = getValue("MAPBAIDU_TRAFFIC_JS_URL").trim(); } if(MAPBAIDU_DISTANCETOOL_URL == null){ MAPBAIDU_DISTANCETOOL_URL = getValue("MAPBAIDU_DISTANCETOOL_URL").trim(); } if(MAPBAIDU_CITYINFO_URL == null){ MAPBAIDU_CITYINFO_URL = getValue("MAPBAIDU_CITYINFO_URL").trim(); } if(MAPBAIDU_AK == null){ MAPBAIDU_AK = getValue("MAPBAIDU_AK").trim(); } if(MAPGAODE_MAP_URL == null){ MAPGAODE_MAP_URL = getValue("MAPGAODE_MAP_URL"); } if(MAP_TYPE == null){ MAP_TYPE = getValue("MAP_TYPE"); } if(SOFT_PHONE_URL == null){ SOFT_PHONE_URL = getValue("SOFT_PHONE_URL").trim(); } if(CMSS_STATUS == null){ CMSS_STATUS = getValue("CMSS_STATUS").trim(); } if(GTALK_STATUS == null){ GTALK_STATUS = getValue("GTALK_STATUS").trim(); } } catch (Exception e) { logger.error("读取程序公用配置文件属性异常!", e); } } public static String getValue(String key) { String value = null; if (p.containsKey(key)) { value = p.getProperty(key); }else { logger.error("配置文件中无名为"+ key +"键的值!"); } return value; } }
[ "dengtieshan@shenghong-technology.com" ]
dengtieshan@shenghong-technology.com
e0c72ee7737674b2041c52c20bf08401d3498fee
454fe1f5ceb40b1739d9055729d608c87ac3a1e0
/src/test/java/screens/LandingScreen.java
202acf777350c458fbef88fe840dbdde7d444620
[]
no_license
alvarolaserna/Valmiera_Workshop
92c3d630082ceb8d09658bbd59fb9ba58dd88838
93d2cfb62e28d346e96b1b1fc2be9a3bb4b6836c
refs/heads/master
2021-01-02T02:26:44.022458
2020-02-11T12:54:59
2020-02-11T12:54:59
239,453,226
2
0
null
2020-02-11T06:48:10
2020-02-10T07:34:29
Java
UTF-8
Java
false
false
2,100
java
package screens; import testUI.elements.UIElement; import static testUI.Utils.By.byAndroidUIAutomator; import static testUI.Utils.By.byId; import static testUI.elements.TestUI.E; public class LandingScreen { // Elements private final UIElement shoppingListInput = E(byAndroidUIAutomator("textContains(\"Add a shopping list\")")); private final UIElement inputShoppingList = E(byId("editText")); private final UIElement addListButton = E(byId("android:id/button1")); private final UIElement groceries = E(byAndroidUIAutomator("textContains(\"OurGroceries\")")); private final UIElement shoppingListTitle = E(byAndroidUIAutomator("textContains(\"SHOPPING LIST\")")); private final UIElement recipesTitle = E(byAndroidUIAutomator("textContains(\"RECIPES\")")); private final UIElement addRecipe = E(byAndroidUIAutomator("textContains(\"Add a recipe...\")")); // Methods public LandingScreen checkLandingScreen(String... args) { for (String arg : args) { UIElement element = E(byAndroidUIAutomator("textContains(\"" + arg + "\")")); element.waitFor(5).untilIsVisible(); } return this; } public void clickAddShoppingList() { shoppingListInput.click(); } public void typeInShoppingName(String var) { inputShoppingList.sendKeys(var); } public void clickOnAddList() { addListButton.shouldHave().attribute("text").equalTo("ADD LISTS"); addListButton.click(); } public void checkNewList(String arg) { UIElement element = E(byAndroidUIAutomator("textContains(\"" + arg + "\")")); element.waitFor(5).untilIsVisible(); } public void goToShoppingList(String list) { E(byAndroidUIAutomator("text(\"" +list+"\")")).waitFor(5).untilIsVisible().click(); } public void checkNoList(String arg) { UIElement element = E(byAndroidUIAutomator("textContains(\"" + arg + "\")")); element.waitFor(5).untilNotVisible(); } }
[ "alvaro.lasernalopez@testdevlab.com" ]
alvaro.lasernalopez@testdevlab.com
7d84d6c3599d55b8e39d4d5040ec7f3ea87b7502
1d586f9eea81e4d7db2c0133a9123a193c3e4bea
/src/main/java/com/rss/keshava/KeshavaSevaSamithiApplication.java
522d95a37754ab0b9c1313c86f0db7ca6df0a534
[]
no_license
shylendramadda/spring-mvc-keshava-seva-samithi-server
c9622851a326e1f162597bfb7899ff40f9479034
8f5d1301b83d8d863cc210d3ee0472287c57089a
refs/heads/master
2022-11-12T11:42:02.804730
2018-11-06T11:36:37
2018-11-06T11:36:37
278,036,291
0
0
null
null
null
null
UTF-8
Java
false
false
331
java
package com.rss.keshava; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class KeshavaSevaSamithiApplication { public static void main(String[] args) { SpringApplication.run(KeshavaSevaSamithiApplication.class, args); } }
[ "shylendramadda@gmail.com" ]
shylendramadda@gmail.com
736b41fd3d8c4d0246debf318da56c5705ac59c7
9d00ce802e3d5029429162bd4b6aa74c75c4f396
/org.amit.pract/org/amit/BinaryTree/BinaryTreeExamples1.java
301b002b72aabe42b96f412759e47c203f90f8ac
[]
no_license
Amitjan20/DataStructures
15253a4c8bcdb7e5040657b53963e549019846eb
2be014cd1f5a48547d76e20bee2dda97bb61288d
refs/heads/master
2021-04-29T07:59:28.151086
2017-01-06T06:22:45
2017-01-06T06:22:45
77,972,917
0
0
null
null
null
null
UTF-8
Java
false
false
3,211
java
package org.amit.BinaryTree; import java.util.Queue; import java.util.concurrent.LinkedBlockingQueue; public class BinaryTreeExamples1 { public static void main(String[] args) { BinaryTree seven = new BinaryTree(null, null, 7); BinaryTree six = new BinaryTree(null, null, 6); BinaryTree five = new BinaryTree(null, null, 5); BinaryTree four = new BinaryTree(null, null, 4); BinaryTree three = new BinaryTree(six, seven, 3); BinaryTree two = new BinaryTree(four, five, 2); BinaryTree root = new BinaryTree(two, three, 1); BinaryTree root2 =null; halfNodesInTree(root); fullNodesInTree(root); leafNodesInTree(root); areStructurallySame(root, root2); maxSumOfLevelInTree(root); } private static int maxSumOfLevelInTree(BinaryTree root) { Queue< BinaryTree> queue = new LinkedBlockingQueue<>(); int currentSum = 0; int maxSum = 0; queue.add(root); queue.add(null); int level = 0; int maxLevel = 0; while(!queue.isEmpty()){ BinaryTree temp = queue.poll(); if(temp == null){ if(currentSum > maxSum){ maxSum = currentSum; maxLevel = level; } currentSum = 0; queue.add(null); level++; }else{ if(temp.getLeft() != null){ queue.add(temp.getLeft()); } if(temp.getRight() != null){ queue.add(temp.getRight()); } } } return maxLevel; } private static boolean areStructurallySame(BinaryTree root, BinaryTree root2) { if(root == null && root2 == null) return true; if(root == null || root2 == null) return false; return ((root.getData() == root2.getData()) && (areStructurallySame(root.getLeft(), root2.getLeft()) && (areStructurallySame(root.getRight(), root2.getRight())))); } private static int leafNodesInTree(BinaryTree root) { Queue< BinaryTree> queue = new LinkedBlockingQueue<>(); queue.add(root); BinaryTree temp = null; int count = 0; while(!queue.isEmpty()){ temp =queue.poll(); if(temp.getLeft() == null && temp.getRight() == null){ count++; }else{ if(temp.getLeft() != null){ queue.add(temp.getLeft()); } if(temp.getRight() != null){ queue.add(temp.getRight()); } } } return count; } private static int fullNodesInTree(BinaryTree root) { Queue< BinaryTree> queue = new LinkedBlockingQueue<>(); queue.add(root); BinaryTree temp = null; int count = 0; while(!queue.isEmpty()){ temp =queue.poll(); if(temp.getLeft() != null && temp.getRight() != null){ count++; } if(temp.getLeft() != null){ queue.add(temp.getLeft()); } if(temp.getRight() != null){ queue.add(temp.getRight()); } } return count; } private static int halfNodesInTree(BinaryTree root) { Queue<BinaryTree> queue = new LinkedBlockingQueue<>(); queue.add(root); BinaryTree temp = null; int count = 0; while(!queue.isEmpty()){ temp =queue.poll(); if((temp.getLeft() != null && temp.getRight() == null) || (temp.getLeft() == null && temp.getRight() != null)){ count++; } if(temp.getLeft() != null){ queue.add(temp.getLeft()); } if(temp.getRight() != null){ queue.add(temp.getRight()); } } return count; } }
[ "aslekaramit@gmail.com" ]
aslekaramit@gmail.com
4140e329b6ee0c1ef2f9556d05ed5732aec66fd2
44a43187dca5c7ab5ca8d2b1be4e1bfa5b7de7cb
/src/forme/ZaduzenjaForma.java
5772ec3470ce6f1448d448f7a3e589ba1198cab1
[]
no_license
choks94/Client-Side_Application
d1579f6286cdbc79abb8c49fc29813fac56e07df
282f589d7bef3ea215607f8a732393d03cc996a4
refs/heads/master
2020-05-23T15:33:33.960546
2019-05-16T10:32:42
2019-05-16T10:32:42
186,827,454
0
0
null
null
null
null
UTF-8
Java
false
false
18,868
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 forme; import domen.Clan; import domen.Knjiga; import domen.Primerak; import domen.Radnik; import domen.Zaduzenje; import forme.potvrde.PotvrdaORazduzivanju; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.LayoutManager; import java.awt.Toolkit; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; import komunikacija.Komunikacija; import modeli.ModelTabeleZaduzenja; import operacije.Operacija; import transfer.KlijentskiZahtev; import transfer.ServerskiOdgovor; /** * * @author STEFAN94 */ public class ZaduzenjaForma extends javax.swing.JFrame { private ArrayList<Zaduzenje> listaZaduzenja = new ArrayList<>(); private ArrayList<Primerak> listaPrimeraka = new ArrayList<>(); private Radnik ulogovaniRadnik; private GlavnaForma gf; private Knjiga selektovanaKnjiga; private Zaduzenje selektovanoZaduzenje; private int brojSlobodnihPrimeraka; private Clan selektovanClanZaZaduzenje; private String brPrimeraka; private String info; private Primerak selektovaniPrimerak; /** * Creates new form ZaduzenjaForma * * @param gf */ public ZaduzenjaForma(GlavnaForma gf) { this.setExtendedState(JFrame.MAXIMIZED_BOTH); this.gf = gf; initComponents(); this.getContentPane().setBackground(java.awt.Color.lightGray); popuniTabelu(); ulogovaniRadnik = gf.getUlogovaniRadnik(); gf.getBtnZaduziKnjigu().setEnabled(false); int indeks = gf.vratiIndeksSelektovaneKnjige(); selektovanaKnjiga = gf.vratiSelektovanuKnjigu(indeks); vratiBrojSlobodnihPrimeraka(selektovanaKnjiga); brPrimeraka = lblBrSlobodnihPrimeraka.getText(); lblBrSlobodnihPrimeraka.setText(brPrimeraka); lblBrPrimeraka.setText("" + brojSlobodnihPrimeraka); info = lblZaduzenaKnjigaLbl.getText(); lblZaduzenaKnjigaLbl.setText(info + " " + selektovanaKnjiga.getNaziv()); btnRazduzi.setEnabled(false); this.setTitle("Zaduzenja za knjigu: " + selektovanaKnjiga.getNaziv()); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); txtPretragaZaduzenja = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); tblZaduzenja = new javax.swing.JTable(); btnZaduzi = new javax.swing.JButton(); btnRazduzi = new javax.swing.JButton(); lblZaduzenaKnjigaLbl = new javax.swing.JLabel(); lblBrSlobodnihPrimeraka = new javax.swing.JLabel(); lblBrPrimeraka = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { formWindowClosed(evt); } }); jLabel1.setText("Pretraga zaduzenja(Ime/Prezime/JMBG/Datum zaduzenja):"); txtPretragaZaduzenja.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { txtPretragaZaduzenjaKeyReleased(evt); } }); tblZaduzenja.setBackground(new java.awt.Color(0, 102, 102)); tblZaduzenja.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); tblZaduzenja.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { tblZaduzenjaMouseClicked(evt); } }); jScrollPane1.setViewportView(tblZaduzenja); btnZaduzi.setText("Novo zaduzenje"); btnZaduzi.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnZaduziActionPerformed(evt); } }); btnRazduzi.setText("Razduzi"); btnRazduzi.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnRazduziActionPerformed(evt); } }); lblZaduzenaKnjigaLbl.setText("Zaduzenja za knjigu:"); lblBrSlobodnihPrimeraka.setText("Broj slobodnih primeraka:"); lblBrPrimeraka.setText("jLabel2"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 726, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(btnZaduzi) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnRazduzi)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtPretragaZaduzenja, javax.swing.GroupLayout.PREFERRED_SIZE, 282, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1) .addGroup(layout.createSequentialGroup() .addComponent(lblZaduzenaKnjigaLbl) .addGap(77, 77, 77) .addComponent(lblBrSlobodnihPrimeraka) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(lblBrPrimeraka))) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtPretragaZaduzenja, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(4, 4, 4) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblZaduzenaKnjigaLbl) .addComponent(lblBrSlobodnihPrimeraka) .addComponent(lblBrPrimeraka)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnRazduzi) .addComponent(btnZaduzi))) ); pack(); }// </editor-fold>//GEN-END:initComponents private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed gf.getBtnZaduziKnjigu().setEnabled(true); }//GEN-LAST:event_formWindowClosed private void txtPretragaZaduzenjaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPretragaZaduzenjaKeyReleased String pretraga = txtPretragaZaduzenja.getText(); String patternZaPretragu = "^" + pretraga.toLowerCase() + ".*"; ArrayList<Zaduzenje> listaPretrazenihZaduzenja = new ArrayList<>(); for (Zaduzenje zaduzenje : listaZaduzenja) { String jmbgString = zaduzenje.getClan().getJmbg() + ""; String datumZadStr = zaduzenje.getDatumZaduzenja().toString(); String datumRazStr = ""; if (zaduzenje.getDatumRazduzenja() != null) { datumRazStr = zaduzenje.getDatumRazduzenja().toString(); } else { datumRazStr = "0000-00-00"; } if (zaduzenje.getClan().getIme().toLowerCase().matches(patternZaPretragu) || zaduzenje.getClan().getPrezime().toLowerCase().matches(patternZaPretragu) || zaduzenje.getClan().getIme().concat(" ").concat(zaduzenje.getClan().getPrezime()).toLowerCase().matches(patternZaPretragu) || zaduzenje.getClan().getPrezime().concat(" ").concat(zaduzenje.getClan().getIme()).toLowerCase().matches(patternZaPretragu) || jmbgString.matches(patternZaPretragu) || datumZadStr.matches(patternZaPretragu) || datumRazStr.matches(patternZaPretragu)) { listaPretrazenihZaduzenja.add(zaduzenje); } } ModelTabeleZaduzenja mtz = (ModelTabeleZaduzenja) tblZaduzenja.getModel(); mtz.azurirajTabelu(listaPretrazenihZaduzenja); btnRazduzi.setEnabled(false); }//GEN-LAST:event_txtPretragaZaduzenjaKeyReleased private void btnRazduziActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRazduziActionPerformed int indeks = tblZaduzenja.getSelectedRow(); ModelTabeleZaduzenja mtz = (ModelTabeleZaduzenja) tblZaduzenja.getModel(); selektovanoZaduzenje = mtz.vratiSelektovanoZaduzenje(indeks); if (selektovanoZaduzenje.getDatumRazduzenja() != null) { JOptionPane.showMessageDialog(this, "Clan je vec razduzio datu knjigu"); return; } selektovanoZaduzenje.getPrimerak().setRashodovan(false); selektovanoZaduzenje.getPrimerak().setZaduzen(false); PotvrdaORazduzivanju por = new PotvrdaORazduzivanju(this, true); por.pack(); por.setVisible(true); btnRazduzi.setEnabled(false); }//GEN-LAST:event_btnRazduziActionPerformed private void tblZaduzenjaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblZaduzenjaMouseClicked btnRazduzi.setEnabled(true); }//GEN-LAST:event_tblZaduzenjaMouseClicked private void btnZaduziActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnZaduziActionPerformed ClanoviZaZaduzenje czz = new ClanoviZaZaduzenje(this, true); int visina = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight() - 30; int sirina = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth() + 20; czz.setPreferredSize(new Dimension(sirina, visina)); czz.setBounds(-10, 0, sirina, visina); czz.pack(); czz.setVisible(true); }//GEN-LAST:event_btnZaduziActionPerformed /** * @param args the command line arguments */ // public static void main(String args[]) { // /* Set the Nimbus look and feel */ // //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. // * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html // */ // try { // for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { // if ("Nimbus".equals(info.getName())) { // javax.swing.UIManager.setLookAndFeel(info.getClassName()); // break; // } // } // } catch (ClassNotFoundException ex) { // java.util.logging.Logger.getLogger(ZaduzenjaForma.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // } catch (InstantiationException ex) { // java.util.logging.Logger.getLogger(ZaduzenjaForma.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // } catch (IllegalAccessException ex) { // java.util.logging.Logger.getLogger(ZaduzenjaForma.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // } catch (javax.swing.UnsupportedLookAndFeelException ex) { // java.util.logging.Logger.getLogger(ZaduzenjaForma.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); // } // //</editor-fold> // // /* Create and display the form */ // java.awt.EventQueue.invokeLater(new Runnable() { // public void run() { // new ZaduzenjaForma().setVisible(true); // } // }); // } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnRazduzi; private javax.swing.JButton btnZaduzi; private javax.swing.JLabel jLabel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel lblBrPrimeraka; private javax.swing.JLabel lblBrSlobodnihPrimeraka; private javax.swing.JLabel lblZaduzenaKnjigaLbl; private javax.swing.JTable tblZaduzenja; private javax.swing.JTextField txtPretragaZaduzenja; // End of variables declaration//GEN-END:variables public void popuniTabelu() { int indeksSelektovaneKnjige = gf.vratiIndeksSelektovaneKnjige(); selektovanaKnjiga = gf.vratiSelektovanuKnjigu(indeksSelektovaneKnjige); // Primerak p = new Primerak(); // p.setIsbn(selektovanaKnjiga.getIsbn()); listaZaduzenja = this.vratiZaduzenja(); // ArrayList<Zaduzenje> listaZaduzenjaZaSelektovanuKnjigu = new ArrayList<>(); // for (Zaduzenje zaduzenje : listaZaduzenja) { // if (zaduzenje.getKnjiga().getIsbn().equals(selektovanaKnjiga.getIsbn())) { // listaZaduzenjaZaSelektovanuKnjigu.add(zaduzenje); // } // } ModelTabeleZaduzenja mtz = new ModelTabeleZaduzenja(listaZaduzenja); tblZaduzenja.setModel(mtz); } private ArrayList<Zaduzenje> vratiZaduzenja() { KlijentskiZahtev kz = new KlijentskiZahtev(); Zaduzenje z = new Zaduzenje(); z.setKnjiga(selektovanaKnjiga); kz.setParametar(z); kz.setOperacija(Operacija.VRATI_ZADUZENJA); komunikacija.Komunikacija.getInstanca().posaljiKlijentskiZahtev(kz); ServerskiOdgovor so = komunikacija.Komunikacija.getInstanca().primiServerskiOdgovor(); ArrayList<Zaduzenje> listaZaduzenja = (ArrayList<Zaduzenje>) so.getOdgovor(); return listaZaduzenja; } private ArrayList<Primerak> vratiPrimerkeZaSelektovanuKnjigu(Primerak primerak) { KlijentskiZahtev kz = new KlijentskiZahtev(); kz.setOperacija(Operacija.VRATI_PRIMERKE); kz.setParametar(primerak); Komunikacija.getInstanca().posaljiKlijentskiZahtev(kz); ServerskiOdgovor so = Komunikacija.getInstanca().primiServerskiOdgovor(); ArrayList<Primerak> listaPrimeraka = (ArrayList<Primerak>) so.getOdgovor(); return listaPrimeraka; } public int vratiBrojSlobodnihPrimeraka(Knjiga knjiga) { brojSlobodnihPrimeraka = 0; Primerak p = new Primerak(); p.setIsbn(selektovanaKnjiga.getIsbn()); listaPrimeraka = vratiPrimerkeZaSelektovanuKnjigu(p); for (Primerak primerak : listaPrimeraka) { if (!primerak.isZaduzen() && !primerak.isRashodovan()) { brojSlobodnihPrimeraka++; } } return brojSlobodnihPrimeraka; } public void azurirajBrPrimeraka() { lblBrPrimeraka.setText(brojSlobodnihPrimeraka + ""); } public Zaduzenje getSelektovanoZaduzenje() { return selektovanoZaduzenje; } public void setSelektovanoZaduzenje(Zaduzenje selektovanoZaduzenje) { this.selektovanoZaduzenje = selektovanoZaduzenje; } public Clan getSelektovanClanZaZaduzenje() { return selektovanClanZaZaduzenje; } public void setSelektovanClanZaZaduzenje(Clan selektovanClanZaZaduzenje) { this.selektovanClanZaZaduzenje = selektovanClanZaZaduzenje; } public Knjiga getSelektovanaKnjiga() { return selektovanaKnjiga; } public void setSelektovanaKnjiga(Knjiga selektovanaKnjiga) { this.selektovanaKnjiga = selektovanaKnjiga; } public ArrayList<Zaduzenje> getListaZaduzenja() { return listaZaduzenja; } public void setListaZaduzenja(ArrayList<Zaduzenje> listaZaduzenja) { this.listaZaduzenja = listaZaduzenja; } public ArrayList<Primerak> getListaPrimeraka() { return listaPrimeraka; } public void setListaPrimeraka(ArrayList<Primerak> listaPrimeraka) { this.listaPrimeraka = listaPrimeraka; } public Radnik getUlogovaniRadnik() { return ulogovaniRadnik; } public void setUlogovaniRadnik(Radnik ulogovaniRadnik) { this.ulogovaniRadnik = ulogovaniRadnik; } public javax.swing.JLabel getLblBrSlobodnihPrimeraka() { return lblBrSlobodnihPrimeraka; } public void setLblBrSlobodnihPrimeraka(javax.swing.JLabel lblBrSlobodnihPrimeraka) { this.lblBrSlobodnihPrimeraka = lblBrSlobodnihPrimeraka; } public int getBrojSlobodnihPrimeraka() { return brojSlobodnihPrimeraka; } public void setBrojSlobodnihPrimeraka(int brojSlobodnihPrimeraka) { this.brojSlobodnihPrimeraka = brojSlobodnihPrimeraka; } public Primerak getSelektovaniPrimerak() { return selektovaniPrimerak; } public void setSelektovaniPrimerak(Primerak selektovaniPrimerak) { this.selektovaniPrimerak = selektovaniPrimerak; } }
[ "STEFAN94@chola" ]
STEFAN94@chola
a67cc4db2031045a068e0771c5ed168131c5bb7f
2ffa0e45339f4289a9d3e31e85d700ec281faf60
/InstallTest/app/src/main/java/com/example/installtest/MainActivity.java
c917f68f27567827c3588f5261e98ac38027c7d0
[]
no_license
hanfengzqh/judgeNetWork
1cd24c8a56ab5ab16e79ec05488cbb110797498c
094abcc8c786d0784d09ae5334328d08f6324ee3
refs/heads/master
2021-01-11T00:11:56.012602
2016-10-13T10:45:36
2016-10-13T10:45:36
70,579,985
3
0
null
null
null
null
UTF-8
Java
false
false
3,581
java
package com.example.installtest; import android.content.Intent; import android.net.Uri; import android.provider.Settings; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import java.io.File; /** * 仿360手机助手秒装和智能安装功能的主Activity。 * 原文地址:http://blog.csdn.net/guolin_blog/article/details/47803149 * @author guolin * @since 2015/12/7 */ public class MainActivity extends AppCompatActivity { TextView apkPathText; String apkPath; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); apkPathText = (TextView) findViewById(R.id.apkPathText); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == 0 && resultCode == RESULT_OK) { apkPath = data.getStringExtra("apk_path"); apkPathText.setText(apkPath); } } public void onChooseApkFile(View view) { Intent intent = new Intent(this, FileExplorerActivity.class); startActivityForResult(intent, 0); } public void onSilentInstall(View view) { if (!isRoot()) { Toast.makeText(this, "没有ROOT权限,不能使用秒装", Toast.LENGTH_SHORT).show(); return; } if (TextUtils.isEmpty(apkPath)) { Toast.makeText(this, "请选择安装包!", Toast.LENGTH_SHORT).show(); return; } final Button button = (Button) view; button.setText("安装中"); new Thread(new Runnable() { @Override public void run() { SilentInstall installHelper = new SilentInstall(); final boolean result = installHelper.install(apkPath); runOnUiThread(new Runnable() { @Override public void run() { if (result) { Toast.makeText(MainActivity.this, "安装成功!", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(MainActivity.this, "安装失败!", Toast.LENGTH_SHORT).show(); } button.setText("秒装"); } }); } }).start(); } public void onForwardToAccessibility(View view) { Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS); startActivity(intent); } public void onSmartInstall(View view) { if (TextUtils.isEmpty(apkPath)) { Toast.makeText(this, "请选择安装包!", Toast.LENGTH_SHORT).show(); return; } Uri uri = Uri.fromFile(new File(apkPath)); Intent localIntent = new Intent(Intent.ACTION_VIEW); localIntent.setDataAndType(uri, "application/vnd.android.package-archive"); startActivity(localIntent); } /** * 判断手机是否拥有Root权限。 * @return 有root权限返回true,否则返回false。 */ public boolean isRoot() { boolean bool = false; try { bool = (!new File("/system/bin/su").exists()) || (!new File("/system/xbin/su").exists()); } catch (Exception e) { e.printStackTrace(); } return bool; } }
[ "1017459102@qq.com" ]
1017459102@qq.com
f68a747a88f73a69f3d24af3482b07b2a485887d
41c6894bc13bd4321bf1155ff2442d591a7e500e
/Databases/PharmacistsAssistant/src/pwr/w11/medicinesDB/ViewHelper.java
9d6de935235cb8851ff8f4e3f7cb086ab4e549d9
[]
no_license
KacperZielinski/WPPT-INF
6743de542e77836d06ff4d993c2f9003317e795d
516797d92fe67daebb13203912746692c1cb07b3
refs/heads/master
2022-12-23T03:10:31.937432
2020-09-28T19:12:34
2020-09-28T19:12:34
173,590,531
0
0
null
2022-12-16T14:49:52
2019-03-03T15:09:07
Java
UTF-8
Java
false
false
4,274
java
package pwr.w11.medicinesDB; import java.util.ArrayList; import java.util.Collection; import java.util.Date; /** * Created by Kacper on 2018-01-17. */ public class ViewHelper { private boolean prescriptionB; private Date date; private Date expirationDate; private Double priceNet; private double priceBrutto; private int ID; private int ingredientID; private int medicamentID; private int productID; private int saleID; private Medicament medicament; private Medicament replacement; private MedicamentProduct medicamentProduct; private Sale.DOCUMENT_TYPE documentType; private String batchNumber; private String content; private String document; private String name; private String prescription; private String producer; private String replacementName; private String seller; private Sale sale; public Collection<Medicament> getMedicaments() { return medicaments; } public String getReplacementName() { return replacementName; } public void setReplacementName(String replacementName) { this.replacementName = replacementName; } public void setMedicaments(Collection<Medicament> medicaments) { this.medicaments = medicaments; } private Collection<Medicament> medicaments = new ArrayList<>(); public String getProducer() { return producer; } public Medicament getMedicament() { return medicament; } public int getProductID() { return productID; } public Date getExpirationDate() { return expirationDate; } public String getBatchNumber() { return batchNumber; } public int getID() { return ID; } public Medicament getReplacement() { return replacement; } public String getPrescription() { return prescription; } public MedicamentProduct getMedicamentProduct() { return medicamentProduct; } public int getSaleID() { return saleID; } public String getSeller() { return seller; } public Sale.DOCUMENT_TYPE getDocumentType() { return documentType; } public String getDocument() { return document; } public Date getDate() { return date; } public Sale getSale() { return sale; } public int getIngredientID() { return ingredientID; } public int getMedicamentID() { return medicamentID; } public String getName() { return name; } public String getContent() { return content; } public Double getPriceNet() { return priceNet; } public boolean getPrescriptionB() { return prescriptionB; } public double getPriceBrutto() { return priceBrutto; } public void setPriceBrutto(double priceBrutto) { this.priceBrutto = priceBrutto; } public void setIngredientID(int ingredientID) { this.ingredientID = ingredientID; } public void setMedicamentID(int medicamentID) { this.medicamentID = medicamentID; } public void setName(String name) { this.name = name; } public void setContent(String content) { this.content = content; } public void setPriceNet(Double priceNet) { this.priceNet = priceNet; } public void setPrescriptionB(boolean prescriptionB) { this.prescriptionB = prescriptionB; } public void setProducer(String producer) { this.producer = producer; } public void setMedicament(Medicament medicament) { this.medicament = medicament; } public void setProductID(int productID) { this.productID = productID; } public void setExpirationDate(Date expirationDate) { this.expirationDate = expirationDate; } public void setBatchNumber(String batchNumber) { this.batchNumber = batchNumber; } public void setID(int ID) { this.ID = ID; } public void setReplacement(Medicament replacement) { this.replacement = replacement; } public void setPrescription(String prescription) { this.prescription = prescription; } public void setMedicamentProduct(MedicamentProduct medicamentProduct) { this.medicamentProduct = medicamentProduct; } public void setSaleID(int saleID) { this.saleID = saleID; } public void setSeller(String seller) { this.seller = seller; } public void setDocumentType(Sale.DOCUMENT_TYPE documentType) { this.documentType = documentType; } public void setDocument(String document) { this.document = document; } public void setDate(Date date) { this.date = date; } public void setSale(Sale sale) { this.sale = sale; } }
[ "236698@student.pwr.edu.pl" ]
236698@student.pwr.edu.pl
5f92e6141ae4f6890c2ddfcabdb0278a60b1b59c
b5cedf885d3116257e1a2af199edfd70d1f2e061
/GaoQi/Homework5_2.java
84a4515b8c31a21b8364f0fb1863fb9ba9f4f9df
[]
no_license
allenhsu6/-java-
7fb83e06e7a5a317a8549f375050ca0a44cdfa99
1cbda13e0d59548b37cc2226e88bbf710f052c5f
refs/heads/master
2020-03-15T12:05:04.304206
2018-07-20T11:21:04
2018-07-20T11:21:04
132,136,154
0
0
null
null
null
null
UTF-8
Java
false
false
1,068
java
package GaoQi; /** * 有没有感受到多态带来的便捷? * 在你具体事例使用的时候,不知道到底要用到那个类,我就传入父类,然后现场父类引用指向子类对象 */ public class Homework5_2 { public static void main(String[] args) { Musician musician = new Musician(); musician.play(new Erhu()); musician.play(new Pinao()); } } class Instrument{ public void makeSound(){ System.out.println("使用乐器发出声音"); } } class Erhu extends Instrument{ @Override public void makeSound() { System.out.println("使用二胡在演奏"); } } class Pinao extends Instrument{ @Override public void makeSound() { System.out.println("天噜惹,他还会钢琴"); } } /** * 要能想到,乐手想要弹奏乐器,乐器是一个引用类型,是一个可实例化的对象啊 * 要学会作为参数传入乐手的技能列表中 */ class Musician{ public void play(Instrument instrument){ instrument.makeSound(); } }
[ "34368696+allenhsu6@users.noreply.github.com" ]
34368696+allenhsu6@users.noreply.github.com
1b36af9c3dd33176aac98f4ae33b351bfb90b532
1783fa452b7dd8273aee7ff4dad9082828816773
/dayDataEntity.java
6f3fbce9d1dd88e58d43e4cf716064fa5e33b24a
[]
no_license
thinhnguyenductn/SunshineApp
edd19584d570f1aa2d2546da8c91a72771bd8b4a
b00936907cb52fa8daa01fa9e6892bd4440eb0f7
refs/heads/main
2023-03-26T12:14:34.902687
2021-03-24T16:11:49
2021-03-24T16:11:49
349,498,216
0
0
null
null
null
null
UTF-8
Java
false
false
1,901
java
package com.example.sunshineapp; import android.util.Log; import androidx.annotation.NonNull; import androidx.room.Entity; import androidx.room.PrimaryKey; import java.sql.Date; import java.text.SimpleDateFormat; @Entity(tableName = "dayData") public class dayDataEntity { @NonNull @PrimaryKey private final Long date; @NonNull private final String maxTemp; @NonNull private final String minTemp; @NonNull private final String wDescrition; @NonNull private final String wHumidity; @NonNull private final String wPressure; @NonNull private final String wWind; public dayDataEntity (Long date, String maxTemp, String minTemp, String wDescrition, String wHumidity, String wPressure, String wWind){ this.date = date; this.maxTemp = maxTemp; this.minTemp = minTemp; this.wDescrition = wDescrition; this.wHumidity = wHumidity; this.wPressure = wPressure; this.wWind = wWind; } public String getWeekDay() { Date date = new Date(this.date*1000L); Log.d("dayData", date.toString()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE"); return simpleDateFormat.format(date); } public String getDate() { Date date = new Date(this.date*1000L); Log.d("dayData", date.toString()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd, MMMM, yyyy"); return simpleDateFormat.format(date); } public String getMaxTemp() { return maxTemp; } public String getMinTemp() { return minTemp; } public String getwDescrition() { return wDescrition; } public String getwHumidity() { return wHumidity; } public String getwPressure() { return wPressure; } public String getwWind() { return wWind; } }
[ "80892709+thinhnguyenductn@users.noreply.github.com" ]
80892709+thinhnguyenductn@users.noreply.github.com
3dd85e53383d5e6338b0a7a7ad6ae17470a1006f
044278382429ff472b6642bc51c1407616f4e511
/abator-extend/trunk/src/java/org/apache/ibatis/abator/api/AbatorRunner.java
bfcfb312b992cce236cbddcfd119aa51f81316f2
[]
no_license
albertodepaola/abator-extend
90804c88fd78e9c6f38bc0c019788d04e23891ba
b5ada551ca90fc92e74580ebeb895162b502148d
refs/heads/master
2021-01-19T13:33:18.828200
2009-04-30T08:09:22
2009-04-30T08:09:22
37,686,361
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
8,163
java
/* * Copyright 2006 The Apache Software Foundation * * 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.apache.ibatis.abator.api; import java.io.File; import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.StringTokenizer; import org.apache.ibatis.abator.config.AbatorConfiguration; import org.apache.ibatis.abator.config.xml.AbatorConfigurationParser; import org.apache.ibatis.abator.exception.InvalidConfigurationException; import org.apache.ibatis.abator.exception.XMLParserException; import org.apache.ibatis.abator.internal.DefaultShellCallback; import org.apache.ibatis.abator.internal.util.messages.Messages; /** * This class allows Abator to be run from the command line. * * @author Jeff Butler */ public class AbatorRunner { private static final String ARGUMENT_PREFIX = "-"; //$NON-NLS-1$ private static final String CONFIG_FILE = "-configfile"; //$NON-NLS-1$ private static final String OVERWRITE = "-overwrite"; //$NON-NLS-1$ private static final String CONTEXT_IDS = "-contextids"; //$NON-NLS-1$ private static final String TABLES = "-tables"; //$NON-NLS-1$ /** READING: Éú³ÉÆ÷Èë¿Ú (charr 2008-08-23) */ public static void main(String[] args) { Map arguments = parseCommandLine(args); if (!arguments.containsKey(CONFIG_FILE)) { writeLine(Messages.getString("RuntimeError.0")); //$NON-NLS-1$ return; } List warnings = new ArrayList(); String configfile = (String) arguments.get(CONFIG_FILE); File configurationFile = new File(configfile); if (!configurationFile.exists()) { writeLine(Messages.getString("RuntimeError.1", configfile)); //$NON-NLS-1$ return; } Set fullyqualifiedTables = new HashSet(); if (arguments.containsKey(TABLES)) { StringTokenizer st = new StringTokenizer((String)arguments.get(TABLES), ","); //$NON-NLS-1$ while (st.hasMoreTokens()) { String s = st.nextToken().trim(); if (s.length() > 0) { fullyqualifiedTables.add(s); } } } Set contexts = new HashSet(); if (arguments.containsKey(CONTEXT_IDS)) { StringTokenizer st = new StringTokenizer((String)arguments.get(CONTEXT_IDS), ","); //$NON-NLS-1$ while (st.hasMoreTokens()) { String s = st.nextToken().trim(); if (s.length() > 0) { contexts.add(s); } } } try { AbatorConfigurationParser cp = new AbatorConfigurationParser( warnings); AbatorConfiguration config = cp.parseAbatorConfiguration(configurationFile); DefaultShellCallback callback = new DefaultShellCallback(arguments.containsKey(OVERWRITE)); Abator abator = new Abator(config, callback, warnings); abator.generate(null, contexts, fullyqualifiedTables); } catch (XMLParserException e) { writeLine(Messages.getString("Progress.3")); //$NON-NLS-1$ writeLine(); List errors = e.getErrors(); Iterator iter = errors.iterator(); while (iter.hasNext()) { writeLine((String) iter.next()); } return; } catch (SQLException e) { e.printStackTrace(); return; } catch (IOException e) { e.printStackTrace(); return; } catch (InvalidConfigurationException e) { e.printStackTrace(); return; } catch (InterruptedException e) { // ignore (will never happen with the DefaultShellCallback) ; } Iterator iter = warnings.iterator(); while (iter.hasNext()) { writeLine((String) iter.next()); } if (warnings.size() == 0) { writeLine(Messages.getString("Progress.4")); //$NON-NLS-1$ } else { writeLine(); writeLine(Messages.getString("Progress.5")); //$NON-NLS-1$ } } private static void usage() { String lines = Messages.getString("Usage.Lines"); //$NON-NLS-1$ int iLines = Integer.parseInt(lines); for (int i = 0; i < iLines; i++) { String key = "Usage." + i; //$NON-NLS-1$ writeLine(Messages.getString(key)); } } private static void writeLine(String message) { System.out.println(message); } private static void writeLine() { System.out.println(); } private static Map parseCommandLine(String[] args) { if (args.length == 0) { usage(); System.exit(0); return null; // only to satisfy compiler, never returns } else if (args.length == 2) { if (args[0].startsWith(ARGUMENT_PREFIX)) { return parseNewCommandLine(args); } else { return parseOldCommandLine(args); } } else { return parseNewCommandLine(args); } } private static Map parseOldCommandLine(String[] args) { Map arguments = new HashMap(); arguments.put(CONFIG_FILE, args[0]); if ("true".equalsIgnoreCase(args[1])) { //$NON-NLS-1$ arguments.put(OVERWRITE, "Y"); //$NON-NLS-1$ } return arguments; } private static Map parseNewCommandLine(String[] args) { List errors = new ArrayList(); Map arguments = new HashMap(); for (int i = 0; i < args.length; i++) { if (CONFIG_FILE.equalsIgnoreCase(args[i])) { if ((i + 1) < args.length) { arguments.put(CONFIG_FILE, args[i + 1]); } else { errors.add(Messages.getString("RuntimeError.19", CONFIG_FILE)); //$NON-NLS-1$ } i++; } else if (OVERWRITE.equalsIgnoreCase(args[i])) { arguments.put(OVERWRITE, "Y"); //$NON-NLS-1$ } else if (CONTEXT_IDS.equalsIgnoreCase(args[i])) { if ((i + 1) < args.length) { arguments.put(CONTEXT_IDS, args[i + 1]); } else { errors.add(Messages.getString("RuntimeError.19", CONTEXT_IDS)); //$NON-NLS-1$ } i++; } else if (TABLES.equalsIgnoreCase(args[i])) { if ((i + 1) < args.length) { arguments.put(TABLES, args[i + 1]); } else { errors.add(Messages.getString("RuntimeError.19", TABLES)); //$NON-NLS-1$ } i++; } else { errors.add(Messages.getString("RuntimeError.20", args[i])); //$NON-NLS-1$ } } if (!errors.isEmpty()) { for (int i = 0; i < errors.size(); i++) { writeLine((String) errors.get(i)); } System.exit(-1); } return arguments; } }
[ "sheyudong@47d76a34-6e55-0410-9958-1dd311f0855e" ]
sheyudong@47d76a34-6e55-0410-9958-1dd311f0855e
a508274f1a19c5a0b432c1b06532ef6ffe6b3386
cfbf8a4852cb3e886b9d8151022aec304080129e
/RecyclerViewDemo/xufeilib/src/test/java/com/lcmf/xll/xufeilib/ExampleUnitTest.java
b80e60e6765e7b1254894a3352622826e7999af8
[]
no_license
lcmftianci/RecyclerViewDemo
88954ecff8fe556899d7a88ad4fa1a91df33d1c1
a8d025a1c758f58c463241abc95cd1ee46fbf78f
refs/heads/master
2021-01-21T17:29:56.466629
2017-07-06T22:18:39
2017-07-06T22:18:39
91,958,328
0
0
null
null
null
null
UTF-8
Java
false
false
384
java
package com.lcmf.xll.xufeilib; 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); } }
[ "707010543@qq.com" ]
707010543@qq.com
ac8d8c4fc68b3f73b3aa8d1822c0ea198a79b6f6
d280800ca4ec277f7f2cdabc459853a46bf87a7c
/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/InnerClassHierarchicalProperties.java
223dd813f62e08e7db5be783d067d4938587ca76
[ "Apache-2.0" ]
permissive
qqqqqcjq/spring-boot-2.1.x
e5ca46d93eeb6a5d17ed97a0b565f6f5ed814dbb
238ffa349a961d292d859e6cc2360ad53b29dfd0
refs/heads/master
2023-03-12T12:50:11.619493
2021-03-01T05:32:52
2021-03-01T05:32:52
343,275,523
0
0
null
null
null
null
UTF-8
Java
false
false
1,954
java
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://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.springframework.boot.configurationsample.specific; import org.springframework.boot.configurationsample.ConfigurationProperties; /** * Demonstrate inner classes end up in metadata regardless of position in hierarchy and * without the use of * {@link org.springframework.boot.configurationsample.NestedConfigurationProperty}. * * @author Madhura Bhave */ @ConfigurationProperties(prefix = "config") public class InnerClassHierarchicalProperties { private Foo foo; public Foo getFoo() { return this.foo; } public void setFoo(Foo foo) { this.foo = foo; } public static class Foo { private Bar bar; public Bar getBar() { return this.bar; } public void setBar(Bar bar) { this.bar = bar; } public static class Baz { private String blah; public String getBlah() { return this.blah; } public void setBlah(String blah) { this.blah = blah; } } } public static class Bar { private String bling; private Foo.Baz baz; public String getBling() { return this.bling; } public void setBling(String foo) { this.bling = foo; } public Foo.Baz getBaz() { return this.baz; } public void setBaz(Foo.Baz baz) { this.baz = baz; } } }
[ "caverspark@163.com" ]
caverspark@163.com
fc963194c70b677c5ff0b98c206e8ca8514f1b7d
1c722428cd5942915301b2ec61fc363539fbe614
/src/main/java/com/yu/mybatisplus/ApplicationWebXml.java
1ea859974d265f36e16281d36d95af85a9e00907
[]
no_license
3437292151/jhipster
52938ccb20bcc2bea4fa2ba3099c46c1696d5ec3
0a2d223cea3081d4cc37de9fd5dc479082a1acd7
refs/heads/master
2020-07-28T19:53:27.733002
2019-09-19T07:44:42
2019-09-19T07:44:42
209,517,871
0
0
null
2019-11-02T22:10:46
2019-09-19T09:46:33
Java
UTF-8
Java
false
false
830
java
package com.yu.mybatisplus; import com.yu.mybatisplus.config.DefaultProfileUtil; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; /** * This is a helper Java class that provides an alternative to creating a web.xml. * This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc. */ public class ApplicationWebXml extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { /** * set a default to use when no profile is configured. */ DefaultProfileUtil.addDefaultProfile(application.application()); return application.sources(YujhipsterApp.class); } }
[ "yuchanglong@epipechina.com" ]
yuchanglong@epipechina.com
34da9c342d8686c429fc099f74eee7ea22ace6e4
5d76b555a3614ab0f156bcad357e45c94d121e2d
/src/com/google/android/gms/drive/internal/RemoveEventListenerRequest.java
d6549fec459ab7a01272b86f17065161acc087a0
[]
no_license
BinSlashBash/xcrumby
8e09282387e2e82d12957d22fa1bb0322f6e6227
5b8b1cc8537ae1cfb59448d37b6efca01dded347
refs/heads/master
2016-09-01T05:58:46.144411
2016-02-15T13:23:25
2016-02-15T13:23:25
51,755,603
5
1
null
null
null
null
UTF-8
Java
false
false
1,128
java
package com.google.android.gms.drive.internal; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.common.internal.safeparcel.SafeParcelable; import com.google.android.gms.drive.DriveId; public class RemoveEventListenerRequest implements SafeParcelable { public static final Parcelable.Creator<RemoveEventListenerRequest> CREATOR = new ak(); final int ES; final DriveId Ew; final int xH; RemoveEventListenerRequest(int paramInt1, DriveId paramDriveId, int paramInt2) { this.xH = paramInt1; this.Ew = paramDriveId; this.ES = paramInt2; } public RemoveEventListenerRequest(DriveId paramDriveId, int paramInt) { this(1, paramDriveId, paramInt); } public int describeContents() { return 0; } public void writeToParcel(Parcel paramParcel, int paramInt) { ak.a(this, paramParcel, paramInt); } } /* Location: /home/dev/Downloads/apk/dex2jar-2.0/crumby-dex2jar.jar!/com/google/android/gms/drive/internal/RemoveEventListenerRequest.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "binslashbash@otaking.top" ]
binslashbash@otaking.top
9a0c5e39d54c786538b8ce6ce26474866d113e2b
4e390e1d3ee8db4277d7e86c74e67730a3583a1b
/components/edmontoninfo_android_components_sources/component-8/edmontoninfo_android/src/com/chrisolsen/edmontoninfo/db/FireStationsDB.java
f9fd5da2859bfb34224b13288d462b462f996563
[]
no_license
WasteService/WasteService.github.io
6dd28b9673895dc53c00bfee751a0378d684813a
fefe1185e6c7a53806f28e759f5104904a80db01
refs/heads/master
2023-01-05T09:56:28.057174
2020-10-28T10:13:53
2020-10-28T10:13:53
307,663,150
0
0
null
null
null
null
UTF-8
Java
false
false
2,362
java
package com.chrisolsen.edmontoninfo.db; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import com.chrisolsen.edmontoninfo.models.FireStation; import android.content.Context; import android.util.Log; public class FireStationsDB extends BaseDB { public static final String CNAME_ID = "_id"; public static final String CNAME_NAME = "name"; public static final String CNAME_ADDRESS = "address"; public static final String CNAME_NUMBER = "number"; public static final String CNAME_LAT = "latitude"; public static final String CNAME_LNG = "longitude"; public static final int CINDEX_ID = 0; public static final int CINDEX_NAME = 1; public static final int CINDEX_ADDRESS = 2; public static final int CINDEX_NUMBER = 3; public static final int CINDEX_LAT = 4; public static final int CINDEX_LNG = 5; public static final String TABLE_CREATE = "create table fire_stations (" + CNAME_ID + " integer primary key," + CNAME_NAME + " text," + CNAME_ADDRESS + " text," + CNAME_NUMBER + " text," + CNAME_LAT + " real," + CNAME_LNG + " real )"; public FireStationsDB(Context context) { super(context); } @Override protected String getTableName() { return "fire_stations"; } @Override protected String getColumnHackName() { return CNAME_NAME; } public ArrayList<FireStation> convertFromJSON(String rawJSON) { try { JSONArray jsonArr = new JSONArray(rawJSON); ArrayList<FireStation> stations = new ArrayList<FireStation>( jsonArr.length() ); for (int i=0; i<jsonArr.length(); i++) { JSONObject jObj = jsonArr.getJSONObject(i); FireStation station = new FireStation(); station.name = jObj.getString(FireStationsDB.CNAME_NAME); station.address = jObj.getString(FireStationsDB.CNAME_ADDRESS); station.number = jObj.getString(FireStationsDB.CNAME_NUMBER); station.latitude = jObj.getDouble(FireStationsDB.CNAME_LAT); station.longitude = jObj.getDouble(FireStationsDB.CNAME_LNG); stations.add(station); } return stations; } catch (JSONException e) { Log.e("JSON: School import", e.getMessage()); e.printStackTrace(); } catch (Exception e) { Log.e("JSON: School import", e.getMessage()); e.printStackTrace(); } return null; } }
[ "" ]
073397d6d7c567bac5433329d02468d78fe22639
ed073197f9c55a6ab61b73dcc4a51321185e525f
/sdk-extensions/aws/src/main/java/io/opentelemetry/sdk/extension/aws/resource/DockerHelper.java
f2cd0ddc720906e6915f7a7b7e7a0f3b7fa9c16a
[ "Apache-2.0" ]
permissive
lannerate/opentelemetry-java
1ae905fcd320be45adff41d7f66ca6d1509f434b
14d23dcd466ea100bcff372e750205dc9407a757
refs/heads/master
2023-01-19T21:58:26.714823
2020-11-26T02:12:56
2020-11-26T02:12:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,579
java
/* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.sdk.extension.aws.resource; import com.google.common.annotations.VisibleForTesting; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; class DockerHelper { private static final Logger logger = Logger.getLogger(DockerHelper.class.getName()); private static final int CONTAINER_ID_LENGTH = 64; private static final String DEFAULT_CGROUP_PATH = "/proc/self/cgroup"; private final String cgroupPath; DockerHelper() { this(DEFAULT_CGROUP_PATH); } @VisibleForTesting DockerHelper(String cgroupPath) { this.cgroupPath = cgroupPath; } /** * Get docker container id from local cgroup file. * * @return docker container ID. Empty string if it can`t be found. */ @SuppressWarnings("DefaultCharset") public String getContainerId() { try (BufferedReader br = new BufferedReader(new FileReader(cgroupPath))) { String line; while ((line = br.readLine()) != null) { if (line.length() > CONTAINER_ID_LENGTH) { return line.substring(line.length() - CONTAINER_ID_LENGTH); } } } catch (FileNotFoundException e) { logger.log(Level.WARNING, "Failed to read container id, cgroup file does not exist."); } catch (IOException e) { logger.log(Level.WARNING, "Unable to read container id: " + e.getMessage()); } return ""; } }
[ "noreply@github.com" ]
noreply@github.com
b63d709e483dcf6d4bf176119efe78fe93cbe5ba
cb0cbba1ef2eb8fa30831cbb153e469c9dba6e18
/src/test/java/com/github/swrirobotics/config/WebAppConfigurationAware.java
d2a9e250347916a55c88faf51220a9b561abcd5c
[]
no_license
StarskyRobotics/bag-database
83eda7b5eb74aafa394e3b7c7908d7c6f18f690f
e935b425869f5e0a2781acde7237c1208ed3eb91
refs/heads/master
2021-01-11T13:48:07.045696
2017-09-27T21:07:11
2017-09-27T21:07:11
86,618,765
1
0
null
2017-05-30T17:35:12
2017-03-29T18:58:31
Java
UTF-8
Java
false
false
2,977
java
// ***************************************************************************** // // Copyright (c) 2015, Southwest Research Institute® (SwRI®) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of Southwest Research Institute® (SwRI®) nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL Southwest Research Institute® BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. // // ***************************************************************************** package com.github.swrirobotics.config; import org.junit.Before; import org.junit.runner.RunWith; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.web.context.WebApplicationContext; import javax.inject.Inject; import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup; @RunWith(SpringJUnit4ClassRunner.class) @ActiveProfiles("test") @WebAppConfiguration @ContextConfiguration(classes = { ApplicationConfig.class, EmbeddedDataSourceConfig.class, JpaConfig.class, LiquibaseConfig.class, WebMvcConfig.class, WebSocketConfig.class, SecurityConfig.class }) public abstract class WebAppConfigurationAware { @Inject protected WebApplicationContext wac; protected MockMvc mockMvc; @Before public void before() { this.mockMvc = webAppContextSetup(this.wac).build(); } }
[ "preed@swri.org" ]
preed@swri.org
4b6f3550259fe405f103be5b9d800f9173d40e66
e3d28481ab299a4e0f4c8fe953ca4a7c1039770b
/tlibrary/src/main/java/com/btx/abero/LocalThumbnails.java
607021aea778612e1330ff1afa0116c1c43ac3bb
[]
no_license
abero1993/LocalThumbnails
91431af0169700014bd8cf5018f68ce620b87c60
0eb62a08f387eebc6e77ae0b4ff844dfce4f1208
refs/heads/master
2020-03-25T06:20:38.841437
2018-08-04T03:55:32
2018-08-04T03:55:32
143,495,944
0
0
null
null
null
null
UTF-8
Java
false
false
7,466
java
package com.btx.abero; import android.content.Context; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.util.Log; import android.widget.ImageView; import java.util.HashMap; import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * Created by abero on 2018/7/16. */ public class LocalThumbnails { private static final String TAG = "LocalThumbnails"; private Context mContext; private boolean enableMemoryCache; private boolean enableDiskCache; private int mMaxMemoryCacheSize; private int mMaxDiskCacheSize; private MemoryThumbnailsCache mMemoryCache; private DiskThumbnailsCache mDiskCache; // private ThreadPoolExecutor mExecutor; private Map<String, ImageView> mViewMap; private Map<String, BitmapRunable> mRunableMap; // private ThumbProc mThumbProc; private LocalThumbnails(Context context, boolean enableMemoryCache, boolean enableDiskCache, int memoryCacheSize, int diskCacheSize) { this.mContext = context; this.enableMemoryCache = enableMemoryCache; this.enableDiskCache = enableDiskCache; this.mMaxMemoryCacheSize = memoryCacheSize; this.mMaxDiskCacheSize = diskCacheSize; if (mMaxMemoryCacheSize <= 0) { int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024); //设置LruCache的缓存大小 mMaxMemoryCacheSize = maxMemory / 8; Log.i(TAG, "init memory size=" + mMaxMemoryCacheSize); } if (mMaxDiskCacheSize <= 0) { //200m mMaxDiskCacheSize = 200 * 1024 * 1024; } Log.i(TAG, "memory cache size=" + mMaxMemoryCacheSize + "KB"); mMemoryCache = new MemoryThumbnailsCache(mMaxMemoryCacheSize); mDiskCache = new DiskThumbnailsCache(context, mMaxDiskCacheSize); BlockingQueue workQueue = new LinkedBlockingDeque<>(); ThreadFactory threadFactory = Executors.defaultThreadFactory(); RejectedExecutionHandler handler = new ThreadPoolExecutor.DiscardPolicy(); mExecutor = new ThreadPoolExecutor(5, 20, 1, TimeUnit.SECONDS, workQueue, threadFactory, handler); mViewMap = new HashMap<>(20); mRunableMap = new HashMap<>(20); mThumbProc = new ThumbProc(context); } public static class Builder { private boolean enableMemoryCache = true; private boolean enableDiskCache = true; private int memoryCacheSize = 0; private int diskCacheSize = 0; private Context context; public Builder enableMemoryCache(boolean cache) { enableMemoryCache = cache; return this; } public Builder setMemoryCacheSize(int size) { memoryCacheSize = size; return this; } public Builder anableDiskCache(boolean cache) { enableDiskCache = cache; return this; } public Builder setDiskCacheSize(int size) { diskCacheSize = size; return this; } public LocalThumbnails create(Context context) { LocalThumbnails localThumbnails = new LocalThumbnails(context, enableMemoryCache, enableDiskCache, memoryCacheSize, diskCacheSize); return localThumbnails; } } public void load(String filePath, ImageView imageView) { if (!mViewMap.containsKey(filePath)) { mViewMap.put(filePath, imageView); BitmapRunable bitmapRunable = new BitmapRunable(filePath); mRunableMap.put(filePath, bitmapRunable); mExecutor.execute(bitmapRunable); } Log.i(TAG, "load map size="+mViewMap.size()); } private class BitmapRunable implements Runnable { private String mPath; public BitmapRunable(String filePath) { mPath = filePath; } @Override public void run() { String key = Util.hashKeyForDisk(mPath); Log.i(TAG, "start get thumbnails =" + mPath); Log.i(TAG, "md5=" + key); Bitmap bitmap = null; if (enableMemoryCache && enableDiskCache) { bitmap = mMemoryCache.getBitmap(key); if (null == bitmap) { bitmap = mDiskCache.getBitmap(key); if (null == bitmap) { bitmap = mThumbProc.getFileThumbnail(mPath); if (null == bitmap) { Log.e(TAG, "can not get thumbnails"); } else { Log.i(TAG, "got discache"); mMemoryCache.putBitmap(key, bitmap); mDiskCache.putBitmap(key, bitmap); } } else { Log.i(TAG, "got memorycache"); mMemoryCache.putBitmap(key, bitmap); } } } else if (!enableMemoryCache && enableDiskCache) { bitmap = mDiskCache.getBitmap(key); if (null == bitmap) { bitmap = mThumbProc.getFileThumbnail(mPath); if (null == bitmap) { Log.e(TAG, "can not get thumbnails"); } else { Log.i(TAG, "got discache"); mDiskCache.putBitmap(key, bitmap); } } } else if (enableMemoryCache && !enableDiskCache) { bitmap = mMemoryCache.getBitmap(key); if (null == bitmap) { bitmap = mThumbProc.getFileThumbnail(mPath); if (null == bitmap) { Log.e(TAG, "can not get thumbnails"); } else { Log.i(TAG, "got discache"); mMemoryCache.putBitmap(key, bitmap); } } } else { bitmap = mThumbProc.getFileThumbnail(mPath); if (null == bitmap) { Log.e(TAG, "can not get thumbnails"); } else { Log.i(TAG, "got discache"); } } sendBitmap(mPath, bitmap); } } private void sendBitmap(String key, Bitmap bitmap) { Message msg = mHandler.obtainMessage(); msg.what = 1; msg.obj = bitmap; Bundle bundle = new Bundle(); bundle.putString("key", key); msg.setData(bundle); mHandler.sendMessage(msg); } private Handler mHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { Bitmap bitmap = (Bitmap) msg.obj; String key = msg.getData().getString("key"); ImageView view = mViewMap.remove(key); view.setImageBitmap(bitmap); mRunableMap.remove(key); //bitmap.recycle(); } }; }
[ "1032041993@qq.com" ]
1032041993@qq.com
f606ea2cfc20dea8c26814b341cf3cb4ce3344f7
fb9eda4c2438cd60bee31763687422abedb17ef0
/Assginment no-2/pattern7.java
ed55f376e845bc068f8fa8546ebe338afb3bf90b
[]
no_license
aarti12345/Edac-May2021
ddd95b0fad660a1eeb6b2fea9f77bd375c579e30
01fc7d1dba2034be1c316490f77936ca5fb61b24
refs/heads/main
2023-06-23T21:11:57.326262
2021-07-26T07:17:22
2021-07-26T07:17:22
365,246,221
0
0
null
null
null
null
UTF-8
Java
false
false
226
java
class pattern7 { public static void main(String args[]) { for(int i=1;i<=5;i++) { for(int j=5;j>i;j--) { System.out.print(" "); } for(int k=1;k<=i;k++) { System.out.print(k+ " "); } System.out.println(); } } }
[ "noreply@github.com" ]
noreply@github.com
4e1246737dfa86ac632fecc4a2077974a1f27797
98ca2c6cd2cb4564e7270a8d285c5070ccd97968
/src/Service/CustomerPurchase.java
c6ec3719dfdb5279feddfc6d7efaea15aefa3858
[]
no_license
ongunmehmet/coffeshop
4303ca3ebc0a14d60f64aa0032179bd77bd10e2a
42150ccfcf88059e0a1343e482a95c1bcb5835ed
refs/heads/master
2023-07-04T00:54:29.875501
2021-07-30T20:35:35
2021-07-30T20:35:35
391,180,057
0
0
null
null
null
null
UTF-8
Java
false
false
46
java
package Service; class CustomerPurchase { }
[ "ongunmehmet21@gmail.com" ]
ongunmehmet21@gmail.com
2e5c95ef4c7fc63b71e3dfe9e7ba38061f33dc20
1db8c4b840a4043686e087a2ab92b39ed29ab2fa
/src/main/java/com/ynov/jh/demo/repository/AuthorityRepository.java
8493accd08887effb1efc72bf8993f3c572b463a
[]
no_license
bilonjea/cours-jhipster-jhdemo
b30d3efc9d04acd4f508e8cf5a82f3265351bdae
5138c4b35c6534fd1a223c8345731ccd3eb108f8
refs/heads/master
2023-04-15T13:22:28.146165
2021-04-29T19:35:02
2021-04-29T19:35:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
298
java
package com.ynov.jh.demo.repository; import com.ynov.jh.demo.domain.Authority; import org.springframework.data.jpa.repository.JpaRepository; /** * Spring Data JPA repository for the {@link Authority} entity. */ public interface AuthorityRepository extends JpaRepository<Authority, String> { }
[ "j.bilong@gmail.com" ]
j.bilong@gmail.com
cbb4bb5ca75d09d8ea00989afb492a0208da02c1
1cf008cb24753757601e4ca72bf7bfbe75f1f073
/src/com/jsjf/service/jzh/impl/SysFuiouMessageServiceImpl.java
60b99ace63531deebea638982ad9936ca8468484
[]
no_license
lslnx0307/system
22c8d919cf3be1ed40512d297b760663ec45d9cb
85907d6662d405912ca48678dc4c13447120cd21
refs/heads/master
2020-04-08T21:30:18.323733
2018-11-30T00:56:11
2018-11-30T00:56:11
159,746,917
0
0
null
null
null
null
UTF-8
Java
false
false
4,416
java
package com.jsjf.service.jzh.impl; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.jsjf.dao.product.DrProductInvestRepayInfoDAO; import com.jsjf.dao.system.SysFuiouMessageLogDAO; import com.jsjf.model.claims.DrClaimsCustomer; import com.jsjf.model.member.DrMember; import com.jsjf.model.product.DrProductInfo; import com.jsjf.model.product.DrProductInvest; import com.jsjf.model.product.DrProductInvestRepayInfo; import com.jsjf.model.system.SysFuiouMessageLog; import com.jsjf.service.claims.DrClaimsInfoService; import com.jsjf.service.jzh.SysFuiouMessageService; import com.jsjf.service.member.DrMemberService; import com.jsjf.service.product.DrProductInfoService; import com.jsjf.service.product.DrProductInvestService; @Service @Transactional public class SysFuiouMessageServiceImpl implements SysFuiouMessageService { @Autowired private SysFuiouMessageLogDAO sysFuiouMessageLogDAO; @Autowired private DrMemberService drMemberService; @Autowired private DrClaimsInfoService drClaimsInfoService; @Autowired private DrProductInfoService drProductInfoService; @Autowired private DrProductInvestService drProductInvestService; @Autowired private DrProductInvestRepayInfoDAO drProductInvestRepayInfoDAO; @Override public void updateMessageData(Map<String, Object>map){ List<DrMember>updateMemberList = (List<DrMember>)map.get("updateMemberList");//个人用户 List<DrClaimsCustomer>updateClaimsCustomerList = (List<DrClaimsCustomer>)map.get("updateClaimsCustomerList");//企业用户 List<DrProductInfo>updateProductInfoList = (List<DrProductInfo>)map.get("updateProductInfoList");//项目用户 List<SysFuiouMessageLog>updateLogList = (List<SysFuiouMessageLog>)map.get("updateLogList");//更新报文日志 List<DrProductInvest>updateInvestList = (List<DrProductInvest>) map.get("updateInvestList");//投资 List<DrProductInvestRepayInfo>updateInvestRepayInfoList = (List<DrProductInvestRepayInfo>) map.get("updateInvestRepayInfoList");//回款 if(updateMemberList != null && !updateMemberList.isEmpty()){ sysFuiouMessageLogDAO.batchUpdateJzhMessageResult(updateMemberList); } if(updateClaimsCustomerList != null && !updateClaimsCustomerList.isEmpty()){ sysFuiouMessageLogDAO.batchUpdateJzhMessageResult(updateClaimsCustomerList); } if(updateProductInfoList != null && !updateProductInfoList.isEmpty()){ sysFuiouMessageLogDAO.batchUpdateJzhMessageResult(updateProductInfoList); drClaimsInfoService.updateCompanyStatus(); } if(updateInvestList != null && !updateInvestList.isEmpty()){ sysFuiouMessageLogDAO.batchUpdateInvestJzhMessageResult(updateInvestList); } if(updateInvestRepayInfoList != null && !updateInvestRepayInfoList.isEmpty()){ sysFuiouMessageLogDAO.batchUpdateJzhMessageResult(updateInvestRepayInfoList); } if(updateLogList != null && !updateLogList.isEmpty()){ sysFuiouMessageLogDAO.updateOvercheck(updateLogList); } } @Override public void updateMemberMessageUpload(SysFuiouMessageLog log, List<DrMember>batchUpdateList){ sysFuiouMessageLogDAO.insert(log); if(!batchUpdateList.isEmpty()){ drMemberService.updateFileStatus(batchUpdateList); } } @Override public void updateProjectInventUpload(SysFuiouMessageLog log, List<DrProductInvest> batchUpdateList) { sysFuiouMessageLogDAO.insert(log); if(!batchUpdateList.isEmpty()){ drProductInvestService.updateFileStatus(batchUpdateList); } } @Override public void updateProjectInventRepayInfoUpload(SysFuiouMessageLog log, List<DrProductInvestRepayInfo> batchUpdateList) { sysFuiouMessageLogDAO.insert(log); if(!batchUpdateList.isEmpty()){ drProductInvestRepayInfoDAO.updateFileStatus(batchUpdateList); } } @Override public void updateCustomerMessageUpload(SysFuiouMessageLog log, List<DrClaimsCustomer>batchUpdateList){ sysFuiouMessageLogDAO.insert(log); if(!batchUpdateList.isEmpty()){ drClaimsInfoService.updateFileStatus(batchUpdateList); } } @Override public void updateProductInfoUpload(SysFuiouMessageLog log, List<DrProductInfo>batchUpdateList){ sysFuiouMessageLogDAO.insert(log); if(!batchUpdateList.isEmpty()){ drProductInfoService.updateFileStatus(batchUpdateList); } } }
[ "184576454@qq.com" ]
184576454@qq.com
8dadf234877441d5d9ac8995fa401dc117742e97
9a44caf666fb5ccbca16bfc81864aaa6e50c4ed5
/src/main/java/com/wb/httpforward/server/service/TranspondHttpService.java
6942a84952e780da88f0f494175400e29ee81fd6
[]
no_license
wang-bo/http-forward
e46e83ac4f51a674fdf402ba9241b050011e550a
8a5c04e8d259aed3f1d40ee9ad6b646b78c2cc5a
refs/heads/master
2021-01-17T07:23:12.989427
2016-07-01T03:28:21
2016-07-01T03:28:21
42,416,893
1
0
null
null
null
null
UTF-8
Java
false
false
2,951
java
package com.wb.httpforward.server.service; import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.alibaba.fastjson.JSON; import com.wb.httpforward.constant.ServerConstant; import com.wb.httpforward.server.client.RequesterClient; import com.wb.httpforward.server.client.ClientHolder; import com.wb.httpforward.server.client.TransponderClient; import com.wb.httpforward.util.ResponseMessage; /** * @author www * @date 2015年9月11日 */ public class TranspondHttpService { private static final Logger log = LoggerFactory.getLogger(TranspondHttpService.class); private static TranspondHttpService instance = new TranspondHttpService(); private TranspondHttpService() { } public static TranspondHttpService getInstance() { return instance; } private static int transpondRequestCount = 0; private static int transpondResponseCount = 0; /** * 请求转发方法的简单实现 * @param clientNo * @param responseValue */ public void transpondHttpRequest(final String clientNo, final String requestMessageString) { log.info(++transpondRequestCount + " server transpond request : " + requestMessageString); // 用开启新线程的方式简单实现异步,以后再改成线程池 new Thread(new Runnable() { public void run() { TransponderClient client = null; // 尝试发送10次,这里简单实现下,当有多个消息积压的时候,会开启多个线程,会失去这些消息的顺序,而且50秒后客户端未接收消息,就会丢失。 // 更健壮的实现应该使用任务队列 for (int i = 0; i < 10; i++) { client = ClientHolder.getInstance().getTransponderClient(clientNo); if (client == null) { try { TimeUnit.SECONDS.sleep(5); // 没获取到的话休眠5秒再重试 } catch (InterruptedException e) { e.printStackTrace(); } if (i == 9) { log.error("no transponder client with clientNo: " + clientNo); } continue; } client.responseValue(requestMessageString); break; } } }).start(); } /** * 转发response给请求端 * @param responseMessage */ public void transpondHttpResponse(String responseMessageString) { ResponseMessage responseMessage = JSON.parseObject(responseMessageString, ResponseMessage.class); if (ServerConstant.LOG_WITH_BODY || responseMessage.getBody() == null) { log.info(++transpondResponseCount + " server transpond response: " + responseMessageString); } else { log.info(++transpondResponseCount + " server transpond response: " + responseMessage.logStringWithNoBody()); } Integer code = responseMessage.getCode(); if (code != null) { RequesterClient client = ClientHolder.getInstance().getRequesterClient(code); if (client != null) { client.response(responseMessage); } } } }
[ "wangbo" ]
wangbo
6545bc849a28d2213cb883b64190a2485a82b225
8139cc291867c781e2511c3dc95f18af6bd46adb
/android/build/generated/source/buildConfig/debug/org/lovebing/reactnative/baidumap/BuildConfig.java
d49b704b8cfc865e23804122968191cae343664c
[]
no_license
sybil052/react-native-baidu-map-xzx
267546ad66c771a8df47637e276d3d5092bb9f0e
88a15f7d8508b6ad9be2aa41e5fbae9526ee2ce2
refs/heads/master
2021-01-20T14:19:27.611966
2017-11-16T06:27:13
2017-11-16T06:27:13
90,591,369
4
3
null
null
null
null
UTF-8
Java
false
false
473
java
/** * Automatically generated file. DO NOT MODIFY */ package org.lovebing.reactnative.baidumap; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "org.lovebing.reactnative.baidumap"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
[ "947538363@qq.com" ]
947538363@qq.com
232eecca8a52e718932e945fb43781ff8717b773
030a109b55f8ae7f8b95760523634f553ca72121
/src/main/java/guida/net/login/handler/CharlistRequestHandler.java
8cc8b76344b9aebc7a218d54fd2007cd42bc7fc2
[]
no_license
DaphyMorph/Guida83
1d34b877500b41a0111c2c68c8c2acdf0d4bcc3b
b6b3c69f099169c2a60c9ef156220a87dd4b09b1
refs/heads/main
2023-03-19T16:24:10.045834
2020-12-27T12:23:59
2020-12-27T12:23:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,996
java
/* * This file is part of Guida. * Copyright (C) 2020 Guida * * Guida is a fork of the OdinMS MapleStory Server. * The following is the original copyright notice: * * This file is part of the OdinMS Maple Story Server * Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> * Matthias Butz <matze@odinms.de> * Jan Christian Meyer <vimes@odinms.de> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License version 3 * as published by the Free Software Foundation. You may not use, modify * or distribute this program under any other version of the * GNU Affero General Public License. * * 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package guida.net.login.handler; import guida.client.MapleClient; import guida.net.AbstractMaplePacketHandler; import guida.tools.MaplePacketCreator; import guida.tools.data.input.SeekableLittleEndianAccessor; public class CharlistRequestHandler extends AbstractMaplePacketHandler { @Override public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { if (c.getLoginState() == MapleClient.LOGIN_LOGGEDIN) { slea.readByte(); final int server = slea.readByte(); final int channel = slea.readByte() + 1; c.setWorld(server); //log.info("Client is connecting to server {} channel {}", server, channel); c.setChannel(channel); c.sendPacket(MaplePacketCreator.reauthenticateClient(c)); c.sendCharList(server); } } }
[ "y765432100@hotmail.com" ]
y765432100@hotmail.com
434c2895f4e00e4db6d2daefa1435ab874b6bcc2
c3c04f63cc6bcd037ed220a09047ee7f1f088575
/src/main/java/com/eplusing/mall/web/bean/Response.java
ba0520bc5d9d3129adfb421174637433548cde8b
[]
no_license
eeplusing/mall-web
b17097f09848fa287d68f43404f0b952938b2c08
b47876d5c97ff9de58205fdb501cb5fa53716ef1
refs/heads/master
2022-12-22T13:26:21.415169
2019-06-12T16:19:21
2019-06-12T16:19:21
191,605,199
0
0
null
2022-12-10T05:40:48
2019-06-12T16:12:32
Java
UTF-8
Java
false
false
870
java
package com.eplusing.mall.web.bean; public class Response { //200成功,500失败 private String code; private String msg; private Product data; public Response(String code, String msg) { super(); this.code = code; this.msg = msg; } public Response(String code, String msg, Product data) { super(); this.code = code; this.msg = msg; this.data = data; } @Override public String toString() { return "Response [code=" + code + ", msg=" + msg + ", data=" + data + "]"; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public Object getData() { return data; } public void setData(Product data) { this.data = data; } }
[ "epluisng@gmail.com" ]
epluisng@gmail.com
f68147408b6a5ea149cb0b9934fa1553056d02ed
8be9bb3e428335c33c893ee605766be46ec1952a
/src/main/java/com/dhcc/wechatdemo/service/KfService.java
89c156898d9210c842d01b27c8a2e9d121f89bc0
[]
no_license
hsy16007/wxDemo
131bbccf375d69121b5c6a8061c1c24d9e0decba
cb07430dc86b116dd9f2fdb4aa826f6a9ff48c3d
refs/heads/master
2020-09-30T23:36:41.147037
2019-12-05T07:30:55
2019-12-05T07:30:55
227,400,639
1
0
null
2019-12-11T15:40:04
2019-12-11T15:40:03
null
UTF-8
Java
false
false
7,529
java
package com.dhcc.wechatdemo.service; import com.alibaba.fastjson.JSONObject; import com.dhcc.wechatdemo.constant.KfConstants; import com.dhcc.wechatdemo.entity.KfAccount; import com.dhcc.wechatdemo.entity.message.kf.BaseKfMsg; import com.dhcc.wechatdemo.utils.HttpHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; /** * @description: 客服管理相关 * @author: Liu Denghui * @time: 2019/12/2 15:46 */ @Service public class KfService { private Logger logger= LoggerFactory.getLogger(KfService.class); /** * 添加客服账号 * @param accessToken accessToken * @param kfAccount 新增的客服信息 * @return JSONObject */ public JSONObject addKfAccount(String accessToken, KfAccount kfAccount){ // 设置url String url = KfConstants.ADD_KF_ACCOUNT.replace("ACCESS_TOKEN", accessToken); JSONObject jsonObject = new JSONObject(); try { logger.info("开始添加客服账号了"); logger.info("客服账号:" + kfAccount.getKf_account()); logger.info("客服昵称:" + kfAccount.getNickname()); logger.info("客服密码:" + kfAccount.getPassword()); jsonObject = HttpHelper.doPost(url, kfAccount); logger.info("添加客服账号成功"); } catch (Exception e) { logger.error("添加客服账号失败"); e.printStackTrace(); } return jsonObject; } /** * 修改客服帐号 * @param accessToken accessToken * @param kfAccount 修改的客服信息 * @return JSONObject */ public JSONObject updateKfAccount(String accessToken, KfAccount kfAccount){ // 设置url String url = KfConstants.UPDATE_KF_ACCOUNT.replace("ACCESS_TOKEN", accessToken); JSONObject jsonObject = new JSONObject(); try { logger.info("开始修改客服账号了"); logger.info("客服账号:" + kfAccount.getKf_account()); logger.info("客服昵称:" + kfAccount.getNickname()); logger.info("客服密码:" + kfAccount.getPassword()); jsonObject = HttpHelper.doPost(url, kfAccount); logger.info("修改客服账号成功"); } catch (Exception e) { logger.error("修改客服账号失败"); e.printStackTrace(); } return jsonObject; } /** * 删除客服账号 * @param accessToken accessToken * @param kfAccount 删除的客服信息 * @return JSONObject */ public JSONObject delKfAccount(String accessToken, KfAccount kfAccount){ // 设置url String url = KfConstants.DEL_KF_ACCOUNT.replace("ACCESS_TOKEN", accessToken); JSONObject jsonObject = new JSONObject(); try { logger.info("开始删除客服账号了"); logger.info("客服账号:" + kfAccount.getKf_account()); logger.info("客服昵称:" + kfAccount.getNickname()); logger.info("客服密码:" + kfAccount.getPassword()); jsonObject = HttpHelper.doPost(url, kfAccount); logger.info("删除客服账号成功"); } catch (Exception e) { logger.error("删除客服账号失败"); e.printStackTrace(); } return jsonObject; } /** * 设置客服帐号的头像 * @param accessToken accessToken * @param kfAccount 要设置头像的客服信息,包含Kf_account * @return JSONObject */ public JSONObject updateKfHeadImg(String accessToken, KfAccount kfAccount) throws IOException{ // 设置url String url = KfConstants.UPLOAD_KF_HEAD_IMG.replace("ACCESS_TOKEN", accessToken) .replace("KFACCOUNT", kfAccount.getKf_account()); String filePath = "C:/Users/15564/Desktop/小程序前台/小程序使用图片/菜品图片/蛋挞.jpg"; File file = new File(filePath); if (!file.exists() || !file.isFile()){ throw new IOException("文件不存在"); } JSONObject jsonObject = new JSONObject(); try { logger.info("开始设置客服帐号的头像了"); logger.info("客服账号:" + kfAccount.getKf_account()); logger.info("图片路径:" + filePath); jsonObject = HttpHelper.uploadMedia(url, file, null); logger.info("设置客服帐号的头像成功"); } catch (Exception e) { logger.error("设置客服帐号的头像失败"); e.printStackTrace(); } return jsonObject; } /** * 获取所有客服账号 * @param accessToken accessToken * @return JSONObject */ public JSONObject getKfList(String accessToken){ // 设置url String url = KfConstants.GET_KF_LIST.replace("ACCESS_TOKEN", accessToken); JSONObject jsonObject = new JSONObject(); try { logger.info("开始获取所有客服账号了"); jsonObject = HttpHelper.doGet(url); logger.info("获取所有客服账号成功"); } catch (Exception e) { logger.error("获取所有客服账号失败"); e.printStackTrace(); } return jsonObject; } /** * 发送客服消息 * @param accessToken accessToken * @param message 返回的客服信息 * @return JSONObject */ public JSONObject sendKfMsg(String accessToken, BaseKfMsg message){ // 设置url String url = KfConstants.SEND_KF_MSG.replace("ACCESS_TOKEN", accessToken); JSONObject jsonObject = new JSONObject(); try { logger.info("开始发送客服信息了"); if (message.getCustomservice() != null){ logger.info("发送信息的客服账号为:" + message.getCustomservice().getKf_account()); } logger.info("发送的信息类型为:" + message.getMsgtype()); jsonObject = HttpHelper.doPost(url, message); logger.info("发送客服信息成功"); } catch (Exception e) { logger.error("发送客服信息失败"); e.printStackTrace(); } return jsonObject; } /** * 设置客服输入状态 * @param accessToken accessToken * @param toUser 普通用户(openid) * @param command 输入状态:"Typing":对用户下发“正在输入"状态 "CancelTyping":取消对用户的”正在输入"状态 * @return JSONObject */ public JSONObject typingKfMsg(String accessToken, String toUser, String command){ // 设置url String url = KfConstants.TYPING_KF_MSG.replace("ACCESS_TOKEN", accessToken); JSONObject jsonObject = new JSONObject(); Map<String, String> map = new HashMap<>(); map.put("touser", toUser); map.put("command", command); try { logger.info("开始设置客服输入状态了"); logger.info("输入状态为:" + command); jsonObject = HttpHelper.doPost(url, map); logger.info("设置客服输入状态成功"); } catch (Exception e) { logger.error("设置客服输入状态失败"); e.printStackTrace(); } return jsonObject; } }
[ "15564835101@163.com" ]
15564835101@163.com
bcb28407c32bf0e349af8b9f24d6afa13a62b1fd
92b3ee34bbb6f2d2d0e8d6c8f44bf43d7b3fddcc
/app/src/main/java/com/wx/project/dialogutil/dialog/CheckBoxDialog.java
cba063cd09e6804b415acb5489d8d019cbde4589
[]
no_license
momo123/DialogUtil
11503fe0a4cb165d2533b15c7017c4d649045320
6f67cc4d4c51b79fcee7cde87b8be11361fb6834
refs/heads/master
2020-03-18T23:01:03.781890
2018-05-30T03:58:18
2018-05-30T03:58:18
135,237,571
0
0
null
null
null
null
UTF-8
Java
false
false
3,540
java
package com.wx.project.dialogutil.dialog; import android.app.AlertDialog; import android.content.Context; import android.os.Bundle; import android.support.annotation.StyleRes; import android.view.Display; import android.view.View; import android.view.WindowManager; import android.widget.AdapterView; import android.widget.Button; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; import com.wx.project.dialogutil.adapter.CheckBoxAdapter; import com.wx.project.dialogutil.adapter.TextAdapter; import com.wx.project.dialogutil.R; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; /** * 单选 * Created by WangXin on 2018/5/24. */ public class CheckBoxDialog extends AlertDialog { private LinearLayout layoutContent; private Context context; private TextView tvTitle; private Button btnNeg; private Button btnPos; private ListView listView; private List<JSONObject> dataList = new ArrayList<>(); private CheckBoxAdapter adapter; public CheckBoxDialog(Context context, @StyleRes int themeResId,List<JSONObject> dataList) { super(context, themeResId); this.context = context; this.dataList = dataList; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dialog_checkbox); WindowManager windowManager = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); final Display display = windowManager.getDefaultDisplay(); layoutContent = (LinearLayout)findViewById(R.id.layout_content); layoutContent.setLayoutParams(new FrameLayout.LayoutParams((int) (display .getWidth() * 0.75), LinearLayout.LayoutParams.WRAP_CONTENT)); tvTitle = (TextView) this.findViewById(R.id.tv_title); btnNeg = (Button)this.findViewById(R.id.btn_neg); btnPos = (Button)this.findViewById(R.id.btn_pos); listView = (ListView)this.findViewById(R.id.listview); adapter = new CheckBoxAdapter(context,dataList); listView.setAdapter(adapter); } public void setOnItemClickEvent(final AdapterView.OnItemClickListener listener){ if (listView == null){ return; } listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { listener.onItemClick(parent,view,position,id); dismiss(); } }); } public void setTitle(String text){ if (tvTitle == null){ return; } tvTitle.setText(text+""); } public void setNegBtn(String text){ if (btnNeg == null){ return; } btnNeg.setText(text); btnNeg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); } public void setPosBtn(String text, final View.OnClickListener listener){ if (btnPos == null){ return; } btnPos.setText(text); btnPos.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { listener.onClick(v); dismiss(); } }); } }
[ "1396530501@qq.com" ]
1396530501@qq.com
67265f4086f5f18fd6dcb88613a349edac0d9110
742c8d61efe29050d6d9b446db5e3e84ead5efb6
/plugins/dsl/com.vectorsf.jvoice.prompt.model.edit/src-gen/com/vectorsf/jvoice/prompt/model/voiceDsl/provider/PromptDslItemProvider.java
be322cd1505452454dc12b27b1c1c37448bec203
[]
no_license
felixvelasco/test
f2d3e8bf6b177c1ce331b901a973f820f05e697a
156586bd5c94c4962b29c13d723ab87e209d1809
refs/heads/master
2021-01-10T00:59:41.318689
2014-04-07T10:16:35
2014-04-07T10:17:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,089
java
/** */ package com.vectorsf.jvoice.prompt.model.voiceDsl.provider; import com.vectorsf.jvoice.prompt.model.voiceDsl.PromptDsl; import java.util.Collection; import java.util.List; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.IItemPropertySource; import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; /** * This is the item provider adapter for a {@link com.vectorsf.jvoice.prompt.model.voiceDsl.PromptDsl} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class PromptDslItemProvider extends VoiceDslItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PromptDslItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); } return itemPropertyDescriptors; } /** * This returns PromptDsl.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/PromptDsl")); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { String label = ((PromptDsl)object).getName(); return label == null || label.length() == 0 ? getString("_UI_PromptDsl_type") : getString("_UI_PromptDsl_type") + " " + label; } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } }
[ "fvelascov@ext.vectorsf.com" ]
fvelascov@ext.vectorsf.com
b000e974706bb0c7131e15d557584d05c87e6bca
dfb45b58ee4cc74ef8c2830f9047eb8389768ee1
/src/analysis/BasicChangeCouplingMeasure.java
3a8e5db2e1c97d38ba9b75b8bed7ddc5ed322f14
[]
no_license
whu-king/GitCommitAnalysis
abe83c3555da8084225a68d20e4497c1180374a5
4f594b949e066d3f6023621790d7491e8632461c
refs/heads/master
2020-06-15T22:31:29.727954
2017-06-08T12:32:57
2017-06-08T12:32:57
75,261,739
0
0
null
null
null
null
UTF-8
Java
false
false
4,848
java
package analysis; import model.fileGraph.*; import model.gitLog.FileChange; import model.gitLog.GitCommit; import model.gitLog.GitStat; import utils.FormatConversionUtil; import java.io.File; import java.util.*; /** * Created by Administrator on 2016/12/28. */ public class BasicChangeCouplingMeasure implements ChangeCouplingMeasure { @Override public int getNumberOfNCoupledClass(Date date,Node node, int n, FileGraph graph) { HashMap<String, Integer> coupledClasses = getCoupledClasses(date,node, n, graph); return coupledClasses.values().size(); } @Override public int getSumOfNCoupledLinks(Date date, Node node, int n, FileGraph graph) { HashMap<String, Integer> coupledClasses = getCoupledClasses(date,node, n, graph); int sum = 0; for(Integer weight : coupledClasses.values()){ sum += weight; } return sum; } @Override public double getTimeExpSumOfNCoupledLinks(Date date, Node node, int n, FileGraph graph) { HashMap<String, Integer> coupledClasses = getCoupledClasses(date,node, n, graph); List<GitCommit> gitCommitOfTargetClass = node.getFile().getChangeLog(); List<String> gitCommitSHA = new ArrayList<String>(); for(GitCommit gitCommit : gitCommitOfTargetClass){ Date commitDate = FormatConversionUtil.getDateFromString(gitCommit.getDate()); if(commitDate.after(date)) continue; gitCommitSHA.add(gitCommit.getCommitSHA()); } int size = gitCommitSHA.size(); double result = 0; for(String className : coupledClasses.keySet()){ Node anotherNode = graph.findNodeByPath(className); List<GitCommit> anotherGitCommits = anotherNode.getFile().getChangeLog(); for(GitCommit gitCommit : anotherGitCommits){ Date commitDate = FormatConversionUtil.getDateFromString(gitCommit.getDate()); if(commitDate.after(date)) continue; String sha = gitCommit.getCommitSHA(); int index = 0; if((index = gitCommitSHA.indexOf(sha)) > -1){ result += 1/Math.pow(2,size - index); } } } return result; } @Override public double getTimeLinearSumOfNCoupledLinks(Date nowDate,Node node, int n, FileGraph graph) { HashMap<String, Integer> coupledClasses = getCoupledClasses(nowDate,node, n, graph); List<GitCommit> gitCommitOfTargetClass = node.getFile().getChangeLog(); List<String> gitCommitSHA = new ArrayList<String>(); for(GitCommit gitCommit : gitCommitOfTargetClass){ Date commitDate = FormatConversionUtil.getDateFromString(gitCommit.getDate()); if(commitDate.after(nowDate) || commitDate.equals(nowDate)) continue; gitCommitSHA.add(gitCommit.getCommitSHA()); } int size = gitCommitSHA.size(); if(size == 0) return 0; double result = 0; for(String className : coupledClasses.keySet()){ Node anotherNode = graph.findNodeByPath(className); List<GitCommit> anotherGitCommits = anotherNode.getFile().getChangeLog(); for(GitCommit gitCommit : anotherGitCommits){ Date commitDate = FormatConversionUtil.getDateFromString(gitCommit.getDate()); if(commitDate.after(nowDate) || commitDate.equals(nowDate)) continue; String sha = gitCommit.getCommitSHA(); int index = 0; if((index = gitCommitSHA.indexOf(sha)) > -1){ result = result + 1.0/(size + 1 - index); } } } return result; } public static HashMap<String, Integer> getCoupledClasses(Date date, Node node, int n, FileGraph graph) { HashMap<String,Integer> coupledClasses = new HashMap<String, Integer>(); String nodeName = node.getFile().getFilePath(); CodeFile codeFile = node.getFile(); List<GitCommit> gitCommits = codeFile.getChangeLog(); for(GitCommit gitCommit : gitCommits){ Date commitDate = FormatConversionUtil.getDateFromString(gitCommit.getDate()); if(commitDate.after(date) || commitDate.equals(date)) continue; List<FileChange> fileChanges = gitCommit.getFileDiff().getDiffs(); for(FileChange fileChange : fileChanges ){ String className = fileChange.getPath(); if(coupledClasses.containsKey(className)) continue; Edge edge = graph.findEdgeByString(nodeName,className); if(edge == null) continue; if(edge.getWeight() >= n) coupledClasses.put(className,edge.getWeight()); } } return coupledClasses; } }
[ "971069014@qq.com" ]
971069014@qq.com
996ba62608bf5b6437e3281949249f91c9fa7c93
bec9b8282a0bf27c4b6bd3f75f290ca2c96a3ce5
/TT-AnalyserGUIV0.5/src/com/mostafa/view/QueryPanel_1.java
45a60685adf5ad2f8d00807f54bae5f183a0aa7b
[]
no_license
Ma7amed/TTAnalyser
5e2f11b28ccb8484ed544c1fdadc6271bc747c99
e7ef41bc0be0a4a23857a6a84d2120e05c5d48de
refs/heads/master
2021-01-10T20:56:05.235159
2014-10-31T20:49:21
2014-10-31T20:49:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,582
java
package com.mostafa.view; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Image; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import org.apache.log4j.Logger; public class QueryPanel_1 extends JPanel { static Logger logger = Logger.getLogger(QueryPanel_1.class); private JButton queryBtn; private JComboBox yearCombo; private JComboBox monthCombo; private JComboBox dayCombo; private JLabel yearLabel; private JLabel monthLabel; private JLabel dayLabel; private QueryPanelListener listener; private Image img1; private Image img2; private Thread t; public QueryPanel_1() { String[] year = new String[30]; for (int i = 0; i <= 29; i++) year[i] = Integer.toString(i + 2000); String[] month = new String[12]; for (int i = 0; i <= 11; i++) month[i] = Integer.toString(i + 1); String[] day = new String[31]; for (int i = 0; i <= 30; i++) day[i] = Integer.toString(i + 1); yearCombo = new JComboBox(year); yearCombo.setToolTipText("Year"); monthCombo = new JComboBox(month); monthCombo.setToolTipText("Month"); dayCombo = new JComboBox(day); dayCombo.setToolTipText("Day"); yearLabel = new JLabel("Year:"); monthLabel = new JLabel("Month:"); dayLabel = new JLabel("Day:"); initComboBox(); queryBtn = new JButton(); queryBtn.setToolTipText("Query Uncleared TTs"); try { img1 = ImageIO.read(getClass().getResource("/images/search.png")); img2 = ImageIO.read(getClass().getResource("/images/search2.png")); queryBtn.setIcon(new ImageIcon(img2)); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } queryBtn.setIcon(new ImageIcon(img1)); queryBtn.setPreferredSize(new Dimension(queryBtn.getPreferredSize().width,yearCombo.getPreferredSize().height)); // queryBtn.setPreferredSize(new JButton("Query!!").getPreferredSize()); queryBtn.setHorizontalAlignment(SwingConstants.LEFT); //setLayout(new FlowLayout(FlowLayout.LEFT)); // add(queryField); /*add(yearCombo); add(monthCombo); add(dayCombo); add(queryBtn);*/ queryBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { listener.queryOccurred(); } }); setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); // First Row gc.gridx = 0; gc.gridy = 0; gc.weightx = 0; gc.weighty = 1; gc.gridx = 0; //gc.fill = GridBagConstraints.NONE; gc.anchor = GridBagConstraints.LINE_START; gc.insets = new Insets(5, 10, 0, 10); add(yearLabel, gc); //gc.anchor = GridBagConstraints.LINE_START; //gc.fill = GridBagConstraints.HORIZONTAL; gc.gridx = 1; gc.gridy = 0; gc.insets = new Insets(5, 0, 0, 10); add(monthLabel, gc); gc.gridx = 2; gc.gridy = 0; add(dayLabel, gc); // Second Row gc.gridx=0; gc.gridy=1; gc.insets = new Insets(0, 10, 10, 10); add(yearCombo,gc); gc.gridx=1; gc.gridy=1; gc.insets = new Insets(0, 0, 10, 10); add(monthCombo,gc); gc.gridx=2; gc.gridy=1; add(dayCombo,gc); gc.gridx=3; gc.gridy=1; gc.weightx=1; add(queryBtn,gc); } private void initComboBox() { // set value to today DateFormat yearformat = new SimpleDateFormat("yyyy"); DateFormat monthformat = new SimpleDateFormat("MM"); DateFormat dayformat = new SimpleDateFormat("dd"); Calendar cal = Calendar.getInstance(); yearCombo.setSelectedItem(yearformat.format(cal.getTime())); monthCombo.setSelectedItem(monthformat.format(cal.getTime())); dayCombo.setSelectedItem(dayformat.format(cal.getTime())); } public void disableQueryBtn() { queryBtn.setEnabled(false); yearCombo.setEnabled(false); monthCombo.setEnabled(false); dayCombo.setEnabled(false); yearLabel.setEnabled(false); monthLabel.setEnabled(false); dayLabel.setEnabled(false); showLoading(); } public void enableQueryBtn() { queryBtn.setEnabled(true); yearCombo.setEnabled(true); monthCombo.setEnabled(true); dayCombo.setEnabled(true); yearLabel.setEnabled(true); monthLabel.setEnabled(true); dayLabel.setEnabled(true); showQuery(); } public String getDate() { String date = yearCombo.getSelectedItem().toString() + monthCombo.getSelectedItem().toString() + dayCombo.getSelectedItem().toString(); logger.debug("Selected Date: " + date); return date; } public void setListener(QueryPanelListener listener) { this.listener = listener; } public void showLoading() { t = new Thread(new Runnable() { public void run() { while (true) { try { queryBtn.setIcon(new ImageIcon(img1)); Thread.sleep(500); queryBtn.setIcon(new ImageIcon(img2)); Thread.sleep(500); } catch (InterruptedException e) { // TODO Auto-generated catch block break; } } } }); // t.start(); } public void showQuery() { t.interrupt(); } }
[ "ma7amedmmhm@gmail.com" ]
ma7amedmmhm@gmail.com
6eed67b08ca8f1523bf73360306dde0e334ac4b7
7035ef52118f0aefd417b13a51667a28630b4779
/src/addcontent/gen_map.java
eff9369284a03d84e98137570e0c26a3903abda9
[]
no_license
tosyngy/Content-Database-Management
3dc8a18ecfa54bfbe0b6e128d467dbc29477f2bf
5f73c935c861c878d80211adb1b5f85f9edc7f21
refs/heads/master
2020-04-15T16:32:58.461438
2019-01-09T10:26:57
2019-01-09T10:26:57
164,840,627
0
0
null
null
null
null
UTF-8
Java
false
false
266
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 addcontent; /** * * @author tosyngy */ public class gen_map { }
[ "noreply@github.com" ]
noreply@github.com
01fad5a6e5319135baca1a77a79c39627dc137fc
6172719cc295170b0a5654f41c3f6cdcc5c49755
/src/main/java/com/mycompany/coding/sg/banking/view/OperationView.java
a5b655ed2a3dd182a65f30d809892ed336d95483
[]
no_license
jackchhun/BankingAccount
b3254234a408d43ad2d578c546f1c047790a4134
bef9c62597767313c8411ae50db586b974d1ec41
refs/heads/main
2023-02-01T13:28:08.581007
2020-12-07T10:26:26
2020-12-07T10:26:26
319,269,857
0
0
null
null
null
null
UTF-8
Java
false
false
425
java
/** * */ package com.mycompany.coding.sg.banking.view; import java.time.LocalDateTime; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; /** * @author kimchhun2 * */ @Getter @Setter @NoArgsConstructor public class OperationView { private LocalDateTime datetime = LocalDateTime.now(); private Double amount = 0.0; private String title = ""; private String operationType = ""; }
[ "thankyouchhun@gmail.com" ]
thankyouchhun@gmail.com
ba6eaf22262fcda1827c1bf216db2d28e74c8911
940dfbc0fba8637c897a8b4b769954ed0d8d637e
/MultirFramework-master/src/main/java/edu/washington/multirframework/data/FuzzyFact.java
929f7ae3e0995807a15d535791cad0d54cb763e7
[]
no_license
NEO-IE/MultirExperiments
33c36cd868ad5a40a987c34e519ce3698d635945
4db6aeda613da8a92f881dafe3e3e478e3d2dd07
refs/heads/master
2021-01-09T05:50:23.619087
2014-09-11T12:30:48
2014-09-11T12:30:48
22,545,680
0
0
null
null
null
null
UTF-8
Java
false
false
1,220
java
package edu.washington.multirframework.data; import java.util.ArrayList; import scala.actors.threadpool.Arrays; public class FuzzyFact { private static final int VALS_INDEX = 1; private static final int ATTR_INDEX = 0; private static final String ATTR_VAL_DELIM = ":"; private static final String VALS_DELIM = ","; String relName; ArrayList<Double> factList; //every number is a float public FuzzyFact(String fuzzyFactString) { String factSplit[] = fuzzyFactString.split(ATTR_VAL_DELIM); relName = factSplit[ATTR_INDEX]; factList = new ArrayList<Double>(); for(String num : factSplit[VALS_INDEX].split(VALS_DELIM)) { factList.add(Double.parseDouble(num)); } } @Override public String toString() { return relName + " - " + factList; } /** * finds out if the number num is matches this fact. Definition of match can be changed * @param num * @return */ public boolean isMatch(Double num, StringBuilder rel) { for(Double val : factList) { if((val - 0.1 * val) <= num && num <= (val + 0.1 * val)) { rel.append(this.relName); System.out.println("Match for " + this.relName + " Original: " + val + "Got: " + num); return true; } } return false; } }
[ "madaan.amanmadaan@gmail.com" ]
madaan.amanmadaan@gmail.com
145b0027e6a0a8df1aa1b3e6321a02724c03194e
bc025e9d25512fe55049a17631b592fe2c38657a
/im-gateway/src/main/java/com/bearxsh/im/gateway/config/RedisConfig.java
e8a564ec245f052a1ba14e8cc1c1d83f9fa71ade
[]
no_license
bearxsh/im
c9baf95a98f6e6a6598ec749ce2be44ce45808b9
411242754d0efb7fcf09047fdd9973b1529183df
refs/heads/master
2023-08-16T17:35:22.789830
2021-09-23T09:16:30
2021-09-23T09:16:30
397,847,797
0
0
null
null
null
null
UTF-8
Java
false
false
802
java
package com.bearxsh.im.gateway.config; import org.springframework.context.annotation.Bean; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.stereotype.Component; /** * @author Bearxsh * @date 2021/09/21 */ @Component public class RedisConfig { @Bean public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>(); redisTemplate.setDefaultSerializer(new StringRedisSerializer()); redisTemplate.setConnectionFactory(redisConnectionFactory); return redisTemplate; } }
[ "bearxsh@163.com" ]
bearxsh@163.com
21d25a150034531e80b97535bda1533dcca7eed2
70914d5c3d3838e9aac5a6edcd4c2822d1f6b9fb
/Module 2/Built-In Component/ListView/SectionList/ClassComponent/android/app/src/debug/java/com/classcomponent/ReactNativeFlipper.java
e297b86213a46b602cca630971244a09d02f6929
[]
no_license
Tops-Technology/React-Native
59c6da4de787ccb487b83ee9023c3ad1380d3f7f
f0bcefca280f4a559302852b7d0e8929bbb3c08e
refs/heads/master
2023-02-01T19:25:54.120266
2020-12-15T09:19:20
2020-12-15T09:19:20
321,344,495
1
1
null
null
null
null
UTF-8
Java
false
false
3,341
java
/** * Copyright (c) Facebook, Inc. and its affiliates. * * <p>This source code is licensed under the MIT license found in the LICENSE file in the root * directory of this source tree. */ package com.classcomponent; import android.content.Context; import com.facebook.flipper.android.AndroidFlipperClient; import com.facebook.flipper.android.utils.FlipperUtils; import com.facebook.flipper.core.FlipperClient; import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; import com.facebook.flipper.plugins.inspector.DescriptorMapping; import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; import com.facebook.flipper.plugins.react.ReactFlipperPlugin; import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; import com.facebook.react.ReactInstanceManager; import com.facebook.react.bridge.ReactContext; import com.facebook.react.modules.network.NetworkingModule; import okhttp3.OkHttpClient; public class ReactNativeFlipper { public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { if (FlipperUtils.shouldEnableFlipper(context)) { final FlipperClient client = AndroidFlipperClient.getInstance(context); client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); client.addPlugin(new ReactFlipperPlugin()); client.addPlugin(new DatabasesFlipperPlugin(context)); client.addPlugin(new SharedPreferencesFlipperPlugin(context)); client.addPlugin(CrashReporterPlugin.getInstance()); NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); NetworkingModule.setCustomClientBuilder( new NetworkingModule.CustomClientBuilder() { @Override public void apply(OkHttpClient.Builder builder) { builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); } }); client.addPlugin(networkFlipperPlugin); client.start(); // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized // Hence we run if after all native modules have been initialized ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); if (reactContext == null) { reactInstanceManager.addReactInstanceEventListener( new ReactInstanceManager.ReactInstanceEventListener() { @Override public void onReactContextInitialized(ReactContext reactContext) { reactInstanceManager.removeReactInstanceEventListener(this); reactContext.runOnNativeModulesQueueThread( new Runnable() { @Override public void run() { client.addPlugin(new FrescoFlipperPlugin()); } }); } }); } else { client.addPlugin(new FrescoFlipperPlugin()); } } } }
[ "75476201+Tops-Technology@users.noreply.github.com" ]
75476201+Tops-Technology@users.noreply.github.com
4fa898f6d99124f792a6ffb73696df9efd7b7622
3333ccc6df3344b2e502edf0f12efdce2eb84cc3
/MainActivity.java
6888d976deb04c1994086489555f439e5f137518
[]
no_license
jonibekk/JPics
08ab8db2532cda5ae75673d35337fe444f78fc97
6b223363e50ad3c364ae26a1dd0c229716d5b842
refs/heads/master
2022-05-04T03:21:11.791667
2018-05-02T04:35:20
2018-05-02T04:35:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
925
java
package com.example.jonib.jpics; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import com.example.jonib.jpics.jpics.JPics; import com.srx.widget.PullToLoadView; import java.util.Objects; import butterknife.BindView; import butterknife.ButterKnife; public class MainActivity extends AppCompatActivity { @BindView(R.id.main_app_bar) Toolbar mToolBar; @BindView(R.id.pullToLoadView) PullToLoadView myList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); setSupportActionBar(mToolBar); Objects.requireNonNull(getSupportActionBar()).setTitle("Pin Pictures"); JPics.Config.setCacheCapacity(15); new Pagination(this, myList).initializePaginator(); } }
[ "jonibeknorboev@gmail.com" ]
jonibeknorboev@gmail.com
f91bb4e3601cfc31d9a4a65ad4f611a5731557d7
2b5d4063d7dea59e67a4ea6e6db43f455df87ef2
/src/test/java/com/cgam/saed/repository/timezone/DateTimeWrapper.java
589b6a03b0a5b6a3d10ed726b4122338c37e69d5
[]
no_license
BulkSecurityGeneratorProject/saed
f959341f9436e8cf1f6dbed92411f32e79e25794
ffc853a90151c763a7aafce13490050fd0786819
refs/heads/master
2022-12-18T17:28:15.577700
2019-07-07T13:32:02
2019-07-07T13:32:02
296,538,564
0
0
null
2020-09-18T06:53:09
2020-09-18T06:53:08
null
UTF-8
Java
false
false
3,155
java
package com.cgam.saed.repository.timezone; import javax.persistence.*; import java.io.Serializable; import java.time.*; import java.util.Objects; @Entity @Table(name = "jhi_date_time_wrapper") public class DateTimeWrapper implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator") @SequenceGenerator(name = "sequenceGenerator") private Long id; @Column(name = "instant") private Instant instant; @Column(name = "local_date_time") private LocalDateTime localDateTime; @Column(name = "offset_date_time") private OffsetDateTime offsetDateTime; @Column(name = "zoned_date_time") private ZonedDateTime zonedDateTime; @Column(name = "local_time") private LocalTime localTime; @Column(name = "offset_time") private OffsetTime offsetTime; @Column(name = "local_date") private LocalDate localDate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Instant getInstant() { return instant; } public void setInstant(Instant instant) { this.instant = instant; } public LocalDateTime getLocalDateTime() { return localDateTime; } public void setLocalDateTime(LocalDateTime localDateTime) { this.localDateTime = localDateTime; } public OffsetDateTime getOffsetDateTime() { return offsetDateTime; } public void setOffsetDateTime(OffsetDateTime offsetDateTime) { this.offsetDateTime = offsetDateTime; } public ZonedDateTime getZonedDateTime() { return zonedDateTime; } public void setZonedDateTime(ZonedDateTime zonedDateTime) { this.zonedDateTime = zonedDateTime; } public LocalTime getLocalTime() { return localTime; } public void setLocalTime(LocalTime localTime) { this.localTime = localTime; } public OffsetTime getOffsetTime() { return offsetTime; } public void setOffsetTime(OffsetTime offsetTime) { this.offsetTime = offsetTime; } public LocalDate getLocalDate() { return localDate; } public void setLocalDate(LocalDate localDate) { this.localDate = localDate; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DateTimeWrapper dateTimeWrapper = (DateTimeWrapper) o; return !(dateTimeWrapper.getId() == null || getId() == null) && Objects.equals(getId(), dateTimeWrapper.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override public String toString() { return "TimeZoneTest{" + "id=" + id + ", instant=" + instant + ", localDateTime=" + localDateTime + ", offsetDateTime=" + offsetDateTime + ", zonedDateTime=" + zonedDateTime + '}'; } }
[ "alvaromonsalve@yahoo.com.co" ]
alvaromonsalve@yahoo.com.co
b59af82c732c0582fbb3115404f30c4195793646
5e6248fb688d22c54479ca07afca2358daf6dd34
/xToXAnnotations/src/main/java/by/academy/it/db4/DepartmentOneManyADao.java
7cc6e5331d5b9fe9172f1675fe0f439e519c2abd
[]
no_license
petkodmitry/hibernateProject
780c1bb8e0b90ee3c9a65c80a339741d01d335bf
18d3e58898ec13e775cda678af8973a708c14d5d
refs/heads/master
2020-07-31T07:42:54.710784
2016-11-28T13:17:35
2016-11-28T13:17:35
73,604,618
0
0
null
null
null
null
UTF-8
Java
false
false
551
java
package by.academy.it.db4; import by.academy.it.pojos4.DepartmentOneManyA; import org.apache.log4j.Logger; public class DepartmentOneManyADao extends Base4Dao<DepartmentOneManyA> { private static DepartmentOneManyADao instance; private DepartmentOneManyADao() {} public static synchronized DepartmentOneManyADao getInstance() { if (instance == null) { instance = new DepartmentOneManyADao(); } return instance; } private static Logger log = Logger.getLogger(DepartmentOneManyADao.class); }
[ "petkodmitry@gmail.com" ]
petkodmitry@gmail.com
b30b5d5c395976de529a1fd766b78437c920d9a4
2d218c9a7e78001eff10f44ad96c2f9a9e11e738
/EventTrackerApp/app/src/main/java/com/dk/eventtracker/helpers/MyJsonParser.java
3c6853f98f7998d302959665f33338f5cbca3a2f
[]
no_license
dalkofjac/Project-EventTracker
fffa9d848eb0e340a6226e7c7eee22d961970693
ec5733fe880d713e475469c074bcd5af401c7e61
refs/heads/master
2021-01-23T00:34:57.475398
2017-11-04T14:59:24
2017-11-04T14:59:24
85,746,154
0
0
null
null
null
null
UTF-8
Java
false
false
1,840
java
package com.dk.eventtracker.helpers; import com.dk.database.Event; import com.dk.database.User; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; /** * Created by Dalibor on 15.4.2017.. */ public class MyJsonParser { public static User ParseUserInfo(String jsonString){ User currentUser = new User(); try { JSONObject jsonObject = new JSONObject(jsonString); JSONArray jsonArray = jsonObject.getJSONArray("user"); JSONObject JO = jsonArray.getJSONObject(0); currentUser.setId(Integer.parseInt(JO.getString("id"))); currentUser.setName(JO.getString("name")); currentUser.setSurname(JO.getString("surname")); currentUser.setEmail(JO.getString("email")); }catch(JSONException jse){ jse.printStackTrace(); } return currentUser; } public static List<Event> ParseEventsInfo(String jsonString){ List<Event> eventsList = new ArrayList<>(); try { JSONObject jsonObject = new JSONObject(jsonString); JSONArray jsonArray = jsonObject.getJSONArray("event"); for (int i=0; i<jsonArray.length(); i++) { JSONObject JO = jsonArray.getJSONObject(i); Event currentEvent = new Event(); currentEvent.setId(Integer.parseInt(JO.getString("id"))); currentEvent.setType(Integer.parseInt(JO.getString("type"))); currentEvent.setName(JO.getString("name")); currentEvent.setDate(JO.getString("date")); eventsList.add(currentEvent); } }catch(JSONException jse){ jse.printStackTrace(); } return eventsList; } }
[ "dadolg22@gmail.com" ]
dadolg22@gmail.com
b736df4a3720fc4eebe471249357a35527528a0c
992c871d5e0d10a2b26cb47de853070b47f64c1d
/src/main/java/english/longman/comm3000/a1/MostFrequentSpokenVerb.java
26dca9e9cb6246e56e2357aedaf663542fe1126d
[]
no_license
developercyrus/linguistics-study
9fdf290d4e6c94167b822ae0c8fdff0c9a3017a2
22f6de1ab78e80b789dc0fa8623e0a80f27a488f
refs/heads/master
2020-05-31T19:32:02.014237
2013-10-16T12:43:34
2013-10-16T12:43:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,044
java
package english.longman.comm3000.a1; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; public class MostFrequentSpokenVerb { public MostFrequentSpokenVerb() throws IOException { String path = this.getClass().getResource("comm3000.txt").getFile(); BufferedReader br = new BufferedReader(new FileReader(path)); String line, word, pos, type; int num=0; while ((line = br.readLine()) != null) { StringTokenizer st = new StringTokenizer(line); word = st.nextToken(); pos = st.nextToken(); type = st.nextToken(); if (pos.equals("v") && (type.startsWith("S1"))) { System.out.println(line); num++; } } System.out.println(num); } public static void main(String[] args) throws IOException { new MostFrequentSpokenVerb(); } }
[ "developer.cyrus@gmail.com" ]
developer.cyrus@gmail.com
70c0368eafa9123891b2b205d87c030121fe3094
cc01ebab32a57788be344c35856be504c0d1c6d6
/app/src/main/java/lr/maisvendas/modelo/Pedido.java
a9972e214b4fe5662078ca3485baf334c8af0330
[]
no_license
Ricardo7/mvendas-app
2e331254941a61575e6831cb1069ae63495b5723
25216a68845526530f8f6b3bf1a76e8ccdbd4960
refs/heads/master
2020-03-28T04:58:20.695514
2018-11-21T17:47:56
2018-11-21T17:48:05
147,748,214
0
0
null
null
null
null
UTF-8
Java
false
false
6,124
java
package lr.maisvendas.modelo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class Pedido implements Serializable{ @JsonProperty("IDAP") private Integer id; @JsonProperty("IDWS") private String idWS; @JsonProperty("Numero") private Integer numero; @JsonProperty("Situacao") private Integer situacao; @JsonProperty("Status") private Integer status; @JsonProperty("Observacao") private String observacao; @JsonProperty("DtCriacao") private String dtCriacao; @JsonProperty("DtAtualizacao") private String dtAtualizacao; @JsonProperty("Cliente") private Cliente cliente; @JsonProperty("CondicaoPagamento") private CondicaoPagamento condicaoPagamento; @JsonProperty("TabelaPreco") private TabelaPreco tabelaPreco; @JsonProperty("ItensPedido") private List<ItemPedido> itensPedido; //public Pedido () {} public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getIdWS() { return idWS; } public void setIdWS(String idWS) { this.idWS = idWS; } public Integer getNumero() { return numero; } public void setNumero(Integer numero) { this.numero = numero; } public Integer getSituacao() { return situacao; } public void setSituacao(Integer situacao) { this.situacao = situacao; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getObservacao() { return observacao; } public void setObservacao(String observacao) { this.observacao = observacao; } public String getDtCriacao() { return dtCriacao; } public void setDtCriacao(String dtCriacao) { this.dtCriacao = dtCriacao; } public String getDtAtualizacao() { return dtAtualizacao; } public void setDtAtualizacao(String dtAtualizacao) { this.dtAtualizacao = dtAtualizacao; } public Cliente getCliente() { return cliente; } public void setCliente(Cliente cliente) { this.cliente = cliente; } public CondicaoPagamento getCondicaoPagamento() { return condicaoPagamento; } public void setCondicaoPagamento(CondicaoPagamento condicaoPagamento) { this.condicaoPagamento = condicaoPagamento; } public TabelaPreco getTabelaPreco() { return tabelaPreco; } public void setTabelaPreco(TabelaPreco tabelaPreco) { this.tabelaPreco = tabelaPreco; } public List<ItemPedido> getItensPedido() { return itensPedido; } public void setItensPedido(List<ItemPedido> itensPedido) { this.itensPedido = itensPedido; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Pedido)) return false; Pedido pedido = (Pedido) o; if (getId() != null ? !getId().equals(pedido.getId()) : pedido.getId() != null) return false; if (getIdWS() != null ? !getIdWS().equals(pedido.getIdWS()) : pedido.getIdWS() != null) return false; if (getNumero() != null ? !getNumero().equals(pedido.getNumero()) : pedido.getNumero() != null) return false; if (getSituacao() != null ? !getSituacao().equals(pedido.getSituacao()) : pedido.getSituacao() != null) return false; if (getStatus() != null ? !getStatus().equals(pedido.getStatus()) : pedido.getStatus() != null) return false; if (getObservacao() != null ? !getObservacao().equals(pedido.getObservacao()) : pedido.getObservacao() != null) return false; if (getDtCriacao() != null ? !getDtCriacao().equals(pedido.getDtCriacao()) : pedido.getDtCriacao() != null) return false; if (getDtAtualizacao() != null ? !getDtAtualizacao().equals(pedido.getDtAtualizacao()) : pedido.getDtAtualizacao() != null) return false; if (getCliente() != null ? !getCliente().equals(pedido.getCliente()) : pedido.getCliente() != null) return false; if (getCondicaoPagamento() != null ? !getCondicaoPagamento().equals(pedido.getCondicaoPagamento()) : pedido.getCondicaoPagamento() != null) return false; if (getTabelaPreco() != null ? !getTabelaPreco().equals(pedido.getTabelaPreco()) : pedido.getTabelaPreco() != null) return false; return getItensPedido() != null ? getItensPedido().equals(pedido.getItensPedido()) : pedido.getItensPedido() == null; } @Override public int hashCode() { int result = getId() != null ? getId().hashCode() : 0; result = 31 * result + (getIdWS() != null ? getIdWS().hashCode() : 0); result = 31 * result + (getNumero() != null ? getNumero().hashCode() : 0); result = 31 * result + (getSituacao() != null ? getSituacao().hashCode() : 0); result = 31 * result + (getStatus() != null ? getStatus().hashCode() : 0); result = 31 * result + (getObservacao() != null ? getObservacao().hashCode() : 0); result = 31 * result + (getDtCriacao() != null ? getDtCriacao().hashCode() : 0); result = 31 * result + (getDtAtualizacao() != null ? getDtAtualizacao().hashCode() : 0); result = 31 * result + (getCliente() != null ? getCliente().hashCode() : 0); result = 31 * result + (getCondicaoPagamento() != null ? getCondicaoPagamento().hashCode() : 0); result = 31 * result + (getTabelaPreco() != null ? getTabelaPreco().hashCode() : 0); result = 31 * result + (getItensPedido() != null ? getItensPedido().hashCode() : 0); return result; } }
[ "ronaldops06@yahoo.com.br" ]
ronaldops06@yahoo.com.br
0a91bf9960a85f8965b479e841dbd4fe62c6484c
af7b8bbe77461e59f32ba746f4bb055620a5c110
/base/src/main/java/com/hz/yk/reactor/core/publisher/TestFlux.java
d7e6d7d59082d0a2773509b4e8bd0b65d3048e90
[]
no_license
ykdsg/MyJavaProject
3e51564a3fb57ab4ae043c9112e1936ccc179dd5
a7d88aee2f58698aed7d497c2cf6e23a605ebb59
refs/heads/master
2023-06-26T02:23:33.812330
2023-06-12T11:28:23
2023-06-12T11:28:23
1,435,034
4
6
null
2022-12-01T15:21:01
2011-03-03T13:30:03
Java
UTF-8
Java
false
false
1,216
java
package com.hz.yk.reactor.core.publisher; import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; /** * @author wuzheng.yk * @date 2019-04-23 */ public class TestFlux { @Test public void fluxArrayTest() { Flux.just(1, 2, 3, 4, 5).map(i -> i * i).subscribe(new Subscriber<Integer>() { // 1 @Override public void onSubscribe(Subscription s) { System.out.println("onSubscribe"); s.request(6); // 2 } @Override public void onNext(Integer integer) { System.out.println("onNext:" + integer); } @Override public void onError(Throwable t) { } @Override public void onComplete() { System.out.println("onComplete"); } }); } @Test public void lambdaSubscriberTest() { Flux.just(1, 2, 3, 4, 5).map(i -> i * 2) .subscribe(System.out::println, System.err::println, () -> System.out.println("Completed.") // subscription -> subscription.request(3) ); } }
[ "17173as@163.com" ]
17173as@163.com
2120aa3722ae8519bb08eb1f52a0d1a91f38a7ab
1c8b3edb25b94af011be7ce0b990d3bf6abf1406
/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ScatterChartDiff.java
9475c21732fd5e5155510584ec87480eacbe4a4a
[]
no_license
mmbsoftware-it/gwt-charts
9d1d2e233c1b454893f864649c63506bb453796b
cf7bf2fdc507b99fbffbe51c7fae0c62a46f1104
refs/heads/master
2021-06-01T22:57:23.552213
2016-05-12T12:35:09
2016-05-12T12:35:09
53,656,421
0
0
null
null
null
null
UTF-8
Java
false
false
1,625
java
/* * Copyright 2012 Rui Afonso * * 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.googlecode.gwt.charts.client.corechart; import com.google.gwt.core.client.JavaScriptObject; /** * Options for Scatter Diff charts. */ public abstract class ScatterChartDiff extends JavaScriptObject { /** * Default constructor. * * @return a new object instance */ public static ScatterChartDiff create() { return createObject().cast(); } protected ScatterChartDiff() { } /** * Change the opacity of the new points. * * @param opacity a value from 0.0 (fully transparent) to 1.0 (fully opaque) */ public final native void setNewDataOpacity(double opacity) /*-{ if (!this.newData) { this.newData = {}; } this.newData.opacity = opacity; }-*/; /** * Change the opacity of the tails. * * @param opacity a value from 0.0 (fully transparent) to 1.0 (fully opaque) */ public final native void setOldDataOpacity(double opacity) /*-{ if (!this.oldData) { this.oldData = {}; } this.oldData.opacity = opacity; }-*/; }
[ "rglafonso@gmail.com" ]
rglafonso@gmail.com
39a9b43af0cda84148e4917073cbb34e0829a3dd
1dfb3da84bb0548cc1659f50fbc6b2a79b3ba9df
/app/GameInterface.java
d9f9a92a304161957f25035486ef525bd6c03fc8
[]
no_license
CodesAreHonest/tank-game
f25a19e6dd7243701b34fb48b7809bde96ec7462
10efa5271f368c4ea95ec86c4f71d7cf6bb1a750
refs/heads/master
2021-05-07T04:20:28.264247
2018-04-02T16:36:12
2018-04-02T16:36:12
111,285,698
0
0
null
null
null
null
UTF-8
Java
false
false
2,574
java
/** * * @author(Chai Ying Hua) * * GameInterface class is a View class in MVC Pattern that interact and display to User * ----------------------------------------------------------------------------------- * 1. This class is a JFRAME that contains all the elements (JPANEL, JLABEL, etc) * 2. This class is a Game Interface that allow user to perform all kind of functions. * */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.LineBorder; public class GameInterface extends JFrame{ private final int GRID_SIZE = 10; private final int CELLSIZE = 60; private final int BOARD_WIDTH = GRID_SIZE * CELLSIZE; private final int BOARD_HEIGHT = GRID_SIZE * CELLSIZE; private GameMenu gameMenu; private GameInfo gameInfo; private Gameboard gameBoard; private SequenceMoves sequenceMoves; /* * * @author(Chai Ying Hua, Shubar, Abduelhakem G Abdusalam) * * During the GameInterface's constructor (BorderLayout) is called :- * 1. add the Gameboard in the Center * 2. add the Move Sequence Panel in the East * 3. add the GameMenu in the West */ public GameInterface() { super("Tank Game"); setVisible(true); setResizable(true); setSize(BOARD_WIDTH+400,BOARD_HEIGHT+100); setBackground(Color.white); setLayout(new BorderLayout()); gameBoard = new Gameboard(); add(gameBoard, BorderLayout.CENTER); sequenceMoves = new SequenceMoves(); add(sequenceMoves, BorderLayout.EAST); gameBoard.getUserTank().setMovesSequence(sequenceMoves); sequenceMoves.setInterface(this); gameMenu = new GameMenu(); add(gameMenu, BorderLayout.WEST); gameMenu.setUserTank(gameBoard.getUserTank()); gameMenu.setComTank(gameBoard.getComputerTank()); setFocusable(true); setLocationRelativeTo(null); setDefaultCloseOperation(EXIT_ON_CLOSE); gameMenu.setGameInterface(this); } /* * * @author(Shubar, Abduelhakem G Abdusalam) * * This function is use to add GameInformation and set Playername */ public void setPlayerName(String name){ gameInfo = new GameInfo(name, gameBoard); add(gameInfo, BorderLayout.NORTH); gameBoard.getUserTank().setGameInfo(gameInfo); //GameInfo.setTrialNo(0); gameMenu.setFileName(name); } }
[ "yinghuachai0@gmail.com" ]
yinghuachai0@gmail.com
257e97272e485cc46c6edb51691e56a21acff8eb
8220d115e3777c63338adcb4a8d3c688d18ca387
/app/src/main/java/com/codesch/afdolash/mjmtol/model/Product.java
4aa5174bd69d7c96e58c99c55de5e605004edfd0
[]
no_license
afdolash/android_mjm_tol
6171bf7ffb98ea03b8b0a4e617658d019952c786
69e2879df1bf889533ac0f03fd630d0a9f41eb8e
refs/heads/master
2021-08-08T23:25:42.171226
2017-11-11T15:30:11
2017-11-11T15:30:11
109,788,993
0
0
null
null
null
null
UTF-8
Java
false
false
837
java
package com.codesch.afdolash.mjmtol.model; /** * Created by Afdolash on 11/7/2017. */ public class Product { private int id_produk; private String nama_produk; private int harga_produk; private String deskripsi_produk; private String foto_produk; private String kategori_produk; private int id_umkm; public int getId_produk() { return id_produk; } public String getNama_produk() { return nama_produk; } public int getHarga_produk() { return harga_produk; } public String getDeskripsi_produk() { return deskripsi_produk; } public String getFoto_produk() { return foto_produk; } public String getKategori_produk() { return kategori_produk; } public int getId_umkm() { return id_umkm; } }
[ "afdolash18@gmail.com" ]
afdolash18@gmail.com
ac926cfc8840ef33e80131a85f85bd4438395ae2
8d884949c6d01ce0225038e88734f7a05889d8b6
/stockholm/src/main/java/saleem/gaming/resultanalysis/AddedPopulationEventHandler.java
973ad00d18570367edec8806772b0b225314189b
[]
no_license
matsim-vsp/vsp-playgrounds
790c43acd5492f6c81dbeca56b52e0a269b35c9e
4e1da810533bfafd890a50eb945efadf42375c65
refs/heads/master
2022-05-26T16:08:38.044357
2022-05-11T12:27:36
2022-05-11T12:27:36
123,579,086
7
7
null
2022-03-16T10:42:27
2018-03-02T12:55:30
Java
UTF-8
Java
false
false
5,975
java
/* * Copyright 2018 Mohammad Saleem * * 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/>. * * contact: salee@kth.se * */ package saleem.gaming.resultanalysis; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.PersonArrivalEvent; import org.matsim.api.core.v01.events.PersonDepartureEvent; import org.matsim.api.core.v01.events.PersonStuckEvent; import org.matsim.api.core.v01.events.TransitDriverStartsEvent; import org.matsim.api.core.v01.events.handler.PersonArrivalEventHandler; import org.matsim.api.core.v01.events.handler.PersonDepartureEventHandler; import org.matsim.api.core.v01.events.handler.PersonStuckEventHandler; import org.matsim.api.core.v01.events.handler.TransitDriverStartsEventHandler; import org.matsim.api.core.v01.population.Person; /** * A event handling class to help in doing basic plausibility check over the executed gaming simulation scenarios, * before the results were provided to ProtoWorld to be used in interactive gaming. * * @author Mohammad Saleem */ public class AddedPopulationEventHandler implements PersonDepartureEventHandler, PersonArrivalEventHandler, TransitDriverStartsEventHandler, PersonStuckEventHandler{ private Set<Id<Person>> transitDrivers = new HashSet<>(); private Map<Id<Person>, Double> times = new HashMap<>(); private Map<Id<Person>, Double> timescar = new HashMap<>(); private Map<Id<Person>, Double> timespt = new HashMap<>(); double stuck = 0, totaltrips = 0, totaltime=0; double stuckcar = 0, tripscar = 0; double totaltimecar=0; double stuckpt = 0, tripspt = 0; double totaltimept=0; public AddedPopulationEventHandler(double totaltrips, double tripscar, double tripspt){//These values come from calculated modal split this.tripscar= tripscar; this.tripspt=tripspt; this.totaltrips=totaltrips; } @Override public void reset(int iteration) { // TODO Auto-generated method stub } public void handleEvent(TransitDriverStartsEvent event) { transitDrivers.add(event.getDriverId()); // TODO Auto-generated method stub } /* event.getPersonId().toString().contains("a") is to ensure considering added population only, * has to be removed if want to consider everyone.(non-Javadoc) */ @Override public void handleEvent(PersonArrivalEvent event) { if(!transitDrivers.contains(event.getPersonId())){//Transit drivers are ignored as they are not passengers if(event.getPersonId().toString().contains("a")){ totaltime += (event.getTime()-times.get(event.getPersonId())); times.remove(event.getPersonId()); } if(event.getPersonId().toString().contains("a") && event.getLegMode() == "car"){ totaltimecar += (event.getTime()-timescar.get(event.getPersonId())); timescar.remove(event.getPersonId()); } if(event.getPersonId().toString().contains("a") && (event.getLegMode() == "pt" || event.getLegMode() == "transit_walk")){ totaltimept += (event.getTime()-timespt.get(event.getPersonId())); timespt.remove(event.getPersonId()); } } } @Override public void handleEvent(PersonDepartureEvent event) { if(!transitDrivers.contains(event.getPersonId())){ if(event.getPersonId().toString().contains("a")){ if(!times.containsKey(event.getPersonId())){ times.put(event.getPersonId(), event.getTime()); } } if(event.getPersonId().toString().contains("a") && event.getLegMode() == "car"){ if(!timescar.containsKey(event.getPersonId())){ timescar.put(event.getPersonId(), event.getTime()); } } if(event.getPersonId().toString().contains("a") && (event.getLegMode() == "pt" || event.getLegMode() == "transit_walk")){ if(!timespt.containsKey(event.getPersonId())){ timespt.put(event.getPersonId(), event.getTime()); } } } // TODO Auto-generated method stub } @Override public void handleEvent(PersonStuckEvent event) { if(!transitDrivers.contains(event.getPersonId())){ if(event.getPersonId().toString().contains("a")){ stuck++; } if(event.getPersonId().toString().contains("a") && (event.getLegMode() == "car")){ stuckcar++; } if(event.getPersonId().toString().contains("a") && (event.getLegMode() == "pt" || event.getLegMode() == "transit_walk")){ stuckpt++; } } // TODO Auto-generated method stub } public void printTripDurations(){ double avgtripduration = totaltime/totaltrips; double avgtripdurationcar = totaltimecar/tripscar; double avgtripdurationpt = totaltimept/tripspt; System.out.println("Trips: " + totaltrips); System.out.println("Car trips: " + tripscar); System.out.println("PT trips: " + tripspt); System.out.println("Average trip duration of the added agents is: " + avgtripduration); System.out.println("Average car trip duration of the added agents is: " + avgtripdurationcar); System.out.println("Average pt trip duration of the added agents is: " + avgtripdurationpt); } public void printStuckAgentsInfo(){ System.out.println("Average stuck agents: " + stuck); System.out.println("Average stuck car agents: " + stuckcar); System.out.println("Average pt stcuk agents: " + stuckpt); } }
[ "gunnar.floetteroed@abe.kth.se" ]
gunnar.floetteroed@abe.kth.se
70e04bda1dceb01a5c7bcc409637a2d4a8fc01e2
df903e78458848a68177edf34ef702f9f044febd
/src/SpeleServeris.java
67e921b022480cec6c32de0f87dd611ecec11f9d
[]
no_license
gerritadmin/my-project
cab9b7d5c7a3eab1e0e06018f58c2401413effd0
ea3bddade7ebcab9fea0c8e0cd5852ce8704a888
refs/heads/master
2021-01-01T20:23:19.911402
2015-05-18T10:31:25
2015-05-18T10:31:25
35,811,196
0
0
null
null
null
null
UTF-8
Java
false
false
1,016
java
import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; public class SpeleServeris { public SpeleServeris() throws IOException{ //servera socket - 1. ServerSocket serverSoc = new ServerSocket(8090); while(true){ //client socket - 2. Socket clientSoc = serverSoc.accept(); System.out.println("Connection established"); // get streams - 3. OutputStream oS = clientSoc.getOutputStream(); InputStream iS = clientSoc.getInputStream(); ObjectOutputStream oOS = new ObjectOutputStream(oS); ObjectInputStream oIS = new ObjectInputStream(iS); //sent message - 4. oOS.writeObject("Message from server"); } // //close connections - 5. // serverSoc.close(); // clientSoc.close(); // oS.close(); // iS.close(); } public static void main(String[] args) throws IOException{ SpeleServeris serveris = new SpeleServeris(); } }
[ "gerrit.review@yahoo.com" ]
gerrit.review@yahoo.com
2ec8ba185abb37a456baa0838b39476c7b22c5d7
b12eb76b11d2ccf0b18aec0fd729c5280ee55fe7
/core/src/com/linkmon/messagesystem/messages/ChatMessage.java
d04c1fab834632443f0370aa85268c971504fb57
[]
no_license
Kilst/Linkmon
c1e449f7942e53dff421b5e07fc755c68a51ee41
2de51f8eeccc674ff1eed0094425cce31021c34c
refs/heads/master
2021-03-24T09:35:34.776875
2016-09-02T12:40:26
2016-09-02T12:40:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,671
java
package com.linkmon.messagesystem.messages; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Group; import com.badlogic.gdx.scenes.scene2d.ui.Image; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.linkmon.eventmanager.EventManager; import com.linkmon.eventmanager.messages.MessageEvent; import com.linkmon.eventmanager.messages.MessageEvents; import com.linkmon.helpers.ResourceLoader; import com.linkmon.view.WorldRenderer; public class ChatMessage extends Actor { private Image characterImage; private ChatMessageTable chatTable; private Skin skin; private Image darken; private Group gameUi; private EventManager eManager; private WorldRenderer worldRenderer; public ChatMessage(int id, String[] messages, WorldRenderer worldRenderer, Group gameUi, EventManager eManager) { this.worldRenderer = worldRenderer; this.gameUi = gameUi; this.eManager = eManager; skin = new Skin(); TextureAtlas uiAtlas = ResourceLoader.assetManager.get(ResourceLoader.UIAtlas, TextureAtlas.class); skin.addRegions(uiAtlas); characterImage = new Image(ResourceLoader.getRegionFromId(id)) { @Override public void act(float delta) { if(characterImage.getX()+characterImage.getWidth() > Gdx.graphics.getWidth()) characterImage.setX(characterImage.getX()-1000f*delta); } }; characterImage.setPosition(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/4); darken = new Image(skin.getDrawable("darkenWorld")); darken.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); darken.getColor().a = 0.7f; chatTable = new ChatMessageTable(skin, this); chatTable.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/3); chatTable.setText("Tinmon", messages); } public void show() { // TODO Auto-generated method stub gameUi.addActor(darken); darken.toFront(); gameUi.addActor(characterImage); characterImage.toFront(); gameUi.addActor(chatTable); chatTable.toFront(); } @Override public void toFront() { super.toFront(); darken.toFront(); characterImage.toFront(); chatTable.toFront(); } public void hide() { // TODO Auto-generated method stub darken.remove(); characterImage.remove(); chatTable.remove(); } @Override public boolean remove() { darken.remove(); characterImage.remove(); chatTable.remove(); worldRenderer.chatWindow = null; eManager.notify(new MessageEvent(MessageEvents.CLEAR_CURRENT_MESSAGE)); return super.remove(); } }
[ "stevendlavender@hotmail.com" ]
stevendlavender@hotmail.com
68aaf1b08131504fa93cb9533800f8786b83f540
7f9261a5a391c261a0a6a9092b027326b3a95821
/jokedisplayer/src/main/java/com/project/udacity/jokedisplayer/JokeDisplayerActivity.java
66333601933730c08cb785769d26e57e72753f34
[]
no_license
natavanmirzayeva/builditbigger
caa668d3bb1d3ea79babd004e7152e339aa38cd8
5c8b244f23bca046867b15e0c176b6484249b489
refs/heads/master
2020-03-23T08:42:40.885772
2018-07-18T05:03:30
2018-07-18T05:03:30
141,341,657
0
0
null
null
null
null
UTF-8
Java
false
false
2,318
java
package com.project.udacity.jokedisplayer; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; public class JokeDisplayerActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_joke_displayer); Toolbar toolbar = findViewById(R.id.toolbar); toolbar.setNavigationIcon(R.drawable.ic_android_white_24dp); if (toolbar != null) { setSupportActionBar(toolbar); getSupportActionBar().setDisplayShowTitleEnabled(false); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); Intent intent = getIntent(); String question = intent.getStringExtra("Question"); final String answer = intent.getStringExtra("Answer"); TextView txt_question = findViewById(R.id.txt_question); final ImageView img_emoji = findViewById(R.id.img_emoji); final TextView txt_answer = findViewById(R.id.txt_answer); final View view = findViewById(R.id.view); Button btn_answer = findViewById(R.id.btn_answer); txt_answer.setVisibility(View.GONE); img_emoji.setVisibility(View.GONE); txt_question.setText(question); txt_answer.setText(answer); view.setVisibility(View.GONE); if(question == null) { txt_question.setText("Please try again or check your internet connection"); btn_answer.setVisibility(View.GONE); } btn_answer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { txt_answer.setVisibility(View.VISIBLE); img_emoji.setVisibility(View.VISIBLE); view.setVisibility(View.VISIBLE); } }); } }
[ "mirzayevanatavan@gmail.com" ]
mirzayevanatavan@gmail.com
99765fccd5c5c9d2f72d0ef4b7f4d95ec201db97
5e69f8bd59b2e437e6c55cae5a58f57df799ca2e
/app/src/main/java/com/it/mougang/gasmyr/takecare/adapters/SmsLifeAdapter.java
0e2a1a637139a06efc375d521e58e509f65ec835
[]
no_license
syntrydy/TakeCare
0217756f3bb15298f2f5e7e8c355a4b4e80af737
34717c9a6a686db4a5b66bfe34804e1ce3883b81
refs/heads/master
2021-01-18T23:42:13.296908
2017-08-17T08:13:46
2017-08-17T08:13:46
72,739,509
0
0
null
null
null
null
UTF-8
Java
false
false
3,827
java
package com.it.mougang.gasmyr.takecare.adapters; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.support.annotation.NonNull; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageButton; import android.widget.TextView; import com.it.mougang.gasmyr.takecare.R; import com.it.mougang.gasmyr.takecare.domain.EventBusMessage; import com.it.mougang.gasmyr.takecare.domain.SmsForLife; import org.greenrobot.eventbus.EventBus; import io.realm.RealmChangeListener; import io.realm.RealmResults; /** * Created by gasmyr.mougang on 12/12/16. */ public class SmsLifeAdapter extends RecyclerView.Adapter<SmsLifeAdapter.MyViewHolder> implements RealmChangeListener<RealmResults<SmsForLife>> { private RealmResults<SmsForLife> realmResults; private Context context; private EventBus eventBus; public SmsLifeAdapter(RealmResults<SmsForLife> smsForLifes, Context context, EventBus eventBus) { this.realmResults = smsForLifes; this.context = context; this.eventBus = eventBus; this.realmResults.addChangeListener(this); } @Override public void onChange(RealmResults<SmsForLife> element) { notifyDataSetChanged(); } public class MyViewHolder extends RecyclerView.ViewHolder { public TextView message; public CardView cardView; private ImageButton actionSend; private CheckBox actionCheck; public MyViewHolder(@NonNull View view) { super(view); cardView = (CardView) view.findViewById(R.id.card_view); message = (TextView) view.findViewById(R.id.loveMessage); actionSend = (ImageButton) view.findViewById(R.id.actionSend); actionCheck = (CheckBox) view.findViewById(R.id.actionCkeck); } } @NonNull @Override public SmsLifeAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.smslife_row, parent, false); return new SmsLifeAdapter.MyViewHolder(itemView); } @Override public void onBindViewHolder(@NonNull final SmsLifeAdapter.MyViewHolder holder, final int position) { final SmsForLife smsForLife = realmResults.get(position); holder.message.setText(smsForLife.getText()); holder.actionSend.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { EventBusMessage eventBusMessage=new EventBusMessage("Ok",smsForLife.getText()); eventBus.post(eventBusMessage); } }); holder.actionCheck.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { if (b) { holder.actionSend.setVisibility(View.VISIBLE); } else { holder.actionSend.setVisibility(View.INVISIBLE); } } }); holder.cardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); holder.cardView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { return true; } }); } @Override public int getItemCount() { return realmResults.size(); } }
[ "gasmyrmougang@yahoo.fr" ]
gasmyrmougang@yahoo.fr
1280ac1bd68c40b002cb5e074394c98a17cb6ee1
fe9898648acdad92871bd7d02b57fdf2cba7fdf8
/src/java/org/malbino/orion/controllers/ReporteCuadernilloPasantiaController.java
bedf68cd5868610de812759994e14859d741b244
[ "MIT" ]
permissive
malbino/orion
7346dadea9e27ddf2c2687bcc43312c54c90b5f2
b17a8b7f3e7a22be246205e00cf9d917f211594e
refs/heads/master
2023-08-19T18:26:18.824142
2023-08-16T03:52:01
2023-08-16T03:52:01
222,261,419
0
0
null
null
null
null
UTF-8
Java
false
false
5,775
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.malbino.orion.controllers; import java.io.Serializable; import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; import javax.inject.Named; import java.io.IOException; import java.util.ArrayList; import javax.ejb.EJB; import javax.inject.Inject; import org.malbino.orion.entities.Carrera; import org.malbino.orion.entities.GestionAcademica; import org.malbino.orion.entities.GrupoPasantia; import org.malbino.orion.entities.Log; import org.malbino.orion.entities.NotaPasantia; import org.malbino.orion.enums.EventoLog; import org.malbino.orion.facades.GrupoPasantiaFacade; import org.malbino.orion.facades.NotaPasantiaFacade; import org.malbino.orion.util.Fecha; /** * * @author Tincho */ @Named("ReporteCuadernilloPasantiaController") @SessionScoped public class ReporteCuadernilloPasantiaController extends AbstractController implements Serializable { @EJB NotaPasantiaFacade notaPasantiaFacade; @EJB GrupoPasantiaFacade grupoPasantiaFacade; @Inject LoginController loginController; private GestionAcademica seleccionGestionAcademica; private Carrera seleccionCarrera; private GrupoPasantia seleccionGrupoPasantia; private List<NotaPasantia> notasPasantias; private NotaPasantia seleccionNotaPasantia; private String keyword; @PostConstruct public void init() { seleccionGestionAcademica = null; notasPasantias = new ArrayList<>(); seleccionNotaPasantia = null; keyword = null; } public void reinit() { notasPasantias = notaPasantiaFacade.listaNotasPasantias(seleccionGrupoPasantia.getId_grupopasantia()); seleccionNotaPasantia = null; keyword = null; } @Override public List<Carrera> listaCarreras() { List<Carrera> l = new ArrayList(); if (seleccionGestionAcademica != null) { l = carreraFacade.listaCarreras(seleccionGestionAcademica.getRegimen()); } return l; } public List<GrupoPasantia> listaGruposPasantias() { List<GrupoPasantia> l = new ArrayList<>(); if (seleccionGestionAcademica != null && seleccionCarrera != null) { l = grupoPasantiaFacade.listaGrupoPasantias(seleccionGestionAcademica.getId_gestionacademica(), seleccionCarrera.getId_carrera()); } return l; } public List<GrupoPasantia> listaGruposPasantiasEditarPasantia() { List<GrupoPasantia> l = new ArrayList<>(); if (seleccionNotaPasantia != null) { l = grupoPasantiaFacade.listaGrupoPasantiasAbiertos(seleccionGestionAcademica.getId_gestionacademica(), seleccionCarrera.getId_carrera()); } return l; } public void buscar() { if (seleccionGrupoPasantia != null) { notasPasantias = notaPasantiaFacade.buscar(seleccionGrupoPasantia, keyword); } } public void toCuadernilloPasantias() throws IOException { this.insertarParametro("id_notapasantia", seleccionNotaPasantia.getId_notapasantia()); this.redireccionarViewId("/reportes/pasantias/cuadernilloPasantia/cuadernilloPasantia"); //log logFacade.create(new Log(Fecha.getDate(), EventoLog.READ, "Generación reporte cuadernillo de pasantia", loginController.getUsr().toString())); } public void toReporteCuadernilloPasantia() throws IOException { reinit(); this.redireccionarViewId("/reportes/pasantias/cuadernilloPasantia/reporteCuadernilloPasantia"); } /** * @return the seleccionGestionAcademica */ public GestionAcademica getSeleccionGestionAcademica() { return seleccionGestionAcademica; } /** * @param seleccionGestionAcademica the seleccionGestionAcademica to set */ public void setSeleccionGestionAcademica(GestionAcademica seleccionGestionAcademica) { this.seleccionGestionAcademica = seleccionGestionAcademica; } /** * @return the notasPasantias */ public List<NotaPasantia> getNotasPasantias() { return notasPasantias; } /** * @param notasPasantias the notasPasantias to set */ public void setNotasPasantias(List<NotaPasantia> notasPasantias) { this.notasPasantias = notasPasantias; } /** * @return the seleccionNotaPasantia */ public NotaPasantia getSeleccionNotaPasantia() { return seleccionNotaPasantia; } /** * @param seleccionNotaPasantia the seleccionNotaPasantia to set */ public void setSeleccionNotaPasantia(NotaPasantia seleccionNotaPasantia) { this.seleccionNotaPasantia = seleccionNotaPasantia; } /** * @return the keyword */ public String getKeyword() { return keyword; } /** * @param keyword the keyword to set */ public void setKeyword(String keyword) { this.keyword = keyword; } /** * @return the seleccionCarrera */ public Carrera getSeleccionCarrera() { return seleccionCarrera; } /** * @param seleccionCarrera the seleccionCarrera to set */ public void setSeleccionCarrera(Carrera seleccionCarrera) { this.seleccionCarrera = seleccionCarrera; } /** * @return the seleccionGrupoPasantia */ public GrupoPasantia getSeleccionGrupoPasantia() { return seleccionGrupoPasantia; } /** * @param seleccionGrupoPasantia the seleccionGrupoPasantia to set */ public void setSeleccionGrupoPasantia(GrupoPasantia seleccionGrupoPasantia) { this.seleccionGrupoPasantia = seleccionGrupoPasantia; } }
[ "maacrazy@gmail.com" ]
maacrazy@gmail.com
5b3fc8b716af5da7c78af4b0ebf3f3f7e2f6545c
845745d047760d4ae6bd62bc17f6621036bf71a1
/src/main/java/com/intuit/demo/boot/appointment/BootUpAppointment.java
e75f8843c40a63712e00225fd431beaaab4278d2
[]
no_license
rajeshkarka/appointment
bf4f305dd2c3b251f8298a0d95091febe6e46fa6
ed7d2dd2034eb51b601f221600f1e8d6913d7090
refs/heads/master
2023-01-12T14:22:47.123759
2019-12-17T15:42:35
2019-12-17T15:42:35
226,636,045
0
0
null
2023-01-07T12:38:29
2019-12-08T08:19:51
TypeScript
UTF-8
Java
false
false
456
java
package com.intuit.demo.boot.appointment; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan(basePackages={"com.intuit.demo", "com.server.config"}) public class BootUpAppointment { public static void main(String[] args) { SpringApplication.run(BootUpAppointment.class, args); } }
[ "rajeshkarka@rajeshs-MacBook-Pro.local" ]
rajeshkarka@rajeshs-MacBook-Pro.local
8823ecc2c21ac54566ba9d40a0d76615ae59d353
abfe68ed529ab8ab3dd4f1bfe50cd4327fabdf62
/business_events_listener/src/main/java/main/java/businessProcessListener/BPTaskListener.java
cc9584f17c5f2c661951fac21292de5cf17bc64f
[]
no_license
Miccia/be
9b1ad908fbe1b35e9de1bac5e35bbb2f4f36dc49
a3dbcdd4a0da17769dc4d835cce6b414a75cac69
refs/heads/master
2020-04-25T11:01:10.167631
2019-02-26T14:46:44
2019-02-26T14:46:44
172,730,244
0
0
null
null
null
null
UTF-8
Java
false
false
4,888
java
package main.java.businessProcessListener; //import org.jbpm.services.task.events.DefaultTaskEventListener; import org.kie.api.task.TaskEvent; public class BPTaskListener extends org.jbpm.services.task.events.DefaultTaskEventListener{ @Override public void beforeTaskActivatedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskClaimedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskSkippedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskStartedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskStoppedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskCompletedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskFailedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskAddedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskExitedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskReleasedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskResumedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskSuspendedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskForwardedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskDelegatedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void beforeTaskNominatedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskActivatedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskClaimedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskSkippedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskStartedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskStoppedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskCompletedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskFailedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskAddedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskExitedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskReleasedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskResumedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskSuspendedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskForwardedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskDelegatedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } @Override public void afterTaskNominatedEvent(TaskEvent event) { String msg = ""; System.out.println("\n\t\t"+msg+"\n"); } public ProcessEventContext getProcessContext(){ } }
[ "noreply@github.com" ]
noreply@github.com
e6f306a1890b3b89bd09835ec22d189734c15ec9
ade83194cad203c7327d07619260348bc88a530a
/src/test/java/com/spring5/mvc/rest/api/v1/mapper/CustomerDTOMapperTest.java
fa897da307416c940ae20b515c16903d51cc5563
[]
no_license
sajadparacha/spring5-mvc-rest
4f7e41cf7c6e2530b735fbefbe3c7d9a1de17382
7870b24eb0ba940148d53eb615121d5305d0f96b
refs/heads/master
2021-02-07T04:14:16.325949
2020-03-22T10:26:57
2020-03-22T10:26:57
243,981,239
0
0
null
null
null
null
UTF-8
Java
false
false
1,734
java
package com.spring5.mvc.rest.api.v1.mapper; import com.spring5.mvc.rest.api.v1.model.CustomerDTO; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; class CustomerDTOMapperTest { public static final String FIRST_NAME = "Sajjad"; CustomerMapper customerMapper; com.spring5.mvc.rest.domain.Customer customer; CustomerDTO customerDTO; @BeforeEach void setUp() { } @Test void customerToCustomerDTO() { //Given customerDTO =new CustomerDTO(); customerDTO.setFirstName(FIRST_NAME); customerDTO.setLastName("Paracha"); customerDTO.setId(1L); customerDTO.setCustomerURL("/customer/"+1L); //when(CustomerMapper.INSTANCE.customerDTOToCustomer(any())).thenReturn(customer); //When com.spring5.mvc.rest.domain.Customer customer1 = CustomerMapper.INSTANCE.customerDTOToCustomer(customerDTO); //Then assertNotNull(customer1); assertEquals(customer1.getFirstName(), FIRST_NAME); } @Test void customerDTOToCustomer() { //Given customer =new com.spring5.mvc.rest.domain.Customer(); customer.setFirstName(FIRST_NAME); customer.setLastName("Paracha"); customer.setId(1L); customer.setCustomerURL("/customer/"+1L); //when(CustomerMapper.INSTANCE.customerToCustomerDTO(any())).thenReturn(customerDTO); //When CustomerDTO customer1 = CustomerMapper.INSTANCE.customerToCustomerDTO(customer); //Then assertNotNull(customer1); assertEquals(customer1.getFirstName(), FIRST_NAME); } }
[ "sajadparacha@gmail.com" ]
sajadparacha@gmail.com
ace4a15bf8ab488dbcf82ee289fd09365b32a678
3e29e5f0fe20b27d0823c9cbf75d35ed644fcdb9
/src/main/java/com/github/buffmage/BlockifyMain.java
6b8d6dc2ff67ae407cc4b9f707c6632f8ede92ba
[ "CC0-1.0" ]
permissive
BuffMage/Blockify
cabb26a249653d8e5612f45f2e06bd94a11147cd
88114582d87c8baa74b1df9c2da7e3ee742ecc0d
refs/heads/main
2023-06-23T11:56:12.553794
2021-07-16T20:34:41
2021-07-16T20:34:41
379,064,742
5
1
null
null
null
null
UTF-8
Java
false
false
7,331
java
package com.github.buffmage; import com.github.buffmage.util.SpotifyUtil; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; import net.minecraft.client.MinecraftClient; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; import net.minecraft.util.Util; import org.lwjgl.glfw.GLFW; public class BlockifyMain implements ModInitializer { public static final String MOD_ID = "blockifybuffmage"; private static KeyBinding playKey; private static KeyBinding nextKey; private static KeyBinding prevKey; private static KeyBinding forceKey; private static KeyBinding hideKey; private boolean playKeyPrevState = false; private boolean nextKeyPrevState = false; private boolean prevKeyPrevState = false; private boolean forceKeyPrevState = false; private boolean hideKeyPrevState = false; private static Thread requestThread; @Override public void onInitialize() { requestThread = new Thread() { public void run() { System.out.println("Hello again!"); while (true) { try { Thread.sleep(1000); if (MinecraftClient.getInstance().world != null) { if (BlockifyHUD.getDuration() < BlockifyHUD.getProgress()) { String [] data = SpotifyUtil.getPlaybackInfo(); if (data[0] != null && data[0].equals("Status Code: 204")) { SpotifyUtil.refreshActiveSession(); } else if (data[0] != null && data[0].equals("Status Code: 429")) { Thread.sleep(3000); } else if (data[0] != null && data[0].equals("Reset")) { System.out.println("Reset condition, maintaining HUD until reset"); } else { BlockifyHUD.updateData(data); } } else if (SpotifyUtil.isPlaying()) { BlockifyHUD.setProgress(BlockifyHUD.getProgress() + 1000); } } else { BlockifyHUD.setProgress(0); BlockifyHUD.setDuration(-1); } } catch (InterruptedException e) { e.printStackTrace(); } } } }; requestThread.setName("Spotify Thread"); requestThread.start(); SpotifyUtil.initialize(); playKey = KeyBindingHelper.registerKeyBinding( new KeyBinding( "Play/Pause", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_5, "Blockify" ) ); nextKey = KeyBindingHelper.registerKeyBinding( new KeyBinding( "Next Song", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_6, "Blockify" ) ); prevKey = KeyBindingHelper.registerKeyBinding( new KeyBinding( "Previous Song", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_4, "Blockify" ) ); forceKey = KeyBindingHelper.registerKeyBinding( new KeyBinding( "Force Update", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_8, "Blockify" ) ); hideKey = KeyBindingHelper.registerKeyBinding( new KeyBinding( "Hide Spotify", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_9, "Blockify" ) ); ClientTickEvents.END_CLIENT_TICK.register( client -> { try { playKeyHandler(playKey.isPressed()); nextKeyHandler(nextKey.isPressed()); prevKeyHandler(prevKey.isPressed()); forceKeyHandler(forceKey.isPressed()); hideKeyHandler(hideKey.isPressed()); } catch (Exception e) { e.printStackTrace(); } } ); } public void playKeyHandler(boolean currPressState) { try { if (currPressState && !playKeyPrevState) { //MinecraftClient.getInstance().player.sendMessage(new LiteralText("Key Pad 5 was pressed!"), false); if (SpotifyUtil.isAuthorized()) { System.out.println("Authorized!"); SpotifyUtil.playPause(); } else { Util.getOperatingSystem().open(SpotifyUtil.authorize()); } } playKeyPrevState = currPressState; } catch (Exception e) { e.printStackTrace(); } } public void nextKeyHandler(boolean currPressState) { if (currPressState && !nextKeyPrevState) { System.out.println("Next Key Pressed"); SpotifyUtil.nextSong(); } nextKeyPrevState = currPressState; } public void prevKeyHandler(boolean currPressState) { if (currPressState && !prevKeyPrevState) { System.out.println("Previous Key Pressed"); SpotifyUtil.prevSong(); } prevKeyPrevState = currPressState; } public void forceKeyHandler(boolean currPressState) { if (currPressState && !forceKeyPrevState) { System.out.println("Force Key Pressed"); BlockifyHUD.setDuration(-2000); } forceKeyPrevState = currPressState; } public void hideKeyHandler(boolean currPressState) { if (currPressState && !hideKeyPrevState) { System.out.println("Hide Key Pressed"); if (BlockifyHUD.isHidden) { BlockifyHUD.isHidden = false; } else { BlockifyHUD.isHidden = true; } } hideKeyPrevState = currPressState; } }
[ "jamesdeloach@vt.edu" ]
jamesdeloach@vt.edu
d1266a1ce927712a534570ffdf680a15079656fd
1ef2d5df62d91696a047cc2b69eebc36f6b1f8b5
/s2csv/src/main/java/org/seasar/s2csv/csv/exception/runtime/CSVColumnConfigException.java
ff43d224c9d7b0c69f1c5b12819ac679df393898
[ "Apache-2.0" ]
permissive
seasarorg/s2csv
0bd24e89e9b32ad4a80ac726f220559e3799c387
01ef501c246ff3f12b33483bbeeb529c67fb9caa
refs/heads/master
2021-01-19T14:06:23.223480
2013-10-08T06:14:39
2013-10-08T06:14:39
13,405,022
1
1
null
null
null
null
UTF-8
Java
false
false
617
java
package org.seasar.s2csv.csv.exception.runtime; import org.seasar.framework.exception.SRuntimeException; /** * CSVカラム設定Exception * @author newta */ public class CSVColumnConfigException extends SRuntimeException { private static final long serialVersionUID = 1L; /** * @param clazz * @param cause */ public CSVColumnConfigException(Class<?> clazz, Throwable cause) { super("ESCSV0002", new Object[]{clazz.getName()}, cause); } /** * @param clazz */ public CSVColumnConfigException(Class<?> clazz) { super("ESCSV0002", new Object[]{clazz.getName()}); } }
[ "t.newtaro@gmail.com" ]
t.newtaro@gmail.com
c0de2371420e0fc7faab5072a581c355aa05cf12
9387a5fe8a51cffa71f860a3ae050164df9d7969
/src/main/java/fr/gtm/project/proxibanque/config/ConfigMvc.java
943af51904ca80d805ce39c105b2aea19c177fea
[]
no_license
AntoineVol/formation-security
a744c87a7b48ddb4fe3248e3dd67e87e3fe81a12
d73927e2f5fbee1f0a1cb78e49c8660f5ed1922e
refs/heads/master
2020-03-22T23:45:44.064760
2018-07-13T09:34:51
2018-07-13T09:34:51
140,827,444
0
0
null
null
null
null
UTF-8
Java
false
false
1,614
java
package fr.gtm.project.proxibanque.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.JstlView; @Configuration @EnableWebMvc @EnableJpaRepositories("fr.gtm.project.proxibanque.dao") @ComponentScan({"fr.gtm.project.proxibanque.web","fr.gtm.project.proxibanque.business"}) public class ConfigMvc { @Bean public InternalResourceViewResolver viewResolver() { final InternalResourceViewResolver vr = new InternalResourceViewResolver(); vr.setPrefix("/WEB-INF/views/"); vr.setSuffix(".jsp"); vr.setViewClass(JstlView.class); return vr; } @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { final LocalContainerEntityManagerFactoryBean lcemf = new LocalContainerEntityManagerFactoryBean(); lcemf.setPersistenceUnitName("proxibanque"); return lcemf; } @Bean public PlatformTransactionManager transactionManager() { final JpaTransactionManager tm = new JpaTransactionManager(); tm.setEntityManagerFactory(this.entityManagerFactory().getObject()); return tm; } }
[ "antoine.volatron@gmail.com" ]
antoine.volatron@gmail.com
cc44f06bbbd63092f9f01dbe45a900370071d26b
2267590c52c66aa1002b5249591b8c145d4c59f1
/Android/src/sgen/application/PourneyApplication.java
71199f350e7dc7a51b7c9d7ce7bc0ed6a57ae6ec
[]
no_license
dudals4824/sgenPourney
da9e29b64d0785aeb3d06942e0102b032c5c52a8
9a6a2ef66db61924d1651b37c614e3bff2477b4a
refs/heads/master
2021-01-11T01:31:56.450939
2018-03-11T04:42:02
2018-03-11T04:42:02
70,697,079
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package sgen.application; import android.app.Application; import sgen.DTO.TripDTO; import sgen.DTO.UserDTO; /** * @author Junki * UserDTO를 전역으로 사용하기 위해 Application을 상속한 클래스. * 선언하고 전역 객체 처럼 사용하면 된다. */ public class PourneyApplication extends Application { private UserDTO loggedInUser; private TripDTO selectedTrip; public TripDTO getSelectedTrip() { return selectedTrip; } public void setSelectedTrip(TripDTO selectedTrip) { this.selectedTrip = selectedTrip; } public UserDTO getLoggedInUser() { return loggedInUser; } public void setLoggedInUser(UserDTO loggedInUser) { this.loggedInUser = loggedInUser; } }
[ "kj0604@11674698-1cfd-0410-beed-d2c9834c560c" ]
kj0604@11674698-1cfd-0410-beed-d2c9834c560c
45acfbf74a706e5d7bd72ca25ab38727a106229f
52319968ddfa0a3c03859694f903f49f2db19506
/src/main/java/com/zp/tooluse/CyclicBarrierSum.java
cbf6ce5c01ffa1ad81c82782c1a14c14c1b7b2fb
[]
no_license
nangongyiling/muliThread
10cc2200df7cf4671888ec8a9ed80c98611a09ac
56e15764db4955568bd3003aca2efe09eedaf228
refs/heads/master
2021-05-15T04:23:10.624841
2018-03-10T15:45:18
2018-03-10T15:45:18
119,496,441
0
0
null
null
null
null
UTF-8
Java
false
false
1,729
java
package com.zp.tooluse; import java.util.Map; import java.util.Random; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CyclicBarrier; public class CyclicBarrierSum { static CyclicBarrier c = new CyclicBarrier(5,new SumThread()); //子线程结果存放的缓存 private static ConcurrentHashMap<String,Integer> resultMap = new ConcurrentHashMap<String,Integer>(); //所有子线程达到屏障后,会执行这个Runnable的任务 private static class SumThread implements Runnable{ @Override public void run() { int result =0; for(Map.Entry<String,Integer> workResult:resultMap.entrySet()){ result = result+workResult.getValue(); } System.out.println("result="+result); System.out.println("完全可以做与子线程,统计无关的事情。。。。什么事都行"); } } //工作线程,也就是子线程 private static class WorkThread implements Runnable{ private Random r= new Random(); @Override public void run() { // TODO Auto-generated method stub int t = r.nextInt(1000)+300; System.out.println(Thread.currentThread().getId()+":t="+t); resultMap.put(Thread.currentThread().getId()+"", t); try { Thread.sleep(t+100); c.await(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); }catch (BrokenBarrierException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public static void main(String[] args) { for(int i=0;i<5;i++){ Thread thread = new Thread(new WorkThread()); thread.start(); } } }
[ "805321239@qq.com" ]
805321239@qq.com
20d2336b5860ad0510c5635737a8739b6433ece8
2e3e30b77ab17860f5c977f09915f9fd9bf09109
/src/main/java/com/startopole/authentication/MyDBAuthenticationService.java
ecbb235d034dce0ba29a43551f75ba63268f1aa7
[]
no_license
Remilo7/startopole
67a711e12251e73265e7d0303fd967137ea9056b
16ea23934e3094fe21cdffd57aa04b939f569635
refs/heads/master
2020-04-27T08:07:53.154557
2019-08-01T10:48:13
2019-08-01T10:48:13
174,139,838
0
0
null
null
null
null
UTF-8
Java
false
false
2,002
java
package com.startopole.authentication; import java.util.ArrayList; import java.util.List; import com.startopole.model.entity.UserInfo; import com.startopole.model.entity.UserRole; import com.startopole.services.UserInfoService; import com.startopole.services.UserRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; @Service public class MyDBAuthenticationService implements UserDetailsService { @Autowired private UserRoleService userRoleService; @Autowired private UserInfoService userInfoService; public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { UserInfo userInfo = userInfoService.findUserInfo(username); System.out.println("UserInfo= " + userInfo); if (userInfo == null) { throw new UsernameNotFoundException("User " + username + " was not found in the database"); } // [USER,ADMIN,..] List<UserRole> roles= userRoleService.getAllUserRoles(username); List<GrantedAuthority> grantList= new ArrayList<GrantedAuthority>(); if(roles!= null) { for(UserRole role: roles) { // ROLE_USER, ROLE_ADMIN,.. GrantedAuthority authority = new SimpleGrantedAuthority("ROLE_" + role.getUser_role()); grantList.add(authority); } } UserDetails userDetails = (UserDetails) new User(userInfo.getUserName(), // userInfo.getPassword(),grantList); return userDetails; } }
[ "238283@student.pwr.edu.pl" ]
238283@student.pwr.edu.pl
b75a09de9cdea9bec7f5b0e666c02e53d0fe2ee9
a9119922c8e925928d27665c3885a19bff5db463
/app/src/main/java/com/example/sergi/practicafinal/MemoriaInterna.java
058bdcef20759b827bb94db8bb2e9f0ab90ceb68
[]
no_license
SCamposM/pr
015fbf55082771c0ef0285eeba9b7ae2aad69537
5446b7c2f5a73c1b68dede5e632f4de90b58ae42
refs/heads/master
2020-05-25T08:36:34.596940
2017-03-14T09:01:01
2017-03-14T09:01:01
84,927,438
0
0
null
null
null
null
UTF-8
Java
false
false
1,374
java
package com.example.sergi.practicafinal; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.Toast; public class MemoriaInterna extends Fitxers { private EditText textBox; static final int READ_BLOCK_SIZE = 100; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.memoriainterna); textBox = (EditText) findViewById(R.id.txtText1); } public void onClickGuardar(View v){ String str = textBox.getText().toString(); try{ FileOutputStream fos = openFileOutput("textFile.txt", MODE_PRIVATE); OutputStreamWriter osw = new OutputStreamWriter(fos); // Escribimos el String en el archivo osw.write(str); osw.flush(); osw.close(); // Mostramos que se ha guardado Toast.makeText(getBaseContext(), "Guardado en Data/Data/com.example.sergi.practicafinal", Toast.LENGTH_SHORT).show(); textBox.setText(""); }catch (IOException ex){ ex.printStackTrace(); } } }
[ "scamposm96@gmail.com" ]
scamposm96@gmail.com
cfeb542a3814da337c38f4f6d5c79d070a191cd5
d0f23c3c9c49bd193a75a1eb3a8072071080feb4
/web/WEB-INF/src/org/pgist/tagging/TagAnalyzer.java
6ebb1b16ad85a0e264cab9000c06411a4a335922
[]
no_license
pgistgrp/cvo
e3dedebf40208239f4be3d4f535ced048f69f2f9
5a2dd6526a8eb14164b451bc08d54e953025299d
refs/heads/master
2021-01-23T12:10:12.857574
2008-03-10T06:16:02
2008-03-10T06:16:02
38,912,047
0
0
null
null
null
null
UTF-8
Java
false
false
2,779
java
package org.pgist.tagging; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.pgist.util.ScanResult; import org.pgist.util.Trie; import org.pgist.util.TrieScanner; /** * Tag Analyzer * * @author kenny */ public class TagAnalyzer { private Map tagsMap = new HashMap(); private Trie trie = new Trie(); private TagDAO tagDAO = null; public void setTagDAO(TagDAO tagDAO) { this.tagDAO = tagDAO; } /* * ------------------------------------------------------------------------ */ public void reload() throws Exception { Collection<Tag> tags = tagDAO.getAllTags(); trie.clear(); tagsMap.clear(); for (Tag tag : tags) { addTag(tag); }//for tag }//reload() public Tag getTag(String tagName) { return (Tag) tagsMap.get(tagName); }//getTag() public void addTag(Tag tag) { tagsMap.put(tag.getName(), tag); trie.add(tag.getName(), tag); }//addTag() public Tag deleteTag(String tagName) { trie.remove(tagName); return (Tag) tagsMap.remove(tagName); }//deleteTag() /** * From the given text, give some suggested tags according to the following processes:<br> * <ul> * <li>accept matched included tags (official tags)</li> * <li>reject excluded tags (stopwords)</li> * <li>suggest unrecognized words (potential tags)</li> * </ul> * * @param text the text string to be parsed * @return an 2D array of string, array[0] is the matched tags, array[1] is the suggested words */ public String[][] suggest(String text) { String[][] phrases = new String[2][]; TrieScanner scanner = trie.suggest(text); Set set0 = new HashSet(); Set set1 = new HashSet(); ScanResult result = null; Tag tag = null; while (!scanner.eop()) { result = (ScanResult) scanner.scan(); if (result!=null) { if (result.isMatched()) { tag = (Tag) result.getObject(); if (tag.getType()==Tag.TYPE_INCLUDED) { set0.add(tag.getName()); } } else { set1.add(text.substring(result.getFrom(), result.getTail()).toLowerCase()); } } }//while phrases[0] = (String[]) set0.toArray(new String[0]); phrases[1] = (String[]) set1.toArray(new String[0]); return phrases; }//suggest() }//class TagAnalyzer
[ "" ]
260006240f3186d4995eb5604ed253ae75d83ec1
82960c1fb7e04bf510e5ef14d8a237f11ba1eb31
/src/main/java/io/github/polarizedions/IrcParser/ParsedMessages/User.java
38aa5e5dbe72d8f7e71c96818f0f066f8b1066b2
[ "MIT" ]
permissive
PolarizedIons/shitty-irc-bot
d40f7e03222b3b9130825eee114ff1158ed0dd1d
150dcd0d5074843a42c543ca0b134462332be385
refs/heads/master
2021-05-14T23:27:36.733760
2017-10-30T13:48:34
2017-10-30T13:48:34
104,679,719
0
0
null
null
null
null
UTF-8
Java
false
false
1,609
java
package io.github.polarizedions.IrcParser.ParsedMessages; /** * Copyright 2017 PolarizedIons * <p> * 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: * <p> * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the * Software. * <p> * 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. **/ public class User { public final String nick, ident, host; public User(String nick, String ident, String host) { this.nick = nick; this.ident = ident; this.host = host; } @Override public String toString() { return "User{" + "nick='" + nick + '\'' + ", ident='" + ident + '\'' + ", host='" + host + '\'' + '}'; } }
[ "PolarizedIons@gmail.com" ]
PolarizedIons@gmail.com
b5e3dd1b0be66a992c6931d54c9326b88c38fbfa
3788b1b004ee608949619847a02f7e0ad050f04a
/gumdrop.common/gumdrop/common/Immutable.java
ab64082e451cad6f7defb6159f6149a9b2f40f00
[ "MIT" ]
permissive
pmcollins/gumdrop
b9059df86da2291d321cfd397be09bda1acc965f
f089bff6cb7b26dbed8f57ce753696a5dd2f8ee5
refs/heads/master
2021-05-14T09:31:42.692074
2020-05-18T01:06:29
2020-05-18T01:06:29
115,665,301
0
0
null
null
null
null
UTF-8
Java
false
false
57
java
package gumdrop.common; public @interface Immutable { }
[ "pablo.collins@gmail.com" ]
pablo.collins@gmail.com
6d7f4cfcb71a7ac389a46a48a7818b591cdb6fbb
caaf59514b8cdfe70d05e2a8b45dce9f076fdd4e
/clients/google-api-services-displayvideo/v1/1.30.1/com/google/api/services/displayvideo/v1/model/ListUsersResponse.java
e1dc25ac2eba3b75f63ca7ed28583bc1843efcca
[ "Apache-2.0" ]
permissive
saikickut/google-api-java-client-services
e1928f5528af7e9609b32e0c74fb49e387091c21
ffb0be34fad6d361121ea57f84294fa6adc8c7a2
refs/heads/master
2022-11-28T15:30:57.405276
2020-07-28T11:08:04
2020-07-28T11:08:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,388
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ /* * This code was generated by https://github.com/googleapis/google-api-java-client-services/ * Modify at your own risk. */ package com.google.api.services.displayvideo.v1.model; /** * Response message for ListUsers. * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Display & Video 360 API. For a detailed explanation * see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class ListUsersResponse extends com.google.api.client.json.GenericJson { /** * A token to retrieve the next page of results. Pass this value in the page_token field in the * subsequent call to `ListUsers` method to retrieve the next page of results. This token will be * absent if there are no more results to return. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String nextPageToken; /** * The list of users. This list will be absent if empty. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.util.List<User> users; /** * A token to retrieve the next page of results. Pass this value in the page_token field in the * subsequent call to `ListUsers` method to retrieve the next page of results. This token will be * absent if there are no more results to return. * @return value or {@code null} for none */ public java.lang.String getNextPageToken() { return nextPageToken; } /** * A token to retrieve the next page of results. Pass this value in the page_token field in the * subsequent call to `ListUsers` method to retrieve the next page of results. This token will be * absent if there are no more results to return. * @param nextPageToken nextPageToken or {@code null} for none */ public ListUsersResponse setNextPageToken(java.lang.String nextPageToken) { this.nextPageToken = nextPageToken; return this; } /** * The list of users. This list will be absent if empty. * @return value or {@code null} for none */ public java.util.List<User> getUsers() { return users; } /** * The list of users. This list will be absent if empty. * @param users users or {@code null} for none */ public ListUsersResponse setUsers(java.util.List<User> users) { this.users = users; return this; } @Override public ListUsersResponse set(String fieldName, Object value) { return (ListUsersResponse) super.set(fieldName, value); } @Override public ListUsersResponse clone() { return (ListUsersResponse) super.clone(); } }
[ "noreply@github.com" ]
noreply@github.com
12c1a9fcdcdeee724ee3d1f168e72a4d028dc028
74b91d23030ba640f0eca1fe8bf0ec57b0bca68e
/src/main/java/com/test/ServletInitializer.java
2895b42e251ca29a52680a4b03d541b67617da84
[]
no_license
amruta12343/Screenshot-project
95b79f5c60d985e1ce374f513d66148242354dc4
d5faf64aa4aadb27539eb0d38275ee40ffd07068
refs/heads/master
2023-05-22T17:11:55.924824
2021-06-12T07:10:25
2021-06-12T07:10:25
376,219,450
0
0
null
null
null
null
UTF-8
Java
false
false
403
java
package com.test; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(IsgWhatsappApplication.class); } }
[ "dhawaleamruta1699@gmail.com" ]
dhawaleamruta1699@gmail.com
c10c9d09d6226d08c19a53c1099ce6030e964074
ea03ac7a25ef062e5b472136ed2ae15f8ca44668
/Top9_studio/.svn/pristine/14/148020df36c787101b5ec520dfa59682167e3515.svn-base
8e142ccc4757d86b74f3ecf7eef222c3b37dc123
[]
no_license
staryin-code/work_androidStudio
64b63ee3baa96c01a8ccffd1b102da94f9b7334c
8f1fcdec7add8fa1ec3f546957c52a10ae34f755
refs/heads/master
2021-06-10T11:25:42.208841
2017-01-19T03:33:28
2017-01-19T03:33:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
package com.zeustel.top9.bean.community; /** * 回复 * * @author NiuLei * @email niulei@zeustel.com * @date 2015/11/9 16:02 */ public class Reply extends Mutual { //tag id为评论 }
[ "13715042651@163.com" ]
13715042651@163.com
0551e37bab61cfa815040d40d55757dd5008ebfb
5c7fbc21b38986b8e588aaca311e49191dd2cf35
/ymir-example-generic/src/main/java/com/example/dto/search/ConditionDto.java
43a6895358193c1008f994d38b15bfa573350a8f
[]
no_license
seasarorg/test-ymir-example-1
c5072b5857cda3bc3c3510951cf799fc25d4e690
3b927cd0ec05b910a15f6514dc9606ede79c32b3
refs/heads/master
2016-09-06T18:40:05.535456
2013-10-09T03:49:16
2013-10-09T03:49:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
245
java
package com.example.dto.search; import java.io.Serializable; public class ConditionDto extends ConditionDtoBase implements Serializable { private static final long serialVersionUID = 1L; public ConditionDto() { } }
[ "skirnir@gmail.com" ]
skirnir@gmail.com
01cee099959966bda0402d8aeb099d20217d9781
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/22/22_5bb266480c1c59f49d992c9ffd543fe174ae1b4e/BoxingDeclarationVisitor/22_5bb266480c1c59f49d992c9ffd543fe174ae1b4e_BoxingDeclarationVisitor_s.java
ce12937d3647ceff275d7acced6a826a60f4febe
[]
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
6,805
java
/* * Copyright Red Hat Inc. and/or its affiliates and other contributors * as indicated by the authors tag. All rights reserved. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU General Public License version 2. * * This particular file is subject to the "Classpath" exception as provided in the * LICENSE file that accompanied this code. * * This program is distributed in the hope that it will be useful, but WITHOUT A * 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 distribution; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ package com.redhat.ceylon.compiler.java.codegen; import java.util.Iterator; import java.util.List; import com.redhat.ceylon.compiler.java.util.Util; import com.redhat.ceylon.compiler.typechecker.model.Class; import com.redhat.ceylon.compiler.typechecker.model.Method; import com.redhat.ceylon.compiler.typechecker.model.Parameter; import com.redhat.ceylon.compiler.typechecker.model.ParameterList; import com.redhat.ceylon.compiler.typechecker.model.ProducedType; import com.redhat.ceylon.compiler.typechecker.model.Setter; import com.redhat.ceylon.compiler.typechecker.model.TypeParameter; import com.redhat.ceylon.compiler.typechecker.model.TypedDeclaration; import com.redhat.ceylon.compiler.typechecker.tree.Tree.AnyAttribute; import com.redhat.ceylon.compiler.typechecker.tree.Tree.AnyMethod; import com.redhat.ceylon.compiler.typechecker.tree.Tree.AttributeSetterDefinition; import com.redhat.ceylon.compiler.typechecker.tree.Tree.ClassDefinition; import com.redhat.ceylon.compiler.typechecker.tree.Tree.Variable; import com.redhat.ceylon.compiler.typechecker.tree.Visitor; public class BoxingDeclarationVisitor extends Visitor { private AbstractTransformer transformer; public BoxingDeclarationVisitor(AbstractTransformer transformer){ this.transformer = transformer; } @Override public void visit(AnyMethod that) { super.visit(that); Method method = that.getDeclarationModel(); // deal with invalid input if(method == null) return; Method refinedMethod = (Method) Util.getTopmostRefinedDeclaration(method); // deal with invalid input if(refinedMethod == null) return; setBoxingState(method, refinedMethod); List<ParameterList> methodParameterLists = method.getParameterLists(); List<ParameterList> refinedParameterLists = refinedMethod.getParameterLists(); // deal with invalid input if(methodParameterLists.isEmpty() || refinedParameterLists.isEmpty()) return; Iterator<Parameter> parameters = methodParameterLists.get(0).getParameters().iterator(); for(Parameter refinedParam : refinedParameterLists.get(0).getParameters()){ Parameter param = parameters.next(); setBoxingState(param, refinedParam); } } @Override public void visit(ClassDefinition that) { super.visit(that); Class klass = that.getDeclarationModel(); // deal with invalid input if(klass == null) return; List<ParameterList> parameterLists = klass.getParameterLists(); // deal with invalid input if(parameterLists.isEmpty()) return; List<Parameter> parameters = parameterLists.get(0).getParameters(); for(Parameter param : parameters){ setBoxingState(param, param); } } private void setBoxingState(TypedDeclaration declaration, TypedDeclaration refinedDeclaration) { ProducedType type = declaration.getType(); if(type == null){ // an error must have already been reported return; } // inherit underlying type constraints if(refinedDeclaration != declaration && type.getUnderlyingType() == null) type.setUnderlyingType(refinedDeclaration.getType().getUnderlyingType()); // abort if our boxing state has already been set if(declaration.getUnboxed() != null) return; if((transformer.isCeylonBasicType(type) || transformer.isCeylonArray(type)) && !(refinedDeclaration.getTypeDeclaration() instanceof TypeParameter)){ // propagate to decl if needed if(refinedDeclaration != declaration){ // make sure refined declarations have already been set if(refinedDeclaration.getUnboxed() == null) setBoxingState(refinedDeclaration, refinedDeclaration); // inherit declaration.setUnboxed(refinedDeclaration.getUnboxed()); }else declaration.setUnboxed(true); }else declaration.setUnboxed(false); } @Override public void visit(AnyAttribute that) { super.visit(that); TypedDeclaration declaration = that.getDeclarationModel(); // deal with invalid input if(declaration == null) return; TypedDeclaration refinedDeclaration = (TypedDeclaration)Util.getTopmostRefinedDeclaration(declaration); // deal with invalid input if(refinedDeclaration == null) return; setBoxingState(declaration, refinedDeclaration); } @Override public void visit(AttributeSetterDefinition that) { super.visit(that); Setter declarationModel = that.getDeclarationModel(); // deal with invalid input if(declarationModel == null) return; TypedDeclaration declaration = declarationModel.getParameter(); // deal with invalid input if(declaration == null) return; TypedDeclaration refinedDeclaration = (TypedDeclaration)Util.getTopmostRefinedDeclaration(declaration); // deal with invalid input if(refinedDeclaration == null) return; setBoxingState(declaration, refinedDeclaration); } @Override public void visit(Variable that) { super.visit(that); TypedDeclaration declaration = that.getDeclarationModel(); // deal with invalid input if(declaration == null) return; setBoxingState(declaration, declaration); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2d7bea7d63b5a48727fdb67898285ac1b35dcb38
40612708a44165ebba6d80a01178e539118da414
/app/src/main/java/com/example/huanxin/mymvpdemo/basemvp/MvpView.java
a48053294e9a022b0ff1b1b74aa14e6d75d0f512
[]
no_license
zhangyinglong110/-MyMVPDemo
36332e604956efd055718ed26e75b1ee3ccbfbe9
b395347269642c389e35a21e1ce8474babf44cc0
refs/heads/master
2021-01-13T08:24:34.012417
2016-10-27T03:24:29
2016-10-27T03:24:29
71,873,192
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package com.example.huanxin.mymvpdemo.basemvp; /** * Created by Administrator on 2016/10/25 0025. */ public interface MvpView { }
[ "zhangyinglongvip@163.com" ]
zhangyinglongvip@163.com
d079bfb8c8a2b83fbc22aefbdd70e2a67a7904f1
609533cc95a7fdb43d5830cc765e8b9ad9b14793
/smart-admin/src/test/java/com/github/dljulong/cloud/smartadmin/SmartAdminApplicationTests.java
7a18c6fae3b307fe4cba4dbc0b0d0041471cde3a
[ "Apache-2.0" ]
permissive
dljulong/smartcloud
510cf784fb0ad928e6c76e8235e23ccac35b6947
d87d2b880c53f0c9eaf19b345fe2e3fc652dd5fa
refs/heads/master
2020-03-13T04:47:27.555139
2019-03-22T06:17:40
2019-03-22T06:17:40
130,969,972
0
0
Apache-2.0
2018-04-25T07:49:37
2018-04-25T07:49:36
null
UTF-8
Java
false
false
357
java
package com.github.dljulong.cloud.smartadmin; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class SmartAdminApplicationTests { @Test public void contextLoads() { } }
[ "57694878@qq.com" ]
57694878@qq.com
1ad827a8a46c898f136950decf9dcb0b2dd40893
64f5da2de234f705427e926ea811838c6e2c476f
/Lesson6/6-5/LearnJUnit/src/com/android_textbook/learnjunit/task/SimpleCountUpTask.java
f990cdd645c4065bf6eec814e45adfd0dfeeb9e0
[]
no_license
Ksakai/Jomon
68972f9922b6016f560ac5f023ea75552596edc6
ec1b14d2ac00722c840416534efb682168338e84
refs/heads/master
2021-01-17T22:41:26.506703
2013-07-18T15:28:45
2013-07-18T15:28:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
489
java
package com.android_textbook.learnjunit.task; import android.os.AsyncTask; public class SimpleCountUpTask extends AsyncTask<Integer, Integer, Integer> { @Override protected Integer doInBackground(Integer... params) { if (params.length == 0) { return -1; } int result = 0; int last = params[0]; for (int i = 1; i <= last; i++) { result += i; publishProgress(i); } return result; } }
[ "cattaka@mail.cattaka.net" ]
cattaka@mail.cattaka.net
79fc80385b14f234b1d9e7086ae70ad0c7a49c14
b90486a6d4b883092a786dbdc1d8bc879fd1a7e3
/src/pointergame/PointerBox.java
e733147ab31f017dd8f0352709a01dc8a39d68eb
[]
no_license
wbolduc/PointerGame
a32f33b1a4a00f83ff3a8863b21eef4241681f10
5e35efdd59e9bd9656af383c630799056f169938
refs/heads/master
2020-03-07T08:28:02.123492
2018-05-17T22:39:28
2018-05-17T22:39:28
127,379,061
0
0
null
null
null
null
UTF-8
Java
false
false
936
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 pointergame; import java.awt.Graphics; /** * * @author wbolduc */ public class PointerBox extends Box{ private Box pointingTo = null; PointerBox() { this.pointingTo = null; } //Mutators public void setPointer(Box dest) { pointingTo = dest; dest.addOrigin(this); } //Getters public Box getDest() { return pointingTo; } //Util public void showChain(String indent) { System.out.print(indent); System.out.print("PointerBox pointing to "); if(pointingTo == null) { System.out.println("null"); } else { pointingTo.showChain(); } } }
[ "bubinasuit@gmail.com" ]
bubinasuit@gmail.com
486985d2531a9acc72875307c96226fcaa114ee5
5d95ef212ceb174f114300775cd2b61481183c6e
/app/src/main/java/sp/senac/br/atividade1/LoginActivity.java
f573d0caf0057d3dabf238f69095c710b7e10fb5
[]
no_license
Rufuls/Login1
b0b1c2511f7abce6f8d9aac80c9a84bef5d526e3
41db4a9848881cffde420aa672a904dae0cdb176
refs/heads/master
2020-05-04T17:15:08.821476
2019-04-03T14:09:56
2019-04-03T14:09:56
179,303,858
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package sp.senac.br.atividade1; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class LoginActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_layout); } }
[ "guilherme.balves3@senacsp.edu.br" ]
guilherme.balves3@senacsp.edu.br
d661cce0be2669ce9bdfc5665f0610e8b407b953
6adeb4e609cf8b1dc4f0f2de395c33fc8355f499
/app/src/androidTest/java/com/sjh/basecommon/ExampleInstrumentedTest.java
09c601c904d1cb42bdf7b739f1e2507a2b7cbfc7
[]
no_license
xiaohuajian/baseCommonProject
af1be82e0827414ea4e47dc31f7f68fce7056fa0
a51cdacc25488a2fd85108f7d029cedb114cd30d
refs/heads/master
2020-06-01T19:07:46.997729
2019-06-09T12:18:25
2019-06-09T12:18:25
190,894,908
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package com.sjh.basecommon; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.sjh.basecommon", appContext.getPackageName()); } }
[ "jianhua.shi@pendanaan.com" ]
jianhua.shi@pendanaan.com
b8da3fd02748ecd958ddd03b7aeaf63d3ece09a5
f6d2058abd9ac11ba69ec78ccd59b0760ed50d0b
/app/src/main/java/xy/hippocampus/cadenza/view/progress/Circle.java
b2eaf678755d7d68531e2c24dab0b6fca7e91822
[]
no_license
xavier0507/Cadenza
161b1d5e94d42ff2a9da1117cce6b9c104a9f64f
705bbdaffb182b920e5bbfd62d3300540279630e
refs/heads/master
2021-01-01T17:51:11.487910
2017-08-17T07:38:24
2017-08-17T07:38:24
98,174,848
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package xy.hippocampus.cadenza.view.progress; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PointF; /** * Created by Xavier Yin on 5/2/17. */ public class Circle { protected Paint paint; private PointF center; private float radius; public void setColor(int color) { this.paint.setColor(color); } public Circle() { this.paint = new Paint(); this.paint.setAntiAlias(true); this.center = new PointF(); } public void setRadius(float radius) { this.radius = radius; } public void setCenter(float x, float y) { this.center.set(x, y); } public void draw(Canvas canvas) { canvas.drawCircle(this.center.x, this.center.y, this.radius, this.paint); } }
[ "xavier0507.yin@gmail.com" ]
xavier0507.yin@gmail.com
ccba77bca324e0d5db7dca41e2eae853f0d2c9b0
ca85b4da3635bcbea482196e5445bd47c9ef956f
/iexhub/src/main/java/org/hl7/v3/CentralNumic.java
37944b8e10464c8e963d82fd499c31d98127a989
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
bhits/iexhub-generated
c89a3a9bd127140f56898d503bc0c924d0398798
e53080ae15f0c57c8111a54d562101d578d6c777
refs/heads/master
2021-01-09T05:59:38.023779
2017-02-01T13:30:19
2017-02-01T13:30:19
80,863,998
0
1
null
null
null
null
UTF-8
Java
false
false
2,149
java
/******************************************************************************* * Copyright (c) 2015, 2016 Substance Abuse and Mental Health Services Administration (SAMHSA) * * 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. * * Contributors: * Eversolve, LLC - initial IExHub implementation for Health Information Exchange (HIE) integration * Anthony Sute, Ioana Singureanu *******************************************************************************/ package org.hl7.v3; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CentralNumic. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="CentralNumic"> * &lt;restriction base="{urn:hl7-org:v3}cs"> * &lt;enumeration value="x-COM"/> * &lt;enumeration value="x-PAR"/> * &lt;enumeration value="x-SHH"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "CentralNumic") @XmlEnum public enum CentralNumic { @XmlEnumValue("x-COM") X_COM("x-COM"), @XmlEnumValue("x-PAR") X_PAR("x-PAR"), @XmlEnumValue("x-SHH") X_SHH("x-SHH"); private final String value; CentralNumic(String v) { value = v; } public String value() { return value; } public static CentralNumic fromValue(String v) { for (CentralNumic c: CentralNumic.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "michael.hadjiosif@feisystems.com" ]
michael.hadjiosif@feisystems.com
01e4befb03e035a0b6d21d86a3dce1051da17fdc
0721305fd9b1c643a7687b6382dccc56a82a2dad
/src/app.zenly.locator_4.8.0_base_source_from_JADX/sources/zendesk/core/ZendeskStorageModule_ProvideCacheFactory.java
76e298653b6a6bf0c733276a58586ff5b36582ac
[]
no_license
a2en/Zenly_re
09c635ad886c8285f70a8292ae4f74167a4ad620
f87af0c2dd0bc14fd772c69d5bc70cd8aa727516
refs/heads/master
2020-12-13T17:07:11.442473
2020-01-17T04:32:44
2020-01-17T04:32:44
234,470,083
1
0
null
null
null
null
UTF-8
Java
false
false
833
java
package zendesk.core; import dagger.internal.C12021c; import dagger.internal.Factory; import java.io.File; import javax.inject.Provider; import okhttp3.C13204g; public final class ZendeskStorageModule_ProvideCacheFactory implements Factory<C13204g> { private final Provider<File> fileProvider; public ZendeskStorageModule_ProvideCacheFactory(Provider<File> provider) { this.fileProvider = provider; } public static Factory<C13204g> create(Provider<File> provider) { return new ZendeskStorageModule_ProvideCacheFactory(provider); } public C13204g get() { C13204g provideCache = ZendeskStorageModule.provideCache((File) this.fileProvider.get()); C12021c.m31671a(provideCache, "Cannot return null from a non-@Nullable @Provides method"); return provideCache; } }
[ "developer@appzoc.com" ]
developer@appzoc.com
19b391a35ea48a9b921cb723bb0eac9e1d84fc3d
03b24aa170c1b643af5397cb8237145f52e2635b
/app/src/main/java/org/crazyit/customviewpager/MainActivity.java
fd718c43e4e288a98a34145d81d34dd8e86362f4
[]
no_license
Ti2Yuan/ViewPagerIndicatorDemo
e65bb5b769f8cbffda01dba1c415546c4332d56e
4bdfa327022add547893a86647f95aa10cfe5196
refs/heads/master
2020-12-25T14:57:47.892484
2016-06-06T07:50:29
2016-06-06T07:50:29
60,508,789
0
0
null
null
null
null
UTF-8
Java
false
false
3,063
java
package org.crazyit.customviewpager; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Window; import org.orazyit.Fragments.VpSimpleFragment; import org.orazyit.view.ViewPagerIndicator; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class MainActivity extends AppCompatActivity { private ViewPager mViewPager; private ViewPagerIndicator mIndicator; private List<String> mTitles = Arrays.asList("短信1","收藏2","推荐3","短信4","收藏5","推荐6","短信7","收藏8","推荐9"); private List<VpSimpleFragment> mContents = new ArrayList<VpSimpleFragment>(); private FragmentPagerAdapter mAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main2); initView(); initDatas(); // mIndicator.setVisibleTabCount(4); mIndicator.setTabItemTitles(mTitles); mViewPager.setAdapter(mAdapter); mIndicator.setViewPager(mViewPager,0); mIndicator.setOnPageChangeListener(new ViewPagerIndicator.PageOnChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { } @Override public void onPageScrollStateChanged(int state) { } }); // mViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { // @Override // public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { // //tabWidth * positionOffset + position * tabWidth // mIndicator.scroll(position,positionOffset); // } // // @Override // public void onPageSelected(int position) { // // } // // @Override // public void onPageScrollStateChanged(int state) { // // } // }); } private void initView() { mViewPager = (ViewPager)findViewById(R.id.id_viewpager); mIndicator = (ViewPagerIndicator) findViewById(R.id.id_indicator); for(String title:mTitles){ VpSimpleFragment fragment = VpSimpleFragment.newInstance(title); mContents.add(fragment); } mAdapter = new FragmentPagerAdapter(getSupportFragmentManager()) { @Override public Fragment getItem(int position) { return mContents.get(position); } @Override public int getCount() { return mContents.size(); } }; } private void initDatas(){ } }
[ "275001068@qq.com" ]
275001068@qq.com
a787b8b9ebe8034f9073e9b478eb30b1a4abdbfe
b433b7f88f114cbd6d60063ab1b69a65bcaf5ee1
/oppf2-portal/.svn/pristine/09/093d3fb68746f52c12f00e4eea7de812f00d3580.svn-base
2db52cdc662fc09bc04608d1d47e2f668d868472
[]
no_license
videocalls/videocall-1
ca972aa3832e86f33960b2ccb18c820a6e0a1af0
e305309da0be80b14673a97a080b9b11e28f0a2e
refs/heads/master
2020-03-29T11:53:04.746403
2018-09-27T07:50:46
2018-09-27T07:50:46
149,875,389
0
1
null
2018-09-22T12:37:05
2018-09-22T12:37:04
null
UTF-8
Java
false
false
5,700
package kr.co.koscom.oppf.spt.myp.sptMyInfo.service.impl; import javax.annotation.Resource; import org.apache.log4j.Logger; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import kr.co.koscom.oppf.cmm.util.OppfStringUtil; import kr.co.koscom.oppf.spt.myp.sptMyInfo.service.SptMyInfoService; import kr.co.koscom.oppf.spt.myp.sptMyInfo.service.SptMyInfoVO; import kr.co.koscom.oppf.spt.myp.sptMyInfo.web.SptMyInfoController; /** * @Project : 자본시장 공동 핀테크 오픈플랫폼 구축 * @FileName : SptMyInfoServiceImpl.java * @Comment : [개인회원정보]정보관리를 위한 Service 클래스 * @author : 포털 유제량 * @since : 2016.05.09 * @version : 1.0 * @see * * << 개정이력(Modification Information) >> * 수정일 수정자 수정내용 * ----------- ------ ---------- * 2016.05.09 유제량 최초생성 * */ @Service("SptMyInfoService") public class SptMyInfoServiceImpl implements SptMyInfoService{ @Resource(name = "SptMyInfoDAO") private SptMyInfoDAO sptMyInfoDAO; private static final Logger log = Logger.getLogger(SptMyInfoController.class); /** * @Method Name : selectSptMyInfo * @Method description : [개인회원정보상세:상세]정보를 조회한다. * @param : SptMyInfoVO * @return : SptMyInfoVO * @throws : Exception */ @Transactional public SptMyInfoVO selectSptMyInfo(SptMyInfoVO sptMyInfoVO) throws Exception{ log.info("------------- selectSptMyInfo START ------------------------"); SptMyInfoVO rs = sptMyInfoDAO.selectSptMyInfo(sptMyInfoVO); log.info("------------- selectSptMyInfo END --------------------------"); return rs; } /** * @Method Name : selectCheckPw * @Method description : [개인회원정보:ID중복확인]ID정보를 조회한다. * @param : String * @return : String * @throws : Exception */ @Transactional public String selectCheckPw(SptMyInfoVO sptMyInfoVO) throws Exception{ log.info("------------- selectCheckPw START ------------------------"); String rs = sptMyInfoDAO.selectCheckPw(sptMyInfoVO); log.info("------------- selectCheckPw END --------------------------"); return rs; } /** * @Method Name : updateSptMyInfo * @Method description : [개인회원정보:수정]을 한다. * @param : SptMyInfoVO * @return : int * @throws : Exception */ @Transactional public int updateSptMyInfo(SptMyInfoVO sptMyInfoVO) throws Exception{ log.info("------------- updateSptMyInfo START ------------------------"); //1.기본정보 DB등록 int rs = sptMyInfoDAO.updateSptMyInfo(sptMyInfoVO); //2.기본정보hist DB등록 sptMyInfoDAO.insertSptMyPwMod(sptMyInfoVO); log.info("------------- updateSptMyInfo END --------------------------"); return rs; } /** * @Method Name : updateSptMyPwMod * @Method description : [개인회원정보:비밀번호변경]을 한다. * @param : SptMyInfoVO * @return : int * @throws : Exception */ @Transactional public int updateSptMyPwMod(SptMyInfoVO sptMyInfoVO) throws Exception{ log.info("------------- updateSptMyPwMod START ------------------------"); //1.기본정보 DB등록 int rs = sptMyInfoDAO.updateSptMyPwMod(sptMyInfoVO); //2.기본정보hist DB등록 sptMyInfoDAO.insertSptMyPwMod(sptMyInfoVO); log.info("------------- updateSptMyPwMod END --------------------------"); return rs; } /** * @Method Name : updateSptMbrSecesInfo * @Method description : [개인회원정보:회원탈퇴]를 한다. * @param : SptMyInfoVO * @return : int * @throws : Exception */ @Transactional public int updateSptMbrSecesInfo(SptMyInfoVO sptMyInfoVO) throws Exception{ log.info("------------- updateSptMbrSecesInfo START ------------------------"); //1.기본정보 DB등록 int rs = sptMyInfoDAO.updateSptMbrSecesInfo(sptMyInfoVO); //2.기본정보hist DB등록 sptMyInfoDAO.insertSptMyPwMod(sptMyInfoVO); log.info("------------- updateSptMbrSecesInfo END --------------------------"); return rs; } /** * @Method Name : selectSptCustomerInfoProfile * @Method description : [개인회원정보:기본]정보를 조회한다. * @param : SptMyInfoVO * @return : SptMyInfoVO * @throws : Exception */ @Transactional public SptMyInfoVO selectSptCustomerInfoProfile(SptMyInfoVO paramVO) throws Exception{ return (SptMyInfoVO) sptMyInfoDAO.selectSptCustomerInfoProfile(paramVO); } /** * @Method Name : selectSptCustomerProfile * @Method description : [개인회원정보상세:상세]정보를 조회한다.(탈퇴메일발송를 위한 정보를 조회해 온다.) * @param : SptMyInfoVO * @return : SptMyInfoVO * @throws : Exception */ @Transactional public SptMyInfoVO selectSptCustomerProfile(SptMyInfoVO paramVO) throws Exception{ return (SptMyInfoVO) sptMyInfoDAO.selectSptCustomerProfile(paramVO); } }
[ "dongbeom.kim@gmail.com" ]
dongbeom.kim@gmail.com
a755acd83e120ec71cd7aabdc93795d6b34b34de
b80e1944039400570fb2012d7704500221cf596d
/android/src/com/mygdx/game/AndroidLauncher.java
be1a932eb75dcad58d3668d8328d1b3d8ad77e05
[]
no_license
YasiTL/color-blend
2281f24695f04b04184a3b5687323a85180e88cc
5227766ff0fcd528fca3ca20eec92ab40062d565
refs/heads/master
2020-03-14T00:52:21.749058
2018-05-17T15:19:21
2018-05-17T15:19:21
125,302,220
0
0
null
null
null
null
UTF-8
Java
false
false
542
java
package com.mygdx.game; import android.os.Bundle; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; public class AndroidLauncher extends AndroidApplication { @Override protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); config.useAccelerometer = false; config.useCompass = false; initialize(new MyGdxGame(), config); } }
[ "yasaman.most@gmail.com" ]
yasaman.most@gmail.com
f4878ccf23c8d934f99675671dbe1ddd75f1301c
ff1937a5a5ec1ef91218bc4cc01552504262d797
/src/chat_server/tester_client.java
9549990a6fd0736b7547a7285fd2a98b9a38adca
[]
no_license
jkracz/ChatServer
e294ca032f43c481050247032c65bb965fe3c0a7
8127be67dd939769e4ac984b7530df652613555c
refs/heads/master
2023-08-02T23:30:44.938540
2023-07-26T00:48:11
2023-07-26T00:48:11
149,633,247
0
0
null
null
null
null
UTF-8
Java
false
false
6,572
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 chat_server; import java.io.IOException; import java.io.PrintStream; import java.net.Socket; import java.util.Scanner; /** * * @author Joseph */ public class tester_client extends javax.swing.JFrame { /** * Creates new form tester_client */ public tester_client() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jTextField1 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setEditable(false); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jTextField1.setText("jTextField1"); jButton1.setText("jButton1"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton1)) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 393, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(129, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(72, 72, 72) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1)) .addContainerGap(80, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: jTextArea1.setText(jTextArea1.getText()+" This is a test\n"); }//GEN-LAST:event_jButton1ActionPerformed /** * @param args the command line arguments */ static Socket k; public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(tester_client.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(tester_client.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(tester_client.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(tester_client.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new tester_client().setVisible(true); } }); //jTextArea1.setText("This is a test\n"); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private static javax.swing.JTextArea jTextArea1; private javax.swing.JTextField jTextField1; // End of variables declaration//GEN-END:variables }
[ "jpk389@nyu.edu" ]
jpk389@nyu.edu
335a9a488952fb8f1af5e23147cafb06519f446d
47ea6cc8613badb07816df5f786358bf20356d95
/driver-artemis/src/main/java/io/openmessaging/benchmark/driver/artemis/ArtemisBenchmarkConsumer.java
6f6a71e641087768e22eaac96c86d51a03f91f82
[ "Zlib", "LicenseRef-scancode-protobuf", "Apache-2.0", "BSD-2-Clause" ]
permissive
confluentinc/openmessaging-benchmark
91c9593a3c722c51c800cdd28eab5f7c196096a3
5c0acd3f5dce43e23e4de95056d28344bf183cb3
refs/heads/master
2023-07-20T02:35:40.639262
2023-06-12T05:28:45
2023-06-12T05:28:45
271,657,488
75
35
Apache-2.0
2023-06-12T05:28:47
2020-06-11T22:21:13
Java
UTF-8
Java
false
false
2,714
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package io.openmessaging.benchmark.driver.artemis; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.client.ClientConsumer; import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.openmessaging.benchmark.driver.BenchmarkConsumer; import io.openmessaging.benchmark.driver.ConsumerCallback; public class ArtemisBenchmarkConsumer implements BenchmarkConsumer { private final ClientSession session; private final ClientConsumer consumer; public ArtemisBenchmarkConsumer(String topic, String queueName, ClientSessionFactory sessionFactory, ConsumerCallback callback) throws ActiveMQException { session = sessionFactory.createSession(); session.createQueue(SimpleString.toSimpleString(topic), RoutingType.MULTICAST, SimpleString.toSimpleString(queueName), true /* durable */); consumer = session.createConsumer(queueName); consumer.setMessageHandler(message -> { byte[] payload = new byte[message.getBodyBuffer().readableBytes()]; message.getBodyBuffer().readBytes(payload); callback.messageReceived(payload, message.getTimestamp()); try { message.acknowledge(); } catch (ActiveMQException e) { log.warn("Failed to acknowledge message", e); } }); session.start(); } @Override public void close() throws Exception { consumer.close(); session.close(); } private static final Logger log = LoggerFactory.getLogger(ArtemisBenchmarkConsumer.class); }
[ "guosijie@gmail.com" ]
guosijie@gmail.com