blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5e9bf1e8e9b8150eac5fb976bb1c3612d6e5b3e0 | 2120efbb93f420937641a98f749bfd6d4c8af41f | /src/main/java/com/daokoujinke/service/project/ProjectService.java | ec6476f5887de8ae976311cb740c69eeafcf56a5 | [] | no_license | whhard/rule | 3a98ec837a6bcffe09246c4c7684c73e1e09db12 | 511d39998de428126bb7717d0e528222b6fe51bc | refs/heads/master | 2020-05-04T22:07:40.443602 | 2019-04-04T17:54:35 | 2019-04-04T17:54:35 | 179,500,396 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 202 | java | package com.daokoujinke.service.project;
import com.daokoujinke.entity.project.Project;
import java.util.List;
public interface ProjectService {
public List<Project> showAllProject();
}
| [
"11whhard@gmail.com"
] | 11whhard@gmail.com |
a2c45509536cb0cc00706b229a0cb842db49748b | 390af6afd76c8c8eb5d1a48b256f205ea42a8075 | /src/main/java/com/sda/servlets/users/UsersService.java | 03d04778f954e57b98e74759fcfbb532ea05ec0a | [] | no_license | MagdaSzuman/jsp-servlety | 67d67682d97138234847f50e98afae36756da270 | f5b2b7254d491a13678b67d37b9f65b85d300534 | refs/heads/master | 2020-04-06T11:54:13.578369 | 2018-11-22T18:18:52 | 2018-11-22T18:18:52 | 157,435,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,251 | java | package com.sda.servlets.users;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class UsersService {
private static UsersService instance;
public static UsersService instanceOf() {
if (instance == null) {
instance = new UsersService();
}
return instance;
}
private List<User> users;
private Integer nextId;
private UsersService() {
this.users = new ArrayList<>();
this.nextId = 1;
save(new User("Jan", "Kowalski", 40, "man"));
save(new User("Marek", "Nowak", 50, "man"));
save(new User("Janina", "Nowacka", 30, "woman"));
save(new User("Krystyna", "Kowal", 20, "woman"));
}
public List<User> findAll() {
return new ArrayList<>(users);
}
public void save(User user) {
if (user.getId() != null) {
users.stream()
.filter(e -> e.getId().equals(user.getId()))
.findFirst()
.ifPresent(e -> {
e.setFirstName(user.getFirstName());
e.setLastName(user.getLastName());
e.setAge(user.getAge());
e.setGender(user.getGender());
});
} else {
user.setId(nextId++);
users.add(user);
}
}
public User findById(int id) throws UserNotFoundException {
return users.stream()
.filter(user -> user.getId().equals(id))
.findFirst()
.orElseThrow(()-> new UserNotFoundException("User with id " + id + " does not existis"));
}
public List<User> findByQuery(String query) {
List<User> usersToReturn = new ArrayList<>();
for (User user : users) {
String userRepresentation = user.getFirstName() + " " + user.getLastName();
if (userRepresentation.contains(query)) {
usersToReturn.add(user);
}
}
return usersToReturn;
}
public void delete(Integer id) {
this.users = users.stream()
.filter(e->!e.getId().equals(id))
.collect(Collectors.toList());
}
}
| [
"szumagda@wp.pl"
] | szumagda@wp.pl |
2c55bb2a119a3d90a000ed37f4126b6da0bf7df5 | 8a299660ae9437669c48cf70f654214cf0d24c1e | /src/main/java/com/xyf/learnweb/common/xss/XssFilter.java | ea9195b7a530f44a77b504136e3b14e3345ba17b | [] | no_license | Tutument/learnweb | 587ce1df9e8f927cd2ef5a6255060baa238b4e07 | b559c0a5a9e6b10bc0de8212ecabde1e6ed3e100 | refs/heads/master | 2023-01-12T16:03:52.547098 | 2020-11-09T08:09:34 | 2020-11-09T08:09:34 | 311,257,582 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,459 | java | package com.xyf.learnweb.common.xss;
import com.xyf.learnweb.common.utils.StringUtils;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 防止XSS攻击的过滤器
*
* @author Lihui
*/
public class XssFilter implements Filter
{
/**
* 排除链接
*/
public List<String> excludes = new ArrayList<>();
/**
* xss过滤开关
*/
public boolean enabled = false;
@Override
public void init(FilterConfig filterConfig) throws ServletException
{
String tempExcludes = filterConfig.getInitParameter("excludes");
String tempEnabled = filterConfig.getInitParameter("enabled");
if (StringUtils.isNotEmpty(tempExcludes))
{
String[] url = tempExcludes.split(",");
for (int i = 0; url != null && i < url.length; i++)
{
excludes.add(url[i]);
}
}
if (StringUtils.isNotEmpty(tempEnabled))
{
enabled = Boolean.valueOf(tempEnabled);
}
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
if (handleExcludeURL(req, resp))
{
chain.doFilter(request, response);
return;
}
XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request);
chain.doFilter(xssRequest, response);
}
private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response)
{
if (!enabled)
{
return true;
}
if (excludes == null || excludes.isEmpty())
{
return false;
}
String url = request.getServletPath();
for (String pattern : excludes)
{
Pattern p = Pattern.compile("^" + pattern);
Matcher m = p.matcher(url);
if (m.find())
{
return true;
}
}
return false;
}
@Override
public void destroy()
{
}
} | [
"15735170682@163.com"
] | 15735170682@163.com |
a15e5f7cbd9e8ab6c65bed9a1c18dfab65a82a98 | be962f2f0e440ea4a292377b18630816147eba13 | /app/src/main/java/com/example/dell/expensemanager/Week.java | f12caf279646cbf498bb9c0446a7ccfb7e14ea97 | [] | no_license | anghotachap/ExpenseManager | d3c02b496c82cb9d90970bc7e78ba569f56e218f | 2f1813490f77df6f37084b3b73e41800af1f7f23 | refs/heads/master | 2020-04-02T02:05:18.086188 | 2018-10-21T12:57:51 | 2018-10-21T12:57:51 | 153,890,763 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 708 | java | package com.example.dell.expensemanager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class Week extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.week, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getActivity().setTitle("Week");
}
} | [
"tejasmsawant@icloud.com"
] | tejasmsawant@icloud.com |
104f25154af33356751048744bc10a7becd7efe6 | 0cc3393f55bde98771f8f73d52dd98ff2fca13ba | /movie-catalog-service/src/main/java/io/javabrains/moviecatalogservice/resources/MovieCatalogResource.java | db54f36df0cefb7bb108fa4b8c9e261893d014a6 | [] | no_license | kelongchen/RateVedioMicroService | c10a4d9d4f96eb8e0572963e60c4f2111eeaac4f | 5cde94706f76f525a97c4ba4003625908dc414ad | refs/heads/master | 2022-12-21T20:36:45.717454 | 2020-09-29T07:05:26 | 2020-09-29T07:05:26 | 299,531,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,894 | java | package io.javabrains.moviecatalogservice.resources;
import com.netflix.discovery.DiscoveryClient;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import io.javabrains.moviecatalogservice.models.CatalogItem;
import io.javabrains.moviecatalogservice.models.Movie;
import io.javabrains.moviecatalogservice.models.Rating;
import io.javabrains.moviecatalogservice.models.UserRating;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/catalog")
public class MovieCatalogResource {
@Autowired //is by type => somewhere there is a bean of type RestTemplate , inject it here
//if there is more than 1 bean with the same type, we should tag them with qualifier
//both bean and Autowired
private RestTemplate restTemplate; //create a property of class of the same type of Bean
//in this way we can access to discovery client interface, to get info about discovery
// instance os service such as URL , port of service and ...
@Autowired
private DiscoveryClient discoveryClient;
@Autowired
private WebClient.Builder webClientBuilder;
@RequestMapping("/{userId}")
@HystrixCommand(fallbackMethod = "getFallbackCatalog") //this is the method if circuit breaks will be called
public List<CatalogItem> getCatalog(@PathVariable("userId") String userId){
//create an instance of rest template ( a utility object that is supposed to make rest api call)
//RestTemplate restTemplate = new RestTemplate();
//1.get all the rated movie id
UserRating ratings = restTemplate.getForObject("http://rating-data-service/ratingsdata/users/" +userId,UserRating.class);
//2."for each movie" id "call info service" and get detail
return ratings
.getUserRatings()//get the list from object
.stream()
//for each movie make a separate call and return the "movie"
//these call are sync => to be async(at the same time) => use webClient
.map(rating -> {
//"option"+"cmd"+"v" => to create a variable name for it
Movie movie = restTemplate.getForObject("http://movie-info-service/movies/" + rating.getMovieId(), Movie.class);
//TO GET DATA FROM **** WEB CLIENT ****:
//Is a REACTIVE STREAM
Movie movieFromWebClient = webClientBuilder.build()
.get() //type of method
.uri("http://localhost:8082/movies/" + rating.getMovieId()) //the path of service
.retrieve() //fetch this data
.bodyToMono(Movie.class) //convert the body to this instance of this class
//mono in async way is same as a proxy
.block(); //blocks the execution until the result gets back and mono is fulfilled
//3. put them all together
//instead of movie can be "movieFromWebClient"
return new CatalogItem(movie.getMovieName(),"desc",rating.getRating());
})
.collect(Collectors.toList());
}
//SHOULD HAVE EXACTLY THE SAME METHOD SIGNATURE
public List<CatalogItem> getFallbackCatalog(@PathVariable("userId") String userId){
//should be simple hard-coded response => we are sure it never fails
return Arrays.asList(new CatalogItem("no moview","",0));
}
}
| [
"lkl19970321@gmail.com"
] | lkl19970321@gmail.com |
b7cf3a6a31f4d77dad2350cc54675e50fe4b6c8e | 6f06172c8c690310200208820bc3c88928e728f9 | /framework-common/src/main/java/com/zyl/framework/common/AsyncTaskConfiguration.java | c091ea4a95c83b7fdf993cad92bb56abf1a36b17 | [] | no_license | Allen0710/framework | 7f379347cacd0f289436070995122a3ec392c4e8 | 8c59c9206b439bdf01bcef5792f0e689d68b9b1f | refs/heads/master | 2020-03-22T23:46:00.390379 | 2018-09-27T08:19:26 | 2018-09-27T08:19:26 | 140,827,740 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 857 | java | package com.zyl.framework.common;
import java.util.concurrent.ThreadPoolExecutor;
import org.springframework.context.annotation.Bean;
import org.springframework.core.task.AsyncTaskExecutor;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/**
* async task param configuration
* @author zhang
*/
@EnableAsync
public class AsyncTaskConfiguration {
@Bean
public AsyncTaskExecutor asyncTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setThreadNamePrefix("Async-Task-Executor");
executor.setMaxPoolSize(10);
// 设置拒绝策略
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
}
| [
"zhangyl@ushareit.com"
] | zhangyl@ushareit.com |
178f1a56c1042a804084edc7b2294db6f34dee8b | 55c45a5fbe5e78832b028d31fb9523784dc07825 | /emotional_analysis_parent/emotional_analysis_spider/src/main/java/org/bianqi/wangyi/entity/comment/Comments.java | 7b2f01d748dff4c785818a7a0b447939a46df03e | [
"Apache-2.0"
] | permissive | Inceptionlrz/emotional_analysis | ef2b10281a38723cb1075a0fb8ec6eefaf23e86b | 79aba9dbcff59d86f532fb2ba7b22356a8d5fed5 | refs/heads/master | 2021-01-15T06:51:00.761185 | 2020-03-04T12:41:56 | 2020-03-04T12:41:56 | 242,906,641 | 1 | 0 | Apache-2.0 | 2020-02-25T04:08:16 | 2020-02-25T04:08:15 | null | UTF-8 | Java | false | false | 1,353 | java | /**
* Copyright 2017 bejson.com
*/
package org.bianqi.wangyi.entity.comment;
import java.util.List;
/**
* Auto-generated: 2017-10-25 14:24:57
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
public class Comments {
private User user;
private boolean liked;
private long commentId;
private long likedCount;
private long time;
private String content;
private boolean isRemoveHotComment;
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public boolean isLiked() {
return liked;
}
public void setLiked(boolean liked) {
this.liked = liked;
}
public long getCommentId() {
return commentId;
}
public void setCommentId(long commentId) {
this.commentId = commentId;
}
public long getLikedCount() {
return likedCount;
}
public void setLikedCount(long likedCount) {
this.likedCount = likedCount;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public boolean isRemoveHotComment() {
return isRemoveHotComment;
}
public void setRemoveHotComment(boolean isRemoveHotComment) {
this.isRemoveHotComment = isRemoveHotComment;
}
} | [
"bianqi@Love"
] | bianqi@Love |
09f1b511916539d925442e5938c8ffc3ed761ff2 | 54eb8c00bc84cc79f1043536ca818a2dac31bc30 | /lucene-fsa/src-test/morfologik/fsa/FSATraversalTest.java | 38800c7ac44d62c5a7822e52f48534aab8310b65 | [] | no_license | dweiss/poligon | 55bc3907ebe08e508ccab210c6443f6df75bdf04 | 024d72a7cb670ee524eed7743c68e985d28ae4d8 | refs/heads/master | 2021-01-15T22:34:34.145376 | 2020-07-10T13:41:36 | 2020-07-10T13:41:36 | 507,710 | 0 | 1 | null | 2020-10-13T23:27:57 | 2010-02-08T12:15:48 | Java | UTF-8 | Java | false | false | 4,101 | java | package morfologik.fsa;
import static org.junit.Assert.*;
import static morfologik.fsa.MatchResult.*;
import java.io.*;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.HashSet;
import org.junit.Before;
import org.junit.Test;
/**
* Tests {@link FSATraversal}.
*/
public final class FSATraversalTest {
private FSA fsa;
/**
*
*/
@Before
public void setUp() throws Exception {
fsa = FSA.read(this.getClass().getResourceAsStream("en_tst.dict"));
}
/**
*
*/
@Test
public void testTraversalWithIterable() {
int count = 0;
for (ByteBuffer bb : fsa.getSequences()) {
assertEquals(0, bb.arrayOffset());
assertEquals(0, bb.position());
count++;
}
assertEquals(346773, count);
}
/**
*
*/
@Test
public void testPerfectHash() throws IOException {
byte[][] input = new byte[][] {
{ 'a' },
{ 'a', 'b', 'a' },
{ 'a', 'c' },
{ 'b' },
{ 'b', 'a' },
{ 'c' },
};
Arrays.sort(input, FSABuilder.LEXICAL_ORDERING);
State s = FSABuilder.build(input);
final byte[] fsaData =
new FSA5Serializer()
.withNumbers()
.serialize(s, new ByteArrayOutputStream())
.toByteArray();
final FSA5 fsa = (FSA5) FSA.read(new ByteArrayInputStream(fsaData));
final FSATraversal traversal = new FSATraversal(fsa);
int i = 0;
for (byte [] seq : input)
{
assertEquals(new String(seq), i++, traversal.perfectHash(seq));
}
// Check if the total number of sequences is encoded at the root node.
assertEquals(6, fsa.getNumberAtNode(fsa.getRootNode()));
// Check sub/super sequence scenarios.
assertEquals(AUTOMATON_HAS_PREFIX, traversal.perfectHash("abax".getBytes("UTF-8")));
assertEquals(SEQUENCE_IS_A_PREFIX, traversal.perfectHash("ab".getBytes("UTF-8")));
assertEquals(NO_MATCH, traversal.perfectHash("d".getBytes("UTF-8")));
assertEquals(NO_MATCH, traversal.perfectHash(new byte [] {0}));
assertTrue(AUTOMATON_HAS_PREFIX < 0);
assertTrue(SEQUENCE_IS_A_PREFIX < 0);
assertTrue(NO_MATCH < 0);
}
/**
*
*/
@Test
public void testRecursiveTraversal() {
final int[] counter = new int[] { 0 };
class Recursion {
public void dumpNode(final int node) {
int arc = fsa.getFirstArc(node);
do {
if (fsa.isArcFinal(arc)) {
counter[0]++;
}
if (!fsa.isArcTerminal(arc)) {
dumpNode(fsa.getEndNode(arc));
}
arc = fsa.getNextArc(arc);
} while (arc != 0);
}
}
new Recursion().dumpNode(fsa.getRootNode());
assertEquals(346773, counter[0]);
}
/**
* Test {@link FSATraversal} and matching results.
*/
@Test
public void testMatch() throws IOException {
final FSA5 fsa = FSA.read(this.getClass().getResourceAsStream("abc.fsa"));
final FSATraversal traversalHelper = new FSATraversal(fsa);
MatchResult m = traversalHelper.match("ax".getBytes());
assertEquals(NO_MATCH, m.kind);
assertEquals(1, m.index);
assertEquals(new HashSet<String>(Arrays.asList("ba", "c")),
suffixes(fsa, m.node));
assertEquals(EXACT_MATCH,
traversalHelper.match("aba".getBytes()).kind);
m = traversalHelper.match("abalonger".getBytes());
assertEquals(AUTOMATON_HAS_PREFIX, m.kind);
assertEquals("longer", "abalonger".substring(m.index));
m = traversalHelper.match("ab".getBytes());
assertEquals(SEQUENCE_IS_A_PREFIX, m.kind);
assertEquals(new HashSet<String>(Arrays.asList("a")),
suffixes(fsa, m.node));
}
/**
* Return all sequences reachable from a given node, as strings.
*/
private HashSet<String> suffixes(FSA fsa, int node) {
HashSet<String> result = new HashSet<String>();
for (ByteBuffer bb : fsa.getSequences(node))
{
try {
result.add(new String(bb.array(), bb.position(), bb.remaining(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
return result;
}
}
| [
"dawid.weiss@carrot-search.com"
] | dawid.weiss@carrot-search.com |
3256b8ba941197ab341ab4216013fd0eb683c093 | b19bdf2395d36f6737914b7c819eeabaabf8925f | /src/main/java/com/netease/server/example/factory/DaoFactory.java | bd912af766a0ff54a135018bff35305a05149ab1 | [] | no_license | yingyuk/ife | df1e2434ffe3ea916dd7c4e149284beca227411b | 4cf1366c054da031cfa6fcc4251ac50159edb97b | refs/heads/master | 2021-01-10T01:05:47.409656 | 2016-04-06T13:55:00 | 2016-04-06T13:55:00 | 53,725,855 | 0 | 1 | null | 2016-03-27T13:34:53 | 2016-03-12T10:27:33 | HTML | UTF-8 | Java | false | false | 319 | java | package com.netease.server.example.factory;
import com.netease.server.example.dao.UserDao;
import com.netease.server.example.dao.impl.UserDaoImpl;
/**
*
*
*/
public class DaoFactory {
private static UserDao userDao = new UserDaoImpl();
public static UserDao getUserDao() {
return userDao;
}
}
| [
"wuyingyucn@gmail.com"
] | wuyingyucn@gmail.com |
3bf4e0f4cb6880c5d0f5f688d5d5d6ee86076fee | f4baf5f5f511fe785a46ab210cf98b5afff906e2 | /WebService-REST-JSON-Jersey-JBOSS7/src/java/com/owl/webservicemain/ApplicationConfig.java | dcd4e44161057cb554cc67f66b962c5a6ab53b56 | [] | no_license | MaiconMessias/Project-JSF-PrimeFaces-with-WebService | c97bcba170157949d3656ad9294cc1c4d875eeed | e7c1ed0dbc2c18f13a257c631e19fa1ad6aad954 | refs/heads/master | 2021-07-08T21:29:04.450534 | 2017-10-09T00:50:47 | 2017-10-09T00:50:47 | 106,221,008 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,403 | 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.owl.webservicemain;
import java.util.Set;
import javax.ws.rs.core.Application;
/**
*
* @author Maicon Messias
*/
@javax.ws.rs.ApplicationPath("webresources")
public class ApplicationConfig extends Application {
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> resources = new java.util.HashSet<Class<?>>();
// following code can be used to customize Jersey 1.x JSON provider:
try {
Class jacksonProvider = Class.forName("org.codehaus.jackson.jaxrs.JacksonJsonProvider");
resources.add(jacksonProvider);
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
addRestResourceClasses(resources);
return resources;
}
/**
* Do not modify addRestResourceClasses() method.
* It is automatically populated with
* all resources defined in the project.
* If required, comment out calling this method in getClasses().
*/
private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(com.owl.webservicemain.WebservicemainResource.class);
}
}
| [
"maiconmessi10@gmail.com"
] | maiconmessi10@gmail.com |
86dd29d3e10d82ee9ac7fd455a3bf4a05717af45 | ef124da2e3afade7ac229d11e50e1a0b695a926a | /src/java/Servlet/LogoutServlet.java | eb8c912d248f8dbbc47e1e03d9bbc7503d8ba5e4 | [] | no_license | reihan703/LaundryWeb | d8dc62c62ae0fe91d19ec5da99cc92f48ce49fa3 | c85de7a08a7642ff221e93d174c52919bc819bf3 | refs/heads/master | 2023-09-02T09:48:09.721061 | 2021-11-13T03:13:32 | 2021-11-13T03:13:32 | 427,556,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,030 | 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 Servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
*
* @author USER
*/
public class LogoutServlet extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
HttpSession session = request.getSession();
session.invalidate();
response.sendRedirect("LoginPageServlet");
// RequestDispatcher dispatch = request.getRequestDispatcher("/HomePage.jsp");
// dispatch.forward(request, response);
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
HttpSession session = request.getSession();
session.invalidate();
//response.sendRedirect("HomePageServlet");
RequestDispatcher dispatch = request.getRequestDispatcher("/ContactUsPage.jsp");
dispatch.forward(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"reihanyasfinu@gmail.com"
] | reihanyasfinu@gmail.com |
c2be05f34743a0351550b0ce57d3bf060ae4736b | 24fea9c984c904af4ba9af82bf5f2fea7727782a | /src/main/java/org/softbasic/reptile/core/JsoupBase.java | 1d643996cf8ed9f08026a81c87cf5c286a97a544 | [] | no_license | softbasic/softbasic-reptile-core | afad6a27feea8929d935d133837a1e354d11a7f7 | 7d9a0b392296651dcf241814446862f7d427d9e3 | refs/heads/master | 2023-05-27T23:55:28.385201 | 2021-06-11T03:20:42 | 2021-06-11T03:20:42 | 375,891,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,565 | java | package org.softbasic.reptile.core;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.util.Map;
/**
* Created by LCR on 2018/11/12.
*/
public class JsoupBase {
private final static int TIMEOUT = 60000;//毫秒
/*** POST请求,HTML
* @param url 请求地址
* @param data 请求参数
* @return JsoupInfo
*/
public static JsoupInfo post(String url, Map<String, String> data) {
JsoupInfo jsoupInfo = new JsoupInfo();
try {
Document doc = Jsoup
.connect(url)
.ignoreContentType(true)
.data(data)
.timeout(TIMEOUT)
.post();
jsoupInfo.setIsSuccess(true);
jsoupInfo.setDocument(doc);
} catch (Exception e) {
jsoupInfo.setIsSuccess(false);
jsoupInfo.setErrorInfo(e.getMessage());
e.printStackTrace();
}
return jsoupInfo;
}
/*** GET请求,HTML
* @param url 请求地址
* @param data 请求参数
* @return JsoupInfo
*/
public static JsoupInfo get(String url, Map<String, String> data) {
JsoupInfo jsoupInfo = new JsoupInfo();
try {
Document doc = Jsoup
.connect(url)
.ignoreContentType(true)
.data(data)
.timeout(TIMEOUT)
.get();
jsoupInfo.setIsSuccess(true);
jsoupInfo.setDocument(doc);
} catch (Exception e) {
jsoupInfo.setIsSuccess(false);
jsoupInfo.setErrorInfo(e.getMessage());
e.printStackTrace();
}
return jsoupInfo;
}
/*** POST请求,JSON
* @param url 请求地址
* @param data 请求参数
* @return JsoupInfo
*/
public static JsoupInfo ajaxPost(String url, String data) {
JsoupInfo jsoupInfo = new JsoupInfo();
try {
Document doc = Jsoup.connect(url)
.requestBody(data)
.ignoreContentType(true)
.header("Content-Type", "application/json")
.timeout(TIMEOUT)
.post();
jsoupInfo.setIsSuccess(true);
jsoupInfo.setDocument(doc);
} catch (Exception e) {
jsoupInfo.setIsSuccess(false);
jsoupInfo.setErrorInfo(e.getMessage());
e.printStackTrace();
}
return jsoupInfo;
}
/*** GET请求,JSON
* @param url 请求地址
* @param data 请求参数
* @return JsoupInfo
*/
public static JsoupInfo ajaxGet(String url, String data) {
JsoupInfo jsoupInfo = new JsoupInfo();
try {
Document doc = Jsoup.connect(url)
.requestBody(data)
.header("Content-Type", "application/json")
.timeout(TIMEOUT)
.get();
jsoupInfo.setIsSuccess(true);
jsoupInfo.setDocument(doc);
} catch (Exception e) {
jsoupInfo.setIsSuccess(false);
jsoupInfo.setErrorInfo(e.getMessage());
e.printStackTrace();
}
return jsoupInfo;
}
/*** POST请求,HTML
* @param url 请求地址
* @param data 请求参数
* @param headers headers参数
* @param cookies cookies参数
* @return JsoupInfo
*/
public static JsoupInfo post(String url, Map<String, String> data, Map<String, String> headers, Map<String, String> cookies) {
JsoupInfo jsoupInfo = new JsoupInfo();
try {
Document doc = Jsoup
.connect(url)
.ignoreContentType(true)
.data(data)
.headers(headers)
.cookies(cookies)
.timeout(TIMEOUT)
.post();
jsoupInfo.setIsSuccess(true);
jsoupInfo.setDocument(doc);
} catch (Exception e) {
jsoupInfo.setIsSuccess(false);
jsoupInfo.setErrorInfo(e.getMessage());
e.printStackTrace();
}
return jsoupInfo;
}
/*** GET请求,HTML
* @param url 请求地址
* @param data 请求参数
* @param headers headers参数
* @param cookies cookies参数
* @return JsoupInfo
*/
public static JsoupInfo get(String url, Map<String, String> data, Map<String, String> headers, Map<String, String> cookies) {
JsoupInfo jsoupInfo = new JsoupInfo();
try {
Document doc = Jsoup
.connect(url)
.ignoreContentType(true)
.data(data)
.headers(headers)
.cookies(cookies)
.timeout(TIMEOUT)
.get();
jsoupInfo.setIsSuccess(true);
jsoupInfo.setDocument(doc);
} catch (Exception e) {
jsoupInfo.setIsSuccess(false);
jsoupInfo.setErrorInfo(e.getMessage());
e.printStackTrace();
}
return jsoupInfo;
}
/*** POST请求,JSON
* @param url 请求地址
* @param data 请求参数
* @param headers headers参数
* @param cookies cookies参数
* @return JsoupInfo
*/
public static JsoupInfo ajaxPost(String url, String data, Map<String, String> headers, Map<String, String> cookies) {
JsoupInfo jsoupInfo = new JsoupInfo();
try {
Document doc = Jsoup.connect(url)
.requestBody(data)
.header("Content-Type", "application/json")
.headers(headers)
.cookies(cookies)
.timeout(TIMEOUT)
.post();
jsoupInfo.setIsSuccess(true);
jsoupInfo.setDocument(doc);
} catch (Exception e) {
jsoupInfo.setIsSuccess(false);
jsoupInfo.setErrorInfo(e.getMessage());
e.printStackTrace();
}
return jsoupInfo;
}
/***GET请求, JSON
* @param url 请求地址
* @param data 请求参数
* @param headers headers参数
* @param cookies cookies参数
* @return JsoupInfo
*/
public static JsoupInfo ajaxGet(String url, String data, Map<String, String> headers, Map<String, String> cookies) {
JsoupInfo jsoupInfo = new JsoupInfo();
try {
Document doc = Jsoup.connect(url)
.requestBody(data)
.header("Content-Type", "application/json")
.headers(headers)
.cookies(cookies)
.timeout(TIMEOUT)
.get();
jsoupInfo.setIsSuccess(true);
jsoupInfo.setDocument(doc);
} catch (Exception e) {
jsoupInfo.setIsSuccess(false);
jsoupInfo.setErrorInfo(e.getMessage());
e.printStackTrace();
}
return jsoupInfo;
}
/**
* Response对象返回值
* @param url
* @param data
* @return
* @throws Exception
*/
public static Connection.Response execute(String url, Map<String, String> data) throws Exception {
try {
return Jsoup.connect(url).ignoreContentType(true).data(data).timeout(TIMEOUT).method(Connection.Method.POST).execute();
} catch (Exception e) {
throw e;
}
}
}
| [
"lcr_rcl@163.com"
] | lcr_rcl@163.com |
b698cd9543cef1e7ac12a2e12aa38fdef681de71 | a9de22590675be8ee38163127a2c24a20c248a0b | /src/com/iremote/infraredcode/tv/codequery/Minded.java | 319dd798e4b43c09cdbe87664de5e918fc841d72 | [] | no_license | jessicaallen777/iremote2 | 0943622300286f8d16e9bb4dca349613ffc23bb1 | b27aa81785fc8bf5467a1ffcacd49a04e41f6966 | refs/heads/master | 2023-03-16T03:20:00.746888 | 2019-12-12T04:02:30 | 2019-12-12T04:02:30 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,864 | java | package com.iremote.infraredcode.tv.codequery;
import com.iremote.infraredcode.tv.codequery.CodeQueryBase;
public class Minded extends CodeQueryBase {
@Override
public String getProductor() {
return "Minded";
}
@Override
public String[] getQueryCodeLiberay() {
return querycode;
}
private static String[] querycode = new String[]
{
//电视 豁达(Minded) 1
"00a052003480cf80d33a313a303a313b303b303b303b303a313b313a303b80983a80973a80983c80973a80973a80973a80973a80973a80973a80963a80973b2f3a89e280d680d33b303a2f3a313a303a303a303b2f3a313a303a313b80983a80973a80963a80973a80973a809800",
//电视 豁达(Minded) 2
"00a052003480cb80d33a2f3a313a303a2f3a303a313b303b2f3a313c303a80973a80973b80983b80983a80973a80973b80983a80983a80973a80983b80973a2f3b89e280d680d23a303a303a303a303a303a303a2f3a313b2f3a313a80983a80963a80973a80973a80973a809700",
//电视 豁达(Minded) 3
"00a051003480ce80d23b303a80973a80973a2f3a80983c303b303b80973a2f3a80973a2f3a313b80973a303b303a80973a303a80983b80973b303b80973a303a80963a80973b882580d680d23a303a80973b80983a313b80983a303a303a80973a313a80983a313b313a80973a00",
//电视 豁达(Minded) 4
"00a052003480ca80d23b80973a303a303a80973b313b80983a303b303a303a2f3b303a80973b303b80983a80983a303a80973a303a80983b80973a80973a80973b80973a303b882580d680d23b80973b313b303b80973a2f3b80973b313a303a2f3a303a303a80973b303a809700",
//电视 豁达(Minded) 5
"00e04b003382138102261d271d271d271d271e261d271d271d278101261d265a275b275b261d261e261e281d288607821a8101261d271d271d271e261e261d271d271d278101261e265a265a275b281d261d261e281d280000000000000000000000000000000000000000000000",
//电视 豁达(Minded) 6
"00e049003481128114281e2820281e281e281f281f291f2863291e291e291e291f291e2820281e286428632865281f291f2863281e291e291e281f291e28652864281f296429632964288b4181208114296329000000000000000000000000000000000000000000000000000000",
//电视 豁达(Minded) 7
"00e0430034106b186b166b162d172c172c166a162c176b166b162c176b172d172c162c172c17868a166a176b176c182c172c162c166c182c176a166a172c176b172b162c172c172c1600000000000000000000000000000000000000000000000000000000000000000000000000",
//电视 豁达(Minded) 8
"00e04700338234811028202820282028202865281f286628202866286528662965291f2965281f286529662866286528202865292028202820281f2820282028662820286528662865298995823c8086280000000000000000000000000000000000000000000000000000000000",
//电视 豁达(Minded) 9
"00a052003780d280ca3a2f3a2f3b303a2f3a2f392e3a2f3a2e3a303a2f3a80963980963a80963b80963a80963a80973b80963a80963b80953a80963a80963b2f3b8bf580d980ca3a2f3a2e3a303a2f3a2f3b2f3a2f3a2f3a2e3a2f3980963a80973a80963980963a80963a809600",
//电视 豁达(Minded) 10
"00a052003480c980d23b313a80973b303b80973a303a303a303a80973b303a80973a303b303b80973a303a80973b303a80973a80983a80963a303b80973a313b80983a80973a882580d780d23a303b80973a2f3b80973a2f3a303b2f3a80983c303a80973b303a303a80973b2f00",
//电视 豁达(Minded) 11
"00a052003480cf80d23b2f3a313b2f3a313b313a303b303b303a313c303a80973a80973a80983a80983c80973a80973a80973b80973a80983a80973a80963a313a89e180d680d23a2f3a303a303a2f3a303a2f3a303b2f3a313a303a80973a80983a80973a80973b80973b809700",
//电视 豁达(Minded) 12
"00a051003380cf80d23a313b80973a80973a303a80973b313b303a80983a303b80973a2f3a303a80963a313b2f3a80983b313a80973a80973a303a80973b303b80973a80983a882480d780d23b303a80973a80973a303980973b303a313b80973b303b80963a303a303a80973b00",
//电视 豁达(Minded) 13
"00a051003480cf80d33b2f3a80983a80983a303a80963a303a2f3a80973b2f3a80983b313a303b80973a303a2f3a80973a303a80983b80973a303b80973a303a80963a80973a882580d680d33b2f3a80983b80983a303b80963a3039303a80973a2f3a80983b303a313b80973a00",
//电视 豁达(Minded) 14
"00a052003480cf80d23a80973a303a2f3a80973a2f3a80983b303b2f3b303a303b313a80973a303a80983a80983a303a80973a303a80963a80973b80973a80973a80973b313b882680d680d23b80973a303a313a80973b303b80983a303a303a303a2f3a303a80973a303b809700",
};
} | [
"stevenbluesky@163.com"
] | stevenbluesky@163.com |
0343951f1cc31cf57e86850f40e98c7da65c4183 | 696ce7d6d916dd36912d5660e4921af7d793d80c | /Succorfish/Installer/app/src/main/java/com/succorfish/installer/Vo/VoLastInstallation.java | ff35809653bd08d27cf2c89b5a44683a72f177c1 | [] | no_license | VinayTShetty/GeoFence_Project_End | c669ff89cc355e1772353317c8d6e7bac9ac3361 | 7e178f207c9183bcd42ec24e339bf414a6df9e71 | refs/heads/main | 2023-06-04T13:54:32.836943 | 2021-06-26T02:27:59 | 2021-06-26T02:27:59 | 380,394,802 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,701 | java | package com.succorfish.installer.Vo;
import java.io.Serializable;
public class VoLastInstallation implements Serializable {
String deviceId = "";
String filtered = "";
String generated = "";
String received = "";
String source = "";
String provider = "";
String lng = "";
String lat = "";
String altitude = "";
String speed = "";
String course = "";
String hdop = "";
String vdop = "";
String pdop = "";
String lowPowerFlag = "";
String notDuplicated = "";
String satelliteFlag = "";
String correlationId = "";
String gpsSatNo = "";
String generatedDate = "";
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getFiltered() {
return filtered;
}
public void setFiltered(String filtered) {
this.filtered = filtered;
}
public String getGenerated() {
return generated;
}
public void setGenerated(String generated) {
this.generated = generated;
}
public String getReceived() {
return received;
}
public void setReceived(String received) {
this.received = received;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getProvider() {
return provider;
}
public void setProvider(String provider) {
this.provider = provider;
}
public String getLng() {
return lng;
}
public void setLng(String lng) {
this.lng = lng;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getAltitude() {
return altitude;
}
public void setAltitude(String altitude) {
this.altitude = altitude;
}
public String getSpeed() {
return speed;
}
public void setSpeed(String speed) {
this.speed = speed;
}
public String getCourse() {
return course;
}
public void setCourse(String course) {
this.course = course;
}
public String getHdop() {
return hdop;
}
public void setHdop(String hdop) {
this.hdop = hdop;
}
public String getVdop() {
return vdop;
}
public void setVdop(String vdop) {
this.vdop = vdop;
}
public String getPdop() {
return pdop;
}
public void setPdop(String pdop) {
this.pdop = pdop;
}
public String getLowPowerFlag() {
return lowPowerFlag;
}
public void setLowPowerFlag(String lowPowerFlag) {
this.lowPowerFlag = lowPowerFlag;
}
public String getNotDuplicated() {
return notDuplicated;
}
public void setNotDuplicated(String notDuplicated) {
this.notDuplicated = notDuplicated;
}
public String getSatelliteFlag() {
return satelliteFlag;
}
public void setSatelliteFlag(String satelliteFlag) {
this.satelliteFlag = satelliteFlag;
}
public String getCorrelationId() {
return correlationId;
}
public void setCorrelationId(String correlationId) {
this.correlationId = correlationId;
}
public String getGpsSatNo() {
return gpsSatNo;
}
public void setGpsSatNo(String gpsSatNo) {
this.gpsSatNo = gpsSatNo;
}
public String getGeneratedDate() {
return generatedDate;
}
public void setGeneratedDate(String generatedDate) {
this.generatedDate = generatedDate;
}
}
| [
"vinay@succorfish.com"
] | vinay@succorfish.com |
83283acff555111efe6443f2c750095030514736 | 4864985c59c97c9950386be0f29e11543a64a800 | /src/HelloWorld.java | 9c7f91b9125263d2ac27c4b34a2fb7b6a589de26 | [] | no_license | nicolerenene/hello-world | e5631b6967574ef676afcdf3e33b74a4b5e7ba0e | 1382cd09e71ddfcf1bf700c3e1670111192b9367 | refs/heads/master | 2023-01-20T12:06:17.273224 | 2020-11-11T21:44:14 | 2020-11-11T21:44:14 | 312,096,947 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 128 | java | public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
| [
"64162382+nicolerenene@users.noreply.github.com"
] | 64162382+nicolerenene@users.noreply.github.com |
44654ed273fda33bf911527c6117bc2dac77ad07 | 56456387c8a2ff1062f34780b471712cc2a49b71 | /org/apache/http/conn/params/ConnPerRouteBean.java | 62896256e23970b8768d79c85e34a9a54cd931a8 | [] | no_license | nendraharyo/presensimahasiswa-sourcecode | 55d4b8e9f6968eaf71a2ea002e0e7f08d16c5a50 | 890fc86782e9b2b4748bdb9f3db946bfb830b252 | refs/heads/master | 2020-05-21T11:21:55.143420 | 2019-05-10T19:03:56 | 2019-05-10T19:03:56 | 186,022,425 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,243 | java | package org.apache.http.conn.params;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.util.Args;
public final class ConnPerRouteBean
implements ConnPerRoute
{
public static final int DEFAULT_MAX_CONNECTIONS_PER_ROUTE = 2;
private volatile int defaultMax;
private final ConcurrentHashMap maxPerHostMap;
public ConnPerRouteBean()
{
this(2);
}
public ConnPerRouteBean(int paramInt)
{
ConcurrentHashMap localConcurrentHashMap = new java/util/concurrent/ConcurrentHashMap;
localConcurrentHashMap.<init>();
this.maxPerHostMap = localConcurrentHashMap;
setDefaultMaxPerRoute(paramInt);
}
public int getDefaultMax()
{
return this.defaultMax;
}
public int getDefaultMaxPerRoute()
{
return this.defaultMax;
}
public int getMaxForRoute(HttpRoute paramHttpRoute)
{
Args.notNull(paramHttpRoute, "HTTP route");
Integer localInteger = (Integer)this.maxPerHostMap.get(paramHttpRoute);
if (localInteger != null) {}
for (int i = localInteger.intValue();; i = this.defaultMax) {
return i;
}
}
public void setDefaultMaxPerRoute(int paramInt)
{
Args.positive(paramInt, "Defautl max per route");
this.defaultMax = paramInt;
}
public void setMaxForRoute(HttpRoute paramHttpRoute, int paramInt)
{
Args.notNull(paramHttpRoute, "HTTP route");
Args.positive(paramInt, "Max per route");
ConcurrentHashMap localConcurrentHashMap = this.maxPerHostMap;
Integer localInteger = Integer.valueOf(paramInt);
localConcurrentHashMap.put(paramHttpRoute, localInteger);
}
public void setMaxForRoutes(Map paramMap)
{
if (paramMap == null) {}
for (;;)
{
return;
this.maxPerHostMap.clear();
ConcurrentHashMap localConcurrentHashMap = this.maxPerHostMap;
localConcurrentHashMap.putAll(paramMap);
}
}
public String toString()
{
return this.maxPerHostMap.toString();
}
}
/* Location: C:\Users\haryo\Desktop\enjarify-master\presensi-enjarify.jar!\org\apache\http\conn\params\ConnPerRouteBean.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 0.7.1
*/ | [
"haryo.nendra@gmail.com"
] | haryo.nendra@gmail.com |
c85f104ed0696799b1af450fa4e8e925358e0e42 | 898432ba83e6569ea1cb020dd669873d2049c37a | /src/main/java/com/bi/exchange/dao/IUserMoneyDao.java | 8dde8dd396911e2d79c24f1943bd64cce1518eb8 | [] | no_license | buexchange/buex | 0d8a12ffc0f13b472bf52519eb54f59766f97254 | c2c7176ac85376c644c7481f4a8e557de8a506ff | refs/heads/master | 2020-03-19T13:30:19.816103 | 2018-06-08T07:37:47 | 2018-06-08T07:37:47 | 136,575,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 504 | java | package com.bi.exchange.dao;
import com.bi.exchange.framework.dao.BaseDao;
import com.bi.exchange.model.BitUserMoney;
import java.math.BigDecimal;
import java.sql.Connection;
/**
* 场外交易用户资产
*/
public interface IUserMoneyDao extends BaseDao<BitUserMoney> {
Connection getConnection() throws Exception;
BitUserMoney getAssetByAssetCode(Long userid, String assetCode);
int updateAsset(Long id, BigDecimal amount, String flag, Connection connection) throws Exception;
}
| [
"bitpoolex@gmail.com"
] | bitpoolex@gmail.com |
3ce36b5888127c69a2fd2e92c84f34d22ed02bb1 | 4cd7523bc164f64c51af9e7d384a8a70c6806f9e | /src/com/jucaipen/service/NewServer.java | 1e9add454751575372540c618ea80fc0ff03a6ec | [] | no_license | loveq2016/jcp_server2017 | 5de95a71afc80edeb7380d5bb725be5a4f6e87b6 | a180bf634a63bc84eb356a57364c08e2ba9d72ac | refs/heads/master | 2021-01-25T09:33:04.404479 | 2017-06-09T09:11:22 | 2017-06-09T09:11:22 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,929 | java | package com.jucaipen.service;
import java.util.List;
import com.jucaipen.dao.NewsDao;
import com.jucaipen.daoimp.NewsImp;
import com.jucaipen.model.News;
/**
* @author ylf
*
* 新闻服务类
*
*/
public class NewServer {
private static List<News> news;
/**
* @param pager
* @return 根据页数查询指定页的新闻信息
*/
public static List<News> queryNews(int pager) {
NewsDao dao = new NewsImp();
news = dao.findAll(pager);
return news;
}
/**
* @param bigId
* @param pager
* @return 根据一级分类查询新闻信息
*/
public static List<News> queryNewsByBigId(int bigId, int pager) {
NewsDao dao = new NewsImp();
return dao.findNewsBybigId(bigId, pager);
}
/**
* @param id
* @return 根据id 查询新闻详细内容
*/
public static News findNewsById(int id) {
NewsDao dao = new NewsImp();
return dao.findNews(id);
}
/**
* @param id
* @return 获取相关新闻
*/
public static List<News> findRelatedNewsById(int id) {
NewsDao dao = new NewsImp();
return dao.findRelatedNewsById(id);
}
/**
* @param count
* @return 获取最近的count条新闻
*/
public static List<News> findLastNews(int count) {
NewsDao dao = new NewsImp();
return dao.findLastNewsByNewsNum(count);
}
/**
* @param hits
* @param id
* @return 修改点击数
*/
public static int upDateHits(int xnHits,int hits,int id){
NewsDao dao=new NewsImp();
return dao.upDateHits(xnHits,hits, id);
}
/**
* @param comments
* @param id
* @return 修改评论数
*/
public static int upDateComments(int comments,int id){
NewsDao dao=new NewsImp();
return dao.upDateComments(comments, id);
}
/**
* @param classId
* @param page
* @return 根据分类查询新闻
*/
public static List<News> findNewsByClassId(int classId,int page){
NewsDao dao=new NewsImp();
return dao.findNewsBybigId(classId, page);
}
}
| [
"185601452@qq.com"
] | 185601452@qq.com |
9f70b0b91f3681432d992d802dc27b97ef22295f | 713a244198357b4cf8953c98ae395ddb40b3e75f | /src/com/list/RemoveLinkedListElement.java | 1e77ecbc50e843528ac2bd83665f3d984e23b271 | [] | no_license | lyf10009/LeetCode | a4b02b0b4e3103f2f4b753859dea439af34fada1 | a1ebf52f0f6a82a90ed725365feba33f0382fc40 | refs/heads/master | 2021-01-10T19:04:33.986100 | 2015-05-22T08:17:31 | 2015-05-22T08:17:31 | 18,203,835 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 800 | java | package com.list;
import com.bean.ListNode;
public class RemoveLinkedListElement {
public static void main(String[] args) {
ListNode list = ListNode.generateList(5);
ListNode node = new ListNode(3);
node.next=list;
ListNode.printListNode(node);
System.out.println("-------------");
node=removeElements(node,3);
ListNode.printListNode(node);
System.out.println("-------------");
}
public static ListNode removeElements(ListNode head, int val) {
ListNode cur = head;
ListNode pre=null;
while(cur!=null){
if(cur.val == val){
if(pre == null){
head = head.next;
cur = head;
continue;
}else{
pre.next=cur.next;
}
}else{
pre = cur;
}
cur = cur.next;
}
return head;
}
}
| [
"lf19891009@163.com"
] | lf19891009@163.com |
85762495aedd869762a5dcb81d235f0a37ae5e42 | 416a6ffec20d6ef81096aee4f2b36470288c7ba0 | /src/Add_Test.java | 6698deff0f6c6e14a5a56e375f2e0209698ca286 | [] | no_license | Liuchiyi/JIANZHIoffer | 90940553a961f1fda5590d09081564c889313684 | 0ac71795c5deceee967c63140e7ece7f1c307ff9 | refs/heads/master | 2020-03-22T05:19:17.560831 | 2018-07-03T09:14:26 | 2018-07-03T09:14:26 | 139,557,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java |
/**
* 写一个函数,求两个整数之和,要求在函数体内不得使用+、-、*、/四则运算符号。
*/
public class Add_Test {
public int Add(int num1,int num2) {
while((num1 & num2) != 0){
int n1 = num1 & num2;
int n2 = num1 ^ num2;
num1 = n1<<1;
num2 = n2;
}
return num1 ^ num2;
}
public static void main(String[] args) {
Add_Test test = new Add_Test();
System.out.println(test.Add(322,657));
}
}
| [
"429531435@qq.com"
] | 429531435@qq.com |
3013ab44e1c0c8930c546a6ddc77267e695366ad | 03c1c090a684ff21f3fb00932eca44756485c4cb | /redakcja/redakcja-ejb/src/java/klient/bean/numerFacade.java | 1b38bdb5e3f88306dd4c5b333082c48eea1ad45f | [] | no_license | arekp/redakcja | 6d35314b7986dba6b8fbca7e4491af21810f9f83 | 33767eb2aa87b025aacd68b7c8788164cf9dc819 | refs/heads/master | 2016-09-05T20:32:15.162032 | 2010-02-10T08:34:44 | 2010-02-10T08:34:44 | 32,316,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,564 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package klient.bean;
import bean.spisTresci;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.EntityResult;
import javax.persistence.FieldResult;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.persistence.SqlResultSetMapping;
import klient.encje.dokument;
import klient.encje.numer;
/**
*
* @author arekp
*/
@Stateless
public class numerFacade implements numerFacadeLocal {
@PersistenceContext
private EntityManager em;
public void create(numer numer) {
em.persist(numer);
}
public void edit(numer numer) {
em.merge(numer);
}
public void remove(numer numer) {
em.remove(em.merge(numer));
}
public numer find(Object id) {
return em.find(numer.class, id);
}
public List<numer> findAll() {
return em.createQuery("select object(o) from numer as o order by o.data desc").getResultList();
}
public List<dokument> ListaSpisTresci(Long idnumer) {
// lista dokumentow danego kontrahenta
Query q = em.createNativeQuery("select * from dokument k where idnumer = :idnumer and idRodzica is null and typ like 'Art%' order by idgrupy,nrstrony desc",dokument.class);
q.setParameter("idnumer", idnumer);
List <dokument> dokument1 = q.getResultList();
System.out.print(dokument1.size());
return dokument1;
}
}
| [
"arek.ptak@6ab437ba-1ea0-11de-b650-e715bd6d7cf1"
] | arek.ptak@6ab437ba-1ea0-11de-b650-e715bd6d7cf1 |
db5286081f067f01ad81b607da43179588f77b1e | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_1/src/b/b/a/i/Calc_1_1_11082.java | 5831159d61c9dcea9fbf523ea8d22cb4d2b6b906 | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package b.b.a.i;
public class Calc_1_1_11082 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
e55f3d5f6092dac3212275d60ec37847b7a176fa | 4c417f9cee8ab37980a9c2b1def3650ab3933b50 | /jiajiale-web/src/main/java/com/vip/web/controller/spring/StringTrimConverter.java | 72b2a3a8688458b327a1cf6267cdd5a82455353a | [
"Apache-2.0"
] | permissive | yizhuoyan/javaweb-jiajiale | 495c2f48f41665c329924b4da37aff3d48ecb248 | 1ea47e273a243e6e1c8bfdd86b377bb267989ed6 | refs/heads/master | 2020-05-30T20:41:29.914478 | 2020-03-20T11:19:35 | 2020-03-20T11:19:35 | 189,954,331 | 16 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package com.vip.web.controller.spring;
import org.springframework.core.convert.converter.Converter;
/**
* Created by Administrator on 5/15.
*/
public class StringTrimConverter implements Converter<String,String> {
@Override
public String convert(String source) {
if(source==null){
return null;
}
source=source.trim();
if(source.length()==0){
return null;
}
return source;
}
}
| [
"yizhuoyan@hotmail.com"
] | yizhuoyan@hotmail.com |
3ab83ed0f87858255d662ee1c56ba86b96d25445 | 76707a749c77d687d347207d4e5bd1f00f298e5a | /acme-api-greeting/src/main/java/com/acme/greeting/api/dummy/DummyGreeting.java | f895662f4e376595a63969306f77513a72887863 | [
"MIT"
] | permissive | vjmadrid/enmilocalfunciona-archunit | 6d77374fb03141e7188d3f1f11c5e114ded9577e | ad39e405db71c27e52c788c2756cbab13c91a6e3 | refs/heads/master | 2023-03-02T02:29:40.837842 | 2021-02-11T18:46:40 | 2021-02-11T18:46:40 | 319,269,273 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,183 | java | package com.acme.greeting.api.dummy;
import java.util.ArrayList;
import java.util.List;
import com.acme.greeting.api.dummy.constant.GreetingDummyConstant;
import com.acme.greeting.api.entity.Greeting;
import com.acme.greeting.api.factory.GreetingDataFactory;
public class DummyGreeting {
private DummyGreeting() {
throw new IllegalStateException("DummyGreeting");
}
public static Greeting createDefault() {
return GreetingDataFactory.create(GreetingDummyConstant.TEST_GREETING_1_ID,GreetingDummyConstant.TEST_GREETING_1_CONTENT);
}
public static List<Greeting> createDefaultList() {
final List<Greeting> list = new ArrayList<>();
list.add(GreetingDataFactory.create(GreetingDummyConstant.TEST_GREETING_1_ID,GreetingDummyConstant.TEST_GREETING_1_CONTENT));
return list;
}
public static List<Greeting> createList() {
final List<Greeting> list = createDefaultList();
list.add(GreetingDataFactory.create(GreetingDummyConstant.TEST_GREETING_2_ID,GreetingDummyConstant.TEST_GREETING_2_CONTENT));
list.add(GreetingDataFactory.create(GreetingDummyConstant.TEST_GREETING_3_ID,GreetingDummyConstant.TEST_GREETING_3_CONTENT));
return list;
}
}
| [
"vjmadrid@atsistemas.com"
] | vjmadrid@atsistemas.com |
9520fb62b46b03c5c202600ffdb18ccdaa9a8fea | 9767959e8f110c9fe120fb1650449d80bd97ce3a | /src/uo/ri/amp/model/types/AsistenciaStatus.java | d5b33bd9bd80035535a3885c5b372cbd3e9bafa0 | [] | no_license | robertofd1995/RI_JPA | 9bd0cca555ab044ae6fe26598cb0d24be9420c64 | 22d9b11ed1e8d1f6bda2e270f23f721d14997ead | refs/heads/master | 2021-01-18T22:56:24.367024 | 2016-06-27T03:20:39 | 2016-06-27T03:20:39 | 61,997,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 84 | java | package uo.ri.amp.model.types;
public enum AsistenciaStatus {
APTO,
NO_APTO
}
| [
"robertofd1995@gmail.com"
] | robertofd1995@gmail.com |
5766704d8bc7ad701433e0186378e1f1bb89b57f | 347512b67db75a4b309a299a8baeac316650aa6a | /AccPoint/src/it/portaleSTI/DTO/DocumTLDocumentoDTO.java | 8f13f31125a1166e8f445a9603ea8fac82363ce5 | [] | no_license | raffan83/AccPoint_Repo | 403638e1c10eedc1c22e1e09dede6b8973031571 | bba4eb551acaf64fb159415bdc1afe6346338084 | refs/heads/master | 2023-08-31T05:04:21.425491 | 2023-08-29T14:29:21 | 2023-08-29T14:29:21 | 83,447,419 | 0 | 0 | null | 2020-04-29T23:47:11 | 2017-02-28T15:19:11 | JavaScript | UTF-8 | Java | false | false | 4,933 | java | package it.portaleSTI.DTO;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
public class DocumTLDocumentoDTO {
private int id;
private String nome_documento;
private int frequenza_rinnovo_mesi;
private String rilasciato;
private Date data_caricamento;
private DocumCommittenteDTO committente;
private DocumFornitoreDTO fornitore;
private Date data_scadenza;
private String nome_file;
private int disabilitato;
private String numero_documento;
private DocumTLStatoDTO stato;
private int obsoleto;
private int email_inviata;
private int documento_sostituito;
private String note_upload;
private String motivo_rifiuto;
private Date data_rilascio;
private DocumTipoDocumentoDTO tipo_documento;
private int aggiornabile_cl;
private String codice;
private String revisione;
private int comunicata_consegna;
private transient Set<DocumDipendenteFornDTO> listaDipendenti= new HashSet<DocumDipendenteFornDTO>(0);
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNome_documento() {
return nome_documento;
}
public void setNome_documento(String nome_documento) {
this.nome_documento = nome_documento;
}
public int getFrequenza_rinnovo_mesi() {
return frequenza_rinnovo_mesi;
}
public void setFrequenza_rinnovo_mesi(int frequenza_rinnovo_mesi) {
this.frequenza_rinnovo_mesi = frequenza_rinnovo_mesi;
}
public String getRilasciato() {
return rilasciato;
}
public void setRilasciato(String rilasciato) {
this.rilasciato = rilasciato;
}
public Date getData_caricamento() {
return data_caricamento;
}
public void setData_caricamento(Date data_caricamento) {
this.data_caricamento = data_caricamento;
}
public Date getData_scadenza() {
return data_scadenza;
}
public void setData_scadenza(Date data_scadenza) {
this.data_scadenza = data_scadenza;
}
public String getNome_file() {
return nome_file;
}
public void setNome_file(String nome_file) {
this.nome_file = nome_file;
}
public int getDisabilitato() {
return disabilitato;
}
public void setDisabilitato(int disabilitato) {
this.disabilitato = disabilitato;
}
public DocumCommittenteDTO getCommittente() {
return committente;
}
public void setCommittente(DocumCommittenteDTO committente) {
this.committente = committente;
}
public DocumFornitoreDTO getFornitore() {
return fornitore;
}
public void setFornitore(DocumFornitoreDTO fornitore) {
this.fornitore = fornitore;
}
public DocumTLStatoDTO getStato() {
return stato;
}
public void setStato(DocumTLStatoDTO stato) {
this.stato = stato;
}
public int getObsoleto() {
return obsoleto;
}
public void setObsoleto(int obsoleto) {
this.obsoleto = obsoleto;
}
public int getEmail_inviata() {
return email_inviata;
}
public void setEmail_inviata(int email_inviata) {
this.email_inviata = email_inviata;
}
public String getNumero_documento() {
return numero_documento;
}
public void setNumero_documento(String numero_documento) {
this.numero_documento = numero_documento;
}
public int getDocumento_sostituito() {
return documento_sostituito;
}
public void setDocumento_sostituito(int documento_sostituito) {
this.documento_sostituito = documento_sostituito;
}
public Set<DocumDipendenteFornDTO> getListaDipendenti() {
return listaDipendenti;
}
public void setListaDipendenti(Set<DocumDipendenteFornDTO> listaDipendenti) {
this.listaDipendenti = listaDipendenti;
}
public String getMotivo_rifiuto() {
return motivo_rifiuto;
}
public void setMotivo_rifiuto(String motivo_rifiuto) {
this.motivo_rifiuto = motivo_rifiuto;
}
public String getNote_upload() {
return note_upload;
}
public void setNote_upload(String note_upload) {
this.note_upload = note_upload;
}
public Date getData_rilascio() {
return data_rilascio;
}
public void setData_rilascio(Date data_rilascio) {
this.data_rilascio = data_rilascio;
}
public DocumTipoDocumentoDTO getTipo_documento() {
return tipo_documento;
}
public void setTipo_documento(DocumTipoDocumentoDTO tipo_documento) {
this.tipo_documento = tipo_documento;
}
public int getAggiornabile_cl() {
return aggiornabile_cl;
}
public void setAggiornabile_cl(int aggiornabile_cl) {
this.aggiornabile_cl = aggiornabile_cl;
}
public String getCodice() {
return codice;
}
public void setCodice(String codice) {
this.codice = codice;
}
public String getRevisione() {
return revisione;
}
public void setRevisione(String revisione) {
this.revisione = revisione;
}
public int getComunicata_consegna() {
return comunicata_consegna;
}
public void setComunicata_consegna(int comunicata_consegna) {
this.comunicata_consegna = comunicata_consegna;
}
}
| [
"antonio.dicivita@ID0090.business.local"
] | antonio.dicivita@ID0090.business.local |
783515ec1ac3609b5c72b31181b057e7ea13c733 | 5c901d064a30f3be4c3a25a29ee293689e024033 | /Java/TP/Workspace/x/x-workspace/jad/src/B/B/C/A.java | df998f56aa1753e3c9c43c10af68e72b6ccc6da8 | [] | no_license | BRICOMATA9/Teaching | 13ea3486dce38d7f547a766f8d99da8123977473 | d2e5ea4ffed566f2d0e68138f45a18289acf0d24 | refs/heads/master | 2022-03-01T01:29:14.844873 | 2019-11-02T11:08:48 | 2019-11-02T11:08:48 | 177,467,808 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 779 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
package B.B.C;
import B.D.D.b;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
public abstract class A extends b
{
public A()
{
}
public String D()
{
return "http://www.yworks.com/xml/graphml";
}
public String C()
{
return "y";
}
String B(Node node, String s)
{
NamedNodeMap namednodemap = node.getAttributes();
if(namednodemap == null)
return null;
Node node1 = namednodemap.getNamedItem(s);
if(node1 == null)
return null;
else
return node1.getNodeValue();
}
}
| [
"githubfortyuds@gmail.com"
] | githubfortyuds@gmail.com |
6fe3f4e9cc1bdc5c2f669d36957c1b9cbd57a616 | 600ad8f229f19ba5e630549d32002d62e1d9eacf | /app/src/main/java/com/example/digikirana/Homepagemodel.java | c1f40483c8bd83ff3cbbd6cd61a8dcc0068e804e | [] | no_license | BURFAL18/DIGI-KIRANA | 978cb475b842343f05cee77d28487de5b9b6dee5 | c34ee8d5c84345e7eb84ff43345060cde0d70d28 | refs/heads/master | 2022-12-11T14:23:55.025307 | 2020-09-16T16:22:14 | 2020-09-16T16:22:14 | 257,702,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,858 | java | package com.example.digikirana;
import java.util.List;
public class Homepagemodel {
public static final int STRIP_AD_BANNER = 0;
public static final int HORIZONTAL_PRODUCT_VIEW = 1;
private int type;
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
///// STRIP LAYOUT//////////
private int resource;
private String backgroundcolor;
//////// HORIZONTAL LAYOUT ///
// private String title;
private List<Horizontalproductmodel> horizontalproductmodelList;
public Homepagemodel(int type, int resource, String backgroundcolor) {
this.type = type;
this.resource = resource;
this.backgroundcolor = backgroundcolor;
}
public Homepagemodel(int type, List<Horizontalproductmodel> horizontalproductmodelList) {
this.type = type;
// this.title = title;
this.horizontalproductmodelList = horizontalproductmodelList;
}
public int getResource() {
return resource;
}
public void setResource(int resource) {
this.resource = resource;
}
///// STRIP LAYOUT//////////
public String getBackgroundcolor() {
return backgroundcolor;
}
public void setBackgroundcolor(String backgroundcolor) {
this.backgroundcolor = backgroundcolor;
}
// public String getTitle() {
// return title;
// }
// public void setTitle(String title) {
// this.title = title;
// }
public List<Horizontalproductmodel> getHorizontalproductmodelList() {
return horizontalproductmodelList;
}
public void setHorizontalproductmodelList(List<Horizontalproductmodel> horizontalproductmodelList) {
this.horizontalproductmodelList = horizontalproductmodelList;
}
//////// HORIZONTAL LAYOUT ///
} | [
"44106351+Brijesh-Burfal@users.noreply.github.com"
] | 44106351+Brijesh-Burfal@users.noreply.github.com |
990addc73840fdda2a3983fb2ce6af5597259fb3 | 122c1e6c3830116e9bdd20bb3b27bc290b347339 | /src/main/java/com/jschuiteboer/graphqltest/author/Author.java | e2d3d776cbe2c5431e21374007aa508c9734d10b | [] | no_license | jschuiteboer/graphql-test-server | 4e0243690637616fce67933257a8aafbc49307c7 | fda5bc6f06ee449d4bd55bd5443feb20a0734d11 | refs/heads/master | 2020-04-04T03:28:47.864859 | 2018-11-15T09:14:10 | 2018-11-15T09:14:10 | 155,714,400 | 0 | 1 | null | 2018-11-15T09:14:11 | 2018-11-01T12:51:32 | Java | UTF-8 | Java | false | false | 485 | java | package com.jschuiteboer.graphqltest.author;
import com.jschuiteboer.graphqltest.book.Book;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Collection;
import java.util.UUID;
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
public class Author {
@Id
@GeneratedValue
private UUID id;
private String name;
@OneToMany(mappedBy="author")
private Collection<Book> books;
}
| [
"jschuiteboer@users.noreply.github.com"
] | jschuiteboer@users.noreply.github.com |
67bdbd7ba9bce10ff57a3c1a2c6d432119cdc80b | d92ba8dd213025608c1e887160fd037d2932aa8c | /src/main/java/com/swisscom/refimpl/util/Resources.java | a085c7f6da374ce6a280426e30ce0eae29fa8de4 | [] | no_license | leantrace/refimpl | c114e40b8d8c06b59e5498c3b41b875496cf67ec | 810bcd4070950ced3e5e96e12632d5abd9839734 | refs/heads/master | 2021-05-28T20:08:39.324400 | 2013-06-21T14:05:40 | 2013-06-21T14:05:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 922 | java | /*
* Copyright 2010-2012 swisscom.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
*
* This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.swisscom.refimpl.util;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author <a href="alexander.schamne@swisscom.com">Alexander Schamne</a>
*
*/
public class Resources {
@Produces
public Logger getLog(InjectionPoint injectionPoint) {
return LoggerFactory.getLogger(injectionPoint.getMember()
.getDeclaringClass());
}
}
| [
"alexander.schamne@swisscom.com"
] | alexander.schamne@swisscom.com |
663ba847c06a36a6a3a96389405e390c8c84f5ed | d97606a7b207fdd6ec4279044e1205b50a6cdf2d | /src/main/java/com/xcgn/marry/business/service/buiness/IncomeRecordService.java | 5db80743165d4ed63eb3997ee20d863d00573fac | [] | no_license | AJAX-UP/marryXcgn | a6b3366b30d277b3c455eec236748d1aff461bf0 | 9ca30a846af797457349e70884258040e19bd71e | refs/heads/master | 2022-06-28T11:17:15.226961 | 2019-11-19T09:54:31 | 2019-11-19T09:54:31 | 222,664,214 | 0 | 0 | null | 2022-06-17T02:41:38 | 2019-11-19T09:58:23 | Java | UTF-8 | Java | false | false | 303 | java | package com.xcgn.marry.business.service.buiness;
import org.springframework.http.ResponseEntity;
/**
* create by ajaxgo on 2019/11/19
**/
public interface IncomeRecordService {
ResponseEntity exchangeCash(Integer userId, Integer cashBean);
ResponseEntity exchangeDetail(Integer userId);
}
| [
"18513348915@163.com"
] | 18513348915@163.com |
64c0b749bc5c20c49569566ff72cac9cbd32350e | d134e83c373b6a249545b6874ae83ab6b4b2f78e | /src/main/java/uniresolver/driver/did/sov/DidSovDriver.java | 034a0e74087e6f91eeb16cba2c5b58269a9ab879 | [
"Apache-2.0"
] | permissive | swcurran/uni-resolver-driver-did-sov | 297286179b736c147bb54194faba1212331ae92d | 7d4b4e67c935364d3f34d5e0b2961cdd3f00f320 | refs/heads/main | 2023-06-03T09:58:14.924542 | 2021-06-21T19:28:41 | 2021-06-21T19:28:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,474 | java | package uniresolver.driver.did.sov;
import java.io.File;
import java.net.URI;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.goterl.lazysodium.LazySodiumJava;
import com.goterl.lazysodium.SodiumJava;
import foundation.identity.did.*;
import foundation.identity.jsonld.JsonLDUtils;
import org.hyperledger.indy.sdk.IndyException;
import org.hyperledger.indy.sdk.LibIndy;
import org.hyperledger.indy.sdk.did.Did;
import org.hyperledger.indy.sdk.did.DidJSONParameters.CreateAndStoreMyDidJSONParameter;
import org.hyperledger.indy.sdk.did.DidResults.CreateAndStoreMyDidResult;
import org.hyperledger.indy.sdk.ledger.Ledger;
import org.hyperledger.indy.sdk.pool.Pool;
import org.hyperledger.indy.sdk.pool.PoolJSONParameters.CreatePoolLedgerConfigJSONParameter;
import org.hyperledger.indy.sdk.pool.PoolJSONParameters.OpenPoolLedgerJSONParameter;
import org.hyperledger.indy.sdk.pool.PoolLedgerConfigExistsException;
import org.hyperledger.indy.sdk.wallet.Wallet;
import org.hyperledger.indy.sdk.wallet.WalletExistsException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import io.leonard.Base58;
import uniresolver.ResolutionException;
import uniresolver.driver.Driver;
import uniresolver.result.ResolveResult;
public class DidSovDriver implements Driver {
private static Logger log = LoggerFactory.getLogger(DidSovDriver.class);
public static final Pattern DID_SOV_PATTERN = Pattern.compile("^did:sov:(?:(\\w[-\\w]*(?::\\w[-\\w]*)*):)?([1-9A-HJ-NP-Za-km-z]{21,22})$");
public static final List<URI> DIDDOCUMENT_CONTEXTS = List.of(
URI.create("https://w3id.org/security/suites/ed25519-2018/v1"),
URI.create("https://w3id.org/security/suites/x25519-2019/v1")
);
public static final String[] DIDDOCUMENT_VERIFICATIONMETHOD_KEY_TYPES = new String[] { "Ed25519VerificationKey2018" };
public static final String[] DIDDOCUMENT_VERIFICATIONMETHOD_KEY_AGREEMENT_TYPES = new String[] { "X25519KeyAgreementKey2019" };
private static final Gson gson = new Gson();
private static final LazySodiumJava lazySodium = new LazySodiumJava(new SodiumJava());
private Map<String, Object> properties;
private String libIndyPath;
private String poolConfigs;
private String poolVersions;
private String walletName;
private Map<String, Pool> poolMap = null;
private Map<String, Integer> poolVersionMap = null;
private Wallet wallet = null;
private String submitterDid = null;
public DidSovDriver(Map<String, Object> properties) {
this.setProperties(properties);
}
public DidSovDriver() {
this(getPropertiesFromEnvironment());
}
private static Map<String, Object> getPropertiesFromEnvironment() {
if (log.isDebugEnabled()) log.debug("Loading from environment: " + System.getenv());
Map<String, Object> properties = new HashMap<String, Object> ();
try {
String env_libIndyPath = System.getenv("uniresolver_driver_did_sov_libIndyPath");
String env_poolConfigs = System.getenv("uniresolver_driver_did_sov_poolConfigs");
String env_poolVersions = System.getenv("uniresolver_driver_did_sov_poolVersions");
String env_walletName = System.getenv("uniresolver_driver_did_sov_walletName");
if (env_libIndyPath != null) properties.put("libIndyPath", env_libIndyPath);
if (env_poolConfigs != null) properties.put("poolConfigs", env_poolConfigs);
if (env_poolVersions != null) properties.put("poolVersions", env_poolVersions);
if (env_walletName != null) properties.put("walletName", env_walletName);
} catch (Exception ex) {
throw new IllegalArgumentException(ex.getMessage(), ex);
}
return properties;
}
private void configureFromProperties() {
if (log.isDebugEnabled()) log.debug("Configuring from properties: " + this.getProperties());
try {
String prop_libIndyPath = (String) this.getProperties().get("libIndyPath");
String prop_poolConfigs = (String) this.getProperties().get("poolConfigs");
String prop_poolVersions = (String) this.getProperties().get("poolVersions");
String prop_walletName = (String) this.getProperties().get("walletName");
if (prop_libIndyPath != null) this.setLibIndyPath(prop_libIndyPath);
if (prop_poolConfigs != null) this.setPoolConfigs(prop_poolConfigs);
if (prop_poolVersions != null) this.setPoolVersions(prop_poolVersions);
if (prop_walletName != null) this.setWalletName(prop_walletName);
} catch (Exception ex) {
throw new IllegalArgumentException(ex.getMessage(), ex);
}
}
@Override
public ResolveResult resolve(DID did, Map<String, Object> resolveOptions) throws ResolutionException {
// open pool
synchronized (this) {
if (this.getPoolMap() == null || this.getPoolVersionMap() == null || this.getWallet() == null || this.getSubmitterDid() == null) this.openIndy();
}
// parse identifier
Matcher matcher = DID_SOV_PATTERN.matcher(did.getDidString());
if (! matcher.matches()) return null;
String network = matcher.group(1);
String targetDid = matcher.group(2);
if (network == null || network.trim().isEmpty()) network = "_";
// find pool version
final Integer poolVersion = this.getPoolVersionMap().get(network);
if (poolVersion == null) throw new ResolutionException("No pool version for network: " + network);
// find pool
final Pool pool = this.getPoolMap().get(network);
if (pool == null) throw new ResolutionException("No pool for network: " + network);
// send GET_NYM request
String getNymResponse;
try {
synchronized (this) {
Pool.setProtocolVersion(poolVersion);
String getNymRequest = Ledger.buildGetNymRequest(this.getSubmitterDid(), targetDid).get();
getNymResponse = Ledger.signAndSubmitRequest(pool, this.getWallet(), this.getSubmitterDid(), getNymRequest).get();
}
} catch (IndyException | InterruptedException | ExecutionException ex) {
throw new ResolutionException("Cannot send GET_NYM request: " + ex.getMessage(), ex);
}
if (log.isInfoEnabled()) log.info("GET_NYM for " + targetDid + ": " + getNymResponse);
// GET_NYM response data
JsonObject jsonGetNymResponse = gson.fromJson(getNymResponse, JsonObject.class);
JsonObject jsonGetNymResult = jsonGetNymResponse == null ? null : jsonGetNymResponse.getAsJsonObject("result");
JsonElement jsonGetNymData = jsonGetNymResult == null ? null : jsonGetNymResult.get("data");
JsonObject jsonGetNymDataContent = (jsonGetNymData == null || jsonGetNymData instanceof JsonNull) ? null : gson.fromJson(jsonGetNymData.getAsString(), JsonObject.class);
if (jsonGetNymDataContent == null) return null;
// send GET_ATTR request
String getAttrResponse;
try {
synchronized (this) {
Pool.setProtocolVersion(poolVersion);
String getAttrRequest = Ledger.buildGetAttribRequest(this.getSubmitterDid(), targetDid, "endpoint", null, null).get();
getAttrResponse = Ledger.signAndSubmitRequest(pool, this.getWallet(), this.getSubmitterDid(), getAttrRequest).get();
}
} catch (IndyException | InterruptedException | ExecutionException ex) {
throw new ResolutionException("Cannot send GET_NYM request: " + ex.getMessage(), ex);
}
if (log.isInfoEnabled()) log.info("GET_ATTR for " + targetDid + ": " + getAttrResponse);
// GET_ATTR response data
JsonObject jsonGetAttrResponse = gson.fromJson(getAttrResponse, JsonObject.class);
JsonObject jsonGetAttrResult = jsonGetAttrResponse == null ? null : jsonGetAttrResponse.getAsJsonObject("result");
JsonElement jsonGetAttrData = jsonGetAttrResult == null ? null : jsonGetAttrResult.get("data");
JsonObject jsonGetAttrDataContent = (jsonGetAttrData == null || jsonGetAttrData instanceof JsonNull) ? null : gson.fromJson(jsonGetAttrData.getAsString(), JsonObject.class);
// DID DOCUMENT verificationMethods
JsonPrimitive jsonGetNymVerkey = jsonGetNymDataContent == null ? null : jsonGetNymDataContent.getAsJsonPrimitive("verkey");
String verkey = jsonGetNymVerkey == null ? null : jsonGetNymVerkey.getAsString();
String ed25519Key = expandVerkey(did.getDidString(), verkey);
String x25519Key = ed25519Tox25519(ed25519Key);
List<VerificationMethod> verificationMethods = new ArrayList<>();
VerificationMethod verificationMethodKey = VerificationMethod.builder()
.id(URI.create(did + "#key-1"))
.types(Arrays.asList(DIDDOCUMENT_VERIFICATIONMETHOD_KEY_TYPES))
.publicKeyBase58(ed25519Key)
.build();
VerificationMethod verificationMethodKeyAgreement = VerificationMethod.builder()
.id(URI.create(did + "#key-agreement-1"))
.types(Arrays.asList(DIDDOCUMENT_VERIFICATIONMETHOD_KEY_AGREEMENT_TYPES))
.publicKeyBase58(x25519Key)
.build();
verificationMethods.add(verificationMethodKey);
verificationMethods.add(verificationMethodKeyAgreement);
// DID DOCUMENT services
JsonObject jsonGetAttrEndpoint = jsonGetAttrDataContent == null ? null : jsonGetAttrDataContent.getAsJsonObject("endpoint");
List<Service> services = new ArrayList<Service> ();
if (jsonGetAttrEndpoint != null) {
for (Map.Entry<String, JsonElement> jsonService : jsonGetAttrEndpoint.entrySet()) {
JsonPrimitive jsonGetAttrEndpointValue = jsonGetAttrEndpoint == null ? null : jsonGetAttrEndpoint.getAsJsonPrimitive(jsonService.getKey());
String value = jsonGetAttrEndpointValue == null ? null : jsonGetAttrEndpointValue.getAsString();
Service service = Service.builder()
.type(jsonService.getKey())
.serviceEndpoint(value)
.build();
services.add(service);
if ("endpoint".equals(service.getType())) {
Service service2 = Service.builder()
.id(URI.create(did + "#did-communication"))
.type("did-communication")
.serviceEndpoint(value)
.build();
JsonLDUtils.jsonLdAddAll(service2, Map.of(
"priority", 0,
"recipientKeys", List.of(JsonLDUtils.uriToString(verificationMethodKey.getId())),
"routingKeys", List.of(),
"accept", List.of("didcomm/aip2;env=rfc19")
));
Service service3 = Service.builder()
.id(URI.create(did + "#didcomm-1"))
.type("DIDComm")
.serviceEndpoint(value)
.build();
JsonLDUtils.jsonLdAddAll(service3, Map.of(
"routingKeys", List.of(),
"accept", List.of("didcomm/v2", "didcomm/aip2;env=rfc19")
));
services.add(service2);
services.add(service3);
}
}
}
// create DID DOCUMENT
DIDDocument didDocument = DIDDocument.builder()
.contexts(DIDDOCUMENT_CONTEXTS)
.id(did.toUri())
.verificationMethods(verificationMethods)
.authenticationVerificationMethod(VerificationMethod.builder().id(verificationMethodKey.getId()).build())
.assertionMethodVerificationMethod(VerificationMethod.builder().id(verificationMethodKey.getId()).build())
.keyAgreementVerificationMethod(VerificationMethod.builder().id(verificationMethodKeyAgreement.getId()).build())
.services(services)
.build();
// create DID DOCUMENT METADATA
Map<String, Object> didDocumentMetadata = new LinkedHashMap<String, Object> ();
didDocumentMetadata.put("network", network);
didDocumentMetadata.put("poolVersion", poolVersion);
didDocumentMetadata.put("nymResponse", gson.fromJson(jsonGetNymResponse, Map.class));
didDocumentMetadata.put("attrResponse", gson.fromJson(jsonGetAttrResponse, Map.class));
// create RESOLVE RESULT
ResolveResult resolveResult = ResolveResult.build(null, didDocument, null, didDocumentMetadata);
// done
return resolveResult;
}
@Override
public Map<String, Object> properties() {
return this.getProperties();
}
private void openIndy() throws ResolutionException {
// initialize libindy
if (this.getLibIndyPath() != null && ! this.getLibIndyPath().isEmpty()) {
if (log.isInfoEnabled()) log.info("Initializing libindy: " + this.getLibIndyPath() + " (" + new File(this.getLibIndyPath()).getAbsolutePath() + ")");
LibIndy.init(new File(this.getLibIndyPath()));
} else {
if (log.isInfoEnabled()) log.info("Initializing libindy.");
if (! LibIndy.isInitialized()) LibIndy.init();
}
// parse pool configs
String[] poolConfigStrings = this.getPoolConfigs().split(";");
Map<String, String> poolConfigStringMap = new HashMap<String, String> ();
for (int i=0; i<poolConfigStrings.length; i+=2) poolConfigStringMap.put(poolConfigStrings[i], poolConfigStrings[i+1]);
if (log.isInfoEnabled()) log.info("Pool config map: " + poolConfigStringMap);
// parse pool versions
String[] poolVersionStrings = this.getPoolVersions().split(";");
this.poolVersionMap = new HashMap<String, Integer> ();
for (int i=0; i<poolVersionStrings.length; i+=2) this.poolVersionMap.put(poolVersionStrings[i], Integer.parseInt(poolVersionStrings[i+1]));
if (log.isInfoEnabled()) log.info("Pool version map: " + this.poolVersionMap);
// create pool configs
for (Map.Entry<String, String> poolConfig : poolConfigStringMap.entrySet()) {
String poolConfigName = poolConfig.getKey();
String poolConfigFile = poolConfig.getValue();
try {
CreatePoolLedgerConfigJSONParameter createPoolLedgerConfigJSONParameter = new CreatePoolLedgerConfigJSONParameter(poolConfigFile);
Pool.createPoolLedgerConfig(poolConfigName, createPoolLedgerConfigJSONParameter.toJson()).get();
if (log.isInfoEnabled()) log.info("Pool config \"" + poolConfigName + "\" successfully created.");
} catch (IndyException | InterruptedException | ExecutionException ex) {
IndyException iex = null;
if (ex instanceof IndyException) iex = (IndyException) ex;
if (ex instanceof ExecutionException && ex.getCause() instanceof IndyException) iex = (IndyException) ex.getCause();
if (iex instanceof PoolLedgerConfigExistsException) {
if (log.isInfoEnabled()) log.info("Pool config \"" + poolConfigName + "\" has already been created.");
} else {
throw new ResolutionException("Cannot create pool config \"" + poolConfigName + "\": " + ex.getMessage(), ex);
}
}
}
// create wallet
try {
String walletConfig = "{ \"id\":\"" + this.getWalletName() + "\", \"storage_type\":\"" + "default" + "\"}";
String walletCredentials = "{ \"key\":\"key\" }";
Wallet.createWallet(walletConfig, walletCredentials).get();
if (log.isInfoEnabled()) log.info("Wallet \"" + this.getWalletName() + "\" successfully created.");
} catch (IndyException | InterruptedException | ExecutionException ex) {
IndyException iex = null;
if (ex instanceof IndyException) iex = (IndyException) ex;
if (ex instanceof ExecutionException && ex.getCause() instanceof IndyException) iex = (IndyException) ex.getCause();
if (iex instanceof WalletExistsException) {
if (log.isInfoEnabled()) log.info("Wallet \"" + this.getWalletName() + "\" has already been created.");
} else {
throw new ResolutionException("Cannot create wallet \"" + this.getWalletName() + "\": " + ex.getMessage(), ex);
}
}
// open wallet
try {
String walletConfig = "{ \"id\":\"" + this.getWalletName() + "\", \"storage_type\":\"" + "default" + "\"}";
String walletCredentials = "{ \"key\":\"key\" }";
this.wallet = Wallet.openWallet(walletConfig, walletCredentials).get();
} catch (IndyException | InterruptedException | ExecutionException ex) {
throw new ResolutionException("Cannot open wallet \"" + this.getWalletName() + "\": " + ex.getMessage(), ex);
}
// create submitter DID
try {
CreateAndStoreMyDidJSONParameter createAndStoreMyDidJSONParameterTrustee = new CreateAndStoreMyDidJSONParameter(null, null, null, null);
CreateAndStoreMyDidResult createAndStoreMyDidResultTrustee = Did.createAndStoreMyDid(this.getWallet(), createAndStoreMyDidJSONParameterTrustee.toJson()).get();
this.submitterDid = createAndStoreMyDidResultTrustee.getDid();
} catch (IndyException | InterruptedException | ExecutionException ex) {
throw new ResolutionException("Cannot create submitter DID: " + ex.getMessage(), ex);
}
if (log.isInfoEnabled()) log.info("Created submitter DID: " + this.submitterDid);
// open pools
this.poolMap = new HashMap<String, Pool> ();
for (String poolConfigName : poolConfigStringMap.keySet()) {
try {
Pool.setProtocolVersion(this.getPoolVersionMap().get(poolConfigName));
OpenPoolLedgerJSONParameter openPoolLedgerJSONParameter = new OpenPoolLedgerJSONParameter(null, null);
Pool pool = Pool.openPoolLedger(poolConfigName, openPoolLedgerJSONParameter.toJson()).get();
this.poolMap.put(poolConfigName, pool);
} catch (IndyException | InterruptedException | ExecutionException ex) {
if (log.isWarnEnabled()) log.warn("Cannot open pool \"" + poolConfigName + "\": " + ex.getMessage(), ex);
continue;
}
}
if (log.isInfoEnabled()) log.info("Opened " + this.poolMap.size() + " pools: " + this.poolMap.keySet());
}
/*
* Helper methods
*/
private static String expandVerkey(String did, String verkey) {
if (verkey == null || ! did.startsWith("did:sov:") || ! verkey.startsWith("~")) return verkey;
byte[] didBytes = Base58.decode(did.substring(did.lastIndexOf(":") + 1));
byte[] verkeyBytes = Base58.decode(verkey.substring(1));
byte[] didVerkeyBytes = new byte[didBytes.length+verkeyBytes.length];
System.arraycopy(didBytes, 0, didVerkeyBytes, 0, 16);
System.arraycopy(verkeyBytes, 0, didVerkeyBytes, 16, 16);
String didVerkey = Base58.encode(didVerkeyBytes);
if (log.isInfoEnabled()) log.info("Expanded " + did + " and " + verkey + " to " + didVerkey);
return didVerkey;
}
private static String ed25519Tox25519(String ed25519Key) {
byte[] ed25519bytes = Base58.decode(ed25519Key);
byte[] x25519bytes = new byte[ed25519bytes.length];
lazySodium.convertPublicKeyEd25519ToCurve25519(x25519bytes, ed25519bytes);
return Base58.encode(x25519bytes);
}
/*
* Getters and setters
*/
public Map<String, Object> getProperties() {
return this.properties;
}
public void setProperties(Map<String, Object> properties) {
this.properties = properties;
this.configureFromProperties();
}
public String getLibIndyPath() {
return this.libIndyPath;
}
public void setLibIndyPath(String libIndyPath) {
this.libIndyPath = libIndyPath;
}
public String getPoolConfigs() {
return this.poolConfigs;
}
public void setPoolConfigs(String poolConfigs) {
this.poolConfigs = poolConfigs;
}
public String getPoolVersions() {
return this.poolVersions;
}
public void setPoolVersions(String poolVersions) {
this.poolVersions = poolVersions;
}
public String getWalletName() {
return this.walletName;
}
public void setWalletName(String walletName) {
this.walletName = walletName;
}
public Map<String, Pool> getPoolMap() {
return this.poolMap;
}
public void setPoolMap(Map<String, Pool> poolMap) {
this.poolMap = poolMap;
}
public Map<String, Integer> getPoolVersionMap() {
return this.poolVersionMap;
}
public void setPoolVersionMap(Map<String, Integer> poolVersionMap) {
this.poolVersionMap = poolVersionMap;
}
public Wallet getWallet() {
return this.wallet;
}
public void setWallet(Wallet wallet) {
this.wallet = wallet;
}
public String getSubmitterDid() {
return this.submitterDid;
}
public void setSubmitterDid(String submitterDid) {
this.submitterDid = submitterDid;
}
}
| [
"markus@danubetech.com"
] | markus@danubetech.com |
08316f3b2ae30a5135f8a3b1a9acf95a6a68ee66 | 7f132338fdd73ece6c5bbf4f4a06434f5bfb19ae | /app/src/main/java/com/yanftch/test/swipemenulistview/SwipeMenuAdapter.java | 64c68086d17bdbd430c710dd12863409a647dfe3 | [] | no_license | yanftch/Test | b7e6435b8abc57f589af0767340734031398ba0a | 3679f9c1f40c85fd698fb70bd74d0e254817fddb | refs/heads/master | 2020-04-07T11:20:10.264227 | 2018-12-13T09:14:16 | 2018-12-13T09:14:16 | 88,705,005 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,343 | java | package com.yanftch.test.swipemenulistview;
import android.content.Context;
import android.database.DataSetObserver;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListAdapter;
import android.widget.WrapperListAdapter;
/**
*
* @author baoyz
* @date 2014-8-24
*
*/
public class SwipeMenuAdapter implements WrapperListAdapter,
SwipeMenuView.OnSwipeItemClickListener {
private ListAdapter mAdapter;
private Context mContext;
private SwipeMenuListView.OnMenuItemClickListener onMenuItemClickListener;
public SwipeMenuAdapter(Context context, ListAdapter adapter) {
mAdapter = adapter;
mContext = context;
}
@Override
public int getCount() {
return mAdapter.getCount();
}
@Override
public Object getItem(int position) {
return mAdapter.getItem(position);
}
@Override
public long getItemId(int position) {
return mAdapter.getItemId(position);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
SwipeMenuLayout layout = null;
if (convertView == null) {
View contentView = mAdapter.getView(position, convertView, parent);
SwipeMenu menu = new SwipeMenu(mContext);
menu.setViewType(getItemViewType(position));
createMenu(menu);
SwipeMenuView menuView = new SwipeMenuView(menu,
(SwipeMenuListView) parent);
menuView.setOnSwipeItemClickListener(this);
SwipeMenuListView listView = (SwipeMenuListView) parent;
layout = new SwipeMenuLayout(contentView, menuView,
listView.getCloseInterpolator(),
listView.getOpenInterpolator());
layout.setPosition(position);
} else {
layout = (SwipeMenuLayout) convertView;
layout.closeMenu();
layout.setPosition(position);
View view = mAdapter.getView(position, layout.getContentView(),
parent);
}
if (mAdapter instanceof BaseSwipListAdapter) {
boolean swipEnable = (((BaseSwipListAdapter) mAdapter).getSwipEnableByPosition(position));
layout.setSwipEnable(swipEnable);
}
return layout;
}
public void createMenu(SwipeMenu menu) {
// Test Code
SwipeMenuItem item = new SwipeMenuItem(mContext);
item.setTitle("Item 1");
item.setBackground(new ColorDrawable(Color.GRAY));
item.setWidth(300);
menu.addMenuItem(item);
item = new SwipeMenuItem(mContext);
item.setTitle("Item 2");
item.setBackground(new ColorDrawable(Color.RED));
item.setWidth(300);
menu.addMenuItem(item);
}
@Override
public void onItemClick(SwipeMenuView view, SwipeMenu menu, int index) {
if (onMenuItemClickListener != null) {
onMenuItemClickListener.onMenuItemClick(view.getPosition(), menu,
index);
}
}
public void setOnSwipeItemClickListener(
SwipeMenuListView.OnMenuItemClickListener onMenuItemClickListener) {
this.onMenuItemClickListener = onMenuItemClickListener;
}
@Override
public void registerDataSetObserver(DataSetObserver observer) {
mAdapter.registerDataSetObserver(observer);
}
@Override
public void unregisterDataSetObserver(DataSetObserver observer) {
mAdapter.unregisterDataSetObserver(observer);
}
@Override
public boolean areAllItemsEnabled() {
return mAdapter.areAllItemsEnabled();
}
@Override
public boolean isEnabled(int position) {
return mAdapter.isEnabled(position);
}
@Override
public boolean hasStableIds() {
return mAdapter.hasStableIds();
}
@Override
public int getItemViewType(int position) {
return mAdapter.getItemViewType(position);
}
@Override
public int getViewTypeCount() {
return mAdapter.getViewTypeCount();
}
@Override
public boolean isEmpty() {
return mAdapter.isEmpty();
}
@Override
public ListAdapter getWrappedAdapter() {
return mAdapter;
}
}
| [
"yanftch@163.com"
] | yanftch@163.com |
73524081b73e835a3600350c871feaec393e6397 | a05e1a01a49a59129cdd71c1fe843c910a35ed8c | /aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53/model/DelegationSetAlreadyCreatedException.java | 18af2c410453c080b917e0f9ec8a37c12a33bccf | [
"Apache-2.0",
"JSON"
] | permissive | lenadkn/java-sdk-test-2 | cd36997e44cd3926831218b2da7c71deda8c2b26 | 28375541f8a4ae27417419772190a8de2b68fc32 | refs/heads/master | 2021-01-20T20:36:53.719764 | 2014-12-19T00:38:57 | 2014-12-19T00:38:57 | 65,262,893 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,243 | java | /*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.route53.model;
import com.amazonaws.AmazonServiceException;
/**
* <p>
* A delegation set with the same owner and caller reference combination
* has already been created.
* </p>
*/
public class DelegationSetAlreadyCreatedException extends AmazonServiceException {
private static final long serialVersionUID = 1L;
/**
* Constructs a new DelegationSetAlreadyCreatedException with the specified error
* message.
*
* @param message Describes the error encountered.
*/
public DelegationSetAlreadyCreatedException(String message) {
super(message);
}
}
| [
"aws@amazon.com"
] | aws@amazon.com |
3bb5a667b96981c4eb7f2b81fb65d1fc2b3f243d | ca7db97caf3e30ac299785d3139383a3de070c3c | /src/ella/RobotData.java | c55b95ea9090802ae0b14f048b27507349347ce4 | [] | no_license | gopenshaw/battlecode-2016 | ef35370def3eb87d881c05e78469efa0c45cb44b | f8e692ede157dadf549c4183c2d4627b70b10fae | refs/heads/master | 2021-01-09T07:01:29.586323 | 2016-02-01T20:41:53 | 2016-02-01T20:41:53 | 49,037,792 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 503 | java | package ella;
import battlecode.common.MapLocation;
import battlecode.common.RobotType;
public class RobotData {
int health;
int id;
MapLocation location;
RobotType type;
public RobotData(int id, MapLocation location, int health, RobotType type) {
this.health = health;
this.location = location;
this.type = type;
this.id = id;
}
@Override
public String toString() {
return location + " " + health + " " + type + "; ";
}
}
| [
"garrett.j.openshaw@gmail.com"
] | garrett.j.openshaw@gmail.com |
42e2b8aaa950992e92c02080397c3f4e533b5a08 | 5181d9445af61db5d27564827002d7c4269ecbab | /app/src/main/java/com/example/esraa/bakingapp/widget/BakingAppWidget.java | a2c55c4572c9da2c4c850e284cd86ce9530c0eef | [] | no_license | EsraaGamalEldien/BakingApp | d292b4a749d1d3e217d0157899a4605876bb8370 | 5868f27b57afd86f24de63171f54a94cae020bf6 | refs/heads/master | 2020-04-11T14:09:48.193123 | 2018-12-14T21:44:37 | 2018-12-14T21:44:37 | 161,843,652 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,177 | java | package com.example.esraa.bakingapp.widget;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.RemoteViews;
import com.example.esraa.bakingapp.R;
import com.example.esraa.bakingapp.activity.MainActivity;
/**
* Implementation of App Widget functionality.
*/
public class BakingAppWidget extends AppWidgetProvider {
public static void updateBakingAppWidgets(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
for (int appWidgetId : appWidgetIds) {
updateAppWidget(context, appWidgetManager, appWidgetId);
}
}
public static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
int appWidgetId) {
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_grid_view);
Intent intent = new Intent(context, GridWidgetService.class);
views.setRemoteAdapter(R.id.widget_grid_view, intent);
Intent appIntent = new Intent(context, MainActivity.class);
PendingIntent appPendingIntent = PendingIntent.getActivity(context, 0, appIntent, PendingIntent.FLAG_UPDATE_CURRENT);
views.setPendingIntentTemplate(R.id.widget_grid_view, appPendingIntent);
appWidgetManager.updateAppWidget(appWidgetId, views);
}
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
for (int appWidgetId : appWidgetIds) {
updateAppWidget(context, appWidgetManager, appWidgetId);
}
}
@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);
}
@Override
public void onEnabled(Context context) {
// Enter relevant functionality for when the first widget is created
}
@Override
public void onDisabled(Context context) {
// Enter relevant functionality for when the last widget is disabled
}
}
| [
"esraagamal01993@gmail.com"
] | esraagamal01993@gmail.com |
0a7f06e81a92617fc052ea9bfcb2e22c5816cdbf | cadecf6fd4e5be7616a2475418f874b06931569d | /Shock_Wave_source/sources/org/shaded/apache/http/protocol/ResponseConnControl.java | cd1bcdf2ae33a5a0bb3f70b58b73b34bf3e080e0 | [] | no_license | TeamShockWave/Ambulance-UAV- | 8a46d2247fe49b7331cf5f7d8c9f18f945f10394 | dc52b40f9feaa3dedb05511d702bd24f4bccadd8 | refs/heads/master | 2022-12-29T00:07:00.666847 | 2020-10-01T11:18:41 | 2020-10-01T11:18:41 | 300,243,147 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,926 | java | package org.shaded.apache.http.protocol;
import java.io.IOException;
import org.shaded.apache.http.Header;
import org.shaded.apache.http.HttpEntity;
import org.shaded.apache.http.HttpException;
import org.shaded.apache.http.HttpRequest;
import org.shaded.apache.http.HttpResponse;
import org.shaded.apache.http.HttpResponseInterceptor;
import org.shaded.apache.http.HttpVersion;
import org.shaded.apache.http.ProtocolVersion;
public class ResponseConnControl implements HttpResponseInterceptor {
public void process(HttpResponse response, HttpContext context) throws HttpException, IOException {
Header header;
if (response == null) {
throw new IllegalArgumentException("HTTP response may not be null");
} else if (context == null) {
throw new IllegalArgumentException("HTTP context may not be null");
} else {
int status = response.getStatusLine().getStatusCode();
if (status == 400 || status == 408 || status == 411 || status == 413 || status == 414 || status == 503 || status == 501) {
response.setHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE);
return;
}
HttpEntity entity = response.getEntity();
if (entity != null) {
ProtocolVersion ver = response.getStatusLine().getProtocolVersion();
if (entity.getContentLength() < 0 && (!entity.isChunked() || ver.lessEquals(HttpVersion.HTTP_1_0))) {
response.setHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE);
return;
}
}
HttpRequest request = (HttpRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
if (request != null && (header = request.getFirstHeader(HTTP.CONN_DIRECTIVE)) != null) {
response.setHeader(HTTP.CONN_DIRECTIVE, header.getValue());
}
}
}
}
| [
"72188202+Tarango24x@users.noreply.github.com"
] | 72188202+Tarango24x@users.noreply.github.com |
59d3c68e4a2d661149e5ef5e2bfa201d5bf4b2f3 | 8a5d3d7ad391242f282c9588c3d9422148543f5d | /PAF-master/src/main/java/com/PafProject/pagination/PaginationResult.java | 9fcdc5f40b36fb1ceb186ff269271c5c2d6e49b8 | [] | no_license | aathif96/PAF | 19c4d8b203ddff33c221e8bc7fd734ef17deb1c1 | f7675035266a90405c401df7d4285d64b57d7bf8 | refs/heads/master | 2020-05-24T04:47:14.958068 | 2019-05-18T16:15:54 | 2019-05-18T16:15:54 | 187,100,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,324 | java | package com.PafProject.pagination;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.query.Query;
public class PaginationResult<E> {
private int totalRecords;
private int currentPage;
private List<E> list;
private int maxResult;
private int totalPages;
private int maxNavigationPage;
private List<Integer> navigationPages;
// @page: 1, 2, ..
public PaginationResult(Query<E> query, int page, int maxResult, int maxNavigationPage) {
final int pageIndex = page - 1 < 0 ? 0 : page - 1;
int fromRecordIndex = pageIndex * maxResult;
int maxRecordIndex = fromRecordIndex + maxResult;
ScrollableResults resultScroll = query.scroll(ScrollMode.SCROLL_INSENSITIVE);
List<E> results = new ArrayList<>();
boolean hasResult = resultScroll.first();
if (hasResult) {
// Scroll to position:
hasResult = resultScroll.scroll(fromRecordIndex);
if (hasResult) {
do {
E record = (E) resultScroll.get(0);
results.add(record);
} while (resultScroll.next()//
&& resultScroll.getRowNumber() >= fromRecordIndex
&& resultScroll.getRowNumber() < maxRecordIndex);
}
// Go to Last record.
resultScroll.last();
}
// Total Records
this.totalRecords = resultScroll.getRowNumber() + 1;
this.currentPage = pageIndex + 1;
this.list = results;
this.maxResult = maxResult;
if (this.totalRecords % this.maxResult == 0) {
this.totalPages = this.totalRecords / this.maxResult;
} else {
this.totalPages = (this.totalRecords / this.maxResult) + 1;
}
this.maxNavigationPage = maxNavigationPage;
if (maxNavigationPage < totalPages) {
this.maxNavigationPage = maxNavigationPage;
}
this.calcNavigationPages();
}
private void calcNavigationPages() {
this.navigationPages = new ArrayList<Integer>();
int current = this.currentPage > this.totalPages ? this.totalPages : this.currentPage;
int begin = current - this.maxNavigationPage / 2;
int end = current + this.maxNavigationPage / 2;
// The first page
navigationPages.add(1);
if (begin > 2) {
// Using for '...'
navigationPages.add(-1);
}
for (int i = begin; i < end; i++) {
if (i > 1 && i < this.totalPages) {
navigationPages.add(i);
}
}
if (end < this.totalPages - 2) {
// Using for '...'
navigationPages.add(-1);
}
// The last page.
navigationPages.add(this.totalPages);
}
public int getTotalPages() {
return totalPages;
}
public int getTotalRecords() {
return totalRecords;
}
public int getCurrentPage() {
return currentPage;
}
public List<E> getList() {
return list;
}
public int getMaxResult() {
return maxResult;
}
public List<Integer> getNavigationPages() {
return navigationPages;
}
}
| [
"janangisenarathna@gmail.com"
] | janangisenarathna@gmail.com |
aa8229d5b2d5c3db445e1a6db5a24c2bbb60e51b | 210ace07fe7053d1a853659e63eea1135f63a08e | /app/src/main/java/com/example/a18302/guigu_news/domain/PhotosMenuDetailPagerBean.java | d5c9a7c24180b3dd2ea7ee4326aa4a1fb3f3cad0 | [] | no_license | hetaoyuan-android/guigunews | 9683a62836aaffc84966c1f4d4096782c37d777a | 8071f4c94b005c49bdaaffde230cb14bcf902b01 | refs/heads/master | 2020-04-11T15:20:29.603758 | 2019-01-20T03:29:19 | 2019-01-20T03:29:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,299 | java | package com.example.a18302.guigu_news.domain;
import java.util.List;
/**
* 图组详情页的数据
*/
public class PhotosMenuDetailPagerBean {
/**
* retcode : 200
* data : {"title":"组图","topic":[],"news":[{"id":147265,"title":"广州93岁肌肉\u201c型爷\u201d走红","url":"/static/html/2015/10/19/724F6A544164197A6B267F47.html","listimage":"/static/images/2015/10/19/35/1987564164OEUZ.jpg","smallimage":"/static/images/2015/10/19/74/5619484425YVE.jpg","largeimage":"/static/images/2015/10/19/62/865381517OOAW.jpg","pubdate":"2015-10-19 08:18","comment":true,"commenturl":"/client/user/newComment/147265","type":"news","commentlist":"/static/api/news/10003/65/147265/comment_1.json"},{"id":147264,"title":"母亲把两岁女儿打扮成选美皇后","url":"/static/html/2015/10/19/734E67594164107369247049.html","listimage":"/static/images/2015/10/19/7/1987564164LL72.jpg","smallimage":"/static/images/2015/10/19/85/561948442I64R.jpg","largeimage":"/static/images/2015/10/19/49/865381517HT9T.jpg","pubdate":"2015-10-19 08:13","comment":true,"commenturl":"/client/user/newComment/147264","type":"news","commentlist":"/static/api/news/10003/64/147264/comment_1.json"},{"id":147184,"title":"盘点全球最让人胆颤心惊的桥梁","url":"/static/html/2015/10/17/764B6D53486D1D7D66257B42.html","listimage":"/static/images/2015/10/17/92/467283564OOS.jpg","smallimage":"/static/images/2015/10/17/4/1987564164XBMP.jpg","largeimage":"/static/images/2015/10/17/81/1473641479VGYE.jpg","pubdate":"2015-10-17 08:37","comment":true,"commenturl":"/client/user/newComment/147184","type":"news","commentlist":"/static/api/news/10003/84/147184/comment_1.json"},{"id":147155,"title":"中国空军歼10空中加油美照","url":"/static/html/2015/10/16/774A6D534A6F1E7E6C227A42.html","listimage":"/static/images/2015/10/16/72/46728356W7Z3.jpg","smallimage":"/static/images/2015/10/16/19/1987564164NIYT.jpg","largeimage":"/static/images/2015/10/16/71/1485924659ZSYH.jpg","pubdate":"2015-10-16 12:13","comment":true,"commenturl":"/client/user/newComment/147155","type":"news","commentlist":"/static/api/news/10003/55/147155/comment_1.json"},{"id":147143,"title":"甜馨登封面变身甜美可爱软妹子","url":"/static/html/2015/10/16/764B6F514F6A1C7C68277B45.html","listimage":"/static/images/2015/10/16/11/1737190341JXBX.jpg","smallimage":"/static/images/2015/10/16/64/1736266820B2LR.jpg","largeimage":"/static/images/2015/10/16/76/1592702510G83T.jpg","pubdate":"2015-10-16 10:30","comment":true,"commenturl":"/client/user/newComment/147143","type":"news","commentlist":"/static/api/news/10003/43/147143/comment_1.json"},{"id":147108,"title":"杭州开启\u201c城市剪影\u201d灯光秀","url":"/static/html/2015/10/16/764B67594B6E1C7C68237B4E.html","listimage":"/static/images/2015/10/16/35/1625236767DCOU.jpg","smallimage":"/static/images/2015/10/16/93/16243132464OY2.jpg","largeimage":"/static/images/2015/10/16/60/1626160288K1XD.jpg","pubdate":"2015-10-16 08:01","comment":true,"commenturl":"/client/user/newComment/147108","type":"news","commentlist":"/static/api/news/10003/08/147108/comment_1.json"},{"id":147083,"title":"盲人夫妇相濡以沫四十载","url":"/static/html/2015/10/15/774A69574C691B7A692A7C42.html","listimage":"/static/images/2015/10/15/68/16490372916K1N.jpg","smallimage":"/static/images/2015/10/15/81/16490372913FZK.jpg","largeimage":"/static/images/2015/10/15/25/1342428319WOUJ.jpg","pubdate":"2015-10-15 15:44","comment":true,"commenturl":"/client/user/newComment/147083","type":"news","commentlist":"/static/api/news/10003/83/147083/comment_1.json"},{"id":147047,"title":"军方曝光新型模块化火箭炮真容","url":"/static/html/2015/10/15/704D6D534F6A1C7D6D227D47.html","listimage":"/static/images/2015/10/15/75/46728356PSDA.jpg","smallimage":"/static/images/2015/10/15/20/1987564164OZH9.jpg","largeimage":"/static/images/2015/10/15/80/1485924659UEO4.jpg","pubdate":"2015-10-15 10:11","comment":true,"commenturl":"/client/user/newComment/147047","type":"news","commentlist":"/static/api/news/10003/47/147047/comment_1.json"},{"id":147005,"title":"美国老爸拍儿子\u201c飞翔\u201d","url":"/static/html/2015/10/15/714C6B554B6E1A7B672C7C44.html","listimage":"/static/images/2015/10/15/10/992237769F1AT.jpg","smallimage":"/static/images/2015/10/15/41/991314248AWJA.jpg","largeimage":"/static/images/2015/10/15/23/990390727AGEC.jpg","pubdate":"2015-10-15 08:32","comment":true,"commenturl":"/client/user/newComment/147005","type":"news","commentlist":"/static/api/news/10003/05/147005/comment_1.json"},{"id":147002,"title":"美国男子鳄鱼池上空走扁带","url":"/static/html/2015/10/15/704D66584F6A1B7A6F247D42.html","listimage":"/static/images/2015/10/15/90/1845697381IGLC.jpg","smallimage":"/static/images/2015/10/15/63/1846620902YRDF.jpg","largeimage":"/static/images/2015/10/15/87/1847544423IEUT.jpg","pubdate":"2015-10-15 08:17","comment":true,"commenturl":"/client/user/newComment/147002","type":"news","commentlist":"/static/api/news/10003/02/147002/comment_1.json"},{"id":147001,"title":"四川螺髻山迎来初雪纷飞","url":"/static/html/2015/10/15/774A69574D6819786D267E42.html","listimage":"/static/images/2015/10/15/5/92784371527JA.jpg","smallimage":"/static/images/2015/10/15/34/926920194UAAH.jpg","largeimage":"/static/images/2015/10/15/43/925996673UNAW.jpg","pubdate":"2015-10-15 08:06","comment":true,"commenturl":"/client/user/newComment/147001","type":"news","commentlist":"/static/api/news/10003/01/147001/comment_1.json"},{"id":146955,"title":"六七十年代中国女兵自然之美","url":"/static/html/2015/10/14/704D6C524A6E1E7668267D45.html","listimage":"/static/images/2015/10/14/63/46728356DC35.jpg","smallimage":"/static/images/2015/10/14/35/1987564164QOY5.jpg","largeimage":"/static/images/2015/10/14/27/1485924659SD9Z.jpg","pubdate":"2015-10-14 11:05","comment":true,"commenturl":"/client/user/newComment/146955","type":"news","commentlist":"/static/api/news/10003/55/146955/comment_1.json"},{"id":146931,"title":"巴丹吉林沙漠秋韵","url":"/static/html/2015/10/14/764B6C524B6F1B73662E7B47.html","listimage":"/static/images/2015/10/14/53/1987564164H6YY.jpg","smallimage":"/static/images/2015/10/14/30/561948442Z91M.jpg","largeimage":"/static/images/2015/10/14/85/865381517FVWV.jpg","pubdate":"2015-10-14 10:08","comment":true,"commenturl":"/client/user/newComment/146931","type":"news","commentlist":"/static/api/news/10003/31/146931/comment_1.json"},{"id":146928,"title":"加拿大举办南瓜舟比赛","url":"/static/html/2015/10/14/724F6D53486C1B736E277F4A.html","listimage":"/static/images/2015/10/14/55/1956051463RM14.jpg","smallimage":"/static/images/2015/10/14/80/19578985059RG4.jpg","largeimage":"/static/images/2015/10/14/76/1955127942L5AQ.jpg","pubdate":"2015-10-14 10:07","comment":true,"commenturl":"/client/user/newComment/146928","type":"news","commentlist":"/static/api/news/10003/28/146928/comment_1.json"},{"id":146919,"title":"万里长城\u201c濒危\u201d之殇","url":"/static/html/2015/10/14/764B6F5140641C746D277B4F.html","listimage":"/static/images/2015/10/14/92/1987564164EEPQ.jpg","smallimage":"/static/images/2015/10/14/76/561948442UHKX.jpg","largeimage":"/static/images/2015/10/14/18/8653815174BEF.jpg","pubdate":"2015-10-14 09:38","comment":true,"commenturl":"/client/user/newComment/146919","type":"news","commentlist":"/static/api/news/10003/19/146919/comment_1.json"},{"id":146917,"title":"郑州:美轮美奂\u201c彩虹隧道\u201d","url":"/static/html/2015/10/14/734E68564A6E197169237F45.html","listimage":"/static/images/2015/10/14/72/3245187314YRP.jpg","smallimage":"/static/images/2015/10/14/97/32359521081SR.jpg","largeimage":"/static/images/2015/10/14/16/15077385783N4G.jpg","pubdate":"2015-10-14 09:19","comment":true,"commenturl":"/client/user/newComment/146917","type":"news","commentlist":"/static/api/news/10003/17/146917/comment_1.json"},{"id":146904,"title":"纪念中国少年先锋队建队66周年","url":"/static/html/2015/10/14/724F6A544D691E76662D7F46.html","listimage":"/static/images/2015/10/14/69/1005077249GNX4.jpg","smallimage":"/static/images/2015/10/14/40/1006000770D5VN.jpg","largeimage":"/static/images/2015/10/14/28/595181977XYVN.jpg","pubdate":"2015-10-14 08:06","comment":true,"commenturl":"/client/user/newComment/146904","type":"news","commentlist":"/static/api/news/10003/04/146904/comment_1.json"},{"id":146853,"title":"新兵为叠出\u201c豆腐块\u201d也是拼了","url":"/static/html/2015/10/13/714C6D534A6E197068267C42.html","listimage":"/static/images/2015/10/13/3/467283560QSZ.jpg","smallimage":"/static/images/2015/10/13/61/1987564164AF3I.jpg","largeimage":"/static/images/2015/10/13/31/1485924659MIXV.jpg","pubdate":"2015-10-13 10:56","comment":true,"commenturl":"/client/user/newComment/146853","type":"news","commentlist":"/static/api/news/10003/53/146853/comment_1.json"},{"id":146849,"title":"最惨无人道的特攻战术","url":"/static/html/2015/10/13/714C6E504C68197066297C48.html","listimage":"/static/images/2015/10/13/14/467283568IBA.jpg","smallimage":"/static/images/2015/10/13/8/1987564164PCQS.jpg","largeimage":"/static/images/2015/10/13/88/1485924659ZYYF.jpg","pubdate":"2015-10-13 10:45","comment":true,"commenturl":"/client/user/newComment/146849","type":"news","commentlist":"/static/api/news/10003/49/146849/comment_1.json"},{"id":146833,"title":"姚晨封面大片诠释知性女神","url":"/static/html/2015/10/13/724F6B554A6E117869217F41.html","listimage":"/static/images/2015/10/13/60/168204621U652.jpg","smallimage":"/static/images/2015/10/13/97/16912814275JQ.jpg","largeimage":"/static/images/2015/10/13/21/718375539WBTZ.jpg","pubdate":"2015-10-13 10:20","comment":true,"commenturl":"/client/user/newComment/146833","type":"news","commentlist":"/static/api/news/10003/33/146833/comment_1.json"}],"countcommenturl":"/client/content/countComment/","more":"/static/api/news/10003/list_2.json"}
*/
private int retcode;
/**
* title : 组图
* topic : []
* news : [{"id":147265,"title":"广州93岁肌肉\u201c型爷\u201d走红","url":"/static/html/2015/10/19/724F6A544164197A6B267F47.html","listimage":"/static/images/2015/10/19/35/1987564164OEUZ.jpg","smallimage":"/static/images/2015/10/19/74/5619484425YVE.jpg","largeimage":"/static/images/2015/10/19/62/865381517OOAW.jpg","pubdate":"2015-10-19 08:18","comment":true,"commenturl":"/client/user/newComment/147265","type":"news","commentlist":"/static/api/news/10003/65/147265/comment_1.json"},{"id":147264,"title":"母亲把两岁女儿打扮成选美皇后","url":"/static/html/2015/10/19/734E67594164107369247049.html","listimage":"/static/images/2015/10/19/7/1987564164LL72.jpg","smallimage":"/static/images/2015/10/19/85/561948442I64R.jpg","largeimage":"/static/images/2015/10/19/49/865381517HT9T.jpg","pubdate":"2015-10-19 08:13","comment":true,"commenturl":"/client/user/newComment/147264","type":"news","commentlist":"/static/api/news/10003/64/147264/comment_1.json"},{"id":147184,"title":"盘点全球最让人胆颤心惊的桥梁","url":"/static/html/2015/10/17/764B6D53486D1D7D66257B42.html","listimage":"/static/images/2015/10/17/92/467283564OOS.jpg","smallimage":"/static/images/2015/10/17/4/1987564164XBMP.jpg","largeimage":"/static/images/2015/10/17/81/1473641479VGYE.jpg","pubdate":"2015-10-17 08:37","comment":true,"commenturl":"/client/user/newComment/147184","type":"news","commentlist":"/static/api/news/10003/84/147184/comment_1.json"},{"id":147155,"title":"中国空军歼10空中加油美照","url":"/static/html/2015/10/16/774A6D534A6F1E7E6C227A42.html","listimage":"/static/images/2015/10/16/72/46728356W7Z3.jpg","smallimage":"/static/images/2015/10/16/19/1987564164NIYT.jpg","largeimage":"/static/images/2015/10/16/71/1485924659ZSYH.jpg","pubdate":"2015-10-16 12:13","comment":true,"commenturl":"/client/user/newComment/147155","type":"news","commentlist":"/static/api/news/10003/55/147155/comment_1.json"},{"id":147143,"title":"甜馨登封面变身甜美可爱软妹子","url":"/static/html/2015/10/16/764B6F514F6A1C7C68277B45.html","listimage":"/static/images/2015/10/16/11/1737190341JXBX.jpg","smallimage":"/static/images/2015/10/16/64/1736266820B2LR.jpg","largeimage":"/static/images/2015/10/16/76/1592702510G83T.jpg","pubdate":"2015-10-16 10:30","comment":true,"commenturl":"/client/user/newComment/147143","type":"news","commentlist":"/static/api/news/10003/43/147143/comment_1.json"},{"id":147108,"title":"杭州开启\u201c城市剪影\u201d灯光秀","url":"/static/html/2015/10/16/764B67594B6E1C7C68237B4E.html","listimage":"/static/images/2015/10/16/35/1625236767DCOU.jpg","smallimage":"/static/images/2015/10/16/93/16243132464OY2.jpg","largeimage":"/static/images/2015/10/16/60/1626160288K1XD.jpg","pubdate":"2015-10-16 08:01","comment":true,"commenturl":"/client/user/newComment/147108","type":"news","commentlist":"/static/api/news/10003/08/147108/comment_1.json"},{"id":147083,"title":"盲人夫妇相濡以沫四十载","url":"/static/html/2015/10/15/774A69574C691B7A692A7C42.html","listimage":"/static/images/2015/10/15/68/16490372916K1N.jpg","smallimage":"/static/images/2015/10/15/81/16490372913FZK.jpg","largeimage":"/static/images/2015/10/15/25/1342428319WOUJ.jpg","pubdate":"2015-10-15 15:44","comment":true,"commenturl":"/client/user/newComment/147083","type":"news","commentlist":"/static/api/news/10003/83/147083/comment_1.json"},{"id":147047,"title":"军方曝光新型模块化火箭炮真容","url":"/static/html/2015/10/15/704D6D534F6A1C7D6D227D47.html","listimage":"/static/images/2015/10/15/75/46728356PSDA.jpg","smallimage":"/static/images/2015/10/15/20/1987564164OZH9.jpg","largeimage":"/static/images/2015/10/15/80/1485924659UEO4.jpg","pubdate":"2015-10-15 10:11","comment":true,"commenturl":"/client/user/newComment/147047","type":"news","commentlist":"/static/api/news/10003/47/147047/comment_1.json"},{"id":147005,"title":"美国老爸拍儿子\u201c飞翔\u201d","url":"/static/html/2015/10/15/714C6B554B6E1A7B672C7C44.html","listimage":"/static/images/2015/10/15/10/992237769F1AT.jpg","smallimage":"/static/images/2015/10/15/41/991314248AWJA.jpg","largeimage":"/static/images/2015/10/15/23/990390727AGEC.jpg","pubdate":"2015-10-15 08:32","comment":true,"commenturl":"/client/user/newComment/147005","type":"news","commentlist":"/static/api/news/10003/05/147005/comment_1.json"},{"id":147002,"title":"美国男子鳄鱼池上空走扁带","url":"/static/html/2015/10/15/704D66584F6A1B7A6F247D42.html","listimage":"/static/images/2015/10/15/90/1845697381IGLC.jpg","smallimage":"/static/images/2015/10/15/63/1846620902YRDF.jpg","largeimage":"/static/images/2015/10/15/87/1847544423IEUT.jpg","pubdate":"2015-10-15 08:17","comment":true,"commenturl":"/client/user/newComment/147002","type":"news","commentlist":"/static/api/news/10003/02/147002/comment_1.json"},{"id":147001,"title":"四川螺髻山迎来初雪纷飞","url":"/static/html/2015/10/15/774A69574D6819786D267E42.html","listimage":"/static/images/2015/10/15/5/92784371527JA.jpg","smallimage":"/static/images/2015/10/15/34/926920194UAAH.jpg","largeimage":"/static/images/2015/10/15/43/925996673UNAW.jpg","pubdate":"2015-10-15 08:06","comment":true,"commenturl":"/client/user/newComment/147001","type":"news","commentlist":"/static/api/news/10003/01/147001/comment_1.json"},{"id":146955,"title":"六七十年代中国女兵自然之美","url":"/static/html/2015/10/14/704D6C524A6E1E7668267D45.html","listimage":"/static/images/2015/10/14/63/46728356DC35.jpg","smallimage":"/static/images/2015/10/14/35/1987564164QOY5.jpg","largeimage":"/static/images/2015/10/14/27/1485924659SD9Z.jpg","pubdate":"2015-10-14 11:05","comment":true,"commenturl":"/client/user/newComment/146955","type":"news","commentlist":"/static/api/news/10003/55/146955/comment_1.json"},{"id":146931,"title":"巴丹吉林沙漠秋韵","url":"/static/html/2015/10/14/764B6C524B6F1B73662E7B47.html","listimage":"/static/images/2015/10/14/53/1987564164H6YY.jpg","smallimage":"/static/images/2015/10/14/30/561948442Z91M.jpg","largeimage":"/static/images/2015/10/14/85/865381517FVWV.jpg","pubdate":"2015-10-14 10:08","comment":true,"commenturl":"/client/user/newComment/146931","type":"news","commentlist":"/static/api/news/10003/31/146931/comment_1.json"},{"id":146928,"title":"加拿大举办南瓜舟比赛","url":"/static/html/2015/10/14/724F6D53486C1B736E277F4A.html","listimage":"/static/images/2015/10/14/55/1956051463RM14.jpg","smallimage":"/static/images/2015/10/14/80/19578985059RG4.jpg","largeimage":"/static/images/2015/10/14/76/1955127942L5AQ.jpg","pubdate":"2015-10-14 10:07","comment":true,"commenturl":"/client/user/newComment/146928","type":"news","commentlist":"/static/api/news/10003/28/146928/comment_1.json"},{"id":146919,"title":"万里长城\u201c濒危\u201d之殇","url":"/static/html/2015/10/14/764B6F5140641C746D277B4F.html","listimage":"/static/images/2015/10/14/92/1987564164EEPQ.jpg","smallimage":"/static/images/2015/10/14/76/561948442UHKX.jpg","largeimage":"/static/images/2015/10/14/18/8653815174BEF.jpg","pubdate":"2015-10-14 09:38","comment":true,"commenturl":"/client/user/newComment/146919","type":"news","commentlist":"/static/api/news/10003/19/146919/comment_1.json"},{"id":146917,"title":"郑州:美轮美奂\u201c彩虹隧道\u201d","url":"/static/html/2015/10/14/734E68564A6E197169237F45.html","listimage":"/static/images/2015/10/14/72/3245187314YRP.jpg","smallimage":"/static/images/2015/10/14/97/32359521081SR.jpg","largeimage":"/static/images/2015/10/14/16/15077385783N4G.jpg","pubdate":"2015-10-14 09:19","comment":true,"commenturl":"/client/user/newComment/146917","type":"news","commentlist":"/static/api/news/10003/17/146917/comment_1.json"},{"id":146904,"title":"纪念中国少年先锋队建队66周年","url":"/static/html/2015/10/14/724F6A544D691E76662D7F46.html","listimage":"/static/images/2015/10/14/69/1005077249GNX4.jpg","smallimage":"/static/images/2015/10/14/40/1006000770D5VN.jpg","largeimage":"/static/images/2015/10/14/28/595181977XYVN.jpg","pubdate":"2015-10-14 08:06","comment":true,"commenturl":"/client/user/newComment/146904","type":"news","commentlist":"/static/api/news/10003/04/146904/comment_1.json"},{"id":146853,"title":"新兵为叠出\u201c豆腐块\u201d也是拼了","url":"/static/html/2015/10/13/714C6D534A6E197068267C42.html","listimage":"/static/images/2015/10/13/3/467283560QSZ.jpg","smallimage":"/static/images/2015/10/13/61/1987564164AF3I.jpg","largeimage":"/static/images/2015/10/13/31/1485924659MIXV.jpg","pubdate":"2015-10-13 10:56","comment":true,"commenturl":"/client/user/newComment/146853","type":"news","commentlist":"/static/api/news/10003/53/146853/comment_1.json"},{"id":146849,"title":"最惨无人道的特攻战术","url":"/static/html/2015/10/13/714C6E504C68197066297C48.html","listimage":"/static/images/2015/10/13/14/467283568IBA.jpg","smallimage":"/static/images/2015/10/13/8/1987564164PCQS.jpg","largeimage":"/static/images/2015/10/13/88/1485924659ZYYF.jpg","pubdate":"2015-10-13 10:45","comment":true,"commenturl":"/client/user/newComment/146849","type":"news","commentlist":"/static/api/news/10003/49/146849/comment_1.json"},{"id":146833,"title":"姚晨封面大片诠释知性女神","url":"/static/html/2015/10/13/724F6B554A6E117869217F41.html","listimage":"/static/images/2015/10/13/60/168204621U652.jpg","smallimage":"/static/images/2015/10/13/97/16912814275JQ.jpg","largeimage":"/static/images/2015/10/13/21/718375539WBTZ.jpg","pubdate":"2015-10-13 10:20","comment":true,"commenturl":"/client/user/newComment/146833","type":"news","commentlist":"/static/api/news/10003/33/146833/comment_1.json"}]
* countcommenturl : /client/content/countComment/
* more : /static/api/news/10003/list_2.json
*/
private DataEntity data;
public void setRetcode(int retcode) {
this.retcode = retcode;
}
public void setData(DataEntity data) {
this.data = data;
}
public int getRetcode() {
return retcode;
}
public DataEntity getData() {
return data;
}
public static class DataEntity {
private String title;
private String countcommenturl;
private String more;
private List<?> topic;
/**
* id : 147265
* title : 广州93岁肌肉“型爷”走红
* url : /static/html/2015/10/19/724F6A544164197A6B267F47.html
* listimage : /static/images/2015/10/19/35/1987564164OEUZ.jpg
* smallimage : /static/images/2015/10/19/74/5619484425YVE.jpg
* largeimage : /static/images/2015/10/19/62/865381517OOAW.jpg
* pubdate : 2015-10-19 08:18
* comment : true
* commenturl : /client/user/newComment/147265
* type : news
* commentlist : /static/api/news/10003/65/147265/comment_1.json
*/
private List<NewsEntity> news;
public void setTitle(String title) {
this.title = title;
}
public void setCountcommenturl(String countcommenturl) {
this.countcommenturl = countcommenturl;
}
public void setMore(String more) {
this.more = more;
}
public void setTopic(List<?> topic) {
this.topic = topic;
}
public void setNews(List<NewsEntity> news) {
this.news = news;
}
public String getTitle() {
return title;
}
public String getCountcommenturl() {
return countcommenturl;
}
public String getMore() {
return more;
}
public List<?> getTopic() {
return topic;
}
public List<NewsEntity> getNews() {
return news;
}
public static class NewsEntity {
private int id;
private String title;
private String url;
private String listimage;
private String smallimage;
private String largeimage;
private String pubdate;
private boolean comment;
private String commenturl;
private String type;
private String commentlist;
public void setId(int id) {
this.id = id;
}
public void setTitle(String title) {
this.title = title;
}
public void setUrl(String url) {
this.url = url;
}
public void setListimage(String listimage) {
this.listimage = listimage;
}
public void setSmallimage(String smallimage) {
this.smallimage = smallimage;
}
public void setLargeimage(String largeimage) {
this.largeimage = largeimage;
}
public void setPubdate(String pubdate) {
this.pubdate = pubdate;
}
public void setComment(boolean comment) {
this.comment = comment;
}
public void setCommenturl(String commenturl) {
this.commenturl = commenturl;
}
public void setType(String type) {
this.type = type;
}
public void setCommentlist(String commentlist) {
this.commentlist = commentlist;
}
public int getId() {
return id;
}
public String getTitle() {
return title;
}
public String getUrl() {
return url;
}
public String getListimage() {
return listimage;
}
public String getSmallimage() {
return smallimage;
}
public String getLargeimage() {
return largeimage;
}
public String getPubdate() {
return pubdate;
}
public boolean isComment() {
return comment;
}
public String getCommenturl() {
return commenturl;
}
public String getType() {
return type;
}
public String getCommentlist() {
return commentlist;
}
}
}
}
| [
"183023376@qq.com"
] | 183023376@qq.com |
c6cc74281f061e76686b46d5b6f4bc33fba4fd40 | 1cc037b19a154941fd1fdc7d9d1c02702794b975 | /hybris/bin/custom/spar/sparstorefront/web/src/com/spar/hcl/storefront/checkout/steps/validation/impl/DefaultMultiStepCheckoutStepValidator.java | 3eb17b659da5f4651fdec6fa022fefbf77a47380 | [] | no_license | demo-solution/solution | b557dea73d613ec8bb722e2d9a63a338f0b9cf8d | e342fd77084703d43122a17d7184803ea72ae5c2 | refs/heads/master | 2022-07-16T05:41:35.541144 | 2020-05-19T14:51:59 | 2020-05-19T14:51:59 | 259,383,771 | 0 | 0 | null | 2020-05-19T14:54:38 | 2020-04-27T16:07:54 | Java | UTF-8 | Java | false | false | 1,516 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2015 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*
*/
package com.spar.hcl.storefront.checkout.steps.validation.impl;
import de.hybris.platform.acceleratorstorefrontcommons.checkout.steps.validation.ValidationResults;
import de.hybris.platform.commercefacades.order.data.CartData;
import de.hybris.platform.acceleratorstorefrontcommons.checkout.steps.validation.AbstractCheckoutStepValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
public class DefaultMultiStepCheckoutStepValidator extends AbstractCheckoutStepValidator
{
private static final Logger LOG = LoggerFactory.getLogger(DefaultMultiStepCheckoutStepValidator.class);
@Override
public ValidationResults validateOnEnter(final RedirectAttributes redirectAttributes)
{
final CartData cartData = getCheckoutFacade().getCheckoutCart();
if (cartData.getEntries() != null && !cartData.getEntries().isEmpty())
{
return (getCheckoutFacade().hasShippingItems()) ? ValidationResults.SUCCESS
: ValidationResults.REDIRECT_TO_PICKUP_LOCATION;
}
LOG.info("Missing, empty or unsupported cart");
return ValidationResults.FAILED;
}
}
| [
"ruchi_g@hcl.com"
] | ruchi_g@hcl.com |
d20df803c0cae3608541532008a242344ef3efc2 | 09e2bba128905ce114e723d3e799392d236296fd | /src/chess/pieces/Rook.java | d8bbc3898bff88eaa48ed81ca5e293a8fc536902 | [] | no_license | luizGusstavo/chess-game-java | 3acc73d1d0999e37febee590bd59bb75cbed9f31 | cd7de895ea8a016237b55b77c8e5f35a3add4bb0 | refs/heads/master | 2023-05-23T15:27:54.270035 | 2021-06-11T17:58:19 | 2021-06-11T17:58:19 | 372,288,882 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,382 | java | package chess.pieces;
import boardgame.Board;
import boardgame.Position;
import chess.ChessPiece;
import chess.Color;
public class Rook extends ChessPiece{
// INFORMA QUEM E O TABULEIRO E QUAL A COR DA PECA
public Rook(Board board, Color color) {
super(board, color);
}
@Override
public String toString() {
return "R";
}
@Override
public boolean[][] possibleMoves() {
boolean[][] mat = new boolean[getBoard().getRows()][getBoard().getColumns()];
Position p = new Position(0, 0);
//aboce - acima
p.setValues(position.getRow() - 1, position.getColumn());
while(getBoard().positionExists(p) && !getBoard().thereIsAPiece(p)) { // ENQUANTO A POSICAO P EXISTIR E NAO TIVER NENHUMA PECA NELA
mat[p.getRow()][p.getColumn()] = true; // DECLARA QUE A TORRE PODE SE MOVER NESSA POSICAO
p.setRow(p.getRow() - 1);
}
if(getBoard().positionExists(p) && isThereOpponentPiece(p)) {
mat[p.getRow()][p.getColumn()] = true;
}
//left - esquerda
p.setValues(position.getRow(), position.getColumn() - 1);
while(getBoard().positionExists(p) && !getBoard().thereIsAPiece(p)) { // ENQUANTO A POSICAO P EXISTIR E NAO TIVER NENHUMA PECA NELA
mat[p.getRow()][p.getColumn()] = true; // DECLARA QUE A TORRE PODE SE MOVER NESSA POSICAO
p.setColumn(p.getColumn() - 1);;
}
if(getBoard().positionExists(p) && isThereOpponentPiece(p)) {
mat[p.getRow()][p.getColumn()] = true;
}
//right - direita
p.setValues(position.getRow(), position.getColumn() + 1);
while(getBoard().positionExists(p) && !getBoard().thereIsAPiece(p)) { // ENQUANTO A POSICAO P EXISTIR E NAO TIVER NENHUMA PECA NELA
mat[p.getRow()][p.getColumn()] = true; // DECLARA QUE A TORRE PODE SE MOVER NESSA POSICAO
p.setColumn(p.getColumn() + 1);;
}
if(getBoard().positionExists(p) && isThereOpponentPiece(p)) {
mat[p.getRow()][p.getColumn()] = true;
}
//below - abaixo
p.setValues(position.getRow() + 1, position.getColumn());
while(getBoard().positionExists(p) && !getBoard().thereIsAPiece(p)) { // ENQUANTO A POSICAO P EXISTIR E NAO TIVER NENHUMA PECA NELA
mat[p.getRow()][p.getColumn()] = true; // DECLARA QUE A TORRE PODE SE MOVER NESSA POSICAO
p.setRow(p.getRow() + 1);
}
if(getBoard().positionExists(p) && isThereOpponentPiece(p)) {
mat[p.getRow()][p.getColumn()] = true;
}
return mat;
}
}
| [
"luizgs@ufba.br"
] | luizgs@ufba.br |
c71b876673bda682296652ed9097d30e62fa2fdc | 6f42f6d60fbf49d19e54268616739f9924b08c57 | /ProductDetails/app/src/main/java/com/example/kylinarm/productdetails/MainActivity.java | 06a1427db4b2644e0bbc9eddc3a369fc97ed417f | [] | no_license | DreaJiao/handsomeYe.productdetails | 3cf0f5f4ed1955664a85fcf453831929f43cbf78 | aaa9dffff70b32addc9cc326bc1dc9cf1808ca97 | refs/heads/master | 2021-08-11T07:15:52.313534 | 2017-11-13T09:50:24 | 2017-11-13T09:50:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,204 | java | package com.example.kylinarm.productdetails;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.widget.NestedScrollView;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.example.kylinarm.productdetails.ui.OneFragment;
import com.example.kylinarm.productdetails.ui.TwoFragment;
import com.example.kylinarm.productdetails.widget.KylinScrollView;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import butterknife.ButterKnife;
import butterknife.InjectView;
/**
* Created by kylinARM on 2017/11/13.
*/
public class MainActivity extends AppCompatActivity implements TabChangeLinstener{
@InjectView(R.id.ll_scroll_content)
LinearLayout upContent;
@InjectView(R.id.tl_tab)
TabLayout cTab;
@InjectView(R.id.fl_scroll_content)
FrameLayout frameContent;
private KylinScrollView kylinScrollView;
private TabLayout tTab;
private View contentView;
private OneFragment oneFragment;
private TwoFragment twoFragment;
private Fragment[] fragments = new Fragment[2];
private String[] tags = new String[2];
private String[] titles = new String[]{"One","Two"};
private FragmentManager fragmentManager;
private TabGroup tabGroup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
initTab();
initFragment();
initScroll();
initUpView();
showFragment(0);
}
private void initView(){
kylinScrollView = (KylinScrollView) findViewById(R.id.pull_scroll);
tTab = (TabLayout) findViewById(R.id.top_tab);
contentView = LayoutInflater.from(this).inflate(R.layout.layout_ks_content,null);
kylinScrollView.addView(contentView);
ButterKnife.inject(this,contentView);
}
private void initTab(){
tabGroup = new TabGroup(this);
tabGroup.addTabLayout(cTab);
tabGroup.addTabLayout(tTab);
tabGroup.addTitiles(titles);
tabGroup.tabGroupListener();
tabGroup.setTabChangeLinstener(this);
}
private void initFragment(){
fragmentManager = getSupportFragmentManager();
oneFragment = OneFragment.newInstance();
twoFragment = TwoFragment.newInstance();
fragments[0] = oneFragment;
fragments[1] = twoFragment;
tags[0] = "fragments0";
tags[1] = "fragments1";
}
private void initScroll(){
kylinScrollView.setMode(PullToRefreshBase.Mode.PULL_FROM_START);
kylinScrollView.getScrollView().setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
@Override
public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
if (scrollY >= cTab.getTop()+contentView.getTop()){
tTab.setVisibility(View.VISIBLE);
}else {
tTab.setVisibility(View.GONE);
}
}
});
kylinScrollView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<NestedScrollView>() {
@Override
public void onRefresh(PullToRefreshBase<NestedScrollView> refreshView) {
Toast.makeText(MainActivity.this,"下拉刷新",Toast.LENGTH_SHORT).show();
// todo 下拉的操作,恢复拉动的操作在刷新之后做
if (kylinScrollView.isRefreshing()){
kylinScrollView.onRefreshComplete();
}
}
});
}
private void initUpView(){
TextView textView = new TextView(this);
textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,600));
textView.setBackgroundResource(R.color.colorAccent);
textView.setGravity(Gravity.CENTER);
textView.setText("测试");
upContent.addView(textView);
}
/**
* 展示fragment
*/
public void showFragment(int position){
for (int i = 0; i < fragments.length; i++) {
if (i == position){
if (fragmentManager.findFragmentByTag(tags[i]) == null){
fragmentManager.beginTransaction().add(R.id.fl_scroll_content, fragments[i], tags[i]).commit();
}else {
fragmentManager.beginTransaction().attach(fragments[i]).commit();
}
}else {
if (fragmentManager.findFragmentByTag(tags[i]) != null){
fragmentManager.beginTransaction().detach(fragments[i]).commit();
}
}
}
}
@Override
public void tabChange(int position) {
showFragment(position);
}
}
| [
"994866755@qq.com"
] | 994866755@qq.com |
a2d5b2fc2445404b73729abe7c80f461b40e20cf | ca303228c457a022b9d68a1eabe45a94c2c1be02 | /ThreadGroupExceptionTest.java | a2436e8d75270252d706aa32d0bf3b0ff63c2b90 | [] | no_license | ZhongHongDou/java_test | 99a4b2371ba66efd41544e673c097e6927a4c703 | 4bbea90f4e448e12cab0a901e19ec50be845f228 | refs/heads/master | 2021-05-27T15:44:55.626333 | 2014-10-21T14:58:48 | 2014-10-21T14:58:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,349 | java | /**
* @file Name: ThreadGroupExceptionTest.java
* @description:Test the ThreadGroupExceptionTest class, the threadgroup deal the * * * * exception for the thread
* @author : trilever
* @version : 1.0
* @mail: trilever31204@gmail.com
* @created Time: 2014-7-8 14:53:00
*/
public class ThreadGroupExceptionTest implements Runnable
{
public void run()
{
for(int i=0;i<100;i++)
{
System.out.println(100/(i-20));
}
}
public static void main(String[] args)
{
ThreadGroup tg = new ThreadGroup("tg1"){
//set the thread exception dealer func
//the threadgroup deal the exception for the thread
public void uncaughtException(Thread t, Throwable e)
{
System.out.println("The Error occure in the thread: "+t.currentThread().getName()+e.getMessage());
}
};
ThreadGroupExceptionTest tgt = new ThreadGroupExceptionTest();
//construct the thread, add it to the threadgroup
Thread t = new Thread(tg,tgt);
t.start();
//construct the thread, add it to the threadgroup
Thread t1 = new Thread(tg,tgt);
t1.start();
//calculate the num of the thread in the threadgroup
System.out.println(tg.activeCount());
//the threadgroup with dealing fun an deal with the exception came out of the threads in the threadgroup but not the thread came out of the threadgroup
System.out.println(20/0);
}
}
| [
"trilever31204@163.com"
] | trilever31204@163.com |
7b95c2f0303eda8b467196d4fe060bb787539193 | de4582316964a3a6f6b3e84a851373892f886f8c | /src/monegros-restaurant/entities/Person.java | 7d9a80898a9d85f4a7ca545171e5c33097df068d | [] | no_license | DianaMD21/monegros-restaurant-dianamonegro | 904ffad8406837fd290e618e2673bd9f795de6a4 | dd6c98ba212b38050d17f64e2e3856cf670e6c0b | refs/heads/main | 2023-04-20T09:01:49.078555 | 2021-04-29T16:03:09 | 2021-04-29T16:03:09 | 360,937,826 | 0 | 0 | null | 2021-04-29T16:03:40 | 2021-04-23T16:03:37 | null | UTF-8 | Java | false | false | 1,105 | java | package entities;
import java.time.ZonedDateTime;
public class Person {
private String name;
private String id;
private String lastName;
private String phone;
private String address;
private ZonedDateTime birthdate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public ZonedDateTime getBirthdate() {
return birthdate;
}
public void setBirthdate(ZonedDateTime birthdate) {
this.birthdate = birthdate;
}
}
| [
"diana2monegro1@gmail.com"
] | diana2monegro1@gmail.com |
6d15794e8e5d9a0240a5974c6b15019a6b463324 | 5204d292d10f1455d51554c80becb7321eef65e7 | /Laboratorios_JavaOO/Codigos_labs/src/curso/oo/lab07/Pessoa.java | 38af584f633f3b4f262ecb303f7d3076027623fd | [
"MIT"
] | permissive | alexferreiradev/3way_laboratorios | a949f899d8ad69c66898539449ade2d5b25494ec | 20ef2549f4928a09098162214ed131cab015f8d7 | refs/heads/master | 2021-08-23T23:37:49.886252 | 2017-12-07T03:26:33 | 2017-12-07T03:26:33 | 107,600,753 | 1 | 8 | null | 2017-11-02T03:43:26 | 2017-10-19T21:30:32 | Java | UTF-8 | Java | false | false | 670 | java | package curso.oo.lab07;
public class Pessoa {
private String nome;
private String telefone;
private String endereco;
public Pessoa() {
}
public Pessoa( String nome ) {
this.nome = nome;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getTelefone() {
return telefone;
}
public void setTelefone(String telefone) {
this.telefone = telefone;
}
public String getEndereco() {
return endereco;
}
public void setEndereco(String endereco) {
this.endereco = endereco;
}
public void ImprimeNome() {
System.out.println("O nome da pessoa é : " + nome);
}
}
| [
"arf92@live.com"
] | arf92@live.com |
df9770d44ef667bc53c09675e7d46e9c33f90761 | 743118b907c3129696a4370792bcd74ef8ef9286 | /src/back-up/peron/hong/structure/flyweight/Document.java | ef29d98d968741e9f265dd11d3ef406a719a2aa6 | [] | no_license | HongXiaoHong/design-pattern | d005ec226ded0b5fb8d7935993b2bb74b0a694db | 8166f36d0b3d4aebf7114f6abd92ed1dbfae8bfe | refs/heads/main | 2023-04-29T15:08:40.947105 | 2021-05-23T12:29:26 | 2021-05-23T12:29:26 | 370,016,773 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 394 | java | package peron.hong.structure.flyweight;
/**
* @note 需要被打印的文件
* @author 洪晓鸿
* @date 2019年7月9日 下午11:33:57
* @version V1.0
*/
public class Document {
private String name;
public Document(String name) {
super();
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"1908711045@qq.com"
] | 1908711045@qq.com |
2488186c7f877eb23d607348236e91eb49b190e9 | e2fd6cd28a7207e5056dbb39650ab8f20fccf33b | /InvoiceItem.java | 604fd3481122edddd2053a3a1eb213b9cd785d9b | [] | no_license | lehoangminhfpt2020/javalad4 | 5e4cc22aa1976517e37798ebc7e4d434ee386615 | 7636afba6987ced702fa16d77e3cd8d5116e3bcf | refs/heads/master | 2023-01-06T11:19:35.542057 | 2020-10-25T02:27:24 | 2020-10-25T02:27:24 | 307,009,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 969 | java | package lab4;
public class InvoiceItem {
private String id;
private String desc;
private int qty;
private double unitPrice;
public InvoiceItem(String id, String desc, int qty, double unitPrice) {
this.id = id;
this.desc = desc;
this.qty = qty;
this.unitPrice = unitPrice;
}
public String getId() {
return id;
}
public String getDesc() {
return desc;
}
public int getQty() {
return qty;
}
public void setQty(int qty) {
this.qty = qty;
}
public double getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(double unitPrice) {
this.unitPrice = unitPrice;
}
public double getTotal() {
return unitPrice * qty;
}
public String toString() {
return "InvoiceItem[id=" + id +
",desc=" + desc + ",qty=" + qty +
",unitPrice=" + unitPrice + "]";
}
}
| [
"65264453+lehoangminhfpt2020@users.noreply.github.com"
] | 65264453+lehoangminhfpt2020@users.noreply.github.com |
eadcb9291a4a8ef9343c4d29dd7aaa098f9fd6ad | 092a5fd0817266d60af50fba16be904c3f772349 | /server/src/main/java/com/vi/server/util/TokenUtil.java | cc68964ebae8824f6b089b909d03a73f21055c98 | [] | no_license | coVdiing/video | 05277fb485c6ddbb47bca45513938e0b36571230 | 8a6c49fbabd5c8a7b3f3449f8ce04698cfbbdc25 | refs/heads/master | 2023-05-31T01:33:46.440518 | 2021-06-28T14:31:56 | 2021-06-28T14:31:56 | 310,972,110 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package com.vi.server.util;
import com.vi.server.consts.SessionConst;
/**
* @Author: vi
* @Date: 2021-06-05 11:11
* @Version: 1.0
* @Description:Token工具类
*/
public class TokenUtil {
// 登录验证token
public static String getLoginToken() {
return SessionConst.LOGIN_USER+"_"+UuidUtil.getShortUuid();
}
}
| [
"113714806@qq.com"
] | 113714806@qq.com |
495575468e43afe702d26a447fc2ac9d68f1b423 | 4dc6da1cbbf589f2dedc6e460209c98df14141e9 | /Test2/app/src/main/java/com/example/sigit/test2/GameHUD.java | 88ec901dc7621e3e0fadca8ebaf0d459921cd9e9 | [] | no_license | SigitasAmbrozaitis/Android | fd4ba82d869609c86f961611c879f11a85e42282 | 28dd84153a5b5f243c8c90082979c1f3db46444e | refs/heads/master | 2020-03-11T21:29:04.975587 | 2018-04-23T19:22:54 | 2018-04-23T19:22:54 | 130,266,757 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,775 | java | package com.example.sigit.test2;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import com.example.sigit.test2.GameObject;
import com.example.sigit.test2.Vector;
public class GameHUD implements GameObject {
private Rect rectangle; //hud location and size parameters
private Paint textPaint;//hud text paint
private int textColor; //hud text color
private int score=0; //game score
private Bitmap hudBackground;
private int lives =0;
public GameHUD(Rect rectangle, Context context)
{
//set loaction and color
this.rectangle = rectangle;
hudBackground = BitmapFactory.decodeResource(context.getResources(), R.drawable.hudbackground);
//create text paint and set its parameters
textColor = Color.rgb(255,0,0);
textPaint = new Paint();
textPaint.setColor(textColor);
textPaint.setAntiAlias(true);
textPaint.setTextSize(30);
}
@Override
public void draw(Canvas canvas)
{
canvas.drawBitmap(hudBackground, null, rectangle, null);
canvas.drawText("Points: " + score, rectangle.right-200,rectangle.bottom/4*2, textPaint);
canvas.drawText("Lives : " + lives, rectangle.right-200, rectangle.bottom/4*3, textPaint);
}
@Override
public void update() {
}
@Override
public Rect boundingRect()
{
return rectangle;
}
public void setScore(int score)
{
this.score = score;
}
public void setLives(int lives)
{
this.lives = lives;
}
}
| [
"ambrozaitis112@gmail.com"
] | ambrozaitis112@gmail.com |
26d99402b4ffb54adf58d06aad26e1add5cf22a2 | af8862d3831f4133f8e81d1b8931e1d44af073bb | /ranch-classify/src/test/java/org/lpw/ranch/classify/TestSupport.java | b35e0c51926cb73a713216678b7c72f8b15fbbe0 | [
"Apache-2.0"
] | permissive | Su-Git/ranch | 1b7776680111b81730bbff0df0485735c32bfc55 | 696cab2d5831aaab25cb0e47396b0c7b2a5d9720 | refs/heads/master | 2021-01-13T12:26:37.979603 | 2017-02-04T08:44:12 | 2017-02-04T08:44:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,622 | java | package org.lpw.ranch.classify;
import net.sf.json.JSONObject;
import org.junit.Assert;
import org.lpw.ranch.recycle.Recycle;
import org.lpw.tephra.cache.Cache;
import org.lpw.tephra.crypto.Sign;
import org.lpw.tephra.dao.orm.lite.LiteOrm;
import org.lpw.tephra.test.SchedulerAspect;
import org.lpw.tephra.test.TephraTestSupport;
import org.lpw.tephra.test.MockHelper;
import org.lpw.tephra.util.Converter;
import org.lpw.tephra.util.Generator;
import org.lpw.tephra.util.Message;
import javax.inject.Inject;
/**
* @author lpw
*/
public class TestSupport extends TephraTestSupport {
@Inject
Message message;
@Inject
Generator generator;
@Inject
Converter converter;
@Inject
Cache cache;
@Inject
LiteOrm liteOrm;
@Inject
Sign sign;
@Inject
MockHelper mockHelper;
@Inject
SchedulerAspect schedulerAspect;
@Inject
ClassifyService classifyService;
void equalsCodeName(JSONObject object, String code, String name) {
Assert.assertEquals(code, object.getString("code"));
Assert.assertEquals(name, object.getString("name"));
}
ClassifyModel create(int code, boolean recycle) {
return create(code, "label " + code, recycle);
}
ClassifyModel create(int code, String label, boolean recycle) {
ClassifyModel classify = new ClassifyModel();
classify.setCode("code " + code);
classify.setName("name " + code);
classify.setLabel(label);
classify.setRecycle((recycle ? Recycle.Yes : Recycle.No).getValue());
liteOrm.save(classify);
return classify;
}
}
| [
"heisedebaise@hotmail.com"
] | heisedebaise@hotmail.com |
7b759420d0eff7de254c5f06fb46654b5dc056b6 | a2d29af99e5920962de50ebf654c5a7443b6870e | /src/main/java/com/thoughtworks/services/UserService.java | 0921e651a4161e86826304a7cacf5aefd5210e12 | [] | no_license | syydas/java_practice_basic-account_management | 22d6432076db83d496f3046e844b357628027d41 | 3eb27427e3e04130fb69dde35f7521251a1bd9c4 | refs/heads/master | 2021-05-20T01:30:23.386592 | 2020-04-06T12:02:31 | 2020-04-06T12:02:31 | 252,128,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,818 | java | package com.thoughtworks.services;
import com.thoughtworks.entities.User;
import com.thoughtworks.repositories.UserRepository;
import com.thoughtworks.repositories.UserRepositoryI;
public class UserService implements UserServiceI {
private UserRepositoryI userRepository = new UserRepository();
@Override
public Boolean userRegister(User user) {
String checkInfo = checkRegisterInfo(user);
switch (checkInfo) {
case "register successful":
if (userRepository.userRegister(user)) {
System.out.println((String.format("%s,恭喜你注册成功!", user.getName())));
return true;
} else {
System.out.println("注册失败");
return false;
}
case "username wrong":
System.out.println(("用户名不合法\n请输入合法的注册信息:"));
return false;
case "telephone wrong":
System.out.println(("手机号不合法\n请输入合法的注册信息:"));
return false;
case "email wrong":
System.out.println(("邮箱不合法\n请输入合法的注册信息:"));
return false;
case "password wrong":
System.out.println(("密码不合法\n请输入合法的注册信息:"));
return false;
default:
return null;
}
}
public String checkRegisterInfo(User user) {
if (!isNameRight(user.getName())) {
return "username wrong";
} else if (!isPhoneNumberRight(user.getPhoneNumber())) {
return "telephone wrong";
} else if (!isEmailRight(user.getEmail())) {
return "email wrong";
} else if (!isPasswordRight(user.getPassword())) {
return "password wrong";
} else {
return "register successful";
}
}
@Override
public Boolean userLogin(String name, String password) {
if (isNameRight(name) && isPasswordRight(password)) {
User user = isUserExist(name);
if (user.getName() == null) {
System.out.println("密码或用户名错误\n请重新输入用户名和密码:");
return false;
} else {
if("locked".equals(user.getStatus())) {
System.out.println("您已3次输错密码,账号被锁定");
return false;
} else {
User user1 = userRepository.userLogin(name, password);
if (user1.getName() == null) {
if (user.getErrorNumber() == 2) {
updateErrorNumber(user.getName(), 0);
updateStatus(user.getName(), "locked");
System.out.println("您已3次输错密码,账号被锁定");
return false;
} else {
updateErrorNumber(name, user.getErrorNumber() + 1);
System.out.println("密码或用户名错误\n请重新输入用户名和密码:");
return false;
}
} else {
System.out.println(user.getName() + ",欢迎回来!\n您的手机号是" + user.getPhoneNumber() + ",邮箱是" + user.getEmail());
return true;
}
}
}
} else {
System.out.println("格式错误\n请按正确格式输入用户名和密码:");
return false;
}
}
@Override
public User isUserExist(String name) {
return userRepository.isUserExist(name);
}
@Override
public boolean isNameRight(String name) {
return name.length() > 2 && name.length() < 10;
}
@Override
public boolean isPhoneNumberRight(String phoneNumber) {
return (11 == phoneNumber.length()) && (phoneNumber.startsWith("1"));
}
@Override
public boolean isEmailRight(String email) {
return email.contains("@");
}
@Override
public boolean isPasswordRight(String password) {
return password.matches("^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$");
}
@Override
public void updateErrorNumber(String name, int errorNumber) {
userRepository.updateErrorNumber(name, errorNumber);
}
@Override
public void updateStatus(String name, String status) {
userRepository.updateStatus(name, status);
}
}
| [
"suqinzheng_0624@163.com"
] | suqinzheng_0624@163.com |
110d1b3aa07ab2e078c1f27622b91d63e5cb3f1c | 7e46013e44c2c0849145d1b99fb142d4415dd870 | /src/main/java/lazyload/Actor.java | ec1fbc97b4481b2fc8f40e848c154203696ecd2d | [] | no_license | NeverRaR/DesignPatterns | 6e0087e2a506d1c133bf59ddd5c1022500e3f903 | 9afdeb3fa7af63169449aa2e7e63589589ce8ad1 | refs/heads/master | 2023-01-28T23:22:58.094568 | 2020-11-28T15:40:20 | 2020-11-28T15:40:20 | 313,669,306 | 5 | 16 | null | 2020-11-28T15:40:21 | 2020-11-17T15:55:53 | Java | UTF-8 | Java | false | false | 469 | java | package lazyload;
public class Actor {
public Actor() {
System.out.println("(" + this.toString() + "): " + "Actor begin to prepare ! ");
try {
System.out.println("(" + this.toString() + "): " + " Actor is in preparation ......");
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("(" + this.toString() + "): " + "Actor is ready !");
}
}
| [
"rui2000666@gmail.com"
] | rui2000666@gmail.com |
0efd656254218a464ceae414887c016c748cfb7c | 7dc69b44030a522200402bb921675c9a5c2ba7f7 | /src/com/zing/dao/CustomDaoImpl.java | 9f8a80b9a7455b95c55c3330d4f234a599057809 | [] | no_license | Raremaa/sshStudyDemo | fceefb63c2a3514001b4d75fe31f80ac9f87ed66 | e7fab33194e9f8e0804f021a4b34261b20ca6c82 | refs/heads/master | 2020-03-19T08:05:36.623076 | 2018-06-06T07:58:36 | 2018-06-06T07:58:36 | 136,175,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,462 | java | package com.zing.dao;
import com.zing.pojo.Customer;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
import java.util.List;
//HibernateDaoSupport 为dao注入sessionFactory
public class CustomDaoImpl extends HibernateDaoSupport implements CustomDao{
@Override
//匿名内部类 要用id 声明为final
public Customer getById(final Long id) {
/*//HQL
return this.getHibernateTemplate().execute(new HibernateCallback<Customer>() {
@Override
public Customer doInHibernate(Session session) throws HibernateException {
String hql = "from Customer where cust_id = ?";
Query query = session.createQuery(hql);
query.setParameter(0,id);
Customer customer = (Customer) query.uniqueResult();
return customer;
}
});*/
//Criteria
DetachedCriteria dc = DetachedCriteria.forClass(Customer.class);
dc.add(Restrictions.eq("cust_id",id));
List<Customer> list = (List<Customer>) this.getHibernateTemplate().findByCriteria(dc);
if(list != null & list.size() >0){
return list.get(0);
}else{
return null;
}
}
@Override
public void save(Customer customer) {
this.getHibernateTemplate().save(customer);
}
}
| [
"masaiqi1996@icloud.com"
] | masaiqi1996@icloud.com |
0b59d550b0684304192a985a81c3cfc91d7f03c7 | b7ca4b7a3022f90e92c886e7824cbe5b0c96e110 | /Project2/src/sample/Duplicate.java | 35810c2185db6b8d40c2587206028865fea96a05 | [] | no_license | arandomcherry/Cherry-Programming-11 | 31aaf1d4ce29a7b292f41e784f0486fe29a56867 | 71c7bd7f83dbbe841eca0b5c1cf158520209394c | refs/heads/master | 2023-06-18T02:52:58.333233 | 2021-07-14T00:38:46 | 2021-07-14T00:38:46 | 282,088,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 826 | java | package sample;
import java.io.*;
public class Duplicate {
private int duplicatesNum;
//Requires: String
//Modifies: "Duplicates.txt"
//Effects: write the String entered to "Duplicates.txt"
public void writeToFile(String duplicate) throws IOException {
FileWriter fw = new FileWriter("Duplicates.txt");
BufferedWriter bw = new BufferedWriter(fw);
bw.write(duplicate);
bw.close();
}
//Requires: nothing
//Modifies: nothing
//Effects: get and return the value in "Duplicates.txt" in Integer form
public int getFromFile() throws IOException {
FileReader fr = new FileReader("Duplicates.txt");
BufferedReader br = new BufferedReader(fr);
duplicatesNum = Integer.parseInt(br.readLine());
return duplicatesNum;
}
}
| [
"68715029+arandomcherry@users.noreply.github.com"
] | 68715029+arandomcherry@users.noreply.github.com |
137eb7a647cc209e4b7688de73d1cb1d9b7808be | 4bedb1448340a6ef30dc8b660fb05eda70774579 | /eclipse-workspace/work/src/main/java/am/itu/qa/work/profile/FbProfile.java | 870efdc216889132002be53601eddb5b59c29018 | [] | no_license | SaTENIK91/web-com | ee892c0e9556bd602042933aed543ed5e10eada0 | 927b4f6c32fa5dc31fc4d29705ebe77592c9b7b1 | refs/heads/master | 2023-03-07T21:07:14.279905 | 2021-02-24T12:02:46 | 2021-02-24T12:02:46 | 337,695,668 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 514 | java | package am.itu.qa.work.profile;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import static am.itu.qa.work.page.main.WorkMainPageConstants.*;
import am.itu.qa.work.page.main.Registration;
public class FbProfile extends Registration {
public FbProfile(WebDriver driver) {
super(driver);
}
@FindBy(xpath = FACEBOOK_PROFILE)
WebElement facebookprof;
public void verifyFbProfile() {
facebookprof.isDisplayed();
}
}
| [
"melqonyan.satenik@gmail.com"
] | melqonyan.satenik@gmail.com |
a030f86209f78d2f2b6a7ce80fc8b54510a80c6a | 678de3b11eb0d9292eb52eb75f63115460fc02cb | /data/asia-tuning/ground-truth-codes/17/69924.java | 9a7b99241c375b5dbe60f2f1a056e4804c5292b5 | [] | no_license | ADANAPaper/replication_package | c531978931104fcae5e82fd27d7c3e47f4d748ab | 643e0cb9d42023dcc703a7c00af7627d9a08e720 | refs/heads/master | 2021-01-19T17:31:36.290361 | 2020-05-08T15:14:46 | 2020-05-08T15:14:46 | 101,067,182 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 323 | java | final OutputStream out = /* open your file using a FileOutputStream here */;
final byte[] buf = new byte[8096]; // size as appropriate
// "in" is the InputStream from the socket
int count;
try {
while ((count = in.read(buf)) != -1)
out.write(buf, 0, count);
out.flush();
} finally {
out.close();
};
| [
"Anonymous"
] | Anonymous |
d954ee166852ad7e063e31b3cf79bd13c877508f | f221c2e49affea38e59c56441a053f36693bfe82 | /app/src/main/java/com/aero/droid/dutyfree/talent/view/SpecialGoodsView.java | fb3fdc7201ffb6719c906de515f7b63700a5aa7b | [] | no_license | wangxp423/FreeMall | f39ded900a3b49c8c60553319ccf82f6cc94784f | b3d572deee13afd771d62470e3bf609fdb7e2092 | refs/heads/master | 2020-04-06T06:25:10.562265 | 2017-02-23T04:09:44 | 2017-02-23T04:09:44 | 82,882,256 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,135 | java | package com.aero.droid.dutyfree.talent.view;
import com.aero.droid.dutyfree.talent.bean.ActiveInfo;
import com.aero.droid.dutyfree.talent.bean.ComentsInfo;
import com.aero.droid.dutyfree.talent.bean.GoodComents;
import com.aero.droid.dutyfree.talent.bean.GoodsDetail;
import com.aero.droid.dutyfree.talent.bean.GoodsInfo;
import com.aero.droid.dutyfree.talent.view.base.BaseView;
import java.util.List;
/**
* Author : wangxp
* Date : 2015/12/14
* Desc : 商品(专场,专题,海报)列表页面(因为数据格式一样,操作大同小异,可以在presenter里面做处理)
*/
public interface SpecialGoodsView extends BaseView{
/**
* 显示商品列表
* @param activeInfo
*/
void showGoodsListData(ActiveInfo activeInfo);
/**
* 下拉 刷新更多数据
* @param goodsInfoList
*/
void refreshGoodsListData(List<GoodsDetail> goodsInfoList);
/**
* 上拉 加载更多数据
* @param goodsInfoList
*/
void loadGoodsListData(List<GoodsDetail> goodsInfoList);
/**
* 请求失败
* @param msg
*/
void requestError(String msg);
}
| [
"wangxiaopan@ihangmei.com"
] | wangxiaopan@ihangmei.com |
b500981f38032f4f75a75914171dd2f12bc894d4 | 7edc5150ed51eac3ee53ee382e159251c8eb2bc6 | /test/serviceLayerUnitTest/src/main/java/com/sample/app/controller/HomeController.java | 17622f159c8857a6c0e23a40cadde52be310d9c7 | [] | no_license | harikrishna553/springboot | 0f04574783f09d0c1a390c71ab7bf4724046ef01 | c0fbab7638fb2b0067f10c7d052c0d17e163219a | refs/heads/master | 2023-04-06T06:07:12.577923 | 2023-02-06T10:03:07 | 2023-02-06T10:03:07 | 195,366,097 | 19 | 58 | null | 2023-03-28T22:27:14 | 2019-07-05T07:58:55 | Java | UTF-8 | Java | false | false | 324 | java | package com.sample.app.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HomeController {
@RequestMapping("/")
public String homePage() {
return "Welcome to Spring boot Application Development";
}
}
| [
"hari.krishna.gurram@sap.com"
] | hari.krishna.gurram@sap.com |
1c06f4b51a677a1addec054b07061bbb1768c188 | 5bf1a83d176793c3dd74ae251c38dda7e666f550 | /lab6-end/src/main/java/jwd/wafepa/web/dto/LogDTO.java | e53d8c5e89e8185c49e1a50317325766813a21bf | [] | no_license | DraganU/Glavni-projekat | 7d02823ae83dceb2676075930f047674280f3e2b | af09fb29c96c043c760c725453ac888a6f3665a3 | refs/heads/master | 2021-01-10T17:08:02.847316 | 2016-01-24T18:07:35 | 2016-01-24T18:07:35 | 50,286,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,104 | java | package jwd.wafepa.web.dto;
import java.util.Date;
import jwd.wafepa.model.Log;
public class LogDTO {
private Long id;
private Date date;
private Integer duration;
private ActivityDTO activity;
private UserDTO user;
public LogDTO() {
}
public LogDTO(Log log){
this.id = log.getId();
this.date = log.getDate();
this.duration = log.getDuration();
this.activity = new ActivityDTO(log.getActivity());
this.user = new UserDTO(log.getUser());
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public ActivityDTO getActivity() {
return activity;
}
public void setActivity(ActivityDTO activity) {
this.activity = activity;
}
public UserDTO getUser() {
return user;
}
public void setUser(UserDTO user) {
this.user = user;
}
}
| [
"dragan.ujfalusi@gmail.com"
] | dragan.ujfalusi@gmail.com |
1c0b368a8f4f518d37783628a4b6ddf238cfeb0a | 45a50191e2ab03db4f2dc8311a0417bee9b51958 | /sushe/src/com/action/TBDel.java | 26e6f2a00b9d9dbabcfc1f95aa31a79e5e8990c3 | [] | no_license | haolei126/myproject | 80ce866fce65007c3fc3ea9114befb7860e29349 | fb65ed9badeda6ad188fb30cf855632dfad94652 | refs/heads/master | 2021-05-18T10:07:36.796706 | 2020-03-30T04:58:31 | 2020-03-30T04:58:31 | 251,204,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,796 | java | package com.action;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.bean.*;
import com.dao.*;
public class TBDel extends ActionSupport {
//下面是Action内用于封装用户请求参数的属性
private String TB_ID ;
public String getTB_ID() {
return TB_ID;
}
public void setTB_ID(String tBID) {
TB_ID = tBID;
}
private String Building_ID ;
public String getBuilding_ID() {
return Building_ID;
}
public void setBuilding_ID(String buildingID) {
Building_ID = buildingID;
}
//处理用户请求的execute方法
public String execute() throws Exception {
//解决乱码,用于页面输出
HttpServletResponse response=null;
response=ServletActionContext.getResponse();
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
//创建session对象
HttpSession session = ServletActionContext.getRequest().getSession();
//验证是否正常登录
if(session.getAttribute("id")==null){
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
out.flush();out.close();return null;
}
//删除
new TBDao().Delete("TB_ID="+TB_ID);
out.print("<script language='javascript'>window.location='TBManager.action?Building_ID="+Building_ID+"';</script>");
out.flush();out.close();return null;
}
//判断是否空值
private boolean isInvalid(String value) {
return (value == null || value.length() == 0);
}
//测试
public static void main(String[] args) {
System.out.println();
}
}
| [
"370540665@qq.com"
] | 370540665@qq.com |
cc5684ba9205232bb8752572af799382d4e30a4f | 5470325c7edfbfc63e50f9c72527b73b4160ba76 | /pao/src/Companie/service/RutaServiceSql.java | 176144c512ac06f8b8589a2a51e85766da55d9c4 | [] | no_license | MirunaCojocaru26/PAO | 241b8feb7261d5ffcc486b36ef54a7603ee9c78f | a172e691ab31ac651297b5ea2f62c69996a519a0 | refs/heads/master | 2020-05-03T09:24:37.371127 | 2019-06-04T06:26:22 | 2019-06-04T06:26:22 | 172,659,163 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,186 | java | package Companie.service;
import Companie.tool.Writer;
import java.sql.*;
public class RutaServiceSql {
public void programExcursii() {
Writer.getInstance().write("programExcursii, "+Thread.currentThread().getName()+", ");
try (Connection c = DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test", "Miruna", "parola");) {
int ok = 0;
PreparedStatement ps = c.prepareStatement("SELECT oras_plecare, oras_sosire FROM rute");
ResultSet rs = ps.executeQuery();
while (rs.next()) {
ok = 1;
System.out.println("Urmatoarea masina spre " + rs.getString(2) + " pleaca din " + rs.getString(1));
}
if (ok == 0)
System.out.println("Informatie indisponibila");
} catch (SQLException e) {
e.printStackTrace();
}
}
public void listaMasini() {
Writer.getInstance().write("listaMasini, "+Thread.currentThread().getName()+", ");
System.out.println("Marcile de masini de care dispunem:");
try (Connection c = DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test", "Miruna", "parola");) {
int ok = 0;
PreparedStatement ps = c.prepareStatement("SELECT marca_masina, model_masina FROM rute");
ResultSet rs = ps.executeQuery();
while (rs.next()) {
ok = 1;
System.out.println("Marca: " + rs.getString(1) + " Model: " + rs.getString(2));
}
if (ok == 0)
System.out.println("Informatie indisponibila");
} catch (SQLException e) {
e.printStackTrace();
}
}
public void soferTraseu() {
Writer.getInstance().write("soferTraseu, "+Thread.currentThread().getName()+", ");
try (Connection c = DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test", "Miruna", "parola");) {
int ok = 0;
PreparedStatement ps = c.prepareStatement("SELECT r.oras_plecare, r.oras_sosire,s.nume FROM rute r,soferi s where s.id=r.id_sofer");
ResultSet rs = ps.executeQuery();
while (rs.next()) {
ok = 1;
System.out.println("Pe traseul " + rs.getString(1) + " -> " + rs.getString(2) + " o sa il aveti ca sofer pe " + rs.getString(3));
}
if (ok == 0)
System.out.println("Informatie indisponibila");
} catch (SQLException e) {
e.printStackTrace();
}
}
public void cautLocuri(String nume) {
Writer.getInstance().write("cautLocuri, "+Thread.currentThread().getName()+", ");
try (Connection c = DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test", "Miruna", "parola");) {
int ok = 0;
PreparedStatement ps = c.prepareStatement("SELECT nr_locuri FROM rute WHERE oras_plecare=? OR oras_sosire=?");
ps.setString(1, nume);
ps.setString(2, nume);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
ok = 1;
System.out.println("Numarul de locuri de pe aceasta ruta sunt: " + rs.getInt(1));
}
if (ok == 0)
System.out.println("Acest oras nu se afla pe nici o ruta a companie noastre");
} catch (SQLException e) {
e.printStackTrace();
}
}
public void cautaAdresaDestinatie(String oras) {
Writer.getInstance().write("cautAdresaDestinatie, "+Thread.currentThread().getName()+", ");
try (Connection c = DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test", "Miruna", "parola");) {
int ok = 0;
PreparedStatement ps = c.prepareStatement("SELECT * FROM rute WHERE oras_plecare=? OR oras_sosire=?");
ps.setString(1, oras);
ps.setString(2, oras);
ResultSet rs = ps.executeQuery();
while (rs.next()) {
ok = 1;
if (rs.getString(3).equalsIgnoreCase(oras))
System.out.println("Strada " + rs.getString(4) + " Numarul " + rs.getInt(5) + " din Orasul " + rs.getString(6));
else
System.out.println("Strada " + rs.getString(1) + " Numarul " + rs.getInt(2) + " din Orasul " + rs.getString(3));
}
if (ok == 0)
System.out.println("Nu avem nici o calatorie planificata spre aceasta destinatie");
} catch (SQLException e) {
e.printStackTrace();
}
}
public void stergeRuta(String oras) {
Writer.getInstance().write("stergeRuta, "+Thread.currentThread().getName()+", ");
try (Connection c = DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test", "Miruna", "parola");) {
PreparedStatement ps=c.prepareStatement("DELETE FROM rute WHERE oras_plecare=? or oras_sosire=?;");
ps.setString(1, oras);
ps.setString(2, oras);
ps.executeUpdate();
System.out.println("Modificare realizata cu succes");
}
catch (SQLException e) {
e.printStackTrace();
}
}
} | [
"mirunacojocaru26@yahoo.com"
] | mirunacojocaru26@yahoo.com |
3f3b9becb82fefcdf9b4a4c25421f95d00b4e142 | b2c2690ef6d544129337fbc50d6276710e918694 | /app/src/main/java/ontime/app/model/usermain/OrderFinished.java | aa21fc8f9494bc9543bb87fafa7efbd048142b8d | [] | no_license | sumitkumarc/MyHotel | d889a2ff59e4e84ba4a9ee999571a93cf96a1184 | 08285735ac189917940d5ca2d896656b830a5eb5 | refs/heads/main | 2023-03-21T03:23:32.516120 | 2021-03-12T15:45:10 | 2021-03-12T15:45:10 | 347,116,182 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,791 | java | package ontime.app.model.usermain;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class OrderFinished {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("order_number")
@Expose
private String orderNumber;
@SerializedName("user_id")
@Expose
private Integer userId;
@SerializedName("restaurant_id")
@Expose
private Integer restaurantId;
@SerializedName("total_quantity")
@Expose
private String totalQuantity;
@SerializedName("total_price")
@Expose
private String totalPrice;
@SerializedName("payment_type")
@Expose
private String paymentType;
@SerializedName("delivery_type")
@Expose
private String deliveryType;
@SerializedName("app_commission")
@Expose
private String appCommission;
@SerializedName("site_commission_tax")
@Expose
private String siteCommissionTax;
@SerializedName("total_tax")
@Expose
private String totalTax;
@SerializedName("grand_total")
@Expose
private String grandTotal;
@SerializedName("payment_status")
@Expose
private String paymentStatus;
@SerializedName("order_status")
@Expose
private Integer orderStatus;
@SerializedName("delivery_status")
@Expose
private Integer deliveryStatus;
@SerializedName("delivery_time")
@Expose
private String deliveryTime;
@SerializedName("delivered_time")
@Expose
private String deliveredTime;
public String getDeliveredTime() {
return deliveredTime;
}
public void setDeliveredTime(String deliveredTime) {
this.deliveredTime = deliveredTime;
}
@SerializedName("countdown_time")
@Expose
private String countdownTime;
@SerializedName("created_at")
@Expose
private String createdAt;
@SerializedName("review")
@Expose
private UserReview review;
public UserReview getReview() {
return review;
}
public void setReview(UserReview review) {
this.review = review;
}
@SerializedName("order_detail")
@Expose
private List<UserCartItemDetail> orderDetail = null;
@SerializedName("restaurant")
@Expose
private Restaurant restaurant;
public Restaurant getRestaurant() {
return restaurant;
}
public void setRestaurant(Restaurant restaurant) {
this.restaurant = restaurant;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getRestaurantId() {
return restaurantId;
}
public void setRestaurantId(Integer restaurantId) {
this.restaurantId = restaurantId;
}
public String getTotalQuantity() {
return totalQuantity;
}
public void setTotalQuantity(String totalQuantity) {
this.totalQuantity = totalQuantity;
}
public String getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(String totalPrice) {
this.totalPrice = totalPrice;
}
public String getPaymentType() {
return paymentType;
}
public void setPaymentType(String paymentType) {
this.paymentType = paymentType;
}
public String getDeliveryType() {
return deliveryType;
}
public void setDeliveryType(String deliveryType) {
this.deliveryType = deliveryType;
}
public String getAppCommission() {
return appCommission;
}
public void setAppCommission(String appCommission) {
this.appCommission = appCommission;
}
public String getSiteCommissionTax() {
return siteCommissionTax;
}
public void setSiteCommissionTax(String siteCommissionTax) {
this.siteCommissionTax = siteCommissionTax;
}
public String getTotalTax() {
return totalTax;
}
public void setTotalTax(String totalTax) {
this.totalTax = totalTax;
}
public String getGrandTotal() {
return grandTotal;
}
public void setGrandTotal(String grandTotal) {
this.grandTotal = grandTotal;
}
public String getPaymentStatus() {
return paymentStatus;
}
public void setPaymentStatus(String paymentStatus) {
this.paymentStatus = paymentStatus;
}
public Integer getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(Integer orderStatus) {
this.orderStatus = orderStatus;
}
public Integer getDeliveryStatus() {
return deliveryStatus;
}
public void setDeliveryStatus(Integer deliveryStatus) {
this.deliveryStatus = deliveryStatus;
}
public String getDeliveryTime() {
return deliveryTime;
}
public void setDeliveryTime(String deliveryTime) {
this.deliveryTime = deliveryTime;
}
public String getCountdownTime() {
return countdownTime;
}
public void setCountdownTime(String countdownTime) {
this.countdownTime = countdownTime;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public List<UserCartItemDetail> getOrderDetail() {
return orderDetail;
}
public void setOrderDetail(List<UserCartItemDetail> orderDetail) {
this.orderDetail = orderDetail;
}
}
| [
"psumit88666@gmail.com"
] | psumit88666@gmail.com |
ab774ed1ee9a7057817ae8d5d2d93074604e57ba | 6b224c8c6fb185ac46852c420085355cb3933011 | /CookitRite/app/src/main/java/com/example/smartbwoy/cookitrite/Splashscreen.java | d88bce02ddff37e8eacef65896ca17afb25b36f7 | [] | no_license | gzx1005/AndroidStudioProjects | 8f078b3bdd8abc2e3bacb286555bce51734b2def | 4aa687bc5cf73bc685afec14af17ef4a1dc31f60 | refs/heads/master | 2020-04-28T09:23:36.171368 | 2018-10-29T01:50:21 | 2018-10-29T01:50:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,496 | java | package com.example.smartbwoy.cookitrite;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class Splashscreen extends AppCompatActivity {
private FirebaseAuth userAuth;
private FirebaseAuth.AuthStateListener firebaseListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
userAuth=FirebaseAuth.getInstance();
setContentView(R.layout.activity_splashscreen);
firebaseListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(FirebaseAuth firebaseAuth) {
FirebaseUser user= FirebaseAuth.getInstance().getCurrentUser();
if(user!=null) {
Intent intent = new Intent(getBaseContext(), ProfileActivity.class);
startActivity(intent);
finish();
return;
}
}
};
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
anim.reset();
RelativeLayout l=(RelativeLayout) findViewById(R.id.activity_splashscreen);
l.clearAnimation();
l.startAnimation(anim);
anim = AnimationUtils.loadAnimation(this, R.anim.translate);
anim.reset();
ImageView iv = (ImageView) findViewById(R.id.splash_image);
iv.clearAnimation();
iv.startAnimation(anim);
Thread myThread=new Thread(){
public void run(){
try {
sleep(3000);
Intent intent= new Intent(getApplicationContext(),MainActivity.class);
startActivity(intent);
finish();
}catch(InterruptedException e){
e.printStackTrace();
}
}
};
myThread.start();
}
@Override
protected void onStart() {
super.onStart();
userAuth.addAuthStateListener(firebaseListener);
}
@Override
protected void onStop() {
super.onStop();
userAuth.removeAuthStateListener(firebaseListener);
}
}
| [
"rrennie66@gmail.com"
] | rrennie66@gmail.com |
051198b96c90274e4d8a9bbe6bd5120552f54c62 | 2dee3d99067e1da2cabfd88e029af738937842ab | /AggregateService/src/main/java/com/revature/configserver/aggregateController.java | 4d45c17bbf110315bf80043ac4b07e12c61d754f | [] | no_license | jsyuille/cognizant | b681fd6d36f54cda944eb72b5f4ce465bdadb7ba | 941ee8939b219df21de0fc0cf52504ba5db9369c | refs/heads/master | 2021-02-26T11:39:14.134665 | 2020-03-06T21:59:06 | 2020-03-06T21:59:06 | 245,522,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 679 | java | package com.revature.configserver;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class aggregateController {
@Autowired
ExperimentClient expClient;
@Autowired
ConversionClient conversionClient;
@GetMapping("/api/experiment/**")
public ResponseEntity<Object> getExperiment(String subject, Double unit) {
Object e = expClient.getExperiment(subject);
e = conversionClient.convert(e, unit);
return ResponseEntity.ok(e);
}
}
| [
"Jesseyuille@yahoo.com"
] | Jesseyuille@yahoo.com |
d9190e0280b2d2b478dff67ea0e6e61132edeb73 | a3d41b62bd018896c8c0fd84aa9f620943346bf4 | /zbpub/src/main/java/com/zbxn/pub/frame/common/TranslucentHelper.java | d843f3130051b600637e04e59a1d4d422722fbf5 | [] | no_license | zhuanao/android_ZBXMOBILE | f4d73645affddbdd32672e740c36d8e3fbdc5fb8 | 8a0c758d77ac2cd3ce9dc3684e300beaa43950af | refs/heads/master | 2020-03-22T08:47:05.934380 | 2017-07-10T10:51:54 | 2017-07-10T10:51:54 | 139,790,670 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,769 | java | /**
* @since 2015-12-11
*/
package com.zbxn.pub.frame.common;
import android.app.Activity;
import com.zbxn.pub.R;
import utils.SystemBarTintManager;
/**
* 沉浸式状态栏
*
* @author GISirFive
* @since 2015-12-11 下午3:55:45
*/
public class TranslucentHelper {
private Activity mActivity;
private ITranslucent mTranslucentControl;
/** */
public TranslucentHelper(ITranslucent control) {
if (control == null)
return;
if (!(control instanceof Activity))
return;
this.mTranslucentControl = control;
this.mActivity = (Activity) control;
translucent();
}
/**
* 设置沉浸式状态栏
*
* @author GISirFive
*/
public void translucent() {
SystemBarTintManager.setTranslucentStatus(mActivity, true);
SystemBarTintManager tintManager = new SystemBarTintManager(mActivity);
// 上方状态栏
tintManager.setStatusBarTintEnabled(true);
int colorRes = mTranslucentControl.getTranslucentColorResource();
if (colorRes == 0)
colorRes = R.color.app_theme;
// 设置沉浸的颜色
tintManager.setStatusBarTintResource(colorRes);
}
/**
* 沉浸式状态栏
*
* @author GISirFive
* @since 2015-12-11 下午4:35:57
*/
public interface ITranslucent {
/**
* 是否使用沉浸式状态栏</br>
*
* @return false-不使用沉浸式状态栏
* @author GISirFive
*/
boolean translucent();
/**
* 获取/设置 沉浸式状态栏的背景色
*
* @return
* @author GISirFive
*/
int getTranslucentColorResource();
}
}
| [
"18410133533@163.com"
] | 18410133533@163.com |
2f89e752846f76affb1f5b808412960dd4d4b014 | 69abec40741e6c80a49c925699dfc081d4a3d242 | /IncompleteAutomataBasedModelChecking/CHIAReplacementChecker/src/test/java/it/polimi/replacementchecker/buchiaccepting/ReplacementChecker14Test.java | 28256f656cf68cf32c5dbd1bec0b5fbbec0e140a | [] | no_license | chdd/IncompleteAutomataBasedModelChecking | eb17b00c858477dda1bffafa1fb103ee88489c69 | 313d305ffe0c834edfaed024c314787030e9d33f | refs/heads/master | 2020-12-07T06:29:10.853555 | 2015-12-17T13:48:27 | 2015-12-17T13:48:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,598 | java | package it.polimi.replacementchecker.buchiaccepting;
import static org.junit.Assert.assertTrue;
import it.polimi.automata.BA;
import it.polimi.automata.IBA;
import it.polimi.automata.io.in.ClaimReader;
import it.polimi.automata.io.in.ModelReader;
import it.polimi.automata.io.out.ElementToStringTransformer;
import it.polimi.checker.Checker;
import it.polimi.checker.SatisfactionValue;
import it.polimi.checker.intersection.acceptingpolicies.AcceptingPolicy;
import it.polimi.checker.intersection.acceptingpolicies.AcceptingPolicy.AcceptingType;
import it.polimi.constraintcomputation.ConstraintGenerator;
import it.polimi.constraints.Constraint;
import it.polimi.constraints.components.Replacement;
import it.polimi.constraints.components.SubProperty;
import it.polimi.constraints.io.in.constraint.ConstraintReader;
import it.polimi.constraints.io.in.replacement.ReplacementReader;
import it.polimi.constraints.io.out.constraint.ConstraintToElementTransformer;
import it.polimi.replacementchecker.ReplacementChecker;
import java.io.File;
import javax.xml.parsers.ParserConfigurationException;
import org.junit.Before;
import org.junit.Test;
public class ReplacementChecker14Test {
private static final String path = "it.polimi.replacementchecker/";
private Constraint constraint;
private Replacement replacement;
private IBA refinement;
private BA claim;
private IBA model;
private AcceptingType acceptingPolicy;
@Before
public void setUp() throws Exception{
this.replacement = new ReplacementReader(new File(getClass().getClassLoader()
.getResource(path + "buchiaccepting/test14/replacement.xml").getFile())).perform();
this.constraint=new ConstraintReader(new File(getClass().getClassLoader()
.getResource(path + "buchiaccepting/test14/constraint.xml").getFile())).perform();
this.refinement=new ModelReader(new File(getClass().getClassLoader()
.getResource(path + "buchiaccepting/test14/refinement.xml").getFile())).perform();
this.claim=new ClaimReader(new File(getClass().getClassLoader()
.getResource(path + "buchiaccepting/test14/claim.xml").getFile())).perform();
this.model=new ModelReader(new File(getClass().getClassLoader()
.getResource(path + "buchiaccepting/test14/model.xml").getFile())).perform();
this.acceptingPolicy=AcceptingType.BA;
}
@Test
public void test() throws ParserConfigurationException, Exception {
Checker checker=new Checker(model, claim,
AcceptingPolicy.getAcceptingPolicy(this.acceptingPolicy, model, claim));
checker.perform();
System.out.println(checker.getUpperIntersectionBA());
ConstraintGenerator cg = new ConstraintGenerator(checker);
Constraint constraint = cg.perform();
System.out.println(new ElementToStringTransformer()
.transform(new ConstraintToElementTransformer()
.transform(constraint)));
checker=new Checker(refinement, claim,
AcceptingPolicy.getAcceptingPolicy(this.acceptingPolicy, refinement, claim));
SatisfactionValue ret=checker.perform();
assertTrue(ret==SatisfactionValue.SATISFIED);
SubProperty subproperty=this.constraint.getSubProperty(this.replacement.getModelState());
ReplacementChecker replacementChecker=new ReplacementChecker( replacement, subproperty,
AcceptingPolicy.getAcceptingPolicy(this.acceptingPolicy, replacement.getAutomaton(), subproperty.getAutomaton()));
SatisfactionValue retValue=replacementChecker.perform();
System.out.println(retValue);
System.out.println(replacementChecker.getLowerIntersectionBA());
assertTrue(retValue==SatisfactionValue.SATISFIED);
}
}
| [
"cla.menghi@gmail.com"
] | cla.menghi@gmail.com |
d0277e1472763a2f77bec45b42ead7416c486fc6 | 12c2a7d2ae2217703c8e6e03f0188bce6f851d51 | /ace-auth/ace-auth-common/src/main/java/com/ace/auth/common/package-info.java | 9665a98efc99287c8381884c280de2055a2fb6bd | [] | no_license | chendingying/ace-gelaili-craft | 024e05a8ef5d1db931ffe8adb67b75564a96ad23 | 3b622637ef77029e88a1d594da3a3b5e39bd4a1b | refs/heads/master | 2020-04-06T14:50:23.369141 | 2018-11-26T09:03:17 | 2018-11-26T09:03:17 | 157,556,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 28 | java | package com.ace.auth.common; | [
"chen@dingying.com"
] | chen@dingying.com |
c67b19b9b99e9cedba51b245e1655d4580bbd25e | fd936d633f172edddd657c3555279dd86a84f9a7 | /Recuperar_contra.java | 1635490234ed9a7f1ab72c69d7ef9972563e2c6c | [] | no_license | AnnaAngelP/encuentraMe | fb704717cf9a1657f30ca23d32b74df639b7bacf | c4263816381e0f7b429a1de61f180417f019c960 | refs/heads/master | 2020-04-06T17:11:35.345900 | 2018-11-15T07:40:18 | 2018-11-15T07:40:18 | 157,650,010 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,173 | java | package uno.prueba.sanchez.augusto.login;
import android.content.Intent;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkError;
import com.android.volley.NoConnectionError;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.ServerError;
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class Recuperar_contra extends AppCompatActivity implements Response.ErrorListener, Response.Listener<JSONObject> {
private String user;
private String passwd, passTo;
private String emailTo;
private EditText correoTo;
RequestQueue rqw;
JsonObjectRequest jsonOR;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recuperar_contra);
user="as7227050@gmail.com";
passwd="(Prueba961007)";
correoTo = (EditText) findViewById(R.id.Valcorreo);
rqw = Volley.newRequestQueue(this);
}
public void enviar(View view){
String c=correoTo.getText().toString();
if(c.length() > 0){
String url = "https://ingrid06.000webhostapp.com/ValidarCorreo.php?correo="+c;
System.out.println(url);
jsonOR = new JsonObjectRequest(Request.Method.GET, url, null, this, this);
rqw.add(jsonOR);
}
else {
Toast.makeText(getApplicationContext(),
"Por favor ingrese un correo",
Toast.LENGTH_LONG).show();
}
}
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "No se ha encontrado el correo " + error.getMessage(), Toast.LENGTH_SHORT).show();
if (error instanceof NetworkError) {
} else if (error instanceof ServerError) {
Toast.makeText(getApplicationContext(),
"Oops. Server error!",
Toast.LENGTH_LONG).show();
} else if (error instanceof AuthFailureError) {
Toast.makeText(getApplicationContext(),
"Oops. AuthFailureError!",
Toast.LENGTH_LONG).show();
} else if (error instanceof ParseError) {
Toast.makeText(getApplicationContext(),
"Oops. ParseError error! " + error.getMessage(),
Toast.LENGTH_LONG).show();
} else if (error instanceof NoConnectionError) {
Toast.makeText(getApplicationContext(),
"Oops. NoConnectionError error!",
Toast.LENGTH_LONG).show();
} else if (error instanceof TimeoutError) {
Toast.makeText(getApplicationContext(),
"Oops. Timeout error!",
Toast.LENGTH_LONG).show();
}
}
@Override
public void onResponse(JSONObject response) {
System.out.println("entro");
JSONArray jsonArray = null;
try {
jsonArray = response.getJSONArray("dato");
for (int i = 0; i < jsonArray.length(); i++) {
System.out.println("lenght: " + jsonArray.length());
JSONObject jsonObject = jsonArray.getJSONObject(i);
//nick = jsonObject.getString("nick");
emailTo = jsonObject.getString("correo");
passTo = jsonObject.getString("password");
if(passTo.compareTo("0")==0){
//no existe el correo
Toast.makeText(getApplicationContext(), "El correo ingresado no esta REGISTRADO ", Toast.LENGTH_SHORT).show();
}
else{
new MailJob(user, passwd).execute(
new MailJob.Mail(user, emailTo, "Recuperación de contraseña:", passTo)
);
Toast.makeText(getApplicationContext(), "La contraseña se te ha enviado a tu correo ", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(Recuperar_contra.this,MainActivity.class);
//intent.setAction(ET_correo.getText().toString());
//intent.setAction()
startActivity(intent);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
| [
"anahi.an.pe@gmail.com"
] | anahi.an.pe@gmail.com |
4a6d285a5e48cf37a692afd3b708d5f93f67b970 | 2f1da28b40beb47077f604c3f1998e480c5dd642 | /MaxHeap/src/com/company/Queue.java | 2b15abeacf0e2e2603d878c550d4d474d044effa | [] | no_license | hykruntoahead/Data-Structures | 5eb086441208b17bf9a032fae439032e329ee1ee | 73a5494035e721257f85c897083844f7fbeaa512 | refs/heads/master | 2020-03-21T12:15:02.291364 | 2018-07-31T07:16:38 | 2018-07-31T07:16:38 | 138,542,898 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 206 | java | package com.company;
public interface Queue<E> {
int getSize();
boolean isEmpty();
//入队
void enqueue(E e);
//出队
E dequeue();
//获取队首元素
E getFront();
}
| [
"heyukun@iaijian.com"
] | heyukun@iaijian.com |
f66f89ff4a1dbfbb8e7a8ee7236cc5f7bfe07163 | 9c3a6f4a81abfa320971c952e2f6eb2de5f83080 | /src/main/java/org/titmuss/softsqueeze/display/FrameE.java | 2201b530d72e912d05239d1333ad29b688243f65 | [] | no_license | StefanZoerner/softsqueeze3 | 611b70b96f39cddd899a36f5762a303d8f99e873 | a7ed0c392d48baf4ba4570ae9c13789b0cb0b398 | refs/heads/master | 2016-08-06T05:21:17.619207 | 2015-02-05T13:52:44 | 2015-02-05T13:52:44 | 30,354,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,261 | java | /*
* SoftSqueeze Copyright (c) 2004 Richard Titmuss
*
* This file is part of SoftSqueeze.
*
* SoftSqueeze is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SoftSqueeze 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 SoftSqueeze; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package org.titmuss.softsqueeze.display;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
/**
* @author Richard Titmuss
*
*/
public class FrameE implements Frame {
private byte frame[];
public FrameE(byte buf[], int offset, int len) {
frame = new byte[len];
System.arraycopy(buf, offset, frame, 0, len);
}
public void render(Graphics g, int width, int offset, Color color[]) {
Graphics2D g2 = (Graphics2D)g;
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 1.0f));
g2.fillRect(0, 0, LcdDisplay.SCREEN_WIDTH, LcdDisplay.SCREEN_HEIGHT);
g2.setComposite(AlphaComposite.Src);
g.setColor(color[3]);
int x = 0;
int end = Math.min( (offset + width)*4, frame.length);
for (int i = offset*4; i < end; ) {
int y = 0;
int pc = 0;
int py = 0;
for (int j = 0; j < 4; j++) {
byte dots = frame[i++];
for (int k = 7; k >= 0; k--, y++) {
int c = (dots >> k) & 0x01;
if (pc == c)
continue;
if (pc > 0) {
g.drawLine(x, py, x, y-1);
}
pc = c;
py = y;
}
}
if (pc > 0) {
g.drawLine(x, py, x, y-1);
}
x++;
}
}
}
| [
"stefan.zoerner@embarc.de"
] | stefan.zoerner@embarc.de |
0ee74dbbecb19a689d6ba159a7378fdf94b032c4 | bff449a67bde60eb42d58b6e81d592bccada40e5 | /InventoryBusiness/unittest/com/viettel/bccs/inventory/service/StockTransSerialOfflineServiceImplTest.java | a1dc4f548ad834f2fa73963bc622a9f5289a51ef | [] | no_license | tiendat182/IM_UNITTEST | 923be43427e2c47446462fef2c0d944bb7f9acce | 2eb4b9c11e236d09044b41dabf9529dc295cb476 | refs/heads/master | 2021-07-19T09:36:51.341386 | 2017-10-25T14:26:33 | 2017-10-25T14:26:33 | 108,283,748 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,982 | java | package com.viettel.bccs.inventory.service;
import com.google.common.collect.Lists;
import com.viettel.bccs.inventory.dto.StockTransSerialOfflineDTO;
import com.viettel.bccs.inventory.model.StockTransSerialOffline;
import com.viettel.bccs.inventory.repo.StockTransSerialOfflineRepo;
import com.viettel.fw.common.util.DbUtil;
import com.viettel.fw.common.util.extjs.FilterRequest;
import com.viettel.fw.common.util.mapper.BaseMapper;
import com.viettel.fw.service.BaseServiceImpl;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/**
* @author DatLT
* @date 12/10/2017
*/
@RunWith(PowerMockRunner.class)
@PowerMockIgnore("javax.management.*")
@PrepareForTest({DbUtil.class, StockTransSerialOfflineServiceImpl.class, BaseServiceImpl.class, StockTransSerialOfflineService.class})
public class StockTransSerialOfflineServiceImplTest {
@InjectMocks
StockTransSerialOfflineServiceImpl stockTransSerialOfflineService;
@Mock
private final BaseMapper<StockTransSerialOffline, StockTransSerialOfflineDTO> mapper = new BaseMapper<>(StockTransSerialOffline.class, StockTransSerialOfflineDTO.class);
@Mock
private StockTransSerialOfflineRepo repository;
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Before
public void initMocks() {
MockitoAnnotations.initMocks(this);
}
/**
* -----------------------------------------------------------------------------------------------------------------
* Test for method StockTransSerialOfflineServiceImpl.count
* -----------------------------------------------------------------------------------------------------------------
*
* @throws Exception
*/
@Test
public void testCount_1() throws Exception {
List<FilterRequest> filters = new ArrayList<>();
when(repository.count(any())).thenReturn(1L);
Assert.assertEquals(1L, stockTransSerialOfflineService.count(filters).longValue());
}
/**
* -----------------------------------------------------------------------------------------------------------------
* Test for method StockTransSerialOfflineServiceImpl.findOne
* -----------------------------------------------------------------------------------------------------------------
*
* @throws Exception
*/
@Test
public void testFindOne_1() throws Exception {
StockTransSerialOfflineServiceImpl spyService = PowerMockito.spy( stockTransSerialOfflineService);
StockTransSerialOffline stockTransSerialOffline = mock(StockTransSerialOffline.class);
StockTransSerialOfflineDTO stockTransSerialOfflineDTO = new StockTransSerialOfflineDTO();
Mockito.when(repository.findOne(anyLong())).thenReturn(stockTransSerialOffline);
setFinalStatic(StockTransSerialOfflineServiceImpl.class.getDeclaredField("mapper"), mapper, spyService);
when(mapper.toDtoBean(stockTransSerialOffline)).thenReturn(stockTransSerialOfflineDTO);
spyService.findOne(1L);
Assert.assertNotNull(stockTransSerialOfflineDTO);
}
/**
* -----------------------------------------------------------------------------------------------------------------
* Test for method StockTransSerialOfflineServiceImpl.findAll
* -----------------------------------------------------------------------------------------------------------------
*
* @throws Exception
*/
@Test
public void testFindAll_1() throws Exception {
StockTransSerialOfflineServiceImpl spyService = PowerMockito.spy( stockTransSerialOfflineService);
StockTransSerialOffline stockTransSerialOffline = mock(StockTransSerialOffline.class);
StockTransSerialOfflineDTO stockTransSerialOfflineDTO = new StockTransSerialOfflineDTO();
List<StockTransSerialOfflineDTO> stockTransSerialOfflineDTOList = Lists.newArrayList(stockTransSerialOfflineDTO);
List<StockTransSerialOffline> stockTransSerialOfflineList = Lists.newArrayList(stockTransSerialOffline);
Mockito.when(repository.findAll()).thenReturn(stockTransSerialOfflineList);
Mockito.when(mapper.toDtoBean(stockTransSerialOfflineList)).thenReturn(stockTransSerialOfflineDTOList);
setFinalStatic(StockTransSerialOfflineServiceImpl.class.getDeclaredField("mapper"), mapper, spyService);
spyService.findAll();
Assert.assertNotNull(stockTransSerialOfflineDTOList);
}
/**
* -----------------------------------------------------------------------------------------------------------------
* Test for method StockTransSerialOfflineServiceImpl.findByFilter
* -----------------------------------------------------------------------------------------------------------------
*
* @throws Exception
*/
@Test
public void testFindByFilter_1() throws Exception {
FilterRequest filterRequest = new FilterRequest();
List<FilterRequest> filterRequestList = Lists.newArrayList(filterRequest);
StockTransSerialOfflineServiceImpl spyService = PowerMockito.spy( stockTransSerialOfflineService);
StockTransSerialOffline stockTransSerialOffline = mock(StockTransSerialOffline.class);
StockTransSerialOfflineDTO stockTransSerialOfflineDTO = new StockTransSerialOfflineDTO();
List<StockTransSerialOfflineDTO> stockTransSerialOfflineDTOList = Lists.newArrayList(stockTransSerialOfflineDTO);
List<StockTransSerialOffline> stockTransSerialOfflineList = Lists.newArrayList(stockTransSerialOffline);
Mockito.when(mapper.toDtoBean(stockTransSerialOfflineList)).thenReturn(stockTransSerialOfflineDTOList);
setFinalStatic(StockTransSerialOfflineServiceImpl.class.getDeclaredField("mapper"), mapper, spyService);
spyService.findByFilter(filterRequestList);
}
/**
* -----------------------------------------------------------------------------------------------------------------
* Test for method StockTransSerialOfflineServiceImpl.create
* -----------------------------------------------------------------------------------------------------------------
*
* @throws Exception
*/
@Test(expected = Exception.class)
public void testCreate_1() throws Exception {
stockTransSerialOfflineService.create(new StockTransSerialOfflineDTO());
}
/**
* -----------------------------------------------------------------------------------------------------------------
* Test for method StockTransSerialOfflineServiceImpl.update
* -----------------------------------------------------------------------------------------------------------------
*
* @throws Exception
*/
@Test(expected = Exception.class)
public void testUpdate_1() throws Exception {
stockTransSerialOfflineService.update(new StockTransSerialOfflineDTO());
}
/**
* -----------------------------------------------------------------------------------------------------------------
* Test for method StockTransSerialOfflineServiceImpl.save
* -----------------------------------------------------------------------------------------------------------------
*
* @throws Exception
*/
@Test
public void testSave_1() throws Exception {
StockTransSerialOfflineDTO stockTransSerialOfflineDTO= new StockTransSerialOfflineDTO();
StockTransSerialOfflineServiceImpl spyService = PowerMockito.spy( stockTransSerialOfflineService);
setFinalStatic(StockTransSerialOfflineServiceImpl.class.getDeclaredField("mapper"), mapper, spyService);
when(mapper.toDtoBean(repository.save(mapper.toPersistenceBean(stockTransSerialOfflineDTO)))).thenReturn(stockTransSerialOfflineDTO);
spyService.save(stockTransSerialOfflineDTO);
}
static void setFinalStatic(Field field, Object newValue, final Object targetObject) throws Exception {
field.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(targetObject, newValue);
}
} | [
"tiendat.fet4@gmail.com"
] | tiendat.fet4@gmail.com |
f31d26e174da160b71b08149d361830e3b90874b | b104b5110806613749153a0d81d90f5520f6fc20 | /simple-spring/src/main/java/com/github/simple/core/annotation/SimpleConfig.java | a45eecc6dafcb9765cc30fca14494a3025282c94 | [] | no_license | RuoBingCoder/spring-boot-source-project-study-sample | d27e2aa3112fd3d1dd33eb30c88b6f4e6836ff29 | dc59c0bb953f6cdc9002db81d4b7e6715c3ce0cc | refs/heads/master | 2023-04-05T15:07:48.849394 | 2021-04-08T14:32:29 | 2021-04-08T14:32:29 | 298,938,563 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package com.github.simple.core.annotation;
import java.lang.annotation.*;
/**
* @author: JianLei
* @date: 2020/12/11 9:45 下午
* @description: SimpleAutowired
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface SimpleConfig {
String name() default "";
}
| [
"1664004642@qq.com"
] | 1664004642@qq.com |
6ab06d5ea82e1a69de2043c82c01f77579c831c9 | cdd1ca9f113bb478db5e331569fdb2f858fd43a8 | /src/main/java/me/rafique/openfire/auth/HybridAuthProvider.java | 101c7bc951f19bd8c8b8b4748a972c31350febfe | [] | no_license | rafique/openfire-keycloak-auth-provider- | 34a3d387054e0dd14fec00bbdd41c39ab3094e9d | fa3c09ea94b76e9ad8faaf414b84079c1e1ae1dd | refs/heads/master | 2023-08-10T03:18:15.672425 | 2018-03-11T10:12:08 | 2018-03-11T10:12:08 | 124,693,507 | 1 | 2 | null | 2023-07-26T08:26:28 | 2018-03-10T19:54:03 | Java | UTF-8 | Java | false | false | 10,377 | java | /*
* Copyright (C) 2005-2008 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.rafique.openfire.auth;
import java.util.HashSet;
import java.util.Set;
import org.jivesoftware.openfire.auth.AuthProvider;
import org.jivesoftware.openfire.auth.ConnectionException;
import org.jivesoftware.openfire.auth.InternalUnauthenticatedException;
import org.jivesoftware.openfire.auth.MappedAuthProvider;
import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.user.UserNotFoundException;
import org.jivesoftware.util.ClassUtils;
import org.jivesoftware.util.JiveGlobals;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The hybrid auth provider allows up to three AuthProvider implementations to
* be strung together to do chained authentication checking. The algorithm is as
* follows:
* <ol>
* <li>Attempt authentication using the primary provider. If that fails:
* <li>If the secondary provider is defined, attempt authentication (otherwise
* return). If that fails:
* <li>If the tertiary provider is defined, attempt authentication.
* </ol>
*
* This class related to, but is distinct from {@link MappedAuthProvider}. The
* Hybrid variant of the provider iterates over providers, operating on the
* first applicable instance. The Mapped variant, however, maps each user to
* exactly one provider.
*
* To enable this provider, set the <tt>provider.auth.className</tt> system
* property to <tt>org.jivesoftware.openfire.auth.HybridAuthProvider</tt>.
*
* The primary, secondary, and tertiary providers are configured be setting
* system properties similar to the following:
*
* <ul>
* <li><tt>hybridAuthProvider.primaryProvider = org.jivesoftware.openfire.auth.DefaultAuthProvider</tt></li>
* <li><tt>hybridAuthProvider.secondaryProvider = org.jivesoftware.openfire.auth.NativeAuthProvider</tt></li>
* </ul>
*
* Each of the chained providers can have a list of override users. If a user is
* in an override list, authentication will only be attempted with the
* associated provider (bypassing the chaining logic).
* <p>
*
* The full list of properties:
* <ul>
* <li><tt>hybridAuthProvider.primaryProvider.className</tt> (required) -- the
* class name of the auth provider.
* <li><tt>hybridAuthProvider.primaryProvider.overrideList</tt> -- a
* comma-delimitted list of usernames for which authentication will only be
* tried with this provider.
* <li><tt>hybridAuthProvider.secondaryProvider.className</tt> -- the class name
* of the auth provider.
* <li><tt>hybridAuthProvider.secondaryProvider.overrideList</tt> -- a
* comma-delimitted list of usernames for which authentication will only be
* tried with this provider.
* <li><tt>hybridAuthProvider.tertiaryProvider.className</tt> -- the class name
* of the auth provider.
* <li><tt>hybridAuthProvider.tertiaryProvider.overrideList</tt> -- a
* comma-delimitted list of usernames for which authentication will only be
* tried with this provider.
* </ul>
*
* The primary provider is required, but all other properties are optional. Each
* provider should be configured as it is normally, using whatever XML
* configuration options it specifies.
*
* @author Matt Tucker
*/
public class HybridAuthProvider implements AuthProvider {
private static final Logger Log = LoggerFactory.getLogger(HybridAuthProvider.class);
private AuthProvider primaryProvider;
private AuthProvider secondaryProvider;
private AuthProvider tertiaryProvider;
private Set<String> primaryOverrides = new HashSet<>();
private Set<String> secondaryOverrides = new HashSet<>();
private Set<String> tertiaryOverrides = new HashSet<>();
public HybridAuthProvider() {
// Convert XML based provider setup to Database based
JiveGlobals.migrateProperty("hybridAuthProvider.primaryProvider.className");
JiveGlobals.migrateProperty("hybridAuthProvider.secondaryProvider.className");
JiveGlobals.migrateProperty("hybridAuthProvider.tertiaryProvider.className");
JiveGlobals.migrateProperty("hybridAuthProvider.primaryProvider.overrideList");
JiveGlobals.migrateProperty("hybridAuthProvider.secondaryProvider.overrideList");
JiveGlobals.migrateProperty("hybridAuthProvider.tertiaryProvider.overrideList");
// Load primary, secondary, and tertiary auth providers.
String primaryClass = JiveGlobals.getProperty("hybridAuthProvider.primaryProvider.className");
if (primaryClass == null) {
Log.error("A primary AuthProvider must be specified. Authentication will be disabled.");
return;
}
try {
Class c = ClassUtils.forName(primaryClass);
primaryProvider = (AuthProvider) c.newInstance();
Log.debug("Primary auth provider: " + primaryClass);
} catch (Exception e) {
Log.error("Unable to load primary auth provider: " + primaryClass + ". Authentication will be disabled.",
e);
return;
}
String secondaryClass = JiveGlobals.getProperty("hybridAuthProvider.secondaryProvider.className");
if (secondaryClass != null) {
try {
Class c = ClassUtils.forName(secondaryClass);
secondaryProvider = (AuthProvider) c.newInstance();
Log.debug("Secondary auth provider: " + secondaryClass);
} catch (Exception e) {
Log.error("Unable to load secondary auth provider: " + secondaryClass, e);
}
}
String tertiaryClass = JiveGlobals.getProperty("hybridAuthProvider.tertiaryProvider.className");
if (tertiaryClass != null) {
try {
Class c = ClassUtils.forName(tertiaryClass);
tertiaryProvider = (AuthProvider) c.newInstance();
Log.debug("Tertiary auth provider: " + tertiaryClass);
} catch (Exception e) {
Log.error("Unable to load tertiary auth provider: " + tertiaryClass, e);
}
}
// Now, load any overrides.
String overrideList = JiveGlobals.getProperty("hybridAuthProvider.primaryProvider.overrideList", "");
for (String user : overrideList.split(",")) {
primaryOverrides.add(user.trim().toLowerCase());
}
if (secondaryProvider != null) {
overrideList = JiveGlobals.getProperty("hybridAuthProvider.secondaryProvider.overrideList", "");
for (String user : overrideList.split(",")) {
secondaryOverrides.add(user.trim().toLowerCase());
}
}
if (tertiaryProvider != null) {
overrideList = JiveGlobals.getProperty("hybridAuthProvider.tertiaryProvider.overrideList", "");
for (String user : overrideList.split(",")) {
tertiaryOverrides.add(user.trim().toLowerCase());
}
}
}
@Override
public void authenticate(String username, String password)
throws UnauthorizedException, ConnectionException, InternalUnauthenticatedException {
// Check overrides first.
if (primaryOverrides.contains(username.toLowerCase())) {
primaryProvider.authenticate(username, password);
return;
} else if (secondaryOverrides.contains(username.toLowerCase())) {
secondaryProvider.authenticate(username, password);
return;
} else if (tertiaryOverrides.contains(username.toLowerCase())) {
tertiaryProvider.authenticate(username, password);
return;
}
// Now perform normal
try {
primaryProvider.authenticate(username, password);
} catch (UnauthorizedException ue) {
if (secondaryProvider != null) {
try {
secondaryProvider.authenticate(username, password);
} catch (UnauthorizedException ue2) {
if (tertiaryProvider != null) {
tertiaryProvider.authenticate(username, password);
} else {
throw ue2;
}
}
} else {
throw ue;
}
}
}
@Override
public String getPassword(String username) throws UserNotFoundException, UnsupportedOperationException {
try {
return primaryProvider.getPassword(username);
} catch (UnsupportedOperationException | UserNotFoundException ue) {
if (secondaryProvider != null) {
try {
return secondaryProvider.getPassword(username);
} catch (UnsupportedOperationException | UserNotFoundException ue2) {
if (tertiaryProvider != null) {
return tertiaryProvider.getPassword(username);
} else {
throw ue2;
}
}
} else {
throw ue;
}
}
}
@Override
public void setPassword(String username, String password)
throws UserNotFoundException, UnsupportedOperationException {
try {
primaryProvider.setPassword(username, password);
} catch (UnsupportedOperationException | UserNotFoundException ue) {
if (secondaryProvider != null) {
try {
secondaryProvider.setPassword(username, password);
} catch (UnsupportedOperationException | UserNotFoundException ue2) {
if (tertiaryProvider != null) {
tertiaryProvider.setPassword(username, password);
} else {
throw ue2;
}
}
} else {
throw ue;
}
}
}
@Override
public boolean supportsPasswordRetrieval() {
return false;
}
@Override
public boolean isScramSupported() {
return false;
}
@Override
public String getSalt(String username) throws UnsupportedOperationException, UserNotFoundException {
throw new UnsupportedOperationException();
}
@Override
public int getIterations(String username) throws UnsupportedOperationException, UserNotFoundException {
throw new UnsupportedOperationException();
}
@Override
public String getServerKey(String username) throws UnsupportedOperationException, UserNotFoundException {
throw new UnsupportedOperationException();
}
@Override
public String getStoredKey(String username) throws UnsupportedOperationException, UserNotFoundException {
throw new UnsupportedOperationException();
}
boolean isProvider(final Class<? extends AuthProvider> clazz) {
return (primaryProvider != null && clazz.isAssignableFrom(primaryProvider.getClass()))
|| (secondaryProvider != null && clazz.isAssignableFrom(secondaryProvider.getClass()))
|| (tertiaryProvider != null && clazz.isAssignableFrom(tertiaryProvider.getClass()));
}
}
| [
"rafique.anwar@gmail.com"
] | rafique.anwar@gmail.com |
678c4135d91252a5a5768b41209defb36461d389 | 8a05bcb0be8aa539682f9bcd3d9a21388ec709ec | /bead/java_16171_bead1/biblio/Entry.java | 273634564b894a05dddb75a6110a74d44df7376a | [] | no_license | 8emi95/elte-ik-java | 9d97569bf8c8ecac499d1c97d924a46079fc7d5c | 7e2f83bd91f120dcd1df4cf8bbc44fe7438c6eca | refs/heads/master | 2020-07-25T09:10:53.906527 | 2019-03-16T19:34:08 | 2019-03-16T19:34:08 | 176,016,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,787 | java | package biblio;
import person.Author;
public class Entry {
private static int counter = 0;
private int id;
private Author author;
private String title;
private int year;
private String publisher;
private Entry(Author author, String title, int year, String publisher) {
this.id = counter;
++counter;
this.author = author;
this.title = title;
this.year = year;
this.publisher = publisher;
}
public static Entry make(Author author, String title, int year, String publisher) {
if (1500 <= year && year <= 2016 && author != null && !title.isEmpty()) {
Entry e = new Entry(author, title, year, publisher);
return e;
}
else {
return null;
}
}
public int getId() { return id; }
public static void resetId() { counter = 0; }
public static int count() { return counter; }
public Author getAuthor() { return author; }
public String getTitle() { return title; }
public int getYear() { return year; }
public String getPublisher() { return publisher; }
public static final int FORMAT_RAW = 0;
public static final int FORMAT_AUTHOR_YEAR = 1;
public static final int FORMAT_AUTHOR_YEAR_COMPACT = 2;
public String show(int format) {
String label = "";
if (format == FORMAT_RAW) {
label = "[" + id + "]";
}
else if (format == FORMAT_AUTHOR_YEAR) {
label = "[" + author.getLastName() + year + "]";
}
else if (format == FORMAT_AUTHOR_YEAR_COMPACT) {
label = "[" + author.getLastName().substring(0, 2) + Integer.toString(year).substring(2) + "]";
}
else {
throw new IllegalArgumentException("Wrong format.");
}
if (!publisher.isEmpty()) {
return (label + " " + author.show() + ". " + title + ", " + publisher + ", " + year);
}
else {
return (label + " " + author.show() + ". " + title + ", " + year);
}
}
} | [
"8emi95@inf.elte.hu"
] | 8emi95@inf.elte.hu |
cfafeeb0f52d8f58dcd79cb870eea5475097b47b | 0bd6dbef38689af817b757e2e222604bfe1f66e1 | /simple-cms-base/src/test/java/org/dtelaroli/simple/cms/base/component/RequestInfoTest.java | c953d32a8f7aa406b74cb2b1306def6ffd499a9e | [] | no_license | vasilhsfoto/simple-cms | c6b009a2dd964322061537693e8f4003c0887f97 | b883ee269a699113ad6e99dfdd874b2735c9ecaf | refs/heads/master | 2020-12-11T05:26:51.775307 | 2014-11-23T00:31:51 | 2014-11-23T00:31:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,949 | java | package org.dtelaroli.simple.cms.base.component;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.typeCompatibleWith;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.when;
import javax.servlet.ServletContext;
import org.dtelaroli.simple.cms.base.controller.MessageController;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import br.com.caelum.vraptor.controller.BeanClass;
import br.com.caelum.vraptor.controller.DefaultBeanClass;
import br.com.caelum.vraptor.controller.DefaultControllerMethod;
import br.com.caelum.vraptor.events.ControllerFound;
import br.com.caelum.vraptor.events.VRaptorInitialized;
public class RequestInfoTest {
private RequestInfo info;
@Mock private ControllerFound controllerFound;
private BeanClass controller;
private DefaultControllerMethod method;
@Mock private VRaptorInitialized vRaptorInitialized;
@Mock private ServletContext context;
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
controller = new DefaultBeanClass(MessageController.class);
method = new DefaultControllerMethod(controller, MessageController.class.getMethod("e500"));
when(controllerFound.getController()).thenReturn(controller);
when(controllerFound.getMethod()).thenReturn(method);
when(context.getContextPath()).thenReturn("context");
info = new RequestInfo();
}
@Test
public void shouldSetController() {
info.controllerFound(controllerFound);
assertThat(info.getController().getType(), typeCompatibleWith(MessageController.class));
}
@Test
public void shouldSetMethod() {
info.controllerFound(controllerFound);
assertThat(info.getAction(), equalTo("e500"));
}
@Test
public void shouldSetContext() {
info.initialized(vRaptorInitialized, context);
assertThat(info.getContextPath(), equalTo("context"));
}
}
| [
"ddts80@gmail.com"
] | ddts80@gmail.com |
38a26ffdbd3eb5fcfb1b90b3bbbce066a5b142ae | 2f9921194aea6b486e5e14a1c24397d9a1fe1009 | /app/src/main/java/com/example/morsetranslator/dairystudy.java | 79dfd76462d94af83ee6b8eb600b00ee128cd319 | [] | no_license | mvarma19/HAhaptics_sighted | e7324564e63dd348fc1f212c7861bc29dc75fa8b | 2d43942d38dbd0e53abb3bb694ea171416cd5abc | refs/heads/master | 2023-02-24T16:06:51.753388 | 2021-01-30T17:46:54 | 2021-01-30T17:46:54 | 314,895,859 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,542 | java | package com.example.morsetranslator;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import android.os.Vibrator;
import android.speech.tts.TextToSpeech;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import java.util.Calendar;
import java.util.Locale;
import java.util.Random;
import static com.example.morsetranslator.HAMorseCommon.user;
import static java.lang.Thread.*;
public class dairystudy extends AppCompatActivity {
Vibrator mvibrator;
Bundle bundle;
Button tv;
TextView pwTV;
TextView delTV;
TextView clrTV;
TextView conditionTV;
Button continue_trial;
//TextView enterTV;
TextView diary;
TextView duration_tv;
TextView interval_tv;
TextView testPWtv;
TextView trialTV;
String fileWriteString="";
Button change;
AlertDialog.Builder builder;
int duration=HABlindTutorial.duration;
int interval=HABlindTutorial.interval;
private TextToSpeech t2;
//String pwstore="";
//TextView conditionTV;
Random r = new Random();
static long startSleep = 0;//for start sleep time
int evalPW=0;
long startTime=0;
long down=0;
int trial=0;
public String pw="";
public int count=0;
int expCondition=HAMorseCommon.conditionArray[HAMorseCommon.conditionIndex];
static int conditionIndex=0;
public boolean touchevent=false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dairy);
mvibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
bundle=getIntent().getExtras();
retrieveItemsFromBundle();
tv = (Button) findViewById(R.id.tvb);
diary=(TextView)findViewById(R.id.ds);
testPWtv=(TextView) findViewById(R.id.testpw);
pwTV=(TextView) findViewById(R.id.input);
delTV=(TextView) findViewById(R.id.del);
clrTV=(TextView) findViewById(R.id.clr);
//enterTV=(TextView) findViewById(R.id.enter);
continue_trial=(Button)findViewById(R.id.continue_button);
trialTV=(TextView) findViewById(R.id.tvtrial);
trialTV.setText("Trial "+String.valueOf(trial)+"/3 ");
duration_tv=(TextView)findViewById(R.id.duration);
interval_tv=(TextView)findViewById(R.id.interval);
conditionTV=(TextView) findViewById(R.id.tvcondition);
duration_tv.setText("Vibration Duration: "+String.valueOf(duration)+"/100");
interval_tv.setText("Vibration Interval: "+String.valueOf(interval)+"/400");
change=(Button)findViewById(R.id.change_button);
builder = new AlertDialog.Builder(this);
change.setEnabled(false);
generateEvaluationPassword();
retrieveItemsFromBundle();
processTVPress(tv,0);
processTVPress(delTV,1);
processTVPress(clrTV,2);
//processTVPress(enterTV,3);
}
//final GestureDetector gdt = new GestureDetector(new enterPWtutorial());
private void generateEvaluationPassword(){
evalPW=r.nextInt(9999);
testPWtv.setText("Please Enter the PIN: "+String.format("%04d", evalPW));
}
public void processTVPress(final TextView t, final int t1) {
t.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction())
{
case MotionEvent.ACTION_DOWN:
Log.e("Tag","I am here!!");
if (t1==0) {
touchevent = true;
new Thread(new TouchVibe()).start();
}
// store += t.getText();
// input.setText(store);
break;
case MotionEvent.ACTION_MOVE:
//Log.d("Tag","ACTION MOVE");
//Log.d("Tag",String.valueOf("Move"));
//isMoving = true;
break;
case MotionEvent.ACTION_UP:
Log.d("TAG", "ACTION_UP");
if (t1==0) {
touchevent = false;
}
if (t1==1){
if (pw != null && pw.length() > 0) {
pw = pw.substring(0, pw.length() - 1);
}
pwTV.setText(pw);
}
if (t1==2){
pw="";
pwTV.setText(pw);
}
//
break;
}
return true;
}
});
if(expCondition==2) {
startSleep+= (new Random()).nextInt(100); //randomization
Log.d("Hi, I am condition 2,Start time is random here:",String.valueOf(startSleep));
}
if(expCondition==4) {
startSleep+= (new Random()).nextInt(100); //randomization
Log.d("Hi i am condition 4:Start time is random here:",String.valueOf(startSleep));
}
if(expCondition==3) {
interval+= (new Random()).nextInt(100);
Log.d("hi i am condition3,random interval is:", String.valueOf(interval));
}
if(expCondition==4) {
interval+= (new Random()).nextInt(100);
Log.d("hi i am condition4,random interval is:", String.valueOf(interval));
}
continue_trial.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (pw.equals(String.format("%04d", evalPW))) {
Log.e("Eval", String.valueOf(evalPW) + " CORRECT " + pw);
//return false;
} else {
Log.e("Eval", String.valueOf(evalPW) + " INCORRECT " + pw);
}
Log.e("Answers", "Empty Text lah");
builder.setMessage("Required PIN: " + String.format("%04d", evalPW) + "\nPIN you entered: " + pw)
.setPositiveButton("Okay!", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
generateEvaluationPassword();
pw = "";
pwTV.setText(pw);
//shifts=0;
trial++;
if (trial >= 3) {
HAMorseCommon.conditionIndex++;
Log.e("CONDITIONS:",String.valueOf(HAMorseCommon.conditionIndex));
HAMorseCommon.conditionIndex--;
addToBundleAndOpenActivity(Survey.class);
}
updateTV();
startTime = Calendar.getInstance().getTimeInMillis();
}
});
AlertDialog alert = builder.create();
//Setting the title manually
alert.setTitle("PIN information");
alert.show();
fileWriteString = "Result of trial no"+"," +trial+","+"Condition number"+","+expCondition+","+ "Required PIN" +","+ String.valueOf(evalPW) +","+"Start time was:"+","+ String.valueOf(startTime) +","+ "Calender date and time:" +","+ String.valueOf(Calendar.getInstance().getTimeInMillis()) +","+ "Required PIN"+","+ String.format("%04d", evalPW) +","+ "Entered PIN"+"," + pw +","+ "Date:" +","+ HAMorseCommon.dateTime() + "\n";
HAMorseCommon.writeAnswerToFile(getApplicationContext(), fileWriteString);
}
});
};
void addToBundleAndOpenActivity(Class cls){
Intent intent = new Intent(dairystudy.this, cls);
Bundle bundle=new Bundle();
bundle.putString("userName",user);
bundle.putInt("duration", duration);
bundle.putInt("interval", interval);
intent.putExtras(bundle);
startActivity(intent);
Log.e("SentBundle",String.valueOf(bundle));
}
void retrieveItemsFromBundle(){
if (bundle!=null) {
user=bundle.getString("userName");
duration=bundle.getInt("duration");
interval=bundle.getInt("interval");
}
}
private void updateTV() {
SystemClock.sleep(startSleep);
Log.e("system has slept for:",String.valueOf(startSleep));
trialTV.setText("Trial "+String.valueOf(trial+1)+"/3 ");
conditionTV.setText(" "+(String.valueOf(HAMorseCommon.conditionIndex+1))
+"/"+String.valueOf(HAMorseCommon.conditionArray.length)
+"("+String.valueOf(HAMorseCommon.conditionArray[HAMorseCommon.conditionIndex])+")");
}
void sendEmail(){
getIntent().addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); getIntent().addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
HAMorseCommon.sendEmail(this);
}
class TouchVibe implements Runnable {
@Override
public void run() {
down = System.currentTimeMillis();
while (touchevent){
if (Math.abs(down-System.currentTimeMillis())>interval && Math.abs(down-System.currentTimeMillis())>startSleep) {
Log.d(" and interval ", String.valueOf(interval));
down=System.currentTimeMillis();
mvibrator.vibrate(duration);
count++;
if (count==10 || count>10){
count=0;
}
}
}
updateTV();
if (!touchevent){
mvibrator.cancel();
Log.d("PW", String.valueOf(count));
pw=pw+String.valueOf(count);
pwTV.setText(pw);
count=0;
}
}
}
} | [
"mk2568@g.rit.edu"
] | mk2568@g.rit.edu |
3d6d3afdff1ec729c952dd7207c23fdb0df44c59 | 75c4712ae3f946db0c9196ee8307748231487e4b | /src/main/java/com/alipay/api/response/ZhimaDataStateDataSyncResponse.java | c80d5c15c2ede3643bb91f515aa4080f843a6ce9 | [
"Apache-2.0"
] | permissive | yuanbaoMarvin/alipay-sdk-java-all | 70a72a969f464d79c79d09af8b6b01fa177ac1be | 25f3003d820dbd0b73739d8e32a6093468d9ed92 | refs/heads/master | 2023-06-03T16:54:25.138471 | 2021-06-25T14:48:21 | 2021-06-25T14:48:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 687 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: zhima.data.state.data.sync response.
*
* @author auto create
* @since 1.0, 2021-05-17 10:40:01
*/
public class ZhimaDataStateDataSyncResponse extends AlipayResponse {
private static final long serialVersionUID = 1571172338697878273L;
/**
* 同步结果成功或失败,具体错误码在错误信息中
*/
@ApiField("biz_result")
private String bizResult;
public void setBizResult(String bizResult) {
this.bizResult = bizResult;
}
public String getBizResult( ) {
return this.bizResult;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
2b738e3c3dea0a1703c1cbb8a0dede5f4b7e59da | 16a2e514e014d1afd13f2cd5e0b5cf6029ba36bb | /dependencies/juddi/3.1.5-wso2v1/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/Transport.java | 8332404535eaaeb212df8a7be414a77e4a1a61b2 | [] | no_license | Vishanth/platform | 0386ee91c506703e0c256a0e318a88b268f76f6f | e5ac79db4820b88b739694ded697384854a3afba | refs/heads/master | 2020-12-25T12:08:05.306968 | 2014-03-03T06:08:57 | 2014-03-03T06:08:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,895 | java | /*
* Copyright 2001-2009 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.juddi.v3.client.transport;
import org.apache.juddi.v3_service.JUDDIApiPortType;
import org.uddi.v3_service.UDDICustodyTransferPortType;
import org.uddi.v3_service.UDDIInquiryPortType;
import org.uddi.v3_service.UDDIPublicationPortType;
import org.uddi.v3_service.UDDISecurityPortType;
import org.uddi.v3_service.UDDISubscriptionListenerPortType;
import org.uddi.v3_service.UDDISubscriptionPortType;;
public abstract class Transport {
public final static String DEFAULT_NODE_NAME = "default";
public abstract UDDIInquiryPortType getUDDIInquiryService(String enpointURL) throws TransportException;
public abstract UDDISecurityPortType getUDDISecurityService(String enpointURL) throws TransportException;
public abstract UDDIPublicationPortType getUDDIPublishService(String enpointURL) throws TransportException;
public abstract UDDISubscriptionPortType getUDDISubscriptionService(String enpointURL) throws TransportException;
public abstract UDDICustodyTransferPortType getUDDICustodyTransferService(String enpointURL) throws TransportException;
public abstract UDDISubscriptionListenerPortType getUDDISubscriptionListenerService(String enpointURL) throws TransportException;
public abstract JUDDIApiPortType getJUDDIApiService(String enpointURL) throws TransportException;
public UDDIInquiryPortType getUDDIInquiryService() throws TransportException {
return getUDDIInquiryService(null);
}
public UDDISecurityPortType getUDDISecurityService() throws TransportException {
return getUDDISecurityService(null);
}
public UDDIPublicationPortType getUDDIPublishService() throws TransportException {
return getUDDIPublishService(null);
}
public UDDISubscriptionPortType getUDDISubscriptionService() throws TransportException {
return getUDDISubscriptionService(null);
}
public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService() throws TransportException {
return getUDDISubscriptionListenerService(null);
}
public UDDICustodyTransferPortType getUDDICustodyTransferService() throws TransportException {
return getUDDICustodyTransferService(null);
}
public JUDDIApiPortType getJUDDIApiService() throws TransportException {
return getJUDDIApiService(null);
}
}
| [
"vijitha@wso2.com@a5903396-d722-0410-b921-86c7d4935375"
] | vijitha@wso2.com@a5903396-d722-0410-b921-86c7d4935375 |
7711f11a414555168fc32c674abcb952b741e9e9 | 80aeba93e490427042cf82b2d98abfc231a46748 | /base-api/src/main/java/com/intellij/lang/javascript/psi/JSFunctionExpression.java | 642cb1e60ea50c4a89ada2c83cb86c737ff0740f | [
"Apache-2.0"
] | permissive | ChenMingzhe/consulo-javascript | 3f721a5859e61ad2fc9e30758e7f2e05ff2c9b1c | 996c0f67eae8454caff22d836cee96aef6a98d8f | refs/heads/master | 2021-04-23T14:33:13.195754 | 2020-01-13T05:46:27 | 2020-01-13T05:46:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 876 | java | /*
* Copyright 2000-2005 JetBrains s.r.o.
*
* 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.intellij.lang.javascript.psi;
import javax.annotation.Nonnull;
/**
* @author max
* @since 7:42:48 PM Jan 30, 2005
*/
public interface JSFunctionExpression extends JSFunction, JSExpression
{
@Nonnull
default JSFunction getFunction()
{
return this;
}
}
| [
"vistall.valeriy@gmail.com"
] | vistall.valeriy@gmail.com |
715e693da7d8ba4defafce6f6d0710870cf94e49 | 4f581f41cc6c89b4d80fa8d55214ba9420980958 | /src/main/java/com/renatoviana/workshopmongo/repository/UserRepository.java | 6337cf15e3a0aac07f83a1f970290e8d0931cc0b | [] | no_license | renato-viana/workshop-spring-boot-mongodb | e176a1dfa2b27a2d61e660e3eef98f1ce7f4754f | 5fa86df3d3b8102268d695aa847027b6e49cd06f | refs/heads/master | 2022-01-22T21:04:24.889938 | 2019-08-11T17:24:52 | 2019-08-11T17:24:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package com.renatoviana.workshopmongo.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import com.renatoviana.workshopmongo.domain.User;
@Repository
public interface UserRepository extends MongoRepository<User, String> {
}
| [
"renatoviana30@gmail.com"
] | renatoviana30@gmail.com |
c5f1e76fe9b75e07d0b60ba11ac60d5bfc410d36 | 0233f5c32197321a06ac062863175383c190578b | /FruitSeller/src/com/robin/fruitseller/activity/SettingActivity.java | 2c7f8385f364f4822f62a5a59d9c33ded85a552c | [] | no_license | robinfjb/fruit-project | dac9f1dcfad5e3f9705345f1ec1480899b5cefcf | baf804ac1417a16464ad8277d3ec8132951bd17b | refs/heads/master | 2020-04-10T08:38:35.771710 | 2014-10-14T06:21:04 | 2014-10-14T06:21:04 | 21,381,871 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,784 | java | package com.robin.fruitseller.activity;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.robin.fruitlib.base.BaseActivity;
import com.robin.fruitlib.data.FruitPerference;
import com.robin.fruitlib.http.HttpException;
import com.robin.fruitlib.task.RGenericTask;
import com.robin.fruitlib.util.Utils;
import cn.sgone.fruitseller.R;
public class SettingActivity extends BaseActivity implements OnClickListener{
private ImageView backImg;
private LinearLayout aboutArea;
private RelativeLayout updateArea;
private LinearLayout intorduceArea;
private Button logoutBtn;
private TextView versionTxt;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setting);
backImg = (ImageView) findViewById(R.id.ivTitleBtnLeft);
backImg.setOnClickListener(this);
aboutArea = (LinearLayout) findViewById(R.id.about);
updateArea = (RelativeLayout) findViewById(R.id.update);
intorduceArea = (LinearLayout) findViewById(R.id.intorduce);
logoutBtn = (Button) findViewById(R.id.logout);
versionTxt = (TextView) findViewById(R.id.version_txt);
aboutArea.setOnClickListener(this);
updateArea.setOnClickListener(this);
intorduceArea.setOnClickListener(this);
logoutBtn.setOnClickListener(this);
if(!TextUtils.isEmpty(FruitPerference.getSellerMobile(this))) {
logoutBtn.setVisibility(View.VISIBLE);
} else {
logoutBtn.setVisibility(View.GONE);
}
versionTxt.setText(Utils.getVersionStr(this));
}
@Override
public void onClick(View v) {
int id = v.getId();
switch (id) {
case R.id.ivTitleBtnLeft:
setResult(Activity.RESULT_CANCELED);
finish();
overridePendingTransition(R.anim.page_enter, R.anim.page_exit);
break;
case R.id.about:
startActivity(new Intent(SettingActivity.this, AboutActivity.class));
((Activity) SettingActivity.this).overridePendingTransition(R.anim.home_enter, R.anim.home_exit);
break;
case R.id.update:
UpdateAppTask task = new UpdateAppTask(SettingActivity.this);
task.execute();
break;
case R.id.intorduce:
startActivity(new Intent(SettingActivity.this, FunctionActivity.class));
((Activity) SettingActivity.this).overridePendingTransition(R.anim.home_enter, R.anim.home_exit);
break;
case R.id.logout:
FruitPerference.removeSellerMobile(SettingActivity.this);
finish();
overridePendingTransition(R.anim.page_enter, R.anim.page_exit);
break;
}
}
@Override
public void onBackPressed() {
finish();
overridePendingTransition(R.anim.page_enter, R.anim.page_exit);
super.onBackPressed();
}
AlertDialog installBuilder;
private class UpdateAppTask extends RGenericTask<String> {
public UpdateAppTask(Context ctx) {
super(ctx);
// TODO Auto-generated constructor stub
}
@Override
protected String getContent() throws HttpException {
// TODO Auto-generated method stub
return null;
}
@Override
protected void onSuccess(final String result) {
if(!TextUtils.isEmpty(result)) {
installBuilder = new AlertDialog.Builder(getApplicationContext())
.setMessage(getString(R.string.app_update_msg))
.setTitle(getString(R.string.app_update_title))
.setPositiveButton(getString(R.string.confirm),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
Uri uri = Uri.parse(result);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
} catch (Exception e) {
// TODO: handle exception
}
}
})
.setNegativeButton(getString(R.string.cancel),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
installBuilder.dismiss();
}
}).create();
installBuilder.show();
} else {
Toast.makeText(SettingActivity.this, getString(R.string.app_update_warn), Toast.LENGTH_SHORT).show();
}
}
@Override
protected void onAnyError(int code, String msg) {
// TODO Auto-generated method stub
}
@Override
protected void onTaskBegin() {
// TODO Auto-generated method stub
}
@Override
protected void onTaskFinished() {
// TODO Auto-generated method stub
}
}
}
| [
"fjbperfect@163.com"
] | fjbperfect@163.com |
0945cbae2e09cf9927e642d8821a3c5ad37b300f | aa9d5ff23a74402dc42197f15ceebf3bb89607e6 | /posterita/posterita/src/main/org/posterita/core/businesslogic/ImportManager.java | abb1d3d79d3c82f58a752e6b56fec584b597adb4 | [] | no_license | vcappugi/ADESVENCA | ca4f2ef25a9bce7e633185936adc9154b9ea1829 | 92f9fa4556ee99b6961e4a8a66801bfa18d78086 | refs/heads/master | 2020-03-21T20:30:01.448421 | 2018-06-28T22:16:00 | 2018-06-28T22:16:00 | 139,011,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,513 | java | /**
* Product: Posterita Web-Based POS and Adempiere Plugin
* Copyright (C) 2007 Posterita Ltd
* This file is part of POSterita
*
* POSterita is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
**/
/**
@author ashley
*/
package org.posterita.core.businesslogic;
import java.io.File;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Properties;
import org.compiere.impexp.ImpFormat;
import org.compiere.process.ImportAccount;
import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.util.Trx;
import org.posterita.businesslogic.ProcessManager;
import org.posterita.core.FileManager;
import org.posterita.exceptions.OperationException;
public class ImportManager
{
public static int importFile(Properties ctx, File impFile, String importFormat, String trxName) throws OperationException
{
if(impFile == null)
throw new OperationException("File to import cannot be null");
if(!impFile.exists() || impFile.isDirectory())
throw new OperationException("File does not exist or it is a directory, file: " + impFile);
if(importFormat == null || importFormat.trim().length() == 0)
throw new OperationException("Import format cannot be null");
ImpFormat impFormat = ImpFormat.load(importFormat);
if(impFormat == null)
throw new OperationException("Could not load import format: " + importFormat);
ArrayList<String> fileLinesList = FileManager.readLines(impFile);
Iterator<String> fileLinesIter = fileLinesList.iterator();
int importedLines = 0;
while(fileLinesIter.hasNext())
{
String line = fileLinesIter.next();
if(impFormat.updateDB(ctx, line, trxName))
importedLines++;
}
return importedLines;
}
public static void importAccounting(Properties ctx, int clientId, int elementId, boolean updateDefaultAccounts, boolean createNewCombination, boolean deleteOldImported, String trxName) throws OperationException
{
ImportAccount impAccount = new ImportAccount();
int accountImportProcessId = ProcessManager.getProcessId(ImportAccount.class);
String updDefAccts = (updateDefaultAccounts) ? "Y" : "N";
String crNewCombinations = (createNewCombination) ? "Y" : "N";
String delOldImp = (deleteOldImported) ? "Y" : "N";
ProcessInfo processInfo = new ProcessInfo("Import accounts", accountImportProcessId);
ProcessInfoParameter clientParam = new ProcessInfoParameter("AD_Client_ID", new BigDecimal(clientId), new BigDecimal(clientId), "Client", "Client");
ProcessInfoParameter elementParam = new ProcessInfoParameter("C_Element_ID", new BigDecimal(elementId), new BigDecimal(elementId), "Element", "Element");
ProcessInfoParameter updDefAcctsParam = new ProcessInfoParameter("UpdateDefaultAccounts", updDefAccts, updDefAccts, "Update Default Accounts", "Update Default Accounts");
ProcessInfoParameter createNewCombinationParam = new ProcessInfoParameter("CreateNewCombination", crNewCombinations, crNewCombinations, "Create New Combination", "Create New Combination");
ProcessInfoParameter deleteOldParam = new ProcessInfoParameter("DeleteOldImported", delOldImp, delOldImp, "Delete Old Imported", "Delete Old Imported");
ProcessInfoParameter parameters[] = new ProcessInfoParameter[5];
parameters[0] = clientParam;
parameters[1] = elementParam;
parameters[2] = updDefAcctsParam;
parameters[3] = createNewCombinationParam;
parameters[4] = deleteOldParam;
processInfo.setParameter(parameters);
Trx trx = null;
if(trxName != null)
trx = Trx.get(trxName, false);
if(!impAccount.startProcess(ctx, processInfo, trx))
throw new OperationException("Could not run import accounting process");
}
}
| [
"vcappugi@gmail.com"
] | vcappugi@gmail.com |
e8397fa18fa8fb2770f588916a3adfa2afb2ab93 | 5d97703aa51a44f3bdba20ef0a3bf5d07581aa71 | /web_proj/src/main/java/com/supermarket/repos/ProductPreferencesRepo.java | 3a9316bc25676bb9931922e6505e8e78735dee0d | [] | no_license | StasMalikov/JavaUnivLabs | 840ceec1ea673155266d1d74b172afb0c73a052f | b93649f61b11f212255358f2cd5115022499172b | refs/heads/master | 2022-09-16T23:00:56.858410 | 2020-06-04T12:42:28 | 2020-06-04T12:42:28 | 239,687,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | package com.supermarket.repos;
import com.supermarket.domain.ProductPreferences;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ProductPreferencesRepo extends JpaRepository<ProductPreferences, Long> {
}
| [
"stas.malikov75@gmail.com"
] | stas.malikov75@gmail.com |
4953b8e6e5a7d3a488e3e78146c6904f4c3c0e44 | acbf353d394cb47069126448ee87117c1187a68c | /SpareTimePractice/src/data/reflection/ClassDemo.java | 1c52b9d1aeced431db034f5890909eb961d0655b | [] | no_license | shaowenhao/JAVASE_Practice | e62204657e20fe5d0f18a1bd4322e76f061129b5 | 4b67e76419aa58aff3167226bab3182f7aa74ac6 | refs/heads/master | 2020-06-04T12:58:31.939122 | 2020-01-13T13:53:00 | 2020-01-13T13:53:00 | 192,031,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,297 | java | package data.reflection;
public class ClassDemo {
public static void main(String[] args) throws ClassNotFoundException {
// 1 object name.getClass()
Employee employee = new Employee("Ryan", 31); //data.reflection.Employee
Class<?> classType = employee.getClass();
System.out.println(classType.getName());
// class name.class
Class<?> classType2 = Employee.class;
System.out.println(classType2.getName()); //data.reflection.Employee
// Class.forName()
Class<?> classType3 = Class.forName("data.reflection.Employee"); //data.reflection.Employee
System.out.println(classType3.getName());
Class<?> classType4 = int.class;
System.out.println(classType4.getName()); //int
Class<?> classType5 = Double.TYPE; //double
System.out.println(classType5.getName());
Class<?> classType6 = Double.class; //java.lang.Double
System.out.println(classType6.getName());
}
}
class Employee{
String name;
int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Employee(String name, int age) {
super();
this.name = name;
this.age = age;
}
} | [
"weshao@dv-weshao-1.dv.local"
] | weshao@dv-weshao-1.dv.local |
563dbb96aa44723944dbdb95303747bdbf2946e0 | f2356fc90471fd132cb8c74e503c889745985b53 | /SelectSubjectMS/SelectSubjectMS_web/src/main/java/com/qgx/selectSubjectMS/action/DeptHeadAction.java | fe6c5c07a88aaf643dfe6fa8fa4f638da8bcf363 | [] | no_license | goxcheer/SelectSubjectMS | 33daf9c8a4c265f864191f4164f78a4da1ea7f01 | 219198b276a4fce6348375ab7797a54188306f06 | refs/heads/master | 2020-03-19T19:34:47.724220 | 2018-08-06T02:11:42 | 2018-08-06T02:11:42 | 136,864,000 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 38,292 | java | package com.qgx.selectSubjectMS.action;
import java.io.File;
import java.io.FileInputStream;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.opensymphony.xwork2.ActionSupport;
import com.qgx.selectSubjectMS.entity.DeptHead;
import com.qgx.selectSubjectMS.entity.Major;
import com.qgx.selectSubjectMS.entity.SchoolClass;
import com.qgx.selectSubjectMS.entity.Setting;
import com.qgx.selectSubjectMS.entity.Student;
import com.qgx.selectSubjectMS.entity.Subject;
import com.qgx.selectSubjectMS.entity.Teacher;
import com.qgx.selectSubjectMS.entity.TeacherAssign;
import com.qgx.selectSubjectMS.entity.User;
import com.qgx.selectSubjectMS.entity.Yard;
import com.qgx.selectSubjectMS.service.ClassService;
import com.qgx.selectSubjectMS.service.DeptHeadService;
import com.qgx.selectSubjectMS.service.MajorService;
import com.qgx.selectSubjectMS.service.SelectSubjectService;
import com.qgx.selectSubjectMS.service.SettingService;
import com.qgx.selectSubjectMS.service.StudentService;
import com.qgx.selectSubjectMS.service.SubjectService;
import com.qgx.selectSubjectMS.service.TeacherAssignService;
import com.qgx.selectSubjectMS.service.TeacherService;
import com.qgx.selectSubjectMS.service.UserService;
import com.qgx.selectSubjectMS.utils.ExcelUtil;
import com.qgx.selectSubjectMS.utils.ResponseUtil;
import com.qgx.selectSubjectMS.utils.StringUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
@Controller
@Scope("protoType")
public class DeptHeadAction extends ActionSupport implements ServletRequestAware {
/**
*
*/
private static final long serialVersionUID = 1L;
private HttpServletRequest request;
private DeptHead deptHead;
@Resource
private DeptHeadService deptHeadService;
@Resource
private UserService userService;
@Resource
private SettingService settingService;
@Resource
private TeacherService teacherService;
@Resource
private StudentService studentService;
@Resource
private SubjectService subjectService;
@Resource
private MajorService majorService;
@Resource
private ClassService classService;
@Resource
private SelectSubjectService selectSubjectService;
@Resource
private TeacherAssignService teacherAssignService;
private Setting setting;
private User user;
private Teacher teacher;
private Student student;
private File teacherUploadFile;
private File studentUploadFile;
private Major major;
/*
* 修改个人信息
*/
public void updatePersonalInfo() throws Exception {
// 获取Session中的admin用户信息
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 修改信息
currentDeptHead.setRealName(deptHead.getRealName());
currentDeptHead.setPhone(deptHead.getPhone());
currentDeptHead.setEmail(deptHead.getEmail());
// 更新数据库的信息
deptHeadService.updateDeptHead(currentDeptHead);
// 更新Session中的信息
request.getSession().setAttribute("currentUser", currentDeptHead);
}
public void modifyPwd() throws Exception {
String password = request.getParameter("password");
String rePassword = request.getParameter("rePassword");
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 根据id查找数据库的用户
User user = userService.findUserById(currentDeptHead.getUser().getId());
JSONObject jsonObject = new JSONObject();
// 比较原密码是否正确
if (!user.getPassword().equals(StringUtil.encryptMd5(password))) {
jsonObject.put("result", "0");
jsonObject.put("message", "原密码输入不正确!");
} else {
user.setPassword(StringUtil.encryptMd5(rePassword));
userService.updateUser(user);
jsonObject.put("result", "1");
jsonObject.put("message", "修改成功!");
}
ResponseUtil.write(jsonObject.toString());
}
/*
* 更新时间设置
*/
public String updateSetting() throws Exception {
// session获取当前院系设置信息
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
Setting currentSetting = currentDeptHead.getYard().getSetting();
// 修改更改
currentSetting.setTeacherSetStartTime(setting.getTeacherSetStartTime());
currentSetting.setTeacherSetEndTime(setting.getTeacherSetEndTime());
currentSetting.setStudentSelectStartTime(setting.getStudentSelectStartTime());
currentSetting.setStudentSelectEndTime(setting.getStudentSelectEndTime());
currentSetting.setTeacherSelectStartTime(setting.getTeacherSelectStartTime());
currentSetting.setTeacherSelectEndTime(setting.getTeacherSelectEndTime());
currentSetting.setDeptHeadAdjustStartTime(setting.getDeptHeadAdjustStartTime());
currentSetting.setDeptHeadAdjustEndTime(setting.getDeptHeadAdjustEndTime());
// 更新数据库持久化数据
settingService.updateSetting(currentSetting);
// 还要更新Session缓存中的
currentDeptHead.getYard().setSetting(currentSetting);
request.getSession().setAttribute("currentUser", currentDeptHead);
request.setAttribute("flag", "update");
return "selectTime";
}
/*
* 更新限制设置
*/
public void updateLimit() throws Exception {
// session获取当前院系设置信息
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
Setting currentSetting = currentDeptHead.getYard().getSetting();
if (setting.getWarnNum() != null) {
currentSetting.setWarnNum(setting.getWarnNum());
}
if (setting.getMaxSelectNum() != null) {
currentSetting.setMaxSelectNum(setting.getMaxSelectNum());
}
if (setting.getMaxStuSelectNum() != null) {
currentSetting.setMaxStuSelectNum(setting.getMaxStuSelectNum());
}
if (setting.getMaxSetNum() != null) {
currentSetting.setMaxSetNum(setting.getMaxSetNum());
}
if (setting.getCurrentGrade() != null) {
currentSetting.setCurrentGrade(setting.getCurrentGrade());
}
settingService.updateSetting(currentSetting);
// 还要更新Session缓存中的
currentDeptHead.getYard().setSetting(currentSetting);
request.getSession().setAttribute("currentUser", currentDeptHead);
}
/*
* 系主任查看该学院下所有老师(可能带条件查询)
*
*/
public void teacherList() throws Exception {
// 获取页面的查询条件
Integer page = Integer.valueOf(request.getParameter("page"));
Integer rows = Integer.valueOf(request.getParameter("rows"));
String teacherName = request.getParameter("teacherName");
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 条件查询集合
List<Teacher> teacherList = teacherService.listTeacher(teacherName, currentDeptHead.getYard().getId(), page,
rows);
// 条件查询个数
int total = teacherService.countTeacher(teacherName, currentDeptHead.getYard().getId());
JSONObject result = new JSONObject();
JSONArray jsonArray = new JSONArray();
for (Teacher t : teacherList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("teacherId", t.getId());
jsonObject.put("yardId", t.getYard().getId());
jsonObject.put("yardName", t.getYard().getYardName());
jsonObject.put("realName", t.getRealName());
jsonObject.put("userName", t.getUser().getUserName());
jsonObject.put("password", t.getUser().getPassword());
jsonObject.put("sex", t.getSex());
jsonObject.put("phone", t.getPhone());
jsonObject.put("email", t.getEmail());
Integer setNum = subjectService.countSubjectByTeacherId(t.getId(), null, null, null);
jsonObject.put("setNum", setNum);
jsonObject.put("maxSetNum", currentDeptHead.getYard().getSetting().getMaxSetNum());
jsonArray.add(jsonObject);
}
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(result.toString());
}
// 添加教师
public void addTeacher() throws Exception {
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
User currentUser = userService.getUserByUserName(user.getUserName());
Integer flag = 0;
JSONObject result = new JSONObject();
if (currentUser == null) {
// 用户为空,表示不存在可以添加,先添加用户
user.setUserType("Teacher");
user.setPassword(StringUtil.encryptMd5(user.getPassword()));
userService.saveUser(user);
// 用户添加后需要获取数据库持久层的该用户,并放入系主任中(id相对应)
currentUser = userService.getUserByUserName(user.getUserName());
teacher.setUser(currentUser);
teacher.setYard(currentDeptHead.getYard()); // 完整对象放入系主任
teacherService.saveTeacher(teacher);
flag++;
}
result.put("num", flag);
result.put("type", "add");
ResponseUtil.write(result.toString());
}
// 修改老师
public void updateTeacher() throws Exception {
// 根据id查询数据库的当前对象
Teacher currentTeacher = teacherService.getTeacherById(teacher.getId());
currentTeacher.setRealName(teacher.getRealName());
currentTeacher.setSex(teacher.getSex());
currentTeacher.setPhone(teacher.getPhone());
currentTeacher.setEmail(teacher.getEmail());
if (!currentTeacher.getUser().getPassword().equals(user.getPassword())) {
currentTeacher.getUser().setPassword(StringUtil.encryptMd5(user.getPassword()));
}
teacherService.updateTeacher(currentTeacher);
JSONObject result = new JSONObject();
result.put("type", "update");
ResponseUtil.write(result.toString());
}
/*
* 删除教师
*/
public void deleteTeacher() throws Exception {
String[] ids = request.getParameter("delIds").split(",");
Integer delNums = teacherService.deleteTeacher(ids);
ResponseUtil.write(delNums.toString());
}
/*
* 导出教师(该院系下的)
*/
public void exportTeachers() throws Exception {
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 查询所有老师(该院系)
List<Teacher> teacherList = teacherService.listTeacherByYardId(currentDeptHead.getYard().getId());
// 创建工作簿
Workbook wb = new HSSFWorkbook();
String heads[] = { "序号", "账号", "姓名", "学院", "性别", "电话", "邮箱" };
Sheet sheet = wb.createSheet();
int rowIndex = 0; // 创建一个行索引
Row row = sheet.createRow(rowIndex++); // 创建第一行
for (int i = 0; i < heads.length; i++) {
row.createCell(i).setCellValue(heads[i]);
}
for (Teacher t : teacherList) {
row = sheet.createRow(rowIndex++);
row.createCell(0).setCellValue(rowIndex);
row.createCell(1).setCellValue(t.getUser().getUserName());
row.createCell(2).setCellValue(t.getRealName());
row.createCell(3).setCellValue(t.getYard().getYardName());
row.createCell(4).setCellValue(t.getSex());
row.createCell(5).setCellValue(t.getPhone());
row.createCell(6).setCellValue(t.getEmail());
}
ResponseUtil.export(wb, "teachers.xls");
}
/*
* 导入教师
*/
public void importTeachers() throws Exception {
HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(teacherUploadFile));
Sheet sheet = wb.getSheetAt(0);
int count = 0;
if (sheet != null) {
for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
Row row = sheet.getRow(rowIndex);
if (row == null) {
continue;
}
User user = new User();
user.setUserName(ExcelUtil.formatCell(row.getCell(0)));
User currentUser = userService.getUserByUserName(user.getUserName());
if (currentUser == null) {
user.setPassword(StringUtil.encryptMd5(ExcelUtil.formatCell(row.getCell(1))));
user.setUserType("Teacher");
Teacher teacher = new Teacher();
teacher.setRealName(ExcelUtil.formatCell(row.getCell(2)));
// 添加的老师必定是当前院系
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
teacher.setYard(currentDeptHead.getYard());
// 持久化老师及用户
userService.saveUser(user);
User savedUser = userService.getUserByUserName(user.getUserName());
teacher.setUser(savedUser);
teacher.setSex(ExcelUtil.formatCell(row.getCell(3)));
teacher.setPhone(ExcelUtil.formatCell(row.getCell(4)));
teacher.setEmail(ExcelUtil.formatCell(row.getCell(5)));
teacherService.saveTeacher(teacher);
count++;
} else
continue;
}
}
JSONObject result = new JSONObject();
result.put("num", count);
ResponseUtil.write(result.toString());
}
/*
* 系主任条件查询学生集合(默认为该院系下)
*/
public void studentList() throws Exception {
// 获取页面的查询条件
Integer page = Integer.valueOf(request.getParameter("page"));
Integer rows = Integer.valueOf(request.getParameter("rows"));
String studentName = request.getParameter("studentName");
String majorId = request.getParameter("majorId");
String classId = request.getParameter("classId");
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 条件查询集合
List<Student> studentList = studentService.listStudent(studentName, currentDeptHead.getYard().getId(), majorId,
classId, page, rows);
// 条件查询个数
int total = studentService.countStudent(studentName, currentDeptHead.getYard().getId(), majorId, classId);
JSONObject result = new JSONObject();
JSONArray jsonArray = new JSONArray();
for (Student s : studentList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("studentId", s.getId());
jsonObject.put("yardName", s.getSchoolClass().getMajor().getYard().getYardName());
jsonObject.put("majorId", s.getSchoolClass().getMajor().getId());
jsonObject.put("majorName", s.getSchoolClass().getMajor().getMajorName());
jsonObject.put("classId", s.getSchoolClass().getId());
jsonObject.put("className", s.getSchoolClass().getClassName());
jsonObject.put("realName", s.getRealName());
jsonObject.put("userName", s.getUser().getUserName());
jsonObject.put("password", s.getUser().getPassword());
jsonObject.put("sex", s.getSex());
jsonObject.put("phone", s.getPhone());
jsonObject.put("email", s.getEmail());
Integer selectSubjectNum = selectSubjectService.countSelectSubjectByStudentId(s.getId());
jsonObject.put("selectSubjectNum", selectSubjectNum);
jsonObject.put("graduateYear", s.getGraduateYear());
jsonArray.add(jsonObject);
}
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(result.toString());
}
/*
* 专业下拉框
*/
public void majorComboBox() throws Exception {
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
List<Major> majorList = majorService.ListMajor(currentDeptHead.getYard().getId());
JSONArray result = new JSONArray();
// 将请选择放进来
JSONObject firstObject = new JSONObject();
firstObject.put("majorId", "0");
firstObject.put("majorName", "请选择");
result.add(firstObject);
// 将院系放进去
for (Major m : majorList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("majorId", m.getId());
jsonObject.put("majorName", m.getMajorName());
result.add(jsonObject);
}
ResponseUtil.write(result.toString());
}
/*
* 班级下拉框二级联动
*/
public void classCombobox() throws Exception {
String majorId = request.getParameter("majorId");
List<SchoolClass> classList = classService.listClassByMajorId(majorId);
JSONArray result = new JSONArray();
JSONObject firstObject = new JSONObject();
firstObject.put("classId", "0");
firstObject.put("className", "请选择");
result.add(firstObject);
for (SchoolClass c : classList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("classId", c.getId());
jsonObject.put("className", c.getClassName());
result.add(jsonObject);
}
ResponseUtil.write(result.toString());
}
// 添加学生
public void addStudent() throws Exception {
String classId = request.getParameter("classId");
User currentUser = userService.getUserByUserName(user.getUserName());
Integer flag = 0;
JSONObject result = new JSONObject();
if (currentUser == null) {
// 用户为空,表示不存在可以添加,先添加用户
user.setUserType("Student");
user.setPassword(StringUtil.encryptMd5(user.getPassword()));
userService.saveUser(user);
// 用户添加后需要获取数据库持久层的该用户,并放入系主任中(id相对应)
currentUser = userService.getUserByUserName(user.getUserName());
student.setUser(currentUser);
SchoolClass currentClass = classService.getSchoolClassById(Long.valueOf(classId));
student.setSchoolClass(currentClass); // 完整对象放入学生
studentService.saveStudent(student);
flag++;
}
result.put("num", flag);
result.put("type", "add");
ResponseUtil.write(result.toString());
}
// 修改学生
public void updateStudent() throws Exception {
String classId = request.getParameter("classId");
// 根据id查询数据库的当前对象
Student currentStudent = studentService.getStudentById(student.getId());
currentStudent.setRealName(student.getRealName());
currentStudent.setSex(student.getSex());
currentStudent.setPhone(student.getPhone());
currentStudent.setEmail(student.getEmail());
currentStudent.setGraduateYear(student.getGraduateYear());
if (!currentStudent.getUser().getPassword().equals(user.getPassword())) {
currentStudent.getUser().setPassword(StringUtil.encryptMd5(user.getPassword()));
}
SchoolClass currentClass = classService.getSchoolClassById(Long.valueOf(classId));
currentStudent.setSchoolClass(currentClass);
studentService.updateStudent(currentStudent);
JSONObject result = new JSONObject();
result.put("type", "update");
ResponseUtil.write(result.toString());
}
/*
* 删除学生
*/
public void deleteStudent() throws Exception {
String[] ids = request.getParameter("delIds").split(",");
Integer delNums = studentService.deleteStudent(ids);
ResponseUtil.write(delNums.toString());
}
/*
* 导出学生(该院系下的)
*/
public void exportStudents() throws Exception {
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 查询所有学生(该院系)
List<Student> studentList = studentService.listStudentByYardId(currentDeptHead.getYard().getId());
// 创建工作簿
Workbook wb = new HSSFWorkbook();
String heads[] = { "序号", "账号", "姓名", "学院", "专业", "班级", "性别", "电话", "邮箱" };
Sheet sheet = wb.createSheet();
int rowIndex = 0; // 创建一个行索引
Row row = sheet.createRow(rowIndex++); // 创建第一行
for (int i = 0; i < heads.length; i++) {
row.createCell(i).setCellValue(heads[i]);
}
for (Student s : studentList) {
row = sheet.createRow(rowIndex++);
row.createCell(0).setCellValue(rowIndex - 1);
row.createCell(1).setCellValue(s.getUser().getUserName());
row.createCell(2).setCellValue(s.getRealName());
row.createCell(3).setCellValue(s.getSchoolClass().getMajor().getYard().getYardName());
row.createCell(4).setCellValue(s.getSchoolClass().getMajor().getMajorName());
row.createCell(5).setCellValue(s.getSchoolClass().getClassName());
row.createCell(6).setCellValue(s.getSex());
row.createCell(7).setCellValue(s.getPhone());
row.createCell(8).setCellValue(s.getEmail());
}
ResponseUtil.export(wb, "students.xls");
}
/*
* 导入学生
*/
public void importStudents() throws Exception {
HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(studentUploadFile));
Sheet sheet = wb.getSheetAt(0);
int count = 0;
if (sheet != null) {
for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
Row row = sheet.getRow(rowIndex);
if (row == null) {
continue;
}
User user = new User();
user.setUserName(ExcelUtil.formatCell(row.getCell(0)));
User currentUser = userService.getUserByUserName(user.getUserName());
if (currentUser == null) {
user.setPassword(StringUtil.encryptMd5(ExcelUtil.formatCell(row.getCell(1))));
user.setUserType("Student");
Student student = new Student();
student.setRealName(ExcelUtil.formatCell(row.getCell(2)));
// 判断专业班级是否匹配(匹配才允许插入)
SchoolClass currentClass = classService
.getSchoolClassByClassName(ExcelUtil.formatCell(row.getCell(5)));
if (currentClass.getMajor().getMajorName().equals(ExcelUtil.formatCell(row.getCell(4)))) {
// 专业和班级均匹配才可添加
// 持久化老师及用户
userService.saveUser(user);
User savedUser = userService.getUserByUserName(user.getUserName());
student.setUser(savedUser);
student.setSchoolClass(currentClass);
student.setSex(ExcelUtil.formatCell(row.getCell(3)));
student.setPhone(ExcelUtil.formatCell(row.getCell(6)));
student.setEmail(ExcelUtil.formatCell(row.getCell(7)));
student.setGraduateYear(ExcelUtil.formatCell(row.getCell(8)));
studentService.saveStudent(student);
count++;
}
} else
continue;
}
}
JSONObject result = new JSONObject();
result.put("num", count);
ResponseUtil.write(result.toString());
}
/*
* 带条件查询专业集合
*/
public void majorList() throws Exception {
Integer page = Integer.valueOf(request.getParameter("page"));
Integer rows = Integer.valueOf(request.getParameter("rows"));
String majorName = request.getParameter("majorName");
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 查询是在该院系为基础下
Integer total = majorService.countMajor(majorName, currentDeptHead.getYard().getId().toString());
List<Major> majorList = majorService.ListMajor(majorName, currentDeptHead.getYard().getId());
JSONObject result = new JSONObject();
JSONArray jsonArray = new JSONArray();
for (Major m : majorList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("majorId", m.getId());
jsonObject.put("yardName", m.getYard().getYardName());
jsonObject.put("majorName", m.getMajorName());
jsonObject.put("majorDesc", m.getMajorDesc());
jsonArray.add(jsonObject);
}
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(result.toString());
}
// 添加专业
public void addMajor() throws Exception {
// 专业相同时专业名相同并且所在院系也相同,此时不能填加
// 根据名称查询时,可能不止一个
List<Major> majorList = majorService.ListMajorByMajorName(major.getMajorName());
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
Integer flag = 0;
boolean isExist = false;
JSONObject result = new JSONObject();
for (Major m : majorList) {
if (m.getYard().getId() == currentDeptHead.getYard().getId()) {
flag = 0;
isExist = true; // 存在标识
}
}
if (!isExist) {
major.setYard(currentDeptHead.getYard());
majorService.saveMajor(major);
flag = 1;
}
result.put("num", flag);
result.put("type", "add");
ResponseUtil.write(result.toString());
}
// 修改专业
public void updateMajor() throws Exception {
// 专业相同时专业名相同并且所在院系也相同,此时不能修改
// 根据名称查询时,可能不止一个
List<Major> majorList = majorService.ListMajorByMajorName(major.getMajorName());
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
Major currentMajor = majorService.getMajorById(major.getId());
Integer flag = 0;
boolean isExist = false;
JSONObject result = new JSONObject();
// 当专业未改变时,即使一样也无所谓
if (currentMajor.getMajorName().equals(major.getMajorName())) {
currentMajor.setMajorName(major.getMajorName());
currentMajor.setMajorDesc(major.getMajorDesc());
majorService.updateMajor(currentMajor);
flag = 1;
} else {
for (Major m : majorList) {
if (m.getYard().getId() == currentDeptHead.getYard().getId()) {
flag = 0;
isExist = true; // 存在标识
}
}
if (!isExist) {
currentMajor.setMajorName(major.getMajorName());
currentMajor.setMajorDesc(major.getMajorDesc());
majorService.updateMajor(currentMajor);
flag = 1;
}
}
result.put("num", flag);
result.put("type", "update");
ResponseUtil.write(result.toString());
}
/*
* 删除专业
*/
public void deleteMajor() throws Exception {
String[] ids = request.getParameter("delIds").split(",");
Integer delNums = majorService.deleteMajor(ids);
ResponseUtil.write(delNums.toString());
}
/*
* 带条件查询班级集合
*/
public void classList() throws Exception {
Integer page = Integer.valueOf(request.getParameter("page"));
Integer rows = Integer.valueOf(request.getParameter("rows"));
String className = request.getParameter("className");
String majorId = request.getParameter("majorId");
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 查询是在该院系为基础下
Integer total = classService.countClass(className, majorId, currentDeptHead.getYard().getId());
List<SchoolClass> classList = classService.listClass(className, majorId, currentDeptHead.getYard().getId(),
page, rows);
JSONObject result = new JSONObject();
JSONArray jsonArray = new JSONArray();
for (SchoolClass s : classList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("classId", s.getId());
jsonObject.put("className", s.getClassName());
jsonObject.put("majorId", s.getMajor().getId());
jsonObject.put("majorName", s.getMajor().getMajorName());
Integer studentNum = studentService.countStudentByClassId(s.getId());
jsonObject.put("studentNum", studentNum);
jsonArray.add(jsonObject);
}
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(result.toString());
}
// 添加班级
public void addClass() throws Exception {
// 班级名称算的上唯一,不存在即可添加
String className = request.getParameter("className");
String majorId = request.getParameter("majorId");
Integer flag = 0;
SchoolClass schoolClass = classService.getSchoolClassByClassName(className);
if (schoolClass == null) {
Major currentMajor = majorService.getMajorById(Long.valueOf(majorId));
schoolClass = new SchoolClass();
schoolClass.setMajor(currentMajor);
schoolClass.setClassName(className);
classService.saveClass(schoolClass);
flag = 1;
}
JSONObject result = new JSONObject();
result.put("num", flag);
result.put("type", "add");
ResponseUtil.write(result.toString());
}
// 修改班级
public void updateClass() throws Exception {
// 班级修改后的信息存在,则不能修改
String className = request.getParameter("className");
String majorId = request.getParameter("majorId");
String classId = request.getParameter("classId");
SchoolClass currentSchoolClass = classService.getSchoolClassById(Long.valueOf(classId));
SchoolClass validateSC = classService.getSchoolClassByClassName(className);
Integer flag = 0;
// 有,并且不是原来的才不允许更新
if (validateSC != null && validateSC.getId() != currentSchoolClass.getId()) {
} else {
currentSchoolClass.setClassName(className);
classService.updateClass(currentSchoolClass);
flag = 1;
}
JSONObject result = new JSONObject();
result.put("num", flag);
result.put("type", "update");
ResponseUtil.write(result.toString());
}
/*
* 删除班级
*/
public void deleteClass() throws Exception {
String[] ids = request.getParameter("delIds").split(",");
Integer delNums = classService.deleteClass(ids);
ResponseUtil.write(delNums.toString());
}
/*
* 系主任查看所有题目
*/
public void subjectList() throws Exception {
// 获取分页查询的信息
Integer page = Integer.valueOf(request.getParameter("page"));
Integer rows = Integer.valueOf(request.getParameter("rows"));
// 获取条件查询的信息
String teacherName = request.getParameter("teacherName"); // 老师姓名
String title = request.getParameter("title"); // 标题
String direction = request.getParameter("direction"); // 方向
String state = request.getParameter("state"); // 审核状态
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
int total = subjectService.countSubject(teacherName, currentDeptHead.getYard().getId(), title, direction,
state); // 获取题目总数
List<Subject> subjectList = subjectService.listSubject(teacherName, currentDeptHead.getYard().getId(), title,
direction, state, page, rows);
JSONArray jsonArray = new JSONArray();
for (Subject s : subjectList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("subjectId", s.getId());
jsonObject.put("yardId", s.getTeacher().getYard().getId());
jsonObject.put("yardName", s.getTeacher().getYard().getYardName());
jsonObject.put("teacherName", s.getTeacher().getRealName());
jsonObject.put("title", s.getTitle());
Integer selectNum = selectSubjectService.countSelectStudentBySubjectId(s.getId());
jsonObject.put("selectNum", selectNum);
jsonObject.put("direction", s.getDirection());
jsonObject.put("state", s.getState());
String stateDesc = "";
switch (s.getState()) {
case "1":
stateDesc = "未审核";
jsonObject.put("examine", "进行审核");
break;
case "2":
stateDesc = "审核通过";
jsonObject.put("examine", "修改审核");
break;
case "3":
stateDesc = "审核未通过";
jsonObject.put("examine", "修改审核");
}
jsonObject.put("stateDesc", stateDesc);
jsonArray.add(jsonObject);
}
JSONObject result = new JSONObject();
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(result.toString());
}
/*
* 根据id异步获取当前选题的信息
*/
public void getSubjectById() throws Exception {
String subjectId = request.getParameter("subjectId");
Subject currentSubject = subjectService.getSubjectById(subjectId);
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setExcludes(new String[] { "teacher" });
ResponseUtil.write(JSONObject.fromObject(currentSubject, jsonConfig).toString());
}
/*
* 修改选题状态
*/
public void updateState() throws Exception {
String subjectId = request.getParameter("subjectId");
String state = request.getParameter("state");
Subject currentSubject = subjectService.getSubjectById(subjectId);
currentSubject.setState(state);
subjectService.updateSubject(currentSubject);
}
/*
* 未指派学生的题目
*/
public void unChooseSubjectList() throws Exception {
// 获取分页查询的信息
Integer page = Integer.valueOf(request.getParameter("page"));
Integer rows = Integer.valueOf(request.getParameter("rows"));
// 获取条件查询的信息
String teacherName = request.getParameter("teacherName"); // 老师姓名
String title = request.getParameter("title"); // 标题
String direction = request.getParameter("direction"); // 方向
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
int total = subjectService.countSubjectOfUnChoose(teacherName, currentDeptHead.getYard().getId(), title,
direction, "2"); // 获取题目总数
List<Subject> subjectList = subjectService.listSubjectOfUnChoose(teacherName, currentDeptHead.getYard().getId(),
title, direction, "2", page, rows);
JSONArray jsonArray = new JSONArray();
for (Subject s : subjectList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("subjectId", s.getId());
jsonObject.put("yardId", s.getTeacher().getYard().getId());
jsonObject.put("yardName", s.getTeacher().getYard().getYardName());
jsonObject.put("teacherName", s.getTeacher().getRealName());
jsonObject.put("title", s.getTitle());
jsonObject.put("direction", s.getDirection());
jsonArray.add(jsonObject);
}
JSONObject result = new JSONObject();
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(result.toString());
}
/*
* 未分配的学生
*/
public void unAssignStudentList() throws Exception {
// 获取页面的查询条件
Integer page = Integer.valueOf(request.getParameter("page"));
Integer rows = Integer.valueOf(request.getParameter("rows"));
String studentName = request.getParameter("studentName");
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 条件查询集合
List<Student> studentList = studentService.listStudentOfUnAssign(studentName, currentDeptHead.getYard().getId(),
page, rows);
// 条件查询个数
int total = studentService.countStudentOfUnAssign(studentName, currentDeptHead.getYard().getId());
JSONObject result = new JSONObject();
JSONArray jsonArray = new JSONArray();
for (Student s : studentList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("studentId", s.getId());
jsonObject.put("yardName", s.getSchoolClass().getMajor().getYard().getYardName());
jsonObject.put("majorId", s.getSchoolClass().getMajor().getId());
jsonObject.put("majorName", s.getSchoolClass().getMajor().getMajorName());
jsonObject.put("classId", s.getSchoolClass().getId());
jsonObject.put("className", s.getSchoolClass().getClassName());
jsonObject.put("realName", s.getRealName());
jsonObject.put("userName", s.getUser().getUserName());
jsonObject.put("sex", s.getSex());
jsonObject.put("phone", s.getPhone());
jsonObject.put("email", s.getEmail());
jsonArray.add(jsonObject);
}
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(result.toString());
}
/*
* 系主任落选指派
*/
public void assign() throws Exception {
String studentId = request.getParameter("studentId");
String subjectId = request.getParameter("subjectId");
TeacherAssign ta = new TeacherAssign();
ta.setStudent(studentService.getStudentById(Long.valueOf(studentId)));
ta.setSubject(subjectService.getSubjectById(subjectId));
teacherAssignService.saveOrUpdateAssign(ta);
JSONObject result = new JSONObject();
result.put("num", "1");
ResponseUtil.write(result.toString());
}
/*
* 最终结果
*/
public void finalResult() throws Exception {
// 获取页面的查询条件
Integer page = Integer.valueOf(request.getParameter("page"));
Integer rows = Integer.valueOf(request.getParameter("rows"));
// 最终结果也是基于本院系下的
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
List<TeacherAssign> taList = teacherAssignService.listTeacherAssignByYardId(currentDeptHead.getYard().getId(),
page, rows);
Integer total = teacherAssignService.countTeacherAssignByYardId(currentDeptHead.getYard().getId());
JSONObject result = new JSONObject();
JSONArray jsonArray = new JSONArray();
for (TeacherAssign ta : taList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("majorName", ta.getStudent().getSchoolClass().getMajor().getMajorName());
jsonObject.put("className", ta.getStudent().getSchoolClass().getClassName());
jsonObject.put("realName", ta.getStudent().getRealName());
jsonObject.put("title", ta.getSubject().getTitle());
jsonObject.put("direction", ta.getSubject().getDirection());
jsonArray.add(jsonObject);
}
result.put("rows", jsonArray);
result.put("total", total);
ResponseUtil.write(result.toString());
}
public void exportResult() throws Exception {
DeptHead currentDeptHead = (DeptHead) request.getSession().getAttribute("currentUser");
// 查询所有结果(该院下)
List<TeacherAssign> taList = teacherAssignService.listTeacherAssignByYardId(currentDeptHead.getYard().getId());
// 创建工作簿
Workbook wb = new HSSFWorkbook();
String heads[] = { "序号", "专业", "班级", "学生姓名", "题目名称", "方向"};
Sheet sheet = wb.createSheet();
int rowIndex = 0; // 创建一个行索引
Row row = sheet.createRow(rowIndex++); // 创建第一行
for (int i = 0; i < heads.length; i++) {
row.createCell(i).setCellValue(heads[i]);
}
for (TeacherAssign ta: taList) {
row = sheet.createRow(rowIndex++);
row.createCell(0).setCellValue(rowIndex - 1);
row.createCell(1).setCellValue(ta.getStudent().getSchoolClass().getMajor().getMajorName());
row.createCell(2).setCellValue(ta.getStudent().getSchoolClass().getClassName());
row.createCell(3).setCellValue(ta.getStudent().getRealName());
row.createCell(4).setCellValue(ta.getSubject().getTitle());
row.createCell(5).setCellValue(ta.getSubject().getDirection());
}
ResponseUtil.export(wb, "selectResult.xls");
}
@Override
public void setServletRequest(HttpServletRequest request) {
this.request = request;
}
public DeptHead getDeptHead() {
return deptHead;
}
public void setDeptHead(DeptHead deptHead) {
this.deptHead = deptHead;
}
public Setting getSetting() {
return setting;
}
public void setSetting(Setting setting) {
this.setting = setting;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Teacher getTeacher() {
return teacher;
}
public void setTeacher(Teacher teacher) {
this.teacher = teacher;
}
public Student getStudent() {
return student;
}
public void setStudent(Student student) {
this.student = student;
}
public File getTeacherUploadFile() {
return teacherUploadFile;
}
public void setTeacherUploadFile(File teacherUploadFile) {
this.teacherUploadFile = teacherUploadFile;
}
public File getStudentUploadFile() {
return studentUploadFile;
}
public void setStudentUploadFile(File studentUploadFile) {
this.studentUploadFile = studentUploadFile;
}
public Major getMajor() {
return major;
}
public void setMajor(Major major) {
this.major = major;
}
}
| [
"604721660@qq.com"
] | 604721660@qq.com |
49e9a971ef340d9b4f77bf87c411954554bc55e8 | ffcdad087974de4db9f7a8c2b9ca7d4bdb99b78b | /admin-common/src/main/java/com/djz/self/base/entity/BaseEntity.java | 04fe569440045c3f40d5446a08677db8572598e1 | [] | no_license | DongJianZheng/selfProject | 57d8b64a1065866007bd15dd477dbdc6d5b0f0ac | e43655709f76800506e5333a2d8fb4869d53d9c4 | refs/heads/master | 2022-12-22T02:32:35.810820 | 2020-04-23T12:26:14 | 2020-04-23T12:26:14 | 173,214,746 | 0 | 0 | null | 2022-12-16T04:45:29 | 2019-03-01T01:33:48 | JavaScript | UTF-8 | Java | false | false | 72 | java | package com.djz.self.base.entity;
public abstract class BaseEntity {
} | [
"1175639137@qq.com"
] | 1175639137@qq.com |
c164b86bfb77fd38ba42e73c0089156429ba736e | 06066b53acc1c5537855aaf44f9e119f714bc781 | /shopping/src/main/java/com/shopping/ServletInitializer.java | 82b2ed4c42ecf30239dde961c8de9df0a1e8d19e | [] | no_license | codegravityllc/shopping | b6a24a428ab46498f15725b02c2213e60c2a8986 | 44568b20960a48e5390f85ef869b5539d7a4ad23 | refs/heads/master | 2023-07-07T15:00:46.619410 | 2021-08-17T00:28:31 | 2021-08-17T00:28:31 | 388,195,620 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package com.shopping;
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(ShoppingApplication.class);
}
}
| [
"hem@codegravityit.com"
] | hem@codegravityit.com |
91d3a37d870af9e1689fee309af02221e1836ae7 | c0d16cb66653de974e9966760d0238d20ed3814d | /app/src/main/java/com/example/tokenretro/Api/ApiClient.java | 7351d2c5084c07c45216c127c639e1548af0a792 | [] | no_license | charlo2433/Token_Retrofit | 1c55cf081a3c1771675fd4375572c4061291c947 | 3c2242bbb6c41f4d7f8d436fe47932021e0f652c | refs/heads/master | 2020-08-24T18:58:16.080228 | 2019-10-22T18:52:01 | 2019-10-22T18:52:01 | 216,886,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,531 | java | package com.example.tokenretro.Api;
import android.util.Log;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import okhttp3.ConnectionPool;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ApiClient {
private static Retrofit retrofit;
private static final String BASE_URL = "http://coffeemateweb.herokuapp.com/";
public static Retrofit getRetrofitInstance() {
if (retrofit == null) {
retrofit = new retrofit2.Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.client(getUnsafeOkHttpClient())
.build();
}
return retrofit;
}
private static OkHttpClient getUnsafeOkHttpClient() {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(message -> Log.d("HTTP", "log: " + message));
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
Interceptor interceptor = chain -> {
final Request request = chain.request().newBuilder()
.build();
return chain.proceed(request);
};
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
}
};
// Install the all-trusting trust manager
final SSLContext sslContext = SSLContext.getInstance("SSL");
sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
// Create an ssl socket factory with our all-trusting manager
final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
ConnectionPool pool = new ConnectionPool(500, 600, TimeUnit.SECONDS);
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.sslSocketFactory(sslSocketFactory);
builder.hostnameVerifier((hostname, session) -> true);
builder.addInterceptor(interceptor);
builder.addInterceptor(logging);
builder.connectionPool(pool);
builder.readTimeout(600, TimeUnit.SECONDS);
builder.connectTimeout(600, TimeUnit.SECONDS);
return builder.build();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
| [
"you@example.com"
] | you@example.com |
672900e0f8c43c12ed2891500287f4d767efa6d9 | feeb5e7da92c595a1ee4ce8c26c47c1aac2a73c9 | /src/main/java/com/guoyi/jerkspace/web/rest/package-info.java | 2ff2462a6df76b72d0798266c5cb1bc77ab30d80 | [] | no_license | wangbl11/jerkSpace | b83b6ca23ec696c1600407c3842a9d0d4ec55452 | f69a3ce7773911f9db1c81b2bce2d4ab4448938e | refs/heads/master | 2020-03-19T11:52:04.794014 | 2018-06-18T22:13:10 | 2018-06-18T22:13:10 | 136,481,607 | 0 | 0 | null | 2018-06-18T22:13:11 | 2018-06-07T13:29:17 | Java | UTF-8 | Java | false | false | 78 | java | /**
* Spring MVC REST controllers.
*/
package com.guoyi.jerkspace.web.rest;
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
b5bbdbe5aa289364be5e09dba5095e017c6b8895 | 514a07dae305d39b9701a8390af373ffc321d026 | /app/src/main/java/com/wave/livedataexample/ui/MainActivity.java | 9f6531afd50b97aa8a58a1753bd814506be52061 | [] | no_license | oddEvenAndroid/LiveData-Easy-Example | 72cae17459393cbd9bf086ac86c817d5526bcc46 | 17cd86aac45e986b71674bcdcc5b2d19c4e15f54 | refs/heads/master | 2020-07-11T05:50:33.883564 | 2019-08-26T11:25:01 | 2019-08-26T11:25:01 | 204,460,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,923 | java | package com.wave.livedataexample.ui;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.wave.livedataexample.R;
import com.wave.livedataexample.model.Blog;
import com.wave.livedataexample.viewmodel.MainViewModel;
import java.util.List;
public class MainActivity extends AppCompatActivity {
RecyclerView mRecyclerView;
SwipeRefreshLayout swipeRefresh;
private MainViewModel mainViewModel;
BlogAdapter mBlogAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initializationViews();
mainViewModel = ViewModelProviders.of(this).get(MainViewModel.class);
getPopularBlog();
// lambda expression
swipeRefresh.setOnRefreshListener(() -> {
getPopularBlog();
});
}
private void initializationViews() {
swipeRefresh = findViewById(R.id.swiperefresh);
mRecyclerView = findViewById(R.id.blogRecyclerView);
}
public void getPopularBlog() {
swipeRefresh.setRefreshing(true);
mainViewModel.getAllBlog().observe(this, new Observer<List<Blog>>() {
@Override
public void onChanged(@Nullable List<Blog> blogList) {
swipeRefresh.setRefreshing(false);
prepareRecyclerView(blogList);
}
});
/**
* Replace this statement with lambda expression
* For using set you have to set following lines in app/build.gradle
// add below line
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// reduce line of code
mainViewModel.getAllBlog().observe(this, blogList -> prepareRecyclerView(blogList));
*/
}
private void prepareRecyclerView(List<Blog> blogList) {
mBlogAdapter = new BlogAdapter(blogList);
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
} else {
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 4));
}
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.setAdapter(mBlogAdapter);
mBlogAdapter.notifyDataSetChanged();
}
}
| [
"oddevenandriod@gmail.com"
] | oddevenandriod@gmail.com |
0403dbfbee1053ee43341152b5a2be390b731cfe | 7d753eb21b9355a84257f50642b55fe136155b18 | /src/main/java/com/unisound/dp/EditDistanceDp.java | 3ac9627275648a1c49f570cfd72ed8dfa4f0f23e | [] | no_license | humdingers/algorithm | e1097fe37224ed4226605454248a2d213bd893ed | 65f69de80eb682818b34d115c89cdffdf8a7dfd4 | refs/heads/master | 2020-12-07T14:11:14.775263 | 2020-06-08T10:27:13 | 2020-06-08T10:27:13 | 232,735,375 | 0 | 0 | null | 2020-10-13T18:44:03 | 2020-01-09T06:08:57 | Java | UTF-8 | Java | false | false | 1,092 | java | package com.unisound.dp;
//O(mn),两层循环显而易见
public class EditDistanceDp
{
public static int minDistance(String word1, String word2)
{
int m = word1.length();
int n = word2.length();
int[][] dp = new int[word1.length() + 1][word2.length() + 1];
for (int i = 0; i <= m; i++) {
dp[i][0] = i;
}
for (int j = 0; j <= n; j++) {
dp[0][j] = j;
}
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if (word1.charAt(i - 1) == word2.charAt(j - 1)) {
dp[i][j] = dp[i - 1][j - 1];
} else {
dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + 1);
}
}
}
return dp[m][n];
}
private static int min(int a, int b, int c)
{
return Math.min(a, Math.min(b, c));
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
}
}
| [
"lan1992s@163.com"
] | lan1992s@163.com |
a8b47d6aec60bd3bffe632f5479e5b8f78a3be7c | 9314391c0e8a1410304dcc6bb06eefeb657cc76a | /TE_aulas_horarios-master/TE_aulas_horarios-master/src/java/com/emergentes/modelo/Docente.java | 9101cf5ac1ebbce97db8abe487de5598cc256f93 | [] | no_license | SamuelCopa/PROYECTO-GESTION-DE-AULAS-Y-HORARIOS | c945d7dc0ded0b69bf1bb7b5875aa4c56aa0b7c1 | 83093208b1aaad4b1e41d5f6f27ba32e2d8ab8ce | refs/heads/master | 2023-06-10T12:42:37.513401 | 2021-06-29T21:21:55 | 2021-06-29T21:21:55 | 381,497,450 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 791 | java | package com.emergentes.modelo;
public class Docente {
private int id;
private String nombre;
private String apellidos;
private String grado_estudio;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getApellidos() {
return apellidos;
}
public void setApellidos(String apellidos) {
this.apellidos = apellidos;
}
public String getGrado_estudio() {
return grado_estudio;
}
public void setGrado_estudio(String grado_estudio) {
this.grado_estudio = grado_estudio;
}
}
| [
"copasamuel059@gmail.com"
] | copasamuel059@gmail.com |
7ebb1ae4e6ff65e0330329f7acdc60d981f48062 | a1ed06756d8519a5165202ee9d5ae9c489f9abeb | /src/main/java/com/xml2j/Xml2jModule.java | fb15d756034d76a6814a37810d52b157d80e4fad | [
"MIT"
] | permissive | Kriengkrai/xml2j-gen | ba4476af5bc9a814691a73d4c01d70adf9f344f9 | ecd6824a64b3e69252ae12708ae82c67b5a52dfd | refs/heads/master | 2020-04-28T20:56:33.182821 | 2018-04-29T10:10:59 | 2018-04-29T10:10:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,015 | java | package com.xml2j;
/********************************************************************************
Copyright 2016, 2017 Lolke B. Dijkstra
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project root: https://sourceforge.net/projects/xml2j/
********************************************************************************/
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
public class Xml2jModule {
public String name = null;
public String description = null;
public String input_path = null;
public String output_path = null;
int currInterface = -1;
List<Xml2jInterface> intl = new ArrayList<Xml2jInterface>();
public List<Xml2jInterface> interfaces() {
return intl;
}
public void add(final Xml2jInterface iface) {
currInterface++;
intl.add(iface);
}
public void print(final PrintStream s) {
s.println("\nxml2j-module" + "\n\tname: " + name + "\n\tinput-path: " + input_path + "\n\toutput-path: " + output_path);
for (Xml2jInterface i : intl) {
i.print(s);
}
}
}
| [
"lolkedijkstra@gmail.com"
] | lolkedijkstra@gmail.com |
58682ebbdf2d6681e05d0a9febf65cdf8eb6466b | 1f5082a924dca1a60b79a3ce4a74e953916898af | /src/main/java/com/adcc/io/netty/TcpClientHandler.java | 786f757e01646ccf37db20abda4d987380a2b46e | [] | no_license | TomZhang322/NettyDemo | 022fcb71905302d6f0b8a83d1f55b67fd013ab25 | e3dead423aac3ab519db714d4837a43d4518dd47 | refs/heads/master | 2021-06-23T05:00:32.864202 | 2017-08-22T03:24:20 | 2017-08-22T03:24:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 636 | java | package com.adcc.io.netty;
import org.apache.log4j.Logger;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
public class TcpClientHandler extends SimpleChannelInboundHandler<Object> {
private static final Logger logger = Logger.getLogger(TcpClientHandler.class);
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg)
throws Exception {
//messageReceived方法,名称很别扭,像是一个内部方法.
logger.info("client接收到服务器返回的消息:"+msg);
}
}
| [
"1553431610@qq.com"
] | 1553431610@qq.com |
545e88bda64323bfa8e24b6ed929bdee8ed68b03 | 359cb9487ff89cedcc3c1d2328fa2dab6a5392e9 | /03. Exams/01. Exam/src/main/java/myexam/service/ProductService.java | f822312b835bf6e2564cfee1e5d5691b62bd2c5a | [] | no_license | AndreyKost/Spring-Fundamentals | 6ed8789a5c4fa5d7c004f7dab06f61d2a636cf90 | 4e4cadf518000785a16ffb28e10fb4f4c1cdb097 | refs/heads/master | 2022-12-19T06:07:16.367229 | 2020-09-26T08:26:48 | 2020-09-26T08:26:48 | 298,768,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 558 | java | package myexam.service;
import myexam.model.entity.CategoryName;
import myexam.model.service.ProductServiceModel;
import myexam.model.view.ProductViewModel;
import java.math.BigDecimal;
import java.util.List;
public interface ProductService {
List<ProductViewModel> findAllProducts();
BigDecimal findAllProductsPriceCount();
void addItem(ProductServiceModel productServiceModel);
ProductViewModel findById(String id);
void delete(String id);
List<ProductViewModel> getProducts(CategoryName category);
void buyAll();
}
| [
"anddy8@gmail.com"
] | anddy8@gmail.com |
85fa1c939f8a4f04535fbbeef6fb4b46953f2599 | 833b750d24fb98a106610dd82a16c720aec604f2 | /commonstruct-core/src/main/java/com/github/frajimiba/commonstruct/validation/SatisfiedByValidator.java | 73144d48ac847bd77918f12e3f6fa4d1278d9ce6 | [] | no_license | frajimiba/commonstruct | b532f3118a75ab3331af0dd6291d14d54cfb55d0 | 147f33aa6305c01f8e708120da9abe540766f88b | refs/heads/master | 2021-05-16T07:29:39.322127 | 2017-09-17T09:33:59 | 2017-09-17T09:33:59 | 103,814,087 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,580 | java | package com.github.frajimiba.commonstruct.validation;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.ValidationException;
import com.github.frajimiba.commonstruct.specification.Specification;
/**
* Defines the logic to validate a constraint specification.
*
* @author Francisco José Jiménez
*
*/
public class SatisfiedByValidator implements ConstraintValidator<SatisfiedBy, Object> {
/**
* String to instantiate error.
*/
private static final String INSTANTIATE_ERROR = "Instantiate specification class error";
/**
* The Specification Class.
*/
private Specification<Object> specification;
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public void initialize(SatisfiedBy specification) {
Class<?> clazz = specification.value();
try {
this.specification = (Specification<Object>) clazz.newInstance();
} catch (InstantiationException e) {
throw new ValidationException(INSTANTIATE_ERROR, e);
} catch (IllegalAccessException e) {
throw new ValidationException(INSTANTIATE_ERROR, e);
}
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid(Object value, ConstraintValidatorContext context) {
boolean result = false;
if (value == null || (value instanceof String && ((String) value).length() == 0)) {
result = true;
} else {
result = this.specification.isSatisfiedBy(value);
}
return result;
}
}
| [
"curro@192.168.0.160"
] | curro@192.168.0.160 |
99f3c84b93b28f7c05ee790103ffaf134da38cff | efd3dad9a7c1caca2daf084215fee99702a4c575 | /Lending Project/src/main/java/org/ht/pojo/Employee.java | c1f0c9ece31f221fa3b8c2e62fcbf95f90666a27 | [] | no_license | Z4c-oops/NJM | e2fedacac2d3497776357c52ff1907f606345a33 | 6a80b38856a5b57890cece62a890575be77f0695 | refs/heads/master | 2021-05-27T05:29:00.509658 | 2020-04-08T23:32:46 | 2020-04-08T23:32:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,451 | java | package org.ht.pojo;
import java.util.Date;
public class Employee extends BaseDomain {
private Integer eid;
private String ename;
private String esex;
private Date ebirth;
private String eidcard;
private String ephone;
private String email;
private Integer edeptno;
private String epostno;
private Date etime;
private String epassword;
private Integer estatus;
public Employee() {
super();
}
public Employee(Integer eid, String ename, String esex, Date ebirth, String eidcard, String ephone, String email,
Integer edeptno, String epostno, Date etime, String epassword, Integer estatus) {
this.eid = eid;
this.ename = ename;
this.esex = esex;
this.ebirth = ebirth;
this.eidcard = eidcard;
this.ephone = ephone;
this.email = email;
this.edeptno = edeptno;
this.epostno = epostno;
this.etime = etime;
this.epassword = epassword;
this.estatus = estatus;
}
public String getEpassword() {
return epassword;
}
public void setEpassword(String epassword) {
this.epassword = epassword;
}
public Integer getEid() {
return eid;
}
public void setEid(Integer eid) {
this.eid = eid;
}
public String getEname() {
return ename;
}
public void setEname(String ename) {
this.ename = ename;
}
public String getEsex() {
return esex;
}
public void setEsex(String esex) {
this.esex = esex;
}
public Date getEbirth() {
return ebirth;
}
public void setEbirth(Date ebirth) {
this.ebirth = ebirth;
}
public String getEidcard() {
return eidcard;
}
public void setEidcard(String eidcard) {
this.eidcard = eidcard;
}
public String getEphone() {
return ephone;
}
public void setEphone(String ephone) {
this.ephone = ephone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getEdeptno() {
return edeptno;
}
public void setEdeptno(Integer edeptno) {
this.edeptno = edeptno;
}
public String getEpostno() {
return epostno;
}
public void setEpostno(String epostno) {
this.epostno = epostno;
}
public Date getEtime() {
return etime;
}
public void setEtime(Date etime) {
this.etime = etime;
}
public Integer getEstatus() {
return estatus;
}
public void setEstatus(Integer estatus) {
this.estatus = estatus;
}
}
| [
"zhang.xinch@husky.neu.edu"
] | zhang.xinch@husky.neu.edu |
fe7ac17055f807669c4529e880da037eaf89b2e3 | a770e95028afb71f3b161d43648c347642819740 | /sources/org/telegram/ui/PasscodeActivity$$ExternalSyntheticLambda1.java | 9edc0b001ec0cd4c219b170c05ac0d6a935e969f | [] | no_license | Edicksonjga/TGDecompiledBeta | d7aa48a2b39bbaefd4752299620ff7b72b515c83 | d1db6a445d5bed43c1dc8213fb8dbefd96f6c51b | refs/heads/master | 2023-08-25T04:12:15.592281 | 2021-10-28T20:24:07 | 2021-10-28T20:24:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package org.telegram.ui;
import android.view.View;
public final /* synthetic */ class PasscodeActivity$$ExternalSyntheticLambda1 implements View.OnClickListener {
public final /* synthetic */ PasscodeActivity f$0;
public /* synthetic */ PasscodeActivity$$ExternalSyntheticLambda1(PasscodeActivity passcodeActivity) {
this.f$0 = passcodeActivity;
}
public final void onClick(View view) {
this.f$0.lambda$createView$1(view);
}
}
| [
"fabian_pastor@msn.com"
] | fabian_pastor@msn.com |
c8cfad6e10e5fc581394998318f930a3de0794a3 | d68f727c7257fd17d2cea7f730945fd979fd0dfc | /Factorial.java | 10ffe76f9b420a047370ed45c83a87338fd4ab09 | [] | no_license | Jothika58/DSA_Java | cfeea450d78d9162dd6bee28e2bffabf41225f88 | 45b677f5e592b5d82e63acf21f41fa77873f29a1 | refs/heads/master | 2023-07-03T23:14:13.305921 | 2021-08-05T17:14:33 | 2021-08-05T17:14:33 | 393,081,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | import java.util.Scanner;
class Factorial{
public static void main(String args[]) {
int fact=1,i;
System.out.println("Enter a number : ");
Scanner SC = new Scanner(System.in);
int num = SC.nextInt();
for(i=1;i<=num;i++){
fact=fact*i;
}
System.out.println("Factorial :"+fact);
}
} | [
"jothika5814@gmail.com"
] | jothika5814@gmail.com |
995fe65dcd0b2447ba129a30411b71f44a6178d2 | 74ba0c23175f487a1f1770c74f82fe89cb47c3cf | /wowcars-logic/src/main/java/co/edu/uniandes/csw/wowcars/api/ICategoryLogic.java | c9849d283b472d21d528e4c96715bfd9a16fff27 | [
"MIT"
] | permissive | Uniandes-MISO4203-backup/wowCars-201820 | 224ac3176761cf124f329f3846782a4cd63fb83d | 92477e3deb5a319a26848ce21e98ce1d1f1d12d5 | refs/heads/master | 2020-03-22T04:26:03.230104 | 2018-07-02T22:48:25 | 2018-07-02T22:48:25 | 139,498,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,638 | java | /*
The MIT License (MIT)
Copyright (c) 2015 Los Andes University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package co.edu.uniandes.csw.wowcars.api;
import co.edu.uniandes.csw.wowcars.entities.CategoryEntity;
import java.util.List;
public interface ICategoryLogic {
public int countCategorys();
public List<CategoryEntity> getCategorys();
public List<CategoryEntity> getCategorys(Integer page, Integer maxRecords);
public CategoryEntity getCategory(Long id);
public CategoryEntity createCategory(CategoryEntity entity);
public CategoryEntity updateCategory(CategoryEntity entity);
public void deleteCategory(Long id);
}
| [
"a.quintero10@uniandes.edu.co"
] | a.quintero10@uniandes.edu.co |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.